From b17de51914b4ec16015a874a794460dc001e54db Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Sat, 6 May 2023 04:00:40 +0000 Subject: [PATCH 1/2] feat: Log Analytics features of the Cloud Logging API feat: Add ConfigServiceV2.CreateBucketAsync method for creating Log Buckets asynchronously feat: Add ConfigServiceV2.UpdateBucketAsync method for creating Log Buckets asynchronously feat: Add ConfigServiceV2.CreateLink method for creating linked datasets for Log Analytics Buckets feat: Add ConfigServiceV2.DeleteLink method for deleting linked datasets feat: Add ConfigServiceV2.ListLinks method for listing linked datasets feat: Add ConfigServiceV2.GetLink methods for describing linked datasets feat: Add LogBucket.analytics_enabled field that specifies whether Log Bucket's Analytics features are enabled feat: Add LogBucket.index_configs field that contains a list of Log Bucket's indexed fields and related configuration data docs: Documentation for the Log Analytics features of the Cloud Logging API PiperOrigin-RevId: 529851525 Source-Link: https://github.com/googleapis/googleapis/commit/1c7ee99d19adf8e444e2d73c5dd52884eab9862d Source-Link: https://github.com/googleapis/googleapis-gen/commit/4a2a3a05b91804333a1b39b635d8fe2243d4b4fd Copy-Tag: eyJwIjoiTG9nZ2luZy8uT3dsQm90LnlhbWwiLCJoIjoiNGEyYTNhMDViOTE4MDQzMzNhMWIzOWI2MzVkOGZlMjI0M2Q0YjRmZCJ9 --- .../Google/Logging/V2/LogEntry.php | Bin 0 -> 2774 bytes .../GPBMetadata/Google/Logging/V2/Logging.php | Bin 0 -> 5213 bytes .../Google/Logging/V2/LoggingConfig.php | Bin 0 -> 22653 bytes .../Google/Logging/V2/LoggingMetrics.php | Bin 0 -> 3931 bytes .../Cloud/Logging/V2/BigQueryDataset.php | 87 + .../Cloud/Logging/V2/BigQueryOptions.php | 149 + .../Cloud/Logging/V2/BucketMetadata.php | 230 + .../Google/Cloud/Logging/V2/CmekSettings.php | 320 ++ .../Logging/V2/ConfigServiceV2GrpcClient.php | 602 +++ .../Logging/V2/CopyLogEntriesMetadata.php | 317 ++ .../Logging/V2/CopyLogEntriesRequest.php | 147 + .../Logging/V2/CopyLogEntriesResponse.php | 67 + .../Cloud/Logging/V2/CreateBucketRequest.php | 173 + .../Logging/V2/CreateExclusionRequest.php | 143 + .../Cloud/Logging/V2/CreateLinkRequest.php | 169 + .../Logging/V2/CreateLogMetricRequest.php | 123 + .../Cloud/Logging/V2/CreateSinkRequest.php | 217 + .../Cloud/Logging/V2/CreateViewRequest.php | 165 + .../Cloud/Logging/V2/DeleteBucketRequest.php | 91 + .../Logging/V2/DeleteExclusionRequest.php | 91 + .../Cloud/Logging/V2/DeleteLinkRequest.php | 83 + .../Logging/V2/DeleteLogMetricRequest.php | 71 + .../Cloud/Logging/V2/DeleteLogRequest.php | 103 + .../Cloud/Logging/V2/DeleteSinkRequest.php | 95 + .../Cloud/Logging/V2/DeleteViewRequest.php | 79 + .../Cloud/Logging/V2/GetBucketRequest.php | 91 + .../Logging/V2/GetCmekSettingsRequest.php | 111 + .../Cloud/Logging/V2/GetExclusionRequest.php | 91 + .../Cloud/Logging/V2/GetLinkRequest.php | 83 + .../Cloud/Logging/V2/GetLogMetricRequest.php | 71 + .../Cloud/Logging/V2/GetSettingsRequest.php | 111 + .../Cloud/Logging/V2/GetSinkRequest.php | 91 + .../Cloud/Logging/V2/GetViewRequest.php | 79 + .../Google/Cloud/Logging/V2/IndexConfig.php | 173 + .../src/Google/Cloud/Logging/V2/IndexType.php | 62 + .../Cloud/Logging/V2/LifecycleState.php | 86 + .../src/Google/Cloud/Logging/V2/Link.php | 271 ++ .../Google/Cloud/Logging/V2/LinkMetadata.php | 230 + .../Cloud/Logging/V2/ListBucketsRequest.php | 183 + .../Cloud/Logging/V2/ListBucketsResponse.php | 109 + .../Logging/V2/ListExclusionsRequest.php | 171 + .../Logging/V2/ListExclusionsResponse.php | 109 + .../Cloud/Logging/V2/ListLinksRequest.php | 159 + .../Cloud/Logging/V2/ListLinksResponse.php | 109 + .../Logging/V2/ListLogEntriesRequest.php | 311 ++ .../Logging/V2/ListLogEntriesResponse.php | 141 + .../Logging/V2/ListLogMetricsRequest.php | 159 + .../Logging/V2/ListLogMetricsResponse.php | 109 + .../Cloud/Logging/V2/ListLogsRequest.php | 245 ++ .../Cloud/Logging/V2/ListLogsResponse.php | 117 + ...istMonitoredResourceDescriptorsRequest.php | 121 + ...stMonitoredResourceDescriptorsResponse.php | 109 + .../Cloud/Logging/V2/ListSinksRequest.php | 171 + .../Cloud/Logging/V2/ListSinksResponse.php | 109 + .../Cloud/Logging/V2/ListViewsRequest.php | 159 + .../Cloud/Logging/V2/ListViewsResponse.php | 109 + .../Cloud/Logging/V2/LocationMetadata.php | 71 + .../src/Google/Cloud/Logging/V2/LogBucket.php | 525 +++ .../src/Google/Cloud/Logging/V2/LogEntry.php | 1061 +++++ .../Cloud/Logging/V2/LogEntryOperation.php | 182 + .../Logging/V2/LogEntrySourceLocation.php | 164 + .../Google/Cloud/Logging/V2/LogExclusion.php | 321 ++ .../src/Google/Cloud/Logging/V2/LogMetric.php | 767 ++++ .../Cloud/Logging/V2/LogMetric/ApiVersion.php | 57 + .../Cloud/Logging/V2/LogMetric_ApiVersion.php | 16 + .../src/Google/Cloud/Logging/V2/LogSink.php | 686 +++ .../Logging/V2/LogSink/VersionFormat.php | 64 + .../Logging/V2/LogSink_VersionFormat.php | 16 + .../src/Google/Cloud/Logging/V2/LogSplit.php | 153 + .../src/Google/Cloud/Logging/V2/LogView.php | 267 ++ .../Logging/V2/LoggingServiceV2GrpcClient.php | 136 + .../Logging/V2/MetricsServiceV2GrpcClient.php | 110 + .../Cloud/Logging/V2/OperationState.php | 93 + .../src/Google/Cloud/Logging/V2/Settings.php | 324 ++ .../Logging/V2/TailLogEntriesRequest.php | 209 + .../Logging/V2/TailLogEntriesResponse.php | 125 + .../SuppressionInfo.php | 104 + .../SuppressionInfo/Reason.php | 68 + ...TailLogEntriesResponse_SuppressionInfo.php | 16 + ...EntriesResponse_SuppressionInfo_Reason.php | 16 + .../Logging/V2/UndeleteBucketRequest.php | 91 + .../Cloud/Logging/V2/UpdateBucketRequest.php | 199 + .../Logging/V2/UpdateCmekSettingsRequest.php | 223 + .../Logging/V2/UpdateExclusionRequest.php | 207 + .../Logging/V2/UpdateLogMetricRequest.php | 127 + .../Logging/V2/UpdateSettingsRequest.php | 211 + .../Cloud/Logging/V2/UpdateSinkRequest.php | 297 ++ .../Cloud/Logging/V2/UpdateViewRequest.php | 187 + .../V2/WriteLogEntriesPartialErrors.php | 83 + .../Logging/V2/WriteLogEntriesRequest.php | 439 ++ .../Logging/V2/WriteLogEntriesResponse.php | 33 + .../copy_log_entries.php | 83 + .../ConfigServiceV2Client/create_bucket.php | 80 + .../create_bucket_async.php | 93 + .../create_exclusion.php | 102 + .../V2/ConfigServiceV2Client/create_link.php | 92 + .../V2/ConfigServiceV2Client/create_sink.php | 106 + .../V2/ConfigServiceV2Client/create_view.php | 79 + .../ConfigServiceV2Client/delete_bucket.php | 77 + .../delete_exclusion.php | 73 + .../V2/ConfigServiceV2Client/delete_link.php | 81 + .../V2/ConfigServiceV2Client/delete_sink.php | 75 + .../V2/ConfigServiceV2Client/delete_view.php | 78 + .../V2/ConfigServiceV2Client/get_bucket.php | 75 + .../get_cmek_settings.php | 62 + .../ConfigServiceV2Client/get_exclusion.php | 75 + .../V2/ConfigServiceV2Client/get_link.php | 71 + .../V2/ConfigServiceV2Client/get_settings.php | 89 + .../V2/ConfigServiceV2Client/get_sink.php | 75 + .../V2/ConfigServiceV2Client/get_view.php | 77 + .../V2/ConfigServiceV2Client/list_buckets.php | 80 + .../ConfigServiceV2Client/list_exclusions.php | 76 + .../V2/ConfigServiceV2Client/list_links.php | 76 + .../V2/ConfigServiceV2Client/list_sinks.php | 76 + .../V2/ConfigServiceV2Client/list_views.php | 72 + .../ConfigServiceV2Client/undelete_bucket.php | 74 + .../ConfigServiceV2Client/update_bucket.php | 85 + .../update_bucket_async.php | 97 + .../update_cmek_settings.php | 67 + .../update_exclusion.php | 102 + .../ConfigServiceV2Client/update_settings.php | 93 + .../V2/ConfigServiceV2Client/update_sink.php | 107 + .../V2/ConfigServiceV2Client/update_view.php | 78 + .../V2/LoggingServiceV2Client/delete_log.php | 79 + .../list_log_entries.php | 93 + .../V2/LoggingServiceV2Client/list_logs.php | 76 + .../list_monitored_resource_descriptors.php | 58 + .../tail_log_entries.php | 90 + .../write_log_entries.php | 102 + .../create_log_metric.php | 100 + .../delete_log_metric.php | 66 + .../MetricsServiceV2Client/get_log_metric.php | 68 + .../list_log_metrics.php | 73 + .../update_log_metric.php | 102 + .../v2/src/V2/ConfigServiceV2Client.php | 34 + .../V2/Gapic/ConfigServiceV2GapicClient.php | 3686 +++++++++++++++++ .../V2/Gapic/LoggingServiceV2GapicClient.php | 993 +++++ .../V2/Gapic/MetricsServiceV2GapicClient.php | 525 +++ .../v2/src/V2/LoggingServiceV2Client.php | 34 + .../v2/src/V2/MetricsServiceV2Client.php | 34 + .../Logging/v2/src/V2/gapic_metadata.json | 251 ++ .../config_service_v2_client_config.json | 206 + .../config_service_v2_descriptor_config.php | 108 + .../config_service_v2_rest_client_config.php | 1147 +++++ .../logging_service_v2_client_config.json | 83 + .../logging_service_v2_descriptor_config.php | 43 + .../logging_service_v2_rest_client_config.php | 191 + .../metrics_service_v2_client_config.json | 71 + .../metrics_service_v2_descriptor_config.php | 18 + .../metrics_service_v2_rest_client_config.php | 160 + .../Unit/V2/ConfigServiceV2ClientTest.php | 2555 ++++++++++++ .../Unit/V2/LoggingServiceV2ClientTest.php | 481 +++ .../Unit/V2/MetricsServiceV2ClientTest.php | 422 ++ 153 files changed, 29995 insertions(+) create mode 100644 owl-bot-staging/Logging/v2/proto/src/GPBMetadata/Google/Logging/V2/LogEntry.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/GPBMetadata/Google/Logging/V2/Logging.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/GPBMetadata/Google/Logging/V2/LoggingConfig.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/GPBMetadata/Google/Logging/V2/LoggingMetrics.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/BigQueryDataset.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/BigQueryOptions.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/BucketMetadata.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CmekSettings.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ConfigServiceV2GrpcClient.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesMetadata.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesResponse.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateBucketRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateExclusionRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateLinkRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateLogMetricRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateSinkRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateViewRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteBucketRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteExclusionRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLinkRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLogMetricRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLogRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteSinkRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteViewRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetBucketRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetCmekSettingsRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetExclusionRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetLinkRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetLogMetricRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetSettingsRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetSinkRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetViewRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/IndexConfig.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/IndexType.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LifecycleState.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/Link.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LinkMetadata.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListBucketsRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListBucketsResponse.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListExclusionsRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListExclusionsResponse.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLinksRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLinksResponse.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogEntriesRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogEntriesResponse.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogMetricsRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogMetricsResponse.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogsRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogsResponse.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListMonitoredResourceDescriptorsRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListMonitoredResourceDescriptorsResponse.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListSinksRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListSinksResponse.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListViewsRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListViewsResponse.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LocationMetadata.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogBucket.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntry.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntryOperation.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntrySourceLocation.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogExclusion.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric/ApiVersion.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric_ApiVersion.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogSink.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogSink/VersionFormat.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogSink_VersionFormat.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogSplit.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogView.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LoggingServiceV2GrpcClient.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/MetricsServiceV2GrpcClient.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/OperationState.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/Settings.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse/SuppressionInfo.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse/SuppressionInfo/Reason.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse_SuppressionInfo.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse_SuppressionInfo_Reason.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UndeleteBucketRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateBucketRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateCmekSettingsRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateExclusionRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateLogMetricRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateSettingsRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateSinkRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateViewRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesPartialErrors.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesRequest.php create mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesResponse.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/copy_log_entries.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_bucket.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_bucket_async.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_exclusion.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_link.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_sink.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_view.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_bucket.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_exclusion.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_link.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_sink.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_view.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_bucket.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_cmek_settings.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_exclusion.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_link.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_settings.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_sink.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_view.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_buckets.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_exclusions.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_links.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_sinks.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_views.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/undelete_bucket.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_bucket.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_bucket_async.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_cmek_settings.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_exclusion.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_settings.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_sink.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_view.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/delete_log.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_log_entries.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_logs.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_monitored_resource_descriptors.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/tail_log_entries.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/write_log_entries.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/create_log_metric.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/delete_log_metric.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/get_log_metric.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/list_log_metrics.php create mode 100644 owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/update_log_metric.php create mode 100644 owl-bot-staging/Logging/v2/src/V2/ConfigServiceV2Client.php create mode 100644 owl-bot-staging/Logging/v2/src/V2/Gapic/ConfigServiceV2GapicClient.php create mode 100644 owl-bot-staging/Logging/v2/src/V2/Gapic/LoggingServiceV2GapicClient.php create mode 100644 owl-bot-staging/Logging/v2/src/V2/Gapic/MetricsServiceV2GapicClient.php create mode 100644 owl-bot-staging/Logging/v2/src/V2/LoggingServiceV2Client.php create mode 100644 owl-bot-staging/Logging/v2/src/V2/MetricsServiceV2Client.php create mode 100644 owl-bot-staging/Logging/v2/src/V2/gapic_metadata.json create mode 100644 owl-bot-staging/Logging/v2/src/V2/resources/config_service_v2_client_config.json create mode 100644 owl-bot-staging/Logging/v2/src/V2/resources/config_service_v2_descriptor_config.php create mode 100644 owl-bot-staging/Logging/v2/src/V2/resources/config_service_v2_rest_client_config.php create mode 100644 owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_client_config.json create mode 100644 owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_descriptor_config.php create mode 100644 owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_rest_client_config.php create mode 100644 owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_client_config.json create mode 100644 owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_descriptor_config.php create mode 100644 owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_rest_client_config.php create mode 100644 owl-bot-staging/Logging/v2/tests/Unit/V2/ConfigServiceV2ClientTest.php create mode 100644 owl-bot-staging/Logging/v2/tests/Unit/V2/LoggingServiceV2ClientTest.php create mode 100644 owl-bot-staging/Logging/v2/tests/Unit/V2/MetricsServiceV2ClientTest.php diff --git a/owl-bot-staging/Logging/v2/proto/src/GPBMetadata/Google/Logging/V2/LogEntry.php b/owl-bot-staging/Logging/v2/proto/src/GPBMetadata/Google/Logging/V2/LogEntry.php new file mode 100644 index 0000000000000000000000000000000000000000..91b3c95544578e31041115590b6f8e6fc50c8083 GIT binary patch literal 2774 zcmbVOQBNC35U%Y2_5wwm2wY9mZU7aK!dY@#wK|}cT@n(B6ci{A)k)U*Zf!PQZm)ZL zR-A~Z{+qt`sSo`F{STG;oL|t#&hFkF29p%ZgV~#%Z)SGBncdm>Ha?5dD&8j%5xyiL z?hdg$BRCdZ@_;kkO?y2eaKO)F%7}0<-aEwKAD-aHd(TcD0yN>N2#AaOoc9@NFy8Oe zsNWbg)v`k(DTa==hEU|6lO*;7g7=Tw&x!OyU;5s@26_hu=$$sV5ek@}Bp5`G6&}4o z82;k4%V>ZT=}Y*xMw1SWsH8rluOaYV-1AvN06ebSOQS$i9$^JIi~_Q;iH%LAyB2de z=q}D9IZ|hbb9>JsNkrr`Z;vE_pt0oQ2vl9SPh^oXCE3`_+$wXlhc`@&t~(awE|wxC zquwzVM5ZFz)^RHX7sblEAy2KCdQT`}VVj)!1ImT#UY_dG$h)A=Ii!FK622fAb9aK@ z9hLKXGK`7$RLb}T`8g$tynWbLEWpPx84y9`@b(r8MqAPUK^+5U!5soF+?`M;ci78&9+h0fvSpi^w%tU_@7;7%^MYmnSOEx&H8GF@?+XK&-w3& ztN=`R);}6iy0-P%HLnt=Y@7j=U_*16nYd98;^-t9W7k~iYXKUq;YZmWQU5q|Rcs|X z_Zjfh>$@^fuu)j~rHZOhA^O&^?xU)5u5KNB2A4K!?aJS+vh@Y3=I67kAf9eMaEx6C z66B0Eh(T?kSsha+_J@r7p_CY<{lHp8Gm^ZLg?2^x2YCa{yi9mh$S1Xx zr75W3w2L}Zv6d_s%?lC`Iv|}(tbH47#rg_WbGB>*kPn+Ucb8X` zqThim=Y43LE}|NZ5+Y=WhW0%`>U5W^Z8S4lD)y9)<7T5H*Ml*-gC?2ZB`mS0aRr$2 z)~^RMXsS>&;m(0p)$1Hy<==ygUy`xDr!8Y}x~&Rnz|#sd?{l8$8aJ&_#iNA(~B7()#-k;IHjdsV}i zZ-yT$6%D9wq3Mx~SktKT6B*hi6}B~tCI&uBi7w-sTmHJ_{!x0{`n`neInAagpd}Iq zUjGJU*?Is~{*nYTX}rl+7wVOVPx!sCymc=6enemEV}f+_^NQwjkF$^nP%(=un~%Db zF_qU>ZYiKHK&Xq2jhj?`*6r@^ns0_5}^P7yq1p&th(|`z* z2O|dFdsHOSR!y6+IFIhZNFsG%8_~)SXfgM3l`adEdvJe`x>9%=nRHhQ@A+J!J(+%4 z+0i$crcqIr<{>M}XcUrHI@Aek0d5#Beb&)Mk!TYW?cYl1KCm@j8|~RV*dsOG9F>0j zGGIInb4^8YpDQ-?_y)9_2~K^*-R(>scmFAsel0KU>zU2@PFn!OO3OKI{+aK1p5F3` xsSd`vx8=Hlxvt)H-3;iur_JspFd_Np>&2V*$V^HjgVj5SDy?Zop9^$>(7#`Fd20Xw literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Logging/v2/proto/src/GPBMetadata/Google/Logging/V2/Logging.php b/owl-bot-staging/Logging/v2/proto/src/GPBMetadata/Google/Logging/V2/Logging.php new file mode 100644 index 0000000000000000000000000000000000000000..9f6596d970d8a7f887f278e5379b55d98e5d02ee GIT binary patch literal 5213 zcmbVQ&2Jmk7JuW=klfHVy^xPOrA(YwajkR==2e18L!XnlB`9s8BowJK8jZ)-&d|xs zy!l87C=z19f~U9QPe3dlEA%8-!vYDhgk3kVKuEA+iCA&&*LZAC+@#q!y65Bm&N;tx z&z*bomcQ$xIrR>4Nnl2#sWuMPXqTvd;6j z*LG&XH1y)YBD&i4ytYHij@NG6Zo9l+k^gGU7ecPNM?&AUh$YOo zifqqSslkS8k>WL#`=q*8d=H{rQYDa08aM=9Uvnc8xTaHIC7~7Ae&hw4psMR_5+&)P zE5&PKTk6hksYQ-a*ZV*&sZkJ<^zNz}kSGq^MTVO?I7+x4pJdNd238|r!| zrjCo_3|AbRxY6lsZrj9ZE|Xnz-}Zvjncnpv-(EnPTSRc=RA^6c)!`7OQ_YQn!;>RU z>b@F7BS3PWz!VBr+w-GS?7HP!^=&9-d`u}BJFmZH3ocfh&4hZlp&g3}Stxbp(bp<^ z;W2%PFK`9T;T@;#SMpQB#`Nv7#Yn&FyhoOfTqEru)Zu**eL>yS#F8~3HeN~oX`>op^Pl>tuk%PIOKxD>u7wHI3yy# zlr8e_n1m7jCmI1920f>y6;&yYE*E~T=KiW)LV1}iz89n;)Zj!cgK^>49GZM9u$d>y zIh%w79V(A;NMXnGQwstw2=Uu!9P+?>a=Yv|dG<#a@6@N7Dwu?m*^ z0yQ;p1kfnIP|(D>9Y(@micLB?Cwaj*8cvTu1PMv;0FvTo(QwOlV4(4Q@~TXr5ie+x zz-Sx-X(-eF`DA9(fOm%c{!_3I>|&Ma=7h7dk}Z*&akB zJcZ7?UTzS(sNztX%}arXMR~&g^v|fe7tiJPz^no)S#K% z3qrxA`n)V^W}|k{9v|xe6?9%CGYP4JhM~8hBfC$ffdwBx7J2{;wCzeE%~WOzJB%s3 zhQ>RXMW!yGQQC3r(#MXZ(c^>u064#6+D<>`XZko#dBk{^%O>>=be3OPjRV_ldIyZz zW0i}tGIES)a?W!W`~;_XFN7x|@irO{W8Vjsgm8&~OKQu5o}(wts}cg_gqxdVHphzok@hZ zYSrzHd&Zmhwl`}lYq!^GtKyKsx8ZL)BI!W3g) zKcE*HT`4`PsxprY^59$G_lyOhi$7J+Inn-f8p6cF#f<&CRV31^pn5e0(3=eCL}5G) z)Pb?Ua9)=1_>r@~$K8S)aQIsVsnqeH8G`j=a1Sz)kt{xut%$A2Vk=-q-934c-V*od z&fo~~f1W}kB0(W89JA*-@Lb}`YAWdfHsBYiFNYX_&xY^>V=JFGOVAcatZ5!x#+TB9 zPEQH>9G*?fdpbraJ&$M7N=df}@l`yR7WXxZP`iosv|0xWAhnVnZN%0?!kT{HCI__Z zc_3AMD{b8a^h7Qe@vCVUNf;+GUcuG0abJ)paq_4tE(G`^=)LY4lG%IRDv}vlz1OQL z_%V~!dl8Im=)I!yqLTk_?)&PbJeaz_l76WEq3lMHAL`}u!NGx`Z1N3d#?dZ(b$W60 zy6>1#%M11vPN%NH9Bf|qT<7qyh7zIK+_T*iYg7LxR%S=%GTh@P;0v+8KbN0@=A`3) zlRh+UDi3b3*rg)#I7D<1!4Z012MIH@`06`x}P&8OHDBuD?lI;sZf%Zp%v~K&OXpj~u zTJ+rK+!@Y`w1H-StSR1e&fNQ*=RNmwZol4m&_JhCcZ{0REZfFebX*Yh%M`rYiNVhFLY5ld077LTY|tB~_T7T{#7;R=w4%7G-UQKP3tCj&0+G#ghwTf-lYbnC8 zP^%ah##2ltp*_>6!;)W3iRmm76aazM*_v%MYvtv9#Hpy30cC%%uPfw+qhTUq`Zqa!Y0Xy>3st;JXhPj%n)#?O=dd<>x zXHAZXAjW*vG-`HdJTs|y;5_=- zR}<)5JQu?U8Qmmz#mPt6u_K(d+%Pj0s(I#)V<(k?4Wi!C8rLr;II0jdxf1!%X+BhS zG?l4KO>v@QoQQfqxKhR-y5NH%Xvje}g)KmwQ;7LV3R}R+2(-^8(7ufN>8VM0=}snDzQ-Km6T?Uq=V3=7v$( zu2hW@31i0Sei#_co)Q>11~xe-D3=K#g#sT%2g?vMw;@JbC8JhetAgx7DjSBtnCzxm zft*vK3bRHJqc@7K{wl`Z38$uevkLWVVZ2p%+$ zJ?X=i2fAfWroW$jmitl?rNmm8S%9BdlaTW=jw)|}#(&wU*jDBV|Fi=cuEN4n=85>Y zlUbvx2Qv0y2T#?To8_AMNkOXq8CS;jje2$6Xo6JsAuivYHM3d;JaUyvy;UQV=UnHrQV)y{ z(dgjk=3uP_LB}}XLc{fz-DugRN8m~%{B6{mTV;E6FGwHEUhs((AcU-T@;+mjq4ZP9 z(FA@O9eCU{!RkupItixs_Gq7&dk;R2hRhmFa@{CZ9+=hjrcq;ImCYoNhSto@UuhZ5 z?NYr#D;pYI2eO*aB&N*Gj}g)ZMoC4y`4Ml@cnO{!ouIr)gT&)#F70*nk_!UR_1OKw z((>%Wd}(H3>27YNbZ>rnv5=pgnJr8YeFX1C$@|%%1pW8&P*VTX#IxLY5@AkBt?HzY zQ(B+^a4hoA4jxzitIge9q{rJF$u&F~?IJ4uR6p9sRi&lT0ily=*u6l`A$14Y$iPRi z2PNNYf6$A1=ZM3EMom(cw3PwzN)Eq7O$vzkiTbu;jeHTKte6P1M!s_WFCpCiAc>9z zg>4$#<48G5u&Av|YVHmg{zB?F?8WkZzR3(tYT z#%=im4dWV)E|kC%8s$x>N$U?G=uyLFL2m^0(*X;1>2v~n==a($qC>6;SPcm52EK&$ z@lpz=KuSQrnjPXZn>aY&ftvA-4a;;tTl=j9I+Uk{JfnR66~aQ;%!sSY1t#%jw3mHP zR~Ip1vi79*hcLN&w1#(2?z&oHO>yvJRH@Ds$h_iAK}iT?-!&Sv_n0BOL$ViU6aNJ? zbjRREBM|L!(%M~gXxga4p5%pKpe>-`d$5CeaRNVqhKPZZs!{p})G{vrpnJ@YP5GYNE%nX&r3w%upkNJnz3?bjIa?D1vElu%j%j=r$E@h9a7 zuWUU{(wOZ|Pm`2v^_6%4+f91H<7wmS{|ejHe@dX!B3`t&1)T+t`|Mer4n^jP{Jev& zgzjD?A#8Z$=N-IyzHK8bN8OY+qPMjEoZ7nyG)yXyg6Nn?1Ha|**^AU?&*E6nbZqDw zXv8}WZtYiGZ69XxQEi`K(_ch~phS?X6#?p|D=6@##QLJELctKr(9JcOLR_Dqnox^XeP8jNuvF#toB&lgAb$q54Wt+Lt~p2 zaWq&%xAU<0R`gD3iATb7KR$`DWi%g|6+;{=xH52${$~(QzZ)D*U32nl0albFn}`;m zi?qE3=o*gE0#xa>w-5%y5obq2x7S=jWA!`@kf+eefZQS2wJ$)-Wfmj85)yr^C5!r? zx5$pRn4ui=sf2`}=P{BWB~hP{<7Xg8{S1UWFhQzlVkM!rKw9G#+@BzA8gXbwn-2Uu z;1oK{yZ)thW24-v+9g^elXTAt0sWg`P2WgF0*sIOBxV63J{y{fCE3xo+$)FD(b-ne zYHy?Ae7&(v3Z)txdm1vm`luSV>HIuP)lk&Jt-!exd~A53u*PL(ZsoU@1Ie(zq6o)2oe7caP+ z!di|gGzv}&XVp|i&^T?F&|{@1r%+@kF7%KHI>@?IKer&?LBkbxZ-F%<17OLfpvU`8qGJn- zg{9mIIka0|$*mMTXLiTYQ7^%A{>{Sly*W72OW=!W^}KidU@6Ilh zBf;gNBtC|Yc!`(p&Cdhz5IG)gf6~2tzEGHkC-venG~(r*$<2~k?D1pG=jQW;IWoLA z{R9oV@1j6)a%^sPrjUO-KUeTwHbQ%I`IXuG1z6)@G&Eh9D*!Z0g^%4UEU$pjBpluK z-CLXn;OOMxul!Ph{nd+sTg)weAN9*iL}U@O^V5Y-lvdte^ddcs4k}~ID@#Oj0vdQ& z`FeJKrEsUPG?dJ~_cl7f?lGV6X8|6LLdkgXDPHVdEiu}x*1$H_52uXT~JP^kS+ z;?p1g1pnmdXI6CDNiOJqE$852WwTO5{}ZLR;j^xbgGz`&WaR&tx{fp zokoceTBRaFbQ&c`XqC$G)oGLjp;am&RHqS=BDDG+q&=XVl*e|{@W}T?=B2-p)MBL) z>6zEGPEv|w)7`-!M01V@h+uG4>mbF*C*Ib&NHu~R6Vz2N@kL!F5N;F`^(;f38c&E9 z2?(xb8S0ci+H(Y(o@F7JvV~x-TBzW?nq{a{-bfD-T(`3fb;=dnD>ygF@B3NR%~QNz zN>T{~>LVg00XFRDfd0C`$?xe{co#3FJHfe_O?QlMaU$ITuEneAF7U+f_Mk!cZ42zT zX?K%EVfjrKF}{}6F41&GRUBfwEq>iYPo#@CwW|(KwEe2AuW2_O)|fV|^54*|IQ)@z zta84g-Euf%+p;17|1Z?5q>d+76)fL+RgMbu{WhWs5#I>BFQPY|pi}hU2q>J#Il&$yip!;h0_A8ZK-{@Cvq5`0X6 zFB@y3OYGe0(PYBpkcXQ;n@9$>3<7dW9|gF>CLpJ5u>f~?1>}@B0&s^*Ku)=00xr4n zXL=A~WeNq`&y1bnICy`XnfSMoT1O_X)2mFyTiokAGjz`UhSs&Ya|yb;_=wQK4ug^N zPHE3!`b-AZ2CGg2wc!kRq>U`o1~rnv;4jUBFX>iRiNUdbfHS|5W!mV%6SxFjElMJE z;hp+amT99aui)DF=OjX`Y6;YaGc2?bRMN;el})I1Wy`45#lUv;bq#=^ex3SuNaTI9XbYVK|)jj23D>oNB_o?Qg@0 z8xf=4%?+?TIzbeQ-|Iz)Wsg9#oZ&cVeZPlx41cp{EX=9|7Gn&HP}}0PnX%Xw#yQ5v zqV0^6ULK2YZDQ`(4(6Wic<$NwbI*1<_ubr>M4XzzM2j6mlB+Jexk2|J{#}{!0&Rq) zJTfe7Bq-&{sFMz}kK&nh40Ma*>DagyPp6|1EnZB=$I=ybz9UO!a>f`Eb(AB>sOI~R zJFc3^VW_3k+q|7u%_?(uRkJFg)2dnJ?Y3%GWbEb+@i0feoFM;$8&gknhsAFN=inRJ zZGR86$4r=f?W;X!SXg*Oll?Emwmx2MM`lR#ZD+NeWb2}~lf16Rl#`3afiB}Ulwi=uk}J#-g)aqvI)F9*lX1zMC;V&x$cXi=gztlY%H&i*|K_g?6Mqyv|q`FLnzBlhde z+y676v1*TN(qmt`a{<4Yac_?t_*7-93|BQ?14dh&$~LL7axlyQRr>21s|@4VqQbYE z8)6(2(nj!q1L$m16%M+GCN}85EkMsQ(5XSRnW-|#VutT!D5V3r+h$aTt71b#IYNzB zWt-%?8p;)5$144GzO|wB5hkth!TyGDIFPIR8~i@N&#Jj__&qcN{-BMG3=Vu_L+9Lv zy4={%;UK7;jSVFW#aC`@C}{wwa$`e@B9Iip;VS?X#L2wtrvW~>#X}>2@(ZV`EbY$& z!s$*%{Y`*OJ|4t8RH5P2L+c+-Jw)N*)J=?km_V4htGYrw;e%E?S!}?nw6(I~aclQf zboX1jiZ{YMHIx;94lY1~ZkPG5B784ED&t}qVLzMDzRh(0jRZbI+j~^0G#!YW{KXVL z;S4z*0$nUVks|yy&Y|!)he9TLxNgT#2v*PIvyPxPuW%@ZNBk7-{4)JXP<+qgX*WfX z#KPr^43|%3gJ99+uTvme$63C@FrHRau>WeP*RO5P63?lLcu9ra?Oc#W<}kdwFWZPsDi$KE3gt9M={+gQ8Bzi+Jl zS0eHCsQXp*ON}L*Vrm=y(Pa1GAllByrq=v&9pmc2ciE1uF*1< literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Logging/v2/proto/src/GPBMetadata/Google/Logging/V2/LoggingMetrics.php b/owl-bot-staging/Logging/v2/proto/src/GPBMetadata/Google/Logging/V2/LoggingMetrics.php new file mode 100644 index 0000000000000000000000000000000000000000..0867f06aa02d9aac26a229998b8a1d1ecb0247a1 GIT binary patch literal 3931 zcmb_f&u<$=6lR?!O(t!VPN{255mUEnoYJgY7f`iLsO%(-3Mq+72okbn*6XpebiKRm zjvYdk3lbNkUf{riKLCjXcMkjmJ;JRg4xD;IoDe78{912ZmpFhgUhVra-+b?TZ*~@M zhdUvb$Cl&o!5?@?wqZD!ZjM0jmo zhS#>sw-9nXJC2EZ1)e+$dWZ=8!fwNJ9TGE}!QUk}uDia=T-$R$gH0@vmhHt9QatP1 z>iQ0I1E27K4d0=~c_MRi-%DWtn_eOs&nD*qIH=wA8I63~tF6%3iQJF{(I&WBR-3Yf zJ^rRRua@QM+!iTHjF$Bb$R)y}E={jaNJLpT@^1;;Ji&hQR2#xpC3I^Q-w!wofgf8| ze^31s&kJ1kTEoX$q~htEtr2LWoV`m@Jm(8kRV?%n&B(I}sC!%mD)Oj^> zQzAoNXV9fG6V3CeF$_`N5GJ~cLZd}3qT@Xp#k_RKAmUWHHm4UFx^)IxH?dR8RXQsTFu5ANC8640LuKS}h5S@6%7ZFf8ygnh5O(Cb5$9 z4UqF+l?C*g;|1NO?xK$E+if_02T*LvrSUn0La^6a@PHmre-=#%Lk#DlXn=81+`>mF zI|wHZ;RvC40UcN90T35qqHoPauiO_QtUTj`s_TQx7q-xuHQL{=-tH2bmg!~Z$rdh( zJr@oqyYPj9vdco136nbW%>g1+Qhay?ucHZxNl4?69drINg)afe`$Ff>;P`Jl#Qy@! z2PnHjJ<90+jHUd;B$~Y^zq{U}QO|Ygb{T(Tpi>96gNwtOb(q@o^CNglAr`KE{>yJ) zXD;AZ`M2al*&|CyuU$!+>`6s65dO+QC(@e3$-GNRH|?OLlmADF7ZwGOBEBquq|}>2 zlXU!*{U?>Q!tu8Tni)_m9>&6e&uGwY3uyC&!#J{(z@Jo3N+PeyZQ$EN=c$=5Zyf z#dUBt|6KXq*kLS;tx{=scXx1d+g-K;Uu7`j7edcwtsv@LJ({}-W3agp_}<>3ff}LR z?705O-aP-v&byJzX!S=p=HPVHT&vpy0G!5VSJxCwOMvYfG&rOts`v3Af6pnY;|MEMc@P k6=+%8<;H{%$Bntgoogle.logging.v2.BigQueryDataset + */ +class BigQueryDataset extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The full resource name of the BigQuery dataset. The DATASET_ID + * will match the ID of the link, so the link must match the naming + * restrictions of BigQuery datasets (alphanumeric characters and underscores + * only). + * The dataset will have a resource path of + * "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]" + * + * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $dataset_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $dataset_id + * Output only. The full resource name of the BigQuery dataset. The DATASET_ID + * will match the ID of the link, so the link must match the naming + * restrictions of BigQuery datasets (alphanumeric characters and underscores + * only). + * The dataset will have a resource path of + * "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The full resource name of the BigQuery dataset. The DATASET_ID + * will match the ID of the link, so the link must match the naming + * restrictions of BigQuery datasets (alphanumeric characters and underscores + * only). + * The dataset will have a resource path of + * "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]" + * + * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDatasetId() + { + return $this->dataset_id; + } + + /** + * Output only. The full resource name of the BigQuery dataset. The DATASET_ID + * will match the ID of the link, so the link must match the naming + * restrictions of BigQuery datasets (alphanumeric characters and underscores + * only). + * The dataset will have a resource path of + * "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]" + * + * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDatasetId($var) + { + GPBUtil::checkString($var, True); + $this->dataset_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/BigQueryOptions.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/BigQueryOptions.php new file mode 100644 index 000000000000..54745c3ee82a --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/BigQueryOptions.php @@ -0,0 +1,149 @@ +google.logging.v2.BigQueryOptions + */ +class BigQueryOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Whether to use [BigQuery's partition + * tables](https://cloud.google.com/bigquery/docs/partitioned-tables). By + * default, Cloud Logging creates dated tables based on the log entries' + * timestamps, e.g. syslog_20170523. With partitioned tables the date suffix + * is no longer present and [special query + * syntax](https://cloud.google.com/bigquery/docs/querying-partitioned-tables) + * has to be used instead. In both cases, tables are sharded based on UTC + * timezone. + * + * Generated from protobuf field bool use_partitioned_tables = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $use_partitioned_tables = false; + /** + * Output only. True if new timestamp column based partitioning is in use, + * false if legacy ingestion-time partitioning is in use. + * All new sinks will have this field set true and will use timestamp column + * based partitioning. If use_partitioned_tables is false, this value has no + * meaning and will be false. Legacy sinks using partitioned tables will have + * this field set to false. + * + * Generated from protobuf field bool uses_timestamp_column_partitioning = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uses_timestamp_column_partitioning = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $use_partitioned_tables + * Optional. Whether to use [BigQuery's partition + * tables](https://cloud.google.com/bigquery/docs/partitioned-tables). By + * default, Cloud Logging creates dated tables based on the log entries' + * timestamps, e.g. syslog_20170523. With partitioned tables the date suffix + * is no longer present and [special query + * syntax](https://cloud.google.com/bigquery/docs/querying-partitioned-tables) + * has to be used instead. In both cases, tables are sharded based on UTC + * timezone. + * @type bool $uses_timestamp_column_partitioning + * Output only. True if new timestamp column based partitioning is in use, + * false if legacy ingestion-time partitioning is in use. + * All new sinks will have this field set true and will use timestamp column + * based partitioning. If use_partitioned_tables is false, this value has no + * meaning and will be false. Legacy sinks using partitioned tables will have + * this field set to false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Whether to use [BigQuery's partition + * tables](https://cloud.google.com/bigquery/docs/partitioned-tables). By + * default, Cloud Logging creates dated tables based on the log entries' + * timestamps, e.g. syslog_20170523. With partitioned tables the date suffix + * is no longer present and [special query + * syntax](https://cloud.google.com/bigquery/docs/querying-partitioned-tables) + * has to be used instead. In both cases, tables are sharded based on UTC + * timezone. + * + * Generated from protobuf field bool use_partitioned_tables = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getUsePartitionedTables() + { + return $this->use_partitioned_tables; + } + + /** + * Optional. Whether to use [BigQuery's partition + * tables](https://cloud.google.com/bigquery/docs/partitioned-tables). By + * default, Cloud Logging creates dated tables based on the log entries' + * timestamps, e.g. syslog_20170523. With partitioned tables the date suffix + * is no longer present and [special query + * syntax](https://cloud.google.com/bigquery/docs/querying-partitioned-tables) + * has to be used instead. In both cases, tables are sharded based on UTC + * timezone. + * + * Generated from protobuf field bool use_partitioned_tables = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setUsePartitionedTables($var) + { + GPBUtil::checkBool($var); + $this->use_partitioned_tables = $var; + + return $this; + } + + /** + * Output only. True if new timestamp column based partitioning is in use, + * false if legacy ingestion-time partitioning is in use. + * All new sinks will have this field set true and will use timestamp column + * based partitioning. If use_partitioned_tables is false, this value has no + * meaning and will be false. Legacy sinks using partitioned tables will have + * this field set to false. + * + * Generated from protobuf field bool uses_timestamp_column_partitioning = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getUsesTimestampColumnPartitioning() + { + return $this->uses_timestamp_column_partitioning; + } + + /** + * Output only. True if new timestamp column based partitioning is in use, + * false if legacy ingestion-time partitioning is in use. + * All new sinks will have this field set true and will use timestamp column + * based partitioning. If use_partitioned_tables is false, this value has no + * meaning and will be false. Legacy sinks using partitioned tables will have + * this field set to false. + * + * Generated from protobuf field bool uses_timestamp_column_partitioning = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setUsesTimestampColumnPartitioning($var) + { + GPBUtil::checkBool($var); + $this->uses_timestamp_column_partitioning = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/BucketMetadata.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/BucketMetadata.php new file mode 100644 index 000000000000..57713f08b32f --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/BucketMetadata.php @@ -0,0 +1,230 @@ +google.logging.v2.BucketMetadata + */ +class BucketMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The create time of an operation. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * The end time of an operation. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + /** + * State of an operation. + * + * Generated from protobuf field .google.logging.v2.OperationState state = 3; + */ + protected $state = 0; + protected $request; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * The create time of an operation. + * @type \Google\Protobuf\Timestamp $end_time + * The end time of an operation. + * @type int $state + * State of an operation. + * @type \Google\Cloud\Logging\V2\CreateBucketRequest $create_bucket_request + * LongRunningCreateBucket RPC request. + * @type \Google\Cloud\Logging\V2\UpdateBucketRequest $update_bucket_request + * LongRunningUpdateBucket RPC request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * The create time of an operation. + * + * 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); + } + + /** + * The create time of an operation. + * + * 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; + } + + /** + * The end time of an operation. + * + * 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); + } + + /** + * The end time of an operation. + * + * 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; + } + + /** + * State of an operation. + * + * Generated from protobuf field .google.logging.v2.OperationState state = 3; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * State of an operation. + * + * Generated from protobuf field .google.logging.v2.OperationState state = 3; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Logging\V2\OperationState::class); + $this->state = $var; + + return $this; + } + + /** + * LongRunningCreateBucket RPC request. + * + * Generated from protobuf field .google.logging.v2.CreateBucketRequest create_bucket_request = 4; + * @return \Google\Cloud\Logging\V2\CreateBucketRequest|null + */ + public function getCreateBucketRequest() + { + return $this->readOneof(4); + } + + public function hasCreateBucketRequest() + { + return $this->hasOneof(4); + } + + /** + * LongRunningCreateBucket RPC request. + * + * Generated from protobuf field .google.logging.v2.CreateBucketRequest create_bucket_request = 4; + * @param \Google\Cloud\Logging\V2\CreateBucketRequest $var + * @return $this + */ + public function setCreateBucketRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\CreateBucketRequest::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * LongRunningUpdateBucket RPC request. + * + * Generated from protobuf field .google.logging.v2.UpdateBucketRequest update_bucket_request = 5; + * @return \Google\Cloud\Logging\V2\UpdateBucketRequest|null + */ + public function getUpdateBucketRequest() + { + return $this->readOneof(5); + } + + public function hasUpdateBucketRequest() + { + return $this->hasOneof(5); + } + + /** + * LongRunningUpdateBucket RPC request. + * + * Generated from protobuf field .google.logging.v2.UpdateBucketRequest update_bucket_request = 5; + * @param \Google\Cloud\Logging\V2\UpdateBucketRequest $var + * @return $this + */ + public function setUpdateBucketRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\UpdateBucketRequest::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getRequest() + { + return $this->whichOneof("request"); + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CmekSettings.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CmekSettings.php new file mode 100644 index 000000000000..80371e43baa0 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CmekSettings.php @@ -0,0 +1,320 @@ +google.logging.v2.CmekSettings + */ +class CmekSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the CMEK settings. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * The resource name for the configured Cloud KMS key. + * KMS key name format: + * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]" + * For example: + * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"` + * To enable CMEK for the Log Router, set this field to a valid + * `kms_key_name` for which the associated service account has the required + * cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key. + * The Cloud KMS key used by the Log Router can be updated by changing the + * `kms_key_name` to a new valid key name or disabled by setting the key name + * to an empty string. Encryption operations that are in progress will be + * completed with the key that was in use when they started. Decryption + * operations will be completed using the key that was used at the time of + * encryption unless access to that key has been revoked. + * To disable CMEK for the Log Router, set this field to an empty string. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Generated from protobuf field string kms_key_name = 2; + */ + protected $kms_key_name = ''; + /** + * The CryptoKeyVersion resource name for the configured Cloud KMS key. + * KMS key name format: + * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]" + * For example: + * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"` + * This is a read-only field used to convey the specific configured + * CryptoKeyVersion of `kms_key` that has been configured. It will be + * populated in cases where the CMEK settings are bound to a single key + * version. + * If this field is populated, the `kms_key` is tied to a specific + * CryptoKeyVersion. + * + * Generated from protobuf field string kms_key_version_name = 4; + */ + protected $kms_key_version_name = ''; + /** + * Output only. The service account that will be used by the Log Router to + * access your Cloud KMS key. + * Before enabling CMEK for Log Router, you must first assign the + * cloudkms.cryptoKeyEncrypterDecrypter role to the service account that + * the Log Router will use to access your Cloud KMS key. Use + * [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to + * obtain the service account ID. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Generated from protobuf field string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $service_account_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of the CMEK settings. + * @type string $kms_key_name + * The resource name for the configured Cloud KMS key. + * KMS key name format: + * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]" + * For example: + * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"` + * To enable CMEK for the Log Router, set this field to a valid + * `kms_key_name` for which the associated service account has the required + * cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key. + * The Cloud KMS key used by the Log Router can be updated by changing the + * `kms_key_name` to a new valid key name or disabled by setting the key name + * to an empty string. Encryption operations that are in progress will be + * completed with the key that was in use when they started. Decryption + * operations will be completed using the key that was used at the time of + * encryption unless access to that key has been revoked. + * To disable CMEK for the Log Router, set this field to an empty string. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * @type string $kms_key_version_name + * The CryptoKeyVersion resource name for the configured Cloud KMS key. + * KMS key name format: + * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]" + * For example: + * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"` + * This is a read-only field used to convey the specific configured + * CryptoKeyVersion of `kms_key` that has been configured. It will be + * populated in cases where the CMEK settings are bound to a single key + * version. + * If this field is populated, the `kms_key` is tied to a specific + * CryptoKeyVersion. + * @type string $service_account_id + * Output only. The service account that will be used by the Log Router to + * access your Cloud KMS key. + * Before enabling CMEK for Log Router, you must first assign the + * cloudkms.cryptoKeyEncrypterDecrypter role to the service account that + * the Log Router will use to access your Cloud KMS key. Use + * [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to + * obtain the service account ID. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the CMEK settings. + * + * 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 CMEK settings. + * + * 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 resource name for the configured Cloud KMS key. + * KMS key name format: + * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]" + * For example: + * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"` + * To enable CMEK for the Log Router, set this field to a valid + * `kms_key_name` for which the associated service account has the required + * cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key. + * The Cloud KMS key used by the Log Router can be updated by changing the + * `kms_key_name` to a new valid key name or disabled by setting the key name + * to an empty string. Encryption operations that are in progress will be + * completed with the key that was in use when they started. Decryption + * operations will be completed using the key that was used at the time of + * encryption unless access to that key has been revoked. + * To disable CMEK for the Log Router, set this field to an empty string. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Generated from protobuf field string kms_key_name = 2; + * @return string + */ + public function getKmsKeyName() + { + return $this->kms_key_name; + } + + /** + * The resource name for the configured Cloud KMS key. + * KMS key name format: + * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]" + * For example: + * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"` + * To enable CMEK for the Log Router, set this field to a valid + * `kms_key_name` for which the associated service account has the required + * cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key. + * The Cloud KMS key used by the Log Router can be updated by changing the + * `kms_key_name` to a new valid key name or disabled by setting the key name + * to an empty string. Encryption operations that are in progress will be + * completed with the key that was in use when they started. Decryption + * operations will be completed using the key that was used at the time of + * encryption unless access to that key has been revoked. + * To disable CMEK for the Log Router, set this field to an empty string. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Generated from protobuf field string kms_key_name = 2; + * @param string $var + * @return $this + */ + public function setKmsKeyName($var) + { + GPBUtil::checkString($var, True); + $this->kms_key_name = $var; + + return $this; + } + + /** + * The CryptoKeyVersion resource name for the configured Cloud KMS key. + * KMS key name format: + * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]" + * For example: + * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"` + * This is a read-only field used to convey the specific configured + * CryptoKeyVersion of `kms_key` that has been configured. It will be + * populated in cases where the CMEK settings are bound to a single key + * version. + * If this field is populated, the `kms_key` is tied to a specific + * CryptoKeyVersion. + * + * Generated from protobuf field string kms_key_version_name = 4; + * @return string + */ + public function getKmsKeyVersionName() + { + return $this->kms_key_version_name; + } + + /** + * The CryptoKeyVersion resource name for the configured Cloud KMS key. + * KMS key name format: + * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]" + * For example: + * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"` + * This is a read-only field used to convey the specific configured + * CryptoKeyVersion of `kms_key` that has been configured. It will be + * populated in cases where the CMEK settings are bound to a single key + * version. + * If this field is populated, the `kms_key` is tied to a specific + * CryptoKeyVersion. + * + * Generated from protobuf field string kms_key_version_name = 4; + * @param string $var + * @return $this + */ + public function setKmsKeyVersionName($var) + { + GPBUtil::checkString($var, True); + $this->kms_key_version_name = $var; + + return $this; + } + + /** + * Output only. The service account that will be used by the Log Router to + * access your Cloud KMS key. + * Before enabling CMEK for Log Router, you must first assign the + * cloudkms.cryptoKeyEncrypterDecrypter role to the service account that + * the Log Router will use to access your Cloud KMS key. Use + * [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to + * obtain the service account ID. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Generated from protobuf field string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getServiceAccountId() + { + return $this->service_account_id; + } + + /** + * Output only. The service account that will be used by the Log Router to + * access your Cloud KMS key. + * Before enabling CMEK for Log Router, you must first assign the + * cloudkms.cryptoKeyEncrypterDecrypter role to the service account that + * the Log Router will use to access your Cloud KMS key. Use + * [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to + * obtain the service account ID. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Generated from protobuf field string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setServiceAccountId($var) + { + GPBUtil::checkString($var, True); + $this->service_account_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ConfigServiceV2GrpcClient.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ConfigServiceV2GrpcClient.php new file mode 100644 index 000000000000..6ceeff2be35a --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ConfigServiceV2GrpcClient.php @@ -0,0 +1,602 @@ +_simpleRequest('/google.logging.v2.ConfigServiceV2/ListBuckets', + $argument, + ['\Google\Cloud\Logging\V2\ListBucketsResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets a log bucket. + * @param \Google\Cloud\Logging\V2\GetBucketRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetBucket(\Google\Cloud\Logging\V2\GetBucketRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/GetBucket', + $argument, + ['\Google\Cloud\Logging\V2\LogBucket', 'decode'], + $metadata, $options); + } + + /** + * Creates a log bucket asynchronously that can be used to store log entries. + * + * After a bucket has been created, the bucket's location cannot be changed. + * @param \Google\Cloud\Logging\V2\CreateBucketRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateBucketAsync(\Google\Cloud\Logging\V2\CreateBucketRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/CreateBucketAsync', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Updates a log bucket asynchronously. + * + * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then + * `FAILED_PRECONDITION` will be returned. + * + * After a bucket has been created, the bucket's location cannot be changed. + * @param \Google\Cloud\Logging\V2\UpdateBucketRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateBucketAsync(\Google\Cloud\Logging\V2\UpdateBucketRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/UpdateBucketAsync', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Creates a log bucket that can be used to store log entries. After a bucket + * has been created, the bucket's location cannot be changed. + * @param \Google\Cloud\Logging\V2\CreateBucketRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateBucket(\Google\Cloud\Logging\V2\CreateBucketRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/CreateBucket', + $argument, + ['\Google\Cloud\Logging\V2\LogBucket', 'decode'], + $metadata, $options); + } + + /** + * Updates a log bucket. + * + * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then + * `FAILED_PRECONDITION` will be returned. + * + * After a bucket has been created, the bucket's location cannot be changed. + * @param \Google\Cloud\Logging\V2\UpdateBucketRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateBucket(\Google\Cloud\Logging\V2\UpdateBucketRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/UpdateBucket', + $argument, + ['\Google\Cloud\Logging\V2\LogBucket', 'decode'], + $metadata, $options); + } + + /** + * Deletes a log bucket. + * + * Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state. + * After 7 days, the bucket will be purged and all log entries in the bucket + * will be permanently deleted. + * @param \Google\Cloud\Logging\V2\DeleteBucketRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteBucket(\Google\Cloud\Logging\V2\DeleteBucketRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/DeleteBucket', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * Undeletes a log bucket. A bucket that has been deleted can be undeleted + * within the grace period of 7 days. + * @param \Google\Cloud\Logging\V2\UndeleteBucketRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UndeleteBucket(\Google\Cloud\Logging\V2\UndeleteBucketRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/UndeleteBucket', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * Lists views on a log bucket. + * @param \Google\Cloud\Logging\V2\ListViewsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListViews(\Google\Cloud\Logging\V2\ListViewsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/ListViews', + $argument, + ['\Google\Cloud\Logging\V2\ListViewsResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets a view on a log bucket.. + * @param \Google\Cloud\Logging\V2\GetViewRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetView(\Google\Cloud\Logging\V2\GetViewRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/GetView', + $argument, + ['\Google\Cloud\Logging\V2\LogView', 'decode'], + $metadata, $options); + } + + /** + * Creates a view over log entries in a log bucket. A bucket may contain a + * maximum of 30 views. + * @param \Google\Cloud\Logging\V2\CreateViewRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateView(\Google\Cloud\Logging\V2\CreateViewRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/CreateView', + $argument, + ['\Google\Cloud\Logging\V2\LogView', 'decode'], + $metadata, $options); + } + + /** + * Updates a view on a log bucket. This method replaces the following fields + * in the existing view with values from the new view: `filter`. + * If an `UNAVAILABLE` error is returned, this indicates that system is not in + * a state where it can update the view. If this occurs, please try again in a + * few minutes. + * @param \Google\Cloud\Logging\V2\UpdateViewRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateView(\Google\Cloud\Logging\V2\UpdateViewRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/UpdateView', + $argument, + ['\Google\Cloud\Logging\V2\LogView', 'decode'], + $metadata, $options); + } + + /** + * Deletes a view on a log bucket. + * If an `UNAVAILABLE` error is returned, this indicates that system is not in + * a state where it can delete the view. If this occurs, please try again in a + * few minutes. + * @param \Google\Cloud\Logging\V2\DeleteViewRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteView(\Google\Cloud\Logging\V2\DeleteViewRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/DeleteView', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * Lists sinks. + * @param \Google\Cloud\Logging\V2\ListSinksRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListSinks(\Google\Cloud\Logging\V2\ListSinksRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/ListSinks', + $argument, + ['\Google\Cloud\Logging\V2\ListSinksResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets a sink. + * @param \Google\Cloud\Logging\V2\GetSinkRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetSink(\Google\Cloud\Logging\V2\GetSinkRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/GetSink', + $argument, + ['\Google\Cloud\Logging\V2\LogSink', 'decode'], + $metadata, $options); + } + + /** + * Creates a sink that exports specified log entries to a destination. The + * export of newly-ingested log entries begins immediately, unless the sink's + * `writer_identity` is not permitted to write to the destination. A sink can + * export log entries only from the resource owning the sink. + * @param \Google\Cloud\Logging\V2\CreateSinkRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateSink(\Google\Cloud\Logging\V2\CreateSinkRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/CreateSink', + $argument, + ['\Google\Cloud\Logging\V2\LogSink', 'decode'], + $metadata, $options); + } + + /** + * Updates a sink. This method replaces the following fields in the existing + * sink with values from the new sink: `destination`, and `filter`. + * + * The updated sink might also have a new `writer_identity`; see the + * `unique_writer_identity` field. + * @param \Google\Cloud\Logging\V2\UpdateSinkRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateSink(\Google\Cloud\Logging\V2\UpdateSinkRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/UpdateSink', + $argument, + ['\Google\Cloud\Logging\V2\LogSink', 'decode'], + $metadata, $options); + } + + /** + * Deletes a sink. If the sink has a unique `writer_identity`, then that + * service account is also deleted. + * @param \Google\Cloud\Logging\V2\DeleteSinkRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteSink(\Google\Cloud\Logging\V2\DeleteSinkRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/DeleteSink', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * Asynchronously creates a linked dataset in BigQuery which makes it possible + * to use BigQuery to read the logs stored in the log bucket. A log bucket may + * currently only contain one link. + * @param \Google\Cloud\Logging\V2\CreateLinkRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateLink(\Google\Cloud\Logging\V2\CreateLinkRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/CreateLink', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Deletes a link. This will also delete the corresponding BigQuery linked + * dataset. + * @param \Google\Cloud\Logging\V2\DeleteLinkRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteLink(\Google\Cloud\Logging\V2\DeleteLinkRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/DeleteLink', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Lists links. + * @param \Google\Cloud\Logging\V2\ListLinksRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListLinks(\Google\Cloud\Logging\V2\ListLinksRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/ListLinks', + $argument, + ['\Google\Cloud\Logging\V2\ListLinksResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets a link. + * @param \Google\Cloud\Logging\V2\GetLinkRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetLink(\Google\Cloud\Logging\V2\GetLinkRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/GetLink', + $argument, + ['\Google\Cloud\Logging\V2\Link', 'decode'], + $metadata, $options); + } + + /** + * Lists all the exclusions on the _Default sink in a parent resource. + * @param \Google\Cloud\Logging\V2\ListExclusionsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListExclusions(\Google\Cloud\Logging\V2\ListExclusionsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/ListExclusions', + $argument, + ['\Google\Cloud\Logging\V2\ListExclusionsResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets the description of an exclusion in the _Default sink. + * @param \Google\Cloud\Logging\V2\GetExclusionRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetExclusion(\Google\Cloud\Logging\V2\GetExclusionRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/GetExclusion', + $argument, + ['\Google\Cloud\Logging\V2\LogExclusion', 'decode'], + $metadata, $options); + } + + /** + * Creates a new exclusion in the _Default sink in a specified parent + * resource. Only log entries belonging to that resource can be excluded. You + * can have up to 10 exclusions in a resource. + * @param \Google\Cloud\Logging\V2\CreateExclusionRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateExclusion(\Google\Cloud\Logging\V2\CreateExclusionRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/CreateExclusion', + $argument, + ['\Google\Cloud\Logging\V2\LogExclusion', 'decode'], + $metadata, $options); + } + + /** + * Changes one or more properties of an existing exclusion in the _Default + * sink. + * @param \Google\Cloud\Logging\V2\UpdateExclusionRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateExclusion(\Google\Cloud\Logging\V2\UpdateExclusionRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/UpdateExclusion', + $argument, + ['\Google\Cloud\Logging\V2\LogExclusion', 'decode'], + $metadata, $options); + } + + /** + * Deletes an exclusion in the _Default sink. + * @param \Google\Cloud\Logging\V2\DeleteExclusionRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteExclusion(\Google\Cloud\Logging\V2\DeleteExclusionRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/DeleteExclusion', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * Gets the Logging CMEK settings for the given resource. + * + * Note: CMEK for the Log Router can be configured for Google Cloud projects, + * folders, organizations and billing accounts. Once configured for an + * organization, it applies to all projects and folders in the Google Cloud + * organization. + * + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * @param \Google\Cloud\Logging\V2\GetCmekSettingsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetCmekSettings(\Google\Cloud\Logging\V2\GetCmekSettingsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/GetCmekSettings', + $argument, + ['\Google\Cloud\Logging\V2\CmekSettings', 'decode'], + $metadata, $options); + } + + /** + * Updates the Log Router CMEK settings for the given resource. + * + * Note: CMEK for the Log Router can currently only be configured for Google + * Cloud organizations. Once configured, it applies to all projects and + * folders in the Google Cloud organization. + * + * [UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings] + * will fail if 1) `kms_key_name` is invalid, or 2) the associated service + * account does not have the required + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or + * 3) access to the key is disabled. + * + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * @param \Google\Cloud\Logging\V2\UpdateCmekSettingsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateCmekSettings(\Google\Cloud\Logging\V2\UpdateCmekSettingsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/UpdateCmekSettings', + $argument, + ['\Google\Cloud\Logging\V2\CmekSettings', 'decode'], + $metadata, $options); + } + + /** + * Gets the Log Router settings for the given resource. + * + * Note: Settings for the Log Router can be get for Google Cloud projects, + * folders, organizations and billing accounts. Currently it can only be + * configured for organizations. Once configured for an organization, it + * applies to all projects and folders in the Google Cloud organization. + * + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * @param \Google\Cloud\Logging\V2\GetSettingsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetSettings(\Google\Cloud\Logging\V2\GetSettingsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/GetSettings', + $argument, + ['\Google\Cloud\Logging\V2\Settings', 'decode'], + $metadata, $options); + } + + /** + * Updates the Log Router settings for the given resource. + * + * Note: Settings for the Log Router can currently only be configured for + * Google Cloud organizations. Once configured, it applies to all projects and + * folders in the Google Cloud organization. + * + * [UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings] + * will fail if 1) `kms_key_name` is invalid, or 2) the associated service + * account does not have the required + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or + * 3) access to the key is disabled. 4) `location_id` is not supported by + * Logging. 5) `location_id` violate OrgPolicy. + * + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * @param \Google\Cloud\Logging\V2\UpdateSettingsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateSettings(\Google\Cloud\Logging\V2\UpdateSettingsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/UpdateSettings', + $argument, + ['\Google\Cloud\Logging\V2\Settings', 'decode'], + $metadata, $options); + } + + /** + * Copies a set of log entries from a log bucket to a Cloud Storage bucket. + * @param \Google\Cloud\Logging\V2\CopyLogEntriesRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CopyLogEntries(\Google\Cloud\Logging\V2\CopyLogEntriesRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/CopyLogEntries', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesMetadata.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesMetadata.php new file mode 100644 index 000000000000..ad1fe195b4f9 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesMetadata.php @@ -0,0 +1,317 @@ +google.logging.v2.CopyLogEntriesMetadata + */ +class CopyLogEntriesMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The create time of an operation. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * The end time of an operation. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + /** + * State of an operation. + * + * Generated from protobuf field .google.logging.v2.OperationState state = 3; + */ + protected $state = 0; + /** + * Identifies whether the user has requested cancellation of the operation. + * + * Generated from protobuf field bool cancellation_requested = 4; + */ + protected $cancellation_requested = false; + /** + * CopyLogEntries RPC request. + * + * Generated from protobuf field .google.logging.v2.CopyLogEntriesRequest request = 5; + */ + protected $request = null; + /** + * Estimated progress of the operation (0 - 100%). + * + * Generated from protobuf field int32 progress = 6; + */ + protected $progress = 0; + /** + * The IAM identity of a service account that must be granted access to the + * destination. + * If the service account is not granted permission to the destination within + * an hour, the operation will be cancelled. + * For example: `"serviceAccount:foo@bar.com"` + * + * Generated from protobuf field string writer_identity = 7; + */ + protected $writer_identity = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * The create time of an operation. + * @type \Google\Protobuf\Timestamp $end_time + * The end time of an operation. + * @type int $state + * State of an operation. + * @type bool $cancellation_requested + * Identifies whether the user has requested cancellation of the operation. + * @type \Google\Cloud\Logging\V2\CopyLogEntriesRequest $request + * CopyLogEntries RPC request. + * @type int $progress + * Estimated progress of the operation (0 - 100%). + * @type string $writer_identity + * The IAM identity of a service account that must be granted access to the + * destination. + * If the service account is not granted permission to the destination within + * an hour, the operation will be cancelled. + * For example: `"serviceAccount:foo@bar.com"` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * The create time of an operation. + * + * 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); + } + + /** + * The create time of an operation. + * + * 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; + } + + /** + * The end time of an operation. + * + * 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); + } + + /** + * The end time of an operation. + * + * 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; + } + + /** + * State of an operation. + * + * Generated from protobuf field .google.logging.v2.OperationState state = 3; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * State of an operation. + * + * Generated from protobuf field .google.logging.v2.OperationState state = 3; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Logging\V2\OperationState::class); + $this->state = $var; + + return $this; + } + + /** + * Identifies whether the user has requested cancellation of the operation. + * + * Generated from protobuf field bool cancellation_requested = 4; + * @return bool + */ + public function getCancellationRequested() + { + return $this->cancellation_requested; + } + + /** + * Identifies whether the user has requested cancellation of the operation. + * + * Generated from protobuf field bool cancellation_requested = 4; + * @param bool $var + * @return $this + */ + public function setCancellationRequested($var) + { + GPBUtil::checkBool($var); + $this->cancellation_requested = $var; + + return $this; + } + + /** + * CopyLogEntries RPC request. + * + * Generated from protobuf field .google.logging.v2.CopyLogEntriesRequest request = 5; + * @return \Google\Cloud\Logging\V2\CopyLogEntriesRequest|null + */ + public function getRequest() + { + return $this->request; + } + + public function hasRequest() + { + return isset($this->request); + } + + public function clearRequest() + { + unset($this->request); + } + + /** + * CopyLogEntries RPC request. + * + * Generated from protobuf field .google.logging.v2.CopyLogEntriesRequest request = 5; + * @param \Google\Cloud\Logging\V2\CopyLogEntriesRequest $var + * @return $this + */ + public function setRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\CopyLogEntriesRequest::class); + $this->request = $var; + + return $this; + } + + /** + * Estimated progress of the operation (0 - 100%). + * + * Generated from protobuf field int32 progress = 6; + * @return int + */ + public function getProgress() + { + return $this->progress; + } + + /** + * Estimated progress of the operation (0 - 100%). + * + * Generated from protobuf field int32 progress = 6; + * @param int $var + * @return $this + */ + public function setProgress($var) + { + GPBUtil::checkInt32($var); + $this->progress = $var; + + return $this; + } + + /** + * The IAM identity of a service account that must be granted access to the + * destination. + * If the service account is not granted permission to the destination within + * an hour, the operation will be cancelled. + * For example: `"serviceAccount:foo@bar.com"` + * + * Generated from protobuf field string writer_identity = 7; + * @return string + */ + public function getWriterIdentity() + { + return $this->writer_identity; + } + + /** + * The IAM identity of a service account that must be granted access to the + * destination. + * If the service account is not granted permission to the destination within + * an hour, the operation will be cancelled. + * For example: `"serviceAccount:foo@bar.com"` + * + * Generated from protobuf field string writer_identity = 7; + * @param string $var + * @return $this + */ + public function setWriterIdentity($var) + { + GPBUtil::checkString($var, True); + $this->writer_identity = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesRequest.php new file mode 100644 index 000000000000..db42fc75bd5d --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesRequest.php @@ -0,0 +1,147 @@ +google.logging.v2.CopyLogEntriesRequest + */ +class CopyLogEntriesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Log bucket from which to copy log entries. + * For example: + * `"projects/my-project/locations/global/buckets/my-source-bucket"` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Optional. A filter specifying which log entries to copy. The filter must be + * no more than 20k characters. An empty filter matches all log entries. + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Required. Destination to which to copy log entries. + * + * Generated from protobuf field string destination = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $destination = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Log bucket from which to copy log entries. + * For example: + * `"projects/my-project/locations/global/buckets/my-source-bucket"` + * @type string $filter + * Optional. A filter specifying which log entries to copy. The filter must be + * no more than 20k characters. An empty filter matches all log entries. + * @type string $destination + * Required. Destination to which to copy log entries. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. Log bucket from which to copy log entries. + * For example: + * `"projects/my-project/locations/global/buckets/my-source-bucket"` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Log bucket from which to copy log entries. + * For example: + * `"projects/my-project/locations/global/buckets/my-source-bucket"` + * + * 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. A filter specifying which log entries to copy. The filter must be + * no more than 20k characters. An empty filter matches all log entries. + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A filter specifying which log entries to copy. The filter must be + * no more than 20k characters. An empty filter matches all log entries. + * + * 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; + } + + /** + * Required. Destination to which to copy log entries. + * + * Generated from protobuf field string destination = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDestination() + { + return $this->destination; + } + + /** + * Required. Destination to which to copy log entries. + * + * Generated from protobuf field string destination = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDestination($var) + { + GPBUtil::checkString($var, True); + $this->destination = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesResponse.php new file mode 100644 index 000000000000..103ccdbe1933 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesResponse.php @@ -0,0 +1,67 @@ +google.logging.v2.CopyLogEntriesResponse + */ +class CopyLogEntriesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Number of log entries copied. + * + * Generated from protobuf field int64 log_entries_copied_count = 1; + */ + protected $log_entries_copied_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $log_entries_copied_count + * Number of log entries copied. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Number of log entries copied. + * + * Generated from protobuf field int64 log_entries_copied_count = 1; + * @return int|string + */ + public function getLogEntriesCopiedCount() + { + return $this->log_entries_copied_count; + } + + /** + * Number of log entries copied. + * + * Generated from protobuf field int64 log_entries_copied_count = 1; + * @param int|string $var + * @return $this + */ + public function setLogEntriesCopiedCount($var) + { + GPBUtil::checkInt64($var); + $this->log_entries_copied_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateBucketRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateBucketRequest.php new file mode 100644 index 000000000000..d91743acf052 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateBucketRequest.php @@ -0,0 +1,173 @@ +google.logging.v2.CreateBucketRequest + */ +class CreateBucketRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource in which to create the log bucket: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * For example: + * `"projects/my-project/locations/global"` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers + * are limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. + * + * Generated from protobuf field string bucket_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $bucket_id = ''; + /** + * Required. The new bucket. The region specified in the new bucket must be + * compliant with any Location Restriction Org Policy. The name field in the + * bucket is ignored. + * + * Generated from protobuf field .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $bucket = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource in which to create the log bucket: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * For example: + * `"projects/my-project/locations/global"` + * @type string $bucket_id + * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers + * are limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. + * @type \Google\Cloud\Logging\V2\LogBucket $bucket + * Required. The new bucket. The region specified in the new bucket must be + * compliant with any Location Restriction Org Policy. The name field in the + * bucket is ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource in which to create the log bucket: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * For example: + * `"projects/my-project/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. The resource in which to create the log bucket: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * For example: + * `"projects/my-project/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; + } + + /** + * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers + * are limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. + * + * Generated from protobuf field string bucket_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBucketId() + { + return $this->bucket_id; + } + + /** + * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers + * are limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. + * + * Generated from protobuf field string bucket_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBucketId($var) + { + GPBUtil::checkString($var, True); + $this->bucket_id = $var; + + return $this; + } + + /** + * Required. The new bucket. The region specified in the new bucket must be + * compliant with any Location Restriction Org Policy. The name field in the + * bucket is ignored. + * + * Generated from protobuf field .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Logging\V2\LogBucket|null + */ + public function getBucket() + { + return $this->bucket; + } + + public function hasBucket() + { + return isset($this->bucket); + } + + public function clearBucket() + { + unset($this->bucket); + } + + /** + * Required. The new bucket. The region specified in the new bucket must be + * compliant with any Location Restriction Org Policy. The name field in the + * bucket is ignored. + * + * Generated from protobuf field .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Logging\V2\LogBucket $var + * @return $this + */ + public function setBucket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogBucket::class); + $this->bucket = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateExclusionRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateExclusionRequest.php new file mode 100644 index 000000000000..0bbd83b99b72 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateExclusionRequest.php @@ -0,0 +1,143 @@ +google.logging.v2.CreateExclusionRequest + */ +class CreateExclusionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource in which to create the exclusion: + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + * For examples: + * `"projects/my-logging-project"` + * `"organizations/123456789"` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The new exclusion, whose `name` parameter is an exclusion name + * that is not already used in the parent resource. + * + * Generated from protobuf field .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $exclusion = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource in which to create the exclusion: + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + * For examples: + * `"projects/my-logging-project"` + * `"organizations/123456789"` + * @type \Google\Cloud\Logging\V2\LogExclusion $exclusion + * Required. The new exclusion, whose `name` parameter is an exclusion name + * that is not already used in the parent resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource in which to create the exclusion: + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + * For examples: + * `"projects/my-logging-project"` + * `"organizations/123456789"` + * + * 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 in which to create the exclusion: + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + * For examples: + * `"projects/my-logging-project"` + * `"organizations/123456789"` + * + * 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 new exclusion, whose `name` parameter is an exclusion name + * that is not already used in the parent resource. + * + * Generated from protobuf field .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Logging\V2\LogExclusion|null + */ + public function getExclusion() + { + return $this->exclusion; + } + + public function hasExclusion() + { + return isset($this->exclusion); + } + + public function clearExclusion() + { + unset($this->exclusion); + } + + /** + * Required. The new exclusion, whose `name` parameter is an exclusion name + * that is not already used in the parent resource. + * + * Generated from protobuf field .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Logging\V2\LogExclusion $var + * @return $this + */ + public function setExclusion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogExclusion::class); + $this->exclusion = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateLinkRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateLinkRequest.php new file mode 100644 index 000000000000..1c59cce78a43 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateLinkRequest.php @@ -0,0 +1,169 @@ +google.logging.v2.CreateLinkRequest + */ +class CreateLinkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full resource name of the bucket to create a link for. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The new link. + * + * Generated from protobuf field .google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $link = null; + /** + * Required. The ID to use for the link. The link_id can have up to 100 + * characters. A valid link_id must only have alphanumeric characters and + * underscores within it. + * + * Generated from protobuf field string link_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $link_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The full resource name of the bucket to create a link for. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * @type \Google\Cloud\Logging\V2\Link $link + * Required. The new link. + * @type string $link_id + * Required. The ID to use for the link. The link_id can have up to 100 + * characters. A valid link_id must only have alphanumeric characters and + * underscores within it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full resource name of the bucket to create a link for. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_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 full resource name of the bucket to create a link for. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_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 new link. + * + * Generated from protobuf field .google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Logging\V2\Link|null + */ + public function getLink() + { + return $this->link; + } + + public function hasLink() + { + return isset($this->link); + } + + public function clearLink() + { + unset($this->link); + } + + /** + * Required. The new link. + * + * Generated from protobuf field .google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Logging\V2\Link $var + * @return $this + */ + public function setLink($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\Link::class); + $this->link = $var; + + return $this; + } + + /** + * Required. The ID to use for the link. The link_id can have up to 100 + * characters. A valid link_id must only have alphanumeric characters and + * underscores within it. + * + * Generated from protobuf field string link_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLinkId() + { + return $this->link_id; + } + + /** + * Required. The ID to use for the link. The link_id can have up to 100 + * characters. A valid link_id must only have alphanumeric characters and + * underscores within it. + * + * Generated from protobuf field string link_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLinkId($var) + { + GPBUtil::checkString($var, True); + $this->link_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateLogMetricRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateLogMetricRequest.php new file mode 100644 index 000000000000..78776555edfd --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateLogMetricRequest.php @@ -0,0 +1,123 @@ +google.logging.v2.CreateLogMetricRequest + */ +class CreateLogMetricRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the project in which to create the metric: + * "projects/[PROJECT_ID]" + * The new metric must be provided in the request. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The new logs-based metric, which must not have an identifier that + * already exists. + * + * Generated from protobuf field .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $metric = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the project in which to create the metric: + * "projects/[PROJECT_ID]" + * The new metric must be provided in the request. + * @type \Google\Cloud\Logging\V2\LogMetric $metric + * Required. The new logs-based metric, which must not have an identifier that + * already exists. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingMetrics::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the project in which to create the metric: + * "projects/[PROJECT_ID]" + * The new metric must be provided in the request. + * + * 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 project in which to create the metric: + * "projects/[PROJECT_ID]" + * The new metric must be provided in the request. + * + * 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 new logs-based metric, which must not have an identifier that + * already exists. + * + * Generated from protobuf field .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Logging\V2\LogMetric|null + */ + public function getMetric() + { + return $this->metric; + } + + public function hasMetric() + { + return isset($this->metric); + } + + public function clearMetric() + { + unset($this->metric); + } + + /** + * Required. The new logs-based metric, which must not have an identifier that + * already exists. + * + * Generated from protobuf field .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Logging\V2\LogMetric $var + * @return $this + */ + public function setMetric($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogMetric::class); + $this->metric = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateSinkRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateSinkRequest.php new file mode 100644 index 000000000000..974dd3d15f29 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateSinkRequest.php @@ -0,0 +1,217 @@ +google.logging.v2.CreateSinkRequest + */ +class CreateSinkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource in which to create the sink: + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + * For examples: + * `"projects/my-project"` + * `"organizations/123456789"` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The new sink, whose `name` parameter is a sink identifier that + * is not already in use. + * + * Generated from protobuf field .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $sink = null; + /** + * Optional. Determines the kind of IAM identity returned as `writer_identity` + * in the new sink. If this value is omitted or set to false, and if the + * sink's parent is a project, then the value returned as `writer_identity` is + * the same group or service account used by Cloud Logging before the addition + * of writer identities to this API. The sink's destination must be in the + * same project as the sink itself. + * If this field is set to true, or if the sink is owned by a non-project + * resource such as an organization, then the value of `writer_identity` will + * be a unique service account used only for exports from the new sink. For + * more information, see `writer_identity` in + * [LogSink][google.logging.v2.LogSink]. + * + * Generated from protobuf field bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $unique_writer_identity = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource in which to create the sink: + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + * For examples: + * `"projects/my-project"` + * `"organizations/123456789"` + * @type \Google\Cloud\Logging\V2\LogSink $sink + * Required. The new sink, whose `name` parameter is a sink identifier that + * is not already in use. + * @type bool $unique_writer_identity + * Optional. Determines the kind of IAM identity returned as `writer_identity` + * in the new sink. If this value is omitted or set to false, and if the + * sink's parent is a project, then the value returned as `writer_identity` is + * the same group or service account used by Cloud Logging before the addition + * of writer identities to this API. The sink's destination must be in the + * same project as the sink itself. + * If this field is set to true, or if the sink is owned by a non-project + * resource such as an organization, then the value of `writer_identity` will + * be a unique service account used only for exports from the new sink. For + * more information, see `writer_identity` in + * [LogSink][google.logging.v2.LogSink]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource in which to create the sink: + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + * For examples: + * `"projects/my-project"` + * `"organizations/123456789"` + * + * 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 in which to create the sink: + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + * For examples: + * `"projects/my-project"` + * `"organizations/123456789"` + * + * 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 new sink, whose `name` parameter is a sink identifier that + * is not already in use. + * + * Generated from protobuf field .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Logging\V2\LogSink|null + */ + public function getSink() + { + return $this->sink; + } + + public function hasSink() + { + return isset($this->sink); + } + + public function clearSink() + { + unset($this->sink); + } + + /** + * Required. The new sink, whose `name` parameter is a sink identifier that + * is not already in use. + * + * Generated from protobuf field .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Logging\V2\LogSink $var + * @return $this + */ + public function setSink($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogSink::class); + $this->sink = $var; + + return $this; + } + + /** + * Optional. Determines the kind of IAM identity returned as `writer_identity` + * in the new sink. If this value is omitted or set to false, and if the + * sink's parent is a project, then the value returned as `writer_identity` is + * the same group or service account used by Cloud Logging before the addition + * of writer identities to this API. The sink's destination must be in the + * same project as the sink itself. + * If this field is set to true, or if the sink is owned by a non-project + * resource such as an organization, then the value of `writer_identity` will + * be a unique service account used only for exports from the new sink. For + * more information, see `writer_identity` in + * [LogSink][google.logging.v2.LogSink]. + * + * Generated from protobuf field bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getUniqueWriterIdentity() + { + return $this->unique_writer_identity; + } + + /** + * Optional. Determines the kind of IAM identity returned as `writer_identity` + * in the new sink. If this value is omitted or set to false, and if the + * sink's parent is a project, then the value returned as `writer_identity` is + * the same group or service account used by Cloud Logging before the addition + * of writer identities to this API. The sink's destination must be in the + * same project as the sink itself. + * If this field is set to true, or if the sink is owned by a non-project + * resource such as an organization, then the value of `writer_identity` will + * be a unique service account used only for exports from the new sink. For + * more information, see `writer_identity` in + * [LogSink][google.logging.v2.LogSink]. + * + * Generated from protobuf field bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setUniqueWriterIdentity($var) + { + GPBUtil::checkBool($var); + $this->unique_writer_identity = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateViewRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateViewRequest.php new file mode 100644 index 000000000000..08a1db42522e --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateViewRequest.php @@ -0,0 +1,165 @@ +google.logging.v2.CreateViewRequest + */ +class CreateViewRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The bucket in which to create the view + * `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. A client-assigned identifier such as `"my-view"`. Identifiers are + * limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. + * + * Generated from protobuf field string view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $view_id = ''; + /** + * Required. The new view. + * + * Generated from protobuf field .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $view = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The bucket in which to create the view + * `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + * @type string $view_id + * Required. A client-assigned identifier such as `"my-view"`. Identifiers are + * limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. + * @type \Google\Cloud\Logging\V2\LogView $view + * Required. The new view. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The bucket in which to create the view + * `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The bucket in which to create the view + * `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + * + * 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. A client-assigned identifier such as `"my-view"`. Identifiers are + * limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. + * + * Generated from protobuf field string view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getViewId() + { + return $this->view_id; + } + + /** + * Required. A client-assigned identifier such as `"my-view"`. Identifiers are + * limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. + * + * Generated from protobuf field string view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setViewId($var) + { + GPBUtil::checkString($var, True); + $this->view_id = $var; + + return $this; + } + + /** + * Required. The new view. + * + * Generated from protobuf field .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Logging\V2\LogView|null + */ + public function getView() + { + return $this->view; + } + + public function hasView() + { + return isset($this->view); + } + + public function clearView() + { + unset($this->view); + } + + /** + * Required. The new view. + * + * Generated from protobuf field .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Logging\V2\LogView $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteBucketRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteBucketRequest.php new file mode 100644 index 000000000000..ede048203de1 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteBucketRequest.php @@ -0,0 +1,91 @@ +google.logging.v2.DeleteBucketRequest + */ +class DeleteBucketRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full resource name of the bucket to delete. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full resource name of the bucket to delete. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full resource name of the bucket to delete. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + * + * 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 resource name of the bucket to delete. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + * + * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteExclusionRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteExclusionRequest.php new file mode 100644 index 000000000000..dcce042dc163 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteExclusionRequest.php @@ -0,0 +1,91 @@ +google.logging.v2.DeleteExclusionRequest + */ +class DeleteExclusionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of an existing exclusion to delete: + * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * For example: + * `"projects/my-project/exclusions/my-exclusion"` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of an existing exclusion to delete: + * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * For example: + * `"projects/my-project/exclusions/my-exclusion"` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of an existing exclusion to delete: + * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * For example: + * `"projects/my-project/exclusions/my-exclusion"` + * + * 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 an existing exclusion to delete: + * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * For example: + * `"projects/my-project/exclusions/my-exclusion"` + * + * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLinkRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLinkRequest.php new file mode 100644 index 000000000000..6043c07c8b88 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLinkRequest.php @@ -0,0 +1,83 @@ +google.logging.v2.DeleteLinkRequest + */ +class DeleteLinkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full resource name of the link to delete. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full resource name of the link to delete. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full resource name of the link to delete. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_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 full resource name of the link to delete. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_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/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLogMetricRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLogMetricRequest.php new file mode 100644 index 000000000000..7c8495085a34 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLogMetricRequest.php @@ -0,0 +1,71 @@ +google.logging.v2.DeleteLogMetricRequest + */ +class DeleteLogMetricRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the metric to delete: + * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * + * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $metric_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $metric_name + * Required. The resource name of the metric to delete: + * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingMetrics::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the metric to delete: + * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * + * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getMetricName() + { + return $this->metric_name; + } + + /** + * Required. The resource name of the metric to delete: + * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * + * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setMetricName($var) + { + GPBUtil::checkString($var, True); + $this->metric_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLogRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLogRequest.php new file mode 100644 index 000000000000..4bfa2460e7c5 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLogRequest.php @@ -0,0 +1,103 @@ +google.logging.v2.DeleteLogRequest + */ +class DeleteLogRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the log to delete: + * * `projects/[PROJECT_ID]/logs/[LOG_ID]` + * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + * * `folders/[FOLDER_ID]/logs/[LOG_ID]` + * `[LOG_ID]` must be URL-encoded. For example, + * `"projects/my-project-id/logs/syslog"`, + * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. + * For more information about log names, see + * [LogEntry][google.logging.v2.LogEntry]. + * + * Generated from protobuf field string log_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $log_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $log_name + * Required. The resource name of the log to delete: + * * `projects/[PROJECT_ID]/logs/[LOG_ID]` + * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + * * `folders/[FOLDER_ID]/logs/[LOG_ID]` + * `[LOG_ID]` must be URL-encoded. For example, + * `"projects/my-project-id/logs/syslog"`, + * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. + * For more information about log names, see + * [LogEntry][google.logging.v2.LogEntry]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\Logging::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the log to delete: + * * `projects/[PROJECT_ID]/logs/[LOG_ID]` + * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + * * `folders/[FOLDER_ID]/logs/[LOG_ID]` + * `[LOG_ID]` must be URL-encoded. For example, + * `"projects/my-project-id/logs/syslog"`, + * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. + * For more information about log names, see + * [LogEntry][google.logging.v2.LogEntry]. + * + * Generated from protobuf field string log_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getLogName() + { + return $this->log_name; + } + + /** + * Required. The resource name of the log to delete: + * * `projects/[PROJECT_ID]/logs/[LOG_ID]` + * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + * * `folders/[FOLDER_ID]/logs/[LOG_ID]` + * `[LOG_ID]` must be URL-encoded. For example, + * `"projects/my-project-id/logs/syslog"`, + * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. + * For more information about log names, see + * [LogEntry][google.logging.v2.LogEntry]. + * + * Generated from protobuf field string log_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLogName($var) + { + GPBUtil::checkString($var, True); + $this->log_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteSinkRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteSinkRequest.php new file mode 100644 index 000000000000..9634479cb435 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteSinkRequest.php @@ -0,0 +1,95 @@ +google.logging.v2.DeleteSinkRequest + */ +class DeleteSinkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full resource name of the sink to delete, including the + * parent resource and the sink identifier: + * "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * For example: + * `"projects/my-project/sinks/my-sink"` + * + * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $sink_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $sink_name + * Required. The full resource name of the sink to delete, including the + * parent resource and the sink identifier: + * "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * For example: + * `"projects/my-project/sinks/my-sink"` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full resource name of the sink to delete, including the + * parent resource and the sink identifier: + * "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * For example: + * `"projects/my-project/sinks/my-sink"` + * + * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSinkName() + { + return $this->sink_name; + } + + /** + * Required. The full resource name of the sink to delete, including the + * parent resource and the sink identifier: + * "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * For example: + * `"projects/my-project/sinks/my-sink"` + * + * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSinkName($var) + { + GPBUtil::checkString($var, True); + $this->sink_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteViewRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteViewRequest.php new file mode 100644 index 000000000000..bafd213c7851 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteViewRequest.php @@ -0,0 +1,79 @@ +google.logging.v2.DeleteViewRequest + */ +class DeleteViewRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full resource name of the view to delete: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full resource name of the view to delete: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full resource name of the view to delete: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` + * + * 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 resource name of the view to delete: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` + * + * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetBucketRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetBucketRequest.php new file mode 100644 index 000000000000..782c41088c2b --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetBucketRequest.php @@ -0,0 +1,91 @@ +google.logging.v2.GetBucketRequest + */ +class GetBucketRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the bucket: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the bucket: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the bucket: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + * + * 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 bucket: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + * + * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetCmekSettingsRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetCmekSettingsRequest.php new file mode 100644 index 000000000000..cafdee7bf6e4 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetCmekSettingsRequest.php @@ -0,0 +1,111 @@ +google.logging.v2.GetCmekSettingsRequest + */ +class GetCmekSettingsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource for which to retrieve CMEK settings. + * "projects/[PROJECT_ID]/cmekSettings" + * "organizations/[ORGANIZATION_ID]/cmekSettings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + * "folders/[FOLDER_ID]/cmekSettings" + * For example: + * `"organizations/12345/cmekSettings"` + * Note: CMEK for the Log Router can be configured for Google Cloud projects, + * folders, organizations and billing accounts. Once configured for an + * organization, it applies to all projects and folders in the Google Cloud + * organization. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource for which to retrieve CMEK settings. + * "projects/[PROJECT_ID]/cmekSettings" + * "organizations/[ORGANIZATION_ID]/cmekSettings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + * "folders/[FOLDER_ID]/cmekSettings" + * For example: + * `"organizations/12345/cmekSettings"` + * Note: CMEK for the Log Router can be configured for Google Cloud projects, + * folders, organizations and billing accounts. Once configured for an + * organization, it applies to all projects and folders in the Google Cloud + * organization. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource for which to retrieve CMEK settings. + * "projects/[PROJECT_ID]/cmekSettings" + * "organizations/[ORGANIZATION_ID]/cmekSettings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + * "folders/[FOLDER_ID]/cmekSettings" + * For example: + * `"organizations/12345/cmekSettings"` + * Note: CMEK for the Log Router can be configured for Google Cloud projects, + * folders, organizations and billing accounts. Once configured for an + * organization, it applies to all projects and folders in the Google Cloud + * organization. + * + * 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 for which to retrieve CMEK settings. + * "projects/[PROJECT_ID]/cmekSettings" + * "organizations/[ORGANIZATION_ID]/cmekSettings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + * "folders/[FOLDER_ID]/cmekSettings" + * For example: + * `"organizations/12345/cmekSettings"` + * Note: CMEK for the Log Router can be configured for Google Cloud projects, + * folders, organizations and billing accounts. Once configured for an + * organization, it applies to all projects and folders in the Google Cloud + * organization. + * + * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetExclusionRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetExclusionRequest.php new file mode 100644 index 000000000000..11606278b0eb --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetExclusionRequest.php @@ -0,0 +1,91 @@ +google.logging.v2.GetExclusionRequest + */ +class GetExclusionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of an existing exclusion: + * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * For example: + * `"projects/my-project/exclusions/my-exclusion"` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of an existing exclusion: + * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * For example: + * `"projects/my-project/exclusions/my-exclusion"` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of an existing exclusion: + * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * For example: + * `"projects/my-project/exclusions/my-exclusion"` + * + * 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 an existing exclusion: + * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * For example: + * `"projects/my-project/exclusions/my-exclusion"` + * + * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetLinkRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetLinkRequest.php new file mode 100644 index 000000000000..89e72a251546 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetLinkRequest.php @@ -0,0 +1,83 @@ +google.logging.v2.GetLinkRequest + */ +class GetLinkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the link: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the link: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the link: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_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 link: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_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/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetLogMetricRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetLogMetricRequest.php new file mode 100644 index 000000000000..5220c283d7ba --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetLogMetricRequest.php @@ -0,0 +1,71 @@ +google.logging.v2.GetLogMetricRequest + */ +class GetLogMetricRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the desired metric: + * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * + * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $metric_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $metric_name + * Required. The resource name of the desired metric: + * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingMetrics::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the desired metric: + * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * + * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getMetricName() + { + return $this->metric_name; + } + + /** + * Required. The resource name of the desired metric: + * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * + * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setMetricName($var) + { + GPBUtil::checkString($var, True); + $this->metric_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetSettingsRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetSettingsRequest.php new file mode 100644 index 000000000000..d75c103c02a6 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetSettingsRequest.php @@ -0,0 +1,111 @@ +google.logging.v2.GetSettingsRequest + */ +class GetSettingsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource for which to retrieve settings. + * "projects/[PROJECT_ID]/settings" + * "organizations/[ORGANIZATION_ID]/settings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/settings" + * "folders/[FOLDER_ID]/settings" + * For example: + * `"organizations/12345/settings"` + * Note: Settings for the Log Router can be get for Google Cloud projects, + * folders, organizations and billing accounts. Currently it can only be + * configured for organizations. Once configured for an organization, it + * applies to all projects and folders in the Google Cloud organization. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource for which to retrieve settings. + * "projects/[PROJECT_ID]/settings" + * "organizations/[ORGANIZATION_ID]/settings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/settings" + * "folders/[FOLDER_ID]/settings" + * For example: + * `"organizations/12345/settings"` + * Note: Settings for the Log Router can be get for Google Cloud projects, + * folders, organizations and billing accounts. Currently it can only be + * configured for organizations. Once configured for an organization, it + * applies to all projects and folders in the Google Cloud organization. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource for which to retrieve settings. + * "projects/[PROJECT_ID]/settings" + * "organizations/[ORGANIZATION_ID]/settings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/settings" + * "folders/[FOLDER_ID]/settings" + * For example: + * `"organizations/12345/settings"` + * Note: Settings for the Log Router can be get for Google Cloud projects, + * folders, organizations and billing accounts. Currently it can only be + * configured for organizations. Once configured for an organization, it + * applies to all projects and folders in the Google Cloud organization. + * + * 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 for which to retrieve settings. + * "projects/[PROJECT_ID]/settings" + * "organizations/[ORGANIZATION_ID]/settings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/settings" + * "folders/[FOLDER_ID]/settings" + * For example: + * `"organizations/12345/settings"` + * Note: Settings for the Log Router can be get for Google Cloud projects, + * folders, organizations and billing accounts. Currently it can only be + * configured for organizations. Once configured for an organization, it + * applies to all projects and folders in the Google Cloud organization. + * + * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetSinkRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetSinkRequest.php new file mode 100644 index 000000000000..3a2b33f46f28 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetSinkRequest.php @@ -0,0 +1,91 @@ +google.logging.v2.GetSinkRequest + */ +class GetSinkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the sink: + * "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * For example: + * `"projects/my-project/sinks/my-sink"` + * + * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $sink_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $sink_name + * Required. The resource name of the sink: + * "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * For example: + * `"projects/my-project/sinks/my-sink"` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the sink: + * "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * For example: + * `"projects/my-project/sinks/my-sink"` + * + * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSinkName() + { + return $this->sink_name; + } + + /** + * Required. The resource name of the sink: + * "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * For example: + * `"projects/my-project/sinks/my-sink"` + * + * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSinkName($var) + { + GPBUtil::checkString($var, True); + $this->sink_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetViewRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetViewRequest.php new file mode 100644 index 000000000000..3ed30a2531a5 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetViewRequest.php @@ -0,0 +1,79 @@ +google.logging.v2.GetViewRequest + */ +class GetViewRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the policy: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the policy: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the policy: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` + * + * 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 policy: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` + * + * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/IndexConfig.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/IndexConfig.php new file mode 100644 index 000000000000..a322960c0b42 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/IndexConfig.php @@ -0,0 +1,173 @@ +google.logging.v2.IndexConfig + */ +class IndexConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The LogEntry field path to index. + * Note that some paths are automatically indexed, and other paths are not + * eligible for indexing. See [indexing documentation]( + * https://cloud.google.com/logging/docs/view/advanced-queries#indexed-fields) + * for details. + * For example: `jsonPayload.request.status` + * + * Generated from protobuf field string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $field_path = ''; + /** + * Required. The type of data in this index. + * + * Generated from protobuf field .google.logging.v2.IndexType type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $type = 0; + /** + * Output only. The timestamp when the index was last modified. + * This is used to return the timestamp, and will be ignored if supplied + * during update. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $field_path + * Required. The LogEntry field path to index. + * Note that some paths are automatically indexed, and other paths are not + * eligible for indexing. See [indexing documentation]( + * https://cloud.google.com/logging/docs/view/advanced-queries#indexed-fields) + * for details. + * For example: `jsonPayload.request.status` + * @type int $type + * Required. The type of data in this index. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp when the index was last modified. + * This is used to return the timestamp, and will be ignored if supplied + * during update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The LogEntry field path to index. + * Note that some paths are automatically indexed, and other paths are not + * eligible for indexing. See [indexing documentation]( + * https://cloud.google.com/logging/docs/view/advanced-queries#indexed-fields) + * for details. + * For example: `jsonPayload.request.status` + * + * Generated from protobuf field string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFieldPath() + { + return $this->field_path; + } + + /** + * Required. The LogEntry field path to index. + * Note that some paths are automatically indexed, and other paths are not + * eligible for indexing. See [indexing documentation]( + * https://cloud.google.com/logging/docs/view/advanced-queries#indexed-fields) + * for details. + * For example: `jsonPayload.request.status` + * + * Generated from protobuf field string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFieldPath($var) + { + GPBUtil::checkString($var, True); + $this->field_path = $var; + + return $this; + } + + /** + * Required. The type of data in this index. + * + * Generated from protobuf field .google.logging.v2.IndexType type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Required. The type of data in this index. + * + * Generated from protobuf field .google.logging.v2.IndexType type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Logging\V2\IndexType::class); + $this->type = $var; + + return $this; + } + + /** + * Output only. The timestamp when the index was last modified. + * This is used to return the timestamp, and will be ignored if supplied + * during update. + * + * 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 when the index was last modified. + * This is used to return the timestamp, and will be ignored if supplied + * during update. + * + * 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; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/IndexType.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/IndexType.php new file mode 100644 index 000000000000..bbda5df5852a --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/IndexType.php @@ -0,0 +1,62 @@ +google.logging.v2.IndexType + */ +class IndexType +{ + /** + * The index's type is unspecified. + * + * Generated from protobuf enum INDEX_TYPE_UNSPECIFIED = 0; + */ + const INDEX_TYPE_UNSPECIFIED = 0; + /** + * The index is a string-type index. + * + * Generated from protobuf enum INDEX_TYPE_STRING = 1; + */ + const INDEX_TYPE_STRING = 1; + /** + * The index is a integer-type index. + * + * Generated from protobuf enum INDEX_TYPE_INTEGER = 2; + */ + const INDEX_TYPE_INTEGER = 2; + + private static $valueToName = [ + self::INDEX_TYPE_UNSPECIFIED => 'INDEX_TYPE_UNSPECIFIED', + self::INDEX_TYPE_STRING => 'INDEX_TYPE_STRING', + self::INDEX_TYPE_INTEGER => 'INDEX_TYPE_INTEGER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __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/Logging/v2/proto/src/Google/Cloud/Logging/V2/LifecycleState.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LifecycleState.php new file mode 100644 index 000000000000..0fe746cebd4d --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LifecycleState.php @@ -0,0 +1,86 @@ +google.logging.v2.LifecycleState + */ +class LifecycleState +{ + /** + * Unspecified state. This is only used/useful for distinguishing unset + * values. + * + * Generated from protobuf enum LIFECYCLE_STATE_UNSPECIFIED = 0; + */ + const LIFECYCLE_STATE_UNSPECIFIED = 0; + /** + * The normal and active state. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * The resource has been marked for deletion by the user. For some resources + * (e.g. buckets), this can be reversed by an un-delete operation. + * + * Generated from protobuf enum DELETE_REQUESTED = 2; + */ + const DELETE_REQUESTED = 2; + /** + * The resource has been marked for an update by the user. It will remain in + * this state until the update is complete. + * + * Generated from protobuf enum UPDATING = 3; + */ + const UPDATING = 3; + /** + * The resource has been marked for creation by the user. It will remain in + * this state until the creation is complete. + * + * Generated from protobuf enum CREATING = 4; + */ + const CREATING = 4; + /** + * The resource is in an INTERNAL error state. + * + * Generated from protobuf enum FAILED = 5; + */ + const FAILED = 5; + + private static $valueToName = [ + self::LIFECYCLE_STATE_UNSPECIFIED => 'LIFECYCLE_STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::DELETE_REQUESTED => 'DELETE_REQUESTED', + self::UPDATING => 'UPDATING', + self::CREATING => 'CREATING', + 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); + } +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/Link.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/Link.php new file mode 100644 index 000000000000..666ffc0feb1a --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/Link.php @@ -0,0 +1,271 @@ +google.logging.v2.Link + */ +class Link extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the link. The name can have up to 100 characters. + * A valid link id (at the end of the link name) must only have alphanumeric + * characters and underscores within it. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * For example: + * `projects/my-project/locations/global/buckets/my-bucket/links/my_link + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Describes this link. + * The maximum length of the description is 8000 characters. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * Output only. The creation timestamp of the link. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The resource lifecycle state. + * + * Generated from protobuf field .google.logging.v2.LifecycleState lifecycle_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $lifecycle_state = 0; + /** + * The information of a BigQuery Dataset. When a link is created, a BigQuery + * dataset is created along with it, in the same project as the LogBucket it's + * linked to. This dataset will also have BigQuery Views corresponding to the + * LogViews in the bucket. + * + * Generated from protobuf field .google.logging.v2.BigQueryDataset bigquery_dataset = 5; + */ + protected $bigquery_dataset = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name of the link. The name can have up to 100 characters. + * A valid link id (at the end of the link name) must only have alphanumeric + * characters and underscores within it. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * For example: + * `projects/my-project/locations/global/buckets/my-bucket/links/my_link + * @type string $description + * Describes this link. + * The maximum length of the description is 8000 characters. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The creation timestamp of the link. + * @type int $lifecycle_state + * Output only. The resource lifecycle state. + * @type \Google\Cloud\Logging\V2\BigQueryDataset $bigquery_dataset + * The information of a BigQuery Dataset. When a link is created, a BigQuery + * dataset is created along with it, in the same project as the LogBucket it's + * linked to. This dataset will also have BigQuery Views corresponding to the + * LogViews in the bucket. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the link. The name can have up to 100 characters. + * A valid link id (at the end of the link name) must only have alphanumeric + * characters and underscores within it. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * For example: + * `projects/my-project/locations/global/buckets/my-bucket/links/my_link + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the link. The name can have up to 100 characters. + * A valid link id (at the end of the link name) must only have alphanumeric + * characters and underscores within it. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * For example: + * `projects/my-project/locations/global/buckets/my-bucket/links/my_link + * + * 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; + } + + /** + * Describes this link. + * The maximum length of the description is 8000 characters. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Describes this link. + * The maximum length of the description is 8000 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; + } + + /** + * Output only. The creation timestamp of the link. + * + * 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 creation timestamp of the link. + * + * 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 resource lifecycle state. + * + * Generated from protobuf field .google.logging.v2.LifecycleState lifecycle_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getLifecycleState() + { + return $this->lifecycle_state; + } + + /** + * Output only. The resource lifecycle state. + * + * Generated from protobuf field .google.logging.v2.LifecycleState lifecycle_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setLifecycleState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Logging\V2\LifecycleState::class); + $this->lifecycle_state = $var; + + return $this; + } + + /** + * The information of a BigQuery Dataset. When a link is created, a BigQuery + * dataset is created along with it, in the same project as the LogBucket it's + * linked to. This dataset will also have BigQuery Views corresponding to the + * LogViews in the bucket. + * + * Generated from protobuf field .google.logging.v2.BigQueryDataset bigquery_dataset = 5; + * @return \Google\Cloud\Logging\V2\BigQueryDataset|null + */ + public function getBigqueryDataset() + { + return $this->bigquery_dataset; + } + + public function hasBigqueryDataset() + { + return isset($this->bigquery_dataset); + } + + public function clearBigqueryDataset() + { + unset($this->bigquery_dataset); + } + + /** + * The information of a BigQuery Dataset. When a link is created, a BigQuery + * dataset is created along with it, in the same project as the LogBucket it's + * linked to. This dataset will also have BigQuery Views corresponding to the + * LogViews in the bucket. + * + * Generated from protobuf field .google.logging.v2.BigQueryDataset bigquery_dataset = 5; + * @param \Google\Cloud\Logging\V2\BigQueryDataset $var + * @return $this + */ + public function setBigqueryDataset($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\BigQueryDataset::class); + $this->bigquery_dataset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LinkMetadata.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LinkMetadata.php new file mode 100644 index 000000000000..0b30b1b01e72 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LinkMetadata.php @@ -0,0 +1,230 @@ +google.logging.v2.LinkMetadata + */ +class LinkMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The start time of an operation. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * The end time of an operation. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + /** + * State of an operation. + * + * Generated from protobuf field .google.logging.v2.OperationState state = 3; + */ + protected $state = 0; + protected $request; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * The start time of an operation. + * @type \Google\Protobuf\Timestamp $end_time + * The end time of an operation. + * @type int $state + * State of an operation. + * @type \Google\Cloud\Logging\V2\CreateLinkRequest $create_link_request + * CreateLink RPC request. + * @type \Google\Cloud\Logging\V2\DeleteLinkRequest $delete_link_request + * DeleteLink RPC request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * The start time of an operation. + * + * 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); + } + + /** + * The start time of an operation. + * + * 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; + } + + /** + * The end time of an operation. + * + * 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); + } + + /** + * The end time of an operation. + * + * 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; + } + + /** + * State of an operation. + * + * Generated from protobuf field .google.logging.v2.OperationState state = 3; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * State of an operation. + * + * Generated from protobuf field .google.logging.v2.OperationState state = 3; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Logging\V2\OperationState::class); + $this->state = $var; + + return $this; + } + + /** + * CreateLink RPC request. + * + * Generated from protobuf field .google.logging.v2.CreateLinkRequest create_link_request = 4; + * @return \Google\Cloud\Logging\V2\CreateLinkRequest|null + */ + public function getCreateLinkRequest() + { + return $this->readOneof(4); + } + + public function hasCreateLinkRequest() + { + return $this->hasOneof(4); + } + + /** + * CreateLink RPC request. + * + * Generated from protobuf field .google.logging.v2.CreateLinkRequest create_link_request = 4; + * @param \Google\Cloud\Logging\V2\CreateLinkRequest $var + * @return $this + */ + public function setCreateLinkRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\CreateLinkRequest::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * DeleteLink RPC request. + * + * Generated from protobuf field .google.logging.v2.DeleteLinkRequest delete_link_request = 5; + * @return \Google\Cloud\Logging\V2\DeleteLinkRequest|null + */ + public function getDeleteLinkRequest() + { + return $this->readOneof(5); + } + + public function hasDeleteLinkRequest() + { + return $this->hasOneof(5); + } + + /** + * DeleteLink RPC request. + * + * Generated from protobuf field .google.logging.v2.DeleteLinkRequest delete_link_request = 5; + * @param \Google\Cloud\Logging\V2\DeleteLinkRequest $var + * @return $this + */ + public function setDeleteLinkRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\DeleteLinkRequest::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getRequest() + { + return $this->whichOneof("request"); + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListBucketsRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListBucketsRequest.php new file mode 100644 index 000000000000..1e5ef1160cf4 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListBucketsRequest.php @@ -0,0 +1,183 @@ +google.logging.v2.ListBucketsRequest + */ +class ListBucketsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource whose buckets are to be listed: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + * Note: The locations portion of the resource must be specified, but + * supplying the character `-` in place of [LOCATION_ID] will return all + * buckets. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource whose buckets are to be listed: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + * Note: The locations portion of the resource must be specified, but + * supplying the character `-` in place of [LOCATION_ID] will return all + * buckets. + * @type string $page_token + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * @type int $page_size + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource whose buckets are to be listed: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + * Note: The locations portion of the resource must be specified, but + * supplying the character `-` in place of [LOCATION_ID] will return all + * buckets. + * + * 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 whose buckets are to be listed: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + * Note: The locations portion of the resource must be specified, but + * supplying the character `-` in place of [LOCATION_ID] will return all + * buckets. + * + * 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. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * + * 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 results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * + * 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 results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * + * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListBucketsResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListBucketsResponse.php new file mode 100644 index 000000000000..28df3a300104 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListBucketsResponse.php @@ -0,0 +1,109 @@ +google.logging.v2.ListBucketsResponse + */ +class ListBucketsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of buckets. + * + * Generated from protobuf field repeated .google.logging.v2.LogBucket buckets = 1; + */ + private $buckets; + /** + * If there might be more results than appear in this response, then + * `nextPageToken` is included. To get the next set of results, call the same + * method again using the value of `nextPageToken` as `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\Logging\V2\LogBucket>|\Google\Protobuf\Internal\RepeatedField $buckets + * A list of buckets. + * @type string $next_page_token + * If there might be more results than appear in this response, then + * `nextPageToken` is included. To get the next set of results, call the same + * method again using the value of `nextPageToken` as `pageToken`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * A list of buckets. + * + * Generated from protobuf field repeated .google.logging.v2.LogBucket buckets = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBuckets() + { + return $this->buckets; + } + + /** + * A list of buckets. + * + * Generated from protobuf field repeated .google.logging.v2.LogBucket buckets = 1; + * @param array<\Google\Cloud\Logging\V2\LogBucket>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBuckets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogBucket::class); + $this->buckets = $arr; + + return $this; + } + + /** + * If there might be more results than appear in this response, then + * `nextPageToken` is included. To get the next set of results, call the same + * method again using the value of `nextPageToken` as `pageToken`. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there might be more results than appear in this response, then + * `nextPageToken` is included. To get the next set of results, call the same + * method again using the value of `nextPageToken` as `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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListExclusionsRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListExclusionsRequest.php new file mode 100644 index 000000000000..6cf6f685825f --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListExclusionsRequest.php @@ -0,0 +1,171 @@ +google.logging.v2.ListExclusionsRequest + */ +class ListExclusionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource whose exclusions are to be listed. + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource whose exclusions are to be listed. + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + * @type string $page_token + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * @type int $page_size + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource whose exclusions are to be listed. + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_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 whose exclusions are to be listed. + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_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. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * + * 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 results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * + * 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 results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * + * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListExclusionsResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListExclusionsResponse.php new file mode 100644 index 000000000000..55311d43e55f --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListExclusionsResponse.php @@ -0,0 +1,109 @@ +google.logging.v2.ListExclusionsResponse + */ +class ListExclusionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of exclusions. + * + * Generated from protobuf field repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + private $exclusions; + /** + * If there might be more results than appear in this response, then + * `nextPageToken` is included. To get the next set of results, call the same + * method again using the value of `nextPageToken` as `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\Logging\V2\LogExclusion>|\Google\Protobuf\Internal\RepeatedField $exclusions + * A list of exclusions. + * @type string $next_page_token + * If there might be more results than appear in this response, then + * `nextPageToken` is included. To get the next set of results, call the same + * method again using the value of `nextPageToken` as `pageToken`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * A list of exclusions. + * + * Generated from protobuf field repeated .google.logging.v2.LogExclusion exclusions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExclusions() + { + return $this->exclusions; + } + + /** + * A list of exclusions. + * + * Generated from protobuf field repeated .google.logging.v2.LogExclusion exclusions = 1; + * @param array<\Google\Cloud\Logging\V2\LogExclusion>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExclusions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogExclusion::class); + $this->exclusions = $arr; + + return $this; + } + + /** + * If there might be more results than appear in this response, then + * `nextPageToken` is included. To get the next set of results, call the same + * method again using the value of `nextPageToken` as `pageToken`. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there might be more results than appear in this response, then + * `nextPageToken` is included. To get the next set of results, call the same + * method again using the value of `nextPageToken` as `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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLinksRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLinksRequest.php new file mode 100644 index 000000000000..3d3ddae8c05a --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLinksRequest.php @@ -0,0 +1,159 @@ +google.logging.v2.ListLinksRequest + */ +class ListLinksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource whose links are to be listed: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/ + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The maximum number of results to return from this request. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource whose links are to be listed: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/ + * @type string $page_token + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. + * @type int $page_size + * Optional. The maximum number of results to return from this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource whose links are to be listed: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_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 whose links are to be listed: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_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. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. + * + * 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 results to return from this request. + * + * 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 results to return from this request. + * + * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLinksResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLinksResponse.php new file mode 100644 index 000000000000..0007fb97d2aa --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLinksResponse.php @@ -0,0 +1,109 @@ +google.logging.v2.ListLinksResponse + */ +class ListLinksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of links. + * + * Generated from protobuf field repeated .google.logging.v2.Link links = 1; + */ + private $links; + /** + * If there might be more results than those appearing in this response, then + * `nextPageToken` is included. To get the next set of results, call the same + * method again using the value of `nextPageToken` as `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\Logging\V2\Link>|\Google\Protobuf\Internal\RepeatedField $links + * A list of links. + * @type string $next_page_token + * If there might be more results than those appearing in this response, then + * `nextPageToken` is included. To get the next set of results, call the same + * method again using the value of `nextPageToken` as `pageToken`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * A list of links. + * + * Generated from protobuf field repeated .google.logging.v2.Link links = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLinks() + { + return $this->links; + } + + /** + * A list of links. + * + * Generated from protobuf field repeated .google.logging.v2.Link links = 1; + * @param array<\Google\Cloud\Logging\V2\Link>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLinks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\Link::class); + $this->links = $arr; + + return $this; + } + + /** + * If there might be more results than those appearing in this response, then + * `nextPageToken` is included. To get the next set of results, call the same + * method again using the value of `nextPageToken` as `pageToken`. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there might be more results than those appearing in this response, then + * `nextPageToken` is included. To get the next set of results, call the same + * method again using the value of `nextPageToken` as `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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogEntriesRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogEntriesRequest.php new file mode 100644 index 000000000000..08859ba8ba62 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogEntriesRequest.php @@ -0,0 +1,311 @@ +google.logging.v2.ListLogEntriesRequest + */ +class ListLogEntriesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Names of one or more parent resources from which to + * retrieve log entries: + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * May alternatively be one or more views: + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * Projects listed in the `project_ids` field are added to this list. + * A maximum of 100 resources may be specified in a single request. + * + * Generated from protobuf field repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $resource_names; + /** + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. + * Referencing a parent resource that is not listed in `resource_names` will + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. How the results should be sorted. Presently, the only permitted + * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first + * option returns entries in order of increasing values of + * `LogEntry.timestamp` (oldest first), and the second option returns entries + * in order of decreasing timestamps (newest first). Entries with equal + * timestamps are returned in order of their `insert_id` values. + * + * Generated from protobuf field string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. The maximum number of results to return from this request. + * Default is 50. If the value is negative or exceeds 1000, the request is + * rejected. The presence of `next_page_token` in the response indicates that + * more results might be available. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. If present, then retrieve 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 should be identical to those in the previous call. + * + * 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 array|\Google\Protobuf\Internal\RepeatedField $resource_names + * Required. Names of one or more parent resources from which to + * retrieve log entries: + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * May alternatively be one or more views: + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * Projects listed in the `project_ids` field are added to this list. + * A maximum of 100 resources may be specified in a single request. + * @type string $filter + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. + * Referencing a parent resource that is not listed in `resource_names` will + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. + * @type string $order_by + * Optional. How the results should be sorted. Presently, the only permitted + * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first + * option returns entries in order of increasing values of + * `LogEntry.timestamp` (oldest first), and the second option returns entries + * in order of decreasing timestamps (newest first). Entries with equal + * timestamps are returned in order of their `insert_id` values. + * @type int $page_size + * Optional. The maximum number of results to return from this request. + * Default is 50. If the value is negative or exceeds 1000, the request is + * rejected. The presence of `next_page_token` in the response indicates that + * more results might be available. + * @type string $page_token + * Optional. If present, then retrieve 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 should be identical to those in the previous call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\Logging::initOnce(); + parent::__construct($data); + } + + /** + * Required. Names of one or more parent resources from which to + * retrieve log entries: + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * May alternatively be one or more views: + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * Projects listed in the `project_ids` field are added to this list. + * A maximum of 100 resources may be specified in a single request. + * + * Generated from protobuf field repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourceNames() + { + return $this->resource_names; + } + + /** + * Required. Names of one or more parent resources from which to + * retrieve log entries: + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * May alternatively be one or more views: + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * Projects listed in the `project_ids` field are added to this list. + * A maximum of 100 resources may be specified in a single request. + * + * Generated from protobuf field repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourceNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_names = $arr; + + return $this; + } + + /** + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. + * Referencing a parent resource that is not listed in `resource_names` will + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. + * Referencing a parent resource that is not listed in `resource_names` will + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. + * + * Generated from protobuf field string filter = 2 [(.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 the results should be sorted. Presently, the only permitted + * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first + * option returns entries in order of increasing values of + * `LogEntry.timestamp` (oldest first), and the second option returns entries + * in order of decreasing timestamps (newest first). Entries with equal + * timestamps are returned in order of their `insert_id` values. + * + * Generated from protobuf field string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. How the results should be sorted. Presently, the only permitted + * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first + * option returns entries in order of increasing values of + * `LogEntry.timestamp` (oldest first), and the second option returns entries + * in order of decreasing timestamps (newest first). Entries with equal + * timestamps are returned in order of their `insert_id` values. + * + * Generated from protobuf field string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Optional. The maximum number of results to return from this request. + * Default is 50. If the value is negative or exceeds 1000, the request is + * rejected. The presence of `next_page_token` in the response indicates that + * more results might be available. + * + * Generated from protobuf field int32 page_size = 4 [(.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. + * Default is 50. If the value is negative or exceeds 1000, the request is + * rejected. The presence of `next_page_token` in the response indicates that + * more results might be available. + * + * 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. If present, then retrieve 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 should be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. If present, then retrieve 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 should be identical to those in the previous call. + * + * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogEntriesResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogEntriesResponse.php new file mode 100644 index 000000000000..74ceb744157d --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogEntriesResponse.php @@ -0,0 +1,141 @@ +google.logging.v2.ListLogEntriesResponse + */ +class ListLogEntriesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of log entries. If `entries` is empty, `nextPageToken` may still be + * returned, indicating that more entries may exist. See `nextPageToken` for + * more information. + * + * Generated from protobuf field repeated .google.logging.v2.LogEntry entries = 1; + */ + private $entries; + /** + * If there might be more results than those appearing in this response, then + * `nextPageToken` is included. To get the next set of results, call this + * method again using the value of `nextPageToken` as `pageToken`. + * If a value for `next_page_token` appears and the `entries` field is empty, + * it means that the search found no log entries so far but it did not have + * time to search all the possible log entries. Retry the method with this + * value for `page_token` to continue the search. Alternatively, consider + * speeding up the search by changing your filter to specify a single log name + * or resource type, or to narrow the time range of the search. + * + * 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\Logging\V2\LogEntry>|\Google\Protobuf\Internal\RepeatedField $entries + * A list of log entries. If `entries` is empty, `nextPageToken` may still be + * returned, indicating that more entries may exist. See `nextPageToken` for + * more information. + * @type string $next_page_token + * If there might be more results than those appearing in this response, then + * `nextPageToken` is included. To get the next set of results, call this + * method again using the value of `nextPageToken` as `pageToken`. + * If a value for `next_page_token` appears and the `entries` field is empty, + * it means that the search found no log entries so far but it did not have + * time to search all the possible log entries. Retry the method with this + * value for `page_token` to continue the search. Alternatively, consider + * speeding up the search by changing your filter to specify a single log name + * or resource type, or to narrow the time range of the search. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\Logging::initOnce(); + parent::__construct($data); + } + + /** + * A list of log entries. If `entries` is empty, `nextPageToken` may still be + * returned, indicating that more entries may exist. See `nextPageToken` for + * more information. + * + * Generated from protobuf field repeated .google.logging.v2.LogEntry entries = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntries() + { + return $this->entries; + } + + /** + * A list of log entries. If `entries` is empty, `nextPageToken` may still be + * returned, indicating that more entries may exist. See `nextPageToken` for + * more information. + * + * Generated from protobuf field repeated .google.logging.v2.LogEntry entries = 1; + * @param array<\Google\Cloud\Logging\V2\LogEntry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogEntry::class); + $this->entries = $arr; + + return $this; + } + + /** + * If there might be more results than those appearing in this response, then + * `nextPageToken` is included. To get the next set of results, call this + * method again using the value of `nextPageToken` as `pageToken`. + * If a value for `next_page_token` appears and the `entries` field is empty, + * it means that the search found no log entries so far but it did not have + * time to search all the possible log entries. Retry the method with this + * value for `page_token` to continue the search. Alternatively, consider + * speeding up the search by changing your filter to specify a single log name + * or resource type, or to narrow the time range of the search. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there might be more results than those appearing in this response, then + * `nextPageToken` is included. To get the next set of results, call this + * method again using the value of `nextPageToken` as `pageToken`. + * If a value for `next_page_token` appears and the `entries` field is empty, + * it means that the search found no log entries so far but it did not have + * time to search all the possible log entries. Retry the method with this + * value for `page_token` to continue the search. Alternatively, consider + * speeding up the search by changing your filter to specify a single log name + * or resource type, or to narrow the time range of the search. + * + * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogMetricsRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogMetricsRequest.php new file mode 100644 index 000000000000..58efa6ad09d5 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogMetricsRequest.php @@ -0,0 +1,159 @@ +google.logging.v2.ListLogMetricsRequest + */ +class ListLogMetricsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project containing the metrics: + * "projects/[PROJECT_ID]" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the project containing the metrics: + * "projects/[PROJECT_ID]" + * @type string $page_token + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * @type int $page_size + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingMetrics::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project containing the metrics: + * "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 containing the metrics: + * "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; + } + + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * + * 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 results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * + * 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 results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * + * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogMetricsResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogMetricsResponse.php new file mode 100644 index 000000000000..62b84c3eb3e0 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogMetricsResponse.php @@ -0,0 +1,109 @@ +google.logging.v2.ListLogMetricsResponse + */ +class ListLogMetricsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of logs-based metrics. + * + * Generated from protobuf field repeated .google.logging.v2.LogMetric metrics = 1; + */ + private $metrics; + /** + * If there might be more results than appear in this response, then + * `nextPageToken` is included. To get the next set of results, call this + * method again using the value of `nextPageToken` as `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\Logging\V2\LogMetric>|\Google\Protobuf\Internal\RepeatedField $metrics + * A list of logs-based metrics. + * @type string $next_page_token + * If there might be more results than appear in this response, then + * `nextPageToken` is included. To get the next set of results, call this + * method again using the value of `nextPageToken` as `pageToken`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingMetrics::initOnce(); + parent::__construct($data); + } + + /** + * A list of logs-based metrics. + * + * Generated from protobuf field repeated .google.logging.v2.LogMetric metrics = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMetrics() + { + return $this->metrics; + } + + /** + * A list of logs-based metrics. + * + * Generated from protobuf field repeated .google.logging.v2.LogMetric metrics = 1; + * @param array<\Google\Cloud\Logging\V2\LogMetric>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogMetric::class); + $this->metrics = $arr; + + return $this; + } + + /** + * If there might be more results than appear in this response, then + * `nextPageToken` is included. To get the next set of results, call this + * method again using the value of `nextPageToken` as `pageToken`. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there might be more results than appear in this response, then + * `nextPageToken` is included. To get the next set of results, call this + * method again using the value of `nextPageToken` as `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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogsRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogsRequest.php new file mode 100644 index 000000000000..457a22414856 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogsRequest.php @@ -0,0 +1,245 @@ +google.logging.v2.ListLogsRequest + */ +class ListLogsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name to list logs for: + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. List of resource names to list logs for: + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * To support legacy queries, it could also be: + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * The resource name in the `parent` field is added to this list. + * + * Generated from protobuf field repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $resource_names; + /** + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name to list logs for: + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * @type array|\Google\Protobuf\Internal\RepeatedField $resource_names + * Optional. List of resource names to list logs for: + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * To support legacy queries, it could also be: + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * The resource name in the `parent` field is added to this list. + * @type int $page_size + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * @type string $page_token + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\Logging::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name to list logs for: + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_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 to list logs for: + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_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. List of resource names to list logs for: + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * To support legacy queries, it could also be: + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * The resource name in the `parent` field is added to this list. + * + * Generated from protobuf field repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourceNames() + { + return $this->resource_names; + } + + /** + * Optional. List of resource names to list logs for: + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * To support legacy queries, it could also be: + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * The resource name in the `parent` field is added to this list. + * + * Generated from protobuf field repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourceNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_names = $arr; + + return $this; + } + + /** + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * + * 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. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * + * 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, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should 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, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should 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; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogsResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogsResponse.php new file mode 100644 index 000000000000..64ae58f309ed --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogsResponse.php @@ -0,0 +1,117 @@ +google.logging.v2.ListLogsResponse + */ +class ListLogsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of log names. For example, + * `"projects/my-project/logs/syslog"` or + * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`. + * + * Generated from protobuf field repeated string log_names = 3; + */ + private $log_names; + /** + * If there might be more results than those appearing in this response, then + * `nextPageToken` is included. To get the next set of results, call this + * method again using the value of `nextPageToken` as `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\Protobuf\Internal\RepeatedField $log_names + * A list of log names. For example, + * `"projects/my-project/logs/syslog"` or + * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`. + * @type string $next_page_token + * If there might be more results than those appearing in this response, then + * `nextPageToken` is included. To get the next set of results, call this + * method again using the value of `nextPageToken` as `pageToken`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\Logging::initOnce(); + parent::__construct($data); + } + + /** + * A list of log names. For example, + * `"projects/my-project/logs/syslog"` or + * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`. + * + * Generated from protobuf field repeated string log_names = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLogNames() + { + return $this->log_names; + } + + /** + * A list of log names. For example, + * `"projects/my-project/logs/syslog"` or + * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`. + * + * Generated from protobuf field repeated string log_names = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLogNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->log_names = $arr; + + return $this; + } + + /** + * If there might be more results than those appearing in this response, then + * `nextPageToken` is included. To get the next set of results, call this + * method again using the value of `nextPageToken` as `pageToken`. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there might be more results than those appearing in this response, then + * `nextPageToken` is included. To get the next set of results, call this + * method again using the value of `nextPageToken` as `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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListMonitoredResourceDescriptorsRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListMonitoredResourceDescriptorsRequest.php new file mode 100644 index 000000000000..fb1027a08115 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListMonitoredResourceDescriptorsRequest.php @@ -0,0 +1,121 @@ +google.logging.v2.ListMonitoredResourceDescriptorsRequest + */ +class ListMonitoredResourceDescriptorsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * + * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $page_size + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * @type string $page_token + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\Logging::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * + * 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 results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * + * 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. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * + * 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; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListMonitoredResourceDescriptorsResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListMonitoredResourceDescriptorsResponse.php new file mode 100644 index 000000000000..a70971f90d43 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListMonitoredResourceDescriptorsResponse.php @@ -0,0 +1,109 @@ +google.logging.v2.ListMonitoredResourceDescriptorsResponse + */ +class ListMonitoredResourceDescriptorsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of resource descriptors. + * + * Generated from protobuf field repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + private $resource_descriptors; + /** + * If there might be more results than those appearing in this response, then + * `nextPageToken` is included. To get the next set of results, call this + * method again using the value of `nextPageToken` as `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\Api\MonitoredResourceDescriptor>|\Google\Protobuf\Internal\RepeatedField $resource_descriptors + * A list of resource descriptors. + * @type string $next_page_token + * If there might be more results than those appearing in this response, then + * `nextPageToken` is included. To get the next set of results, call this + * method again using the value of `nextPageToken` as `pageToken`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\Logging::initOnce(); + parent::__construct($data); + } + + /** + * A list of resource descriptors. + * + * Generated from protobuf field repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourceDescriptors() + { + return $this->resource_descriptors; + } + + /** + * A list of resource descriptors. + * + * Generated from protobuf field repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + * @param array<\Google\Api\MonitoredResourceDescriptor>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourceDescriptors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\MonitoredResourceDescriptor::class); + $this->resource_descriptors = $arr; + + return $this; + } + + /** + * If there might be more results than those appearing in this response, then + * `nextPageToken` is included. To get the next set of results, call this + * method again using the value of `nextPageToken` as `pageToken`. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there might be more results than those appearing in this response, then + * `nextPageToken` is included. To get the next set of results, call this + * method again using the value of `nextPageToken` as `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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListSinksRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListSinksRequest.php new file mode 100644 index 000000000000..1039925ff64b --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListSinksRequest.php @@ -0,0 +1,171 @@ +google.logging.v2.ListSinksRequest + */ +class ListSinksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource whose sinks are to be listed: + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource whose sinks are to be listed: + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + * @type string $page_token + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * @type int $page_size + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource whose sinks are to be listed: + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_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 whose sinks are to be listed: + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_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. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * + * 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 results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * + * 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 results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * + * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListSinksResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListSinksResponse.php new file mode 100644 index 000000000000..0f7ff3bce972 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListSinksResponse.php @@ -0,0 +1,109 @@ +google.logging.v2.ListSinksResponse + */ +class ListSinksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of sinks. + * + * Generated from protobuf field repeated .google.logging.v2.LogSink sinks = 1; + */ + private $sinks; + /** + * If there might be more results than appear in this response, then + * `nextPageToken` is included. To get the next set of results, call the same + * method again using the value of `nextPageToken` as `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\Logging\V2\LogSink>|\Google\Protobuf\Internal\RepeatedField $sinks + * A list of sinks. + * @type string $next_page_token + * If there might be more results than appear in this response, then + * `nextPageToken` is included. To get the next set of results, call the same + * method again using the value of `nextPageToken` as `pageToken`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * A list of sinks. + * + * Generated from protobuf field repeated .google.logging.v2.LogSink sinks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSinks() + { + return $this->sinks; + } + + /** + * A list of sinks. + * + * Generated from protobuf field repeated .google.logging.v2.LogSink sinks = 1; + * @param array<\Google\Cloud\Logging\V2\LogSink>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSinks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogSink::class); + $this->sinks = $arr; + + return $this; + } + + /** + * If there might be more results than appear in this response, then + * `nextPageToken` is included. To get the next set of results, call the same + * method again using the value of `nextPageToken` as `pageToken`. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there might be more results than appear in this response, then + * `nextPageToken` is included. To get the next set of results, call the same + * method again using the value of `nextPageToken` as `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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListViewsRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListViewsRequest.php new file mode 100644 index 000000000000..9cb9d7e0540b --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListViewsRequest.php @@ -0,0 +1,159 @@ +google.logging.v2.ListViewsRequest + */ +class ListViewsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The bucket whose views are to be listed: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The bucket whose views are to be listed: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * @type string $page_token + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * @type int $page_size + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The bucket whose views are to be listed: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The bucket whose views are to be listed: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * + * 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. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * + * 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 results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * + * 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 results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * + * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListViewsResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListViewsResponse.php new file mode 100644 index 000000000000..246cfb190d38 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListViewsResponse.php @@ -0,0 +1,109 @@ +google.logging.v2.ListViewsResponse + */ +class ListViewsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of views. + * + * Generated from protobuf field repeated .google.logging.v2.LogView views = 1; + */ + private $views; + /** + * If there might be more results than appear in this response, then + * `nextPageToken` is included. To get the next set of results, call the same + * method again using the value of `nextPageToken` as `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\Logging\V2\LogView>|\Google\Protobuf\Internal\RepeatedField $views + * A list of views. + * @type string $next_page_token + * If there might be more results than appear in this response, then + * `nextPageToken` is included. To get the next set of results, call the same + * method again using the value of `nextPageToken` as `pageToken`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * A list of views. + * + * Generated from protobuf field repeated .google.logging.v2.LogView views = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getViews() + { + return $this->views; + } + + /** + * A list of views. + * + * Generated from protobuf field repeated .google.logging.v2.LogView views = 1; + * @param array<\Google\Cloud\Logging\V2\LogView>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setViews($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogView::class); + $this->views = $arr; + + return $this; + } + + /** + * If there might be more results than appear in this response, then + * `nextPageToken` is included. To get the next set of results, call the same + * method again using the value of `nextPageToken` as `pageToken`. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there might be more results than appear in this response, then + * `nextPageToken` is included. To get the next set of results, call the same + * method again using the value of `nextPageToken` as `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/Logging/v2/proto/src/Google/Cloud/Logging/V2/LocationMetadata.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LocationMetadata.php new file mode 100644 index 000000000000..9c896b21b87c --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LocationMetadata.php @@ -0,0 +1,71 @@ +google.logging.v2.LocationMetadata + */ +class LocationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates whether or not Log Analytics features are supported in the given + * location. + * + * Generated from protobuf field bool log_analytics_enabled = 1; + */ + protected $log_analytics_enabled = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $log_analytics_enabled + * Indicates whether or not Log Analytics features are supported in the given + * location. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Indicates whether or not Log Analytics features are supported in the given + * location. + * + * Generated from protobuf field bool log_analytics_enabled = 1; + * @return bool + */ + public function getLogAnalyticsEnabled() + { + return $this->log_analytics_enabled; + } + + /** + * Indicates whether or not Log Analytics features are supported in the given + * location. + * + * Generated from protobuf field bool log_analytics_enabled = 1; + * @param bool $var + * @return $this + */ + public function setLogAnalyticsEnabled($var) + { + GPBUtil::checkBool($var); + $this->log_analytics_enabled = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogBucket.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogBucket.php new file mode 100644 index 000000000000..775a7fd41535 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogBucket.php @@ -0,0 +1,525 @@ +google.logging.v2.LogBucket + */ +class LogBucket extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the bucket. + * For example: + * `projects/my-project/locations/global/buckets/my-bucket` + * For a list of supported locations, see [Supported + * Regions](https://cloud.google.com/logging/docs/region-support) + * For the location of `global` it is unspecified where log entries are + * actually stored. + * After a bucket has been created, the location cannot be changed. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Describes this bucket. + * + * Generated from protobuf field string description = 3; + */ + protected $description = ''; + /** + * Output only. The creation timestamp of the bucket. This is not set for any + * of the default buckets. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The last update timestamp of the bucket. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Logs will be retained by default for this amount of time, after which they + * will automatically be deleted. The minimum retention period is 1 day. If + * this value is set to zero at bucket creation time, the default time of 30 + * days will be used. + * + * Generated from protobuf field int32 retention_days = 11; + */ + protected $retention_days = 0; + /** + * Whether the bucket is locked. + * The retention period on a locked bucket cannot be changed. Locked buckets + * may only be deleted if they are empty. + * + * Generated from protobuf field bool locked = 9; + */ + protected $locked = false; + /** + * Output only. The bucket lifecycle state. + * + * Generated from protobuf field .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $lifecycle_state = 0; + /** + * Whether log analytics is enabled for this bucket. + * Once enabled, log analytics features cannot be disabled. + * + * Generated from protobuf field bool analytics_enabled = 14; + */ + protected $analytics_enabled = false; + /** + * Log entry field paths that are denied access in this bucket. + * The following fields and their children are eligible: `textPayload`, + * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`. + * Restricting a repeated field will restrict all values. Adding a parent will + * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`) + * + * Generated from protobuf field repeated string restricted_fields = 15; + */ + private $restricted_fields; + /** + * A list of indexed fields and related configuration data. + * + * Generated from protobuf field repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + private $index_configs; + /** + * The CMEK settings of the log bucket. If present, new log entries written to + * this log bucket are encrypted using the CMEK key provided in this + * configuration. If a log bucket has CMEK settings, the CMEK settings cannot + * be disabled later by updating the log bucket. Changing the KMS key is + * allowed. + * + * Generated from protobuf field .google.logging.v2.CmekSettings cmek_settings = 19; + */ + protected $cmek_settings = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of the bucket. + * For example: + * `projects/my-project/locations/global/buckets/my-bucket` + * For a list of supported locations, see [Supported + * Regions](https://cloud.google.com/logging/docs/region-support) + * For the location of `global` it is unspecified where log entries are + * actually stored. + * After a bucket has been created, the location cannot be changed. + * @type string $description + * Describes this bucket. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The creation timestamp of the bucket. This is not set for any + * of the default buckets. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last update timestamp of the bucket. + * @type int $retention_days + * Logs will be retained by default for this amount of time, after which they + * will automatically be deleted. The minimum retention period is 1 day. If + * this value is set to zero at bucket creation time, the default time of 30 + * days will be used. + * @type bool $locked + * Whether the bucket is locked. + * The retention period on a locked bucket cannot be changed. Locked buckets + * may only be deleted if they are empty. + * @type int $lifecycle_state + * Output only. The bucket lifecycle state. + * @type bool $analytics_enabled + * Whether log analytics is enabled for this bucket. + * Once enabled, log analytics features cannot be disabled. + * @type array|\Google\Protobuf\Internal\RepeatedField $restricted_fields + * Log entry field paths that are denied access in this bucket. + * The following fields and their children are eligible: `textPayload`, + * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`. + * Restricting a repeated field will restrict all values. Adding a parent will + * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`) + * @type array<\Google\Cloud\Logging\V2\IndexConfig>|\Google\Protobuf\Internal\RepeatedField $index_configs + * A list of indexed fields and related configuration data. + * @type \Google\Cloud\Logging\V2\CmekSettings $cmek_settings + * The CMEK settings of the log bucket. If present, new log entries written to + * this log bucket are encrypted using the CMEK key provided in this + * configuration. If a log bucket has CMEK settings, the CMEK settings cannot + * be disabled later by updating the log bucket. Changing the KMS key is + * allowed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the bucket. + * For example: + * `projects/my-project/locations/global/buckets/my-bucket` + * For a list of supported locations, see [Supported + * Regions](https://cloud.google.com/logging/docs/region-support) + * For the location of `global` it is unspecified where log entries are + * actually stored. + * After a bucket has been created, the location cannot be changed. + * + * 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 bucket. + * For example: + * `projects/my-project/locations/global/buckets/my-bucket` + * For a list of supported locations, see [Supported + * Regions](https://cloud.google.com/logging/docs/region-support) + * For the location of `global` it is unspecified where log entries are + * actually stored. + * After a bucket has been created, the location cannot be changed. + * + * 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; + } + + /** + * Describes this bucket. + * + * Generated from protobuf field string description = 3; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Describes this bucket. + * + * Generated from protobuf field string description = 3; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The creation timestamp of the bucket. This is not set for any + * of the default buckets. + * + * 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 creation timestamp of the bucket. This is not set for any + * of the default buckets. + * + * 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 last update timestamp of the bucket. + * + * 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 last update timestamp of the bucket. + * + * 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; + } + + /** + * Logs will be retained by default for this amount of time, after which they + * will automatically be deleted. The minimum retention period is 1 day. If + * this value is set to zero at bucket creation time, the default time of 30 + * days will be used. + * + * Generated from protobuf field int32 retention_days = 11; + * @return int + */ + public function getRetentionDays() + { + return $this->retention_days; + } + + /** + * Logs will be retained by default for this amount of time, after which they + * will automatically be deleted. The minimum retention period is 1 day. If + * this value is set to zero at bucket creation time, the default time of 30 + * days will be used. + * + * Generated from protobuf field int32 retention_days = 11; + * @param int $var + * @return $this + */ + public function setRetentionDays($var) + { + GPBUtil::checkInt32($var); + $this->retention_days = $var; + + return $this; + } + + /** + * Whether the bucket is locked. + * The retention period on a locked bucket cannot be changed. Locked buckets + * may only be deleted if they are empty. + * + * Generated from protobuf field bool locked = 9; + * @return bool + */ + public function getLocked() + { + return $this->locked; + } + + /** + * Whether the bucket is locked. + * The retention period on a locked bucket cannot be changed. Locked buckets + * may only be deleted if they are empty. + * + * Generated from protobuf field bool locked = 9; + * @param bool $var + * @return $this + */ + public function setLocked($var) + { + GPBUtil::checkBool($var); + $this->locked = $var; + + return $this; + } + + /** + * Output only. The bucket lifecycle state. + * + * Generated from protobuf field .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getLifecycleState() + { + return $this->lifecycle_state; + } + + /** + * Output only. The bucket lifecycle state. + * + * Generated from protobuf field .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setLifecycleState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Logging\V2\LifecycleState::class); + $this->lifecycle_state = $var; + + return $this; + } + + /** + * Whether log analytics is enabled for this bucket. + * Once enabled, log analytics features cannot be disabled. + * + * Generated from protobuf field bool analytics_enabled = 14; + * @return bool + */ + public function getAnalyticsEnabled() + { + return $this->analytics_enabled; + } + + /** + * Whether log analytics is enabled for this bucket. + * Once enabled, log analytics features cannot be disabled. + * + * Generated from protobuf field bool analytics_enabled = 14; + * @param bool $var + * @return $this + */ + public function setAnalyticsEnabled($var) + { + GPBUtil::checkBool($var); + $this->analytics_enabled = $var; + + return $this; + } + + /** + * Log entry field paths that are denied access in this bucket. + * The following fields and their children are eligible: `textPayload`, + * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`. + * Restricting a repeated field will restrict all values. Adding a parent will + * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`) + * + * Generated from protobuf field repeated string restricted_fields = 15; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRestrictedFields() + { + return $this->restricted_fields; + } + + /** + * Log entry field paths that are denied access in this bucket. + * The following fields and their children are eligible: `textPayload`, + * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`. + * Restricting a repeated field will restrict all values. Adding a parent will + * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`) + * + * Generated from protobuf field repeated string restricted_fields = 15; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRestrictedFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->restricted_fields = $arr; + + return $this; + } + + /** + * A list of indexed fields and related configuration data. + * + * Generated from protobuf field repeated .google.logging.v2.IndexConfig index_configs = 17; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIndexConfigs() + { + return $this->index_configs; + } + + /** + * A list of indexed fields and related configuration data. + * + * Generated from protobuf field repeated .google.logging.v2.IndexConfig index_configs = 17; + * @param array<\Google\Cloud\Logging\V2\IndexConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIndexConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\IndexConfig::class); + $this->index_configs = $arr; + + return $this; + } + + /** + * The CMEK settings of the log bucket. If present, new log entries written to + * this log bucket are encrypted using the CMEK key provided in this + * configuration. If a log bucket has CMEK settings, the CMEK settings cannot + * be disabled later by updating the log bucket. Changing the KMS key is + * allowed. + * + * Generated from protobuf field .google.logging.v2.CmekSettings cmek_settings = 19; + * @return \Google\Cloud\Logging\V2\CmekSettings|null + */ + public function getCmekSettings() + { + return $this->cmek_settings; + } + + public function hasCmekSettings() + { + return isset($this->cmek_settings); + } + + public function clearCmekSettings() + { + unset($this->cmek_settings); + } + + /** + * The CMEK settings of the log bucket. If present, new log entries written to + * this log bucket are encrypted using the CMEK key provided in this + * configuration. If a log bucket has CMEK settings, the CMEK settings cannot + * be disabled later by updating the log bucket. Changing the KMS key is + * allowed. + * + * Generated from protobuf field .google.logging.v2.CmekSettings cmek_settings = 19; + * @param \Google\Cloud\Logging\V2\CmekSettings $var + * @return $this + */ + public function setCmekSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\CmekSettings::class); + $this->cmek_settings = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntry.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntry.php new file mode 100644 index 000000000000..3fc817730b2d --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntry.php @@ -0,0 +1,1061 @@ +google.logging.v2.LogEntry + */ +class LogEntry extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the log to which this log entry belongs: + * "projects/[PROJECT_ID]/logs/[LOG_ID]" + * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + * "folders/[FOLDER_ID]/logs/[LOG_ID]" + * A project number may be used in place of PROJECT_ID. The project number is + * translated to its corresponding PROJECT_ID internally and the `log_name` + * field will contain PROJECT_ID in queries and exports. + * `[LOG_ID]` must be URL-encoded within `log_name`. Example: + * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. + * `[LOG_ID]` must be less than 512 characters long and can only include the + * following characters: upper and lower case alphanumeric characters, + * forward-slash, underscore, hyphen, and period. + * For backward compatibility, if `log_name` begins with a forward-slash, such + * as `/projects/...`, then the log entry is ingested as usual, but the + * forward-slash is removed. Listing the log entry will not show the leading + * slash and filtering for a log name with a leading slash will never return + * any results. + * + * Generated from protobuf field string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $log_name = ''; + /** + * Required. The monitored resource that produced this log entry. + * Example: a log entry that reports a database error would be associated with + * the monitored resource designating the particular database that reported + * the error. + * + * Generated from protobuf field .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = null; + /** + * Optional. The time the event described by the log entry occurred. This time + * is used to compute the log entry's age and to enforce the logs retention + * period. If this field is omitted in a new log entry, then Logging assigns + * it the current time. Timestamps have nanosecond accuracy, but trailing + * zeros in the fractional seconds might be omitted when the timestamp is + * displayed. + * Incoming log entries must have timestamps that don't exceed the + * [logs retention + * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in + * the past, and that don't exceed 24 hours in the future. Log entries outside + * those time boundaries aren't ingested by Logging. + * + * Generated from protobuf field .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $timestamp = null; + /** + * Output only. The time the log entry was received by Logging. + * + * Generated from protobuf field .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $receive_timestamp = null; + /** + * Optional. The severity of the log entry. The default value is + * `LogSeverity.DEFAULT`. + * + * Generated from protobuf field .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $severity = 0; + /** + * Optional. A unique identifier for the log entry. If you provide a value, + * then Logging considers other log entries in the same project, with the same + * `timestamp`, and with the same `insert_id` to be duplicates which are + * removed in a single query result. However, there are no guarantees of + * de-duplication in the export of logs. + * If the `insert_id` is omitted when writing a log entry, the Logging API + * assigns its own unique identifier in this field. + * In queries, the `insert_id` is also used to order log entries that have + * the same `log_name` and `timestamp` values. + * + * Generated from protobuf field string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $insert_id = ''; + /** + * Optional. Information about the HTTP request associated with this log + * entry, if applicable. + * + * Generated from protobuf field .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $http_request = null; + /** + * Optional. A map of key, value pairs that provides additional information + * about the log entry. The labels can be user-defined or system-defined. + * User-defined labels are arbitrary key, value pairs that you can use to + * classify logs. + * System-defined labels are defined by GCP services for platform logs. + * They have two components - a service namespace component and the + * attribute name. For example: `compute.googleapis.com/resource_name`. + * Cloud Logging truncates label keys that exceed 512 B and label + * values that exceed 64 KB upon their associated log entry being + * written. The truncation is indicated by an ellipsis at the + * end of the character string. + * + * Generated from protobuf field map labels = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. Information about an operation associated with the log entry, if + * applicable. + * + * Generated from protobuf field .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $operation = null; + /** + * Optional. The REST resource name of the trace being written to + * [Cloud Trace](https://cloud.google.com/trace) in + * association with this log entry. For example, if your trace data is stored + * in the Cloud project "my-trace-project" and if the service that is creating + * the log entry receives a trace header that includes the trace ID "12345", + * then the service should use "projects/my-tracing-project/traces/12345". + * The `trace` field provides the link between logs and traces. By using + * this field, you can navigate from a log entry to a trace. + * + * Generated from protobuf field string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $trace = ''; + /** + * Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span + * associated with the current operation in which the log is being written. + * For example, if a span has the REST resource name of + * "projects/some-project/traces/some-trace/spans/some-span-id", then the + * `span_id` field is "some-span-id". + * A + * [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span) + * represents a single operation within a trace. Whereas a trace may involve + * multiple different microservices running on multiple different machines, + * a span generally corresponds to a single logical operation being performed + * in a single instance of a microservice on one specific machine. Spans + * are the nodes within the tree that is a trace. + * Applications that are [instrumented for + * tracing](https://cloud.google.com/trace/docs/setup) will generally assign a + * new, unique span ID on each incoming request. It is also common to create + * and record additional spans corresponding to internal processing elements + * as well as issuing requests to dependencies. + * The span ID is expected to be a 16-character, hexadecimal encoding of an + * 8-byte array and should not be zero. It should be unique within the trace + * and should, ideally, be generated in a manner that is uniformly random. + * Example values: + * - `000000000000004a` + * - `7a2190356c3fc94b` + * - `0000f00300090021` + * - `d39223e101960076` + * + * Generated from protobuf field string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $span_id = ''; + /** + * Optional. The sampling decision of the trace associated with the log entry. + * True means that the trace resource name in the `trace` field was sampled + * for storage in a trace backend. False means that the trace was not sampled + * for storage when this log entry was written, or the sampling decision was + * unknown at the time. A non-sampled `trace` value is still useful as a + * request correlation identifier. The default is False. + * + * Generated from protobuf field bool trace_sampled = 30 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $trace_sampled = false; + /** + * Optional. Source code location information associated with the log entry, + * if any. + * + * Generated from protobuf field .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $source_location = null; + /** + * Optional. Information indicating this LogEntry is part of a sequence of + * multiple log entries split from a single LogEntry. + * + * Generated from protobuf field .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $split = null; + protected $payload; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $log_name + * Required. The resource name of the log to which this log entry belongs: + * "projects/[PROJECT_ID]/logs/[LOG_ID]" + * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + * "folders/[FOLDER_ID]/logs/[LOG_ID]" + * A project number may be used in place of PROJECT_ID. The project number is + * translated to its corresponding PROJECT_ID internally and the `log_name` + * field will contain PROJECT_ID in queries and exports. + * `[LOG_ID]` must be URL-encoded within `log_name`. Example: + * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. + * `[LOG_ID]` must be less than 512 characters long and can only include the + * following characters: upper and lower case alphanumeric characters, + * forward-slash, underscore, hyphen, and period. + * For backward compatibility, if `log_name` begins with a forward-slash, such + * as `/projects/...`, then the log entry is ingested as usual, but the + * forward-slash is removed. Listing the log entry will not show the leading + * slash and filtering for a log name with a leading slash will never return + * any results. + * @type \Google\Api\MonitoredResource $resource + * Required. The monitored resource that produced this log entry. + * Example: a log entry that reports a database error would be associated with + * the monitored resource designating the particular database that reported + * the error. + * @type \Google\Protobuf\Any $proto_payload + * The log entry payload, represented as a protocol buffer. Some Google + * Cloud Platform services use this field for their log entry payloads. + * The following protocol buffer types are supported; user-defined types + * are not supported: + * "type.googleapis.com/google.cloud.audit.AuditLog" + * "type.googleapis.com/google.appengine.logging.v1.RequestLog" + * @type string $text_payload + * The log entry payload, represented as a Unicode string (UTF-8). + * @type \Google\Protobuf\Struct $json_payload + * The log entry payload, represented as a structure that is + * expressed as a JSON object. + * @type \Google\Protobuf\Timestamp $timestamp + * Optional. The time the event described by the log entry occurred. This time + * is used to compute the log entry's age and to enforce the logs retention + * period. If this field is omitted in a new log entry, then Logging assigns + * it the current time. Timestamps have nanosecond accuracy, but trailing + * zeros in the fractional seconds might be omitted when the timestamp is + * displayed. + * Incoming log entries must have timestamps that don't exceed the + * [logs retention + * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in + * the past, and that don't exceed 24 hours in the future. Log entries outside + * those time boundaries aren't ingested by Logging. + * @type \Google\Protobuf\Timestamp $receive_timestamp + * Output only. The time the log entry was received by Logging. + * @type int $severity + * Optional. The severity of the log entry. The default value is + * `LogSeverity.DEFAULT`. + * @type string $insert_id + * Optional. A unique identifier for the log entry. If you provide a value, + * then Logging considers other log entries in the same project, with the same + * `timestamp`, and with the same `insert_id` to be duplicates which are + * removed in a single query result. However, there are no guarantees of + * de-duplication in the export of logs. + * If the `insert_id` is omitted when writing a log entry, the Logging API + * assigns its own unique identifier in this field. + * In queries, the `insert_id` is also used to order log entries that have + * the same `log_name` and `timestamp` values. + * @type \Google\Cloud\Logging\Type\HttpRequest $http_request + * Optional. Information about the HTTP request associated with this log + * entry, if applicable. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. A map of key, value pairs that provides additional information + * about the log entry. The labels can be user-defined or system-defined. + * User-defined labels are arbitrary key, value pairs that you can use to + * classify logs. + * System-defined labels are defined by GCP services for platform logs. + * They have two components - a service namespace component and the + * attribute name. For example: `compute.googleapis.com/resource_name`. + * Cloud Logging truncates label keys that exceed 512 B and label + * values that exceed 64 KB upon their associated log entry being + * written. The truncation is indicated by an ellipsis at the + * end of the character string. + * @type \Google\Cloud\Logging\V2\LogEntryOperation $operation + * Optional. Information about an operation associated with the log entry, if + * applicable. + * @type string $trace + * Optional. The REST resource name of the trace being written to + * [Cloud Trace](https://cloud.google.com/trace) in + * association with this log entry. For example, if your trace data is stored + * in the Cloud project "my-trace-project" and if the service that is creating + * the log entry receives a trace header that includes the trace ID "12345", + * then the service should use "projects/my-tracing-project/traces/12345". + * The `trace` field provides the link between logs and traces. By using + * this field, you can navigate from a log entry to a trace. + * @type string $span_id + * Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span + * associated with the current operation in which the log is being written. + * For example, if a span has the REST resource name of + * "projects/some-project/traces/some-trace/spans/some-span-id", then the + * `span_id` field is "some-span-id". + * A + * [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span) + * represents a single operation within a trace. Whereas a trace may involve + * multiple different microservices running on multiple different machines, + * a span generally corresponds to a single logical operation being performed + * in a single instance of a microservice on one specific machine. Spans + * are the nodes within the tree that is a trace. + * Applications that are [instrumented for + * tracing](https://cloud.google.com/trace/docs/setup) will generally assign a + * new, unique span ID on each incoming request. It is also common to create + * and record additional spans corresponding to internal processing elements + * as well as issuing requests to dependencies. + * The span ID is expected to be a 16-character, hexadecimal encoding of an + * 8-byte array and should not be zero. It should be unique within the trace + * and should, ideally, be generated in a manner that is uniformly random. + * Example values: + * - `000000000000004a` + * - `7a2190356c3fc94b` + * - `0000f00300090021` + * - `d39223e101960076` + * @type bool $trace_sampled + * Optional. The sampling decision of the trace associated with the log entry. + * True means that the trace resource name in the `trace` field was sampled + * for storage in a trace backend. False means that the trace was not sampled + * for storage when this log entry was written, or the sampling decision was + * unknown at the time. A non-sampled `trace` value is still useful as a + * request correlation identifier. The default is False. + * @type \Google\Cloud\Logging\V2\LogEntrySourceLocation $source_location + * Optional. Source code location information associated with the log entry, + * if any. + * @type \Google\Cloud\Logging\V2\LogSplit $split + * Optional. Information indicating this LogEntry is part of a sequence of + * multiple log entries split from a single LogEntry. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LogEntry::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the log to which this log entry belongs: + * "projects/[PROJECT_ID]/logs/[LOG_ID]" + * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + * "folders/[FOLDER_ID]/logs/[LOG_ID]" + * A project number may be used in place of PROJECT_ID. The project number is + * translated to its corresponding PROJECT_ID internally and the `log_name` + * field will contain PROJECT_ID in queries and exports. + * `[LOG_ID]` must be URL-encoded within `log_name`. Example: + * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. + * `[LOG_ID]` must be less than 512 characters long and can only include the + * following characters: upper and lower case alphanumeric characters, + * forward-slash, underscore, hyphen, and period. + * For backward compatibility, if `log_name` begins with a forward-slash, such + * as `/projects/...`, then the log entry is ingested as usual, but the + * forward-slash is removed. Listing the log entry will not show the leading + * slash and filtering for a log name with a leading slash will never return + * any results. + * + * Generated from protobuf field string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLogName() + { + return $this->log_name; + } + + /** + * Required. The resource name of the log to which this log entry belongs: + * "projects/[PROJECT_ID]/logs/[LOG_ID]" + * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + * "folders/[FOLDER_ID]/logs/[LOG_ID]" + * A project number may be used in place of PROJECT_ID. The project number is + * translated to its corresponding PROJECT_ID internally and the `log_name` + * field will contain PROJECT_ID in queries and exports. + * `[LOG_ID]` must be URL-encoded within `log_name`. Example: + * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. + * `[LOG_ID]` must be less than 512 characters long and can only include the + * following characters: upper and lower case alphanumeric characters, + * forward-slash, underscore, hyphen, and period. + * For backward compatibility, if `log_name` begins with a forward-slash, such + * as `/projects/...`, then the log entry is ingested as usual, but the + * forward-slash is removed. Listing the log entry will not show the leading + * slash and filtering for a log name with a leading slash will never return + * any results. + * + * Generated from protobuf field string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLogName($var) + { + GPBUtil::checkString($var, True); + $this->log_name = $var; + + return $this; + } + + /** + * Required. The monitored resource that produced this log entry. + * Example: a log entry that reports a database error would be associated with + * the monitored resource designating the particular database that reported + * the error. + * + * Generated from protobuf field .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Api\MonitoredResource|null + */ + public function getResource() + { + return $this->resource; + } + + public function hasResource() + { + return isset($this->resource); + } + + public function clearResource() + { + unset($this->resource); + } + + /** + * Required. The monitored resource that produced this log entry. + * Example: a log entry that reports a database error would be associated with + * the monitored resource designating the particular database that reported + * the error. + * + * Generated from protobuf field .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Api\MonitoredResource $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkMessage($var, \Google\Api\MonitoredResource::class); + $this->resource = $var; + + return $this; + } + + /** + * The log entry payload, represented as a protocol buffer. Some Google + * Cloud Platform services use this field for their log entry payloads. + * The following protocol buffer types are supported; user-defined types + * are not supported: + * "type.googleapis.com/google.cloud.audit.AuditLog" + * "type.googleapis.com/google.appengine.logging.v1.RequestLog" + * + * Generated from protobuf field .google.protobuf.Any proto_payload = 2; + * @return \Google\Protobuf\Any|null + */ + public function getProtoPayload() + { + return $this->readOneof(2); + } + + public function hasProtoPayload() + { + return $this->hasOneof(2); + } + + /** + * The log entry payload, represented as a protocol buffer. Some Google + * Cloud Platform services use this field for their log entry payloads. + * The following protocol buffer types are supported; user-defined types + * are not supported: + * "type.googleapis.com/google.cloud.audit.AuditLog" + * "type.googleapis.com/google.appengine.logging.v1.RequestLog" + * + * Generated from protobuf field .google.protobuf.Any proto_payload = 2; + * @param \Google\Protobuf\Any $var + * @return $this + */ + public function setProtoPayload($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Any::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The log entry payload, represented as a Unicode string (UTF-8). + * + * Generated from protobuf field string text_payload = 3; + * @return string + */ + public function getTextPayload() + { + return $this->readOneof(3); + } + + public function hasTextPayload() + { + return $this->hasOneof(3); + } + + /** + * The log entry payload, represented as a Unicode string (UTF-8). + * + * Generated from protobuf field string text_payload = 3; + * @param string $var + * @return $this + */ + public function setTextPayload($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * The log entry payload, represented as a structure that is + * expressed as a JSON object. + * + * Generated from protobuf field .google.protobuf.Struct json_payload = 6; + * @return \Google\Protobuf\Struct|null + */ + public function getJsonPayload() + { + return $this->readOneof(6); + } + + public function hasJsonPayload() + { + return $this->hasOneof(6); + } + + /** + * The log entry payload, represented as a structure that is + * expressed as a JSON object. + * + * Generated from protobuf field .google.protobuf.Struct json_payload = 6; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setJsonPayload($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Optional. The time the event described by the log entry occurred. This time + * is used to compute the log entry's age and to enforce the logs retention + * period. If this field is omitted in a new log entry, then Logging assigns + * it the current time. Timestamps have nanosecond accuracy, but trailing + * zeros in the fractional seconds might be omitted when the timestamp is + * displayed. + * Incoming log entries must have timestamps that don't exceed the + * [logs retention + * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in + * the past, and that don't exceed 24 hours in the future. Log entries outside + * those time boundaries aren't ingested by Logging. + * + * Generated from protobuf field .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getTimestamp() + { + return $this->timestamp; + } + + public function hasTimestamp() + { + return isset($this->timestamp); + } + + public function clearTimestamp() + { + unset($this->timestamp); + } + + /** + * Optional. The time the event described by the log entry occurred. This time + * is used to compute the log entry's age and to enforce the logs retention + * period. If this field is omitted in a new log entry, then Logging assigns + * it the current time. Timestamps have nanosecond accuracy, but trailing + * zeros in the fractional seconds might be omitted when the timestamp is + * displayed. + * Incoming log entries must have timestamps that don't exceed the + * [logs retention + * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in + * the past, and that don't exceed 24 hours in the future. Log entries outside + * those time boundaries aren't ingested by Logging. + * + * Generated from protobuf field .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setTimestamp($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->timestamp = $var; + + return $this; + } + + /** + * Output only. The time the log entry was received by Logging. + * + * Generated from protobuf field .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReceiveTimestamp() + { + return $this->receive_timestamp; + } + + public function hasReceiveTimestamp() + { + return isset($this->receive_timestamp); + } + + public function clearReceiveTimestamp() + { + unset($this->receive_timestamp); + } + + /** + * Output only. The time the log entry was received by Logging. + * + * Generated from protobuf field .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReceiveTimestamp($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->receive_timestamp = $var; + + return $this; + } + + /** + * Optional. The severity of the log entry. The default value is + * `LogSeverity.DEFAULT`. + * + * Generated from protobuf field .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSeverity() + { + return $this->severity; + } + + /** + * Optional. The severity of the log entry. The default value is + * `LogSeverity.DEFAULT`. + * + * Generated from protobuf field .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSeverity($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Logging\Type\LogSeverity::class); + $this->severity = $var; + + return $this; + } + + /** + * Optional. A unique identifier for the log entry. If you provide a value, + * then Logging considers other log entries in the same project, with the same + * `timestamp`, and with the same `insert_id` to be duplicates which are + * removed in a single query result. However, there are no guarantees of + * de-duplication in the export of logs. + * If the `insert_id` is omitted when writing a log entry, the Logging API + * assigns its own unique identifier in this field. + * In queries, the `insert_id` is also used to order log entries that have + * the same `log_name` and `timestamp` values. + * + * Generated from protobuf field string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getInsertId() + { + return $this->insert_id; + } + + /** + * Optional. A unique identifier for the log entry. If you provide a value, + * then Logging considers other log entries in the same project, with the same + * `timestamp`, and with the same `insert_id` to be duplicates which are + * removed in a single query result. However, there are no guarantees of + * de-duplication in the export of logs. + * If the `insert_id` is omitted when writing a log entry, the Logging API + * assigns its own unique identifier in this field. + * In queries, the `insert_id` is also used to order log entries that have + * the same `log_name` and `timestamp` values. + * + * Generated from protobuf field string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setInsertId($var) + { + GPBUtil::checkString($var, True); + $this->insert_id = $var; + + return $this; + } + + /** + * Optional. Information about the HTTP request associated with this log + * entry, if applicable. + * + * Generated from protobuf field .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Logging\Type\HttpRequest|null + */ + public function getHttpRequest() + { + return $this->http_request; + } + + public function hasHttpRequest() + { + return isset($this->http_request); + } + + public function clearHttpRequest() + { + unset($this->http_request); + } + + /** + * Optional. Information about the HTTP request associated with this log + * entry, if applicable. + * + * Generated from protobuf field .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Logging\Type\HttpRequest $var + * @return $this + */ + public function setHttpRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\Type\HttpRequest::class); + $this->http_request = $var; + + return $this; + } + + /** + * Optional. A map of key, value pairs that provides additional information + * about the log entry. The labels can be user-defined or system-defined. + * User-defined labels are arbitrary key, value pairs that you can use to + * classify logs. + * System-defined labels are defined by GCP services for platform logs. + * They have two components - a service namespace component and the + * attribute name. For example: `compute.googleapis.com/resource_name`. + * Cloud Logging truncates label keys that exceed 512 B and label + * values that exceed 64 KB upon their associated log entry being + * written. The truncation is indicated by an ellipsis at the + * end of the character string. + * + * Generated from protobuf field map labels = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. A map of key, value pairs that provides additional information + * about the log entry. The labels can be user-defined or system-defined. + * User-defined labels are arbitrary key, value pairs that you can use to + * classify logs. + * System-defined labels are defined by GCP services for platform logs. + * They have two components - a service namespace component and the + * attribute name. For example: `compute.googleapis.com/resource_name`. + * Cloud Logging truncates label keys that exceed 512 B and label + * values that exceed 64 KB upon their associated log entry being + * written. The truncation is indicated by an ellipsis at the + * end of the character string. + * + * Generated from protobuf field map labels = 11 [(.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. Information about an operation associated with the log entry, if + * applicable. + * + * Generated from protobuf field .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Logging\V2\LogEntryOperation|null + */ + public function getOperation() + { + return $this->operation; + } + + public function hasOperation() + { + return isset($this->operation); + } + + public function clearOperation() + { + unset($this->operation); + } + + /** + * Optional. Information about an operation associated with the log entry, if + * applicable. + * + * Generated from protobuf field .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Logging\V2\LogEntryOperation $var + * @return $this + */ + public function setOperation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogEntryOperation::class); + $this->operation = $var; + + return $this; + } + + /** + * Optional. The REST resource name of the trace being written to + * [Cloud Trace](https://cloud.google.com/trace) in + * association with this log entry. For example, if your trace data is stored + * in the Cloud project "my-trace-project" and if the service that is creating + * the log entry receives a trace header that includes the trace ID "12345", + * then the service should use "projects/my-tracing-project/traces/12345". + * The `trace` field provides the link between logs and traces. By using + * this field, you can navigate from a log entry to a trace. + * + * Generated from protobuf field string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getTrace() + { + return $this->trace; + } + + /** + * Optional. The REST resource name of the trace being written to + * [Cloud Trace](https://cloud.google.com/trace) in + * association with this log entry. For example, if your trace data is stored + * in the Cloud project "my-trace-project" and if the service that is creating + * the log entry receives a trace header that includes the trace ID "12345", + * then the service should use "projects/my-tracing-project/traces/12345". + * The `trace` field provides the link between logs and traces. By using + * this field, you can navigate from a log entry to a trace. + * + * Generated from protobuf field string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setTrace($var) + { + GPBUtil::checkString($var, True); + $this->trace = $var; + + return $this; + } + + /** + * Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span + * associated with the current operation in which the log is being written. + * For example, if a span has the REST resource name of + * "projects/some-project/traces/some-trace/spans/some-span-id", then the + * `span_id` field is "some-span-id". + * A + * [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span) + * represents a single operation within a trace. Whereas a trace may involve + * multiple different microservices running on multiple different machines, + * a span generally corresponds to a single logical operation being performed + * in a single instance of a microservice on one specific machine. Spans + * are the nodes within the tree that is a trace. + * Applications that are [instrumented for + * tracing](https://cloud.google.com/trace/docs/setup) will generally assign a + * new, unique span ID on each incoming request. It is also common to create + * and record additional spans corresponding to internal processing elements + * as well as issuing requests to dependencies. + * The span ID is expected to be a 16-character, hexadecimal encoding of an + * 8-byte array and should not be zero. It should be unique within the trace + * and should, ideally, be generated in a manner that is uniformly random. + * Example values: + * - `000000000000004a` + * - `7a2190356c3fc94b` + * - `0000f00300090021` + * - `d39223e101960076` + * + * Generated from protobuf field string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSpanId() + { + return $this->span_id; + } + + /** + * Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span + * associated with the current operation in which the log is being written. + * For example, if a span has the REST resource name of + * "projects/some-project/traces/some-trace/spans/some-span-id", then the + * `span_id` field is "some-span-id". + * A + * [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span) + * represents a single operation within a trace. Whereas a trace may involve + * multiple different microservices running on multiple different machines, + * a span generally corresponds to a single logical operation being performed + * in a single instance of a microservice on one specific machine. Spans + * are the nodes within the tree that is a trace. + * Applications that are [instrumented for + * tracing](https://cloud.google.com/trace/docs/setup) will generally assign a + * new, unique span ID on each incoming request. It is also common to create + * and record additional spans corresponding to internal processing elements + * as well as issuing requests to dependencies. + * The span ID is expected to be a 16-character, hexadecimal encoding of an + * 8-byte array and should not be zero. It should be unique within the trace + * and should, ideally, be generated in a manner that is uniformly random. + * Example values: + * - `000000000000004a` + * - `7a2190356c3fc94b` + * - `0000f00300090021` + * - `d39223e101960076` + * + * Generated from protobuf field string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSpanId($var) + { + GPBUtil::checkString($var, True); + $this->span_id = $var; + + return $this; + } + + /** + * Optional. The sampling decision of the trace associated with the log entry. + * True means that the trace resource name in the `trace` field was sampled + * for storage in a trace backend. False means that the trace was not sampled + * for storage when this log entry was written, or the sampling decision was + * unknown at the time. A non-sampled `trace` value is still useful as a + * request correlation identifier. The default is False. + * + * Generated from protobuf field bool trace_sampled = 30 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getTraceSampled() + { + return $this->trace_sampled; + } + + /** + * Optional. The sampling decision of the trace associated with the log entry. + * True means that the trace resource name in the `trace` field was sampled + * for storage in a trace backend. False means that the trace was not sampled + * for storage when this log entry was written, or the sampling decision was + * unknown at the time. A non-sampled `trace` value is still useful as a + * request correlation identifier. The default is False. + * + * Generated from protobuf field bool trace_sampled = 30 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setTraceSampled($var) + { + GPBUtil::checkBool($var); + $this->trace_sampled = $var; + + return $this; + } + + /** + * Optional. Source code location information associated with the log entry, + * if any. + * + * Generated from protobuf field .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Logging\V2\LogEntrySourceLocation|null + */ + public function getSourceLocation() + { + return $this->source_location; + } + + public function hasSourceLocation() + { + return isset($this->source_location); + } + + public function clearSourceLocation() + { + unset($this->source_location); + } + + /** + * Optional. Source code location information associated with the log entry, + * if any. + * + * Generated from protobuf field .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Logging\V2\LogEntrySourceLocation $var + * @return $this + */ + public function setSourceLocation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogEntrySourceLocation::class); + $this->source_location = $var; + + return $this; + } + + /** + * Optional. Information indicating this LogEntry is part of a sequence of + * multiple log entries split from a single LogEntry. + * + * Generated from protobuf field .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Logging\V2\LogSplit|null + */ + public function getSplit() + { + return $this->split; + } + + public function hasSplit() + { + return isset($this->split); + } + + public function clearSplit() + { + unset($this->split); + } + + /** + * Optional. Information indicating this LogEntry is part of a sequence of + * multiple log entries split from a single LogEntry. + * + * Generated from protobuf field .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Logging\V2\LogSplit $var + * @return $this + */ + public function setSplit($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogSplit::class); + $this->split = $var; + + return $this; + } + + /** + * @return string + */ + public function getPayload() + { + return $this->whichOneof("payload"); + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntryOperation.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntryOperation.php new file mode 100644 index 000000000000..81a4bf2d70ae --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntryOperation.php @@ -0,0 +1,182 @@ +google.logging.v2.LogEntryOperation + */ +class LogEntryOperation extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. An arbitrary operation identifier. Log entries with the same + * identifier are assumed to be part of the same operation. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $id = ''; + /** + * Optional. An arbitrary producer identifier. The combination of `id` and + * `producer` must be globally unique. Examples for `producer`: + * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. + * + * Generated from protobuf field string producer = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $producer = ''; + /** + * Optional. Set this to True if this is the first log entry in the operation. + * + * Generated from protobuf field bool first = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $first = false; + /** + * Optional. Set this to True if this is the last log entry in the operation. + * + * Generated from protobuf field bool last = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $last = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * Optional. An arbitrary operation identifier. Log entries with the same + * identifier are assumed to be part of the same operation. + * @type string $producer + * Optional. An arbitrary producer identifier. The combination of `id` and + * `producer` must be globally unique. Examples for `producer`: + * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. + * @type bool $first + * Optional. Set this to True if this is the first log entry in the operation. + * @type bool $last + * Optional. Set this to True if this is the last log entry in the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LogEntry::initOnce(); + parent::__construct($data); + } + + /** + * Optional. An arbitrary operation identifier. Log entries with the same + * identifier are assumed to be part of the same operation. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Optional. An arbitrary operation identifier. Log entries with the same + * identifier are assumed to be part of the same operation. + * + * 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; + } + + /** + * Optional. An arbitrary producer identifier. The combination of `id` and + * `producer` must be globally unique. Examples for `producer`: + * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. + * + * Generated from protobuf field string producer = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getProducer() + { + return $this->producer; + } + + /** + * Optional. An arbitrary producer identifier. The combination of `id` and + * `producer` must be globally unique. Examples for `producer`: + * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. + * + * Generated from protobuf field string producer = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setProducer($var) + { + GPBUtil::checkString($var, True); + $this->producer = $var; + + return $this; + } + + /** + * Optional. Set this to True if this is the first log entry in the operation. + * + * Generated from protobuf field bool first = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getFirst() + { + return $this->first; + } + + /** + * Optional. Set this to True if this is the first log entry in the operation. + * + * Generated from protobuf field bool first = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setFirst($var) + { + GPBUtil::checkBool($var); + $this->first = $var; + + return $this; + } + + /** + * Optional. Set this to True if this is the last log entry in the operation. + * + * Generated from protobuf field bool last = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getLast() + { + return $this->last; + } + + /** + * Optional. Set this to True if this is the last log entry in the operation. + * + * Generated from protobuf field bool last = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setLast($var) + { + GPBUtil::checkBool($var); + $this->last = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntrySourceLocation.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntrySourceLocation.php new file mode 100644 index 000000000000..47279739bd52 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntrySourceLocation.php @@ -0,0 +1,164 @@ +google.logging.v2.LogEntrySourceLocation + */ +class LogEntrySourceLocation extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Source file name. Depending on the runtime environment, this + * might be a simple name or a fully-qualified name. + * + * Generated from protobuf field string file = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $file = ''; + /** + * Optional. Line within the source file. 1-based; 0 indicates no line number + * available. + * + * Generated from protobuf field int64 line = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $line = 0; + /** + * Optional. Human-readable name of the function or method being invoked, with + * optional context such as the class or package name. This information may be + * used in contexts such as the logs viewer, where a file and line number are + * less meaningful. The format can vary by language. For example: + * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` + * (Python). + * + * Generated from protobuf field string function = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $function = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $file + * Optional. Source file name. Depending on the runtime environment, this + * might be a simple name or a fully-qualified name. + * @type int|string $line + * Optional. Line within the source file. 1-based; 0 indicates no line number + * available. + * @type string $function + * Optional. Human-readable name of the function or method being invoked, with + * optional context such as the class or package name. This information may be + * used in contexts such as the logs viewer, where a file and line number are + * less meaningful. The format can vary by language. For example: + * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` + * (Python). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LogEntry::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Source file name. Depending on the runtime environment, this + * might be a simple name or a fully-qualified name. + * + * Generated from protobuf field string file = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFile() + { + return $this->file; + } + + /** + * Optional. Source file name. Depending on the runtime environment, this + * might be a simple name or a fully-qualified name. + * + * Generated from protobuf field string file = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFile($var) + { + GPBUtil::checkString($var, True); + $this->file = $var; + + return $this; + } + + /** + * Optional. Line within the source file. 1-based; 0 indicates no line number + * available. + * + * Generated from protobuf field int64 line = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getLine() + { + return $this->line; + } + + /** + * Optional. Line within the source file. 1-based; 0 indicates no line number + * available. + * + * Generated from protobuf field int64 line = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setLine($var) + { + GPBUtil::checkInt64($var); + $this->line = $var; + + return $this; + } + + /** + * Optional. Human-readable name of the function or method being invoked, with + * optional context such as the class or package name. This information may be + * used in contexts such as the logs viewer, where a file and line number are + * less meaningful. The format can vary by language. For example: + * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` + * (Python). + * + * Generated from protobuf field string function = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFunction() + { + return $this->function; + } + + /** + * Optional. Human-readable name of the function or method being invoked, with + * optional context such as the class or package name. This information may be + * used in contexts such as the logs viewer, where a file and line number are + * less meaningful. The format can vary by language. For example: + * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` + * (Python). + * + * Generated from protobuf field string function = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFunction($var) + { + GPBUtil::checkString($var, True); + $this->function = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogExclusion.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogExclusion.php new file mode 100644 index 000000000000..bc3c81c62318 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogExclusion.php @@ -0,0 +1,321 @@ +google.logging.v2.LogExclusion + */ +class LogExclusion extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A client-assigned identifier, such as + * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and + * can include only letters, digits, underscores, hyphens, and periods. First + * character has to be alphanumeric. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Optional. A description of this exclusion. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Required. An [advanced logs + * filter](https://cloud.google.com/logging/docs/view/advanced-queries) that + * matches the log entries to be excluded. By using the [sample + * function](https://cloud.google.com/logging/docs/view/advanced-queries#sample), + * you can exclude less than 100% of the matching log entries. + * For example, the following query matches 99% of low-severity log entries + * from Google Cloud Storage buckets: + * `resource.type=gcs_bucket severitystring filter = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $filter = ''; + /** + * Optional. If set to True, then this exclusion is disabled and it does not + * exclude any log entries. You can [update an + * exclusion][google.logging.v2.ConfigServiceV2.UpdateExclusion] to change the + * value of this field. + * + * Generated from protobuf field bool disabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disabled = false; + /** + * Output only. The creation timestamp of the exclusion. + * This field may not be present for older exclusions. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The last update timestamp of the exclusion. + * This field may not be present for older exclusions. + * + * 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 + * Required. A client-assigned identifier, such as + * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and + * can include only letters, digits, underscores, hyphens, and periods. First + * character has to be alphanumeric. + * @type string $description + * Optional. A description of this exclusion. + * @type string $filter + * Required. An [advanced logs + * filter](https://cloud.google.com/logging/docs/view/advanced-queries) that + * matches the log entries to be excluded. By using the [sample + * function](https://cloud.google.com/logging/docs/view/advanced-queries#sample), + * you can exclude less than 100% of the matching log entries. + * For example, the following query matches 99% of low-severity log entries + * from Google Cloud Storage buckets: + * `resource.type=gcs_bucket severitystring name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A client-assigned identifier, such as + * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and + * can include only letters, digits, underscores, hyphens, and periods. First + * character has to be alphanumeric. + * + * 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. A description of this exclusion. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A description of this exclusion. + * + * 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; + } + + /** + * Required. An [advanced logs + * filter](https://cloud.google.com/logging/docs/view/advanced-queries) that + * matches the log entries to be excluded. By using the [sample + * function](https://cloud.google.com/logging/docs/view/advanced-queries#sample), + * you can exclude less than 100% of the matching log entries. + * For example, the following query matches 99% of low-severity log entries + * from Google Cloud Storage buckets: + * `resource.type=gcs_bucket severitystring filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Required. An [advanced logs + * filter](https://cloud.google.com/logging/docs/view/advanced-queries) that + * matches the log entries to be excluded. By using the [sample + * function](https://cloud.google.com/logging/docs/view/advanced-queries#sample), + * you can exclude less than 100% of the matching log entries. + * For example, the following query matches 99% of low-severity log entries + * from Google Cloud Storage buckets: + * `resource.type=gcs_bucket severitystring filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. If set to True, then this exclusion is disabled and it does not + * exclude any log entries. You can [update an + * exclusion][google.logging.v2.ConfigServiceV2.UpdateExclusion] to change the + * value of this field. + * + * Generated from protobuf field bool disabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDisabled() + { + return $this->disabled; + } + + /** + * Optional. If set to True, then this exclusion is disabled and it does not + * exclude any log entries. You can [update an + * exclusion][google.logging.v2.ConfigServiceV2.UpdateExclusion] to change the + * value of this field. + * + * Generated from protobuf field bool disabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDisabled($var) + { + GPBUtil::checkBool($var); + $this->disabled = $var; + + return $this; + } + + /** + * Output only. The creation timestamp of the exclusion. + * This field may not be present for older exclusions. + * + * 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 creation timestamp of the exclusion. + * This field may not be present for older exclusions. + * + * 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 last update timestamp of the exclusion. + * This field may not be present for older exclusions. + * + * 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 last update timestamp of the exclusion. + * This field may not be present for older exclusions. + * + * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric.php new file mode 100644 index 000000000000..b542f6adc62e --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric.php @@ -0,0 +1,767 @@ +google.logging.v2.LogMetric + */ +class LogMetric extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The client-assigned metric identifier. + * Examples: `"error_count"`, `"nginx/requests"`. + * Metric identifiers are limited to 100 characters and can include only the + * following characters: `A-Z`, `a-z`, `0-9`, and the special characters + * `_-.,+!*',()%/`. The forward-slash character (`/`) denotes a hierarchy of + * name pieces, and it cannot be the first character of the name. + * This field is the `[METRIC_ID]` part of a metric resource name in the + * format "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Example: If the + * resource name of a metric is + * `"projects/my-project/metrics/nginx%2Frequests"`, this field's value is + * `"nginx/requests"`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Optional. A description of this metric, which is used in documentation. + * The maximum length of the description is 8000 characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Required. An [advanced logs + * filter](https://cloud.google.com/logging/docs/view/advanced_filters) which + * is used to match log entries. Example: + * "resource.type=gae_app AND severity>=ERROR" + * The maximum length of the filter is 20000 characters. + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $filter = ''; + /** + * Optional. The resource name of the Log Bucket that owns the Log Metric. + * Only Log Buckets in projects are supported. The bucket has to be in the + * same project as the metric. + * For example: + * `projects/my-project/locations/global/buckets/my-bucket` + * If empty, then the Log Metric is considered a non-Bucket Log Metric. + * + * Generated from protobuf field string bucket_name = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $bucket_name = ''; + /** + * Optional. If set to True, then this metric is disabled and it does not + * generate any points. + * + * Generated from protobuf field bool disabled = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disabled = false; + /** + * Optional. The metric descriptor associated with the logs-based metric. + * If unspecified, it uses a default metric descriptor with a DELTA metric + * kind, INT64 value type, with no labels and a unit of "1". Such a metric + * counts the number of log entries matching the `filter` expression. + * The `name`, `type`, and `description` fields in the `metric_descriptor` + * are output only, and is constructed using the `name` and `description` + * field in the LogMetric. + * To create a logs-based metric that records a distribution of log values, a + * DELTA metric kind with a DISTRIBUTION value type must be used along with + * a `value_extractor` expression in the LogMetric. + * Each label in the metric descriptor must have a matching label + * name as the key and an extractor expression as the value in the + * `label_extractors` map. + * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot + * be updated once initially configured. New labels can be added in the + * `metric_descriptor`, but existing labels cannot be modified except for + * their description. + * + * Generated from protobuf field .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $metric_descriptor = null; + /** + * Optional. A `value_extractor` is required when using a distribution + * logs-based metric to extract the values to record from a log entry. + * Two functions are supported for value extraction: `EXTRACT(field)` or + * `REGEXP_EXTRACT(field, regex)`. The arguments are: + * 1. field: The name of the log entry field from which the value is to be + * extracted. + * 2. regex: A regular expression using the Google RE2 syntax + * (https://github.com/google/re2/wiki/Syntax) with a single capture + * group to extract data from the specified log entry field. The value + * of the field is converted to a string before applying the regex. + * It is an error to specify a regex that does not include exactly one + * capture group. + * The result of the extraction must be convertible to a double type, as the + * distribution always records double values. If either the extraction or + * the conversion to double fails, then those values are not recorded in the + * distribution. + * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` + * + * Generated from protobuf field string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $value_extractor = ''; + /** + * Optional. A map from a label key string to an extractor expression which is + * used to extract data from a log entry field and assign as the label value. + * Each label key specified in the LabelDescriptor must have an associated + * extractor expression in this map. The syntax of the extractor expression + * is the same as for the `value_extractor` field. + * The extracted value is converted to the type defined in the label + * descriptor. If either the extraction or the type conversion fails, + * the label will have a default value. The default value for a string + * label is an empty string, for an integer label its 0, and for a boolean + * label its `false`. + * Note that there are upper bounds on the maximum number of labels and the + * number of active time series that are allowed in a project. + * + * Generated from protobuf field map label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $label_extractors; + /** + * Optional. The `bucket_options` are required when the logs-based metric is + * using a DISTRIBUTION value type and it describes the bucket boundaries + * used to create a histogram of the extracted values. + * + * Generated from protobuf field .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $bucket_options = null; + /** + * Output only. The creation timestamp of the metric. + * This field may not be present for older metrics. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The last update timestamp of the metric. + * This field may not be present for older metrics. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Deprecated. The API version that created or updated this metric. + * The v2 format is used by default and cannot be changed. + * + * Generated from protobuf field .google.logging.v2.LogMetric.ApiVersion version = 4 [deprecated = true]; + * @deprecated + */ + protected $version = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The client-assigned metric identifier. + * Examples: `"error_count"`, `"nginx/requests"`. + * Metric identifiers are limited to 100 characters and can include only the + * following characters: `A-Z`, `a-z`, `0-9`, and the special characters + * `_-.,+!*',()%/`. The forward-slash character (`/`) denotes a hierarchy of + * name pieces, and it cannot be the first character of the name. + * This field is the `[METRIC_ID]` part of a metric resource name in the + * format "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Example: If the + * resource name of a metric is + * `"projects/my-project/metrics/nginx%2Frequests"`, this field's value is + * `"nginx/requests"`. + * @type string $description + * Optional. A description of this metric, which is used in documentation. + * The maximum length of the description is 8000 characters. + * @type string $filter + * Required. An [advanced logs + * filter](https://cloud.google.com/logging/docs/view/advanced_filters) which + * is used to match log entries. Example: + * "resource.type=gae_app AND severity>=ERROR" + * The maximum length of the filter is 20000 characters. + * @type string $bucket_name + * Optional. The resource name of the Log Bucket that owns the Log Metric. + * Only Log Buckets in projects are supported. The bucket has to be in the + * same project as the metric. + * For example: + * `projects/my-project/locations/global/buckets/my-bucket` + * If empty, then the Log Metric is considered a non-Bucket Log Metric. + * @type bool $disabled + * Optional. If set to True, then this metric is disabled and it does not + * generate any points. + * @type \Google\Api\MetricDescriptor $metric_descriptor + * Optional. The metric descriptor associated with the logs-based metric. + * If unspecified, it uses a default metric descriptor with a DELTA metric + * kind, INT64 value type, with no labels and a unit of "1". Such a metric + * counts the number of log entries matching the `filter` expression. + * The `name`, `type`, and `description` fields in the `metric_descriptor` + * are output only, and is constructed using the `name` and `description` + * field in the LogMetric. + * To create a logs-based metric that records a distribution of log values, a + * DELTA metric kind with a DISTRIBUTION value type must be used along with + * a `value_extractor` expression in the LogMetric. + * Each label in the metric descriptor must have a matching label + * name as the key and an extractor expression as the value in the + * `label_extractors` map. + * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot + * be updated once initially configured. New labels can be added in the + * `metric_descriptor`, but existing labels cannot be modified except for + * their description. + * @type string $value_extractor + * Optional. A `value_extractor` is required when using a distribution + * logs-based metric to extract the values to record from a log entry. + * Two functions are supported for value extraction: `EXTRACT(field)` or + * `REGEXP_EXTRACT(field, regex)`. The arguments are: + * 1. field: The name of the log entry field from which the value is to be + * extracted. + * 2. regex: A regular expression using the Google RE2 syntax + * (https://github.com/google/re2/wiki/Syntax) with a single capture + * group to extract data from the specified log entry field. The value + * of the field is converted to a string before applying the regex. + * It is an error to specify a regex that does not include exactly one + * capture group. + * The result of the extraction must be convertible to a double type, as the + * distribution always records double values. If either the extraction or + * the conversion to double fails, then those values are not recorded in the + * distribution. + * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` + * @type array|\Google\Protobuf\Internal\MapField $label_extractors + * Optional. A map from a label key string to an extractor expression which is + * used to extract data from a log entry field and assign as the label value. + * Each label key specified in the LabelDescriptor must have an associated + * extractor expression in this map. The syntax of the extractor expression + * is the same as for the `value_extractor` field. + * The extracted value is converted to the type defined in the label + * descriptor. If either the extraction or the type conversion fails, + * the label will have a default value. The default value for a string + * label is an empty string, for an integer label its 0, and for a boolean + * label its `false`. + * Note that there are upper bounds on the maximum number of labels and the + * number of active time series that are allowed in a project. + * @type \Google\Api\Distribution\BucketOptions $bucket_options + * Optional. The `bucket_options` are required when the logs-based metric is + * using a DISTRIBUTION value type and it describes the bucket boundaries + * used to create a histogram of the extracted values. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The creation timestamp of the metric. + * This field may not be present for older metrics. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last update timestamp of the metric. + * This field may not be present for older metrics. + * @type int $version + * Deprecated. The API version that created or updated this metric. + * The v2 format is used by default and cannot be changed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingMetrics::initOnce(); + parent::__construct($data); + } + + /** + * Required. The client-assigned metric identifier. + * Examples: `"error_count"`, `"nginx/requests"`. + * Metric identifiers are limited to 100 characters and can include only the + * following characters: `A-Z`, `a-z`, `0-9`, and the special characters + * `_-.,+!*',()%/`. The forward-slash character (`/`) denotes a hierarchy of + * name pieces, and it cannot be the first character of the name. + * This field is the `[METRIC_ID]` part of a metric resource name in the + * format "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Example: If the + * resource name of a metric is + * `"projects/my-project/metrics/nginx%2Frequests"`, this field's value is + * `"nginx/requests"`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The client-assigned metric identifier. + * Examples: `"error_count"`, `"nginx/requests"`. + * Metric identifiers are limited to 100 characters and can include only the + * following characters: `A-Z`, `a-z`, `0-9`, and the special characters + * `_-.,+!*',()%/`. The forward-slash character (`/`) denotes a hierarchy of + * name pieces, and it cannot be the first character of the name. + * This field is the `[METRIC_ID]` part of a metric resource name in the + * format "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Example: If the + * resource name of a metric is + * `"projects/my-project/metrics/nginx%2Frequests"`, this field's value is + * `"nginx/requests"`. + * + * 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. A description of this metric, which is used in documentation. + * The maximum length of the description is 8000 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 this metric, which is used in documentation. + * The maximum length of the description is 8000 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; + } + + /** + * Required. An [advanced logs + * filter](https://cloud.google.com/logging/docs/view/advanced_filters) which + * is used to match log entries. Example: + * "resource.type=gae_app AND severity>=ERROR" + * The maximum length of the filter is 20000 characters. + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Required. An [advanced logs + * filter](https://cloud.google.com/logging/docs/view/advanced_filters) which + * is used to match log entries. Example: + * "resource.type=gae_app AND severity>=ERROR" + * The maximum length of the filter is 20000 characters. + * + * Generated from protobuf field string filter = 3 [(.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 resource name of the Log Bucket that owns the Log Metric. + * Only Log Buckets in projects are supported. The bucket has to be in the + * same project as the metric. + * For example: + * `projects/my-project/locations/global/buckets/my-bucket` + * If empty, then the Log Metric is considered a non-Bucket Log Metric. + * + * Generated from protobuf field string bucket_name = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getBucketName() + { + return $this->bucket_name; + } + + /** + * Optional. The resource name of the Log Bucket that owns the Log Metric. + * Only Log Buckets in projects are supported. The bucket has to be in the + * same project as the metric. + * For example: + * `projects/my-project/locations/global/buckets/my-bucket` + * If empty, then the Log Metric is considered a non-Bucket Log Metric. + * + * Generated from protobuf field string bucket_name = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setBucketName($var) + { + GPBUtil::checkString($var, True); + $this->bucket_name = $var; + + return $this; + } + + /** + * Optional. If set to True, then this metric is disabled and it does not + * generate any points. + * + * Generated from protobuf field bool disabled = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDisabled() + { + return $this->disabled; + } + + /** + * Optional. If set to True, then this metric is disabled and it does not + * generate any points. + * + * Generated from protobuf field bool disabled = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDisabled($var) + { + GPBUtil::checkBool($var); + $this->disabled = $var; + + return $this; + } + + /** + * Optional. The metric descriptor associated with the logs-based metric. + * If unspecified, it uses a default metric descriptor with a DELTA metric + * kind, INT64 value type, with no labels and a unit of "1". Such a metric + * counts the number of log entries matching the `filter` expression. + * The `name`, `type`, and `description` fields in the `metric_descriptor` + * are output only, and is constructed using the `name` and `description` + * field in the LogMetric. + * To create a logs-based metric that records a distribution of log values, a + * DELTA metric kind with a DISTRIBUTION value type must be used along with + * a `value_extractor` expression in the LogMetric. + * Each label in the metric descriptor must have a matching label + * name as the key and an extractor expression as the value in the + * `label_extractors` map. + * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot + * be updated once initially configured. New labels can be added in the + * `metric_descriptor`, but existing labels cannot be modified except for + * their description. + * + * Generated from protobuf field .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Api\MetricDescriptor|null + */ + public function getMetricDescriptor() + { + return $this->metric_descriptor; + } + + public function hasMetricDescriptor() + { + return isset($this->metric_descriptor); + } + + public function clearMetricDescriptor() + { + unset($this->metric_descriptor); + } + + /** + * Optional. The metric descriptor associated with the logs-based metric. + * If unspecified, it uses a default metric descriptor with a DELTA metric + * kind, INT64 value type, with no labels and a unit of "1". Such a metric + * counts the number of log entries matching the `filter` expression. + * The `name`, `type`, and `description` fields in the `metric_descriptor` + * are output only, and is constructed using the `name` and `description` + * field in the LogMetric. + * To create a logs-based metric that records a distribution of log values, a + * DELTA metric kind with a DISTRIBUTION value type must be used along with + * a `value_extractor` expression in the LogMetric. + * Each label in the metric descriptor must have a matching label + * name as the key and an extractor expression as the value in the + * `label_extractors` map. + * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot + * be updated once initially configured. New labels can be added in the + * `metric_descriptor`, but existing labels cannot be modified except for + * their description. + * + * Generated from protobuf field .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Api\MetricDescriptor $var + * @return $this + */ + public function setMetricDescriptor($var) + { + GPBUtil::checkMessage($var, \Google\Api\MetricDescriptor::class); + $this->metric_descriptor = $var; + + return $this; + } + + /** + * Optional. A `value_extractor` is required when using a distribution + * logs-based metric to extract the values to record from a log entry. + * Two functions are supported for value extraction: `EXTRACT(field)` or + * `REGEXP_EXTRACT(field, regex)`. The arguments are: + * 1. field: The name of the log entry field from which the value is to be + * extracted. + * 2. regex: A regular expression using the Google RE2 syntax + * (https://github.com/google/re2/wiki/Syntax) with a single capture + * group to extract data from the specified log entry field. The value + * of the field is converted to a string before applying the regex. + * It is an error to specify a regex that does not include exactly one + * capture group. + * The result of the extraction must be convertible to a double type, as the + * distribution always records double values. If either the extraction or + * the conversion to double fails, then those values are not recorded in the + * distribution. + * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` + * + * Generated from protobuf field string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getValueExtractor() + { + return $this->value_extractor; + } + + /** + * Optional. A `value_extractor` is required when using a distribution + * logs-based metric to extract the values to record from a log entry. + * Two functions are supported for value extraction: `EXTRACT(field)` or + * `REGEXP_EXTRACT(field, regex)`. The arguments are: + * 1. field: The name of the log entry field from which the value is to be + * extracted. + * 2. regex: A regular expression using the Google RE2 syntax + * (https://github.com/google/re2/wiki/Syntax) with a single capture + * group to extract data from the specified log entry field. The value + * of the field is converted to a string before applying the regex. + * It is an error to specify a regex that does not include exactly one + * capture group. + * The result of the extraction must be convertible to a double type, as the + * distribution always records double values. If either the extraction or + * the conversion to double fails, then those values are not recorded in the + * distribution. + * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` + * + * Generated from protobuf field string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setValueExtractor($var) + { + GPBUtil::checkString($var, True); + $this->value_extractor = $var; + + return $this; + } + + /** + * Optional. A map from a label key string to an extractor expression which is + * used to extract data from a log entry field and assign as the label value. + * Each label key specified in the LabelDescriptor must have an associated + * extractor expression in this map. The syntax of the extractor expression + * is the same as for the `value_extractor` field. + * The extracted value is converted to the type defined in the label + * descriptor. If either the extraction or the type conversion fails, + * the label will have a default value. The default value for a string + * label is an empty string, for an integer label its 0, and for a boolean + * label its `false`. + * Note that there are upper bounds on the maximum number of labels and the + * number of active time series that are allowed in a project. + * + * Generated from protobuf field map label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabelExtractors() + { + return $this->label_extractors; + } + + /** + * Optional. A map from a label key string to an extractor expression which is + * used to extract data from a log entry field and assign as the label value. + * Each label key specified in the LabelDescriptor must have an associated + * extractor expression in this map. The syntax of the extractor expression + * is the same as for the `value_extractor` field. + * The extracted value is converted to the type defined in the label + * descriptor. If either the extraction or the type conversion fails, + * the label will have a default value. The default value for a string + * label is an empty string, for an integer label its 0, and for a boolean + * label its `false`. + * Note that there are upper bounds on the maximum number of labels and the + * number of active time series that are allowed in a project. + * + * Generated from protobuf field map label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabelExtractors($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->label_extractors = $arr; + + return $this; + } + + /** + * Optional. The `bucket_options` are required when the logs-based metric is + * using a DISTRIBUTION value type and it describes the bucket boundaries + * used to create a histogram of the extracted values. + * + * Generated from protobuf field .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Api\Distribution\BucketOptions|null + */ + public function getBucketOptions() + { + return $this->bucket_options; + } + + public function hasBucketOptions() + { + return isset($this->bucket_options); + } + + public function clearBucketOptions() + { + unset($this->bucket_options); + } + + /** + * Optional. The `bucket_options` are required when the logs-based metric is + * using a DISTRIBUTION value type and it describes the bucket boundaries + * used to create a histogram of the extracted values. + * + * Generated from protobuf field .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Api\Distribution\BucketOptions $var + * @return $this + */ + public function setBucketOptions($var) + { + GPBUtil::checkMessage($var, \Google\Api\Distribution\BucketOptions::class); + $this->bucket_options = $var; + + return $this; + } + + /** + * Output only. The creation timestamp of the metric. + * This field may not be present for older metrics. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 9 [(.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 metric. + * This field may not be present for older metrics. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 9 [(.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 metric. + * This field may not be present for older metrics. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 10 [(.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 metric. + * This field may not be present for older metrics. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 10 [(.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; + } + + /** + * Deprecated. The API version that created or updated this metric. + * The v2 format is used by default and cannot be changed. + * + * Generated from protobuf field .google.logging.v2.LogMetric.ApiVersion version = 4 [deprecated = true]; + * @return int + * @deprecated + */ + public function getVersion() + { + @trigger_error('version is deprecated.', E_USER_DEPRECATED); + return $this->version; + } + + /** + * Deprecated. The API version that created or updated this metric. + * The v2 format is used by default and cannot be changed. + * + * Generated from protobuf field .google.logging.v2.LogMetric.ApiVersion version = 4 [deprecated = true]; + * @param int $var + * @return $this + * @deprecated + */ + public function setVersion($var) + { + @trigger_error('version is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkEnum($var, \Google\Cloud\Logging\V2\LogMetric\ApiVersion::class); + $this->version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric/ApiVersion.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric/ApiVersion.php new file mode 100644 index 000000000000..393ff635b652 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric/ApiVersion.php @@ -0,0 +1,57 @@ +google.logging.v2.LogMetric.ApiVersion + */ +class ApiVersion +{ + /** + * Logging API v2. + * + * Generated from protobuf enum V2 = 0; + */ + const V2 = 0; + /** + * Logging API v1. + * + * Generated from protobuf enum V1 = 1; + */ + const V1 = 1; + + private static $valueToName = [ + self::V2 => 'V2', + self::V1 => 'V1', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __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(ApiVersion::class, \Google\Cloud\Logging\V2\LogMetric_ApiVersion::class); + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric_ApiVersion.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric_ApiVersion.php new file mode 100644 index 000000000000..b25048d05d57 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric_ApiVersion.php @@ -0,0 +1,16 @@ +google.logging.v2.LogSink + */ +class LogSink extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The client-assigned sink identifier, unique within the project. + * For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited + * to 100 characters and can include only the following characters: upper and + * lower-case alphanumeric characters, underscores, hyphens, and periods. + * First character has to be alphanumeric. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. The export destination: + * "storage.googleapis.com/[GCS_BUCKET]" + * "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" + * "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" + * The sink's `writer_identity`, set when the sink is created, must have + * permission to write to the destination or else the log entries are not + * exported. For more information, see + * [Exporting Logs with + * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). + * + * Generated from protobuf field string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $destination = ''; + /** + * Optional. An [advanced logs + * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The + * only exported log entries are those that are in the resource owning the + * sink and that match the filter. + * For example: + * `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR` + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. A description of this sink. + * The maximum length of the description is 8000 characters. + * + * Generated from protobuf field string description = 18 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. If set to true, then this sink is disabled and it does not export + * any log entries. + * + * Generated from protobuf field bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disabled = false; + /** + * Optional. Log entries that match any of these exclusion filters will not be + * exported. + * If a log entry is matched by both `filter` and one of `exclusion_filters` + * it will not be exported. + * + * Generated from protobuf field repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $exclusions; + /** + * Deprecated. This field is unused. + * + * Generated from protobuf field .google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true]; + * @deprecated + */ + protected $output_version_format = 0; + /** + * Output only. An IAM identity—a service account or group—under + * which Cloud Logging writes the exported log entries to the sink's + * destination. This field is either set by specifying + * `custom_writer_identity` or set automatically by + * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and + * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the + * value of `unique_writer_identity` in those methods. + * Until you grant this identity write-access to the destination, log entry + * exports from this sink will fail. For more information, see [Granting + * Access for a + * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource). + * Consult the destination service's documentation to determine the + * appropriate IAM roles to assign to the identity. + * Sinks that have a destination that is a log bucket in the same project as + * the sink cannot have a writer_identity and no additional permissions are + * required. + * + * Generated from protobuf field string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $writer_identity = ''; + /** + * Optional. This field applies only to sinks owned by organizations and + * folders. If the field is false, the default, only the logs owned by the + * sink's parent resource are available for export. If the field is true, then + * log entries from all the projects, folders, and billing accounts contained + * in the sink's parent resource are also available for export. Whether a + * particular log entry from the children is exported depends on the sink's + * filter expression. + * For example, if this field is true, then the filter + * `resource.type=gce_instance` would export all Compute Engine VM instance + * log entries from all projects in the sink's parent. + * To only export entries from certain child projects, filter on the project + * part of the log name: + * logName:("projects/test-project1/" OR "projects/test-project2/") AND + * resource.type=gce_instance + * + * Generated from protobuf field bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $include_children = false; + /** + * Output only. The creation timestamp of the sink. + * This field may not be present for older sinks. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The last update timestamp of the sink. + * This field may not be present for older sinks. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + protected $options; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The client-assigned sink identifier, unique within the project. + * For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited + * to 100 characters and can include only the following characters: upper and + * lower-case alphanumeric characters, underscores, hyphens, and periods. + * First character has to be alphanumeric. + * @type string $destination + * Required. The export destination: + * "storage.googleapis.com/[GCS_BUCKET]" + * "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" + * "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" + * The sink's `writer_identity`, set when the sink is created, must have + * permission to write to the destination or else the log entries are not + * exported. For more information, see + * [Exporting Logs with + * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). + * @type string $filter + * Optional. An [advanced logs + * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The + * only exported log entries are those that are in the resource owning the + * sink and that match the filter. + * For example: + * `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR` + * @type string $description + * Optional. A description of this sink. + * The maximum length of the description is 8000 characters. + * @type bool $disabled + * Optional. If set to true, then this sink is disabled and it does not export + * any log entries. + * @type array<\Google\Cloud\Logging\V2\LogExclusion>|\Google\Protobuf\Internal\RepeatedField $exclusions + * Optional. Log entries that match any of these exclusion filters will not be + * exported. + * If a log entry is matched by both `filter` and one of `exclusion_filters` + * it will not be exported. + * @type int $output_version_format + * Deprecated. This field is unused. + * @type string $writer_identity + * Output only. An IAM identity—a service account or group—under + * which Cloud Logging writes the exported log entries to the sink's + * destination. This field is either set by specifying + * `custom_writer_identity` or set automatically by + * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and + * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the + * value of `unique_writer_identity` in those methods. + * Until you grant this identity write-access to the destination, log entry + * exports from this sink will fail. For more information, see [Granting + * Access for a + * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource). + * Consult the destination service's documentation to determine the + * appropriate IAM roles to assign to the identity. + * Sinks that have a destination that is a log bucket in the same project as + * the sink cannot have a writer_identity and no additional permissions are + * required. + * @type bool $include_children + * Optional. This field applies only to sinks owned by organizations and + * folders. If the field is false, the default, only the logs owned by the + * sink's parent resource are available for export. If the field is true, then + * log entries from all the projects, folders, and billing accounts contained + * in the sink's parent resource are also available for export. Whether a + * particular log entry from the children is exported depends on the sink's + * filter expression. + * For example, if this field is true, then the filter + * `resource.type=gce_instance` would export all Compute Engine VM instance + * log entries from all projects in the sink's parent. + * To only export entries from certain child projects, filter on the project + * part of the log name: + * logName:("projects/test-project1/" OR "projects/test-project2/") AND + * resource.type=gce_instance + * @type \Google\Cloud\Logging\V2\BigQueryOptions $bigquery_options + * Optional. Options that affect sinks exporting data to BigQuery. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The creation timestamp of the sink. + * This field may not be present for older sinks. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last update timestamp of the sink. + * This field may not be present for older sinks. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The client-assigned sink identifier, unique within the project. + * For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited + * to 100 characters and can include only the following characters: upper and + * lower-case alphanumeric characters, underscores, hyphens, and periods. + * First character has to be alphanumeric. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The client-assigned sink identifier, unique within the project. + * For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited + * to 100 characters and can include only the following characters: upper and + * lower-case alphanumeric characters, underscores, hyphens, and periods. + * First character has to be alphanumeric. + * + * 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 export destination: + * "storage.googleapis.com/[GCS_BUCKET]" + * "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" + * "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" + * The sink's `writer_identity`, set when the sink is created, must have + * permission to write to the destination or else the log entries are not + * exported. For more information, see + * [Exporting Logs with + * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). + * + * Generated from protobuf field string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getDestination() + { + return $this->destination; + } + + /** + * Required. The export destination: + * "storage.googleapis.com/[GCS_BUCKET]" + * "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" + * "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" + * The sink's `writer_identity`, set when the sink is created, must have + * permission to write to the destination or else the log entries are not + * exported. For more information, see + * [Exporting Logs with + * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). + * + * Generated from protobuf field string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDestination($var) + { + GPBUtil::checkString($var, True); + $this->destination = $var; + + return $this; + } + + /** + * Optional. An [advanced logs + * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The + * only exported log entries are those that are in the resource owning the + * sink and that match the filter. + * For example: + * `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR` + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. An [advanced logs + * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The + * only exported log entries are those that are in the resource owning the + * sink and that match the filter. + * For example: + * `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR` + * + * Generated from protobuf field string filter = 5 [(.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 description of this sink. + * The maximum length of the description is 8000 characters. + * + * Generated from protobuf field string description = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A description of this sink. + * The maximum length of the description is 8000 characters. + * + * Generated from protobuf field string description = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. If set to true, then this sink is disabled and it does not export + * any log entries. + * + * Generated from protobuf field bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDisabled() + { + return $this->disabled; + } + + /** + * Optional. If set to true, then this sink is disabled and it does not export + * any log entries. + * + * Generated from protobuf field bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDisabled($var) + { + GPBUtil::checkBool($var); + $this->disabled = $var; + + return $this; + } + + /** + * Optional. Log entries that match any of these exclusion filters will not be + * exported. + * If a log entry is matched by both `filter` and one of `exclusion_filters` + * it will not be exported. + * + * Generated from protobuf field repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExclusions() + { + return $this->exclusions; + } + + /** + * Optional. Log entries that match any of these exclusion filters will not be + * exported. + * If a log entry is matched by both `filter` and one of `exclusion_filters` + * it will not be exported. + * + * Generated from protobuf field repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Logging\V2\LogExclusion>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExclusions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogExclusion::class); + $this->exclusions = $arr; + + return $this; + } + + /** + * Deprecated. This field is unused. + * + * Generated from protobuf field .google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true]; + * @return int + * @deprecated + */ + public function getOutputVersionFormat() + { + @trigger_error('output_version_format is deprecated.', E_USER_DEPRECATED); + return $this->output_version_format; + } + + /** + * Deprecated. This field is unused. + * + * Generated from protobuf field .google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true]; + * @param int $var + * @return $this + * @deprecated + */ + public function setOutputVersionFormat($var) + { + @trigger_error('output_version_format is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkEnum($var, \Google\Cloud\Logging\V2\LogSink\VersionFormat::class); + $this->output_version_format = $var; + + return $this; + } + + /** + * Output only. An IAM identity—a service account or group—under + * which Cloud Logging writes the exported log entries to the sink's + * destination. This field is either set by specifying + * `custom_writer_identity` or set automatically by + * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and + * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the + * value of `unique_writer_identity` in those methods. + * Until you grant this identity write-access to the destination, log entry + * exports from this sink will fail. For more information, see [Granting + * Access for a + * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource). + * Consult the destination service's documentation to determine the + * appropriate IAM roles to assign to the identity. + * Sinks that have a destination that is a log bucket in the same project as + * the sink cannot have a writer_identity and no additional permissions are + * required. + * + * Generated from protobuf field string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getWriterIdentity() + { + return $this->writer_identity; + } + + /** + * Output only. An IAM identity—a service account or group—under + * which Cloud Logging writes the exported log entries to the sink's + * destination. This field is either set by specifying + * `custom_writer_identity` or set automatically by + * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and + * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the + * value of `unique_writer_identity` in those methods. + * Until you grant this identity write-access to the destination, log entry + * exports from this sink will fail. For more information, see [Granting + * Access for a + * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource). + * Consult the destination service's documentation to determine the + * appropriate IAM roles to assign to the identity. + * Sinks that have a destination that is a log bucket in the same project as + * the sink cannot have a writer_identity and no additional permissions are + * required. + * + * Generated from protobuf field string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setWriterIdentity($var) + { + GPBUtil::checkString($var, True); + $this->writer_identity = $var; + + return $this; + } + + /** + * Optional. This field applies only to sinks owned by organizations and + * folders. If the field is false, the default, only the logs owned by the + * sink's parent resource are available for export. If the field is true, then + * log entries from all the projects, folders, and billing accounts contained + * in the sink's parent resource are also available for export. Whether a + * particular log entry from the children is exported depends on the sink's + * filter expression. + * For example, if this field is true, then the filter + * `resource.type=gce_instance` would export all Compute Engine VM instance + * log entries from all projects in the sink's parent. + * To only export entries from certain child projects, filter on the project + * part of the log name: + * logName:("projects/test-project1/" OR "projects/test-project2/") AND + * resource.type=gce_instance + * + * Generated from protobuf field bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getIncludeChildren() + { + return $this->include_children; + } + + /** + * Optional. This field applies only to sinks owned by organizations and + * folders. If the field is false, the default, only the logs owned by the + * sink's parent resource are available for export. If the field is true, then + * log entries from all the projects, folders, and billing accounts contained + * in the sink's parent resource are also available for export. Whether a + * particular log entry from the children is exported depends on the sink's + * filter expression. + * For example, if this field is true, then the filter + * `resource.type=gce_instance` would export all Compute Engine VM instance + * log entries from all projects in the sink's parent. + * To only export entries from certain child projects, filter on the project + * part of the log name: + * logName:("projects/test-project1/" OR "projects/test-project2/") AND + * resource.type=gce_instance + * + * Generated from protobuf field bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setIncludeChildren($var) + { + GPBUtil::checkBool($var); + $this->include_children = $var; + + return $this; + } + + /** + * Optional. Options that affect sinks exporting data to BigQuery. + * + * Generated from protobuf field .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Logging\V2\BigQueryOptions|null + */ + public function getBigqueryOptions() + { + return $this->readOneof(12); + } + + public function hasBigqueryOptions() + { + return $this->hasOneof(12); + } + + /** + * Optional. Options that affect sinks exporting data to BigQuery. + * + * Generated from protobuf field .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Logging\V2\BigQueryOptions $var + * @return $this + */ + public function setBigqueryOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\BigQueryOptions::class); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Output only. The creation timestamp of the sink. + * This field may not be present for older sinks. + * + * 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 creation timestamp of the sink. + * This field may not be present for older sinks. + * + * 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 last update timestamp of the sink. + * This field may not be present for older sinks. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 14 [(.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 sink. + * This field may not be present for older sinks. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 14 [(.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; + } + + /** + * @return string + */ + public function getOptions() + { + return $this->whichOneof("options"); + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogSink/VersionFormat.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogSink/VersionFormat.php new file mode 100644 index 000000000000..4cdb89f2b82d --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogSink/VersionFormat.php @@ -0,0 +1,64 @@ +google.logging.v2.LogSink.VersionFormat + */ +class VersionFormat +{ + /** + * An unspecified format version that will default to V2. + * + * Generated from protobuf enum VERSION_FORMAT_UNSPECIFIED = 0; + */ + const VERSION_FORMAT_UNSPECIFIED = 0; + /** + * `LogEntry` version 2 format. + * + * Generated from protobuf enum V2 = 1; + */ + const V2 = 1; + /** + * `LogEntry` version 1 format. + * + * Generated from protobuf enum V1 = 2; + */ + const V1 = 2; + + private static $valueToName = [ + self::VERSION_FORMAT_UNSPECIFIED => 'VERSION_FORMAT_UNSPECIFIED', + self::V2 => 'V2', + self::V1 => 'V1', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __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(VersionFormat::class, \Google\Cloud\Logging\V2\LogSink_VersionFormat::class); + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogSink_VersionFormat.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogSink_VersionFormat.php new file mode 100644 index 000000000000..d18a03549846 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogSink_VersionFormat.php @@ -0,0 +1,16 @@ +google.logging.v2.LogSplit + */ +class LogSplit extends \Google\Protobuf\Internal\Message +{ + /** + * A globally unique identifier for all log entries in a sequence of split log + * entries. All log entries with the same |LogSplit.uid| are assumed to be + * part of the same sequence of split log entries. + * + * Generated from protobuf field string uid = 1; + */ + protected $uid = ''; + /** + * The index of this LogEntry in the sequence of split log entries. Log + * entries are given |index| values 0, 1, ..., n-1 for a sequence of n log + * entries. + * + * Generated from protobuf field int32 index = 2; + */ + protected $index = 0; + /** + * The total number of log entries that the original LogEntry was split into. + * + * Generated from protobuf field int32 total_splits = 3; + */ + protected $total_splits = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uid + * A globally unique identifier for all log entries in a sequence of split log + * entries. All log entries with the same |LogSplit.uid| are assumed to be + * part of the same sequence of split log entries. + * @type int $index + * The index of this LogEntry in the sequence of split log entries. Log + * entries are given |index| values 0, 1, ..., n-1 for a sequence of n log + * entries. + * @type int $total_splits + * The total number of log entries that the original LogEntry was split into. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LogEntry::initOnce(); + parent::__construct($data); + } + + /** + * A globally unique identifier for all log entries in a sequence of split log + * entries. All log entries with the same |LogSplit.uid| are assumed to be + * part of the same sequence of split log entries. + * + * Generated from protobuf field string uid = 1; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * A globally unique identifier for all log entries in a sequence of split log + * entries. All log entries with the same |LogSplit.uid| are assumed to be + * part of the same sequence of split log entries. + * + * Generated from protobuf field string uid = 1; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * The index of this LogEntry in the sequence of split log entries. Log + * entries are given |index| values 0, 1, ..., n-1 for a sequence of n log + * entries. + * + * Generated from protobuf field int32 index = 2; + * @return int + */ + public function getIndex() + { + return $this->index; + } + + /** + * The index of this LogEntry in the sequence of split log entries. Log + * entries are given |index| values 0, 1, ..., n-1 for a sequence of n log + * entries. + * + * Generated from protobuf field int32 index = 2; + * @param int $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkInt32($var); + $this->index = $var; + + return $this; + } + + /** + * The total number of log entries that the original LogEntry was split into. + * + * Generated from protobuf field int32 total_splits = 3; + * @return int + */ + public function getTotalSplits() + { + return $this->total_splits; + } + + /** + * The total number of log entries that the original LogEntry was split into. + * + * Generated from protobuf field int32 total_splits = 3; + * @param int $var + * @return $this + */ + public function setTotalSplits($var) + { + GPBUtil::checkInt32($var); + $this->total_splits = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogView.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogView.php new file mode 100644 index 000000000000..3b506053a5a4 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogView.php @@ -0,0 +1,267 @@ +google.logging.v2.LogView + */ +class LogView extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the view. + * For example: + * `projects/my-project/locations/global/buckets/my-bucket/views/my-view` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Describes this view. + * + * Generated from protobuf field string description = 3; + */ + protected $description = ''; + /** + * Output only. The creation timestamp of the view. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The last update timestamp of the view. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Filter that restricts which log entries in a bucket are visible in this + * view. + * Filters are restricted to be a logical AND of ==/!= of any of the + * following: + * - originating project/folder/organization/billing account. + * - resource type + * - log id + * For example: + * SOURCE("projects/myproject") AND resource.type = "gce_instance" + * AND LOG_ID("stdout") + * + * Generated from protobuf field string filter = 7; + */ + protected $filter = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name of the view. + * For example: + * `projects/my-project/locations/global/buckets/my-bucket/views/my-view` + * @type string $description + * Describes this view. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The creation timestamp of the view. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last update timestamp of the view. + * @type string $filter + * Filter that restricts which log entries in a bucket are visible in this + * view. + * Filters are restricted to be a logical AND of ==/!= of any of the + * following: + * - originating project/folder/organization/billing account. + * - resource type + * - log id + * For example: + * SOURCE("projects/myproject") AND resource.type = "gce_instance" + * AND LOG_ID("stdout") + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the view. + * For example: + * `projects/my-project/locations/global/buckets/my-bucket/views/my-view` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the view. + * For example: + * `projects/my-project/locations/global/buckets/my-bucket/views/my-view` + * + * 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; + } + + /** + * Describes this view. + * + * Generated from protobuf field string description = 3; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Describes this view. + * + * Generated from protobuf field string description = 3; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The creation timestamp of the view. + * + * 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 creation timestamp of the view. + * + * 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 last update timestamp of the view. + * + * 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 last update timestamp of the view. + * + * 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; + } + + /** + * Filter that restricts which log entries in a bucket are visible in this + * view. + * Filters are restricted to be a logical AND of ==/!= of any of the + * following: + * - originating project/folder/organization/billing account. + * - resource type + * - log id + * For example: + * SOURCE("projects/myproject") AND resource.type = "gce_instance" + * AND LOG_ID("stdout") + * + * Generated from protobuf field string filter = 7; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Filter that restricts which log entries in a bucket are visible in this + * view. + * Filters are restricted to be a logical AND of ==/!= of any of the + * following: + * - originating project/folder/organization/billing account. + * - resource type + * - log id + * For example: + * SOURCE("projects/myproject") AND resource.type = "gce_instance" + * AND LOG_ID("stdout") + * + * Generated from protobuf field string filter = 7; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LoggingServiceV2GrpcClient.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LoggingServiceV2GrpcClient.php new file mode 100644 index 000000000000..fc97349a0548 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LoggingServiceV2GrpcClient.php @@ -0,0 +1,136 @@ +_simpleRequest('/google.logging.v2.LoggingServiceV2/DeleteLog', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * Writes log entries to Logging. This API method is the + * only way to send log entries to Logging. This method + * is used, directly or indirectly, by the Logging agent + * (fluentd) and all logging libraries configured to use Logging. + * A single request may contain log entries for a maximum of 1000 + * different resources (projects, organizations, billing accounts or + * folders) + * @param \Google\Cloud\Logging\V2\WriteLogEntriesRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function WriteLogEntries(\Google\Cloud\Logging\V2\WriteLogEntriesRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.LoggingServiceV2/WriteLogEntries', + $argument, + ['\Google\Cloud\Logging\V2\WriteLogEntriesResponse', 'decode'], + $metadata, $options); + } + + /** + * Lists log entries. Use this method to retrieve log entries that originated + * from a project/folder/organization/billing account. For ways to export log + * entries, see [Exporting + * Logs](https://cloud.google.com/logging/docs/export). + * @param \Google\Cloud\Logging\V2\ListLogEntriesRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListLogEntries(\Google\Cloud\Logging\V2\ListLogEntriesRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.LoggingServiceV2/ListLogEntries', + $argument, + ['\Google\Cloud\Logging\V2\ListLogEntriesResponse', 'decode'], + $metadata, $options); + } + + /** + * Lists the descriptors for monitored resource types used by Logging. + * @param \Google\Cloud\Logging\V2\ListMonitoredResourceDescriptorsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListMonitoredResourceDescriptors(\Google\Cloud\Logging\V2\ListMonitoredResourceDescriptorsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.LoggingServiceV2/ListMonitoredResourceDescriptors', + $argument, + ['\Google\Cloud\Logging\V2\ListMonitoredResourceDescriptorsResponse', 'decode'], + $metadata, $options); + } + + /** + * Lists the logs in projects, organizations, folders, or billing accounts. + * Only logs that have entries are listed. + * @param \Google\Cloud\Logging\V2\ListLogsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListLogs(\Google\Cloud\Logging\V2\ListLogsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.LoggingServiceV2/ListLogs', + $argument, + ['\Google\Cloud\Logging\V2\ListLogsResponse', 'decode'], + $metadata, $options); + } + + /** + * Streaming read of log entries as they are ingested. Until the stream is + * terminated, it will continue reading logs. + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\BidiStreamingCall + */ + public function TailLogEntries($metadata = [], $options = []) { + return $this->_bidiRequest('/google.logging.v2.LoggingServiceV2/TailLogEntries', + ['\Google\Cloud\Logging\V2\TailLogEntriesResponse','decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/MetricsServiceV2GrpcClient.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/MetricsServiceV2GrpcClient.php new file mode 100644 index 000000000000..f671b2f3b410 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/MetricsServiceV2GrpcClient.php @@ -0,0 +1,110 @@ +_simpleRequest('/google.logging.v2.MetricsServiceV2/ListLogMetrics', + $argument, + ['\Google\Cloud\Logging\V2\ListLogMetricsResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets a logs-based metric. + * @param \Google\Cloud\Logging\V2\GetLogMetricRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetLogMetric(\Google\Cloud\Logging\V2\GetLogMetricRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.MetricsServiceV2/GetLogMetric', + $argument, + ['\Google\Cloud\Logging\V2\LogMetric', 'decode'], + $metadata, $options); + } + + /** + * Creates a logs-based metric. + * @param \Google\Cloud\Logging\V2\CreateLogMetricRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateLogMetric(\Google\Cloud\Logging\V2\CreateLogMetricRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.MetricsServiceV2/CreateLogMetric', + $argument, + ['\Google\Cloud\Logging\V2\LogMetric', 'decode'], + $metadata, $options); + } + + /** + * Creates or updates a logs-based metric. + * @param \Google\Cloud\Logging\V2\UpdateLogMetricRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateLogMetric(\Google\Cloud\Logging\V2\UpdateLogMetricRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.MetricsServiceV2/UpdateLogMetric', + $argument, + ['\Google\Cloud\Logging\V2\LogMetric', 'decode'], + $metadata, $options); + } + + /** + * Deletes a logs-based metric. + * @param \Google\Cloud\Logging\V2\DeleteLogMetricRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteLogMetric(\Google\Cloud\Logging\V2\DeleteLogMetricRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.MetricsServiceV2/DeleteLogMetric', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/OperationState.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/OperationState.php new file mode 100644 index 000000000000..32d50436ce86 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/OperationState.php @@ -0,0 +1,93 @@ +google.logging.v2.OperationState + */ +class OperationState +{ + /** + * Should not be used. + * + * Generated from protobuf enum OPERATION_STATE_UNSPECIFIED = 0; + */ + const OPERATION_STATE_UNSPECIFIED = 0; + /** + * The operation is scheduled. + * + * Generated from protobuf enum OPERATION_STATE_SCHEDULED = 1; + */ + const OPERATION_STATE_SCHEDULED = 1; + /** + * Waiting for necessary permissions. + * + * Generated from protobuf enum OPERATION_STATE_WAITING_FOR_PERMISSIONS = 2; + */ + const OPERATION_STATE_WAITING_FOR_PERMISSIONS = 2; + /** + * The operation is running. + * + * Generated from protobuf enum OPERATION_STATE_RUNNING = 3; + */ + const OPERATION_STATE_RUNNING = 3; + /** + * The operation was completed successfully. + * + * Generated from protobuf enum OPERATION_STATE_SUCCEEDED = 4; + */ + const OPERATION_STATE_SUCCEEDED = 4; + /** + * The operation failed. + * + * Generated from protobuf enum OPERATION_STATE_FAILED = 5; + */ + const OPERATION_STATE_FAILED = 5; + /** + * The operation was cancelled by the user. + * + * Generated from protobuf enum OPERATION_STATE_CANCELLED = 6; + */ + const OPERATION_STATE_CANCELLED = 6; + + private static $valueToName = [ + self::OPERATION_STATE_UNSPECIFIED => 'OPERATION_STATE_UNSPECIFIED', + self::OPERATION_STATE_SCHEDULED => 'OPERATION_STATE_SCHEDULED', + self::OPERATION_STATE_WAITING_FOR_PERMISSIONS => 'OPERATION_STATE_WAITING_FOR_PERMISSIONS', + self::OPERATION_STATE_RUNNING => 'OPERATION_STATE_RUNNING', + self::OPERATION_STATE_SUCCEEDED => 'OPERATION_STATE_SUCCEEDED', + self::OPERATION_STATE_FAILED => 'OPERATION_STATE_FAILED', + self::OPERATION_STATE_CANCELLED => 'OPERATION_STATE_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); + } +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/Settings.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/Settings.php new file mode 100644 index 000000000000..b66463e4ad75 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/Settings.php @@ -0,0 +1,324 @@ +google.logging.v2.Settings + */ +class Settings extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the settings. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Optional. The resource name for the configured Cloud KMS key. + * KMS key name format: + * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]" + * For example: + * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"` + * To enable CMEK for the Log Router, set this field to a valid + * `kms_key_name` for which the associated service account has the required + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key. + * The Cloud KMS key used by the Log Router can be updated by changing the + * `kms_key_name` to a new valid key name. Encryption operations that are in + * progress will be completed with the key that was in use when they started. + * Decryption operations will be completed using the key that was used at the + * time of encryption unless access to that key has been revoked. + * To disable CMEK for the Log Router, set this field to an empty string. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Generated from protobuf field string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $kms_key_name = ''; + /** + * Output only. The service account that will be used by the Log Router to + * access your Cloud KMS key. + * Before enabling CMEK for Log Router, you must first assign the role + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that + * the Log Router will use to access your Cloud KMS key. Use + * [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings] to + * obtain the service account ID. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Generated from protobuf field string kms_service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $kms_service_account_id = ''; + /** + * Optional. The Cloud region that will be used for _Default and _Required log + * buckets for newly created projects and folders. For example `europe-west1`. + * This setting does not affect the location of custom log buckets. + * + * Generated from protobuf field string storage_location = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $storage_location = ''; + /** + * Optional. If set to true, the _Default sink in newly created projects and + * folders will created in a disabled state. This can be used to automatically + * disable log ingestion if there is already an aggregated sink configured in + * the hierarchy. The _Default sink can be re-enabled manually if needed. + * + * Generated from protobuf field bool disable_default_sink = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disable_default_sink = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of the settings. + * @type string $kms_key_name + * Optional. The resource name for the configured Cloud KMS key. + * KMS key name format: + * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]" + * For example: + * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"` + * To enable CMEK for the Log Router, set this field to a valid + * `kms_key_name` for which the associated service account has the required + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key. + * The Cloud KMS key used by the Log Router can be updated by changing the + * `kms_key_name` to a new valid key name. Encryption operations that are in + * progress will be completed with the key that was in use when they started. + * Decryption operations will be completed using the key that was used at the + * time of encryption unless access to that key has been revoked. + * To disable CMEK for the Log Router, set this field to an empty string. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * @type string $kms_service_account_id + * Output only. The service account that will be used by the Log Router to + * access your Cloud KMS key. + * Before enabling CMEK for Log Router, you must first assign the role + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that + * the Log Router will use to access your Cloud KMS key. Use + * [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings] to + * obtain the service account ID. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * @type string $storage_location + * Optional. The Cloud region that will be used for _Default and _Required log + * buckets for newly created projects and folders. For example `europe-west1`. + * This setting does not affect the location of custom log buckets. + * @type bool $disable_default_sink + * Optional. If set to true, the _Default sink in newly created projects and + * folders will created in a disabled state. This can be used to automatically + * disable log ingestion if there is already an aggregated sink configured in + * the hierarchy. The _Default sink can be re-enabled manually if needed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the settings. + * + * 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 settings. + * + * 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. The resource name for the configured Cloud KMS key. + * KMS key name format: + * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]" + * For example: + * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"` + * To enable CMEK for the Log Router, set this field to a valid + * `kms_key_name` for which the associated service account has the required + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key. + * The Cloud KMS key used by the Log Router can be updated by changing the + * `kms_key_name` to a new valid key name. Encryption operations that are in + * progress will be completed with the key that was in use when they started. + * Decryption operations will be completed using the key that was used at the + * time of encryption unless access to that key has been revoked. + * To disable CMEK for the Log Router, set this field to an empty string. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Generated from protobuf field string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getKmsKeyName() + { + return $this->kms_key_name; + } + + /** + * Optional. The resource name for the configured Cloud KMS key. + * KMS key name format: + * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]" + * For example: + * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"` + * To enable CMEK for the Log Router, set this field to a valid + * `kms_key_name` for which the associated service account has the required + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key. + * The Cloud KMS key used by the Log Router can be updated by changing the + * `kms_key_name` to a new valid key name. Encryption operations that are in + * progress will be completed with the key that was in use when they started. + * Decryption operations will be completed using the key that was used at the + * time of encryption unless access to that key has been revoked. + * To disable CMEK for the Log Router, set this field to an empty string. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Generated from protobuf field string kms_key_name = 2 [(.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; + } + + /** + * Output only. The service account that will be used by the Log Router to + * access your Cloud KMS key. + * Before enabling CMEK for Log Router, you must first assign the role + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that + * the Log Router will use to access your Cloud KMS key. Use + * [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings] to + * obtain the service account ID. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Generated from protobuf field string kms_service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getKmsServiceAccountId() + { + return $this->kms_service_account_id; + } + + /** + * Output only. The service account that will be used by the Log Router to + * access your Cloud KMS key. + * Before enabling CMEK for Log Router, you must first assign the role + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that + * the Log Router will use to access your Cloud KMS key. Use + * [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings] to + * obtain the service account ID. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Generated from protobuf field string kms_service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setKmsServiceAccountId($var) + { + GPBUtil::checkString($var, True); + $this->kms_service_account_id = $var; + + return $this; + } + + /** + * Optional. The Cloud region that will be used for _Default and _Required log + * buckets for newly created projects and folders. For example `europe-west1`. + * This setting does not affect the location of custom log buckets. + * + * Generated from protobuf field string storage_location = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getStorageLocation() + { + return $this->storage_location; + } + + /** + * Optional. The Cloud region that will be used for _Default and _Required log + * buckets for newly created projects and folders. For example `europe-west1`. + * This setting does not affect the location of custom log buckets. + * + * Generated from protobuf field string storage_location = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setStorageLocation($var) + { + GPBUtil::checkString($var, True); + $this->storage_location = $var; + + return $this; + } + + /** + * Optional. If set to true, the _Default sink in newly created projects and + * folders will created in a disabled state. This can be used to automatically + * disable log ingestion if there is already an aggregated sink configured in + * the hierarchy. The _Default sink can be re-enabled manually if needed. + * + * Generated from protobuf field bool disable_default_sink = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDisableDefaultSink() + { + return $this->disable_default_sink; + } + + /** + * Optional. If set to true, the _Default sink in newly created projects and + * folders will created in a disabled state. This can be used to automatically + * disable log ingestion if there is already an aggregated sink configured in + * the hierarchy. The _Default sink can be re-enabled manually if needed. + * + * Generated from protobuf field bool disable_default_sink = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDisableDefaultSink($var) + { + GPBUtil::checkBool($var); + $this->disable_default_sink = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesRequest.php new file mode 100644 index 000000000000..87b5718221cf --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesRequest.php @@ -0,0 +1,209 @@ +google.logging.v2.TailLogEntriesRequest + */ +class TailLogEntriesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of a parent resource from which to retrieve log entries: + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * May alternatively be one or more views: + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * + * Generated from protobuf field repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $resource_names; + /** + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. + * Referencing a parent resource that is not listed in `resource_names` will + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. The amount of time to buffer log entries at the server before + * being returned to prevent out of order results due to late arriving log + * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000 + * milliseconds. + * + * Generated from protobuf field .google.protobuf.Duration buffer_window = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $buffer_window = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $resource_names + * Required. Name of a parent resource from which to retrieve log entries: + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * May alternatively be one or more views: + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * @type string $filter + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. + * Referencing a parent resource that is not listed in `resource_names` will + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. + * @type \Google\Protobuf\Duration $buffer_window + * Optional. The amount of time to buffer log entries at the server before + * being returned to prevent out of order results due to late arriving log + * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000 + * milliseconds. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\Logging::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of a parent resource from which to retrieve log entries: + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * May alternatively be one or more views: + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * + * Generated from protobuf field repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourceNames() + { + return $this->resource_names; + } + + /** + * Required. Name of a parent resource from which to retrieve log entries: + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * May alternatively be one or more views: + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * + * Generated from protobuf field repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourceNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_names = $arr; + + return $this; + } + + /** + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. + * Referencing a parent resource that is not listed in `resource_names` will + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. + * Referencing a parent resource that is not listed in `resource_names` will + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The amount of time to buffer log entries at the server before + * being returned to prevent out of order results due to late arriving log + * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000 + * milliseconds. + * + * Generated from protobuf field .google.protobuf.Duration buffer_window = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getBufferWindow() + { + return $this->buffer_window; + } + + public function hasBufferWindow() + { + return isset($this->buffer_window); + } + + public function clearBufferWindow() + { + unset($this->buffer_window); + } + + /** + * Optional. The amount of time to buffer log entries at the server before + * being returned to prevent out of order results due to late arriving log + * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000 + * milliseconds. + * + * Generated from protobuf field .google.protobuf.Duration buffer_window = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setBufferWindow($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->buffer_window = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse.php new file mode 100644 index 000000000000..a5d94ed0e2e6 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse.php @@ -0,0 +1,125 @@ +google.logging.v2.TailLogEntriesResponse + */ +class TailLogEntriesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of log entries. Each response in the stream will order entries with + * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed + * between separate responses. + * + * Generated from protobuf field repeated .google.logging.v2.LogEntry entries = 1; + */ + private $entries; + /** + * If entries that otherwise would have been included in the session were not + * sent back to the client, counts of relevant entries omitted from the + * session with the reason that they were not included. There will be at most + * one of each reason per response. The counts represent the number of + * suppressed entries since the last streamed response. + * + * Generated from protobuf field repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + */ + private $suppression_info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Logging\V2\LogEntry>|\Google\Protobuf\Internal\RepeatedField $entries + * A list of log entries. Each response in the stream will order entries with + * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed + * between separate responses. + * @type array<\Google\Cloud\Logging\V2\TailLogEntriesResponse\SuppressionInfo>|\Google\Protobuf\Internal\RepeatedField $suppression_info + * If entries that otherwise would have been included in the session were not + * sent back to the client, counts of relevant entries omitted from the + * session with the reason that they were not included. There will be at most + * one of each reason per response. The counts represent the number of + * suppressed entries since the last streamed response. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\Logging::initOnce(); + parent::__construct($data); + } + + /** + * A list of log entries. Each response in the stream will order entries with + * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed + * between separate responses. + * + * Generated from protobuf field repeated .google.logging.v2.LogEntry entries = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntries() + { + return $this->entries; + } + + /** + * A list of log entries. Each response in the stream will order entries with + * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed + * between separate responses. + * + * Generated from protobuf field repeated .google.logging.v2.LogEntry entries = 1; + * @param array<\Google\Cloud\Logging\V2\LogEntry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogEntry::class); + $this->entries = $arr; + + return $this; + } + + /** + * If entries that otherwise would have been included in the session were not + * sent back to the client, counts of relevant entries omitted from the + * session with the reason that they were not included. There will be at most + * one of each reason per response. The counts represent the number of + * suppressed entries since the last streamed response. + * + * Generated from protobuf field repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSuppressionInfo() + { + return $this->suppression_info; + } + + /** + * If entries that otherwise would have been included in the session were not + * sent back to the client, counts of relevant entries omitted from the + * session with the reason that they were not included. There will be at most + * one of each reason per response. The counts represent the number of + * suppressed entries since the last streamed response. + * + * Generated from protobuf field repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * @param array<\Google\Cloud\Logging\V2\TailLogEntriesResponse\SuppressionInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSuppressionInfo($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\TailLogEntriesResponse\SuppressionInfo::class); + $this->suppression_info = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse/SuppressionInfo.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse/SuppressionInfo.php new file mode 100644 index 000000000000..f8b88df264a0 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse/SuppressionInfo.php @@ -0,0 +1,104 @@ +google.logging.v2.TailLogEntriesResponse.SuppressionInfo + */ +class SuppressionInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The reason that entries were omitted from the session. + * + * Generated from protobuf field .google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason reason = 1; + */ + protected $reason = 0; + /** + * A lower bound on the count of entries omitted due to `reason`. + * + * Generated from protobuf field int32 suppressed_count = 2; + */ + protected $suppressed_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $reason + * The reason that entries were omitted from the session. + * @type int $suppressed_count + * A lower bound on the count of entries omitted due to `reason`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\Logging::initOnce(); + parent::__construct($data); + } + + /** + * The reason that entries were omitted from the session. + * + * Generated from protobuf field .google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason reason = 1; + * @return int + */ + public function getReason() + { + return $this->reason; + } + + /** + * The reason that entries were omitted from the session. + * + * Generated from protobuf field .google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason reason = 1; + * @param int $var + * @return $this + */ + public function setReason($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Logging\V2\TailLogEntriesResponse\SuppressionInfo\Reason::class); + $this->reason = $var; + + return $this; + } + + /** + * A lower bound on the count of entries omitted due to `reason`. + * + * Generated from protobuf field int32 suppressed_count = 2; + * @return int + */ + public function getSuppressedCount() + { + return $this->suppressed_count; + } + + /** + * A lower bound on the count of entries omitted due to `reason`. + * + * Generated from protobuf field int32 suppressed_count = 2; + * @param int $var + * @return $this + */ + public function setSuppressedCount($var) + { + GPBUtil::checkInt32($var); + $this->suppressed_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SuppressionInfo::class, \Google\Cloud\Logging\V2\TailLogEntriesResponse_SuppressionInfo::class); + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse/SuppressionInfo/Reason.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse/SuppressionInfo/Reason.php new file mode 100644 index 000000000000..a626cf2f1b84 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse/SuppressionInfo/Reason.php @@ -0,0 +1,68 @@ +google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason + */ +class Reason +{ + /** + * Unexpected default. + * + * Generated from protobuf enum REASON_UNSPECIFIED = 0; + */ + const REASON_UNSPECIFIED = 0; + /** + * Indicates suppression occurred due to relevant entries being + * received in excess of rate limits. For quotas and limits, see + * [Logging API quotas and + * limits](https://cloud.google.com/logging/quotas#api-limits). + * + * Generated from protobuf enum RATE_LIMIT = 1; + */ + const RATE_LIMIT = 1; + /** + * Indicates suppression occurred due to the client not consuming + * responses quickly enough. + * + * Generated from protobuf enum NOT_CONSUMED = 2; + */ + const NOT_CONSUMED = 2; + + private static $valueToName = [ + self::REASON_UNSPECIFIED => 'REASON_UNSPECIFIED', + self::RATE_LIMIT => 'RATE_LIMIT', + self::NOT_CONSUMED => 'NOT_CONSUMED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __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\Logging\V2\TailLogEntriesResponse_SuppressionInfo_Reason::class); + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse_SuppressionInfo.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse_SuppressionInfo.php new file mode 100644 index 000000000000..d3e4b91ac857 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse_SuppressionInfo.php @@ -0,0 +1,16 @@ +google.logging.v2.UndeleteBucketRequest + */ +class UndeleteBucketRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full resource name of the bucket to undelete. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full resource name of the bucket to undelete. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full resource name of the bucket to undelete. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + * + * 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 resource name of the bucket to undelete. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + * + * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateBucketRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateBucketRequest.php new file mode 100644 index 000000000000..8fc50d3f20df --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateBucketRequest.php @@ -0,0 +1,199 @@ +google.logging.v2.UpdateBucketRequest + */ +class UpdateBucketRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full resource name of the bucket to update. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The updated bucket. + * + * Generated from protobuf field .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $bucket = null; + /** + * Required. Field mask that specifies the fields in `bucket` that need an + * update. A bucket field will be overwritten if, and only if, it is in the + * update mask. `name` and output only fields cannot be updated. + * For a detailed `FieldMask` definition, see: + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + * For example: `updateMask=retention_days` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full resource name of the bucket to update. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + * @type \Google\Cloud\Logging\V2\LogBucket $bucket + * Required. The updated bucket. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask that specifies the fields in `bucket` that need an + * update. A bucket field will be overwritten if, and only if, it is in the + * update mask. `name` and output only fields cannot be updated. + * For a detailed `FieldMask` definition, see: + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + * For example: `updateMask=retention_days` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full resource name of the bucket to update. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + * + * 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 resource name of the bucket to update. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + * + * 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 updated bucket. + * + * Generated from protobuf field .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Logging\V2\LogBucket|null + */ + public function getBucket() + { + return $this->bucket; + } + + public function hasBucket() + { + return isset($this->bucket); + } + + public function clearBucket() + { + unset($this->bucket); + } + + /** + * Required. The updated bucket. + * + * Generated from protobuf field .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Logging\V2\LogBucket $var + * @return $this + */ + public function setBucket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogBucket::class); + $this->bucket = $var; + + return $this; + } + + /** + * Required. Field mask that specifies the fields in `bucket` that need an + * update. A bucket field will be overwritten if, and only if, it is in the + * update mask. `name` and output only fields cannot be updated. + * For a detailed `FieldMask` definition, see: + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + * For example: `updateMask=retention_days` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.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 that specifies the fields in `bucket` that need an + * update. A bucket field will be overwritten if, and only if, it is in the + * update mask. `name` and output only fields cannot be updated. + * For a detailed `FieldMask` definition, see: + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + * For example: `updateMask=retention_days` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.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/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateCmekSettingsRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateCmekSettingsRequest.php new file mode 100644 index 000000000000..29cc0edeed5b --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateCmekSettingsRequest.php @@ -0,0 +1,223 @@ +google.logging.v2.UpdateCmekSettingsRequest + */ +class UpdateCmekSettingsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name for the CMEK settings to update. + * "projects/[PROJECT_ID]/cmekSettings" + * "organizations/[ORGANIZATION_ID]/cmekSettings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + * "folders/[FOLDER_ID]/cmekSettings" + * For example: + * `"organizations/12345/cmekSettings"` + * Note: CMEK for the Log Router can currently only be configured for Google + * Cloud organizations. Once configured, it applies to all projects and + * folders in the Google Cloud organization. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. The CMEK settings to update. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Generated from protobuf field .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cmek_settings = null; + /** + * Optional. Field mask identifying which fields from `cmek_settings` should + * be updated. A field will be overwritten if and only if it is in the update + * mask. Output only fields cannot be updated. + * See [FieldMask][google.protobuf.FieldMask] for more information. + * For example: `"updateMask=kmsKeyName"` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name for the CMEK settings to update. + * "projects/[PROJECT_ID]/cmekSettings" + * "organizations/[ORGANIZATION_ID]/cmekSettings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + * "folders/[FOLDER_ID]/cmekSettings" + * For example: + * `"organizations/12345/cmekSettings"` + * Note: CMEK for the Log Router can currently only be configured for Google + * Cloud organizations. Once configured, it applies to all projects and + * folders in the Google Cloud organization. + * @type \Google\Cloud\Logging\V2\CmekSettings $cmek_settings + * Required. The CMEK settings to update. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask identifying which fields from `cmek_settings` should + * be updated. A field will be overwritten if and only if it is in the update + * mask. Output only fields cannot be updated. + * See [FieldMask][google.protobuf.FieldMask] for more information. + * For example: `"updateMask=kmsKeyName"` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name for the CMEK settings to update. + * "projects/[PROJECT_ID]/cmekSettings" + * "organizations/[ORGANIZATION_ID]/cmekSettings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + * "folders/[FOLDER_ID]/cmekSettings" + * For example: + * `"organizations/12345/cmekSettings"` + * Note: CMEK for the Log Router can currently only be configured for Google + * Cloud organizations. Once configured, it applies to all projects and + * folders in the Google Cloud organization. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name for the CMEK settings to update. + * "projects/[PROJECT_ID]/cmekSettings" + * "organizations/[ORGANIZATION_ID]/cmekSettings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + * "folders/[FOLDER_ID]/cmekSettings" + * For example: + * `"organizations/12345/cmekSettings"` + * Note: CMEK for the Log Router can currently only be configured for Google + * Cloud organizations. Once configured, it applies to all projects and + * folders in the Google Cloud organization. + * + * 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 CMEK settings to update. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Generated from protobuf field .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Logging\V2\CmekSettings|null + */ + public function getCmekSettings() + { + return $this->cmek_settings; + } + + public function hasCmekSettings() + { + return isset($this->cmek_settings); + } + + public function clearCmekSettings() + { + unset($this->cmek_settings); + } + + /** + * Required. The CMEK settings to update. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Generated from protobuf field .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Logging\V2\CmekSettings $var + * @return $this + */ + public function setCmekSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\CmekSettings::class); + $this->cmek_settings = $var; + + return $this; + } + + /** + * Optional. Field mask identifying which fields from `cmek_settings` should + * be updated. A field will be overwritten if and only if it is in the update + * mask. Output only fields cannot be updated. + * See [FieldMask][google.protobuf.FieldMask] for more information. + * For example: `"updateMask=kmsKeyName"` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.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 identifying which fields from `cmek_settings` should + * be updated. A field will be overwritten if and only if it is in the update + * mask. Output only fields cannot be updated. + * See [FieldMask][google.protobuf.FieldMask] for more information. + * For example: `"updateMask=kmsKeyName"` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.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/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateExclusionRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateExclusionRequest.php new file mode 100644 index 000000000000..890aea124e7b --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateExclusionRequest.php @@ -0,0 +1,207 @@ +google.logging.v2.UpdateExclusionRequest + */ +class UpdateExclusionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the exclusion to update: + * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * For example: + * `"projects/my-project/exclusions/my-exclusion"` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. New values for the existing exclusion. Only the fields specified + * in `update_mask` are relevant. + * + * Generated from protobuf field .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $exclusion = null; + /** + * Required. A non-empty list of fields to change in the existing exclusion. + * New values for the fields are taken from the corresponding fields in the + * [LogExclusion][google.logging.v2.LogExclusion] included in this request. + * Fields not mentioned in `update_mask` are not changed and are ignored in + * the request. + * For example, to change the filter and description of an exclusion, + * specify an `update_mask` of `"filter,description"`. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the exclusion to update: + * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * For example: + * `"projects/my-project/exclusions/my-exclusion"` + * @type \Google\Cloud\Logging\V2\LogExclusion $exclusion + * Required. New values for the existing exclusion. Only the fields specified + * in `update_mask` are relevant. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. A non-empty list of fields to change in the existing exclusion. + * New values for the fields are taken from the corresponding fields in the + * [LogExclusion][google.logging.v2.LogExclusion] included in this request. + * Fields not mentioned in `update_mask` are not changed and are ignored in + * the request. + * For example, to change the filter and description of an exclusion, + * specify an `update_mask` of `"filter,description"`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the exclusion to update: + * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * For example: + * `"projects/my-project/exclusions/my-exclusion"` + * + * 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 exclusion to update: + * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * For example: + * `"projects/my-project/exclusions/my-exclusion"` + * + * 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. New values for the existing exclusion. Only the fields specified + * in `update_mask` are relevant. + * + * Generated from protobuf field .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Logging\V2\LogExclusion|null + */ + public function getExclusion() + { + return $this->exclusion; + } + + public function hasExclusion() + { + return isset($this->exclusion); + } + + public function clearExclusion() + { + unset($this->exclusion); + } + + /** + * Required. New values for the existing exclusion. Only the fields specified + * in `update_mask` are relevant. + * + * Generated from protobuf field .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Logging\V2\LogExclusion $var + * @return $this + */ + public function setExclusion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogExclusion::class); + $this->exclusion = $var; + + return $this; + } + + /** + * Required. A non-empty list of fields to change in the existing exclusion. + * New values for the fields are taken from the corresponding fields in the + * [LogExclusion][google.logging.v2.LogExclusion] included in this request. + * Fields not mentioned in `update_mask` are not changed and are ignored in + * the request. + * For example, to change the filter and description of an exclusion, + * specify an `update_mask` of `"filter,description"`. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.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. A non-empty list of fields to change in the existing exclusion. + * New values for the fields are taken from the corresponding fields in the + * [LogExclusion][google.logging.v2.LogExclusion] included in this request. + * Fields not mentioned in `update_mask` are not changed and are ignored in + * the request. + * For example, to change the filter and description of an exclusion, + * specify an `update_mask` of `"filter,description"`. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.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/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateLogMetricRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateLogMetricRequest.php new file mode 100644 index 000000000000..5236c519607f --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateLogMetricRequest.php @@ -0,0 +1,127 @@ +google.logging.v2.UpdateLogMetricRequest + */ +class UpdateLogMetricRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the metric to update: + * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * The updated metric must be provided in the request and it's + * `name` field must be the same as `[METRIC_ID]` If the metric + * does not exist in `[PROJECT_ID]`, then a new metric is created. + * + * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $metric_name = ''; + /** + * Required. The updated metric. + * + * Generated from protobuf field .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $metric = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $metric_name + * Required. The resource name of the metric to update: + * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * The updated metric must be provided in the request and it's + * `name` field must be the same as `[METRIC_ID]` If the metric + * does not exist in `[PROJECT_ID]`, then a new metric is created. + * @type \Google\Cloud\Logging\V2\LogMetric $metric + * Required. The updated metric. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingMetrics::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the metric to update: + * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * The updated metric must be provided in the request and it's + * `name` field must be the same as `[METRIC_ID]` If the metric + * does not exist in `[PROJECT_ID]`, then a new metric is created. + * + * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getMetricName() + { + return $this->metric_name; + } + + /** + * Required. The resource name of the metric to update: + * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * The updated metric must be provided in the request and it's + * `name` field must be the same as `[METRIC_ID]` If the metric + * does not exist in `[PROJECT_ID]`, then a new metric is created. + * + * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setMetricName($var) + { + GPBUtil::checkString($var, True); + $this->metric_name = $var; + + return $this; + } + + /** + * Required. The updated metric. + * + * Generated from protobuf field .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Logging\V2\LogMetric|null + */ + public function getMetric() + { + return $this->metric; + } + + public function hasMetric() + { + return isset($this->metric); + } + + public function clearMetric() + { + unset($this->metric); + } + + /** + * Required. The updated metric. + * + * Generated from protobuf field .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Logging\V2\LogMetric $var + * @return $this + */ + public function setMetric($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogMetric::class); + $this->metric = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateSettingsRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateSettingsRequest.php new file mode 100644 index 000000000000..6f410aa2c384 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateSettingsRequest.php @@ -0,0 +1,211 @@ +google.logging.v2.UpdateSettingsRequest + */ +class UpdateSettingsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name for the settings to update. + * "organizations/[ORGANIZATION_ID]/settings" + * For example: + * `"organizations/12345/settings"` + * Note: Settings for the Log Router can currently only be configured for + * Google Cloud organizations. Once configured, it applies to all projects and + * folders in the Google Cloud organization. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. The settings to update. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Generated from protobuf field .google.logging.v2.Settings settings = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $settings = null; + /** + * Optional. Field mask identifying which fields from `settings` should + * be updated. A field will be overwritten if and only if it is in the update + * mask. Output only fields cannot be updated. + * See [FieldMask][google.protobuf.FieldMask] for more information. + * For example: `"updateMask=kmsKeyName"` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name for the settings to update. + * "organizations/[ORGANIZATION_ID]/settings" + * For example: + * `"organizations/12345/settings"` + * Note: Settings for the Log Router can currently only be configured for + * Google Cloud organizations. Once configured, it applies to all projects and + * folders in the Google Cloud organization. + * @type \Google\Cloud\Logging\V2\Settings $settings + * Required. The settings to update. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask identifying which fields from `settings` should + * be updated. A field will be overwritten if and only if it is in the update + * mask. Output only fields cannot be updated. + * See [FieldMask][google.protobuf.FieldMask] for more information. + * For example: `"updateMask=kmsKeyName"` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name for the settings to update. + * "organizations/[ORGANIZATION_ID]/settings" + * For example: + * `"organizations/12345/settings"` + * Note: Settings for the Log Router can currently only be configured for + * Google Cloud organizations. Once configured, it applies to all projects and + * folders in the Google Cloud organization. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name for the settings to update. + * "organizations/[ORGANIZATION_ID]/settings" + * For example: + * `"organizations/12345/settings"` + * Note: Settings for the Log Router can currently only be configured for + * Google Cloud organizations. Once configured, it applies to all projects and + * folders in the Google Cloud organization. + * + * 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 settings to update. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Generated from protobuf field .google.logging.v2.Settings settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Logging\V2\Settings|null + */ + public function getSettings() + { + return $this->settings; + } + + public function hasSettings() + { + return isset($this->settings); + } + + public function clearSettings() + { + unset($this->settings); + } + + /** + * Required. The settings to update. + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Generated from protobuf field .google.logging.v2.Settings settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Logging\V2\Settings $var + * @return $this + */ + public function setSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\Settings::class); + $this->settings = $var; + + return $this; + } + + /** + * Optional. Field mask identifying which fields from `settings` should + * be updated. A field will be overwritten if and only if it is in the update + * mask. Output only fields cannot be updated. + * See [FieldMask][google.protobuf.FieldMask] for more information. + * For example: `"updateMask=kmsKeyName"` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.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 identifying which fields from `settings` should + * be updated. A field will be overwritten if and only if it is in the update + * mask. Output only fields cannot be updated. + * See [FieldMask][google.protobuf.FieldMask] for more information. + * For example: `"updateMask=kmsKeyName"` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.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/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateSinkRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateSinkRequest.php new file mode 100644 index 000000000000..a3ea6f1c69b4 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateSinkRequest.php @@ -0,0 +1,297 @@ +google.logging.v2.UpdateSinkRequest + */ +class UpdateSinkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full resource name of the sink to update, including the + * parent resource and the sink identifier: + * "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * For example: + * `"projects/my-project/sinks/my-sink"` + * + * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $sink_name = ''; + /** + * Required. The updated sink, whose name is the same identifier that appears + * as part of `sink_name`. + * + * Generated from protobuf field .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $sink = null; + /** + * Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] + * for a description of this field. When updating a sink, the effect of this + * field on the value of `writer_identity` in the updated sink depends on both + * the old and new values of this field: + * + If the old and new values of this field are both false or both true, + * then there is no change to the sink's `writer_identity`. + * + If the old value is false and the new value is true, then + * `writer_identity` is changed to a unique service account. + * + It is an error if the old value is true and the new value is + * set to false or defaulted to false. + * + * Generated from protobuf field bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $unique_writer_identity = false; + /** + * Optional. Field mask that specifies the fields in `sink` that need + * an update. A sink field will be overwritten if, and only if, it is + * in the update mask. `name` and output only fields cannot be updated. + * An empty `updateMask` is temporarily treated as using the following mask + * for backwards compatibility purposes: + * `destination,filter,includeChildren` + * At some point in the future, behavior will be removed and specifying an + * empty `updateMask` will be an error. + * For a detailed `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + * For example: `updateMask=filter` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $sink_name + * Required. The full resource name of the sink to update, including the + * parent resource and the sink identifier: + * "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * For example: + * `"projects/my-project/sinks/my-sink"` + * @type \Google\Cloud\Logging\V2\LogSink $sink + * Required. The updated sink, whose name is the same identifier that appears + * as part of `sink_name`. + * @type bool $unique_writer_identity + * Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] + * for a description of this field. When updating a sink, the effect of this + * field on the value of `writer_identity` in the updated sink depends on both + * the old and new values of this field: + * + If the old and new values of this field are both false or both true, + * then there is no change to the sink's `writer_identity`. + * + If the old value is false and the new value is true, then + * `writer_identity` is changed to a unique service account. + * + It is an error if the old value is true and the new value is + * set to false or defaulted to false. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask that specifies the fields in `sink` that need + * an update. A sink field will be overwritten if, and only if, it is + * in the update mask. `name` and output only fields cannot be updated. + * An empty `updateMask` is temporarily treated as using the following mask + * for backwards compatibility purposes: + * `destination,filter,includeChildren` + * At some point in the future, behavior will be removed and specifying an + * empty `updateMask` will be an error. + * For a detailed `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + * For example: `updateMask=filter` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full resource name of the sink to update, including the + * parent resource and the sink identifier: + * "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * For example: + * `"projects/my-project/sinks/my-sink"` + * + * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSinkName() + { + return $this->sink_name; + } + + /** + * Required. The full resource name of the sink to update, including the + * parent resource and the sink identifier: + * "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * For example: + * `"projects/my-project/sinks/my-sink"` + * + * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSinkName($var) + { + GPBUtil::checkString($var, True); + $this->sink_name = $var; + + return $this; + } + + /** + * Required. The updated sink, whose name is the same identifier that appears + * as part of `sink_name`. + * + * Generated from protobuf field .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Logging\V2\LogSink|null + */ + public function getSink() + { + return $this->sink; + } + + public function hasSink() + { + return isset($this->sink); + } + + public function clearSink() + { + unset($this->sink); + } + + /** + * Required. The updated sink, whose name is the same identifier that appears + * as part of `sink_name`. + * + * Generated from protobuf field .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Logging\V2\LogSink $var + * @return $this + */ + public function setSink($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogSink::class); + $this->sink = $var; + + return $this; + } + + /** + * Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] + * for a description of this field. When updating a sink, the effect of this + * field on the value of `writer_identity` in the updated sink depends on both + * the old and new values of this field: + * + If the old and new values of this field are both false or both true, + * then there is no change to the sink's `writer_identity`. + * + If the old value is false and the new value is true, then + * `writer_identity` is changed to a unique service account. + * + It is an error if the old value is true and the new value is + * set to false or defaulted to false. + * + * Generated from protobuf field bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getUniqueWriterIdentity() + { + return $this->unique_writer_identity; + } + + /** + * Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] + * for a description of this field. When updating a sink, the effect of this + * field on the value of `writer_identity` in the updated sink depends on both + * the old and new values of this field: + * + If the old and new values of this field are both false or both true, + * then there is no change to the sink's `writer_identity`. + * + If the old value is false and the new value is true, then + * `writer_identity` is changed to a unique service account. + * + It is an error if the old value is true and the new value is + * set to false or defaulted to false. + * + * Generated from protobuf field bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setUniqueWriterIdentity($var) + { + GPBUtil::checkBool($var); + $this->unique_writer_identity = $var; + + return $this; + } + + /** + * Optional. Field mask that specifies the fields in `sink` that need + * an update. A sink field will be overwritten if, and only if, it is + * in the update mask. `name` and output only fields cannot be updated. + * An empty `updateMask` is temporarily treated as using the following mask + * for backwards compatibility purposes: + * `destination,filter,includeChildren` + * At some point in the future, behavior will be removed and specifying an + * empty `updateMask` will be an error. + * For a detailed `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + * For example: `updateMask=filter` + * + * 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. Field mask that specifies the fields in `sink` that need + * an update. A sink field will be overwritten if, and only if, it is + * in the update mask. `name` and output only fields cannot be updated. + * An empty `updateMask` is temporarily treated as using the following mask + * for backwards compatibility purposes: + * `destination,filter,includeChildren` + * At some point in the future, behavior will be removed and specifying an + * empty `updateMask` will be an error. + * For a detailed `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + * For example: `updateMask=filter` + * + * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateViewRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateViewRequest.php new file mode 100644 index 000000000000..1058f7b4409d --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateViewRequest.php @@ -0,0 +1,187 @@ +google.logging.v2.UpdateViewRequest + */ +class UpdateViewRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full resource name of the view to update + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. The updated view. + * + * Generated from protobuf field .google.logging.v2.LogView view = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $view = null; + /** + * Optional. Field mask that specifies the fields in `view` that need + * an update. A field will be overwritten if, and only if, it is + * in the update mask. `name` and output only fields cannot be updated. + * For a detailed `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + * For example: `updateMask=filter` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full resource name of the view to update + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` + * @type \Google\Cloud\Logging\V2\LogView $view + * Required. The updated view. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask that specifies the fields in `view` that need + * an update. A field will be overwritten if, and only if, it is + * in the update mask. `name` and output only fields cannot be updated. + * For a detailed `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + * For example: `updateMask=filter` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full resource name of the view to update + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The full resource name of the view to update + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` + * + * 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 updated view. + * + * Generated from protobuf field .google.logging.v2.LogView view = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Logging\V2\LogView|null + */ + public function getView() + { + return $this->view; + } + + public function hasView() + { + return isset($this->view); + } + + public function clearView() + { + unset($this->view); + } + + /** + * Required. The updated view. + * + * Generated from protobuf field .google.logging.v2.LogView view = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Logging\V2\LogView $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogView::class); + $this->view = $var; + + return $this; + } + + /** + * Optional. Field mask that specifies the fields in `view` that need + * an update. A field will be overwritten if, and only if, it is + * in the update mask. `name` and output only fields cannot be updated. + * For a detailed `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + * For example: `updateMask=filter` + * + * 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. Field mask that specifies the fields in `view` that need + * an update. A field will be overwritten if, and only if, it is + * in the update mask. `name` and output only fields cannot be updated. + * For a detailed `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + * For example: `updateMask=filter` + * + * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesPartialErrors.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesPartialErrors.php new file mode 100644 index 000000000000..7ff395ccb489 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesPartialErrors.php @@ -0,0 +1,83 @@ +google.logging.v2.WriteLogEntriesPartialErrors + */ +class WriteLogEntriesPartialErrors extends \Google\Protobuf\Internal\Message +{ + /** + * When `WriteLogEntriesRequest.partial_success` is true, records the error + * status for entries that were not written due to a permanent error, keyed + * by the entry's zero-based index in `WriteLogEntriesRequest.entries`. + * Failed requests for which no entries are written will not include + * per-entry errors. + * + * Generated from protobuf field map log_entry_errors = 1; + */ + private $log_entry_errors; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $log_entry_errors + * When `WriteLogEntriesRequest.partial_success` is true, records the error + * status for entries that were not written due to a permanent error, keyed + * by the entry's zero-based index in `WriteLogEntriesRequest.entries`. + * Failed requests for which no entries are written will not include + * per-entry errors. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\Logging::initOnce(); + parent::__construct($data); + } + + /** + * When `WriteLogEntriesRequest.partial_success` is true, records the error + * status for entries that were not written due to a permanent error, keyed + * by the entry's zero-based index in `WriteLogEntriesRequest.entries`. + * Failed requests for which no entries are written will not include + * per-entry errors. + * + * Generated from protobuf field map log_entry_errors = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLogEntryErrors() + { + return $this->log_entry_errors; + } + + /** + * When `WriteLogEntriesRequest.partial_success` is true, records the error + * status for entries that were not written due to a permanent error, keyed + * by the entry's zero-based index in `WriteLogEntriesRequest.entries`. + * Failed requests for which no entries are written will not include + * per-entry errors. + * + * Generated from protobuf field map log_entry_errors = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLogEntryErrors($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::INT32, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->log_entry_errors = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesRequest.php new file mode 100644 index 000000000000..b692c454f128 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesRequest.php @@ -0,0 +1,439 @@ +google.logging.v2.WriteLogEntriesRequest + */ +class WriteLogEntriesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A default log resource name that is assigned to all log entries + * in `entries` that do not specify a value for `log_name`: + * * `projects/[PROJECT_ID]/logs/[LOG_ID]` + * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + * * `folders/[FOLDER_ID]/logs/[LOG_ID]` + * `[LOG_ID]` must be URL-encoded. For example: + * "projects/my-project-id/logs/syslog" + * "organizations/123/logs/cloudaudit.googleapis.com%2Factivity" + * The permission `logging.logEntries.create` is needed on each project, + * organization, billing account, or folder that is receiving new log + * entries, whether the resource is specified in `logName` or in an + * individual log entry. + * + * Generated from protobuf field string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $log_name = ''; + /** + * Optional. A default monitored resource object that is assigned to all log + * entries in `entries` that do not specify a value for `resource`. Example: + * { "type": "gce_instance", + * "labels": { + * "zone": "us-central1-a", "instance_id": "00000000000000000000" }} + * See [LogEntry][google.logging.v2.LogEntry]. + * + * Generated from protobuf field .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $resource = null; + /** + * Optional. Default labels that are added to the `labels` field of all log + * entries in `entries`. If a log entry already has a label with the same key + * as a label in this parameter, then the log entry's label is not changed. + * See [LogEntry][google.logging.v2.LogEntry]. + * + * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Required. The log entries to send to Logging. The order of log + * entries in this list does not matter. Values supplied in this method's + * `log_name`, `resource`, and `labels` fields are copied into those log + * entries in this list that do not include values for their corresponding + * fields. For more information, see the + * [LogEntry][google.logging.v2.LogEntry] type. + * If the `timestamp` or `insert_id` fields are missing in log entries, then + * this method supplies the current time or a unique identifier, respectively. + * The supplied values are chosen so that, among the log entries that did not + * supply their own values, the entries earlier in the list will sort before + * the entries later in the list. See the `entries.list` method. + * Log entries with timestamps that are more than the + * [logs retention period](https://cloud.google.com/logging/quotas) in + * the past or more than 24 hours in the future will not be available when + * calling `entries.list`. However, those log entries can still be [exported + * with + * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). + * To improve throughput and to avoid exceeding the + * [quota limit](https://cloud.google.com/logging/quotas) for calls to + * `entries.write`, you should try to include several log entries in this + * list, rather than calling this method for each individual log entry. + * + * Generated from protobuf field repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $entries; + /** + * Optional. Whether a batch's valid entries should be written even if some + * other entry failed due to a permanent error such as INVALID_ARGUMENT or + * PERMISSION_DENIED. If any entry failed, then the response status is the + * response status of one of the failed entries. The response will include + * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by + * the entries' zero-based index in the `entries`. Failed requests for which + * no entries are written will not include per-entry errors. + * + * Generated from protobuf field bool partial_success = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $partial_success = false; + /** + * Optional. If true, the request should expect normal response, but the + * entries won't be persisted nor exported. Useful for checking whether the + * logging API endpoints are working properly before sending valuable data. + * + * Generated from protobuf field bool dry_run = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $dry_run = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $log_name + * Optional. A default log resource name that is assigned to all log entries + * in `entries` that do not specify a value for `log_name`: + * * `projects/[PROJECT_ID]/logs/[LOG_ID]` + * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + * * `folders/[FOLDER_ID]/logs/[LOG_ID]` + * `[LOG_ID]` must be URL-encoded. For example: + * "projects/my-project-id/logs/syslog" + * "organizations/123/logs/cloudaudit.googleapis.com%2Factivity" + * The permission `logging.logEntries.create` is needed on each project, + * organization, billing account, or folder that is receiving new log + * entries, whether the resource is specified in `logName` or in an + * individual log entry. + * @type \Google\Api\MonitoredResource $resource + * Optional. A default monitored resource object that is assigned to all log + * entries in `entries` that do not specify a value for `resource`. Example: + * { "type": "gce_instance", + * "labels": { + * "zone": "us-central1-a", "instance_id": "00000000000000000000" }} + * See [LogEntry][google.logging.v2.LogEntry]. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Default labels that are added to the `labels` field of all log + * entries in `entries`. If a log entry already has a label with the same key + * as a label in this parameter, then the log entry's label is not changed. + * See [LogEntry][google.logging.v2.LogEntry]. + * @type array<\Google\Cloud\Logging\V2\LogEntry>|\Google\Protobuf\Internal\RepeatedField $entries + * Required. The log entries to send to Logging. The order of log + * entries in this list does not matter. Values supplied in this method's + * `log_name`, `resource`, and `labels` fields are copied into those log + * entries in this list that do not include values for their corresponding + * fields. For more information, see the + * [LogEntry][google.logging.v2.LogEntry] type. + * If the `timestamp` or `insert_id` fields are missing in log entries, then + * this method supplies the current time or a unique identifier, respectively. + * The supplied values are chosen so that, among the log entries that did not + * supply their own values, the entries earlier in the list will sort before + * the entries later in the list. See the `entries.list` method. + * Log entries with timestamps that are more than the + * [logs retention period](https://cloud.google.com/logging/quotas) in + * the past or more than 24 hours in the future will not be available when + * calling `entries.list`. However, those log entries can still be [exported + * with + * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). + * To improve throughput and to avoid exceeding the + * [quota limit](https://cloud.google.com/logging/quotas) for calls to + * `entries.write`, you should try to include several log entries in this + * list, rather than calling this method for each individual log entry. + * @type bool $partial_success + * Optional. Whether a batch's valid entries should be written even if some + * other entry failed due to a permanent error such as INVALID_ARGUMENT or + * PERMISSION_DENIED. If any entry failed, then the response status is the + * response status of one of the failed entries. The response will include + * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by + * the entries' zero-based index in the `entries`. Failed requests for which + * no entries are written will not include per-entry errors. + * @type bool $dry_run + * Optional. If true, the request should expect normal response, but the + * entries won't be persisted nor exported. Useful for checking whether the + * logging API endpoints are working properly before sending valuable data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\Logging::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A default log resource name that is assigned to all log entries + * in `entries` that do not specify a value for `log_name`: + * * `projects/[PROJECT_ID]/logs/[LOG_ID]` + * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + * * `folders/[FOLDER_ID]/logs/[LOG_ID]` + * `[LOG_ID]` must be URL-encoded. For example: + * "projects/my-project-id/logs/syslog" + * "organizations/123/logs/cloudaudit.googleapis.com%2Factivity" + * The permission `logging.logEntries.create` is needed on each project, + * organization, billing account, or folder that is receiving new log + * entries, whether the resource is specified in `logName` or in an + * individual log entry. + * + * Generated from protobuf field string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getLogName() + { + return $this->log_name; + } + + /** + * Optional. A default log resource name that is assigned to all log entries + * in `entries` that do not specify a value for `log_name`: + * * `projects/[PROJECT_ID]/logs/[LOG_ID]` + * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + * * `folders/[FOLDER_ID]/logs/[LOG_ID]` + * `[LOG_ID]` must be URL-encoded. For example: + * "projects/my-project-id/logs/syslog" + * "organizations/123/logs/cloudaudit.googleapis.com%2Factivity" + * The permission `logging.logEntries.create` is needed on each project, + * organization, billing account, or folder that is receiving new log + * entries, whether the resource is specified in `logName` or in an + * individual log entry. + * + * Generated from protobuf field string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLogName($var) + { + GPBUtil::checkString($var, True); + $this->log_name = $var; + + return $this; + } + + /** + * Optional. A default monitored resource object that is assigned to all log + * entries in `entries` that do not specify a value for `resource`. Example: + * { "type": "gce_instance", + * "labels": { + * "zone": "us-central1-a", "instance_id": "00000000000000000000" }} + * See [LogEntry][google.logging.v2.LogEntry]. + * + * Generated from protobuf field .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Api\MonitoredResource|null + */ + public function getResource() + { + return $this->resource; + } + + public function hasResource() + { + return isset($this->resource); + } + + public function clearResource() + { + unset($this->resource); + } + + /** + * Optional. A default monitored resource object that is assigned to all log + * entries in `entries` that do not specify a value for `resource`. Example: + * { "type": "gce_instance", + * "labels": { + * "zone": "us-central1-a", "instance_id": "00000000000000000000" }} + * See [LogEntry][google.logging.v2.LogEntry]. + * + * Generated from protobuf field .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Api\MonitoredResource $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkMessage($var, \Google\Api\MonitoredResource::class); + $this->resource = $var; + + return $this; + } + + /** + * Optional. Default labels that are added to the `labels` field of all log + * entries in `entries`. If a log entry already has a label with the same key + * as a label in this parameter, then the log entry's label is not changed. + * See [LogEntry][google.logging.v2.LogEntry]. + * + * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Default labels that are added to the `labels` field of all log + * entries in `entries`. If a log entry already has a label with the same key + * as a label in this parameter, then the log entry's label is not changed. + * See [LogEntry][google.logging.v2.LogEntry]. + * + * 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; + } + + /** + * Required. The log entries to send to Logging. The order of log + * entries in this list does not matter. Values supplied in this method's + * `log_name`, `resource`, and `labels` fields are copied into those log + * entries in this list that do not include values for their corresponding + * fields. For more information, see the + * [LogEntry][google.logging.v2.LogEntry] type. + * If the `timestamp` or `insert_id` fields are missing in log entries, then + * this method supplies the current time or a unique identifier, respectively. + * The supplied values are chosen so that, among the log entries that did not + * supply their own values, the entries earlier in the list will sort before + * the entries later in the list. See the `entries.list` method. + * Log entries with timestamps that are more than the + * [logs retention period](https://cloud.google.com/logging/quotas) in + * the past or more than 24 hours in the future will not be available when + * calling `entries.list`. However, those log entries can still be [exported + * with + * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). + * To improve throughput and to avoid exceeding the + * [quota limit](https://cloud.google.com/logging/quotas) for calls to + * `entries.write`, you should try to include several log entries in this + * list, rather than calling this method for each individual log entry. + * + * Generated from protobuf field repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntries() + { + return $this->entries; + } + + /** + * Required. The log entries to send to Logging. The order of log + * entries in this list does not matter. Values supplied in this method's + * `log_name`, `resource`, and `labels` fields are copied into those log + * entries in this list that do not include values for their corresponding + * fields. For more information, see the + * [LogEntry][google.logging.v2.LogEntry] type. + * If the `timestamp` or `insert_id` fields are missing in log entries, then + * this method supplies the current time or a unique identifier, respectively. + * The supplied values are chosen so that, among the log entries that did not + * supply their own values, the entries earlier in the list will sort before + * the entries later in the list. See the `entries.list` method. + * Log entries with timestamps that are more than the + * [logs retention period](https://cloud.google.com/logging/quotas) in + * the past or more than 24 hours in the future will not be available when + * calling `entries.list`. However, those log entries can still be [exported + * with + * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). + * To improve throughput and to avoid exceeding the + * [quota limit](https://cloud.google.com/logging/quotas) for calls to + * `entries.write`, you should try to include several log entries in this + * list, rather than calling this method for each individual log entry. + * + * Generated from protobuf field repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Logging\V2\LogEntry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogEntry::class); + $this->entries = $arr; + + return $this; + } + + /** + * Optional. Whether a batch's valid entries should be written even if some + * other entry failed due to a permanent error such as INVALID_ARGUMENT or + * PERMISSION_DENIED. If any entry failed, then the response status is the + * response status of one of the failed entries. The response will include + * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by + * the entries' zero-based index in the `entries`. Failed requests for which + * no entries are written will not include per-entry errors. + * + * Generated from protobuf field bool partial_success = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getPartialSuccess() + { + return $this->partial_success; + } + + /** + * Optional. Whether a batch's valid entries should be written even if some + * other entry failed due to a permanent error such as INVALID_ARGUMENT or + * PERMISSION_DENIED. If any entry failed, then the response status is the + * response status of one of the failed entries. The response will include + * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by + * the entries' zero-based index in the `entries`. Failed requests for which + * no entries are written will not include per-entry errors. + * + * Generated from protobuf field bool partial_success = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setPartialSuccess($var) + { + GPBUtil::checkBool($var); + $this->partial_success = $var; + + return $this; + } + + /** + * Optional. If true, the request should expect normal response, but the + * entries won't be persisted nor exported. Useful for checking whether the + * logging API endpoints are working properly before sending valuable data. + * + * Generated from protobuf field bool dry_run = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDryRun() + { + return $this->dry_run; + } + + /** + * Optional. If true, the request should expect normal response, but the + * entries won't be persisted nor exported. Useful for checking whether the + * logging API endpoints are working properly before sending valuable data. + * + * Generated from protobuf field bool dry_run = 6 [(.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/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesResponse.php new file mode 100644 index 000000000000..006dcaf82055 --- /dev/null +++ b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesResponse.php @@ -0,0 +1,33 @@ +google.logging.v2.WriteLogEntriesResponse + */ +class WriteLogEntriesResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Logging\V2\Logging::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/copy_log_entries.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/copy_log_entries.php new file mode 100644 index 000000000000..5234133bcf86 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/copy_log_entries.php @@ -0,0 +1,83 @@ +copyLogEntries($name, $destination); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var CopyLogEntriesResponse $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]'; + $destination = '[DESTINATION]'; + + copy_log_entries_sample($name, $destination); +} +// [END logging_v2_generated_ConfigServiceV2_CopyLogEntries_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_bucket.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_bucket.php new file mode 100644 index 000000000000..e1112e178d83 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_bucket.php @@ -0,0 +1,80 @@ +createBucket($formattedParent, $bucketId, $bucket); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - 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 = ConfigServiceV2Client::organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $bucketId = '[BUCKET_ID]'; + + create_bucket_sample($formattedParent, $bucketId); +} +// [END logging_v2_generated_ConfigServiceV2_CreateBucket_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_bucket_async.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_bucket_async.php new file mode 100644 index 000000000000..16ed75593aee --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_bucket_async.php @@ -0,0 +1,93 @@ +createBucketAsync($formattedParent, $bucketId, $bucket); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var LogBucket $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 = ConfigServiceV2Client::organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $bucketId = '[BUCKET_ID]'; + + create_bucket_async_sample($formattedParent, $bucketId); +} +// [END logging_v2_generated_ConfigServiceV2_CreateBucketAsync_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_exclusion.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_exclusion.php new file mode 100644 index 000000000000..915057c7dc25 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_exclusion.php @@ -0,0 +1,102 @@ +setName($exclusionName) + ->setFilter($exclusionFilter); + + // Call the API and handle any network failures. + try { + /** @var LogExclusion $response */ + $response = $configServiceV2Client->createExclusion($formattedParent, $exclusion); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - 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 = ConfigServiceV2Client::projectName('[PROJECT]'); + $exclusionName = '[NAME]'; + $exclusionFilter = '[FILTER]'; + + create_exclusion_sample($formattedParent, $exclusionName, $exclusionFilter); +} +// [END logging_v2_generated_ConfigServiceV2_CreateExclusion_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_link.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_link.php new file mode 100644 index 000000000000..5a07608cd118 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_link.php @@ -0,0 +1,92 @@ +createLink($formattedParent, $link, $linkId); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Link $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 = ConfigServiceV2Client::logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + $linkId = '[LINK_ID]'; + + create_link_sample($formattedParent, $linkId); +} +// [END logging_v2_generated_ConfigServiceV2_CreateLink_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_sink.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_sink.php new file mode 100644 index 000000000000..375c4761e9a8 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_sink.php @@ -0,0 +1,106 @@ +setName($sinkName) + ->setDestination($sinkDestination); + + // Call the API and handle any network failures. + try { + /** @var LogSink $response */ + $response = $configServiceV2Client->createSink($formattedParent, $sink); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - 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 = ConfigServiceV2Client::projectName('[PROJECT]'); + $sinkName = '[NAME]'; + $sinkDestination = '[DESTINATION]'; + + create_sink_sample($formattedParent, $sinkName, $sinkDestination); +} +// [END logging_v2_generated_ConfigServiceV2_CreateSink_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_view.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_view.php new file mode 100644 index 000000000000..b76c064d0d21 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_view.php @@ -0,0 +1,79 @@ +createView($parent, $viewId, $view); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - 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]'; + $viewId = '[VIEW_ID]'; + + create_view_sample($parent, $viewId); +} +// [END logging_v2_generated_ConfigServiceV2_CreateView_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_bucket.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_bucket.php new file mode 100644 index 000000000000..8f34265aa899 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_bucket.php @@ -0,0 +1,77 @@ +deleteBucket($formattedName); + 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 = ConfigServiceV2Client::logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + + delete_bucket_sample($formattedName); +} +// [END logging_v2_generated_ConfigServiceV2_DeleteBucket_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_exclusion.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_exclusion.php new file mode 100644 index 000000000000..2491c77e24f6 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_exclusion.php @@ -0,0 +1,73 @@ +deleteExclusion($formattedName); + 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 = ConfigServiceV2Client::logExclusionName('[PROJECT]', '[EXCLUSION]'); + + delete_exclusion_sample($formattedName); +} +// [END logging_v2_generated_ConfigServiceV2_DeleteExclusion_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_link.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_link.php new file mode 100644 index 000000000000..e38a0f9b73cc --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_link.php @@ -0,0 +1,81 @@ +deleteLink($formattedName); + $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 = ConfigServiceV2Client::linkName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[LINK]'); + + delete_link_sample($formattedName); +} +// [END logging_v2_generated_ConfigServiceV2_DeleteLink_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_sink.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_sink.php new file mode 100644 index 000000000000..48b1dd0a3598 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_sink.php @@ -0,0 +1,75 @@ +deleteSink($formattedSinkName); + 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 +{ + $formattedSinkName = ConfigServiceV2Client::logSinkName('[PROJECT]', '[SINK]'); + + delete_sink_sample($formattedSinkName); +} +// [END logging_v2_generated_ConfigServiceV2_DeleteSink_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_view.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_view.php new file mode 100644 index 000000000000..50ad44896b9f --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_view.php @@ -0,0 +1,78 @@ +deleteView($formattedName); + 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 = ConfigServiceV2Client::logViewName( + '[PROJECT]', + '[LOCATION]', + '[BUCKET]', + '[VIEW]' + ); + + delete_view_sample($formattedName); +} +// [END logging_v2_generated_ConfigServiceV2_DeleteView_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_bucket.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_bucket.php new file mode 100644 index 000000000000..9c8d0317d0c0 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_bucket.php @@ -0,0 +1,75 @@ +getBucket($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - 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 = ConfigServiceV2Client::logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + + get_bucket_sample($formattedName); +} +// [END logging_v2_generated_ConfigServiceV2_GetBucket_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_cmek_settings.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_cmek_settings.php new file mode 100644 index 000000000000..b33229bac7e7 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_cmek_settings.php @@ -0,0 +1,62 @@ +getCmekSettings(); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END logging_v2_generated_ConfigServiceV2_GetCmekSettings_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_exclusion.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_exclusion.php new file mode 100644 index 000000000000..3d5bf7aeea32 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_exclusion.php @@ -0,0 +1,75 @@ +getExclusion($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - 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 = ConfigServiceV2Client::logExclusionName('[PROJECT]', '[EXCLUSION]'); + + get_exclusion_sample($formattedName); +} +// [END logging_v2_generated_ConfigServiceV2_GetExclusion_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_link.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_link.php new file mode 100644 index 000000000000..d0ab8339441f --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_link.php @@ -0,0 +1,71 @@ +getLink($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - 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 = ConfigServiceV2Client::linkName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[LINK]'); + + get_link_sample($formattedName); +} +// [END logging_v2_generated_ConfigServiceV2_GetLink_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_settings.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_settings.php new file mode 100644 index 000000000000..7d49c190e210 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_settings.php @@ -0,0 +1,89 @@ +getSettings($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - 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 = ConfigServiceV2Client::settingsName('[PROJECT]'); + + get_settings_sample($formattedName); +} +// [END logging_v2_generated_ConfigServiceV2_GetSettings_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_sink.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_sink.php new file mode 100644 index 000000000000..3302fd369a33 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_sink.php @@ -0,0 +1,75 @@ +getSink($formattedSinkName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedSinkName = ConfigServiceV2Client::logSinkName('[PROJECT]', '[SINK]'); + + get_sink_sample($formattedSinkName); +} +// [END logging_v2_generated_ConfigServiceV2_GetSink_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_view.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_view.php new file mode 100644 index 000000000000..3473f3433474 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_view.php @@ -0,0 +1,77 @@ +getView($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - 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 = ConfigServiceV2Client::logViewName( + '[PROJECT]', + '[LOCATION]', + '[BUCKET]', + '[VIEW]' + ); + + get_view_sample($formattedName); +} +// [END logging_v2_generated_ConfigServiceV2_GetView_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_buckets.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_buckets.php new file mode 100644 index 000000000000..2491b879b177 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_buckets.php @@ -0,0 +1,80 @@ +listBuckets($formattedParent); + + /** @var LogBucket $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 = ConfigServiceV2Client::organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + + list_buckets_sample($formattedParent); +} +// [END logging_v2_generated_ConfigServiceV2_ListBuckets_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_exclusions.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_exclusions.php new file mode 100644 index 000000000000..bb0036617b43 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_exclusions.php @@ -0,0 +1,76 @@ +listExclusions($formattedParent); + + /** @var LogExclusion $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 = ConfigServiceV2Client::projectName('[PROJECT]'); + + list_exclusions_sample($formattedParent); +} +// [END logging_v2_generated_ConfigServiceV2_ListExclusions_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_links.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_links.php new file mode 100644 index 000000000000..481251d77495 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_links.php @@ -0,0 +1,76 @@ +listLinks($formattedParent); + + /** @var Link $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 = ConfigServiceV2Client::logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + + list_links_sample($formattedParent); +} +// [END logging_v2_generated_ConfigServiceV2_ListLinks_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_sinks.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_sinks.php new file mode 100644 index 000000000000..f7668bcf5619 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_sinks.php @@ -0,0 +1,76 @@ +listSinks($formattedParent); + + /** @var LogSink $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 = ConfigServiceV2Client::projectName('[PROJECT]'); + + list_sinks_sample($formattedParent); +} +// [END logging_v2_generated_ConfigServiceV2_ListSinks_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_views.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_views.php new file mode 100644 index 000000000000..bd7d34d2fd59 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_views.php @@ -0,0 +1,72 @@ +listViews($parent); + + /** @var LogView $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_views_sample($parent); +} +// [END logging_v2_generated_ConfigServiceV2_ListViews_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/undelete_bucket.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/undelete_bucket.php new file mode 100644 index 000000000000..1890823207ae --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/undelete_bucket.php @@ -0,0 +1,74 @@ +undeleteBucket($formattedName); + 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 = ConfigServiceV2Client::logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + + undelete_bucket_sample($formattedName); +} +// [END logging_v2_generated_ConfigServiceV2_UndeleteBucket_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_bucket.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_bucket.php new file mode 100644 index 000000000000..1cd46f881164 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_bucket.php @@ -0,0 +1,85 @@ +updateBucket($formattedName, $bucket, $updateMask); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - 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 = ConfigServiceV2Client::logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + + update_bucket_sample($formattedName); +} +// [END logging_v2_generated_ConfigServiceV2_UpdateBucket_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_bucket_async.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_bucket_async.php new file mode 100644 index 000000000000..54aacc0f3091 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_bucket_async.php @@ -0,0 +1,97 @@ +updateBucketAsync($formattedName, $bucket, $updateMask); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var LogBucket $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 = ConfigServiceV2Client::logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + + update_bucket_async_sample($formattedName); +} +// [END logging_v2_generated_ConfigServiceV2_UpdateBucketAsync_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_cmek_settings.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_cmek_settings.php new file mode 100644 index 000000000000..2d924f8c272c --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_cmek_settings.php @@ -0,0 +1,67 @@ +updateCmekSettings(); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateCmekSettings_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_exclusion.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_exclusion.php new file mode 100644 index 000000000000..28f227546709 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_exclusion.php @@ -0,0 +1,102 @@ +setName($exclusionName) + ->setFilter($exclusionFilter); + $updateMask = new FieldMask(); + + // Call the API and handle any network failures. + try { + /** @var LogExclusion $response */ + $response = $configServiceV2Client->updateExclusion($formattedName, $exclusion, $updateMask); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - 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 = ConfigServiceV2Client::logExclusionName('[PROJECT]', '[EXCLUSION]'); + $exclusionName = '[NAME]'; + $exclusionFilter = '[FILTER]'; + + update_exclusion_sample($formattedName, $exclusionName, $exclusionFilter); +} +// [END logging_v2_generated_ConfigServiceV2_UpdateExclusion_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_settings.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_settings.php new file mode 100644 index 000000000000..5021dc20e44d --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_settings.php @@ -0,0 +1,93 @@ +updateSettings($name, $settings); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - 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]'; + + update_settings_sample($name); +} +// [END logging_v2_generated_ConfigServiceV2_UpdateSettings_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_sink.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_sink.php new file mode 100644 index 000000000000..9e83e5dc2901 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_sink.php @@ -0,0 +1,107 @@ +setName($sinkName) + ->setDestination($sinkDestination); + + // Call the API and handle any network failures. + try { + /** @var LogSink $response */ + $response = $configServiceV2Client->updateSink($formattedSinkName, $sink); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedSinkName = ConfigServiceV2Client::logSinkName('[PROJECT]', '[SINK]'); + $sinkName = '[NAME]'; + $sinkDestination = '[DESTINATION]'; + + update_sink_sample($formattedSinkName, $sinkName, $sinkDestination); +} +// [END logging_v2_generated_ConfigServiceV2_UpdateSink_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_view.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_view.php new file mode 100644 index 000000000000..da603e9f4c8a --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_view.php @@ -0,0 +1,78 @@ +updateView($name, $view); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - 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]'; + + update_view_sample($name); +} +// [END logging_v2_generated_ConfigServiceV2_UpdateView_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/delete_log.php b/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/delete_log.php new file mode 100644 index 000000000000..813c0f3e4b65 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/delete_log.php @@ -0,0 +1,79 @@ +deleteLog($formattedLogName); + 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 +{ + $formattedLogName = LoggingServiceV2Client::logName('[PROJECT]', '[LOG]'); + + delete_log_sample($formattedLogName); +} +// [END logging_v2_generated_LoggingServiceV2_DeleteLog_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_log_entries.php b/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_log_entries.php new file mode 100644 index 000000000000..11ecf1f1c9a2 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_log_entries.php @@ -0,0 +1,93 @@ +listLogEntries($formattedResourceNames); + + /** @var LogEntry $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 +{ + $formattedResourceNamesElement = LoggingServiceV2Client::projectName('[PROJECT]'); + + list_log_entries_sample($formattedResourceNamesElement); +} +// [END logging_v2_generated_LoggingServiceV2_ListLogEntries_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_logs.php b/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_logs.php new file mode 100644 index 000000000000..dc830797e63e --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_logs.php @@ -0,0 +1,76 @@ +listLogs($formattedParent); + + /** @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 +{ + $formattedParent = LoggingServiceV2Client::projectName('[PROJECT]'); + + list_logs_sample($formattedParent); +} +// [END logging_v2_generated_LoggingServiceV2_ListLogs_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_monitored_resource_descriptors.php b/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_monitored_resource_descriptors.php new file mode 100644 index 000000000000..0f4961127543 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_monitored_resource_descriptors.php @@ -0,0 +1,58 @@ +listMonitoredResourceDescriptors(); + + /** @var MonitoredResourceDescriptor $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 logging_v2_generated_LoggingServiceV2_ListMonitoredResourceDescriptors_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/tail_log_entries.php b/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/tail_log_entries.php new file mode 100644 index 000000000000..3afb4406b571 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/tail_log_entries.php @@ -0,0 +1,90 @@ +setResourceNames($resourceNames); + + // Call the API and handle any network failures. + try { + /** @var BidiStream $stream */ + $stream = $loggingServiceV2Client->tailLogEntries(); + $stream->writeAll([$request,]); + + /** @var TailLogEntriesResponse $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 +{ + $resourceNamesElement = '[RESOURCE_NAMES]'; + + tail_log_entries_sample($resourceNamesElement); +} +// [END logging_v2_generated_LoggingServiceV2_TailLogEntries_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/write_log_entries.php b/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/write_log_entries.php new file mode 100644 index 000000000000..e2fc147a12f4 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/write_log_entries.php @@ -0,0 +1,102 @@ +setLogName($entriesLogName) + ->setResource($entriesResource); + $entries = [$logEntry,]; + + // Call the API and handle any network failures. + try { + /** @var WriteLogEntriesResponse $response */ + $response = $loggingServiceV2Client->writeLogEntries($entries); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $entriesLogName = '[LOG_NAME]'; + + write_log_entries_sample($entriesLogName); +} +// [END logging_v2_generated_LoggingServiceV2_WriteLogEntries_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/create_log_metric.php b/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/create_log_metric.php new file mode 100644 index 000000000000..a873a9f9639e --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/create_log_metric.php @@ -0,0 +1,100 @@ +=ERROR" + * + * The maximum length of the filter is 20000 characters. + */ +function create_log_metric_sample( + string $formattedParent, + string $metricName, + string $metricFilter +): void { + // Create a client. + $metricsServiceV2Client = new MetricsServiceV2Client(); + + // Prepare any non-scalar elements to be passed along with the request. + $metric = (new LogMetric()) + ->setName($metricName) + ->setFilter($metricFilter); + + // Call the API and handle any network failures. + try { + /** @var LogMetric $response */ + $response = $metricsServiceV2Client->createLogMetric($formattedParent, $metric); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - 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 = MetricsServiceV2Client::projectName('[PROJECT]'); + $metricName = '[NAME]'; + $metricFilter = '[FILTER]'; + + create_log_metric_sample($formattedParent, $metricName, $metricFilter); +} +// [END logging_v2_generated_MetricsServiceV2_CreateLogMetric_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/delete_log_metric.php b/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/delete_log_metric.php new file mode 100644 index 000000000000..8f76819f29ce --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/delete_log_metric.php @@ -0,0 +1,66 @@ +deleteLogMetric($formattedMetricName); + 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 +{ + $formattedMetricName = MetricsServiceV2Client::logMetricName('[PROJECT]', '[METRIC]'); + + delete_log_metric_sample($formattedMetricName); +} +// [END logging_v2_generated_MetricsServiceV2_DeleteLogMetric_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/get_log_metric.php b/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/get_log_metric.php new file mode 100644 index 000000000000..a2851efe73ca --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/get_log_metric.php @@ -0,0 +1,68 @@ +getLogMetric($formattedMetricName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedMetricName = MetricsServiceV2Client::logMetricName('[PROJECT]', '[METRIC]'); + + get_log_metric_sample($formattedMetricName); +} +// [END logging_v2_generated_MetricsServiceV2_GetLogMetric_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/list_log_metrics.php b/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/list_log_metrics.php new file mode 100644 index 000000000000..4b62e905f0d1 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/list_log_metrics.php @@ -0,0 +1,73 @@ +listLogMetrics($formattedParent); + + /** @var LogMetric $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 = MetricsServiceV2Client::projectName('[PROJECT]'); + + list_log_metrics_sample($formattedParent); +} +// [END logging_v2_generated_MetricsServiceV2_ListLogMetrics_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/update_log_metric.php b/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/update_log_metric.php new file mode 100644 index 000000000000..2aa78c5446f3 --- /dev/null +++ b/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/update_log_metric.php @@ -0,0 +1,102 @@ +=ERROR" + * + * The maximum length of the filter is 20000 characters. + */ +function update_log_metric_sample( + string $formattedMetricName, + string $metricName, + string $metricFilter +): void { + // Create a client. + $metricsServiceV2Client = new MetricsServiceV2Client(); + + // Prepare any non-scalar elements to be passed along with the request. + $metric = (new LogMetric()) + ->setName($metricName) + ->setFilter($metricFilter); + + // Call the API and handle any network failures. + try { + /** @var LogMetric $response */ + $response = $metricsServiceV2Client->updateLogMetric($formattedMetricName, $metric); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedMetricName = MetricsServiceV2Client::logMetricName('[PROJECT]', '[METRIC]'); + $metricName = '[NAME]'; + $metricFilter = '[FILTER]'; + + update_log_metric_sample($formattedMetricName, $metricName, $metricFilter); +} +// [END logging_v2_generated_MetricsServiceV2_UpdateLogMetric_sync] diff --git a/owl-bot-staging/Logging/v2/src/V2/ConfigServiceV2Client.php b/owl-bot-staging/Logging/v2/src/V2/ConfigServiceV2Client.php new file mode 100644 index 000000000000..7fb015b5335c --- /dev/null +++ b/owl-bot-staging/Logging/v2/src/V2/ConfigServiceV2Client.php @@ -0,0 +1,34 @@ +copyLogEntries($name, $destination); + * $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 = $configServiceV2Client->copyLogEntries($name, $destination); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $configServiceV2Client->resumeOperation($operationName, 'copyLogEntries'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $configServiceV2Client->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. + */ +class ConfigServiceV2GapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.logging.v2.ConfigServiceV2'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'logging.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + 'https://www.googleapis.com/auth/logging.admin', + 'https://www.googleapis.com/auth/logging.read', + ]; + + private static $billingAccountNameTemplate; + + private static $billingAccountCmekSettingsNameTemplate; + + private static $billingAccountExclusionNameTemplate; + + private static $billingAccountLocationNameTemplate; + + private static $billingAccountLocationBucketNameTemplate; + + private static $billingAccountLocationBucketLinkNameTemplate; + + private static $billingAccountLocationBucketViewNameTemplate; + + private static $billingAccountSettingsNameTemplate; + + private static $billingAccountSinkNameTemplate; + + private static $cmekSettingsNameTemplate; + + private static $folderNameTemplate; + + private static $folderCmekSettingsNameTemplate; + + private static $folderExclusionNameTemplate; + + private static $folderLocationNameTemplate; + + private static $folderLocationBucketNameTemplate; + + private static $folderLocationBucketLinkNameTemplate; + + private static $folderLocationBucketViewNameTemplate; + + private static $folderSettingsNameTemplate; + + private static $folderSinkNameTemplate; + + private static $linkNameTemplate; + + private static $locationNameTemplate; + + private static $logBucketNameTemplate; + + private static $logExclusionNameTemplate; + + private static $logSinkNameTemplate; + + private static $logViewNameTemplate; + + private static $organizationNameTemplate; + + private static $organizationCmekSettingsNameTemplate; + + private static $organizationExclusionNameTemplate; + + private static $organizationLocationNameTemplate; + + private static $organizationLocationBucketNameTemplate; + + private static $organizationLocationBucketLinkNameTemplate; + + private static $organizationLocationBucketViewNameTemplate; + + private static $organizationSettingsNameTemplate; + + private static $organizationSinkNameTemplate; + + private static $projectNameTemplate; + + private static $projectCmekSettingsNameTemplate; + + private static $projectExclusionNameTemplate; + + private static $projectLocationBucketNameTemplate; + + private static $projectLocationBucketLinkNameTemplate; + + private static $projectLocationBucketViewNameTemplate; + + private static $projectSettingsNameTemplate; + + private static $projectSinkNameTemplate; + + private static $settingsNameTemplate; + + 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/config_service_v2_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/config_service_v2_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/config_service_v2_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/config_service_v2_rest_client_config.php', + ], + ], + ]; + } + + private static function getBillingAccountNameTemplate() + { + if (self::$billingAccountNameTemplate == null) { + self::$billingAccountNameTemplate = new PathTemplate('billingAccounts/{billing_account}'); + } + + return self::$billingAccountNameTemplate; + } + + private static function getBillingAccountCmekSettingsNameTemplate() + { + if (self::$billingAccountCmekSettingsNameTemplate == null) { + self::$billingAccountCmekSettingsNameTemplate = new PathTemplate('billingAccounts/{billing_account}/cmekSettings'); + } + + return self::$billingAccountCmekSettingsNameTemplate; + } + + private static function getBillingAccountExclusionNameTemplate() + { + if (self::$billingAccountExclusionNameTemplate == null) { + self::$billingAccountExclusionNameTemplate = new PathTemplate('billingAccounts/{billing_account}/exclusions/{exclusion}'); + } + + return self::$billingAccountExclusionNameTemplate; + } + + private static function getBillingAccountLocationNameTemplate() + { + if (self::$billingAccountLocationNameTemplate == null) { + self::$billingAccountLocationNameTemplate = new PathTemplate('billingAccounts/{billing_account}/locations/{location}'); + } + + return self::$billingAccountLocationNameTemplate; + } + + private static function getBillingAccountLocationBucketNameTemplate() + { + if (self::$billingAccountLocationBucketNameTemplate == null) { + self::$billingAccountLocationBucketNameTemplate = new PathTemplate('billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}'); + } + + return self::$billingAccountLocationBucketNameTemplate; + } + + private static function getBillingAccountLocationBucketLinkNameTemplate() + { + if (self::$billingAccountLocationBucketLinkNameTemplate == null) { + self::$billingAccountLocationBucketLinkNameTemplate = new PathTemplate('billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/links/{link}'); + } + + return self::$billingAccountLocationBucketLinkNameTemplate; + } + + private static function getBillingAccountLocationBucketViewNameTemplate() + { + if (self::$billingAccountLocationBucketViewNameTemplate == null) { + self::$billingAccountLocationBucketViewNameTemplate = new PathTemplate('billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/views/{view}'); + } + + return self::$billingAccountLocationBucketViewNameTemplate; + } + + private static function getBillingAccountSettingsNameTemplate() + { + if (self::$billingAccountSettingsNameTemplate == null) { + self::$billingAccountSettingsNameTemplate = new PathTemplate('billingAccounts/{billing_account}/settings'); + } + + return self::$billingAccountSettingsNameTemplate; + } + + private static function getBillingAccountSinkNameTemplate() + { + if (self::$billingAccountSinkNameTemplate == null) { + self::$billingAccountSinkNameTemplate = new PathTemplate('billingAccounts/{billing_account}/sinks/{sink}'); + } + + return self::$billingAccountSinkNameTemplate; + } + + private static function getCmekSettingsNameTemplate() + { + if (self::$cmekSettingsNameTemplate == null) { + self::$cmekSettingsNameTemplate = new PathTemplate('projects/{project}/cmekSettings'); + } + + return self::$cmekSettingsNameTemplate; + } + + private static function getFolderNameTemplate() + { + if (self::$folderNameTemplate == null) { + self::$folderNameTemplate = new PathTemplate('folders/{folder}'); + } + + return self::$folderNameTemplate; + } + + private static function getFolderCmekSettingsNameTemplate() + { + if (self::$folderCmekSettingsNameTemplate == null) { + self::$folderCmekSettingsNameTemplate = new PathTemplate('folders/{folder}/cmekSettings'); + } + + return self::$folderCmekSettingsNameTemplate; + } + + private static function getFolderExclusionNameTemplate() + { + if (self::$folderExclusionNameTemplate == null) { + self::$folderExclusionNameTemplate = new PathTemplate('folders/{folder}/exclusions/{exclusion}'); + } + + return self::$folderExclusionNameTemplate; + } + + private static function getFolderLocationNameTemplate() + { + if (self::$folderLocationNameTemplate == null) { + self::$folderLocationNameTemplate = new PathTemplate('folders/{folder}/locations/{location}'); + } + + return self::$folderLocationNameTemplate; + } + + private static function getFolderLocationBucketNameTemplate() + { + if (self::$folderLocationBucketNameTemplate == null) { + self::$folderLocationBucketNameTemplate = new PathTemplate('folders/{folder}/locations/{location}/buckets/{bucket}'); + } + + return self::$folderLocationBucketNameTemplate; + } + + private static function getFolderLocationBucketLinkNameTemplate() + { + if (self::$folderLocationBucketLinkNameTemplate == null) { + self::$folderLocationBucketLinkNameTemplate = new PathTemplate('folders/{folder}/locations/{location}/buckets/{bucket}/links/{link}'); + } + + return self::$folderLocationBucketLinkNameTemplate; + } + + private static function getFolderLocationBucketViewNameTemplate() + { + if (self::$folderLocationBucketViewNameTemplate == null) { + self::$folderLocationBucketViewNameTemplate = new PathTemplate('folders/{folder}/locations/{location}/buckets/{bucket}/views/{view}'); + } + + return self::$folderLocationBucketViewNameTemplate; + } + + private static function getFolderSettingsNameTemplate() + { + if (self::$folderSettingsNameTemplate == null) { + self::$folderSettingsNameTemplate = new PathTemplate('folders/{folder}/settings'); + } + + return self::$folderSettingsNameTemplate; + } + + private static function getFolderSinkNameTemplate() + { + if (self::$folderSinkNameTemplate == null) { + self::$folderSinkNameTemplate = new PathTemplate('folders/{folder}/sinks/{sink}'); + } + + return self::$folderSinkNameTemplate; + } + + private static function getLinkNameTemplate() + { + if (self::$linkNameTemplate == null) { + self::$linkNameTemplate = new PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}/links/{link}'); + } + + return self::$linkNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getLogBucketNameTemplate() + { + if (self::$logBucketNameTemplate == null) { + self::$logBucketNameTemplate = new PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}'); + } + + return self::$logBucketNameTemplate; + } + + private static function getLogExclusionNameTemplate() + { + if (self::$logExclusionNameTemplate == null) { + self::$logExclusionNameTemplate = new PathTemplate('projects/{project}/exclusions/{exclusion}'); + } + + return self::$logExclusionNameTemplate; + } + + private static function getLogSinkNameTemplate() + { + if (self::$logSinkNameTemplate == null) { + self::$logSinkNameTemplate = new PathTemplate('projects/{project}/sinks/{sink}'); + } + + return self::$logSinkNameTemplate; + } + + private static function getLogViewNameTemplate() + { + if (self::$logViewNameTemplate == null) { + self::$logViewNameTemplate = new PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}/views/{view}'); + } + + return self::$logViewNameTemplate; + } + + private static function getOrganizationNameTemplate() + { + if (self::$organizationNameTemplate == null) { + self::$organizationNameTemplate = new PathTemplate('organizations/{organization}'); + } + + return self::$organizationNameTemplate; + } + + private static function getOrganizationCmekSettingsNameTemplate() + { + if (self::$organizationCmekSettingsNameTemplate == null) { + self::$organizationCmekSettingsNameTemplate = new PathTemplate('organizations/{organization}/cmekSettings'); + } + + return self::$organizationCmekSettingsNameTemplate; + } + + private static function getOrganizationExclusionNameTemplate() + { + if (self::$organizationExclusionNameTemplate == null) { + self::$organizationExclusionNameTemplate = new PathTemplate('organizations/{organization}/exclusions/{exclusion}'); + } + + return self::$organizationExclusionNameTemplate; + } + + private static function getOrganizationLocationNameTemplate() + { + if (self::$organizationLocationNameTemplate == null) { + self::$organizationLocationNameTemplate = new PathTemplate('organizations/{organization}/locations/{location}'); + } + + return self::$organizationLocationNameTemplate; + } + + private static function getOrganizationLocationBucketNameTemplate() + { + if (self::$organizationLocationBucketNameTemplate == null) { + self::$organizationLocationBucketNameTemplate = new PathTemplate('organizations/{organization}/locations/{location}/buckets/{bucket}'); + } + + return self::$organizationLocationBucketNameTemplate; + } + + private static function getOrganizationLocationBucketLinkNameTemplate() + { + if (self::$organizationLocationBucketLinkNameTemplate == null) { + self::$organizationLocationBucketLinkNameTemplate = new PathTemplate('organizations/{organization}/locations/{location}/buckets/{bucket}/links/{link}'); + } + + return self::$organizationLocationBucketLinkNameTemplate; + } + + private static function getOrganizationLocationBucketViewNameTemplate() + { + if (self::$organizationLocationBucketViewNameTemplate == null) { + self::$organizationLocationBucketViewNameTemplate = new PathTemplate('organizations/{organization}/locations/{location}/buckets/{bucket}/views/{view}'); + } + + return self::$organizationLocationBucketViewNameTemplate; + } + + private static function getOrganizationSettingsNameTemplate() + { + if (self::$organizationSettingsNameTemplate == null) { + self::$organizationSettingsNameTemplate = new PathTemplate('organizations/{organization}/settings'); + } + + return self::$organizationSettingsNameTemplate; + } + + private static function getOrganizationSinkNameTemplate() + { + if (self::$organizationSinkNameTemplate == null) { + self::$organizationSinkNameTemplate = new PathTemplate('organizations/{organization}/sinks/{sink}'); + } + + return self::$organizationSinkNameTemplate; + } + + private static function getProjectNameTemplate() + { + if (self::$projectNameTemplate == null) { + self::$projectNameTemplate = new PathTemplate('projects/{project}'); + } + + return self::$projectNameTemplate; + } + + private static function getProjectCmekSettingsNameTemplate() + { + if (self::$projectCmekSettingsNameTemplate == null) { + self::$projectCmekSettingsNameTemplate = new PathTemplate('projects/{project}/cmekSettings'); + } + + return self::$projectCmekSettingsNameTemplate; + } + + private static function getProjectExclusionNameTemplate() + { + if (self::$projectExclusionNameTemplate == null) { + self::$projectExclusionNameTemplate = new PathTemplate('projects/{project}/exclusions/{exclusion}'); + } + + return self::$projectExclusionNameTemplate; + } + + private static function getProjectLocationBucketNameTemplate() + { + if (self::$projectLocationBucketNameTemplate == null) { + self::$projectLocationBucketNameTemplate = new PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}'); + } + + return self::$projectLocationBucketNameTemplate; + } + + private static function getProjectLocationBucketLinkNameTemplate() + { + if (self::$projectLocationBucketLinkNameTemplate == null) { + self::$projectLocationBucketLinkNameTemplate = new PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}/links/{link}'); + } + + return self::$projectLocationBucketLinkNameTemplate; + } + + private static function getProjectLocationBucketViewNameTemplate() + { + if (self::$projectLocationBucketViewNameTemplate == null) { + self::$projectLocationBucketViewNameTemplate = new PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}/views/{view}'); + } + + return self::$projectLocationBucketViewNameTemplate; + } + + private static function getProjectSettingsNameTemplate() + { + if (self::$projectSettingsNameTemplate == null) { + self::$projectSettingsNameTemplate = new PathTemplate('projects/{project}/settings'); + } + + return self::$projectSettingsNameTemplate; + } + + private static function getProjectSinkNameTemplate() + { + if (self::$projectSinkNameTemplate == null) { + self::$projectSinkNameTemplate = new PathTemplate('projects/{project}/sinks/{sink}'); + } + + return self::$projectSinkNameTemplate; + } + + private static function getSettingsNameTemplate() + { + if (self::$settingsNameTemplate == null) { + self::$settingsNameTemplate = new PathTemplate('projects/{project}/settings'); + } + + return self::$settingsNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'billingAccount' => self::getBillingAccountNameTemplate(), + 'billingAccountCmekSettings' => self::getBillingAccountCmekSettingsNameTemplate(), + 'billingAccountExclusion' => self::getBillingAccountExclusionNameTemplate(), + 'billingAccountLocation' => self::getBillingAccountLocationNameTemplate(), + 'billingAccountLocationBucket' => self::getBillingAccountLocationBucketNameTemplate(), + 'billingAccountLocationBucketLink' => self::getBillingAccountLocationBucketLinkNameTemplate(), + 'billingAccountLocationBucketView' => self::getBillingAccountLocationBucketViewNameTemplate(), + 'billingAccountSettings' => self::getBillingAccountSettingsNameTemplate(), + 'billingAccountSink' => self::getBillingAccountSinkNameTemplate(), + 'cmekSettings' => self::getCmekSettingsNameTemplate(), + 'folder' => self::getFolderNameTemplate(), + 'folderCmekSettings' => self::getFolderCmekSettingsNameTemplate(), + 'folderExclusion' => self::getFolderExclusionNameTemplate(), + 'folderLocation' => self::getFolderLocationNameTemplate(), + 'folderLocationBucket' => self::getFolderLocationBucketNameTemplate(), + 'folderLocationBucketLink' => self::getFolderLocationBucketLinkNameTemplate(), + 'folderLocationBucketView' => self::getFolderLocationBucketViewNameTemplate(), + 'folderSettings' => self::getFolderSettingsNameTemplate(), + 'folderSink' => self::getFolderSinkNameTemplate(), + 'link' => self::getLinkNameTemplate(), + 'location' => self::getLocationNameTemplate(), + 'logBucket' => self::getLogBucketNameTemplate(), + 'logExclusion' => self::getLogExclusionNameTemplate(), + 'logSink' => self::getLogSinkNameTemplate(), + 'logView' => self::getLogViewNameTemplate(), + 'organization' => self::getOrganizationNameTemplate(), + 'organizationCmekSettings' => self::getOrganizationCmekSettingsNameTemplate(), + 'organizationExclusion' => self::getOrganizationExclusionNameTemplate(), + 'organizationLocation' => self::getOrganizationLocationNameTemplate(), + 'organizationLocationBucket' => self::getOrganizationLocationBucketNameTemplate(), + 'organizationLocationBucketLink' => self::getOrganizationLocationBucketLinkNameTemplate(), + 'organizationLocationBucketView' => self::getOrganizationLocationBucketViewNameTemplate(), + 'organizationSettings' => self::getOrganizationSettingsNameTemplate(), + 'organizationSink' => self::getOrganizationSinkNameTemplate(), + 'project' => self::getProjectNameTemplate(), + 'projectCmekSettings' => self::getProjectCmekSettingsNameTemplate(), + 'projectExclusion' => self::getProjectExclusionNameTemplate(), + 'projectLocationBucket' => self::getProjectLocationBucketNameTemplate(), + 'projectLocationBucketLink' => self::getProjectLocationBucketLinkNameTemplate(), + 'projectLocationBucketView' => self::getProjectLocationBucketViewNameTemplate(), + 'projectSettings' => self::getProjectSettingsNameTemplate(), + 'projectSink' => self::getProjectSinkNameTemplate(), + 'settings' => self::getSettingsNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * billing_account resource. + * + * @param string $billingAccount + * + * @return string The formatted billing_account resource. + */ + public static function billingAccountName($billingAccount) + { + return self::getBillingAccountNameTemplate()->render([ + 'billing_account' => $billingAccount, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * billing_account_cmekSettings resource. + * + * @param string $billingAccount + * + * @return string The formatted billing_account_cmekSettings resource. + */ + public static function billingAccountCmekSettingsName($billingAccount) + { + return self::getBillingAccountCmekSettingsNameTemplate()->render([ + 'billing_account' => $billingAccount, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * billing_account_exclusion resource. + * + * @param string $billingAccount + * @param string $exclusion + * + * @return string The formatted billing_account_exclusion resource. + */ + public static function billingAccountExclusionName($billingAccount, $exclusion) + { + return self::getBillingAccountExclusionNameTemplate()->render([ + 'billing_account' => $billingAccount, + 'exclusion' => $exclusion, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * billing_account_location resource. + * + * @param string $billingAccount + * @param string $location + * + * @return string The formatted billing_account_location resource. + */ + public static function billingAccountLocationName($billingAccount, $location) + { + return self::getBillingAccountLocationNameTemplate()->render([ + 'billing_account' => $billingAccount, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * billing_account_location_bucket resource. + * + * @param string $billingAccount + * @param string $location + * @param string $bucket + * + * @return string The formatted billing_account_location_bucket resource. + */ + public static function billingAccountLocationBucketName($billingAccount, $location, $bucket) + { + return self::getBillingAccountLocationBucketNameTemplate()->render([ + 'billing_account' => $billingAccount, + 'location' => $location, + 'bucket' => $bucket, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * billing_account_location_bucket_link resource. + * + * @param string $billingAccount + * @param string $location + * @param string $bucket + * @param string $link + * + * @return string The formatted billing_account_location_bucket_link resource. + */ + public static function billingAccountLocationBucketLinkName($billingAccount, $location, $bucket, $link) + { + return self::getBillingAccountLocationBucketLinkNameTemplate()->render([ + 'billing_account' => $billingAccount, + 'location' => $location, + 'bucket' => $bucket, + 'link' => $link, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * billing_account_location_bucket_view resource. + * + * @param string $billingAccount + * @param string $location + * @param string $bucket + * @param string $view + * + * @return string The formatted billing_account_location_bucket_view resource. + */ + public static function billingAccountLocationBucketViewName($billingAccount, $location, $bucket, $view) + { + return self::getBillingAccountLocationBucketViewNameTemplate()->render([ + 'billing_account' => $billingAccount, + 'location' => $location, + 'bucket' => $bucket, + 'view' => $view, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * billing_account_settings resource. + * + * @param string $billingAccount + * + * @return string The formatted billing_account_settings resource. + */ + public static function billingAccountSettingsName($billingAccount) + { + return self::getBillingAccountSettingsNameTemplate()->render([ + 'billing_account' => $billingAccount, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * billing_account_sink resource. + * + * @param string $billingAccount + * @param string $sink + * + * @return string The formatted billing_account_sink resource. + */ + public static function billingAccountSinkName($billingAccount, $sink) + { + return self::getBillingAccountSinkNameTemplate()->render([ + 'billing_account' => $billingAccount, + 'sink' => $sink, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * cmek_settings resource. + * + * @param string $project + * + * @return string The formatted cmek_settings resource. + */ + public static function cmekSettingsName($project) + { + return self::getCmekSettingsNameTemplate()->render([ + 'project' => $project, + ]); + } + + /** + * 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($folder) + { + return self::getFolderNameTemplate()->render([ + 'folder' => $folder, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_cmekSettings resource. + * + * @param string $folder + * + * @return string The formatted folder_cmekSettings resource. + */ + public static function folderCmekSettingsName($folder) + { + return self::getFolderCmekSettingsNameTemplate()->render([ + 'folder' => $folder, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_exclusion resource. + * + * @param string $folder + * @param string $exclusion + * + * @return string The formatted folder_exclusion resource. + */ + public static function folderExclusionName($folder, $exclusion) + { + return self::getFolderExclusionNameTemplate()->render([ + 'folder' => $folder, + 'exclusion' => $exclusion, + ]); + } + + /** + * 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($folder, $location) + { + return self::getFolderLocationNameTemplate()->render([ + 'folder' => $folder, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_location_bucket resource. + * + * @param string $folder + * @param string $location + * @param string $bucket + * + * @return string The formatted folder_location_bucket resource. + */ + public static function folderLocationBucketName($folder, $location, $bucket) + { + return self::getFolderLocationBucketNameTemplate()->render([ + 'folder' => $folder, + 'location' => $location, + 'bucket' => $bucket, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_location_bucket_link resource. + * + * @param string $folder + * @param string $location + * @param string $bucket + * @param string $link + * + * @return string The formatted folder_location_bucket_link resource. + */ + public static function folderLocationBucketLinkName($folder, $location, $bucket, $link) + { + return self::getFolderLocationBucketLinkNameTemplate()->render([ + 'folder' => $folder, + 'location' => $location, + 'bucket' => $bucket, + 'link' => $link, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_location_bucket_view resource. + * + * @param string $folder + * @param string $location + * @param string $bucket + * @param string $view + * + * @return string The formatted folder_location_bucket_view resource. + */ + public static function folderLocationBucketViewName($folder, $location, $bucket, $view) + { + return self::getFolderLocationBucketViewNameTemplate()->render([ + 'folder' => $folder, + 'location' => $location, + 'bucket' => $bucket, + 'view' => $view, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_settings resource. + * + * @param string $folder + * + * @return string The formatted folder_settings resource. + */ + public static function folderSettingsName($folder) + { + return self::getFolderSettingsNameTemplate()->render([ + 'folder' => $folder, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a folder_sink + * resource. + * + * @param string $folder + * @param string $sink + * + * @return string The formatted folder_sink resource. + */ + public static function folderSinkName($folder, $sink) + { + return self::getFolderSinkNameTemplate()->render([ + 'folder' => $folder, + 'sink' => $sink, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a link + * resource. + * + * @param string $project + * @param string $location + * @param string $bucket + * @param string $link + * + * @return string The formatted link resource. + */ + public static function linkName($project, $location, $bucket, $link) + { + return self::getLinkNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'bucket' => $bucket, + 'link' => $link, + ]); + } + + /** + * 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($project, $location) + { + return self::getLocationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a log_bucket + * resource. + * + * @param string $project + * @param string $location + * @param string $bucket + * + * @return string The formatted log_bucket resource. + */ + public static function logBucketName($project, $location, $bucket) + { + return self::getLogBucketNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'bucket' => $bucket, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * log_exclusion resource. + * + * @param string $project + * @param string $exclusion + * + * @return string The formatted log_exclusion resource. + */ + public static function logExclusionName($project, $exclusion) + { + return self::getLogExclusionNameTemplate()->render([ + 'project' => $project, + 'exclusion' => $exclusion, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a log_sink + * resource. + * + * @param string $project + * @param string $sink + * + * @return string The formatted log_sink resource. + */ + public static function logSinkName($project, $sink) + { + return self::getLogSinkNameTemplate()->render([ + 'project' => $project, + 'sink' => $sink, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a log_view + * resource. + * + * @param string $project + * @param string $location + * @param string $bucket + * @param string $view + * + * @return string The formatted log_view resource. + */ + public static function logViewName($project, $location, $bucket, $view) + { + return self::getLogViewNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'bucket' => $bucket, + 'view' => $view, + ]); + } + + /** + * 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($organization) + { + return self::getOrganizationNameTemplate()->render([ + 'organization' => $organization, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_cmekSettings resource. + * + * @param string $organization + * + * @return string The formatted organization_cmekSettings resource. + */ + public static function organizationCmekSettingsName($organization) + { + return self::getOrganizationCmekSettingsNameTemplate()->render([ + 'organization' => $organization, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_exclusion resource. + * + * @param string $organization + * @param string $exclusion + * + * @return string The formatted organization_exclusion resource. + */ + public static function organizationExclusionName($organization, $exclusion) + { + return self::getOrganizationExclusionNameTemplate()->render([ + 'organization' => $organization, + 'exclusion' => $exclusion, + ]); + } + + /** + * 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($organization, $location) + { + return self::getOrganizationLocationNameTemplate()->render([ + 'organization' => $organization, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location_bucket resource. + * + * @param string $organization + * @param string $location + * @param string $bucket + * + * @return string The formatted organization_location_bucket resource. + */ + public static function organizationLocationBucketName($organization, $location, $bucket) + { + return self::getOrganizationLocationBucketNameTemplate()->render([ + 'organization' => $organization, + 'location' => $location, + 'bucket' => $bucket, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location_bucket_link resource. + * + * @param string $organization + * @param string $location + * @param string $bucket + * @param string $link + * + * @return string The formatted organization_location_bucket_link resource. + */ + public static function organizationLocationBucketLinkName($organization, $location, $bucket, $link) + { + return self::getOrganizationLocationBucketLinkNameTemplate()->render([ + 'organization' => $organization, + 'location' => $location, + 'bucket' => $bucket, + 'link' => $link, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location_bucket_view resource. + * + * @param string $organization + * @param string $location + * @param string $bucket + * @param string $view + * + * @return string The formatted organization_location_bucket_view resource. + */ + public static function organizationLocationBucketViewName($organization, $location, $bucket, $view) + { + return self::getOrganizationLocationBucketViewNameTemplate()->render([ + 'organization' => $organization, + 'location' => $location, + 'bucket' => $bucket, + 'view' => $view, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_settings resource. + * + * @param string $organization + * + * @return string The formatted organization_settings resource. + */ + public static function organizationSettingsName($organization) + { + return self::getOrganizationSettingsNameTemplate()->render([ + 'organization' => $organization, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_sink resource. + * + * @param string $organization + * @param string $sink + * + * @return string The formatted organization_sink resource. + */ + public static function organizationSinkName($organization, $sink) + { + return self::getOrganizationSinkNameTemplate()->render([ + 'organization' => $organization, + 'sink' => $sink, + ]); + } + + /** + * 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 + * project_cmekSettings resource. + * + * @param string $project + * + * @return string The formatted project_cmekSettings resource. + */ + public static function projectCmekSettingsName($project) + { + return self::getProjectCmekSettingsNameTemplate()->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_exclusion resource. + * + * @param string $project + * @param string $exclusion + * + * @return string The formatted project_exclusion resource. + */ + public static function projectExclusionName($project, $exclusion) + { + return self::getProjectExclusionNameTemplate()->render([ + 'project' => $project, + 'exclusion' => $exclusion, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_bucket resource. + * + * @param string $project + * @param string $location + * @param string $bucket + * + * @return string The formatted project_location_bucket resource. + */ + public static function projectLocationBucketName($project, $location, $bucket) + { + return self::getProjectLocationBucketNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'bucket' => $bucket, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_bucket_link resource. + * + * @param string $project + * @param string $location + * @param string $bucket + * @param string $link + * + * @return string The formatted project_location_bucket_link resource. + */ + public static function projectLocationBucketLinkName($project, $location, $bucket, $link) + { + return self::getProjectLocationBucketLinkNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'bucket' => $bucket, + 'link' => $link, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_bucket_view resource. + * + * @param string $project + * @param string $location + * @param string $bucket + * @param string $view + * + * @return string The formatted project_location_bucket_view resource. + */ + public static function projectLocationBucketViewName($project, $location, $bucket, $view) + { + return self::getProjectLocationBucketViewNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'bucket' => $bucket, + 'view' => $view, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_settings resource. + * + * @param string $project + * + * @return string The formatted project_settings resource. + */ + public static function projectSettingsName($project) + { + return self::getProjectSettingsNameTemplate()->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project_sink + * resource. + * + * @param string $project + * @param string $sink + * + * @return string The formatted project_sink resource. + */ + public static function projectSinkName($project, $sink) + { + return self::getProjectSinkNameTemplate()->render([ + 'project' => $project, + 'sink' => $sink, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a settings + * resource. + * + * @param string $project + * + * @return string The formatted settings resource. + */ + public static function settingsName($project) + { + return self::getSettingsNameTemplate()->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 + * - billingAccount: billingAccounts/{billing_account} + * - billingAccountCmekSettings: billingAccounts/{billing_account}/cmekSettings + * - billingAccountExclusion: billingAccounts/{billing_account}/exclusions/{exclusion} + * - billingAccountLocation: billingAccounts/{billing_account}/locations/{location} + * - billingAccountLocationBucket: billingAccounts/{billing_account}/locations/{location}/buckets/{bucket} + * - billingAccountLocationBucketLink: billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/links/{link} + * - billingAccountLocationBucketView: billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/views/{view} + * - billingAccountSettings: billingAccounts/{billing_account}/settings + * - billingAccountSink: billingAccounts/{billing_account}/sinks/{sink} + * - cmekSettings: projects/{project}/cmekSettings + * - folder: folders/{folder} + * - folderCmekSettings: folders/{folder}/cmekSettings + * - folderExclusion: folders/{folder}/exclusions/{exclusion} + * - folderLocation: folders/{folder}/locations/{location} + * - folderLocationBucket: folders/{folder}/locations/{location}/buckets/{bucket} + * - folderLocationBucketLink: folders/{folder}/locations/{location}/buckets/{bucket}/links/{link} + * - folderLocationBucketView: folders/{folder}/locations/{location}/buckets/{bucket}/views/{view} + * - folderSettings: folders/{folder}/settings + * - folderSink: folders/{folder}/sinks/{sink} + * - link: projects/{project}/locations/{location}/buckets/{bucket}/links/{link} + * - location: projects/{project}/locations/{location} + * - logBucket: projects/{project}/locations/{location}/buckets/{bucket} + * - logExclusion: projects/{project}/exclusions/{exclusion} + * - logSink: projects/{project}/sinks/{sink} + * - logView: projects/{project}/locations/{location}/buckets/{bucket}/views/{view} + * - organization: organizations/{organization} + * - organizationCmekSettings: organizations/{organization}/cmekSettings + * - organizationExclusion: organizations/{organization}/exclusions/{exclusion} + * - organizationLocation: organizations/{organization}/locations/{location} + * - organizationLocationBucket: organizations/{organization}/locations/{location}/buckets/{bucket} + * - organizationLocationBucketLink: organizations/{organization}/locations/{location}/buckets/{bucket}/links/{link} + * - organizationLocationBucketView: organizations/{organization}/locations/{location}/buckets/{bucket}/views/{view} + * - organizationSettings: organizations/{organization}/settings + * - organizationSink: organizations/{organization}/sinks/{sink} + * - project: projects/{project} + * - projectCmekSettings: projects/{project}/cmekSettings + * - projectExclusion: projects/{project}/exclusions/{exclusion} + * - projectLocationBucket: projects/{project}/locations/{location}/buckets/{bucket} + * - projectLocationBucketLink: projects/{project}/locations/{location}/buckets/{bucket}/links/{link} + * - projectLocationBucketView: projects/{project}/locations/{location}/buckets/{bucket}/views/{view} + * - projectSettings: projects/{project}/settings + * - projectSink: projects/{project}/sinks/{sink} + * - settings: projects/{project}/settings + * + * 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"); + } + + /** + * 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; + } + + /** + * 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 'logging.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); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Copies a set of log entries from a log bucket to a Cloud Storage bucket. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $name = 'name'; + * $destination = 'destination'; + * $operationResponse = $configServiceV2Client->copyLogEntries($name, $destination); + * $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 = $configServiceV2Client->copyLogEntries($name, $destination); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $configServiceV2Client->resumeOperation($operationName, 'copyLogEntries'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $name Required. Log bucket from which to copy log entries. + * + * For example: + * + * `"projects/my-project/locations/global/buckets/my-source-bucket"` + * @param string $destination Required. Destination to which to copy log entries. + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * Optional. A filter specifying which log entries to copy. The filter must be + * no more than 20k characters. An empty filter matches all log entries. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. 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 + */ + public function copyLogEntries($name, $destination, array $optionalArgs = []) + { + $request = new CopyLogEntriesRequest(); + $request->setName($name); + $request->setDestination($destination); + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + return $this->startOperationsCall('CopyLogEntries', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a log bucket that can be used to store log entries. After a bucket + * has been created, the bucket's location cannot be changed. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedParent = $configServiceV2Client->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + * $bucketId = 'bucket_id'; + * $bucket = new LogBucket(); + * $response = $configServiceV2Client->createBucket($formattedParent, $bucketId, $bucket); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $parent Required. The resource in which to create the log bucket: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * + * For example: + * + * `"projects/my-project/locations/global"` + * @param string $bucketId Required. A client-assigned identifier such as `"my-bucket"`. Identifiers + * are limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. + * @param LogBucket $bucket Required. The new bucket. The region specified in the new bucket must be + * compliant with any Location Restriction Org Policy. The name field in the + * bucket is ignored. + * @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\Logging\V2\LogBucket + * + * @throws ApiException if the remote call fails + */ + public function createBucket($parent, $bucketId, $bucket, array $optionalArgs = []) + { + $request = new CreateBucketRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setBucketId($bucketId); + $request->setBucket($bucket); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateBucket', LogBucket::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a log bucket asynchronously that can be used to store log entries. + * + * After a bucket has been created, the bucket's location cannot be changed. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedParent = $configServiceV2Client->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + * $bucketId = 'bucket_id'; + * $bucket = new LogBucket(); + * $operationResponse = $configServiceV2Client->createBucketAsync($formattedParent, $bucketId, $bucket); + * $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 = $configServiceV2Client->createBucketAsync($formattedParent, $bucketId, $bucket); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $configServiceV2Client->resumeOperation($operationName, 'createBucketAsync'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $parent Required. The resource in which to create the log bucket: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * + * For example: + * + * `"projects/my-project/locations/global"` + * @param string $bucketId Required. A client-assigned identifier such as `"my-bucket"`. Identifiers + * are limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. + * @param LogBucket $bucket Required. The new bucket. The region specified in the new bucket must be + * compliant with any Location Restriction Org Policy. The name field in the + * bucket is ignored. + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createBucketAsync($parent, $bucketId, $bucket, array $optionalArgs = []) + { + $request = new CreateBucketRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setBucketId($bucketId); + $request->setBucket($bucket); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateBucketAsync', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new exclusion in the _Default sink in a specified parent + * resource. Only log entries belonging to that resource can be excluded. You + * can have up to 10 exclusions in a resource. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedParent = $configServiceV2Client->projectName('[PROJECT]'); + * $exclusion = new LogExclusion(); + * $response = $configServiceV2Client->createExclusion($formattedParent, $exclusion); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource in which to create the exclusion: + * + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + * + * For examples: + * + * `"projects/my-logging-project"` + * `"organizations/123456789"` + * @param LogExclusion $exclusion Required. The new exclusion, whose `name` parameter is an exclusion name + * that is not already used in the parent resource. + * @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\Logging\V2\LogExclusion + * + * @throws ApiException if the remote call fails + */ + public function createExclusion($parent, $exclusion, array $optionalArgs = []) + { + $request = new CreateExclusionRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setExclusion($exclusion); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateExclusion', LogExclusion::class, $optionalArgs, $request)->wait(); + } + + /** + * Asynchronously creates a linked dataset in BigQuery which makes it possible + * to use BigQuery to read the logs stored in the log bucket. A log bucket may + * currently only contain one link. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedParent = $configServiceV2Client->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + * $link = new Link(); + * $linkId = 'link_id'; + * $operationResponse = $configServiceV2Client->createLink($formattedParent, $link, $linkId); + * $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 = $configServiceV2Client->createLink($formattedParent, $link, $linkId); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $configServiceV2Client->resumeOperation($operationName, 'createLink'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $parent Required. The full resource name of the bucket to create a link for. + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * @param Link $link Required. The new link. + * @param string $linkId Required. The ID to use for the link. The link_id can have up to 100 + * characters. A valid link_id must only have alphanumeric characters and + * underscores within it. + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createLink($parent, $link, $linkId, array $optionalArgs = []) + { + $request = new CreateLinkRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setLink($link); + $request->setLinkId($linkId); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateLink', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a sink that exports specified log entries to a destination. The + * export of newly-ingested log entries begins immediately, unless the sink's + * `writer_identity` is not permitted to write to the destination. A sink can + * export log entries only from the resource owning the sink. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedParent = $configServiceV2Client->projectName('[PROJECT]'); + * $sink = new LogSink(); + * $response = $configServiceV2Client->createSink($formattedParent, $sink); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $parent Required. The resource in which to create the sink: + * + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + * + * For examples: + * + * `"projects/my-project"` + * `"organizations/123456789"` + * @param LogSink $sink Required. The new sink, whose `name` parameter is a sink identifier that + * is not already in use. + * @param array $optionalArgs { + * Optional. + * + * @type bool $uniqueWriterIdentity + * Optional. Determines the kind of IAM identity returned as `writer_identity` + * in the new sink. If this value is omitted or set to false, and if the + * sink's parent is a project, then the value returned as `writer_identity` is + * the same group or service account used by Cloud Logging before the addition + * of writer identities to this API. The sink's destination must be in the + * same project as the sink itself. + * + * If this field is set to true, or if the sink is owned by a non-project + * resource such as an organization, then the value of `writer_identity` will + * be a unique service account used only for exports from the new sink. For + * more information, see `writer_identity` in + * [LogSink][google.logging.v2.LogSink]. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. 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\Logging\V2\LogSink + * + * @throws ApiException if the remote call fails + */ + public function createSink($parent, $sink, array $optionalArgs = []) + { + $request = new CreateSinkRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setSink($sink); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['uniqueWriterIdentity'])) { + $request->setUniqueWriterIdentity($optionalArgs['uniqueWriterIdentity']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateSink', LogSink::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a view over log entries in a log bucket. A bucket may contain a + * maximum of 30 views. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $parent = 'parent'; + * $viewId = 'view_id'; + * $view = new LogView(); + * $response = $configServiceV2Client->createView($parent, $viewId, $view); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $parent Required. The bucket in which to create the view + * + * `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` + * + * For example: + * + * `"projects/my-project/locations/global/buckets/my-bucket"` + * @param string $viewId Required. A client-assigned identifier such as `"my-view"`. Identifiers are + * limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. + * @param LogView $view Required. The new view. + * @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\Logging\V2\LogView + * + * @throws ApiException if the remote call fails + */ + public function createView($parent, $viewId, $view, array $optionalArgs = []) + { + $request = new CreateViewRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setViewId($viewId); + $request->setView($view); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateView', LogView::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a log bucket. + * + * Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state. + * After 7 days, the bucket will be purged and all log entries in the bucket + * will be permanently deleted. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedName = $configServiceV2Client->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + * $configServiceV2Client->deleteBucket($formattedName); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $name Required. The full resource name of the bucket to delete. + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * + * For example: + * + * `"projects/my-project/locations/global/buckets/my-bucket"` + * @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 deleteBucket($name, array $optionalArgs = []) + { + $request = new DeleteBucketRequest(); + $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('DeleteBucket', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes an exclusion in the _Default sink. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedName = $configServiceV2Client->logExclusionName('[PROJECT]', '[EXCLUSION]'); + * $configServiceV2Client->deleteExclusion($formattedName); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $name Required. The resource name of an existing exclusion to delete: + * + * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * + * For example: + * + * `"projects/my-project/exclusions/my-exclusion"` + * @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 deleteExclusion($name, array $optionalArgs = []) + { + $request = new DeleteExclusionRequest(); + $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('DeleteExclusion', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a link. This will also delete the corresponding BigQuery linked + * dataset. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedName = $configServiceV2Client->linkName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[LINK]'); + * $operationResponse = $configServiceV2Client->deleteLink($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $configServiceV2Client->deleteLink($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $configServiceV2Client->resumeOperation($operationName, 'deleteLink'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $name Required. The full resource name of the link to delete. + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteLink($name, array $optionalArgs = []) + { + $request = new DeleteLinkRequest(); + $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->startOperationsCall('DeleteLink', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a sink. If the sink has a unique `writer_identity`, then that + * service account is also deleted. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedSinkName = $configServiceV2Client->logSinkName('[PROJECT]', '[SINK]'); + * $configServiceV2Client->deleteSink($formattedSinkName); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $sinkName Required. The full resource name of the sink to delete, including the + * parent resource and the sink identifier: + * + * "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * + * For example: + * + * `"projects/my-project/sinks/my-sink"` + * @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 deleteSink($sinkName, array $optionalArgs = []) + { + $request = new DeleteSinkRequest(); + $requestParamHeaders = []; + $request->setSinkName($sinkName); + $requestParamHeaders['sink_name'] = $sinkName; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteSink', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a view on a log bucket. + * If an `UNAVAILABLE` error is returned, this indicates that system is not in + * a state where it can delete the view. If this occurs, please try again in a + * few minutes. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedName = $configServiceV2Client->logViewName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[VIEW]'); + * $configServiceV2Client->deleteView($formattedName); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $name Required. The full resource name of the view to delete: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + * + * For example: + * + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` + * @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 deleteView($name, array $optionalArgs = []) + { + $request = new DeleteViewRequest(); + $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('DeleteView', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a log bucket. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedName = $configServiceV2Client->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + * $response = $configServiceV2Client->getBucket($formattedName); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the bucket: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * + * For example: + * + * `"projects/my-project/locations/global/buckets/my-bucket"` + * @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\Logging\V2\LogBucket + * + * @throws ApiException if the remote call fails + */ + public function getBucket($name, array $optionalArgs = []) + { + $request = new GetBucketRequest(); + $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('GetBucket', LogBucket::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the Logging CMEK settings for the given resource. + * + * Note: CMEK for the Log Router can be configured for Google Cloud projects, + * folders, organizations and billing accounts. Once configured for an + * organization, it applies to all projects and folders in the Google Cloud + * organization. + * + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $response = $configServiceV2Client->getCmekSettings(); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Required. The resource for which to retrieve CMEK settings. + * + * "projects/[PROJECT_ID]/cmekSettings" + * "organizations/[ORGANIZATION_ID]/cmekSettings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + * "folders/[FOLDER_ID]/cmekSettings" + * + * For example: + * + * `"organizations/12345/cmekSettings"` + * + * Note: CMEK for the Log Router can be configured for Google Cloud projects, + * folders, organizations and billing accounts. Once configured for an + * organization, it applies to all projects and folders in the Google Cloud + * organization. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. 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\Logging\V2\CmekSettings + * + * @throws ApiException if the remote call fails + */ + public function getCmekSettings(array $optionalArgs = []) + { + $request = new GetCmekSettingsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetCmekSettings', CmekSettings::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the description of an exclusion in the _Default sink. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedName = $configServiceV2Client->logExclusionName('[PROJECT]', '[EXCLUSION]'); + * $response = $configServiceV2Client->getExclusion($formattedName); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $name Required. The resource name of an existing exclusion: + * + * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * + * For example: + * + * `"projects/my-project/exclusions/my-exclusion"` + * @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\Logging\V2\LogExclusion + * + * @throws ApiException if the remote call fails + */ + public function getExclusion($name, array $optionalArgs = []) + { + $request = new GetExclusionRequest(); + $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('GetExclusion', LogExclusion::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a link. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedName = $configServiceV2Client->linkName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[LINK]'); + * $response = $configServiceV2Client->getLink($formattedName); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the link: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_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\Logging\V2\Link + * + * @throws ApiException if the remote call fails + */ + public function getLink($name, array $optionalArgs = []) + { + $request = new GetLinkRequest(); + $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('GetLink', Link::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the Log Router settings for the given resource. + * + * Note: Settings for the Log Router can be get for Google Cloud projects, + * folders, organizations and billing accounts. Currently it can only be + * configured for organizations. Once configured for an organization, it + * applies to all projects and folders in the Google Cloud organization. + * + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedName = $configServiceV2Client->settingsName('[PROJECT]'); + * $response = $configServiceV2Client->getSettings($formattedName); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $name Required. The resource for which to retrieve settings. + * + * "projects/[PROJECT_ID]/settings" + * "organizations/[ORGANIZATION_ID]/settings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/settings" + * "folders/[FOLDER_ID]/settings" + * + * For example: + * + * `"organizations/12345/settings"` + * + * Note: Settings for the Log Router can be get for Google Cloud projects, + * folders, organizations and billing accounts. Currently it can only be + * configured for organizations. Once configured for an organization, it + * applies to all projects and folders in the Google Cloud organization. + * @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\Logging\V2\Settings + * + * @throws ApiException if the remote call fails + */ + public function getSettings($name, array $optionalArgs = []) + { + $request = new GetSettingsRequest(); + $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('GetSettings', Settings::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a sink. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedSinkName = $configServiceV2Client->logSinkName('[PROJECT]', '[SINK]'); + * $response = $configServiceV2Client->getSink($formattedSinkName); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $sinkName Required. The resource name of the sink: + * + * "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * + * For example: + * + * `"projects/my-project/sinks/my-sink"` + * @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\Logging\V2\LogSink + * + * @throws ApiException if the remote call fails + */ + public function getSink($sinkName, array $optionalArgs = []) + { + $request = new GetSinkRequest(); + $requestParamHeaders = []; + $request->setSinkName($sinkName); + $requestParamHeaders['sink_name'] = $sinkName; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetSink', LogSink::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a view on a log bucket.. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedName = $configServiceV2Client->logViewName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[VIEW]'); + * $response = $configServiceV2Client->getView($formattedName); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the policy: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + * + * For example: + * + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` + * @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\Logging\V2\LogView + * + * @throws ApiException if the remote call fails + */ + public function getView($name, array $optionalArgs = []) + { + $request = new GetViewRequest(); + $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('GetView', LogView::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists log buckets. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedParent = $configServiceV2Client->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $configServiceV2Client->listBuckets($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $configServiceV2Client->listBuckets($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource whose buckets are to be listed: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + * + * Note: The locations portion of the resource must be specified, but + * supplying the character `-` in place of [LOCATION_ID] will return all + * buckets. + * @param array $optionalArgs { + * Optional. + * + * @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 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 RetrySettings|array $retrySettings + * Retry settings to use for this call. 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 listBuckets($parent, array $optionalArgs = []) + { + $request = new ListBucketsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListBuckets', $optionalArgs, ListBucketsResponse::class, $request); + } + + /** + * Lists all the exclusions on the _Default sink in a parent resource. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedParent = $configServiceV2Client->projectName('[PROJECT]'); + * // Iterate over pages of elements + * $pagedResponse = $configServiceV2Client->listExclusions($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $configServiceV2Client->listExclusions($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource whose exclusions are to be listed. + * + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + * @param array $optionalArgs { + * Optional. + * + * @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 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 RetrySettings|array $retrySettings + * Retry settings to use for this call. 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 listExclusions($parent, array $optionalArgs = []) + { + $request = new ListExclusionsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListExclusions', $optionalArgs, ListExclusionsResponse::class, $request); + } + + /** + * Lists links. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedParent = $configServiceV2Client->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + * // Iterate over pages of elements + * $pagedResponse = $configServiceV2Client->listLinks($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $configServiceV2Client->listLinks($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource whose links are to be listed: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/ + * @param array $optionalArgs { + * Optional. + * + * @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 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 RetrySettings|array $retrySettings + * Retry settings to use for this call. 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 listLinks($parent, array $optionalArgs = []) + { + $request = new ListLinksRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLinks', $optionalArgs, ListLinksResponse::class, $request); + } + + /** + * Lists sinks. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedParent = $configServiceV2Client->projectName('[PROJECT]'); + * // Iterate over pages of elements + * $pagedResponse = $configServiceV2Client->listSinks($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $configServiceV2Client->listSinks($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource whose sinks are to be listed: + * + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + * @param array $optionalArgs { + * Optional. + * + * @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 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 RetrySettings|array $retrySettings + * Retry settings to use for this call. 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 listSinks($parent, array $optionalArgs = []) + { + $request = new ListSinksRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListSinks', $optionalArgs, ListSinksResponse::class, $request); + } + + /** + * Lists views on a log bucket. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $parent = 'parent'; + * // Iterate over pages of elements + * $pagedResponse = $configServiceV2Client->listViews($parent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $configServiceV2Client->listViews($parent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $parent Required. The bucket whose views are to be listed: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * @param array $optionalArgs { + * Optional. + * + * @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 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 RetrySettings|array $retrySettings + * Retry settings to use for this call. 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 listViews($parent, array $optionalArgs = []) + { + $request = new ListViewsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListViews', $optionalArgs, ListViewsResponse::class, $request); + } + + /** + * Undeletes a log bucket. A bucket that has been deleted can be undeleted + * within the grace period of 7 days. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedName = $configServiceV2Client->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + * $configServiceV2Client->undeleteBucket($formattedName); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $name Required. The full resource name of the bucket to undelete. + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * + * For example: + * + * `"projects/my-project/locations/global/buckets/my-bucket"` + * @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 undeleteBucket($name, array $optionalArgs = []) + { + $request = new UndeleteBucketRequest(); + $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('UndeleteBucket', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates a log bucket. + * + * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then + * `FAILED_PRECONDITION` will be returned. + * + * After a bucket has been created, the bucket's location cannot be changed. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedName = $configServiceV2Client->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + * $bucket = new LogBucket(); + * $updateMask = new FieldMask(); + * $response = $configServiceV2Client->updateBucket($formattedName, $bucket, $updateMask); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $name Required. The full resource name of the bucket to update. + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * + * For example: + * + * `"projects/my-project/locations/global/buckets/my-bucket"` + * @param LogBucket $bucket Required. The updated bucket. + * @param FieldMask $updateMask Required. Field mask that specifies the fields in `bucket` that need an + * update. A bucket field will be overwritten if, and only if, it is in the + * update mask. `name` and output only fields cannot be updated. + * + * For a detailed `FieldMask` definition, see: + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + * + * For example: `updateMask=retention_days` + * @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\Logging\V2\LogBucket + * + * @throws ApiException if the remote call fails + */ + public function updateBucket($name, $bucket, $updateMask, array $optionalArgs = []) + { + $request = new UpdateBucketRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setBucket($bucket); + $request->setUpdateMask($updateMask); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateBucket', LogBucket::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates a log bucket asynchronously. + * + * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then + * `FAILED_PRECONDITION` will be returned. + * + * After a bucket has been created, the bucket's location cannot be changed. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedName = $configServiceV2Client->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + * $bucket = new LogBucket(); + * $updateMask = new FieldMask(); + * $operationResponse = $configServiceV2Client->updateBucketAsync($formattedName, $bucket, $updateMask); + * $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 = $configServiceV2Client->updateBucketAsync($formattedName, $bucket, $updateMask); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $configServiceV2Client->resumeOperation($operationName, 'updateBucketAsync'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $name Required. The full resource name of the bucket to update. + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * + * For example: + * + * `"projects/my-project/locations/global/buckets/my-bucket"` + * @param LogBucket $bucket Required. The updated bucket. + * @param FieldMask $updateMask Required. Field mask that specifies the fields in `bucket` that need an + * update. A bucket field will be overwritten if, and only if, it is in the + * update mask. `name` and output only fields cannot be updated. + * + * For a detailed `FieldMask` definition, see: + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + * + * For example: `updateMask=retention_days` + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateBucketAsync($name, $bucket, $updateMask, array $optionalArgs = []) + { + $request = new UpdateBucketRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setBucket($bucket); + $request->setUpdateMask($updateMask); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateBucketAsync', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the Log Router CMEK settings for the given resource. + * + * Note: CMEK for the Log Router can currently only be configured for Google + * Cloud organizations. Once configured, it applies to all projects and + * folders in the Google Cloud organization. + * + * [UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings] + * will fail if 1) `kms_key_name` is invalid, or 2) the associated service + * account does not have the required + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or + * 3) access to the key is disabled. + * + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $response = $configServiceV2Client->updateCmekSettings(); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Required. The resource name for the CMEK settings to update. + * + * "projects/[PROJECT_ID]/cmekSettings" + * "organizations/[ORGANIZATION_ID]/cmekSettings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + * "folders/[FOLDER_ID]/cmekSettings" + * + * For example: + * + * `"organizations/12345/cmekSettings"` + * + * Note: CMEK for the Log Router can currently only be configured for Google + * Cloud organizations. Once configured, it applies to all projects and + * folders in the Google Cloud organization. + * @type CmekSettings $cmekSettings + * Required. The CMEK settings to update. + * + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * @type FieldMask $updateMask + * Optional. Field mask identifying which fields from `cmek_settings` should + * be updated. A field will be overwritten if and only if it is in the update + * mask. Output only fields cannot be updated. + * + * See [FieldMask][google.protobuf.FieldMask] for more information. + * + * For example: `"updateMask=kmsKeyName"` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. 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\Logging\V2\CmekSettings + * + * @throws ApiException if the remote call fails + */ + public function updateCmekSettings(array $optionalArgs = []) + { + $request = new UpdateCmekSettingsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['cmekSettings'])) { + $request->setCmekSettings($optionalArgs['cmekSettings']); + } + + 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('UpdateCmekSettings', CmekSettings::class, $optionalArgs, $request)->wait(); + } + + /** + * Changes one or more properties of an existing exclusion in the _Default + * sink. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedName = $configServiceV2Client->logExclusionName('[PROJECT]', '[EXCLUSION]'); + * $exclusion = new LogExclusion(); + * $updateMask = new FieldMask(); + * $response = $configServiceV2Client->updateExclusion($formattedName, $exclusion, $updateMask); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the exclusion to update: + * + * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * + * For example: + * + * `"projects/my-project/exclusions/my-exclusion"` + * @param LogExclusion $exclusion Required. New values for the existing exclusion. Only the fields specified + * in `update_mask` are relevant. + * @param FieldMask $updateMask Required. A non-empty list of fields to change in the existing exclusion. + * New values for the fields are taken from the corresponding fields in the + * [LogExclusion][google.logging.v2.LogExclusion] included in this request. + * Fields not mentioned in `update_mask` are not changed and are ignored in + * the request. + * + * For example, to change the filter and description of an exclusion, + * specify an `update_mask` of `"filter,description"`. + * @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\Logging\V2\LogExclusion + * + * @throws ApiException if the remote call fails + */ + public function updateExclusion($name, $exclusion, $updateMask, array $optionalArgs = []) + { + $request = new UpdateExclusionRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setExclusion($exclusion); + $request->setUpdateMask($updateMask); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateExclusion', LogExclusion::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates the Log Router settings for the given resource. + * + * Note: Settings for the Log Router can currently only be configured for + * Google Cloud organizations. Once configured, it applies to all projects and + * folders in the Google Cloud organization. + * + * [UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings] + * will fail if 1) `kms_key_name` is invalid, or 2) the associated service + * account does not have the required + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or + * 3) access to the key is disabled. 4) `location_id` is not supported by + * Logging. 5) `location_id` violate OrgPolicy. + * + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $name = 'name'; + * $settings = new Settings(); + * $response = $configServiceV2Client->updateSettings($name, $settings); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $name Required. The resource name for the settings to update. + * + * "organizations/[ORGANIZATION_ID]/settings" + * + * For example: + * + * `"organizations/12345/settings"` + * + * Note: Settings for the Log Router can currently only be configured for + * Google Cloud organizations. Once configured, it applies to all projects and + * folders in the Google Cloud organization. + * @param Settings $settings Required. The settings to update. + * + * See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Field mask identifying which fields from `settings` should + * be updated. A field will be overwritten if and only if it is in the update + * mask. Output only fields cannot be updated. + * + * See [FieldMask][google.protobuf.FieldMask] for more information. + * + * For example: `"updateMask=kmsKeyName"` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. 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\Logging\V2\Settings + * + * @throws ApiException if the remote call fails + */ + public function updateSettings($name, $settings, array $optionalArgs = []) + { + $request = new UpdateSettingsRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setSettings($settings); + $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('UpdateSettings', Settings::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates a sink. This method replaces the following fields in the existing + * sink with values from the new sink: `destination`, and `filter`. + * + * The updated sink might also have a new `writer_identity`; see the + * `unique_writer_identity` field. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedSinkName = $configServiceV2Client->logSinkName('[PROJECT]', '[SINK]'); + * $sink = new LogSink(); + * $response = $configServiceV2Client->updateSink($formattedSinkName, $sink); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $sinkName Required. The full resource name of the sink to update, including the + * parent resource and the sink identifier: + * + * "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * + * For example: + * + * `"projects/my-project/sinks/my-sink"` + * @param LogSink $sink Required. The updated sink, whose name is the same identifier that appears + * as part of `sink_name`. + * @param array $optionalArgs { + * Optional. + * + * @type bool $uniqueWriterIdentity + * Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] + * for a description of this field. When updating a sink, the effect of this + * field on the value of `writer_identity` in the updated sink depends on both + * the old and new values of this field: + * + * + If the old and new values of this field are both false or both true, + * then there is no change to the sink's `writer_identity`. + * + If the old value is false and the new value is true, then + * `writer_identity` is changed to a unique service account. + * + It is an error if the old value is true and the new value is + * set to false or defaulted to false. + * @type FieldMask $updateMask + * Optional. Field mask that specifies the fields in `sink` that need + * an update. A sink field will be overwritten if, and only if, it is + * in the update mask. `name` and output only fields cannot be updated. + * + * An empty `updateMask` is temporarily treated as using the following mask + * for backwards compatibility purposes: + * + * `destination,filter,includeChildren` + * + * At some point in the future, behavior will be removed and specifying an + * empty `updateMask` will be an error. + * + * For a detailed `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + * + * For example: `updateMask=filter` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. 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\Logging\V2\LogSink + * + * @throws ApiException if the remote call fails + */ + public function updateSink($sinkName, $sink, array $optionalArgs = []) + { + $request = new UpdateSinkRequest(); + $requestParamHeaders = []; + $request->setSinkName($sinkName); + $request->setSink($sink); + $requestParamHeaders['sink_name'] = $sinkName; + if (isset($optionalArgs['uniqueWriterIdentity'])) { + $request->setUniqueWriterIdentity($optionalArgs['uniqueWriterIdentity']); + } + + 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('UpdateSink', LogSink::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates a view on a log bucket. This method replaces the following fields + * in the existing view with values from the new view: `filter`. + * If an `UNAVAILABLE` error is returned, this indicates that system is not in + * a state where it can update the view. If this occurs, please try again in a + * few minutes. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $name = 'name'; + * $view = new LogView(); + * $response = $configServiceV2Client->updateView($name, $view); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $name Required. The full resource name of the view to update + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + * + * For example: + * + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` + * @param LogView $view Required. The updated view. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Field mask that specifies the fields in `view` that need + * an update. A field will be overwritten if, and only if, it is + * in the update mask. `name` and output only fields cannot be updated. + * + * For a detailed `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + * + * For example: `updateMask=filter` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. 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\Logging\V2\LogView + * + * @throws ApiException if the remote call fails + */ + public function updateView($name, $view, array $optionalArgs = []) + { + $request = new UpdateViewRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setView($view); + $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('UpdateView', LogView::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Logging/v2/src/V2/Gapic/LoggingServiceV2GapicClient.php b/owl-bot-staging/Logging/v2/src/V2/Gapic/LoggingServiceV2GapicClient.php new file mode 100644 index 000000000000..6ff51b575efe --- /dev/null +++ b/owl-bot-staging/Logging/v2/src/V2/Gapic/LoggingServiceV2GapicClient.php @@ -0,0 +1,993 @@ +logName('[PROJECT]', '[LOG]'); + * $loggingServiceV2Client->deleteLog($formattedLogName); + * } finally { + * $loggingServiceV2Client->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. + */ +class LoggingServiceV2GapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.logging.v2.LoggingServiceV2'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'logging.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + 'https://www.googleapis.com/auth/logging.admin', + 'https://www.googleapis.com/auth/logging.read', + 'https://www.googleapis.com/auth/logging.write', + ]; + + private static $billingAccountNameTemplate; + + private static $billingAccountLogNameTemplate; + + private static $folderNameTemplate; + + private static $folderLogNameTemplate; + + private static $logNameTemplate; + + private static $organizationNameTemplate; + + private static $organizationLogNameTemplate; + + private static $projectNameTemplate; + + private static $projectLogNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/logging_service_v2_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/logging_service_v2_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/logging_service_v2_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/logging_service_v2_rest_client_config.php', + ], + ], + ]; + } + + private static function getBillingAccountNameTemplate() + { + if (self::$billingAccountNameTemplate == null) { + self::$billingAccountNameTemplate = new PathTemplate('billingAccounts/{billing_account}'); + } + + return self::$billingAccountNameTemplate; + } + + private static function getBillingAccountLogNameTemplate() + { + if (self::$billingAccountLogNameTemplate == null) { + self::$billingAccountLogNameTemplate = new PathTemplate('billingAccounts/{billing_account}/logs/{log}'); + } + + return self::$billingAccountLogNameTemplate; + } + + private static function getFolderNameTemplate() + { + if (self::$folderNameTemplate == null) { + self::$folderNameTemplate = new PathTemplate('folders/{folder}'); + } + + return self::$folderNameTemplate; + } + + private static function getFolderLogNameTemplate() + { + if (self::$folderLogNameTemplate == null) { + self::$folderLogNameTemplate = new PathTemplate('folders/{folder}/logs/{log}'); + } + + return self::$folderLogNameTemplate; + } + + private static function getLogNameTemplate() + { + if (self::$logNameTemplate == null) { + self::$logNameTemplate = new PathTemplate('projects/{project}/logs/{log}'); + } + + return self::$logNameTemplate; + } + + private static function getOrganizationNameTemplate() + { + if (self::$organizationNameTemplate == null) { + self::$organizationNameTemplate = new PathTemplate('organizations/{organization}'); + } + + return self::$organizationNameTemplate; + } + + private static function getOrganizationLogNameTemplate() + { + if (self::$organizationLogNameTemplate == null) { + self::$organizationLogNameTemplate = new PathTemplate('organizations/{organization}/logs/{log}'); + } + + return self::$organizationLogNameTemplate; + } + + private static function getProjectNameTemplate() + { + if (self::$projectNameTemplate == null) { + self::$projectNameTemplate = new PathTemplate('projects/{project}'); + } + + return self::$projectNameTemplate; + } + + private static function getProjectLogNameTemplate() + { + if (self::$projectLogNameTemplate == null) { + self::$projectLogNameTemplate = new PathTemplate('projects/{project}/logs/{log}'); + } + + return self::$projectLogNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'billingAccount' => self::getBillingAccountNameTemplate(), + 'billingAccountLog' => self::getBillingAccountLogNameTemplate(), + 'folder' => self::getFolderNameTemplate(), + 'folderLog' => self::getFolderLogNameTemplate(), + 'log' => self::getLogNameTemplate(), + 'organization' => self::getOrganizationNameTemplate(), + 'organizationLog' => self::getOrganizationLogNameTemplate(), + 'project' => self::getProjectNameTemplate(), + 'projectLog' => self::getProjectLogNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * billing_account resource. + * + * @param string $billingAccount + * + * @return string The formatted billing_account resource. + */ + public static function billingAccountName($billingAccount) + { + return self::getBillingAccountNameTemplate()->render([ + 'billing_account' => $billingAccount, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * billing_account_log resource. + * + * @param string $billingAccount + * @param string $log + * + * @return string The formatted billing_account_log resource. + */ + public static function billingAccountLogName($billingAccount, $log) + { + return self::getBillingAccountLogNameTemplate()->render([ + 'billing_account' => $billingAccount, + 'log' => $log, + ]); + } + + /** + * 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($folder) + { + return self::getFolderNameTemplate()->render([ + 'folder' => $folder, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a folder_log + * resource. + * + * @param string $folder + * @param string $log + * + * @return string The formatted folder_log resource. + */ + public static function folderLogName($folder, $log) + { + return self::getFolderLogNameTemplate()->render([ + 'folder' => $folder, + 'log' => $log, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a log + * resource. + * + * @param string $project + * @param string $log + * + * @return string The formatted log resource. + */ + public static function logName($project, $log) + { + return self::getLogNameTemplate()->render([ + 'project' => $project, + 'log' => $log, + ]); + } + + /** + * 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($organization) + { + return self::getOrganizationNameTemplate()->render([ + 'organization' => $organization, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_log resource. + * + * @param string $organization + * @param string $log + * + * @return string The formatted organization_log resource. + */ + public static function organizationLogName($organization, $log) + { + return self::getOrganizationLogNameTemplate()->render([ + 'organization' => $organization, + 'log' => $log, + ]); + } + + /** + * 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 project_log + * resource. + * + * @param string $project + * @param string $log + * + * @return string The formatted project_log resource. + */ + public static function projectLogName($project, $log) + { + return self::getProjectLogNameTemplate()->render([ + 'project' => $project, + 'log' => $log, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - billingAccount: billingAccounts/{billing_account} + * - billingAccountLog: billingAccounts/{billing_account}/logs/{log} + * - folder: folders/{folder} + * - folderLog: folders/{folder}/logs/{log} + * - log: projects/{project}/logs/{log} + * - organization: organizations/{organization} + * - organizationLog: organizations/{organization}/logs/{log} + * - project: projects/{project} + * - projectLog: projects/{project}/logs/{log} + * + * 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 'logging.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); + } + + /** + * Deletes all the log entries in a log for the _Default Log Bucket. The log + * reappears if it receives new entries. Log entries written shortly before + * the delete operation might not be deleted. Entries received after the + * delete operation with a timestamp before the operation will be deleted. + * + * Sample code: + * ``` + * $loggingServiceV2Client = new LoggingServiceV2Client(); + * try { + * $formattedLogName = $loggingServiceV2Client->logName('[PROJECT]', '[LOG]'); + * $loggingServiceV2Client->deleteLog($formattedLogName); + * } finally { + * $loggingServiceV2Client->close(); + * } + * ``` + * + * @param string $logName Required. The resource name of the log to delete: + * + * * `projects/[PROJECT_ID]/logs/[LOG_ID]` + * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + * * `folders/[FOLDER_ID]/logs/[LOG_ID]` + * + * `[LOG_ID]` must be URL-encoded. For example, + * `"projects/my-project-id/logs/syslog"`, + * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. + * + * For more information about log names, see + * [LogEntry][google.logging.v2.LogEntry]. + * @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 deleteLog($logName, array $optionalArgs = []) + { + $request = new DeleteLogRequest(); + $requestParamHeaders = []; + $request->setLogName($logName); + $requestParamHeaders['log_name'] = $logName; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteLog', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists log entries. Use this method to retrieve log entries that originated + * from a project/folder/organization/billing account. For ways to export log + * entries, see [Exporting + * Logs](https://cloud.google.com/logging/docs/export). + * + * Sample code: + * ``` + * $loggingServiceV2Client = new LoggingServiceV2Client(); + * try { + * $formattedResourceNames = [ + * $loggingServiceV2Client->projectName('[PROJECT]'), + * ]; + * // Iterate over pages of elements + * $pagedResponse = $loggingServiceV2Client->listLogEntries($formattedResourceNames); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $loggingServiceV2Client->listLogEntries($formattedResourceNames); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $loggingServiceV2Client->close(); + * } + * ``` + * + * @param string[] $resourceNames Required. Names of one or more parent resources from which to + * retrieve log entries: + * + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * + * May alternatively be one or more views: + * + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * + * Projects listed in the `project_ids` field are added to this list. + * A maximum of 100 resources may be specified in a single request. + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. + * Referencing a parent resource that is not listed in `resource_names` will + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. + * @type string $orderBy + * Optional. How the results should be sorted. Presently, the only permitted + * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first + * option returns entries in order of increasing values of + * `LogEntry.timestamp` (oldest first), and the second option returns entries + * in order of decreasing timestamps (newest first). Entries with equal + * timestamps are returned in order of their `insert_id` values. + * @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 listLogEntries($resourceNames, array $optionalArgs = []) + { + $request = new ListLogEntriesRequest(); + $request->setResourceNames($resourceNames); + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + return $this->getPagedListResponse('ListLogEntries', $optionalArgs, ListLogEntriesResponse::class, $request); + } + + /** + * Lists the logs in projects, organizations, folders, or billing accounts. + * Only logs that have entries are listed. + * + * Sample code: + * ``` + * $loggingServiceV2Client = new LoggingServiceV2Client(); + * try { + * $formattedParent = $loggingServiceV2Client->projectName('[PROJECT]'); + * // Iterate over pages of elements + * $pagedResponse = $loggingServiceV2Client->listLogs($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $loggingServiceV2Client->listLogs($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $loggingServiceV2Client->close(); + * } + * ``` + * + * @param string $parent Required. The resource name to list logs for: + * + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * @param array $optionalArgs { + * Optional. + * + * @type string[] $resourceNames + * Optional. List of resource names to list logs for: + * + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * + * To support legacy queries, it could also be: + * + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * + * The resource name in the `parent` field is added to this list. + * @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 listLogs($parent, array $optionalArgs = []) + { + $request = new ListLogsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['resourceNames'])) { + $request->setResourceNames($optionalArgs['resourceNames']); + } + + 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('ListLogs', $optionalArgs, ListLogsResponse::class, $request); + } + + /** + * Lists the descriptors for monitored resource types used by Logging. + * + * Sample code: + * ``` + * $loggingServiceV2Client = new LoggingServiceV2Client(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $loggingServiceV2Client->listMonitoredResourceDescriptors(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $loggingServiceV2Client->listMonitoredResourceDescriptors(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $loggingServiceV2Client->close(); + * } + * ``` + * + * @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 listMonitoredResourceDescriptors(array $optionalArgs = []) + { + $request = new ListMonitoredResourceDescriptorsRequest(); + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + return $this->getPagedListResponse('ListMonitoredResourceDescriptors', $optionalArgs, ListMonitoredResourceDescriptorsResponse::class, $request); + } + + /** + * Streaming read of log entries as they are ingested. Until the stream is + * terminated, it will continue reading logs. + * + * Sample code: + * ``` + * $loggingServiceV2Client = new LoggingServiceV2Client(); + * try { + * $resourceNames = []; + * $request = new TailLogEntriesRequest(); + * $request->setResourceNames($resourceNames); + * // Write all requests to the server, then read all responses until the + * // stream is complete + * $requests = [ + * $request, + * ]; + * $stream = $loggingServiceV2Client->tailLogEntries(); + * $stream->writeAll($requests); + * foreach ($stream->closeWriteAndReadAll() as $element) { + * // doSomethingWith($element); + * } + * // Alternatively: + * // Write requests individually, making read() calls if + * // required. Call closeWrite() once writes are complete, and read the + * // remaining responses from the server. + * $requests = [ + * $request, + * ]; + * $stream = $loggingServiceV2Client->tailLogEntries(); + * foreach ($requests as $request) { + * $stream->write($request); + * // if required, read a single response from the stream + * $element = $stream->read(); + * // doSomethingWith($element) + * } + * $stream->closeWrite(); + * $element = $stream->read(); + * while (!is_null($element)) { + * // doSomethingWith($element) + * $element = $stream->read(); + * } + * } finally { + * $loggingServiceV2Client->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return \Google\ApiCore\BidiStream + * + * @throws ApiException if the remote call fails + */ + public function tailLogEntries(array $optionalArgs = []) + { + return $this->startCall('TailLogEntries', TailLogEntriesResponse::class, $optionalArgs, null, Call::BIDI_STREAMING_CALL); + } + + /** + * Writes log entries to Logging. This API method is the + * only way to send log entries to Logging. This method + * is used, directly or indirectly, by the Logging agent + * (fluentd) and all logging libraries configured to use Logging. + * A single request may contain log entries for a maximum of 1000 + * different resources (projects, organizations, billing accounts or + * folders) + * + * Sample code: + * ``` + * $loggingServiceV2Client = new LoggingServiceV2Client(); + * try { + * $entries = []; + * $response = $loggingServiceV2Client->writeLogEntries($entries); + * } finally { + * $loggingServiceV2Client->close(); + * } + * ``` + * + * @param LogEntry[] $entries Required. The log entries to send to Logging. The order of log + * entries in this list does not matter. Values supplied in this method's + * `log_name`, `resource`, and `labels` fields are copied into those log + * entries in this list that do not include values for their corresponding + * fields. For more information, see the + * [LogEntry][google.logging.v2.LogEntry] type. + * + * If the `timestamp` or `insert_id` fields are missing in log entries, then + * this method supplies the current time or a unique identifier, respectively. + * The supplied values are chosen so that, among the log entries that did not + * supply their own values, the entries earlier in the list will sort before + * the entries later in the list. See the `entries.list` method. + * + * Log entries with timestamps that are more than the + * [logs retention period](https://cloud.google.com/logging/quotas) in + * the past or more than 24 hours in the future will not be available when + * calling `entries.list`. However, those log entries can still be [exported + * with + * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). + * + * To improve throughput and to avoid exceeding the + * [quota limit](https://cloud.google.com/logging/quotas) for calls to + * `entries.write`, you should try to include several log entries in this + * list, rather than calling this method for each individual log entry. + * @param array $optionalArgs { + * Optional. + * + * @type string $logName + * Optional. A default log resource name that is assigned to all log entries + * in `entries` that do not specify a value for `log_name`: + * + * * `projects/[PROJECT_ID]/logs/[LOG_ID]` + * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + * * `folders/[FOLDER_ID]/logs/[LOG_ID]` + * + * `[LOG_ID]` must be URL-encoded. For example: + * + * "projects/my-project-id/logs/syslog" + * "organizations/123/logs/cloudaudit.googleapis.com%2Factivity" + * + * The permission `logging.logEntries.create` is needed on each project, + * organization, billing account, or folder that is receiving new log + * entries, whether the resource is specified in `logName` or in an + * individual log entry. + * @type MonitoredResource $resource + * Optional. A default monitored resource object that is assigned to all log + * entries in `entries` that do not specify a value for `resource`. Example: + * + * { "type": "gce_instance", + * "labels": { + * "zone": "us-central1-a", "instance_id": "00000000000000000000" }} + * + * See [LogEntry][google.logging.v2.LogEntry]. + * @type array $labels + * Optional. Default labels that are added to the `labels` field of all log + * entries in `entries`. If a log entry already has a label with the same key + * as a label in this parameter, then the log entry's label is not changed. + * See [LogEntry][google.logging.v2.LogEntry]. + * @type bool $partialSuccess + * Optional. Whether a batch's valid entries should be written even if some + * other entry failed due to a permanent error such as INVALID_ARGUMENT or + * PERMISSION_DENIED. If any entry failed, then the response status is the + * response status of one of the failed entries. The response will include + * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by + * the entries' zero-based index in the `entries`. Failed requests for which + * no entries are written will not include per-entry errors. + * @type bool $dryRun + * Optional. If true, the request should expect normal response, but the + * entries won't be persisted nor exported. Useful for checking whether the + * logging API endpoints are working properly before sending valuable data. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. 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\Logging\V2\WriteLogEntriesResponse + * + * @throws ApiException if the remote call fails + */ + public function writeLogEntries($entries, array $optionalArgs = []) + { + $request = new WriteLogEntriesRequest(); + $request->setEntries($entries); + if (isset($optionalArgs['logName'])) { + $request->setLogName($optionalArgs['logName']); + } + + if (isset($optionalArgs['resource'])) { + $request->setResource($optionalArgs['resource']); + } + + if (isset($optionalArgs['labels'])) { + $request->setLabels($optionalArgs['labels']); + } + + if (isset($optionalArgs['partialSuccess'])) { + $request->setPartialSuccess($optionalArgs['partialSuccess']); + } + + if (isset($optionalArgs['dryRun'])) { + $request->setDryRun($optionalArgs['dryRun']); + } + + return $this->startCall('WriteLogEntries', WriteLogEntriesResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Logging/v2/src/V2/Gapic/MetricsServiceV2GapicClient.php b/owl-bot-staging/Logging/v2/src/V2/Gapic/MetricsServiceV2GapicClient.php new file mode 100644 index 000000000000..951f82e4defd --- /dev/null +++ b/owl-bot-staging/Logging/v2/src/V2/Gapic/MetricsServiceV2GapicClient.php @@ -0,0 +1,525 @@ +projectName('[PROJECT]'); + * $metric = new LogMetric(); + * $response = $metricsServiceV2Client->createLogMetric($formattedParent, $metric); + * } finally { + * $metricsServiceV2Client->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. + */ +class MetricsServiceV2GapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.logging.v2.MetricsServiceV2'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'logging.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + 'https://www.googleapis.com/auth/logging.admin', + 'https://www.googleapis.com/auth/logging.read', + 'https://www.googleapis.com/auth/logging.write', + ]; + + private static $logMetricNameTemplate; + + private static $projectNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/metrics_service_v2_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/metrics_service_v2_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/metrics_service_v2_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/metrics_service_v2_rest_client_config.php', + ], + ], + ]; + } + + private static function getLogMetricNameTemplate() + { + if (self::$logMetricNameTemplate == null) { + self::$logMetricNameTemplate = new PathTemplate('projects/{project}/metrics/{metric}'); + } + + return self::$logMetricNameTemplate; + } + + private static function getProjectNameTemplate() + { + if (self::$projectNameTemplate == null) { + self::$projectNameTemplate = new PathTemplate('projects/{project}'); + } + + return self::$projectNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'logMetric' => self::getLogMetricNameTemplate(), + 'project' => self::getProjectNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a log_metric + * resource. + * + * @param string $project + * @param string $metric + * + * @return string The formatted log_metric resource. + */ + public static function logMetricName($project, $metric) + { + return self::getLogMetricNameTemplate()->render([ + 'project' => $project, + 'metric' => $metric, + ]); + } + + /** + * 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, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - logMetric: projects/{project}/metrics/{metric} + * - 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($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 'logging.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); + } + + /** + * Creates a logs-based metric. + * + * Sample code: + * ``` + * $metricsServiceV2Client = new MetricsServiceV2Client(); + * try { + * $formattedParent = $metricsServiceV2Client->projectName('[PROJECT]'); + * $metric = new LogMetric(); + * $response = $metricsServiceV2Client->createLogMetric($formattedParent, $metric); + * } finally { + * $metricsServiceV2Client->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the project in which to create the metric: + * + * "projects/[PROJECT_ID]" + * + * The new metric must be provided in the request. + * @param LogMetric $metric Required. The new logs-based metric, which must not have an identifier that + * already exists. + * @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\Logging\V2\LogMetric + * + * @throws ApiException if the remote call fails + */ + public function createLogMetric($parent, $metric, array $optionalArgs = []) + { + $request = new CreateLogMetricRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setMetric($metric); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateLogMetric', LogMetric::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a logs-based metric. + * + * Sample code: + * ``` + * $metricsServiceV2Client = new MetricsServiceV2Client(); + * try { + * $formattedMetricName = $metricsServiceV2Client->logMetricName('[PROJECT]', '[METRIC]'); + * $metricsServiceV2Client->deleteLogMetric($formattedMetricName); + * } finally { + * $metricsServiceV2Client->close(); + * } + * ``` + * + * @param string $metricName Required. The resource name of the metric to delete: + * + * "projects/[PROJECT_ID]/metrics/[METRIC_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 + */ + public function deleteLogMetric($metricName, array $optionalArgs = []) + { + $request = new DeleteLogMetricRequest(); + $requestParamHeaders = []; + $request->setMetricName($metricName); + $requestParamHeaders['metric_name'] = $metricName; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteLogMetric', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a logs-based metric. + * + * Sample code: + * ``` + * $metricsServiceV2Client = new MetricsServiceV2Client(); + * try { + * $formattedMetricName = $metricsServiceV2Client->logMetricName('[PROJECT]', '[METRIC]'); + * $response = $metricsServiceV2Client->getLogMetric($formattedMetricName); + * } finally { + * $metricsServiceV2Client->close(); + * } + * ``` + * + * @param string $metricName Required. The resource name of the desired metric: + * + * "projects/[PROJECT_ID]/metrics/[METRIC_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\Logging\V2\LogMetric + * + * @throws ApiException if the remote call fails + */ + public function getLogMetric($metricName, array $optionalArgs = []) + { + $request = new GetLogMetricRequest(); + $requestParamHeaders = []; + $request->setMetricName($metricName); + $requestParamHeaders['metric_name'] = $metricName; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLogMetric', LogMetric::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists logs-based metrics. + * + * Sample code: + * ``` + * $metricsServiceV2Client = new MetricsServiceV2Client(); + * try { + * $formattedParent = $metricsServiceV2Client->projectName('[PROJECT]'); + * // Iterate over pages of elements + * $pagedResponse = $metricsServiceV2Client->listLogMetrics($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $metricsServiceV2Client->listLogMetrics($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $metricsServiceV2Client->close(); + * } + * ``` + * + * @param string $parent Required. The name of the project containing the metrics: + * + * "projects/[PROJECT_ID]" + * @param array $optionalArgs { + * Optional. + * + * @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 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 RetrySettings|array $retrySettings + * Retry settings to use for this call. 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 listLogMetrics($parent, array $optionalArgs = []) + { + $request = new ListLogMetricsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLogMetrics', $optionalArgs, ListLogMetricsResponse::class, $request); + } + + /** + * Creates or updates a logs-based metric. + * + * Sample code: + * ``` + * $metricsServiceV2Client = new MetricsServiceV2Client(); + * try { + * $formattedMetricName = $metricsServiceV2Client->logMetricName('[PROJECT]', '[METRIC]'); + * $metric = new LogMetric(); + * $response = $metricsServiceV2Client->updateLogMetric($formattedMetricName, $metric); + * } finally { + * $metricsServiceV2Client->close(); + * } + * ``` + * + * @param string $metricName Required. The resource name of the metric to update: + * + * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * + * The updated metric must be provided in the request and it's + * `name` field must be the same as `[METRIC_ID]` If the metric + * does not exist in `[PROJECT_ID]`, then a new metric is created. + * @param LogMetric $metric Required. The updated metric. + * @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\Logging\V2\LogMetric + * + * @throws ApiException if the remote call fails + */ + public function updateLogMetric($metricName, $metric, array $optionalArgs = []) + { + $request = new UpdateLogMetricRequest(); + $requestParamHeaders = []; + $request->setMetricName($metricName); + $request->setMetric($metric); + $requestParamHeaders['metric_name'] = $metricName; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateLogMetric', LogMetric::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Logging/v2/src/V2/LoggingServiceV2Client.php b/owl-bot-staging/Logging/v2/src/V2/LoggingServiceV2Client.php new file mode 100644 index 000000000000..d738ceb98d83 --- /dev/null +++ b/owl-bot-staging/Logging/v2/src/V2/LoggingServiceV2Client.php @@ -0,0 +1,34 @@ + [ + 'google.logging.v2.ConfigServiceV2' => [ + 'CopyLogEntries' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Logging\V2\CopyLogEntriesResponse', + 'metadataReturnType' => '\Google\Cloud\Logging\V2\CopyLogEntriesMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateBucketAsync' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Logging\V2\LogBucket', + 'metadataReturnType' => '\Google\Cloud\Logging\V2\BucketMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateLink' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Logging\V2\Link', + 'metadataReturnType' => '\Google\Cloud\Logging\V2\LinkMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteLink' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Logging\V2\LinkMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateBucketAsync' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Logging\V2\LogBucket', + 'metadataReturnType' => '\Google\Cloud\Logging\V2\BucketMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'ListBuckets' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getBuckets', + ], + ], + 'ListExclusions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getExclusions', + ], + ], + 'ListLinks' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLinks', + ], + ], + 'ListSinks' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSinks', + ], + ], + 'ListViews' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getViews', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Logging/v2/src/V2/resources/config_service_v2_rest_client_config.php b/owl-bot-staging/Logging/v2/src/V2/resources/config_service_v2_rest_client_config.php new file mode 100644 index 000000000000..dac023f81c6c --- /dev/null +++ b/owl-bot-staging/Logging/v2/src/V2/resources/config_service_v2_rest_client_config.php @@ -0,0 +1,1147 @@ + [ + 'google.logging.v2.ConfigServiceV2' => [ + 'CopyLogEntries' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/entries:copy', + 'body' => '*', + ], + 'CreateBucket' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=*/*/locations/*}/buckets', + 'body' => 'bucket', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/buckets', + 'body' => 'bucket', + 'queryParams' => [ + 'bucket_id', + ], + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=organizations/*/locations/*}/buckets', + 'body' => 'bucket', + 'queryParams' => [ + 'bucket_id', + ], + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=folders/*/locations/*}/buckets', + 'body' => 'bucket', + 'queryParams' => [ + 'bucket_id', + ], + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=billingAccounts/*/locations/*}/buckets', + 'body' => 'bucket', + 'queryParams' => [ + 'bucket_id', + ], + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'bucket_id', + ], + ], + 'CreateBucketAsync' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=*/*/locations/*}/buckets:createAsync', + 'body' => 'bucket', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/buckets:createAsync', + 'body' => 'bucket', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=organizations/*/locations/*}/buckets:createAsync', + 'body' => 'bucket', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=folders/*/locations/*}/buckets:createAsync', + 'body' => 'bucket', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=billingAccounts/*/locations/*}/buckets:createAsync', + 'body' => 'bucket', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateExclusion' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=*/*}/exclusions', + 'body' => 'exclusion', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/exclusions', + 'body' => 'exclusion', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=organizations/*}/exclusions', + 'body' => 'exclusion', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=folders/*}/exclusions', + 'body' => 'exclusion', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=billingAccounts/*}/exclusions', + 'body' => 'exclusion', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateLink' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=*/*/locations/*/buckets/*}/links', + 'body' => 'link', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/buckets/*}/links', + 'body' => 'link', + 'queryParams' => [ + 'link_id', + ], + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=organizations/*/locations/*/buckets/*}/links', + 'body' => 'link', + 'queryParams' => [ + 'link_id', + ], + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=folders/*/locations/*/buckets/*}/links', + 'body' => 'link', + 'queryParams' => [ + 'link_id', + ], + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=billingAccounts/*/locations/*/buckets/*}/links', + 'body' => 'link', + 'queryParams' => [ + 'link_id', + ], + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'link_id', + ], + ], + 'CreateSink' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=*/*}/sinks', + 'body' => 'sink', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/sinks', + 'body' => 'sink', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=organizations/*}/sinks', + 'body' => 'sink', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=folders/*}/sinks', + 'body' => 'sink', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=billingAccounts/*}/sinks', + 'body' => 'sink', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateView' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=*/*/locations/*/buckets/*}/views', + 'body' => 'view', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/buckets/*}/views', + 'body' => 'view', + 'queryParams' => [ + 'view_id', + ], + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=organizations/*/locations/*/buckets/*}/views', + 'body' => 'view', + 'queryParams' => [ + 'view_id', + ], + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=folders/*/locations/*/buckets/*}/views', + 'body' => 'view', + 'queryParams' => [ + 'view_id', + ], + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=billingAccounts/*/locations/*/buckets/*}/views', + 'body' => 'view', + 'queryParams' => [ + 'view_id', + ], + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'view_id', + ], + ], + 'DeleteBucket' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteExclusion' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=*/*/exclusions/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/exclusions/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=organizations/*/exclusions/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=folders/*/exclusions/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=billingAccounts/*/exclusions/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteLink' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*/links/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*/links/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*/links/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*/links/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*/links/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteSink' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{sink_name=*/*/sinks/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{sink_name=projects/*/sinks/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{sink_name=organizations/*/sinks/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{sink_name=folders/*/sinks/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{sink_name=billingAccounts/*/sinks/*}', + ], + ], + 'placeholders' => [ + 'sink_name' => [ + 'getters' => [ + 'getSinkName', + ], + ], + ], + ], + 'DeleteView' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*/views/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*/views/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*/views/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*/views/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetBucket' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetCmekSettings' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=*/*}/cmekSettings', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/cmekSettings', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=organizations/*}/cmekSettings', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=folders/*}/cmekSettings', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=billingAccounts/*}/cmekSettings', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetExclusion' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=*/*/exclusions/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/exclusions/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=organizations/*/exclusions/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=folders/*/exclusions/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=billingAccounts/*/exclusions/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetLink' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*/links/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*/links/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*/links/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*/links/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*/links/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetSettings' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=*/*}/settings', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/settings', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=organizations/*}/settings', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=folders/*}/settings', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=billingAccounts/*}/settings', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetSink' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{sink_name=*/*/sinks/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{sink_name=projects/*/sinks/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{sink_name=organizations/*/sinks/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{sink_name=folders/*/sinks/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{sink_name=billingAccounts/*/sinks/*}', + ], + ], + 'placeholders' => [ + 'sink_name' => [ + 'getters' => [ + 'getSinkName', + ], + ], + ], + ], + 'GetView' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*/views/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*/views/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*/views/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*/views/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListBuckets' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=*/*/locations/*}/buckets', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/buckets', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=organizations/*/locations/*}/buckets', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=folders/*/locations/*}/buckets', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=billingAccounts/*/locations/*}/buckets', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListExclusions' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=*/*}/exclusions', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/exclusions', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=organizations/*}/exclusions', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=folders/*}/exclusions', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=billingAccounts/*}/exclusions', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListLinks' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=*/*/locations/*/buckets/*}/links', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/buckets/*}/links', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=organizations/*/locations/*/buckets/*}/links', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=folders/*/locations/*/buckets/*}/links', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=billingAccounts/*/locations/*/buckets/*}/links', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListSinks' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=*/*}/sinks', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/sinks', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=organizations/*}/sinks', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=folders/*}/sinks', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=billingAccounts/*}/sinks', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListViews' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=*/*/locations/*/buckets/*}/views', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/buckets/*}/views', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=organizations/*/locations/*/buckets/*}/views', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=folders/*/locations/*/buckets/*}/views', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=billingAccounts/*/locations/*/buckets/*}/views', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UndeleteBucket' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*}:undelete', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*}:undelete', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*}:undelete', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*}:undelete', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*}:undelete', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateBucket' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*}', + 'body' => 'bucket', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*}', + 'body' => 'bucket', + 'queryParams' => [ + 'update_mask', + ], + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*}', + 'body' => 'bucket', + 'queryParams' => [ + 'update_mask', + ], + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*}', + 'body' => 'bucket', + 'queryParams' => [ + 'update_mask', + ], + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*}', + 'body' => 'bucket', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateBucketAsync' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*}:updateAsync', + 'body' => 'bucket', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*}:updateAsync', + 'body' => 'bucket', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*}:updateAsync', + 'body' => 'bucket', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*}:updateAsync', + 'body' => 'bucket', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*}:updateAsync', + 'body' => 'bucket', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateCmekSettings' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{name=*/*}/cmekSettings', + 'body' => 'cmek_settings', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{name=organizations/*}/cmekSettings', + 'body' => 'cmek_settings', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateExclusion' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{name=*/*/exclusions/*}', + 'body' => 'exclusion', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{name=projects/*/exclusions/*}', + 'body' => 'exclusion', + 'queryParams' => [ + 'update_mask', + ], + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{name=organizations/*/exclusions/*}', + 'body' => 'exclusion', + 'queryParams' => [ + 'update_mask', + ], + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{name=folders/*/exclusions/*}', + 'body' => 'exclusion', + 'queryParams' => [ + 'update_mask', + ], + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{name=billingAccounts/*/exclusions/*}', + 'body' => 'exclusion', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateSettings' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{name=*/*}/settings', + 'body' => 'settings', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{name=organizations/*}/settings', + 'body' => 'settings', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{name=folders/*}/settings', + 'body' => 'settings', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateSink' => [ + 'method' => 'put', + 'uriTemplate' => '/v2/{sink_name=*/*/sinks/*}', + 'body' => 'sink', + 'additionalBindings' => [ + [ + 'method' => 'put', + 'uriTemplate' => '/v2/{sink_name=projects/*/sinks/*}', + 'body' => 'sink', + ], + [ + 'method' => 'put', + 'uriTemplate' => '/v2/{sink_name=organizations/*/sinks/*}', + 'body' => 'sink', + ], + [ + 'method' => 'put', + 'uriTemplate' => '/v2/{sink_name=folders/*/sinks/*}', + 'body' => 'sink', + ], + [ + 'method' => 'put', + 'uriTemplate' => '/v2/{sink_name=billingAccounts/*/sinks/*}', + 'body' => 'sink', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{sink_name=projects/*/sinks/*}', + 'body' => 'sink', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{sink_name=organizations/*/sinks/*}', + 'body' => 'sink', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{sink_name=folders/*/sinks/*}', + 'body' => 'sink', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{sink_name=billingAccounts/*/sinks/*}', + 'body' => 'sink', + ], + ], + 'placeholders' => [ + 'sink_name' => [ + 'getters' => [ + 'getSinkName', + ], + ], + ], + ], + 'UpdateView' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*/views/*}', + 'body' => 'view', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*/views/*}', + 'body' => 'view', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*/views/*}', + 'body' => 'view', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*/views/*}', + 'body' => 'view', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}', + 'body' => 'view', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=*/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=folders/*/locations/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=*/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=folders/*/locations/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=*/*/locations/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=folders/*/locations/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_client_config.json b/owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_client_config.json new file mode 100644 index 000000000000..f5ac1a4d058e --- /dev/null +++ b/owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_client_config.json @@ -0,0 +1,83 @@ +{ + "interfaces": { + "google.logging.v2.LoggingServiceV2": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "INTERNAL", + "UNAVAILABLE" + ], + "retry_policy_2_codes": [ + "DEADLINE_EXCEEDED", + "INTERNAL", + "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": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 3600000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 3600000, + "total_timeout_millis": 3600000 + } + }, + "methods": { + "DeleteLog": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLogEntries": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLogs": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListMonitoredResourceDescriptors": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "TailLogEntries": { + "timeout_millis": 3600000 + }, + "WriteLogEntries": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params", + "bundling": { + "delay_threshold_millis": 50, + "element_count_threshold": 1000, + "request_byte_threshold": 1048576 + } + } + } + } + } +} diff --git a/owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_descriptor_config.php b/owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_descriptor_config.php new file mode 100644 index 000000000000..dccb09092992 --- /dev/null +++ b/owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_descriptor_config.php @@ -0,0 +1,43 @@ + [ + 'google.logging.v2.LoggingServiceV2' => [ + 'ListLogEntries' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getEntries', + ], + ], + 'ListLogs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLogNames', + ], + ], + 'ListMonitoredResourceDescriptors' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getResourceDescriptors', + ], + ], + 'TailLogEntries' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'BidiStreaming', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_rest_client_config.php b/owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_rest_client_config.php new file mode 100644 index 000000000000..00e4c2f5ffa8 --- /dev/null +++ b/owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_rest_client_config.php @@ -0,0 +1,191 @@ + [ + 'google.logging.v2.LoggingServiceV2' => [ + 'DeleteLog' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{log_name=projects/*/logs/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{log_name=*/*/logs/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{log_name=organizations/*/logs/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{log_name=folders/*/logs/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{log_name=billingAccounts/*/logs/*}', + ], + ], + 'placeholders' => [ + 'log_name' => [ + 'getters' => [ + 'getLogName', + ], + ], + ], + ], + 'ListLogEntries' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/entries:list', + 'body' => '*', + ], + 'ListLogs' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=*/*}/logs', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/logs', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=organizations/*}/logs', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=folders/*}/logs', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=billingAccounts/*}/logs', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/buckets/*/views/*}/logs', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=organizations/*/locations/*/buckets/*/views/*}/logs', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=folders/*/locations/*/buckets/*/views/*}/logs', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=billingAccounts/*/locations/*/buckets/*/views/*}/logs', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListMonitoredResourceDescriptors' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/monitoredResourceDescriptors', + ], + 'WriteLogEntries' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/entries:write', + 'body' => '*', + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=*/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=folders/*/locations/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=*/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=folders/*/locations/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=*/*/locations/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=folders/*/locations/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_client_config.json b/owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_client_config.json new file mode 100644 index 000000000000..8d1153764e81 --- /dev/null +++ b/owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_client_config.json @@ -0,0 +1,71 @@ +{ + "interfaces": { + "google.logging.v2.MetricsServiceV2": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_1_codes": [], + "retry_policy_4_codes": [ + "DEADLINE_EXCEEDED", + "INTERNAL", + "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 + }, + "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 + }, + "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": { + "CreateLogMetric": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteLogMetric": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "GetLogMetric": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "ListLogMetrics": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "UpdateLogMetric": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + } + } + } + } +} diff --git a/owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_descriptor_config.php b/owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_descriptor_config.php new file mode 100644 index 000000000000..d0dfc9cbfe12 --- /dev/null +++ b/owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_descriptor_config.php @@ -0,0 +1,18 @@ + [ + 'google.logging.v2.MetricsServiceV2' => [ + 'ListLogMetrics' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getMetrics', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_rest_client_config.php b/owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_rest_client_config.php new file mode 100644 index 000000000000..9d07868f5bec --- /dev/null +++ b/owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_rest_client_config.php @@ -0,0 +1,160 @@ + [ + 'google.logging.v2.MetricsServiceV2' => [ + 'CreateLogMetric' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/metrics', + 'body' => 'metric', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteLogMetric' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{metric_name=projects/*/metrics/*}', + 'placeholders' => [ + 'metric_name' => [ + 'getters' => [ + 'getMetricName', + ], + ], + ], + ], + 'GetLogMetric' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{metric_name=projects/*/metrics/*}', + 'placeholders' => [ + 'metric_name' => [ + 'getters' => [ + 'getMetricName', + ], + ], + ], + ], + 'ListLogMetrics' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/metrics', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateLogMetric' => [ + 'method' => 'put', + 'uriTemplate' => '/v2/{metric_name=projects/*/metrics/*}', + 'body' => 'metric', + 'placeholders' => [ + 'metric_name' => [ + 'getters' => [ + 'getMetricName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=*/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=folders/*/locations/*/operations/*}:cancel', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=*/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=folders/*/locations/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=*/*/locations/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=folders/*/locations/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Logging/v2/tests/Unit/V2/ConfigServiceV2ClientTest.php b/owl-bot-staging/Logging/v2/tests/Unit/V2/ConfigServiceV2ClientTest.php new file mode 100644 index 000000000000..1dc001d1440e --- /dev/null +++ b/owl-bot-staging/Logging/v2/tests/Unit/V2/ConfigServiceV2ClientTest.php @@ -0,0 +1,2555 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ConfigServiceV2Client */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ConfigServiceV2Client($options); + } + + /** @test */ + public function copyLogEntriesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/copyLogEntriesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $logEntriesCopiedCount = 2134326978; + $expectedResponse = new CopyLogEntriesResponse(); + $expectedResponse->setLogEntriesCopiedCount($logEntriesCopiedCount); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/copyLogEntriesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $name = 'name3373707'; + $destination = 'destination-1429847026'; + $response = $gapicClient->copyLogEntries($name, $destination); + $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.logging.v2.ConfigServiceV2/CopyLogEntries', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualApiRequestObject->getDestination(); + $this->assertProtobufEquals($destination, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/copyLogEntriesTest'); + $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 copyLogEntriesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/copyLogEntriesTest'); + $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'; + $destination = 'destination-1429847026'; + $response = $gapicClient->copyLogEntries($name, $destination); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/copyLogEntriesTest'); + 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 createBucketTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $retentionDays = 1544391896; + $locked = true; + $analyticsEnabled = true; + $expectedResponse = new LogBucket(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setRetentionDays($retentionDays); + $expectedResponse->setLocked($locked); + $expectedResponse->setAnalyticsEnabled($analyticsEnabled); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $bucketId = 'bucketId1837164432'; + $bucket = new LogBucket(); + $response = $gapicClient->createBucket($formattedParent, $bucketId, $bucket); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/CreateBucket', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getBucketId(); + $this->assertProtobufEquals($bucketId, $actualValue); + $actualValue = $actualRequestObject->getBucket(); + $this->assertProtobufEquals($bucket, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createBucketExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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]'); + $bucketId = 'bucketId1837164432'; + $bucket = new LogBucket(); + try { + $gapicClient->createBucket($formattedParent, $bucketId, $bucket); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createBucketAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBucketAsyncTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $retentionDays = 1544391896; + $locked = true; + $analyticsEnabled = true; + $expectedResponse = new LogBucket(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setRetentionDays($retentionDays); + $expectedResponse->setLocked($locked); + $expectedResponse->setAnalyticsEnabled($analyticsEnabled); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createBucketAsyncTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $bucketId = 'bucketId1837164432'; + $bucket = new LogBucket(); + $response = $gapicClient->createBucketAsync($formattedParent, $bucketId, $bucket); + $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.logging.v2.ConfigServiceV2/CreateBucketAsync', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getBucketId(); + $this->assertProtobufEquals($bucketId, $actualValue); + $actualValue = $actualApiRequestObject->getBucket(); + $this->assertProtobufEquals($bucket, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBucketAsyncTest'); + $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 createBucketAsyncExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBucketAsyncTest'); + $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]'); + $bucketId = 'bucketId1837164432'; + $bucket = new LogBucket(); + $response = $gapicClient->createBucketAsync($formattedParent, $bucketId, $bucket); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBucketAsyncTest'); + 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 createExclusionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $filter = 'filter-1274492040'; + $disabled = true; + $expectedResponse = new LogExclusion(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setFilter($filter); + $expectedResponse->setDisabled($disabled); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $exclusion = new LogExclusion(); + $exclusionName = 'exclusionName1004344697'; + $exclusion->setName($exclusionName); + $exclusionFilter = 'exclusionFilter-1414044954'; + $exclusion->setFilter($exclusionFilter); + $response = $gapicClient->createExclusion($formattedParent, $exclusion); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/CreateExclusion', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getExclusion(); + $this->assertProtobufEquals($exclusion, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createExclusionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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]'); + $exclusion = new LogExclusion(); + $exclusionName = 'exclusionName1004344697'; + $exclusion->setName($exclusionName); + $exclusionFilter = 'exclusionFilter-1414044954'; + $exclusion->setFilter($exclusionFilter); + try { + $gapicClient->createExclusion($formattedParent, $exclusion); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createLinkTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createLinkTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $expectedResponse = new Link(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createLinkTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + $link = new Link(); + $linkId = 'linkId177080192'; + $response = $gapicClient->createLink($formattedParent, $link, $linkId); + $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.logging.v2.ConfigServiceV2/CreateLink', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getLink(); + $this->assertProtobufEquals($link, $actualValue); + $actualValue = $actualApiRequestObject->getLinkId(); + $this->assertProtobufEquals($linkId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createLinkTest'); + $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 createLinkExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createLinkTest'); + $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->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + $link = new Link(); + $linkId = 'linkId177080192'; + $response = $gapicClient->createLink($formattedParent, $link, $linkId); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createLinkTest'); + 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 createSinkTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $destination = 'destination-1429847026'; + $filter = 'filter-1274492040'; + $description = 'description-1724546052'; + $disabled = true; + $writerIdentity = 'writerIdentity775638794'; + $includeChildren = true; + $expectedResponse = new LogSink(); + $expectedResponse->setName($name); + $expectedResponse->setDestination($destination); + $expectedResponse->setFilter($filter); + $expectedResponse->setDescription($description); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setWriterIdentity($writerIdentity); + $expectedResponse->setIncludeChildren($includeChildren); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $sink = new LogSink(); + $sinkName = 'sinkName508775358'; + $sink->setName($sinkName); + $sinkDestination = 'sinkDestination-1018870917'; + $sink->setDestination($sinkDestination); + $response = $gapicClient->createSink($formattedParent, $sink); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/CreateSink', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getSink(); + $this->assertProtobufEquals($sink, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createSinkExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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]'); + $sink = new LogSink(); + $sinkName = 'sinkName508775358'; + $sink->setName($sinkName); + $sinkDestination = 'sinkDestination-1018870917'; + $sink->setDestination($sinkDestination); + try { + $gapicClient->createSink($formattedParent, $sink); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createViewTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $filter = 'filter-1274492040'; + $expectedResponse = new LogView(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setFilter($filter); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $viewId = 'viewId454228213'; + $view = new LogView(); + $response = $gapicClient->createView($parent, $viewId, $view); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/CreateView', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getViewId(); + $this->assertProtobufEquals($viewId, $actualValue); + $actualValue = $actualRequestObject->getView(); + $this->assertProtobufEquals($view, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createViewExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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'; + $viewId = 'viewId454228213'; + $view = new LogView(); + try { + $gapicClient->createView($parent, $viewId, $view); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteBucketTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + $gapicClient->deleteBucket($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/DeleteBucket', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteBucketExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + try { + $gapicClient->deleteBucket($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 deleteExclusionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->logExclusionName('[PROJECT]', '[EXCLUSION]'); + $gapicClient->deleteExclusion($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/DeleteExclusion', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteExclusionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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->logExclusionName('[PROJECT]', '[EXCLUSION]'); + try { + $gapicClient->deleteExclusion($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 deleteLinkTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteLinkTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteLinkTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->linkName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[LINK]'); + $response = $gapicClient->deleteLink($formattedName); + $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.logging.v2.ConfigServiceV2/DeleteLink', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteLinkTest'); + $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 deleteLinkExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteLinkTest'); + $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->linkName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[LINK]'); + $response = $gapicClient->deleteLink($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteLinkTest'); + 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 deleteSinkTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedSinkName = $gapicClient->logSinkName('[PROJECT]', '[SINK]'); + $gapicClient->deleteSink($formattedSinkName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/DeleteSink', $actualFuncCall); + $actualValue = $actualRequestObject->getSinkName(); + $this->assertProtobufEquals($formattedSinkName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteSinkExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedSinkName = $gapicClient->logSinkName('[PROJECT]', '[SINK]'); + try { + $gapicClient->deleteSink($formattedSinkName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteViewTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->logViewName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[VIEW]'); + $gapicClient->deleteView($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/DeleteView', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteViewExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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->logViewName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[VIEW]'); + try { + $gapicClient->deleteView($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 getBucketTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $retentionDays = 1544391896; + $locked = true; + $analyticsEnabled = true; + $expectedResponse = new LogBucket(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setRetentionDays($retentionDays); + $expectedResponse->setLocked($locked); + $expectedResponse->setAnalyticsEnabled($analyticsEnabled); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + $response = $gapicClient->getBucket($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/GetBucket', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBucketExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + try { + $gapicClient->getBucket($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 getCmekSettingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $kmsKeyName = 'kmsKeyName2094986649'; + $kmsKeyVersionName = 'kmsKeyVersionName-1734350176'; + $serviceAccountId = 'serviceAccountId-111486921'; + $expectedResponse = new CmekSettings(); + $expectedResponse->setName($name2); + $expectedResponse->setKmsKeyName($kmsKeyName); + $expectedResponse->setKmsKeyVersionName($kmsKeyVersionName); + $expectedResponse->setServiceAccountId($serviceAccountId); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getCmekSettings(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/GetCmekSettings', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getCmekSettingsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getCmekSettings(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getExclusionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $filter = 'filter-1274492040'; + $disabled = true; + $expectedResponse = new LogExclusion(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setFilter($filter); + $expectedResponse->setDisabled($disabled); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->logExclusionName('[PROJECT]', '[EXCLUSION]'); + $response = $gapicClient->getExclusion($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/GetExclusion', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getExclusionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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->logExclusionName('[PROJECT]', '[EXCLUSION]'); + try { + $gapicClient->getExclusion($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 getLinkTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $expectedResponse = new Link(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->linkName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[LINK]'); + $response = $gapicClient->getLink($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/GetLink', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLinkExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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->linkName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[LINK]'); + try { + $gapicClient->getLink($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 getSettingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $kmsKeyName = 'kmsKeyName2094986649'; + $kmsServiceAccountId = 'kmsServiceAccountId-263326747'; + $storageLocation = 'storageLocation-612882183'; + $disableDefaultSink = true; + $expectedResponse = new Settings(); + $expectedResponse->setName($name2); + $expectedResponse->setKmsKeyName($kmsKeyName); + $expectedResponse->setKmsServiceAccountId($kmsServiceAccountId); + $expectedResponse->setStorageLocation($storageLocation); + $expectedResponse->setDisableDefaultSink($disableDefaultSink); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->settingsName('[PROJECT]'); + $response = $gapicClient->getSettings($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/GetSettings', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSettingsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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->settingsName('[PROJECT]'); + try { + $gapicClient->getSettings($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 getSinkTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $destination = 'destination-1429847026'; + $filter = 'filter-1274492040'; + $description = 'description-1724546052'; + $disabled = true; + $writerIdentity = 'writerIdentity775638794'; + $includeChildren = true; + $expectedResponse = new LogSink(); + $expectedResponse->setName($name); + $expectedResponse->setDestination($destination); + $expectedResponse->setFilter($filter); + $expectedResponse->setDescription($description); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setWriterIdentity($writerIdentity); + $expectedResponse->setIncludeChildren($includeChildren); + $transport->addResponse($expectedResponse); + // Mock request + $formattedSinkName = $gapicClient->logSinkName('[PROJECT]', '[SINK]'); + $response = $gapicClient->getSink($formattedSinkName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/GetSink', $actualFuncCall); + $actualValue = $actualRequestObject->getSinkName(); + $this->assertProtobufEquals($formattedSinkName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSinkExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedSinkName = $gapicClient->logSinkName('[PROJECT]', '[SINK]'); + try { + $gapicClient->getSink($formattedSinkName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getViewTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $filter = 'filter-1274492040'; + $expectedResponse = new LogView(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setFilter($filter); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->logViewName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[VIEW]'); + $response = $gapicClient->getView($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/GetView', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getViewExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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->logViewName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[VIEW]'); + try { + $gapicClient->getView($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 listBucketsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $bucketsElement = new LogBucket(); + $buckets = [ + $bucketsElement, + ]; + $expectedResponse = new ListBucketsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setBuckets($buckets); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $response = $gapicClient->listBuckets($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getBuckets()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/ListBuckets', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBucketsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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]'); + try { + $gapicClient->listBuckets($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 listExclusionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $exclusionsElement = new LogExclusion(); + $exclusions = [ + $exclusionsElement, + ]; + $expectedResponse = new ListExclusionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setExclusions($exclusions); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $response = $gapicClient->listExclusions($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getExclusions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/ListExclusions', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listExclusionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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->listExclusions($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 listLinksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $linksElement = new Link(); + $links = [ + $linksElement, + ]; + $expectedResponse = new ListLinksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLinks($links); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + $response = $gapicClient->listLinks($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLinks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/ListLinks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLinksExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + try { + $gapicClient->listLinks($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 listSinksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $sinksElement = new LogSink(); + $sinks = [ + $sinksElement, + ]; + $expectedResponse = new ListSinksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSinks($sinks); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $response = $gapicClient->listSinks($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSinks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/ListSinks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSinksExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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->listSinks($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 listViewsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $viewsElement = new LogView(); + $views = [ + $viewsElement, + ]; + $expectedResponse = new ListViewsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setViews($views); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $response = $gapicClient->listViews($parent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getViews()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/ListViews', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listViewsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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'; + try { + $gapicClient->listViews($parent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function undeleteBucketTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + $gapicClient->undeleteBucket($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/UndeleteBucket', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function undeleteBucketExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + try { + $gapicClient->undeleteBucket($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 updateBucketTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $retentionDays = 1544391896; + $locked = true; + $analyticsEnabled = true; + $expectedResponse = new LogBucket(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setRetentionDays($retentionDays); + $expectedResponse->setLocked($locked); + $expectedResponse->setAnalyticsEnabled($analyticsEnabled); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + $bucket = new LogBucket(); + $updateMask = new FieldMask(); + $response = $gapicClient->updateBucket($formattedName, $bucket, $updateMask); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/UpdateBucket', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getBucket(); + $this->assertProtobufEquals($bucket, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateBucketExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + $bucket = new LogBucket(); + $updateMask = new FieldMask(); + try { + $gapicClient->updateBucket($formattedName, $bucket, $updateMask); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateBucketAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateBucketAsyncTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $retentionDays = 1544391896; + $locked = true; + $analyticsEnabled = true; + $expectedResponse = new LogBucket(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setRetentionDays($retentionDays); + $expectedResponse->setLocked($locked); + $expectedResponse->setAnalyticsEnabled($analyticsEnabled); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateBucketAsyncTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + $bucket = new LogBucket(); + $updateMask = new FieldMask(); + $response = $gapicClient->updateBucketAsync($formattedName, $bucket, $updateMask); + $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.logging.v2.ConfigServiceV2/UpdateBucketAsync', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getBucket(); + $this->assertProtobufEquals($bucket, $actualValue); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateBucketAsyncTest'); + $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 updateBucketAsyncExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateBucketAsyncTest'); + $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->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + $bucket = new LogBucket(); + $updateMask = new FieldMask(); + $response = $gapicClient->updateBucketAsync($formattedName, $bucket, $updateMask); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateBucketAsyncTest'); + 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 updateCmekSettingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $kmsKeyName = 'kmsKeyName2094986649'; + $kmsKeyVersionName = 'kmsKeyVersionName-1734350176'; + $serviceAccountId = 'serviceAccountId-111486921'; + $expectedResponse = new CmekSettings(); + $expectedResponse->setName($name2); + $expectedResponse->setKmsKeyName($kmsKeyName); + $expectedResponse->setKmsKeyVersionName($kmsKeyVersionName); + $expectedResponse->setServiceAccountId($serviceAccountId); + $transport->addResponse($expectedResponse); + $response = $gapicClient->updateCmekSettings(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/UpdateCmekSettings', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateCmekSettingsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->updateCmekSettings(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateExclusionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $filter = 'filter-1274492040'; + $disabled = true; + $expectedResponse = new LogExclusion(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setFilter($filter); + $expectedResponse->setDisabled($disabled); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->logExclusionName('[PROJECT]', '[EXCLUSION]'); + $exclusion = new LogExclusion(); + $exclusionName = 'exclusionName1004344697'; + $exclusion->setName($exclusionName); + $exclusionFilter = 'exclusionFilter-1414044954'; + $exclusion->setFilter($exclusionFilter); + $updateMask = new FieldMask(); + $response = $gapicClient->updateExclusion($formattedName, $exclusion, $updateMask); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/UpdateExclusion', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getExclusion(); + $this->assertProtobufEquals($exclusion, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateExclusionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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->logExclusionName('[PROJECT]', '[EXCLUSION]'); + $exclusion = new LogExclusion(); + $exclusionName = 'exclusionName1004344697'; + $exclusion->setName($exclusionName); + $exclusionFilter = 'exclusionFilter-1414044954'; + $exclusion->setFilter($exclusionFilter); + $updateMask = new FieldMask(); + try { + $gapicClient->updateExclusion($formattedName, $exclusion, $updateMask); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateSettingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $kmsKeyName = 'kmsKeyName2094986649'; + $kmsServiceAccountId = 'kmsServiceAccountId-263326747'; + $storageLocation = 'storageLocation-612882183'; + $disableDefaultSink = true; + $expectedResponse = new Settings(); + $expectedResponse->setName($name2); + $expectedResponse->setKmsKeyName($kmsKeyName); + $expectedResponse->setKmsServiceAccountId($kmsServiceAccountId); + $expectedResponse->setStorageLocation($storageLocation); + $expectedResponse->setDisableDefaultSink($disableDefaultSink); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $settings = new Settings(); + $response = $gapicClient->updateSettings($name, $settings); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/UpdateSettings', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getSettings(); + $this->assertProtobufEquals($settings, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateSettingsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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'; + $settings = new Settings(); + try { + $gapicClient->updateSettings($name, $settings); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateSinkTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $destination = 'destination-1429847026'; + $filter = 'filter-1274492040'; + $description = 'description-1724546052'; + $disabled = true; + $writerIdentity = 'writerIdentity775638794'; + $includeChildren = true; + $expectedResponse = new LogSink(); + $expectedResponse->setName($name); + $expectedResponse->setDestination($destination); + $expectedResponse->setFilter($filter); + $expectedResponse->setDescription($description); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setWriterIdentity($writerIdentity); + $expectedResponse->setIncludeChildren($includeChildren); + $transport->addResponse($expectedResponse); + // Mock request + $formattedSinkName = $gapicClient->logSinkName('[PROJECT]', '[SINK]'); + $sink = new LogSink(); + $sinkName = 'sinkName508775358'; + $sink->setName($sinkName); + $sinkDestination = 'sinkDestination-1018870917'; + $sink->setDestination($sinkDestination); + $response = $gapicClient->updateSink($formattedSinkName, $sink); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/UpdateSink', $actualFuncCall); + $actualValue = $actualRequestObject->getSinkName(); + $this->assertProtobufEquals($formattedSinkName, $actualValue); + $actualValue = $actualRequestObject->getSink(); + $this->assertProtobufEquals($sink, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateSinkExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedSinkName = $gapicClient->logSinkName('[PROJECT]', '[SINK]'); + $sink = new LogSink(); + $sinkName = 'sinkName508775358'; + $sink->setName($sinkName); + $sinkDestination = 'sinkDestination-1018870917'; + $sink->setDestination($sinkDestination); + try { + $gapicClient->updateSink($formattedSinkName, $sink); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateViewTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $filter = 'filter-1274492040'; + $expectedResponse = new LogView(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setFilter($filter); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $view = new LogView(); + $response = $gapicClient->updateView($name, $view); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/UpdateView', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getView(); + $this->assertProtobufEquals($view, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateViewExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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'; + $view = new LogView(); + try { + $gapicClient->updateView($name, $view); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->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/Logging/v2/tests/Unit/V2/LoggingServiceV2ClientTest.php b/owl-bot-staging/Logging/v2/tests/Unit/V2/LoggingServiceV2ClientTest.php new file mode 100644 index 000000000000..5e311530b0d1 --- /dev/null +++ b/owl-bot-staging/Logging/v2/tests/Unit/V2/LoggingServiceV2ClientTest.php @@ -0,0 +1,481 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return LoggingServiceV2Client */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new LoggingServiceV2Client($options); + } + + /** @test */ + public function deleteLogTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedLogName = $gapicClient->logName('[PROJECT]', '[LOG]'); + $gapicClient->deleteLog($formattedLogName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.LoggingServiceV2/DeleteLog', $actualFuncCall); + $actualValue = $actualRequestObject->getLogName(); + $this->assertProtobufEquals($formattedLogName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteLogExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedLogName = $gapicClient->logName('[PROJECT]', '[LOG]'); + try { + $gapicClient->deleteLog($formattedLogName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLogEntriesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $entriesElement = new LogEntry(); + $entries = [ + $entriesElement, + ]; + $expectedResponse = new ListLogEntriesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setEntries($entries); + $transport->addResponse($expectedResponse); + // Mock request + $formattedResourceNames = [ + $gapicClient->projectName('[PROJECT]'), + ]; + $response = $gapicClient->listLogEntries($formattedResourceNames); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getEntries()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.LoggingServiceV2/ListLogEntries', $actualFuncCall); + $actualValue = $actualRequestObject->getResourceNames(); + $this->assertProtobufEquals($formattedResourceNames, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLogEntriesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedResourceNames = [ + $gapicClient->projectName('[PROJECT]'), + ]; + try { + $gapicClient->listLogEntries($formattedResourceNames); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLogsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $logNamesElement = 'logNamesElement-1079688374'; + $logNames = [ + $logNamesElement, + ]; + $expectedResponse = new ListLogsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLogNames($logNames); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $response = $gapicClient->listLogs($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLogNames()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.LoggingServiceV2/ListLogs', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLogsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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->listLogs($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 listMonitoredResourceDescriptorsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $resourceDescriptorsElement = new MonitoredResourceDescriptor(); + $resourceDescriptors = [ + $resourceDescriptorsElement, + ]; + $expectedResponse = new ListMonitoredResourceDescriptorsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setResourceDescriptors($resourceDescriptors); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listMonitoredResourceDescriptors(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getResourceDescriptors()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.LoggingServiceV2/ListMonitoredResourceDescriptors', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listMonitoredResourceDescriptorsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listMonitoredResourceDescriptors(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function tailLogEntriesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TailLogEntriesResponse(); + $transport->addResponse($expectedResponse); + $expectedResponse2 = new TailLogEntriesResponse(); + $transport->addResponse($expectedResponse2); + $expectedResponse3 = new TailLogEntriesResponse(); + $transport->addResponse($expectedResponse3); + // Mock request + $resourceNames = []; + $request = new TailLogEntriesRequest(); + $request->setResourceNames($resourceNames); + $resourceNames2 = []; + $request2 = new TailLogEntriesRequest(); + $request2->setResourceNames($resourceNames2); + $resourceNames3 = []; + $request3 = new TailLogEntriesRequest(); + $request3->setResourceNames($resourceNames3); + $bidi = $gapicClient->tailLogEntries(); + $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.logging.v2.LoggingServiceV2/TailLogEntries', $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 tailLogEntriesExceptionTest() + { + $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->tailLogEntries(); + $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 writeLogEntriesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new WriteLogEntriesResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $entries = []; + $response = $gapicClient->writeLogEntries($entries); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.LoggingServiceV2/WriteLogEntries', $actualFuncCall); + $actualValue = $actualRequestObject->getEntries(); + $this->assertProtobufEquals($entries, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function writeLogEntriesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $entries = []; + try { + $gapicClient->writeLogEntries($entries); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->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/Logging/v2/tests/Unit/V2/MetricsServiceV2ClientTest.php b/owl-bot-staging/Logging/v2/tests/Unit/V2/MetricsServiceV2ClientTest.php new file mode 100644 index 000000000000..30ef70a229b4 --- /dev/null +++ b/owl-bot-staging/Logging/v2/tests/Unit/V2/MetricsServiceV2ClientTest.php @@ -0,0 +1,422 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return MetricsServiceV2Client */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new MetricsServiceV2Client($options); + } + + /** @test */ + public function createLogMetricTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $filter = 'filter-1274492040'; + $bucketName = 'bucketName283610048'; + $disabled = true; + $valueExtractor = 'valueExtractor2047672534'; + $expectedResponse = new LogMetric(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setFilter($filter); + $expectedResponse->setBucketName($bucketName); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setValueExtractor($valueExtractor); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $metric = new LogMetric(); + $metricName = 'metricName-610759589'; + $metric->setName($metricName); + $metricFilter = 'metricFilter1248897352'; + $metric->setFilter($metricFilter); + $response = $gapicClient->createLogMetric($formattedParent, $metric); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.MetricsServiceV2/CreateLogMetric', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getMetric(); + $this->assertProtobufEquals($metric, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createLogMetricExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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]'); + $metric = new LogMetric(); + $metricName = 'metricName-610759589'; + $metric->setName($metricName); + $metricFilter = 'metricFilter1248897352'; + $metric->setFilter($metricFilter); + try { + $gapicClient->createLogMetric($formattedParent, $metric); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteLogMetricTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedMetricName = $gapicClient->logMetricName('[PROJECT]', '[METRIC]'); + $gapicClient->deleteLogMetric($formattedMetricName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.MetricsServiceV2/DeleteLogMetric', $actualFuncCall); + $actualValue = $actualRequestObject->getMetricName(); + $this->assertProtobufEquals($formattedMetricName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteLogMetricExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedMetricName = $gapicClient->logMetricName('[PROJECT]', '[METRIC]'); + try { + $gapicClient->deleteLogMetric($formattedMetricName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLogMetricTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $filter = 'filter-1274492040'; + $bucketName = 'bucketName283610048'; + $disabled = true; + $valueExtractor = 'valueExtractor2047672534'; + $expectedResponse = new LogMetric(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setFilter($filter); + $expectedResponse->setBucketName($bucketName); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setValueExtractor($valueExtractor); + $transport->addResponse($expectedResponse); + // Mock request + $formattedMetricName = $gapicClient->logMetricName('[PROJECT]', '[METRIC]'); + $response = $gapicClient->getLogMetric($formattedMetricName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.MetricsServiceV2/GetLogMetric', $actualFuncCall); + $actualValue = $actualRequestObject->getMetricName(); + $this->assertProtobufEquals($formattedMetricName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLogMetricExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedMetricName = $gapicClient->logMetricName('[PROJECT]', '[METRIC]'); + try { + $gapicClient->getLogMetric($formattedMetricName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLogMetricsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $metricsElement = new LogMetric(); + $metrics = [ + $metricsElement, + ]; + $expectedResponse = new ListLogMetricsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setMetrics($metrics); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $response = $gapicClient->listLogMetrics($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getMetrics()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.MetricsServiceV2/ListLogMetrics', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLogMetricsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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->listLogMetrics($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 updateLogMetricTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $filter = 'filter-1274492040'; + $bucketName = 'bucketName283610048'; + $disabled = true; + $valueExtractor = 'valueExtractor2047672534'; + $expectedResponse = new LogMetric(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setFilter($filter); + $expectedResponse->setBucketName($bucketName); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setValueExtractor($valueExtractor); + $transport->addResponse($expectedResponse); + // Mock request + $formattedMetricName = $gapicClient->logMetricName('[PROJECT]', '[METRIC]'); + $metric = new LogMetric(); + $metricName = 'metricName-610759589'; + $metric->setName($metricName); + $metricFilter = 'metricFilter1248897352'; + $metric->setFilter($metricFilter); + $response = $gapicClient->updateLogMetric($formattedMetricName, $metric); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.MetricsServiceV2/UpdateLogMetric', $actualFuncCall); + $actualValue = $actualRequestObject->getMetricName(); + $this->assertProtobufEquals($formattedMetricName, $actualValue); + $actualValue = $actualRequestObject->getMetric(); + $this->assertProtobufEquals($metric, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateLogMetricExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedMetricName = $gapicClient->logMetricName('[PROJECT]', '[METRIC]'); + $metric = new LogMetric(); + $metricName = 'metricName-610759589'; + $metric->setName($metricName); + $metricFilter = 'metricFilter1248897352'; + $metric->setFilter($metricFilter); + try { + $gapicClient->updateLogMetric($formattedMetricName, $metric); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} From dc0e260e5f3d18362a02d29fafe0f90fd3d79f18 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Sat, 6 May 2023 04:04:04 +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 --- Logging/metadata/V2/Logging.php | Bin 4954 -> 5213 bytes Logging/metadata/V2/LoggingConfig.php | Bin 17907 -> 22653 bytes Logging/metadata/V2/LoggingMetrics.php | Bin 3905 -> 3931 bytes .../ConfigServiceV2Client/create_bucket.php | 6 +- .../create_bucket_async.php | 0 .../create_exclusion.php | 8 +- .../V2/ConfigServiceV2Client/create_link.php | 0 .../V2/ConfigServiceV2Client/create_view.php | 4 +- .../V2/ConfigServiceV2Client/delete_link.php | 0 .../V2/ConfigServiceV2Client/delete_sink.php | 4 +- .../V2/ConfigServiceV2Client/get_link.php | 0 .../V2/ConfigServiceV2Client/list_links.php | 0 .../ConfigServiceV2Client/update_bucket.php | 6 +- .../update_bucket_async.php | 0 .../update_exclusion.php | 8 +- .../V2/ConfigServiceV2Client/update_sink.php | 4 +- .../list_log_entries.php | 3 +- .../V2/LoggingServiceV2Client/list_logs.php | 2 +- .../src}/V2/BigQueryDataset.php | 2 +- Logging/src/V2/BigQueryOptions.php | 16 +- .../src}/V2/BucketMetadata.php | 6 +- Logging/src/V2/CmekSettings.php | 90 +- Logging/src/V2/ConfigServiceV2GrpcClient.php | 106 +- Logging/src/V2/CopyLogEntriesRequest.php | 16 +- Logging/src/V2/CreateBucketRequest.php | 48 +- .../src}/V2/CreateLinkRequest.php | 6 +- Logging/src/V2/CreateSinkRequest.php | 12 +- Logging/src/V2/CreateViewRequest.php | 16 +- .../src}/V2/DeleteLinkRequest.php | 2 +- Logging/src/V2/DeleteSinkRequest.php | 16 +- .../V2/Gapic/ConfigServiceV2GapicClient.php | 673 ++- .../V2/Gapic/LoggingServiceV2GapicClient.php | 55 +- .../src}/V2/GetLinkRequest.php | 2 +- .../src}/V2/IndexConfig.php | 6 +- .../Logging => Logging/src}/V2/IndexType.php | 0 Logging/src/V2/LifecycleState.php | 23 + .../Cloud/Logging => Logging/src}/V2/Link.php | 10 +- .../src}/V2/LinkMetadata.php | 6 +- Logging/src/V2/ListBucketsRequest.php | 56 +- .../src}/V2/ListLinksRequest.php | 6 +- .../src}/V2/ListLinksResponse.php | 2 +- Logging/src/V2/ListLogEntriesRequest.php | 76 +- Logging/src/V2/ListLogsRequest.php | 150 +- Logging/src/V2/ListViewsRequest.php | 32 +- .../src}/V2/LocationMetadata.php | 2 +- Logging/src/V2/LogBucket.php | 88 +- Logging/src/V2/LogEntry.php | 296 +- Logging/src/V2/LogExclusion.php | 32 +- Logging/src/V2/LogMetric.php | 70 +- Logging/src/V2/LogSink.php | 120 +- Logging/src/V2/Settings.php | 64 +- Logging/src/V2/TailLogEntriesRequest.php | 48 +- Logging/src/V2/UpdateBucketRequest.php | 24 +- Logging/src/V2/UpdateExclusionRequest.php | 52 +- Logging/src/V2/UpdateSinkRequest.php | 32 +- Logging/src/V2/WriteLogEntriesRequest.php | 48 +- Logging/src/V2/gapic_metadata.json | 30 + .../config_service_v2_client_config.json | 30 + .../config_service_v2_descriptor_config.php | 50 + .../config_service_v2_rest_client_config.php | 210 +- .../logging_service_v2_rest_client_config.php | 18 +- .../metrics_service_v2_rest_client_config.php | 2 +- .../Unit/V2/ConfigServiceV2ClientTest.php | 670 ++- .../Unit/V2/MetricsServiceV2ClientTest.php | 6 + .../Google/Logging/V2/LogEntry.php | Bin 2774 -> 0 bytes .../GPBMetadata/Google/Logging/V2/Logging.php | Bin 5213 -> 0 bytes .../Google/Logging/V2/LoggingConfig.php | Bin 22653 -> 0 bytes .../Google/Logging/V2/LoggingMetrics.php | Bin 3931 -> 0 bytes .../Cloud/Logging/V2/BigQueryOptions.php | 149 - .../Google/Cloud/Logging/V2/CmekSettings.php | 320 -- .../Logging/V2/ConfigServiceV2GrpcClient.php | 602 --- .../Logging/V2/CopyLogEntriesMetadata.php | 317 -- .../Logging/V2/CopyLogEntriesRequest.php | 147 - .../Logging/V2/CopyLogEntriesResponse.php | 67 - .../Cloud/Logging/V2/CreateBucketRequest.php | 173 - .../Logging/V2/CreateExclusionRequest.php | 143 - .../Logging/V2/CreateLogMetricRequest.php | 123 - .../Cloud/Logging/V2/CreateSinkRequest.php | 217 - .../Cloud/Logging/V2/CreateViewRequest.php | 165 - .../Cloud/Logging/V2/DeleteBucketRequest.php | 91 - .../Logging/V2/DeleteExclusionRequest.php | 91 - .../Logging/V2/DeleteLogMetricRequest.php | 71 - .../Cloud/Logging/V2/DeleteLogRequest.php | 103 - .../Cloud/Logging/V2/DeleteSinkRequest.php | 95 - .../Cloud/Logging/V2/DeleteViewRequest.php | 79 - .../Cloud/Logging/V2/GetBucketRequest.php | 91 - .../Logging/V2/GetCmekSettingsRequest.php | 111 - .../Cloud/Logging/V2/GetExclusionRequest.php | 91 - .../Cloud/Logging/V2/GetLogMetricRequest.php | 71 - .../Cloud/Logging/V2/GetSettingsRequest.php | 111 - .../Cloud/Logging/V2/GetSinkRequest.php | 91 - .../Cloud/Logging/V2/GetViewRequest.php | 79 - .../Cloud/Logging/V2/LifecycleState.php | 86 - .../Cloud/Logging/V2/ListBucketsRequest.php | 183 - .../Cloud/Logging/V2/ListBucketsResponse.php | 109 - .../Logging/V2/ListExclusionsRequest.php | 171 - .../Logging/V2/ListExclusionsResponse.php | 109 - .../Logging/V2/ListLogEntriesRequest.php | 311 -- .../Logging/V2/ListLogEntriesResponse.php | 141 - .../Logging/V2/ListLogMetricsRequest.php | 159 - .../Logging/V2/ListLogMetricsResponse.php | 109 - .../Cloud/Logging/V2/ListLogsRequest.php | 245 -- .../Cloud/Logging/V2/ListLogsResponse.php | 117 - ...istMonitoredResourceDescriptorsRequest.php | 121 - ...stMonitoredResourceDescriptorsResponse.php | 109 - .../Cloud/Logging/V2/ListSinksRequest.php | 171 - .../Cloud/Logging/V2/ListSinksResponse.php | 109 - .../Cloud/Logging/V2/ListViewsRequest.php | 159 - .../Cloud/Logging/V2/ListViewsResponse.php | 109 - .../src/Google/Cloud/Logging/V2/LogBucket.php | 525 --- .../src/Google/Cloud/Logging/V2/LogEntry.php | 1061 ----- .../Cloud/Logging/V2/LogEntryOperation.php | 182 - .../Logging/V2/LogEntrySourceLocation.php | 164 - .../Google/Cloud/Logging/V2/LogExclusion.php | 321 -- .../src/Google/Cloud/Logging/V2/LogMetric.php | 767 ---- .../Cloud/Logging/V2/LogMetric/ApiVersion.php | 57 - .../Cloud/Logging/V2/LogMetric_ApiVersion.php | 16 - .../src/Google/Cloud/Logging/V2/LogSink.php | 686 --- .../Logging/V2/LogSink/VersionFormat.php | 64 - .../Logging/V2/LogSink_VersionFormat.php | 16 - .../src/Google/Cloud/Logging/V2/LogSplit.php | 153 - .../src/Google/Cloud/Logging/V2/LogView.php | 267 -- .../Logging/V2/LoggingServiceV2GrpcClient.php | 136 - .../Logging/V2/MetricsServiceV2GrpcClient.php | 110 - .../Cloud/Logging/V2/OperationState.php | 93 - .../src/Google/Cloud/Logging/V2/Settings.php | 324 -- .../Logging/V2/TailLogEntriesRequest.php | 209 - .../Logging/V2/TailLogEntriesResponse.php | 125 - .../SuppressionInfo.php | 104 - .../SuppressionInfo/Reason.php | 68 - ...TailLogEntriesResponse_SuppressionInfo.php | 16 - ...EntriesResponse_SuppressionInfo_Reason.php | 16 - .../Logging/V2/UndeleteBucketRequest.php | 91 - .../Cloud/Logging/V2/UpdateBucketRequest.php | 199 - .../Logging/V2/UpdateCmekSettingsRequest.php | 223 - .../Logging/V2/UpdateExclusionRequest.php | 207 - .../Logging/V2/UpdateLogMetricRequest.php | 127 - .../Logging/V2/UpdateSettingsRequest.php | 211 - .../Cloud/Logging/V2/UpdateSinkRequest.php | 297 -- .../Cloud/Logging/V2/UpdateViewRequest.php | 187 - .../V2/WriteLogEntriesPartialErrors.php | 83 - .../Logging/V2/WriteLogEntriesRequest.php | 439 -- .../Logging/V2/WriteLogEntriesResponse.php | 33 - .../copy_log_entries.php | 83 - .../ConfigServiceV2Client/create_bucket.php | 80 - .../create_exclusion.php | 102 - .../V2/ConfigServiceV2Client/create_sink.php | 106 - .../V2/ConfigServiceV2Client/create_view.php | 79 - .../ConfigServiceV2Client/delete_bucket.php | 77 - .../delete_exclusion.php | 73 - .../V2/ConfigServiceV2Client/delete_sink.php | 75 - .../V2/ConfigServiceV2Client/delete_view.php | 78 - .../V2/ConfigServiceV2Client/get_bucket.php | 75 - .../get_cmek_settings.php | 62 - .../ConfigServiceV2Client/get_exclusion.php | 75 - .../V2/ConfigServiceV2Client/get_settings.php | 89 - .../V2/ConfigServiceV2Client/get_sink.php | 75 - .../V2/ConfigServiceV2Client/get_view.php | 77 - .../V2/ConfigServiceV2Client/list_buckets.php | 80 - .../ConfigServiceV2Client/list_exclusions.php | 76 - .../V2/ConfigServiceV2Client/list_sinks.php | 76 - .../V2/ConfigServiceV2Client/list_views.php | 72 - .../ConfigServiceV2Client/undelete_bucket.php | 74 - .../ConfigServiceV2Client/update_bucket.php | 85 - .../update_cmek_settings.php | 67 - .../update_exclusion.php | 102 - .../ConfigServiceV2Client/update_settings.php | 93 - .../V2/ConfigServiceV2Client/update_sink.php | 107 - .../V2/ConfigServiceV2Client/update_view.php | 78 - .../V2/LoggingServiceV2Client/delete_log.php | 79 - .../list_log_entries.php | 93 - .../V2/LoggingServiceV2Client/list_logs.php | 76 - .../list_monitored_resource_descriptors.php | 58 - .../tail_log_entries.php | 90 - .../write_log_entries.php | 102 - .../create_log_metric.php | 100 - .../delete_log_metric.php | 66 - .../MetricsServiceV2Client/get_log_metric.php | 68 - .../list_log_metrics.php | 73 - .../update_log_metric.php | 102 - .../v2/src/V2/ConfigServiceV2Client.php | 34 - .../V2/Gapic/ConfigServiceV2GapicClient.php | 3686 ----------------- .../V2/Gapic/LoggingServiceV2GapicClient.php | 993 ----- .../V2/Gapic/MetricsServiceV2GapicClient.php | 525 --- .../v2/src/V2/LoggingServiceV2Client.php | 34 - .../v2/src/V2/MetricsServiceV2Client.php | 34 - .../Logging/v2/src/V2/gapic_metadata.json | 251 -- .../config_service_v2_client_config.json | 206 - .../config_service_v2_descriptor_config.php | 108 - .../config_service_v2_rest_client_config.php | 1147 ----- .../logging_service_v2_client_config.json | 83 - .../logging_service_v2_descriptor_config.php | 43 - .../logging_service_v2_rest_client_config.php | 191 - .../metrics_service_v2_client_config.json | 71 - .../metrics_service_v2_descriptor_config.php | 18 - .../metrics_service_v2_rest_client_config.php | 160 - .../Unit/V2/ConfigServiceV2ClientTest.php | 2555 ------------ .../Unit/V2/LoggingServiceV2ClientTest.php | 481 --- .../Unit/V2/MetricsServiceV2ClientTest.php | 422 -- 199 files changed, 2717 insertions(+), 28411 deletions(-) rename {owl-bot-staging/Logging/v2 => Logging}/samples/V2/ConfigServiceV2Client/create_bucket_async.php (100%) rename {owl-bot-staging/Logging/v2 => Logging}/samples/V2/ConfigServiceV2Client/create_link.php (100%) rename {owl-bot-staging/Logging/v2 => Logging}/samples/V2/ConfigServiceV2Client/delete_link.php (100%) rename {owl-bot-staging/Logging/v2 => Logging}/samples/V2/ConfigServiceV2Client/get_link.php (100%) rename {owl-bot-staging/Logging/v2 => Logging}/samples/V2/ConfigServiceV2Client/list_links.php (100%) rename {owl-bot-staging/Logging/v2 => Logging}/samples/V2/ConfigServiceV2Client/update_bucket_async.php (100%) rename {owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging => Logging/src}/V2/BigQueryDataset.php (98%) rename {owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging => Logging/src}/V2/BucketMetadata.php (98%) rename {owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging => Logging/src}/V2/CreateLinkRequest.php (98%) rename {owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging => Logging/src}/V2/DeleteLinkRequest.php (99%) rename {owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging => Logging/src}/V2/GetLinkRequest.php (99%) rename {owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging => Logging/src}/V2/IndexConfig.php (98%) rename {owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging => Logging/src}/V2/IndexType.php (100%) rename {owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging => Logging/src}/V2/Link.php (98%) rename {owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging => Logging/src}/V2/LinkMetadata.php (98%) rename {owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging => Logging/src}/V2/ListLinksRequest.php (98%) rename {owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging => Logging/src}/V2/ListLinksResponse.php (98%) rename {owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging => Logging/src}/V2/LocationMetadata.php (97%) delete mode 100644 owl-bot-staging/Logging/v2/proto/src/GPBMetadata/Google/Logging/V2/LogEntry.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/GPBMetadata/Google/Logging/V2/Logging.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/GPBMetadata/Google/Logging/V2/LoggingConfig.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/GPBMetadata/Google/Logging/V2/LoggingMetrics.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/BigQueryOptions.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CmekSettings.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ConfigServiceV2GrpcClient.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesMetadata.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesResponse.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateBucketRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateExclusionRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateLogMetricRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateSinkRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateViewRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteBucketRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteExclusionRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLogMetricRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLogRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteSinkRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteViewRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetBucketRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetCmekSettingsRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetExclusionRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetLogMetricRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetSettingsRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetSinkRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetViewRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LifecycleState.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListBucketsRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListBucketsResponse.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListExclusionsRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListExclusionsResponse.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogEntriesRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogEntriesResponse.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogMetricsRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogMetricsResponse.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogsRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogsResponse.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListMonitoredResourceDescriptorsRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListMonitoredResourceDescriptorsResponse.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListSinksRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListSinksResponse.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListViewsRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListViewsResponse.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogBucket.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntry.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntryOperation.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntrySourceLocation.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogExclusion.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric/ApiVersion.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric_ApiVersion.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogSink.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogSink/VersionFormat.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogSink_VersionFormat.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogSplit.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogView.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LoggingServiceV2GrpcClient.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/MetricsServiceV2GrpcClient.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/OperationState.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/Settings.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse/SuppressionInfo.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse/SuppressionInfo/Reason.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse_SuppressionInfo.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse_SuppressionInfo_Reason.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UndeleteBucketRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateBucketRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateCmekSettingsRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateExclusionRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateLogMetricRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateSettingsRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateSinkRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateViewRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesPartialErrors.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesRequest.php delete mode 100644 owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesResponse.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/copy_log_entries.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_bucket.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_exclusion.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_sink.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_view.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_bucket.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_exclusion.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_sink.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_view.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_bucket.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_cmek_settings.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_exclusion.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_settings.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_sink.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_view.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_buckets.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_exclusions.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_sinks.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_views.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/undelete_bucket.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_bucket.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_cmek_settings.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_exclusion.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_settings.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_sink.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_view.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/delete_log.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_log_entries.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_logs.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_monitored_resource_descriptors.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/tail_log_entries.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/write_log_entries.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/create_log_metric.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/delete_log_metric.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/get_log_metric.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/list_log_metrics.php delete mode 100644 owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/update_log_metric.php delete mode 100644 owl-bot-staging/Logging/v2/src/V2/ConfigServiceV2Client.php delete mode 100644 owl-bot-staging/Logging/v2/src/V2/Gapic/ConfigServiceV2GapicClient.php delete mode 100644 owl-bot-staging/Logging/v2/src/V2/Gapic/LoggingServiceV2GapicClient.php delete mode 100644 owl-bot-staging/Logging/v2/src/V2/Gapic/MetricsServiceV2GapicClient.php delete mode 100644 owl-bot-staging/Logging/v2/src/V2/LoggingServiceV2Client.php delete mode 100644 owl-bot-staging/Logging/v2/src/V2/MetricsServiceV2Client.php delete mode 100644 owl-bot-staging/Logging/v2/src/V2/gapic_metadata.json delete mode 100644 owl-bot-staging/Logging/v2/src/V2/resources/config_service_v2_client_config.json delete mode 100644 owl-bot-staging/Logging/v2/src/V2/resources/config_service_v2_descriptor_config.php delete mode 100644 owl-bot-staging/Logging/v2/src/V2/resources/config_service_v2_rest_client_config.php delete mode 100644 owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_client_config.json delete mode 100644 owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_descriptor_config.php delete mode 100644 owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_rest_client_config.php delete mode 100644 owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_client_config.json delete mode 100644 owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_descriptor_config.php delete mode 100644 owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_rest_client_config.php delete mode 100644 owl-bot-staging/Logging/v2/tests/Unit/V2/ConfigServiceV2ClientTest.php delete mode 100644 owl-bot-staging/Logging/v2/tests/Unit/V2/LoggingServiceV2ClientTest.php delete mode 100644 owl-bot-staging/Logging/v2/tests/Unit/V2/MetricsServiceV2ClientTest.php diff --git a/Logging/metadata/V2/Logging.php b/Logging/metadata/V2/Logging.php index a6ecd73f16f00b59b97017cb69d8b12ee600edc5..9f6596d970d8a7f887f278e5379b55d98e5d02ee 100644 GIT binary patch delta 271 zcmcbmc2{G=d1j^q3Y#x7bFfWb!!A8pl}lmr4Nk+&u3TzNOfPvi=kmBR^L4Xuark5w zm-ytT7Yiv(F60oIe1+eHb1QSxuce=ppPX2dnV$z@CzU2=r-DVxGE>WeBDFy2^x`N-A^XWb0@4~pDYh1}oLnd% XN}OV6A;-xR1Z1W0n7nzFzy>A&!jxP? delta 82 zcmV-Y0ImPsDB32l&jSLz9<$K{2nLfC3NVwa2ON|12_UmY3MK*q<_oiJ3`GMDhyn@- oOlfm;OmAm%5+ajv2o#gl4>Sp~0fN)ylLDdvlMxW2v$heZ0*H7fK6lQnr#GZA6GtSzZKN8mYA-2J>36Q!`%Gz;)A*3Ogs^qdV_7YYxw&PtY z42mlC)E`wU9dT&Y3Q&8XqK8yg4^@Rgs(PUuif9i-YSjZ05>;DJQB@)OGc&sm4p^uc zduQgo_kG`cZ{Gaz7W4Niv-%0gKD=1H#QB)9w;8~v3OV&;qF6YpEkYjvM>RE{Q%V`* zn8@@oTbyz3XPJdzU^6NuRb=s2YqT4E20XpgF^zXklTpBD%WB3@6+=6&iX7U^4>I3Z zzp}M3zDyyLuNYcZSJXo0NM6l}tvHYaUAK3OJ3xy@C@5LVK^NQlxGj8i6Tzq_SG{8| zG#v|ojd5-9zzMZnnamg&T{Q^locXC}xyPhA>2n*f&1i)s=mNGv26Ligr(H55p4aEW%?dTHN?6z3N zzGLso-?E?!-4{eVA(2F9dOT>GW023|r5-*_{*dCBTDM+x#9HglS77?x=INGj{Z=*Y zy5b1G$$+*5&G!tBGp}MUx&gO?rc$P?77Qy7eq6kVau1|5JcLF7*hnxcn~(ZXTSVAf zSTal44w}gsNh7ybdua-^O{#g-Q0svr^(l>8Fs9lF4k4Wc?io!th>QNe$Z^;bg?-V1 zG-#{y)Jw&JuEIfJC(Lv#i!=wNjedmP!wJwjtx}j8$}^Z%HwvqE<}$k4`CLagXkR+6 zD@$rcc||SjxDyoGBev>;&fjdjbeRRM@e|o4)j+RrdarjH2v&C=p_@wC%(!U7iQ=Q^ zo`1-{X9L7$CrY>>ROJaXJ2e|5O^r?sc)WWy#GRno3L;fm;3BCaP@59KV?hzgPXP6! z`~Hp)v9!Apq@_4w!=ww`Y zUfPbUETPg?*Sh`P(ipAqy=`9iiaC)jkC=om1h%a+j!QACklv|v#^ft7_F0dyf4qGHhgkume* zjghGNab+adPUVIJE4O6&FkX`ffPk*<6uKcDLu>H=u(;D|V;rqYf}O6=aHQX)ad&v! zNrNryfNNPZaWVl5`NKfevLW>`yW87gCFPcEJy`G;7BrJlj(Vb9EhGunfa|2gp2u&> nM~`bgWMaG@+-`o{2wGq*p{T2-ZlSIpTxP*c&DD#$_O<>8(w*i) delta 200 zcmeynf$?)UQ6nDwoAQEG8XQD$;U zYD#=sW@=7Ku>`*Yvj*qplWcixn`iUy( z`VVHK9@ot)H47OTcTSep4&Z*l*mU{HWTuCVLMoFNnk!G9sXdulLr871qrVJS64=^e yeXZKfyasmcjJGHIn0s+dU;^vtoIKC`CbNN%9!Tlr6bqrvTP#etH=BF8@c{tUYe)(J diff --git a/Logging/metadata/V2/LoggingMetrics.php b/Logging/metadata/V2/LoggingMetrics.php index f582ea66af32b72cfe4e8030508d6b25df4ca742..0867f06aa02d9aac26a229998b8a1d1ecb0247a1 100644 GIT binary patch delta 51 zcmX>ocUx}5TxP~ko98ieF*5F*ypqLVQi6*+sWdq|wIn_-F*j9$SAkK3(~0?kBje`p HEM8my&tDL1 delta 25 hcmcaDcTjG_TxP}_o98ieF)}WmypqL#vkstring dataset_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - protected $dataset_id = ''; + private $dataset_id = ''; /** * Constructor. diff --git a/Logging/src/V2/BigQueryOptions.php b/Logging/src/V2/BigQueryOptions.php index e413e31ba5db..e4b2d127638d 100644 --- a/Logging/src/V2/BigQueryOptions.php +++ b/Logging/src/V2/BigQueryOptions.php @@ -29,8 +29,8 @@ class BigQueryOptions extends \Google\Protobuf\Internal\Message */ private $use_partitioned_tables = false; /** - * Output only. True if new timestamp column based partitioning is in use, false if legacy - * ingestion-time partitioning is in use. + * Output only. True if new timestamp column based partitioning is in use, + * false if legacy ingestion-time partitioning is in use. * All new sinks will have this field set true and will use timestamp column * based partitioning. If use_partitioned_tables is false, this value has no * meaning and will be false. Legacy sinks using partitioned tables will have @@ -56,8 +56,8 @@ class BigQueryOptions extends \Google\Protobuf\Internal\Message * has to be used instead. In both cases, tables are sharded based on UTC * timezone. * @type bool $uses_timestamp_column_partitioning - * Output only. True if new timestamp column based partitioning is in use, false if legacy - * ingestion-time partitioning is in use. + * Output only. True if new timestamp column based partitioning is in use, + * false if legacy ingestion-time partitioning is in use. * All new sinks will have this field set true and will use timestamp column * based partitioning. If use_partitioned_tables is false, this value has no * meaning and will be false. Legacy sinks using partitioned tables will have @@ -110,8 +110,8 @@ public function setUsePartitionedTables($var) } /** - * Output only. True if new timestamp column based partitioning is in use, false if legacy - * ingestion-time partitioning is in use. + * Output only. True if new timestamp column based partitioning is in use, + * false if legacy ingestion-time partitioning is in use. * All new sinks will have this field set true and will use timestamp column * based partitioning. If use_partitioned_tables is false, this value has no * meaning and will be false. Legacy sinks using partitioned tables will have @@ -126,8 +126,8 @@ public function getUsesTimestampColumnPartitioning() } /** - * Output only. True if new timestamp column based partitioning is in use, false if legacy - * ingestion-time partitioning is in use. + * Output only. True if new timestamp column based partitioning is in use, + * false if legacy ingestion-time partitioning is in use. * All new sinks will have this field set true and will use timestamp column * based partitioning. If use_partitioned_tables is false, this value has no * meaning and will be false. Legacy sinks using partitioned tables will have diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/BucketMetadata.php b/Logging/src/V2/BucketMetadata.php similarity index 98% rename from owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/BucketMetadata.php rename to Logging/src/V2/BucketMetadata.php index 57713f08b32f..1b5dc8ecc1b5 100644 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/BucketMetadata.php +++ b/Logging/src/V2/BucketMetadata.php @@ -20,19 +20,19 @@ class BucketMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; */ - protected $start_time = null; + private $start_time = null; /** * The end time of an operation. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; */ - protected $end_time = null; + private $end_time = null; /** * State of an operation. * * Generated from protobuf field .google.logging.v2.OperationState state = 3; */ - protected $state = 0; + private $state = 0; protected $request; /** diff --git a/Logging/src/V2/CmekSettings.php b/Logging/src/V2/CmekSettings.php index 0f47b4f2bfb1..6c3f02f81a73 100644 --- a/Logging/src/V2/CmekSettings.php +++ b/Logging/src/V2/CmekSettings.php @@ -52,8 +52,24 @@ class CmekSettings extends \Google\Protobuf\Internal\Message */ private $kms_key_name = ''; /** - * Output only. The service account that will be used by the Log Router to access your - * Cloud KMS key. + * The CryptoKeyVersion resource name for the configured Cloud KMS key. + * KMS key name format: + * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]" + * For example: + * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"` + * This is a read-only field used to convey the specific configured + * CryptoKeyVersion of `kms_key` that has been configured. It will be + * populated in cases where the CMEK settings are bound to a single key + * version. + * If this field is populated, the `kms_key` is tied to a specific + * CryptoKeyVersion. + * + * Generated from protobuf field string kms_key_version_name = 4; + */ + private $kms_key_version_name = ''; + /** + * Output only. The service account that will be used by the Log Router to + * access your Cloud KMS key. * Before enabling CMEK for Log Router, you must first assign the * cloudkms.cryptoKeyEncrypterDecrypter role to the service account that * the Log Router will use to access your Cloud KMS key. Use @@ -94,9 +110,21 @@ class CmekSettings extends \Google\Protobuf\Internal\Message * See [Enabling CMEK for Log * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) * for more information. + * @type string $kms_key_version_name + * The CryptoKeyVersion resource name for the configured Cloud KMS key. + * KMS key name format: + * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]" + * For example: + * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"` + * This is a read-only field used to convey the specific configured + * CryptoKeyVersion of `kms_key` that has been configured. It will be + * populated in cases where the CMEK settings are bound to a single key + * version. + * If this field is populated, the `kms_key` is tied to a specific + * CryptoKeyVersion. * @type string $service_account_id - * Output only. The service account that will be used by the Log Router to access your - * Cloud KMS key. + * Output only. The service account that will be used by the Log Router to + * access your Cloud KMS key. * Before enabling CMEK for Log Router, you must first assign the * cloudkms.cryptoKeyEncrypterDecrypter role to the service account that * the Log Router will use to access your Cloud KMS key. Use @@ -199,8 +227,54 @@ public function setKmsKeyName($var) } /** - * Output only. The service account that will be used by the Log Router to access your - * Cloud KMS key. + * The CryptoKeyVersion resource name for the configured Cloud KMS key. + * KMS key name format: + * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]" + * For example: + * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"` + * This is a read-only field used to convey the specific configured + * CryptoKeyVersion of `kms_key` that has been configured. It will be + * populated in cases where the CMEK settings are bound to a single key + * version. + * If this field is populated, the `kms_key` is tied to a specific + * CryptoKeyVersion. + * + * Generated from protobuf field string kms_key_version_name = 4; + * @return string + */ + public function getKmsKeyVersionName() + { + return $this->kms_key_version_name; + } + + /** + * The CryptoKeyVersion resource name for the configured Cloud KMS key. + * KMS key name format: + * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]" + * For example: + * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"` + * This is a read-only field used to convey the specific configured + * CryptoKeyVersion of `kms_key` that has been configured. It will be + * populated in cases where the CMEK settings are bound to a single key + * version. + * If this field is populated, the `kms_key` is tied to a specific + * CryptoKeyVersion. + * + * Generated from protobuf field string kms_key_version_name = 4; + * @param string $var + * @return $this + */ + public function setKmsKeyVersionName($var) + { + GPBUtil::checkString($var, True); + $this->kms_key_version_name = $var; + + return $this; + } + + /** + * Output only. The service account that will be used by the Log Router to + * access your Cloud KMS key. * Before enabling CMEK for Log Router, you must first assign the * cloudkms.cryptoKeyEncrypterDecrypter role to the service account that * the Log Router will use to access your Cloud KMS key. Use @@ -219,8 +293,8 @@ public function getServiceAccountId() } /** - * Output only. The service account that will be used by the Log Router to access your - * Cloud KMS key. + * Output only. The service account that will be used by the Log Router to + * access your Cloud KMS key. * Before enabling CMEK for Log Router, you must first assign the * cloudkms.cryptoKeyEncrypterDecrypter role to the service account that * the Log Router will use to access your Cloud KMS key. Use diff --git a/Logging/src/V2/ConfigServiceV2GrpcClient.php b/Logging/src/V2/ConfigServiceV2GrpcClient.php index 2d9f792703b6..b0d1e47be4fa 100644 --- a/Logging/src/V2/ConfigServiceV2GrpcClient.php +++ b/Logging/src/V2/ConfigServiceV2GrpcClient.php @@ -62,6 +62,43 @@ public function GetBucket(\Google\Cloud\Logging\V2\GetBucketRequest $argument, $metadata, $options); } + /** + * Creates a log bucket asynchronously that can be used to store log entries. + * + * After a bucket has been created, the bucket's location cannot be changed. + * @param \Google\Cloud\Logging\V2\CreateBucketRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateBucketAsync(\Google\Cloud\Logging\V2\CreateBucketRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/CreateBucketAsync', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Updates a log bucket asynchronously. + * + * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then + * `FAILED_PRECONDITION` will be returned. + * + * After a bucket has been created, the bucket's location cannot be changed. + * @param \Google\Cloud\Logging\V2\UpdateBucketRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateBucketAsync(\Google\Cloud\Logging\V2\UpdateBucketRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/UpdateBucketAsync', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + /** * Creates a log bucket that can be used to store log entries. After a bucket * has been created, the bucket's location cannot be changed. @@ -79,11 +116,7 @@ public function CreateBucket(\Google\Cloud\Logging\V2\CreateBucketRequest $argum } /** - * Updates a log bucket. This method replaces the following fields in the - * existing bucket with values from the new bucket: `retention_period` - * - * If the retention period is decreased and the bucket is locked, - * `FAILED_PRECONDITION` will be returned. + * Updates a log bucket. * * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then * `FAILED_PRECONDITION` will be returned. @@ -303,6 +336,69 @@ public function DeleteSink(\Google\Cloud\Logging\V2\DeleteSinkRequest $argument, $metadata, $options); } + /** + * Asynchronously creates a linked dataset in BigQuery which makes it possible + * to use BigQuery to read the logs stored in the log bucket. A log bucket may + * currently only contain one link. + * @param \Google\Cloud\Logging\V2\CreateLinkRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateLink(\Google\Cloud\Logging\V2\CreateLinkRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/CreateLink', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Deletes a link. This will also delete the corresponding BigQuery linked + * dataset. + * @param \Google\Cloud\Logging\V2\DeleteLinkRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteLink(\Google\Cloud\Logging\V2\DeleteLinkRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/DeleteLink', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Lists links. + * @param \Google\Cloud\Logging\V2\ListLinksRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListLinks(\Google\Cloud\Logging\V2\ListLinksRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/ListLinks', + $argument, + ['\Google\Cloud\Logging\V2\ListLinksResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets a link. + * @param \Google\Cloud\Logging\V2\GetLinkRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetLink(\Google\Cloud\Logging\V2\GetLinkRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/GetLink', + $argument, + ['\Google\Cloud\Logging\V2\Link', 'decode'], + $metadata, $options); + } + /** * Lists all the exclusions on the _Default sink in a parent resource. * @param \Google\Cloud\Logging\V2\ListExclusionsRequest $argument input argument diff --git a/Logging/src/V2/CopyLogEntriesRequest.php b/Logging/src/V2/CopyLogEntriesRequest.php index 575daeeb159c..e528397e37eb 100644 --- a/Logging/src/V2/CopyLogEntriesRequest.php +++ b/Logging/src/V2/CopyLogEntriesRequest.php @@ -24,8 +24,8 @@ class CopyLogEntriesRequest extends \Google\Protobuf\Internal\Message */ private $name = ''; /** - * Optional. A filter specifying which log entries to copy. The filter must be no more - * than 20k characters. An empty filter matches all log entries. + * Optional. A filter specifying which log entries to copy. The filter must be + * no more than 20k characters. An empty filter matches all log entries. * * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -48,8 +48,8 @@ class CopyLogEntriesRequest extends \Google\Protobuf\Internal\Message * For example: * `"projects/my-project/locations/global/buckets/my-source-bucket"` * @type string $filter - * Optional. A filter specifying which log entries to copy. The filter must be no more - * than 20k characters. An empty filter matches all log entries. + * Optional. A filter specifying which log entries to copy. The filter must be + * no more than 20k characters. An empty filter matches all log entries. * @type string $destination * Required. Destination to which to copy log entries. * } @@ -90,8 +90,8 @@ public function setName($var) } /** - * Optional. A filter specifying which log entries to copy. The filter must be no more - * than 20k characters. An empty filter matches all log entries. + * Optional. A filter specifying which log entries to copy. The filter must be + * no more than 20k characters. An empty filter matches all log entries. * * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -102,8 +102,8 @@ public function getFilter() } /** - * Optional. A filter specifying which log entries to copy. The filter must be no more - * than 20k characters. An empty filter matches all log entries. + * Optional. A filter specifying which log entries to copy. The filter must be + * no more than 20k characters. An empty filter matches all log entries. * * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/Logging/src/V2/CreateBucketRequest.php b/Logging/src/V2/CreateBucketRequest.php index cf1e3bc1eb15..340b4c9d1bbc 100644 --- a/Logging/src/V2/CreateBucketRequest.php +++ b/Logging/src/V2/CreateBucketRequest.php @@ -25,17 +25,17 @@ class CreateBucketRequest extends \Google\Protobuf\Internal\Message */ private $parent = ''; /** - * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers are limited - * to 100 characters and can include only letters, digits, underscores, - * hyphens, and periods. + * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers + * are limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. * * Generated from protobuf field string bucket_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ private $bucket_id = ''; /** - * Required. The new bucket. The region specified in the new bucket must be compliant - * with any Location Restriction Org Policy. The name field in the bucket is - * ignored. + * Required. The new bucket. The region specified in the new bucket must be + * compliant with any Location Restriction Org Policy. The name field in the + * bucket is ignored. * * Generated from protobuf field .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; */ @@ -53,13 +53,13 @@ class CreateBucketRequest extends \Google\Protobuf\Internal\Message * For example: * `"projects/my-project/locations/global"` * @type string $bucket_id - * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers are limited - * to 100 characters and can include only letters, digits, underscores, - * hyphens, and periods. + * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers + * are limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. * @type \Google\Cloud\Logging\V2\LogBucket $bucket - * Required. The new bucket. The region specified in the new bucket must be compliant - * with any Location Restriction Org Policy. The name field in the bucket is - * ignored. + * Required. The new bucket. The region specified in the new bucket must be + * compliant with any Location Restriction Org Policy. The name field in the + * bucket is ignored. * } */ public function __construct($data = NULL) { @@ -100,9 +100,9 @@ public function setParent($var) } /** - * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers are limited - * to 100 characters and can include only letters, digits, underscores, - * hyphens, and periods. + * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers + * are limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. * * Generated from protobuf field string bucket_id = 2 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -113,9 +113,9 @@ public function getBucketId() } /** - * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers are limited - * to 100 characters and can include only letters, digits, underscores, - * hyphens, and periods. + * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers + * are limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. * * Generated from protobuf field string bucket_id = 2 [(.google.api.field_behavior) = REQUIRED]; * @param string $var @@ -130,9 +130,9 @@ public function setBucketId($var) } /** - * Required. The new bucket. The region specified in the new bucket must be compliant - * with any Location Restriction Org Policy. The name field in the bucket is - * ignored. + * Required. The new bucket. The region specified in the new bucket must be + * compliant with any Location Restriction Org Policy. The name field in the + * bucket is ignored. * * Generated from protobuf field .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; * @return \Google\Cloud\Logging\V2\LogBucket|null @@ -153,9 +153,9 @@ public function clearBucket() } /** - * Required. The new bucket. The region specified in the new bucket must be compliant - * with any Location Restriction Org Policy. The name field in the bucket is - * ignored. + * Required. The new bucket. The region specified in the new bucket must be + * compliant with any Location Restriction Org Policy. The name field in the + * bucket is ignored. * * Generated from protobuf field .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; * @param \Google\Cloud\Logging\V2\LogBucket $var diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateLinkRequest.php b/Logging/src/V2/CreateLinkRequest.php similarity index 98% rename from owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateLinkRequest.php rename to Logging/src/V2/CreateLinkRequest.php index 1c59cce78a43..30b9ff9cccf5 100644 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateLinkRequest.php +++ b/Logging/src/V2/CreateLinkRequest.php @@ -24,13 +24,13 @@ class CreateLinkRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - protected $parent = ''; + private $parent = ''; /** * Required. The new link. * * Generated from protobuf field .google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED]; */ - protected $link = null; + private $link = null; /** * Required. The ID to use for the link. The link_id can have up to 100 * characters. A valid link_id must only have alphanumeric characters and @@ -38,7 +38,7 @@ class CreateLinkRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string link_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - protected $link_id = ''; + private $link_id = ''; /** * Constructor. diff --git a/Logging/src/V2/CreateSinkRequest.php b/Logging/src/V2/CreateSinkRequest.php index 922df6f935c1..b7d75c924e9f 100644 --- a/Logging/src/V2/CreateSinkRequest.php +++ b/Logging/src/V2/CreateSinkRequest.php @@ -45,7 +45,8 @@ class CreateSinkRequest extends \Google\Protobuf\Internal\Message * If this field is set to true, or if the sink is owned by a non-project * resource such as an organization, then the value of `writer_identity` will * be a unique service account used only for exports from the new sink. For - * more information, see `writer_identity` in [LogSink][google.logging.v2.LogSink]. + * more information, see `writer_identity` in + * [LogSink][google.logging.v2.LogSink]. * * Generated from protobuf field bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -79,7 +80,8 @@ class CreateSinkRequest extends \Google\Protobuf\Internal\Message * If this field is set to true, or if the sink is owned by a non-project * resource such as an organization, then the value of `writer_identity` will * be a unique service account used only for exports from the new sink. For - * more information, see `writer_identity` in [LogSink][google.logging.v2.LogSink]. + * more information, see `writer_identity` in + * [LogSink][google.logging.v2.LogSink]. * } */ public function __construct($data = NULL) { @@ -175,7 +177,8 @@ public function setSink($var) * If this field is set to true, or if the sink is owned by a non-project * resource such as an organization, then the value of `writer_identity` will * be a unique service account used only for exports from the new sink. For - * more information, see `writer_identity` in [LogSink][google.logging.v2.LogSink]. + * more information, see `writer_identity` in + * [LogSink][google.logging.v2.LogSink]. * * Generated from protobuf field bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -195,7 +198,8 @@ public function getUniqueWriterIdentity() * If this field is set to true, or if the sink is owned by a non-project * resource such as an organization, then the value of `writer_identity` will * be a unique service account used only for exports from the new sink. For - * more information, see `writer_identity` in [LogSink][google.logging.v2.LogSink]. + * more information, see `writer_identity` in + * [LogSink][google.logging.v2.LogSink]. * * Generated from protobuf field bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var diff --git a/Logging/src/V2/CreateViewRequest.php b/Logging/src/V2/CreateViewRequest.php index 03a41790f284..375a4b86107c 100644 --- a/Logging/src/V2/CreateViewRequest.php +++ b/Logging/src/V2/CreateViewRequest.php @@ -25,7 +25,9 @@ class CreateViewRequest extends \Google\Protobuf\Internal\Message */ private $parent = ''; /** - * Required. The id to use for this view. + * Required. A client-assigned identifier such as `"my-view"`. Identifiers are + * limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. * * Generated from protobuf field string view_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ @@ -49,7 +51,9 @@ class CreateViewRequest extends \Google\Protobuf\Internal\Message * For example: * `"projects/my-project/locations/global/buckets/my-bucket"` * @type string $view_id - * Required. The id to use for this view. + * Required. A client-assigned identifier such as `"my-view"`. Identifiers are + * limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. * @type \Google\Cloud\Logging\V2\LogView $view * Required. The new view. * } @@ -92,7 +96,9 @@ public function setParent($var) } /** - * Required. The id to use for this view. + * Required. A client-assigned identifier such as `"my-view"`. Identifiers are + * limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. * * Generated from protobuf field string view_id = 2 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -103,7 +109,9 @@ public function getViewId() } /** - * Required. The id to use for this view. + * Required. A client-assigned identifier such as `"my-view"`. Identifiers are + * limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. * * Generated from protobuf field string view_id = 2 [(.google.api.field_behavior) = REQUIRED]; * @param string $var diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLinkRequest.php b/Logging/src/V2/DeleteLinkRequest.php similarity index 99% rename from owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLinkRequest.php rename to Logging/src/V2/DeleteLinkRequest.php index 6043c07c8b88..e1754d9dc362 100644 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLinkRequest.php +++ b/Logging/src/V2/DeleteLinkRequest.php @@ -24,7 +24,7 @@ class DeleteLinkRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - protected $name = ''; + private $name = ''; /** * Constructor. diff --git a/Logging/src/V2/DeleteSinkRequest.php b/Logging/src/V2/DeleteSinkRequest.php index 40ef81094405..655198e5e7bc 100644 --- a/Logging/src/V2/DeleteSinkRequest.php +++ b/Logging/src/V2/DeleteSinkRequest.php @@ -16,8 +16,8 @@ class DeleteSinkRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The full resource name of the sink to delete, including the parent - * resource and the sink identifier: + * Required. The full resource name of the sink to delete, including the + * parent resource and the sink identifier: * "projects/[PROJECT_ID]/sinks/[SINK_ID]" * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" @@ -36,8 +36,8 @@ class DeleteSinkRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $sink_name - * Required. The full resource name of the sink to delete, including the parent - * resource and the sink identifier: + * Required. The full resource name of the sink to delete, including the + * parent resource and the sink identifier: * "projects/[PROJECT_ID]/sinks/[SINK_ID]" * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" @@ -52,8 +52,8 @@ public function __construct($data = NULL) { } /** - * Required. The full resource name of the sink to delete, including the parent - * resource and the sink identifier: + * Required. The full resource name of the sink to delete, including the + * parent resource and the sink identifier: * "projects/[PROJECT_ID]/sinks/[SINK_ID]" * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" @@ -70,8 +70,8 @@ public function getSinkName() } /** - * Required. The full resource name of the sink to delete, including the parent - * resource and the sink identifier: + * Required. The full resource name of the sink to delete, including the + * parent resource and the sink identifier: * "projects/[PROJECT_ID]/sinks/[SINK_ID]" * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" diff --git a/Logging/src/V2/Gapic/ConfigServiceV2GapicClient.php b/Logging/src/V2/Gapic/ConfigServiceV2GapicClient.php index d48103c87f28..e9dd20a91aa5 100644 --- a/Logging/src/V2/Gapic/ConfigServiceV2GapicClient.php +++ b/Logging/src/V2/Gapic/ConfigServiceV2GapicClient.php @@ -39,22 +39,28 @@ use Google\Cloud\Logging\V2\CopyLogEntriesRequest; use Google\Cloud\Logging\V2\CreateBucketRequest; use Google\Cloud\Logging\V2\CreateExclusionRequest; +use Google\Cloud\Logging\V2\CreateLinkRequest; use Google\Cloud\Logging\V2\CreateSinkRequest; use Google\Cloud\Logging\V2\CreateViewRequest; use Google\Cloud\Logging\V2\DeleteBucketRequest; use Google\Cloud\Logging\V2\DeleteExclusionRequest; +use Google\Cloud\Logging\V2\DeleteLinkRequest; use Google\Cloud\Logging\V2\DeleteSinkRequest; use Google\Cloud\Logging\V2\DeleteViewRequest; use Google\Cloud\Logging\V2\GetBucketRequest; use Google\Cloud\Logging\V2\GetCmekSettingsRequest; use Google\Cloud\Logging\V2\GetExclusionRequest; +use Google\Cloud\Logging\V2\GetLinkRequest; use Google\Cloud\Logging\V2\GetSettingsRequest; use Google\Cloud\Logging\V2\GetSinkRequest; use Google\Cloud\Logging\V2\GetViewRequest; +use Google\Cloud\Logging\V2\Link; use Google\Cloud\Logging\V2\ListBucketsRequest; use Google\Cloud\Logging\V2\ListBucketsResponse; use Google\Cloud\Logging\V2\ListExclusionsRequest; use Google\Cloud\Logging\V2\ListExclusionsResponse; +use Google\Cloud\Logging\V2\ListLinksRequest; +use Google\Cloud\Logging\V2\ListLinksResponse; use Google\Cloud\Logging\V2\ListSinksRequest; use Google\Cloud\Logging\V2\ListSinksResponse; use Google\Cloud\Logging\V2\ListViewsRequest; @@ -156,6 +162,8 @@ class ConfigServiceV2GapicClient private static $billingAccountLocationBucketNameTemplate; + private static $billingAccountLocationBucketLinkNameTemplate; + private static $billingAccountLocationBucketViewNameTemplate; private static $billingAccountSettingsNameTemplate; @@ -174,12 +182,16 @@ class ConfigServiceV2GapicClient private static $folderLocationBucketNameTemplate; + private static $folderLocationBucketLinkNameTemplate; + private static $folderLocationBucketViewNameTemplate; private static $folderSettingsNameTemplate; private static $folderSinkNameTemplate; + private static $linkNameTemplate; + private static $locationNameTemplate; private static $logBucketNameTemplate; @@ -200,6 +212,8 @@ class ConfigServiceV2GapicClient private static $organizationLocationBucketNameTemplate; + private static $organizationLocationBucketLinkNameTemplate; + private static $organizationLocationBucketViewNameTemplate; private static $organizationSettingsNameTemplate; @@ -214,6 +228,8 @@ class ConfigServiceV2GapicClient private static $projectLocationBucketNameTemplate; + private static $projectLocationBucketLinkNameTemplate; + private static $projectLocationBucketViewNameTemplate; private static $projectSettingsNameTemplate; @@ -290,6 +306,15 @@ private static function getBillingAccountLocationBucketNameTemplate() return self::$billingAccountLocationBucketNameTemplate; } + private static function getBillingAccountLocationBucketLinkNameTemplate() + { + if (self::$billingAccountLocationBucketLinkNameTemplate == null) { + self::$billingAccountLocationBucketLinkNameTemplate = new PathTemplate('billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/links/{link}'); + } + + return self::$billingAccountLocationBucketLinkNameTemplate; + } + private static function getBillingAccountLocationBucketViewNameTemplate() { if (self::$billingAccountLocationBucketViewNameTemplate == null) { @@ -371,6 +396,15 @@ private static function getFolderLocationBucketNameTemplate() return self::$folderLocationBucketNameTemplate; } + private static function getFolderLocationBucketLinkNameTemplate() + { + if (self::$folderLocationBucketLinkNameTemplate == null) { + self::$folderLocationBucketLinkNameTemplate = new PathTemplate('folders/{folder}/locations/{location}/buckets/{bucket}/links/{link}'); + } + + return self::$folderLocationBucketLinkNameTemplate; + } + private static function getFolderLocationBucketViewNameTemplate() { if (self::$folderLocationBucketViewNameTemplate == null) { @@ -398,6 +432,15 @@ private static function getFolderSinkNameTemplate() return self::$folderSinkNameTemplate; } + private static function getLinkNameTemplate() + { + if (self::$linkNameTemplate == null) { + self::$linkNameTemplate = new PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}/links/{link}'); + } + + return self::$linkNameTemplate; + } + private static function getLocationNameTemplate() { if (self::$locationNameTemplate == null) { @@ -488,6 +531,15 @@ private static function getOrganizationLocationBucketNameTemplate() return self::$organizationLocationBucketNameTemplate; } + private static function getOrganizationLocationBucketLinkNameTemplate() + { + if (self::$organizationLocationBucketLinkNameTemplate == null) { + self::$organizationLocationBucketLinkNameTemplate = new PathTemplate('organizations/{organization}/locations/{location}/buckets/{bucket}/links/{link}'); + } + + return self::$organizationLocationBucketLinkNameTemplate; + } + private static function getOrganizationLocationBucketViewNameTemplate() { if (self::$organizationLocationBucketViewNameTemplate == null) { @@ -551,6 +603,15 @@ private static function getProjectLocationBucketNameTemplate() return self::$projectLocationBucketNameTemplate; } + private static function getProjectLocationBucketLinkNameTemplate() + { + if (self::$projectLocationBucketLinkNameTemplate == null) { + self::$projectLocationBucketLinkNameTemplate = new PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}/links/{link}'); + } + + return self::$projectLocationBucketLinkNameTemplate; + } + private static function getProjectLocationBucketViewNameTemplate() { if (self::$projectLocationBucketViewNameTemplate == null) { @@ -596,6 +657,7 @@ private static function getPathTemplateMap() 'billingAccountExclusion' => self::getBillingAccountExclusionNameTemplate(), 'billingAccountLocation' => self::getBillingAccountLocationNameTemplate(), 'billingAccountLocationBucket' => self::getBillingAccountLocationBucketNameTemplate(), + 'billingAccountLocationBucketLink' => self::getBillingAccountLocationBucketLinkNameTemplate(), 'billingAccountLocationBucketView' => self::getBillingAccountLocationBucketViewNameTemplate(), 'billingAccountSettings' => self::getBillingAccountSettingsNameTemplate(), 'billingAccountSink' => self::getBillingAccountSinkNameTemplate(), @@ -605,9 +667,11 @@ private static function getPathTemplateMap() 'folderExclusion' => self::getFolderExclusionNameTemplate(), 'folderLocation' => self::getFolderLocationNameTemplate(), 'folderLocationBucket' => self::getFolderLocationBucketNameTemplate(), + 'folderLocationBucketLink' => self::getFolderLocationBucketLinkNameTemplate(), 'folderLocationBucketView' => self::getFolderLocationBucketViewNameTemplate(), 'folderSettings' => self::getFolderSettingsNameTemplate(), 'folderSink' => self::getFolderSinkNameTemplate(), + 'link' => self::getLinkNameTemplate(), 'location' => self::getLocationNameTemplate(), 'logBucket' => self::getLogBucketNameTemplate(), 'logExclusion' => self::getLogExclusionNameTemplate(), @@ -618,6 +682,7 @@ private static function getPathTemplateMap() 'organizationExclusion' => self::getOrganizationExclusionNameTemplate(), 'organizationLocation' => self::getOrganizationLocationNameTemplate(), 'organizationLocationBucket' => self::getOrganizationLocationBucketNameTemplate(), + 'organizationLocationBucketLink' => self::getOrganizationLocationBucketLinkNameTemplate(), 'organizationLocationBucketView' => self::getOrganizationLocationBucketViewNameTemplate(), 'organizationSettings' => self::getOrganizationSettingsNameTemplate(), 'organizationSink' => self::getOrganizationSinkNameTemplate(), @@ -625,6 +690,7 @@ private static function getPathTemplateMap() 'projectCmekSettings' => self::getProjectCmekSettingsNameTemplate(), 'projectExclusion' => self::getProjectExclusionNameTemplate(), 'projectLocationBucket' => self::getProjectLocationBucketNameTemplate(), + 'projectLocationBucketLink' => self::getProjectLocationBucketLinkNameTemplate(), 'projectLocationBucketView' => self::getProjectLocationBucketViewNameTemplate(), 'projectSettings' => self::getProjectSettingsNameTemplate(), 'projectSink' => self::getProjectSinkNameTemplate(), @@ -718,6 +784,27 @@ public static function billingAccountLocationBucketName($billingAccount, $locati ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * billing_account_location_bucket_link resource. + * + * @param string $billingAccount + * @param string $location + * @param string $bucket + * @param string $link + * + * @return string The formatted billing_account_location_bucket_link resource. + */ + public static function billingAccountLocationBucketLinkName($billingAccount, $location, $bucket, $link) + { + return self::getBillingAccountLocationBucketLinkNameTemplate()->render([ + 'billing_account' => $billingAccount, + 'location' => $location, + 'bucket' => $bucket, + 'link' => $link, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * billing_account_location_bucket_view resource. @@ -869,6 +956,27 @@ public static function folderLocationBucketName($folder, $location, $bucket) ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * folder_location_bucket_link resource. + * + * @param string $folder + * @param string $location + * @param string $bucket + * @param string $link + * + * @return string The formatted folder_location_bucket_link resource. + */ + public static function folderLocationBucketLinkName($folder, $location, $bucket, $link) + { + return self::getFolderLocationBucketLinkNameTemplate()->render([ + 'folder' => $folder, + 'location' => $location, + 'bucket' => $bucket, + 'link' => $link, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * folder_location_bucket_view resource. @@ -922,6 +1030,27 @@ public static function folderSinkName($folder, $sink) ]); } + /** + * Formats a string containing the fully-qualified path to represent a link + * resource. + * + * @param string $project + * @param string $location + * @param string $bucket + * @param string $link + * + * @return string The formatted link resource. + */ + public static function linkName($project, $location, $bucket, $link) + { + return self::getLinkNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'bucket' => $bucket, + 'link' => $link, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a location * resource. @@ -1096,6 +1225,27 @@ public static function organizationLocationBucketName($organization, $location, ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location_bucket_link resource. + * + * @param string $organization + * @param string $location + * @param string $bucket + * @param string $link + * + * @return string The formatted organization_location_bucket_link resource. + */ + public static function organizationLocationBucketLinkName($organization, $location, $bucket, $link) + { + return self::getOrganizationLocationBucketLinkNameTemplate()->render([ + 'organization' => $organization, + 'location' => $location, + 'bucket' => $bucket, + 'link' => $link, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * organization_location_bucket_view resource. @@ -1215,6 +1365,27 @@ public static function projectLocationBucketName($project, $location, $bucket) ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_bucket_link resource. + * + * @param string $project + * @param string $location + * @param string $bucket + * @param string $link + * + * @return string The formatted project_location_bucket_link resource. + */ + public static function projectLocationBucketLinkName($project, $location, $bucket, $link) + { + return self::getProjectLocationBucketLinkNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'bucket' => $bucket, + 'link' => $link, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * project_location_bucket_view resource. @@ -1292,6 +1463,7 @@ public static function settingsName($project) * - billingAccountExclusion: billingAccounts/{billing_account}/exclusions/{exclusion} * - billingAccountLocation: billingAccounts/{billing_account}/locations/{location} * - billingAccountLocationBucket: billingAccounts/{billing_account}/locations/{location}/buckets/{bucket} + * - billingAccountLocationBucketLink: billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/links/{link} * - billingAccountLocationBucketView: billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/views/{view} * - billingAccountSettings: billingAccounts/{billing_account}/settings * - billingAccountSink: billingAccounts/{billing_account}/sinks/{sink} @@ -1301,9 +1473,11 @@ public static function settingsName($project) * - folderExclusion: folders/{folder}/exclusions/{exclusion} * - folderLocation: folders/{folder}/locations/{location} * - folderLocationBucket: folders/{folder}/locations/{location}/buckets/{bucket} + * - folderLocationBucketLink: folders/{folder}/locations/{location}/buckets/{bucket}/links/{link} * - folderLocationBucketView: folders/{folder}/locations/{location}/buckets/{bucket}/views/{view} * - folderSettings: folders/{folder}/settings * - folderSink: folders/{folder}/sinks/{sink} + * - link: projects/{project}/locations/{location}/buckets/{bucket}/links/{link} * - location: projects/{project}/locations/{location} * - logBucket: projects/{project}/locations/{location}/buckets/{bucket} * - logExclusion: projects/{project}/exclusions/{exclusion} @@ -1314,6 +1488,7 @@ public static function settingsName($project) * - organizationExclusion: organizations/{organization}/exclusions/{exclusion} * - organizationLocation: organizations/{organization}/locations/{location} * - organizationLocationBucket: organizations/{organization}/locations/{location}/buckets/{bucket} + * - organizationLocationBucketLink: organizations/{organization}/locations/{location}/buckets/{bucket}/links/{link} * - organizationLocationBucketView: organizations/{organization}/locations/{location}/buckets/{bucket}/views/{view} * - organizationSettings: organizations/{organization}/settings * - organizationSink: organizations/{organization}/sinks/{sink} @@ -1321,6 +1496,7 @@ public static function settingsName($project) * - projectCmekSettings: projects/{project}/cmekSettings * - projectExclusion: projects/{project}/exclusions/{exclusion} * - projectLocationBucket: projects/{project}/locations/{location}/buckets/{bucket} + * - projectLocationBucketLink: projects/{project}/locations/{location}/buckets/{bucket}/links/{link} * - projectLocationBucketView: projects/{project}/locations/{location}/buckets/{bucket}/views/{view} * - projectSettings: projects/{project}/settings * - projectSink: projects/{project}/sinks/{sink} @@ -1501,8 +1677,8 @@ public function __construct(array $options = []) * Optional. * * @type string $filter - * Optional. A filter specifying which log entries to copy. The filter must be no more - * than 20k characters. An empty filter matches all log entries. + * Optional. A filter specifying which log entries to copy. The filter must be + * no more than 20k characters. An empty filter matches all log entries. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -1549,12 +1725,12 @@ public function copyLogEntries($name, $destination, array $optionalArgs = []) * For example: * * `"projects/my-project/locations/global"` - * @param string $bucketId Required. A client-assigned identifier such as `"my-bucket"`. Identifiers are limited - * to 100 characters and can include only letters, digits, underscores, - * hyphens, and periods. - * @param LogBucket $bucket Required. The new bucket. The region specified in the new bucket must be compliant - * with any Location Restriction Org Policy. The name field in the bucket is - * ignored. + * @param string $bucketId Required. A client-assigned identifier such as `"my-bucket"`. Identifiers + * are limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. + * @param LogBucket $bucket Required. The new bucket. The region specified in the new bucket must be + * compliant with any Location Restriction Org Policy. The name field in the + * bucket is ignored. * @param array $optionalArgs { * Optional. * @@ -1581,6 +1757,88 @@ public function createBucket($parent, $bucketId, $bucket, array $optionalArgs = return $this->startCall('CreateBucket', LogBucket::class, $optionalArgs, $request)->wait(); } + /** + * Creates a log bucket asynchronously that can be used to store log entries. + * + * After a bucket has been created, the bucket's location cannot be changed. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedParent = $configServiceV2Client->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + * $bucketId = 'bucket_id'; + * $bucket = new LogBucket(); + * $operationResponse = $configServiceV2Client->createBucketAsync($formattedParent, $bucketId, $bucket); + * $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 = $configServiceV2Client->createBucketAsync($formattedParent, $bucketId, $bucket); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $configServiceV2Client->resumeOperation($operationName, 'createBucketAsync'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $parent Required. The resource in which to create the log bucket: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * + * For example: + * + * `"projects/my-project/locations/global"` + * @param string $bucketId Required. A client-assigned identifier such as `"my-bucket"`. Identifiers + * are limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. + * @param LogBucket $bucket Required. The new bucket. The region specified in the new bucket must be + * compliant with any Location Restriction Org Policy. The name field in the + * bucket is ignored. + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createBucketAsync($parent, $bucketId, $bucket, array $optionalArgs = []) + { + $request = new CreateBucketRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setBucketId($bucketId); + $request->setBucket($bucket); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateBucketAsync', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + /** * Creates a new exclusion in the _Default sink in a specified parent * resource. Only log entries belonging to that resource can be excluded. You @@ -1636,6 +1894,85 @@ public function createExclusion($parent, $exclusion, array $optionalArgs = []) return $this->startCall('CreateExclusion', LogExclusion::class, $optionalArgs, $request)->wait(); } + /** + * Asynchronously creates a linked dataset in BigQuery which makes it possible + * to use BigQuery to read the logs stored in the log bucket. A log bucket may + * currently only contain one link. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedParent = $configServiceV2Client->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + * $link = new Link(); + * $linkId = 'link_id'; + * $operationResponse = $configServiceV2Client->createLink($formattedParent, $link, $linkId); + * $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 = $configServiceV2Client->createLink($formattedParent, $link, $linkId); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $configServiceV2Client->resumeOperation($operationName, 'createLink'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $parent Required. The full resource name of the bucket to create a link for. + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * @param Link $link Required. The new link. + * @param string $linkId Required. The ID to use for the link. The link_id can have up to 100 + * characters. A valid link_id must only have alphanumeric characters and + * underscores within it. + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createLink($parent, $link, $linkId, array $optionalArgs = []) + { + $request = new CreateLinkRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setLink($link); + $request->setLinkId($linkId); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateLink', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + /** * Creates a sink that exports specified log entries to a destination. The * export of newly-ingested log entries begins immediately, unless the sink's @@ -1681,7 +2018,8 @@ public function createExclusion($parent, $exclusion, array $optionalArgs = []) * If this field is set to true, or if the sink is owned by a non-project * resource such as an organization, then the value of `writer_identity` will * be a unique service account used only for exports from the new sink. For - * more information, see `writer_identity` in [LogSink][google.logging.v2.LogSink]. + * more information, see `writer_identity` in + * [LogSink][google.logging.v2.LogSink]. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -1732,7 +2070,9 @@ public function createSink($parent, $sink, array $optionalArgs = []) * For example: * * `"projects/my-project/locations/global/buckets/my-bucket"` - * @param string $viewId Required. The id to use for this view. + * @param string $viewId Required. A client-assigned identifier such as `"my-view"`. Identifiers are + * limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. * @param LogView $view Required. The new view. * @param array $optionalArgs { * Optional. @@ -1856,6 +2196,74 @@ public function deleteExclusion($name, array $optionalArgs = []) return $this->startCall('DeleteExclusion', GPBEmpty::class, $optionalArgs, $request)->wait(); } + /** + * Deletes a link. This will also delete the corresponding BigQuery linked + * dataset. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedName = $configServiceV2Client->linkName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[LINK]'); + * $operationResponse = $configServiceV2Client->deleteLink($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $configServiceV2Client->deleteLink($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $configServiceV2Client->resumeOperation($operationName, 'deleteLink'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $name Required. The full resource name of the link to delete. + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteLink($name, array $optionalArgs = []) + { + $request = new DeleteLinkRequest(); + $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->startOperationsCall('DeleteLink', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + /** * Deletes a sink. If the sink has a unique `writer_identity`, then that * service account is also deleted. @@ -1871,8 +2279,8 @@ public function deleteExclusion($name, array $optionalArgs = []) * } * ``` * - * @param string $sinkName Required. The full resource name of the sink to delete, including the parent - * resource and the sink identifier: + * @param string $sinkName Required. The full resource name of the sink to delete, including the + * parent resource and the sink identifier: * * "projects/[PROJECT_ID]/sinks/[SINK_ID]" * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" @@ -2111,6 +2519,50 @@ public function getExclusion($name, array $optionalArgs = []) return $this->startCall('GetExclusion', LogExclusion::class, $optionalArgs, $request)->wait(); } + /** + * Gets a link. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedName = $configServiceV2Client->linkName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[LINK]'); + * $response = $configServiceV2Client->getLink($formattedName); + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the link: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_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\Logging\V2\Link + * + * @throws ApiException if the remote call fails + */ + public function getLink($name, array $optionalArgs = []) + { + $request = new GetLinkRequest(); + $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('GetLink', Link::class, $optionalArgs, $request)->wait(); + } + /** * Gets the Log Router settings for the given resource. * @@ -2416,6 +2868,79 @@ public function listExclusions($parent, array $optionalArgs = []) return $this->getPagedListResponse('ListExclusions', $optionalArgs, ListExclusionsResponse::class, $request); } + /** + * Lists links. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedParent = $configServiceV2Client->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + * // Iterate over pages of elements + * $pagedResponse = $configServiceV2Client->listLinks($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $configServiceV2Client->listLinks($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource whose links are to be listed: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/ + * @param array $optionalArgs { + * Optional. + * + * @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 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 RetrySettings|array $retrySettings + * Retry settings to use for this call. 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 listLinks($parent, array $optionalArgs = []) + { + $request = new ListLinksRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLinks', $optionalArgs, ListLinksResponse::class, $request); + } + /** * Lists sinks. * @@ -2607,11 +3132,7 @@ public function undeleteBucket($name, array $optionalArgs = []) } /** - * Updates a log bucket. This method replaces the following fields in the - * existing bucket with values from the new bucket: `retention_period` - * - * If the retention period is decreased and the bucket is locked, - * `FAILED_PRECONDITION` will be returned. + * Updates a log bucket. * * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then * `FAILED_PRECONDITION` will be returned. @@ -2642,9 +3163,9 @@ public function undeleteBucket($name, array $optionalArgs = []) * * `"projects/my-project/locations/global/buckets/my-bucket"` * @param LogBucket $bucket Required. The updated bucket. - * @param FieldMask $updateMask Required. Field mask that specifies the fields in `bucket` that need an update. A - * bucket field will be overwritten if, and only if, it is in the update mask. - * `name` and output only fields cannot be updated. + * @param FieldMask $updateMask Required. Field mask that specifies the fields in `bucket` that need an + * update. A bucket field will be overwritten if, and only if, it is in the + * update mask. `name` and output only fields cannot be updated. * * For a detailed `FieldMask` definition, see: * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask @@ -2676,6 +3197,97 @@ public function updateBucket($name, $bucket, $updateMask, array $optionalArgs = return $this->startCall('UpdateBucket', LogBucket::class, $optionalArgs, $request)->wait(); } + /** + * Updates a log bucket asynchronously. + * + * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then + * `FAILED_PRECONDITION` will be returned. + * + * After a bucket has been created, the bucket's location cannot be changed. + * + * Sample code: + * ``` + * $configServiceV2Client = new ConfigServiceV2Client(); + * try { + * $formattedName = $configServiceV2Client->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + * $bucket = new LogBucket(); + * $updateMask = new FieldMask(); + * $operationResponse = $configServiceV2Client->updateBucketAsync($formattedName, $bucket, $updateMask); + * $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 = $configServiceV2Client->updateBucketAsync($formattedName, $bucket, $updateMask); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $configServiceV2Client->resumeOperation($operationName, 'updateBucketAsync'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $configServiceV2Client->close(); + * } + * ``` + * + * @param string $name Required. The full resource name of the bucket to update. + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * + * For example: + * + * `"projects/my-project/locations/global/buckets/my-bucket"` + * @param LogBucket $bucket Required. The updated bucket. + * @param FieldMask $updateMask Required. Field mask that specifies the fields in `bucket` that need an + * update. A bucket field will be overwritten if, and only if, it is in the + * update mask. `name` and output only fields cannot be updated. + * + * For a detailed `FieldMask` definition, see: + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + * + * For example: `updateMask=retention_days` + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateBucketAsync($name, $bucket, $updateMask, array $optionalArgs = []) + { + $request = new UpdateBucketRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setBucket($bucket); + $request->setUpdateMask($updateMask); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateBucketAsync', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + /** * Updates the Log Router CMEK settings for the given resource. * @@ -2794,12 +3406,13 @@ public function updateCmekSettings(array $optionalArgs = []) * For example: * * `"projects/my-project/exclusions/my-exclusion"` - * @param LogExclusion $exclusion Required. New values for the existing exclusion. Only the fields specified in - * `update_mask` are relevant. - * @param FieldMask $updateMask Required. A non-empty list of fields to change in the existing exclusion. New values - * for the fields are taken from the corresponding fields in the - * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in - * `update_mask` are not changed and are ignored in the request. + * @param LogExclusion $exclusion Required. New values for the existing exclusion. Only the fields specified + * in `update_mask` are relevant. + * @param FieldMask $updateMask Required. A non-empty list of fields to change in the existing exclusion. + * New values for the fields are taken from the corresponding fields in the + * [LogExclusion][google.logging.v2.LogExclusion] included in this request. + * Fields not mentioned in `update_mask` are not changed and are ignored in + * the request. * * For example, to change the filter and description of an exclusion, * specify an `update_mask` of `"filter,description"`. @@ -2931,8 +3544,8 @@ public function updateSettings($name, $settings, array $optionalArgs = []) * } * ``` * - * @param string $sinkName Required. The full resource name of the sink to update, including the parent - * resource and the sink identifier: + * @param string $sinkName Required. The full resource name of the sink to update, including the + * parent resource and the sink identifier: * * "projects/[PROJECT_ID]/sinks/[SINK_ID]" * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" @@ -2942,8 +3555,8 @@ public function updateSettings($name, $settings, array $optionalArgs = []) * For example: * * `"projects/my-project/sinks/my-sink"` - * @param LogSink $sink Required. The updated sink, whose name is the same identifier that appears as part - * of `sink_name`. + * @param LogSink $sink Required. The updated sink, whose name is the same identifier that appears + * as part of `sink_name`. * @param array $optionalArgs { * Optional. * diff --git a/Logging/src/V2/Gapic/LoggingServiceV2GapicClient.php b/Logging/src/V2/Gapic/LoggingServiceV2GapicClient.php index bac737217c7f..5e36861982dc 100644 --- a/Logging/src/V2/Gapic/LoggingServiceV2GapicClient.php +++ b/Logging/src/V2/Gapic/LoggingServiceV2GapicClient.php @@ -587,17 +587,16 @@ public function deleteLog($logName, array $optionalArgs = []) * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * * Projects listed in the `project_ids` field are added to this list. + * A maximum of 100 resources may be specified in a single request. * @param array $optionalArgs { * Optional. * * @type string $filter - * Optional. A filter that chooses which log entries to return. See [Advanced - * Logs Queries](https://cloud.google.com/logging/docs/view/advanced-queries). - * Only log entries that match the filter are returned. An empty filter - * matches all log entries in the resources listed in `resource_names`. + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. * Referencing a parent resource that is not listed in `resource_names` will - * cause the filter to return no results. The maximum length of the filter is - * 20000 characters. + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. * @type string $orderBy * Optional. How the results should be sorted. Presently, the only permitted * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first @@ -674,7 +673,7 @@ public function listLogEntries($resourceNames, array $optionalArgs = []) * } * ``` * - * @param string $parent Required. The resource name that owns the logs: + * @param string $parent Required. The resource name to list logs for: * * * `projects/[PROJECT_ID]` * * `organizations/[ORGANIZATION_ID]` @@ -683,17 +682,8 @@ public function listLogEntries($resourceNames, array $optionalArgs = []) * @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[] $resourceNames - * Optional. The resource name that owns the logs: + * Optional. List of resource names to list logs for: * * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` @@ -706,6 +696,17 @@ public function listLogEntries($resourceNames, array $optionalArgs = []) * * `organizations/[ORGANIZATION_ID]` * * `billingAccounts/[BILLING_ACCOUNT_ID]` * * `folders/[FOLDER_ID]` + * + * The resource name in the `parent` field is added to this list. + * @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 @@ -722,6 +723,10 @@ public function listLogs($parent, array $optionalArgs = []) $requestParamHeaders = []; $request->setParent($parent); $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['resourceNames'])) { + $request->setResourceNames($optionalArgs['resourceNames']); + } + if (isset($optionalArgs['pageSize'])) { $request->setPageSize($optionalArgs['pageSize']); } @@ -730,10 +735,6 @@ public function listLogs($parent, array $optionalArgs = []) $request->setPageToken($optionalArgs['pageToken']); } - if (isset($optionalArgs['resourceNames'])) { - $request->setResourceNames($optionalArgs['resourceNames']); - } - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); return $this->getPagedListResponse('ListLogs', $optionalArgs, ListLogsResponse::class, $request); @@ -942,11 +943,13 @@ public function tailLogEntries(array $optionalArgs = []) * as a label in this parameter, then the log entry's label is not changed. * See [LogEntry][google.logging.v2.LogEntry]. * @type bool $partialSuccess - * Optional. Whether valid entries should be written even if some other - * entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any - * entry is not written, then the response status is the error associated - * with one of the failed entries and the response includes error details - * keyed by the entries' zero-based index in the `entries.write` method. + * Optional. Whether a batch's valid entries should be written even if some + * other entry failed due to a permanent error such as INVALID_ARGUMENT or + * PERMISSION_DENIED. If any entry failed, then the response status is the + * response status of one of the failed entries. The response will include + * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by + * the entries' zero-based index in the `entries`. Failed requests for which + * no entries are written will not include per-entry errors. * @type bool $dryRun * Optional. If true, the request should expect normal response, but the * entries won't be persisted nor exported. Useful for checking whether the diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetLinkRequest.php b/Logging/src/V2/GetLinkRequest.php similarity index 99% rename from owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetLinkRequest.php rename to Logging/src/V2/GetLinkRequest.php index 89e72a251546..44f5711a63fc 100644 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetLinkRequest.php +++ b/Logging/src/V2/GetLinkRequest.php @@ -24,7 +24,7 @@ class GetLinkRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - protected $name = ''; + private $name = ''; /** * Constructor. diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/IndexConfig.php b/Logging/src/V2/IndexConfig.php similarity index 98% rename from owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/IndexConfig.php rename to Logging/src/V2/IndexConfig.php index a322960c0b42..51359da2dc59 100644 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/IndexConfig.php +++ b/Logging/src/V2/IndexConfig.php @@ -25,13 +25,13 @@ class IndexConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; */ - protected $field_path = ''; + private $field_path = ''; /** * Required. The type of data in this index. * * Generated from protobuf field .google.logging.v2.IndexType type = 2 [(.google.api.field_behavior) = REQUIRED]; */ - protected $type = 0; + private $type = 0; /** * Output only. The timestamp when the index was last modified. * This is used to return the timestamp, and will be ignored if supplied @@ -39,7 +39,7 @@ class IndexConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - protected $create_time = null; + private $create_time = null; /** * Constructor. diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/IndexType.php b/Logging/src/V2/IndexType.php similarity index 100% rename from owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/IndexType.php rename to Logging/src/V2/IndexType.php diff --git a/Logging/src/V2/LifecycleState.php b/Logging/src/V2/LifecycleState.php index 3dbffb695e6b..0fe746cebd4d 100644 --- a/Logging/src/V2/LifecycleState.php +++ b/Logging/src/V2/LifecycleState.php @@ -33,11 +33,34 @@ class LifecycleState * Generated from protobuf enum DELETE_REQUESTED = 2; */ const DELETE_REQUESTED = 2; + /** + * The resource has been marked for an update by the user. It will remain in + * this state until the update is complete. + * + * Generated from protobuf enum UPDATING = 3; + */ + const UPDATING = 3; + /** + * The resource has been marked for creation by the user. It will remain in + * this state until the creation is complete. + * + * Generated from protobuf enum CREATING = 4; + */ + const CREATING = 4; + /** + * The resource is in an INTERNAL error state. + * + * Generated from protobuf enum FAILED = 5; + */ + const FAILED = 5; private static $valueToName = [ self::LIFECYCLE_STATE_UNSPECIFIED => 'LIFECYCLE_STATE_UNSPECIFIED', self::ACTIVE => 'ACTIVE', self::DELETE_REQUESTED => 'DELETE_REQUESTED', + self::UPDATING => 'UPDATING', + self::CREATING => 'CREATING', + self::FAILED => 'FAILED', ]; public static function name($value) diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/Link.php b/Logging/src/V2/Link.php similarity index 98% rename from owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/Link.php rename to Logging/src/V2/Link.php index 666ffc0feb1a..06771a8fe4a2 100644 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/Link.php +++ b/Logging/src/V2/Link.php @@ -28,26 +28,26 @@ class Link extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - protected $name = ''; + private $name = ''; /** * Describes this link. * The maximum length of the description is 8000 characters. * * Generated from protobuf field string description = 2; */ - protected $description = ''; + private $description = ''; /** * Output only. The creation timestamp of the link. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - protected $create_time = null; + private $create_time = null; /** * Output only. The resource lifecycle state. * * Generated from protobuf field .google.logging.v2.LifecycleState lifecycle_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - protected $lifecycle_state = 0; + private $lifecycle_state = 0; /** * The information of a BigQuery Dataset. When a link is created, a BigQuery * dataset is created along with it, in the same project as the LogBucket it's @@ -56,7 +56,7 @@ class Link extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.logging.v2.BigQueryDataset bigquery_dataset = 5; */ - protected $bigquery_dataset = null; + private $bigquery_dataset = null; /** * Constructor. diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LinkMetadata.php b/Logging/src/V2/LinkMetadata.php similarity index 98% rename from owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LinkMetadata.php rename to Logging/src/V2/LinkMetadata.php index 0b30b1b01e72..ccb41c534ccc 100644 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LinkMetadata.php +++ b/Logging/src/V2/LinkMetadata.php @@ -20,19 +20,19 @@ class LinkMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; */ - protected $start_time = null; + private $start_time = null; /** * The end time of an operation. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; */ - protected $end_time = null; + private $end_time = null; /** * State of an operation. * * Generated from protobuf field .google.logging.v2.OperationState state = 3; */ - protected $state = 0; + private $state = 0; protected $request; /** diff --git a/Logging/src/V2/ListBucketsRequest.php b/Logging/src/V2/ListBucketsRequest.php index c7fa80fa97b2..4d630f156c7a 100644 --- a/Logging/src/V2/ListBucketsRequest.php +++ b/Logging/src/V2/ListBucketsRequest.php @@ -29,18 +29,18 @@ class ListBucketsRequest extends \Google\Protobuf\Internal\Message */ private $parent = ''; /** - * Optional. If present, then retrieve the next batch of results from the preceding call - * to this method. `pageToken` must be the value of `nextPageToken` from the - * previous response. The values of other method parameters should be - * identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. * * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; */ private $page_token = ''; /** - * Optional. The maximum number of results to return from this request. Non-positive - * values are ignored. The presence of `nextPageToken` in the response - * indicates that more results might be available. + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. * * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -62,14 +62,14 @@ class ListBucketsRequest extends \Google\Protobuf\Internal\Message * supplying the character `-` in place of [LOCATION_ID] will return all * buckets. * @type string $page_token - * Optional. If present, then retrieve the next batch of results from the preceding call - * to this method. `pageToken` must be the value of `nextPageToken` from the - * previous response. The values of other method parameters should be - * identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. * @type int $page_size - * Optional. The maximum number of results to return from this request. Non-positive - * values are ignored. The presence of `nextPageToken` in the response - * indicates that more results might be available. + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. * } */ public function __construct($data = NULL) { @@ -118,10 +118,10 @@ public function setParent($var) } /** - * Optional. If present, then retrieve the next batch of results from the preceding call - * to this method. `pageToken` must be the value of `nextPageToken` from the - * previous response. The values of other method parameters should be - * identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. * * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -132,10 +132,10 @@ public function getPageToken() } /** - * Optional. If present, then retrieve the next batch of results from the preceding call - * to this method. `pageToken` must be the value of `nextPageToken` from the - * previous response. The values of other method parameters should be - * identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. * * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var @@ -150,9 +150,9 @@ public function setPageToken($var) } /** - * Optional. The maximum number of results to return from this request. Non-positive - * values are ignored. The presence of `nextPageToken` in the response - * indicates that more results might be available. + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. * * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; * @return int @@ -163,9 +163,9 @@ public function getPageSize() } /** - * Optional. The maximum number of results to return from this request. Non-positive - * values are ignored. The presence of `nextPageToken` in the response - * indicates that more results might be available. + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. * * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; * @param int $var diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLinksRequest.php b/Logging/src/V2/ListLinksRequest.php similarity index 98% rename from owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLinksRequest.php rename to Logging/src/V2/ListLinksRequest.php index 3d3ddae8c05a..01a7507d36ef 100644 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLinksRequest.php +++ b/Logging/src/V2/ListLinksRequest.php @@ -24,7 +24,7 @@ class ListLinksRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - protected $parent = ''; + private $parent = ''; /** * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `pageToken` must be the value of @@ -32,13 +32,13 @@ class ListLinksRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - protected $page_token = ''; + private $page_token = ''; /** * Optional. The maximum number of results to return from this request. * * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - protected $page_size = 0; + private $page_size = 0; /** * Constructor. diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLinksResponse.php b/Logging/src/V2/ListLinksResponse.php similarity index 98% rename from owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLinksResponse.php rename to Logging/src/V2/ListLinksResponse.php index 0007fb97d2aa..f43420e4d061 100644 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLinksResponse.php +++ b/Logging/src/V2/ListLinksResponse.php @@ -28,7 +28,7 @@ class ListLinksResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - protected $next_page_token = ''; + private $next_page_token = ''; /** * Constructor. diff --git a/Logging/src/V2/ListLogEntriesRequest.php b/Logging/src/V2/ListLogEntriesRequest.php index 982e5b973a2a..8d482a480d68 100644 --- a/Logging/src/V2/ListLogEntriesRequest.php +++ b/Logging/src/V2/ListLogEntriesRequest.php @@ -28,18 +28,17 @@ class ListLogEntriesRequest extends \Google\Protobuf\Internal\Message * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * Projects listed in the `project_ids` field are added to this list. + * A maximum of 100 resources may be specified in a single request. * * Generated from protobuf field repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ private $resource_names; /** - * Optional. A filter that chooses which log entries to return. See [Advanced - * Logs Queries](https://cloud.google.com/logging/docs/view/advanced-queries). - * Only log entries that match the filter are returned. An empty filter - * matches all log entries in the resources listed in `resource_names`. + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. * Referencing a parent resource that is not listed in `resource_names` will - * cause the filter to return no results. The maximum length of the filter is - * 20000 characters. + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. * * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -56,10 +55,10 @@ class ListLogEntriesRequest extends \Google\Protobuf\Internal\Message */ private $order_by = ''; /** - * Optional. The maximum number of results to return from this request. Default is 50. - * If the value is negative or exceeds 1000, the request is rejected. The - * presence of `next_page_token` in the response indicates that more results - * might be available. + * Optional. The maximum number of results to return from this request. + * Default is 50. If the value is negative or exceeds 1000, the request is + * rejected. The presence of `next_page_token` in the response indicates that + * more results might be available. * * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -93,14 +92,13 @@ class ListLogEntriesRequest extends \Google\Protobuf\Internal\Message * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * Projects listed in the `project_ids` field are added to this list. + * A maximum of 100 resources may be specified in a single request. * @type string $filter - * Optional. A filter that chooses which log entries to return. See [Advanced - * Logs Queries](https://cloud.google.com/logging/docs/view/advanced-queries). - * Only log entries that match the filter are returned. An empty filter - * matches all log entries in the resources listed in `resource_names`. + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. * Referencing a parent resource that is not listed in `resource_names` will - * cause the filter to return no results. The maximum length of the filter is - * 20000 characters. + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. * @type string $order_by * Optional. How the results should be sorted. Presently, the only permitted * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first @@ -109,10 +107,10 @@ class ListLogEntriesRequest extends \Google\Protobuf\Internal\Message * in order of decreasing timestamps (newest first). Entries with equal * timestamps are returned in order of their `insert_id` values. * @type int $page_size - * Optional. The maximum number of results to return from this request. Default is 50. - * If the value is negative or exceeds 1000, the request is rejected. The - * presence of `next_page_token` in the response indicates that more results - * might be available. + * Optional. The maximum number of results to return from this request. + * Default is 50. If the value is negative or exceeds 1000, the request is + * rejected. The presence of `next_page_token` in the response indicates that + * more results might be available. * @type string $page_token * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `page_token` must be the value of @@ -138,6 +136,7 @@ public function __construct($data = NULL) { * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * Projects listed in the `project_ids` field are added to this list. + * A maximum of 100 resources may be specified in a single request. * * Generated from protobuf field repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -160,6 +159,7 @@ public function getResourceNames() * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * Projects listed in the `project_ids` field are added to this list. + * A maximum of 100 resources may be specified in a single request. * * Generated from protobuf field repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -174,13 +174,11 @@ public function setResourceNames($var) } /** - * Optional. A filter that chooses which log entries to return. See [Advanced - * Logs Queries](https://cloud.google.com/logging/docs/view/advanced-queries). - * Only log entries that match the filter are returned. An empty filter - * matches all log entries in the resources listed in `resource_names`. + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. * Referencing a parent resource that is not listed in `resource_names` will - * cause the filter to return no results. The maximum length of the filter is - * 20000 characters. + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. * * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -191,13 +189,11 @@ public function getFilter() } /** - * Optional. A filter that chooses which log entries to return. See [Advanced - * Logs Queries](https://cloud.google.com/logging/docs/view/advanced-queries). - * Only log entries that match the filter are returned. An empty filter - * matches all log entries in the resources listed in `resource_names`. + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. * Referencing a parent resource that is not listed in `resource_names` will - * cause the filter to return no results. The maximum length of the filter is - * 20000 characters. + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. * * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var @@ -248,10 +244,10 @@ public function setOrderBy($var) } /** - * Optional. The maximum number of results to return from this request. Default is 50. - * If the value is negative or exceeds 1000, the request is rejected. The - * presence of `next_page_token` in the response indicates that more results - * might be available. + * Optional. The maximum number of results to return from this request. + * Default is 50. If the value is negative or exceeds 1000, the request is + * rejected. The presence of `next_page_token` in the response indicates that + * more results might be available. * * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; * @return int @@ -262,10 +258,10 @@ public function getPageSize() } /** - * Optional. The maximum number of results to return from this request. Default is 50. - * If the value is negative or exceeds 1000, the request is rejected. The - * presence of `next_page_token` in the response indicates that more results - * might be available. + * Optional. The maximum number of results to return from this request. + * Default is 50. If the value is negative or exceeds 1000, the request is + * rejected. The presence of `next_page_token` in the response indicates that + * more results might be available. * * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; * @param int $var diff --git a/Logging/src/V2/ListLogsRequest.php b/Logging/src/V2/ListLogsRequest.php index c7d6ba1fee35..6709cdacfad6 100644 --- a/Logging/src/V2/ListLogsRequest.php +++ b/Logging/src/V2/ListLogsRequest.php @@ -16,7 +16,7 @@ class ListLogsRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The resource name that owns the logs: + * Required. The resource name to list logs for: * * `projects/[PROJECT_ID]` * * `organizations/[ORGANIZATION_ID]` * * `billingAccounts/[BILLING_ACCOUNT_ID]` @@ -25,6 +25,22 @@ class ListLogsRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ private $parent = ''; + /** + * Optional. List of resource names to list logs for: + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * To support legacy queries, it could also be: + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * The resource name in the `parent` field is added to this list. + * + * Generated from protobuf field repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $resource_names; /** * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `nextPageToken` in the @@ -42,21 +58,6 @@ class ListLogsRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ private $page_token = ''; - /** - * Optional. The resource name that owns the logs: - * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * To support legacy queries, it could also be: - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * - * Generated from protobuf field repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - private $resource_names; /** * Constructor. @@ -65,22 +66,13 @@ class ListLogsRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $parent - * Required. The resource name that owns the logs: + * Required. The resource name to list logs for: * * `projects/[PROJECT_ID]` * * `organizations/[ORGANIZATION_ID]` * * `billingAccounts/[BILLING_ACCOUNT_ID]` * * `folders/[FOLDER_ID]` - * @type int $page_size - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * @type string $page_token - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. * @type array|\Google\Protobuf\Internal\RepeatedField $resource_names - * Optional. The resource name that owns the logs: + * Optional. List of resource names to list logs for: * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` @@ -90,6 +82,16 @@ class ListLogsRequest extends \Google\Protobuf\Internal\Message * * `organizations/[ORGANIZATION_ID]` * * `billingAccounts/[BILLING_ACCOUNT_ID]` * * `folders/[FOLDER_ID]` + * The resource name in the `parent` field is added to this list. + * @type int $page_size + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `nextPageToken` in the + * response indicates that more results might be available. + * @type string $page_token + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. * } */ public function __construct($data = NULL) { @@ -98,7 +100,7 @@ public function __construct($data = NULL) { } /** - * Required. The resource name that owns the logs: + * Required. The resource name to list logs for: * * `projects/[PROJECT_ID]` * * `organizations/[ORGANIZATION_ID]` * * `billingAccounts/[BILLING_ACCOUNT_ID]` @@ -113,7 +115,7 @@ public function getParent() } /** - * Required. The resource name that owns the logs: + * Required. The resource name to list logs for: * * `projects/[PROJECT_ID]` * * `organizations/[ORGANIZATION_ID]` * * `billingAccounts/[BILLING_ACCOUNT_ID]` @@ -131,6 +133,52 @@ public function setParent($var) return $this; } + /** + * Optional. List of resource names to list logs for: + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * To support legacy queries, it could also be: + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * The resource name in the `parent` field is added to this list. + * + * Generated from protobuf field repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourceNames() + { + return $this->resource_names; + } + + /** + * Optional. List of resource names to list logs for: + * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * To support legacy queries, it could also be: + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * The resource name in the `parent` field is added to this list. + * + * Generated from protobuf field repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourceNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_names = $arr; + + return $this; + } + /** * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `nextPageToken` in the @@ -193,49 +241,5 @@ public function setPageToken($var) return $this; } - /** - * Optional. The resource name that owns the logs: - * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * To support legacy queries, it could also be: - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * - * Generated from protobuf field repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getResourceNames() - { - return $this->resource_names; - } - - /** - * Optional. The resource name that owns the logs: - * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * To support legacy queries, it could also be: - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * - * Generated from protobuf field repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setResourceNames($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->resource_names = $arr; - - return $this; - } - } diff --git a/Logging/src/V2/ListViewsRequest.php b/Logging/src/V2/ListViewsRequest.php index 2f12f41d4273..29c8050f18b4 100644 --- a/Logging/src/V2/ListViewsRequest.php +++ b/Logging/src/V2/ListViewsRequest.php @@ -23,10 +23,10 @@ class ListViewsRequest extends \Google\Protobuf\Internal\Message */ private $parent = ''; /** - * Optional. If present, then retrieve the next batch of results from the preceding call - * to this method. `pageToken` must be the value of `nextPageToken` from the - * previous response. The values of other method parameters should be - * identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. * * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -50,10 +50,10 @@ class ListViewsRequest extends \Google\Protobuf\Internal\Message * Required. The bucket whose views are to be listed: * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * @type string $page_token - * Optional. If present, then retrieve the next batch of results from the preceding call - * to this method. `pageToken` must be the value of `nextPageToken` from the - * previous response. The values of other method parameters should be - * identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. * @type int $page_size * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `nextPageToken` in the @@ -94,10 +94,10 @@ public function setParent($var) } /** - * Optional. If present, then retrieve the next batch of results from the preceding call - * to this method. `pageToken` must be the value of `nextPageToken` from the - * previous response. The values of other method parameters should be - * identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. * * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -108,10 +108,10 @@ public function getPageToken() } /** - * Optional. If present, then retrieve the next batch of results from the preceding call - * to this method. `pageToken` must be the value of `nextPageToken` from the - * previous response. The values of other method parameters should be - * identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `pageToken` must be the value of + * `nextPageToken` from the previous response. The values of other method + * parameters should be identical to those in the previous call. * * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LocationMetadata.php b/Logging/src/V2/LocationMetadata.php similarity index 97% rename from owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LocationMetadata.php rename to Logging/src/V2/LocationMetadata.php index 9c896b21b87c..5d237af73b1c 100644 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LocationMetadata.php +++ b/Logging/src/V2/LocationMetadata.php @@ -21,7 +21,7 @@ class LocationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool log_analytics_enabled = 1; */ - protected $log_analytics_enabled = false; + private $log_analytics_enabled = false; /** * Constructor. diff --git a/Logging/src/V2/LogBucket.php b/Logging/src/V2/LogBucket.php index 846e40d694e9..203ae09119f1 100644 --- a/Logging/src/V2/LogBucket.php +++ b/Logging/src/V2/LogBucket.php @@ -35,8 +35,8 @@ class LogBucket extends \Google\Protobuf\Internal\Message */ private $description = ''; /** - * Output only. The creation timestamp of the bucket. This is not set for any of the - * default buckets. + * Output only. The creation timestamp of the bucket. This is not set for any + * of the default buckets. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -70,6 +70,13 @@ class LogBucket extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $lifecycle_state = 0; + /** + * Whether log analytics is enabled for this bucket. + * Once enabled, log analytics features cannot be disabled. + * + * Generated from protobuf field bool analytics_enabled = 14; + */ + private $analytics_enabled = false; /** * Log entry field paths that are denied access in this bucket. * The following fields and their children are eligible: `textPayload`, @@ -80,6 +87,12 @@ class LogBucket extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated string restricted_fields = 15; */ private $restricted_fields; + /** + * A list of indexed fields and related configuration data. + * + * Generated from protobuf field repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + private $index_configs; /** * The CMEK settings of the log bucket. If present, new log entries written to * this log bucket are encrypted using the CMEK key provided in this @@ -109,8 +122,8 @@ class LogBucket extends \Google\Protobuf\Internal\Message * @type string $description * Describes this bucket. * @type \Google\Protobuf\Timestamp $create_time - * Output only. The creation timestamp of the bucket. This is not set for any of the - * default buckets. + * Output only. The creation timestamp of the bucket. This is not set for any + * of the default buckets. * @type \Google\Protobuf\Timestamp $update_time * Output only. The last update timestamp of the bucket. * @type int $retention_days @@ -124,12 +137,17 @@ class LogBucket extends \Google\Protobuf\Internal\Message * may only be deleted if they are empty. * @type int $lifecycle_state * Output only. The bucket lifecycle state. + * @type bool $analytics_enabled + * Whether log analytics is enabled for this bucket. + * Once enabled, log analytics features cannot be disabled. * @type array|\Google\Protobuf\Internal\RepeatedField $restricted_fields * Log entry field paths that are denied access in this bucket. * The following fields and their children are eligible: `textPayload`, * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`. * Restricting a repeated field will restrict all values. Adding a parent will * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`) + * @type array<\Google\Cloud\Logging\V2\IndexConfig>|\Google\Protobuf\Internal\RepeatedField $index_configs + * A list of indexed fields and related configuration data. * @type \Google\Cloud\Logging\V2\CmekSettings $cmek_settings * The CMEK settings of the log bucket. If present, new log entries written to * this log bucket are encrypted using the CMEK key provided in this @@ -210,8 +228,8 @@ public function setDescription($var) } /** - * Output only. The creation timestamp of the bucket. This is not set for any of the - * default buckets. + * Output only. The creation timestamp of the bucket. This is not set for any + * of the default buckets. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return \Google\Protobuf\Timestamp|null @@ -232,8 +250,8 @@ public function clearCreateTime() } /** - * Output only. The creation timestamp of the bucket. This is not set for any of the - * default buckets. + * Output only. The creation timestamp of the bucket. This is not set for any + * of the default buckets. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param \Google\Protobuf\Timestamp $var @@ -371,6 +389,34 @@ public function setLifecycleState($var) return $this; } + /** + * Whether log analytics is enabled for this bucket. + * Once enabled, log analytics features cannot be disabled. + * + * Generated from protobuf field bool analytics_enabled = 14; + * @return bool + */ + public function getAnalyticsEnabled() + { + return $this->analytics_enabled; + } + + /** + * Whether log analytics is enabled for this bucket. + * Once enabled, log analytics features cannot be disabled. + * + * Generated from protobuf field bool analytics_enabled = 14; + * @param bool $var + * @return $this + */ + public function setAnalyticsEnabled($var) + { + GPBUtil::checkBool($var); + $this->analytics_enabled = $var; + + return $this; + } + /** * Log entry field paths that are denied access in this bucket. * The following fields and their children are eligible: `textPayload`, @@ -405,6 +451,32 @@ public function setRestrictedFields($var) return $this; } + /** + * A list of indexed fields and related configuration data. + * + * Generated from protobuf field repeated .google.logging.v2.IndexConfig index_configs = 17; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIndexConfigs() + { + return $this->index_configs; + } + + /** + * A list of indexed fields and related configuration data. + * + * Generated from protobuf field repeated .google.logging.v2.IndexConfig index_configs = 17; + * @param array<\Google\Cloud\Logging\V2\IndexConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIndexConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\IndexConfig::class); + $this->index_configs = $arr; + + return $this; + } + /** * The CMEK settings of the log bucket. If present, new log entries written to * this log bucket are encrypted using the CMEK key provided in this diff --git a/Logging/src/V2/LogEntry.php b/Logging/src/V2/LogEntry.php index aedafc43ae38..ac161fc73cc1 100644 --- a/Logging/src/V2/LogEntry.php +++ b/Logging/src/V2/LogEntry.php @@ -48,11 +48,12 @@ class LogEntry extends \Google\Protobuf\Internal\Message */ private $resource = null; /** - * Optional. The time the event described by the log entry occurred. This time is used - * to compute the log entry's age and to enforce the logs retention period. - * If this field is omitted in a new log entry, then Logging assigns it the - * current time. Timestamps have nanosecond accuracy, but trailing zeros in - * the fractional seconds might be omitted when the timestamp is displayed. + * Optional. The time the event described by the log entry occurred. This time + * is used to compute the log entry's age and to enforce the logs retention + * period. If this field is omitted in a new log entry, then Logging assigns + * it the current time. Timestamps have nanosecond accuracy, but trailing + * zeros in the fractional seconds might be omitted when the timestamp is + * displayed. * Incoming log entries must have timestamps that don't exceed the * [logs retention * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in @@ -69,14 +70,15 @@ class LogEntry extends \Google\Protobuf\Internal\Message */ private $receive_timestamp = null; /** - * Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`. + * Optional. The severity of the log entry. The default value is + * `LogSeverity.DEFAULT`. * * Generated from protobuf field .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; */ private $severity = 0; /** - * Optional. A unique identifier for the log entry. If you provide a value, then - * Logging considers other log entries in the same project, with the same + * Optional. A unique identifier for the log entry. If you provide a value, + * then Logging considers other log entries in the same project, with the same * `timestamp`, and with the same `insert_id` to be duplicates which are * removed in a single query result. However, there are no guarantees of * de-duplication in the export of logs. @@ -89,15 +91,15 @@ class LogEntry extends \Google\Protobuf\Internal\Message */ private $insert_id = ''; /** - * Optional. Information about the HTTP request associated with this log entry, if - * applicable. + * Optional. Information about the HTTP request associated with this log + * entry, if applicable. * * Generated from protobuf field .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; */ private $http_request = null; /** - * Optional. A map of key, value pairs that provides additional information about the - * log entry. The labels can be user-defined or system-defined. + * Optional. A map of key, value pairs that provides additional information + * about the log entry. The labels can be user-defined or system-defined. * User-defined labels are arbitrary key, value pairs that you can use to * classify logs. * System-defined labels are defined by GCP services for platform logs. @@ -119,19 +121,44 @@ class LogEntry extends \Google\Protobuf\Internal\Message */ private $operation = null; /** - * Optional. Resource name of the trace associated with the log entry, if any. If it - * contains a relative resource name, the name is assumed to be relative to - * `//tracing.googleapis.com`. Example: - * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824` + * Optional. The REST resource name of the trace being written to + * [Cloud Trace](https://cloud.google.com/trace) in + * association with this log entry. For example, if your trace data is stored + * in the Cloud project "my-trace-project" and if the service that is creating + * the log entry receives a trace header that includes the trace ID "12345", + * then the service should use "projects/my-tracing-project/traces/12345". + * The `trace` field provides the link between logs and traces. By using + * this field, you can navigate from a log entry to a trace. * * Generated from protobuf field string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; */ private $trace = ''; /** - * Optional. The span ID within the trace associated with the log entry. - * For Trace spans, this is the same format that the Trace API v2 uses: a - * 16-character hexadecimal encoding of an 8-byte array, such as - * `000000000000004a`. + * Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span + * associated with the current operation in which the log is being written. + * For example, if a span has the REST resource name of + * "projects/some-project/traces/some-trace/spans/some-span-id", then the + * `span_id` field is "some-span-id". + * A + * [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span) + * represents a single operation within a trace. Whereas a trace may involve + * multiple different microservices running on multiple different machines, + * a span generally corresponds to a single logical operation being performed + * in a single instance of a microservice on one specific machine. Spans + * are the nodes within the tree that is a trace. + * Applications that are [instrumented for + * tracing](https://cloud.google.com/trace/docs/setup) will generally assign a + * new, unique span ID on each incoming request. It is also common to create + * and record additional spans corresponding to internal processing elements + * as well as issuing requests to dependencies. + * The span ID is expected to be a 16-character, hexadecimal encoding of an + * 8-byte array and should not be zero. It should be unique within the trace + * and should, ideally, be generated in a manner that is uniformly random. + * Example values: + * - `000000000000004a` + * - `7a2190356c3fc94b` + * - `0000f00300090021` + * - `d39223e101960076` * * Generated from protobuf field string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -148,14 +175,15 @@ class LogEntry extends \Google\Protobuf\Internal\Message */ private $trace_sampled = false; /** - * Optional. Source code location information associated with the log entry, if any. + * Optional. Source code location information associated with the log entry, + * if any. * * Generated from protobuf field .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; */ private $source_location = null; /** - * Optional. Information indicating this LogEntry is part of a sequence of multiple log - * entries split from a single LogEntry. + * Optional. Information indicating this LogEntry is part of a sequence of + * multiple log entries split from a single LogEntry. * * Generated from protobuf field .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -205,11 +233,12 @@ class LogEntry extends \Google\Protobuf\Internal\Message * The log entry payload, represented as a structure that is * expressed as a JSON object. * @type \Google\Protobuf\Timestamp $timestamp - * Optional. The time the event described by the log entry occurred. This time is used - * to compute the log entry's age and to enforce the logs retention period. - * If this field is omitted in a new log entry, then Logging assigns it the - * current time. Timestamps have nanosecond accuracy, but trailing zeros in - * the fractional seconds might be omitted when the timestamp is displayed. + * Optional. The time the event described by the log entry occurred. This time + * is used to compute the log entry's age and to enforce the logs retention + * period. If this field is omitted in a new log entry, then Logging assigns + * it the current time. Timestamps have nanosecond accuracy, but trailing + * zeros in the fractional seconds might be omitted when the timestamp is + * displayed. * Incoming log entries must have timestamps that don't exceed the * [logs retention * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in @@ -218,10 +247,11 @@ class LogEntry extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\Timestamp $receive_timestamp * Output only. The time the log entry was received by Logging. * @type int $severity - * Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`. + * Optional. The severity of the log entry. The default value is + * `LogSeverity.DEFAULT`. * @type string $insert_id - * Optional. A unique identifier for the log entry. If you provide a value, then - * Logging considers other log entries in the same project, with the same + * Optional. A unique identifier for the log entry. If you provide a value, + * then Logging considers other log entries in the same project, with the same * `timestamp`, and with the same `insert_id` to be duplicates which are * removed in a single query result. However, there are no guarantees of * de-duplication in the export of logs. @@ -230,11 +260,11 @@ class LogEntry extends \Google\Protobuf\Internal\Message * In queries, the `insert_id` is also used to order log entries that have * the same `log_name` and `timestamp` values. * @type \Google\Cloud\Logging\Type\HttpRequest $http_request - * Optional. Information about the HTTP request associated with this log entry, if - * applicable. + * Optional. Information about the HTTP request associated with this log + * entry, if applicable. * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. A map of key, value pairs that provides additional information about the - * log entry. The labels can be user-defined or system-defined. + * Optional. A map of key, value pairs that provides additional information + * about the log entry. The labels can be user-defined or system-defined. * User-defined labels are arbitrary key, value pairs that you can use to * classify logs. * System-defined labels are defined by GCP services for platform logs. @@ -248,15 +278,40 @@ class LogEntry extends \Google\Protobuf\Internal\Message * Optional. Information about an operation associated with the log entry, if * applicable. * @type string $trace - * Optional. Resource name of the trace associated with the log entry, if any. If it - * contains a relative resource name, the name is assumed to be relative to - * `//tracing.googleapis.com`. Example: - * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824` + * Optional. The REST resource name of the trace being written to + * [Cloud Trace](https://cloud.google.com/trace) in + * association with this log entry. For example, if your trace data is stored + * in the Cloud project "my-trace-project" and if the service that is creating + * the log entry receives a trace header that includes the trace ID "12345", + * then the service should use "projects/my-tracing-project/traces/12345". + * The `trace` field provides the link between logs and traces. By using + * this field, you can navigate from a log entry to a trace. * @type string $span_id - * Optional. The span ID within the trace associated with the log entry. - * For Trace spans, this is the same format that the Trace API v2 uses: a - * 16-character hexadecimal encoding of an 8-byte array, such as - * `000000000000004a`. + * Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span + * associated with the current operation in which the log is being written. + * For example, if a span has the REST resource name of + * "projects/some-project/traces/some-trace/spans/some-span-id", then the + * `span_id` field is "some-span-id". + * A + * [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span) + * represents a single operation within a trace. Whereas a trace may involve + * multiple different microservices running on multiple different machines, + * a span generally corresponds to a single logical operation being performed + * in a single instance of a microservice on one specific machine. Spans + * are the nodes within the tree that is a trace. + * Applications that are [instrumented for + * tracing](https://cloud.google.com/trace/docs/setup) will generally assign a + * new, unique span ID on each incoming request. It is also common to create + * and record additional spans corresponding to internal processing elements + * as well as issuing requests to dependencies. + * The span ID is expected to be a 16-character, hexadecimal encoding of an + * 8-byte array and should not be zero. It should be unique within the trace + * and should, ideally, be generated in a manner that is uniformly random. + * Example values: + * - `000000000000004a` + * - `7a2190356c3fc94b` + * - `0000f00300090021` + * - `d39223e101960076` * @type bool $trace_sampled * Optional. The sampling decision of the trace associated with the log entry. * True means that the trace resource name in the `trace` field was sampled @@ -265,10 +320,11 @@ class LogEntry extends \Google\Protobuf\Internal\Message * unknown at the time. A non-sampled `trace` value is still useful as a * request correlation identifier. The default is False. * @type \Google\Cloud\Logging\V2\LogEntrySourceLocation $source_location - * Optional. Source code location information associated with the log entry, if any. + * Optional. Source code location information associated with the log entry, + * if any. * @type \Google\Cloud\Logging\V2\LogSplit $split - * Optional. Information indicating this LogEntry is part of a sequence of multiple log - * entries split from a single LogEntry. + * Optional. Information indicating this LogEntry is part of a sequence of + * multiple log entries split from a single LogEntry. * } */ public function __construct($data = NULL) { @@ -484,11 +540,12 @@ public function setJsonPayload($var) } /** - * Optional. The time the event described by the log entry occurred. This time is used - * to compute the log entry's age and to enforce the logs retention period. - * If this field is omitted in a new log entry, then Logging assigns it the - * current time. Timestamps have nanosecond accuracy, but trailing zeros in - * the fractional seconds might be omitted when the timestamp is displayed. + * Optional. The time the event described by the log entry occurred. This time + * is used to compute the log entry's age and to enforce the logs retention + * period. If this field is omitted in a new log entry, then Logging assigns + * it the current time. Timestamps have nanosecond accuracy, but trailing + * zeros in the fractional seconds might be omitted when the timestamp is + * displayed. * Incoming log entries must have timestamps that don't exceed the * [logs retention * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in @@ -514,11 +571,12 @@ public function clearTimestamp() } /** - * Optional. The time the event described by the log entry occurred. This time is used - * to compute the log entry's age and to enforce the logs retention period. - * If this field is omitted in a new log entry, then Logging assigns it the - * current time. Timestamps have nanosecond accuracy, but trailing zeros in - * the fractional seconds might be omitted when the timestamp is displayed. + * Optional. The time the event described by the log entry occurred. This time + * is used to compute the log entry's age and to enforce the logs retention + * period. If this field is omitted in a new log entry, then Logging assigns + * it the current time. Timestamps have nanosecond accuracy, but trailing + * zeros in the fractional seconds might be omitted when the timestamp is + * displayed. * Incoming log entries must have timestamps that don't exceed the * [logs retention * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in @@ -574,7 +632,8 @@ public function setReceiveTimestamp($var) } /** - * Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`. + * Optional. The severity of the log entry. The default value is + * `LogSeverity.DEFAULT`. * * Generated from protobuf field .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; * @return int @@ -585,7 +644,8 @@ public function getSeverity() } /** - * Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`. + * Optional. The severity of the log entry. The default value is + * `LogSeverity.DEFAULT`. * * Generated from protobuf field .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; * @param int $var @@ -600,8 +660,8 @@ public function setSeverity($var) } /** - * Optional. A unique identifier for the log entry. If you provide a value, then - * Logging considers other log entries in the same project, with the same + * Optional. A unique identifier for the log entry. If you provide a value, + * then Logging considers other log entries in the same project, with the same * `timestamp`, and with the same `insert_id` to be duplicates which are * removed in a single query result. However, there are no guarantees of * de-duplication in the export of logs. @@ -619,8 +679,8 @@ public function getInsertId() } /** - * Optional. A unique identifier for the log entry. If you provide a value, then - * Logging considers other log entries in the same project, with the same + * Optional. A unique identifier for the log entry. If you provide a value, + * then Logging considers other log entries in the same project, with the same * `timestamp`, and with the same `insert_id` to be duplicates which are * removed in a single query result. However, there are no guarantees of * de-duplication in the export of logs. @@ -642,8 +702,8 @@ public function setInsertId($var) } /** - * Optional. Information about the HTTP request associated with this log entry, if - * applicable. + * Optional. Information about the HTTP request associated with this log + * entry, if applicable. * * Generated from protobuf field .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\Logging\Type\HttpRequest|null @@ -664,8 +724,8 @@ public function clearHttpRequest() } /** - * Optional. Information about the HTTP request associated with this log entry, if - * applicable. + * Optional. Information about the HTTP request associated with this log + * entry, if applicable. * * Generated from protobuf field .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\Logging\Type\HttpRequest $var @@ -680,8 +740,8 @@ public function setHttpRequest($var) } /** - * Optional. A map of key, value pairs that provides additional information about the - * log entry. The labels can be user-defined or system-defined. + * Optional. A map of key, value pairs that provides additional information + * about the log entry. The labels can be user-defined or system-defined. * User-defined labels are arbitrary key, value pairs that you can use to * classify logs. * System-defined labels are defined by GCP services for platform logs. @@ -701,8 +761,8 @@ public function getLabels() } /** - * Optional. A map of key, value pairs that provides additional information about the - * log entry. The labels can be user-defined or system-defined. + * Optional. A map of key, value pairs that provides additional information + * about the log entry. The labels can be user-defined or system-defined. * User-defined labels are arbitrary key, value pairs that you can use to * classify logs. * System-defined labels are defined by GCP services for platform logs. @@ -764,10 +824,14 @@ public function setOperation($var) } /** - * Optional. Resource name of the trace associated with the log entry, if any. If it - * contains a relative resource name, the name is assumed to be relative to - * `//tracing.googleapis.com`. Example: - * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824` + * Optional. The REST resource name of the trace being written to + * [Cloud Trace](https://cloud.google.com/trace) in + * association with this log entry. For example, if your trace data is stored + * in the Cloud project "my-trace-project" and if the service that is creating + * the log entry receives a trace header that includes the trace ID "12345", + * then the service should use "projects/my-tracing-project/traces/12345". + * The `trace` field provides the link between logs and traces. By using + * this field, you can navigate from a log entry to a trace. * * Generated from protobuf field string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -778,10 +842,14 @@ public function getTrace() } /** - * Optional. Resource name of the trace associated with the log entry, if any. If it - * contains a relative resource name, the name is assumed to be relative to - * `//tracing.googleapis.com`. Example: - * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824` + * Optional. The REST resource name of the trace being written to + * [Cloud Trace](https://cloud.google.com/trace) in + * association with this log entry. For example, if your trace data is stored + * in the Cloud project "my-trace-project" and if the service that is creating + * the log entry receives a trace header that includes the trace ID "12345", + * then the service should use "projects/my-tracing-project/traces/12345". + * The `trace` field provides the link between logs and traces. By using + * this field, you can navigate from a log entry to a trace. * * Generated from protobuf field string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var @@ -796,10 +864,31 @@ public function setTrace($var) } /** - * Optional. The span ID within the trace associated with the log entry. - * For Trace spans, this is the same format that the Trace API v2 uses: a - * 16-character hexadecimal encoding of an 8-byte array, such as - * `000000000000004a`. + * Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span + * associated with the current operation in which the log is being written. + * For example, if a span has the REST resource name of + * "projects/some-project/traces/some-trace/spans/some-span-id", then the + * `span_id` field is "some-span-id". + * A + * [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span) + * represents a single operation within a trace. Whereas a trace may involve + * multiple different microservices running on multiple different machines, + * a span generally corresponds to a single logical operation being performed + * in a single instance of a microservice on one specific machine. Spans + * are the nodes within the tree that is a trace. + * Applications that are [instrumented for + * tracing](https://cloud.google.com/trace/docs/setup) will generally assign a + * new, unique span ID on each incoming request. It is also common to create + * and record additional spans corresponding to internal processing elements + * as well as issuing requests to dependencies. + * The span ID is expected to be a 16-character, hexadecimal encoding of an + * 8-byte array and should not be zero. It should be unique within the trace + * and should, ideally, be generated in a manner that is uniformly random. + * Example values: + * - `000000000000004a` + * - `7a2190356c3fc94b` + * - `0000f00300090021` + * - `d39223e101960076` * * Generated from protobuf field string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -810,10 +899,31 @@ public function getSpanId() } /** - * Optional. The span ID within the trace associated with the log entry. - * For Trace spans, this is the same format that the Trace API v2 uses: a - * 16-character hexadecimal encoding of an 8-byte array, such as - * `000000000000004a`. + * Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span + * associated with the current operation in which the log is being written. + * For example, if a span has the REST resource name of + * "projects/some-project/traces/some-trace/spans/some-span-id", then the + * `span_id` field is "some-span-id". + * A + * [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span) + * represents a single operation within a trace. Whereas a trace may involve + * multiple different microservices running on multiple different machines, + * a span generally corresponds to a single logical operation being performed + * in a single instance of a microservice on one specific machine. Spans + * are the nodes within the tree that is a trace. + * Applications that are [instrumented for + * tracing](https://cloud.google.com/trace/docs/setup) will generally assign a + * new, unique span ID on each incoming request. It is also common to create + * and record additional spans corresponding to internal processing elements + * as well as issuing requests to dependencies. + * The span ID is expected to be a 16-character, hexadecimal encoding of an + * 8-byte array and should not be zero. It should be unique within the trace + * and should, ideally, be generated in a manner that is uniformly random. + * Example values: + * - `000000000000004a` + * - `7a2190356c3fc94b` + * - `0000f00300090021` + * - `d39223e101960076` * * Generated from protobuf field string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var @@ -864,7 +974,8 @@ public function setTraceSampled($var) } /** - * Optional. Source code location information associated with the log entry, if any. + * Optional. Source code location information associated with the log entry, + * if any. * * Generated from protobuf field .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\Logging\V2\LogEntrySourceLocation|null @@ -885,7 +996,8 @@ public function clearSourceLocation() } /** - * Optional. Source code location information associated with the log entry, if any. + * Optional. Source code location information associated with the log entry, + * if any. * * Generated from protobuf field .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\Logging\V2\LogEntrySourceLocation $var @@ -900,8 +1012,8 @@ public function setSourceLocation($var) } /** - * Optional. Information indicating this LogEntry is part of a sequence of multiple log - * entries split from a single LogEntry. + * Optional. Information indicating this LogEntry is part of a sequence of + * multiple log entries split from a single LogEntry. * * Generated from protobuf field .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\Logging\V2\LogSplit|null @@ -922,8 +1034,8 @@ public function clearSplit() } /** - * Optional. Information indicating this LogEntry is part of a sequence of multiple log - * entries split from a single LogEntry. + * Optional. Information indicating this LogEntry is part of a sequence of + * multiple log entries split from a single LogEntry. * * Generated from protobuf field .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\Logging\V2\LogSplit $var diff --git a/Logging/src/V2/LogExclusion.php b/Logging/src/V2/LogExclusion.php index e07b1351928b..0b15f6adda7c 100644 --- a/Logging/src/V2/LogExclusion.php +++ b/Logging/src/V2/LogExclusion.php @@ -20,10 +20,10 @@ class LogExclusion extends \Google\Protobuf\Internal\Message { /** - * Required. A client-assigned identifier, such as `"load-balancer-exclusion"`. - * Identifiers are limited to 100 characters and can include only letters, - * digits, underscores, hyphens, and periods. First character has to be - * alphanumeric. + * Required. A client-assigned identifier, such as + * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and + * can include only letters, digits, underscores, hyphens, and periods. First + * character has to be alphanumeric. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ @@ -78,10 +78,10 @@ class LogExclusion extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * Required. A client-assigned identifier, such as `"load-balancer-exclusion"`. - * Identifiers are limited to 100 characters and can include only letters, - * digits, underscores, hyphens, and periods. First character has to be - * alphanumeric. + * Required. A client-assigned identifier, such as + * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and + * can include only letters, digits, underscores, hyphens, and periods. First + * character has to be alphanumeric. * @type string $description * Optional. A description of this exclusion. * @type string $filter @@ -112,10 +112,10 @@ public function __construct($data = NULL) { } /** - * Required. A client-assigned identifier, such as `"load-balancer-exclusion"`. - * Identifiers are limited to 100 characters and can include only letters, - * digits, underscores, hyphens, and periods. First character has to be - * alphanumeric. + * Required. A client-assigned identifier, such as + * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and + * can include only letters, digits, underscores, hyphens, and periods. First + * character has to be alphanumeric. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -126,10 +126,10 @@ public function getName() } /** - * Required. A client-assigned identifier, such as `"load-balancer-exclusion"`. - * Identifiers are limited to 100 characters and can include only letters, - * digits, underscores, hyphens, and periods. First character has to be - * alphanumeric. + * Required. A client-assigned identifier, such as + * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and + * can include only letters, digits, underscores, hyphens, and periods. First + * character has to be alphanumeric. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; * @param string $var diff --git a/Logging/src/V2/LogMetric.php b/Logging/src/V2/LogMetric.php index 671bc3fed823..9ccd8fc9b8e4 100644 --- a/Logging/src/V2/LogMetric.php +++ b/Logging/src/V2/LogMetric.php @@ -53,6 +53,17 @@ class LogMetric extends \Google\Protobuf\Internal\Message * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = REQUIRED]; */ private $filter = ''; + /** + * Optional. The resource name of the Log Bucket that owns the Log Metric. + * Only Log Buckets in projects are supported. The bucket has to be in the + * same project as the metric. + * For example: + * `projects/my-project/locations/global/buckets/my-bucket` + * If empty, then the Log Metric is considered a non-Bucket Log Metric. + * + * Generated from protobuf field string bucket_name = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $bucket_name = ''; /** * Optional. If set to True, then this metric is disabled and it does not * generate any points. @@ -86,7 +97,7 @@ class LogMetric extends \Google\Protobuf\Internal\Message * Optional. A `value_extractor` is required when using a distribution * logs-based metric to extract the values to record from a log entry. * Two functions are supported for value extraction: `EXTRACT(field)` or - * `REGEXP_EXTRACT(field, regex)`. The argument are: + * `REGEXP_EXTRACT(field, regex)`. The arguments are: * 1. field: The name of the log entry field from which the value is to be * extracted. * 2. regex: A regular expression using the Google RE2 syntax @@ -111,7 +122,7 @@ class LogMetric extends \Google\Protobuf\Internal\Message * extractor expression in this map. The syntax of the extractor expression * is the same as for the `value_extractor` field. * The extracted value is converted to the type defined in the label - * descriptor. If the either the extraction or the type conversion fails, + * descriptor. If either the extraction or the type conversion fails, * the label will have a default value. The default value for a string * label is an empty string, for an integer label its 0, and for a boolean * label its `false`. @@ -179,6 +190,13 @@ class LogMetric extends \Google\Protobuf\Internal\Message * is used to match log entries. Example: * "resource.type=gae_app AND severity>=ERROR" * The maximum length of the filter is 20000 characters. + * @type string $bucket_name + * Optional. The resource name of the Log Bucket that owns the Log Metric. + * Only Log Buckets in projects are supported. The bucket has to be in the + * same project as the metric. + * For example: + * `projects/my-project/locations/global/buckets/my-bucket` + * If empty, then the Log Metric is considered a non-Bucket Log Metric. * @type bool $disabled * Optional. If set to True, then this metric is disabled and it does not * generate any points. @@ -204,7 +222,7 @@ class LogMetric extends \Google\Protobuf\Internal\Message * Optional. A `value_extractor` is required when using a distribution * logs-based metric to extract the values to record from a log entry. * Two functions are supported for value extraction: `EXTRACT(field)` or - * `REGEXP_EXTRACT(field, regex)`. The argument are: + * `REGEXP_EXTRACT(field, regex)`. The arguments are: * 1. field: The name of the log entry field from which the value is to be * extracted. * 2. regex: A regular expression using the Google RE2 syntax @@ -225,7 +243,7 @@ class LogMetric extends \Google\Protobuf\Internal\Message * extractor expression in this map. The syntax of the extractor expression * is the same as for the `value_extractor` field. * The extracted value is converted to the type defined in the label - * descriptor. If the either the extraction or the type conversion fails, + * descriptor. If either the extraction or the type conversion fails, * the label will have a default value. The default value for a string * label is an empty string, for an integer label its 0, and for a boolean * label its `false`. @@ -359,6 +377,42 @@ public function setFilter($var) return $this; } + /** + * Optional. The resource name of the Log Bucket that owns the Log Metric. + * Only Log Buckets in projects are supported. The bucket has to be in the + * same project as the metric. + * For example: + * `projects/my-project/locations/global/buckets/my-bucket` + * If empty, then the Log Metric is considered a non-Bucket Log Metric. + * + * Generated from protobuf field string bucket_name = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getBucketName() + { + return $this->bucket_name; + } + + /** + * Optional. The resource name of the Log Bucket that owns the Log Metric. + * Only Log Buckets in projects are supported. The bucket has to be in the + * same project as the metric. + * For example: + * `projects/my-project/locations/global/buckets/my-bucket` + * If empty, then the Log Metric is considered a non-Bucket Log Metric. + * + * Generated from protobuf field string bucket_name = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setBucketName($var) + { + GPBUtil::checkString($var, True); + $this->bucket_name = $var; + + return $this; + } + /** * Optional. If set to True, then this metric is disabled and it does not * generate any points. @@ -459,7 +513,7 @@ public function setMetricDescriptor($var) * Optional. A `value_extractor` is required when using a distribution * logs-based metric to extract the values to record from a log entry. * Two functions are supported for value extraction: `EXTRACT(field)` or - * `REGEXP_EXTRACT(field, regex)`. The argument are: + * `REGEXP_EXTRACT(field, regex)`. The arguments are: * 1. field: The name of the log entry field from which the value is to be * extracted. * 2. regex: A regular expression using the Google RE2 syntax @@ -486,7 +540,7 @@ public function getValueExtractor() * Optional. A `value_extractor` is required when using a distribution * logs-based metric to extract the values to record from a log entry. * Two functions are supported for value extraction: `EXTRACT(field)` or - * `REGEXP_EXTRACT(field, regex)`. The argument are: + * `REGEXP_EXTRACT(field, regex)`. The arguments are: * 1. field: The name of the log entry field from which the value is to be * extracted. * 2. regex: A regular expression using the Google RE2 syntax @@ -520,7 +574,7 @@ public function setValueExtractor($var) * extractor expression in this map. The syntax of the extractor expression * is the same as for the `value_extractor` field. * The extracted value is converted to the type defined in the label - * descriptor. If the either the extraction or the type conversion fails, + * descriptor. If either the extraction or the type conversion fails, * the label will have a default value. The default value for a string * label is an empty string, for an integer label its 0, and for a boolean * label its `false`. @@ -542,7 +596,7 @@ public function getLabelExtractors() * extractor expression in this map. The syntax of the extractor expression * is the same as for the `value_extractor` field. * The extracted value is converted to the type defined in the label - * descriptor. If the either the extraction or the type conversion fails, + * descriptor. If either the extraction or the type conversion fails, * the label will have a default value. The default value for a string * label is an empty string, for an integer label its 0, and for a boolean * label its `false`. diff --git a/Logging/src/V2/LogSink.php b/Logging/src/V2/LogSink.php index 56b3f968e837..ed8fcaf2090e 100644 --- a/Logging/src/V2/LogSink.php +++ b/Logging/src/V2/LogSink.php @@ -62,14 +62,15 @@ class LogSink extends \Google\Protobuf\Internal\Message */ private $description = ''; /** - * Optional. If set to true, then this sink is disabled and it does not export any log - * entries. + * Optional. If set to true, then this sink is disabled and it does not export + * any log entries. * * Generated from protobuf field bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; */ private $disabled = false; /** - * Optional. Log entries that match any of these exclusion filters will not be exported. + * Optional. Log entries that match any of these exclusion filters will not be + * exported. * If a log entry is matched by both `filter` and one of `exclusion_filters` * it will not be exported. * @@ -84,9 +85,10 @@ class LogSink extends \Google\Protobuf\Internal\Message */ protected $output_version_format = 0; /** - * Output only. An IAM identity—a service account or group—under which Cloud - * Logging writes the exported log entries to the sink's destination. This - * field is set by + * Output only. An IAM identity—a service account or group—under + * which Cloud Logging writes the exported log entries to the sink's + * destination. This field is either set by specifying + * `custom_writer_identity` or set automatically by * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the * value of `unique_writer_identity` in those methods. @@ -97,20 +99,20 @@ class LogSink extends \Google\Protobuf\Internal\Message * Consult the destination service's documentation to determine the * appropriate IAM roles to assign to the identity. * Sinks that have a destination that is a log bucket in the same project as - * the sink do not have a writer_identity and no additional permissions are + * the sink cannot have a writer_identity and no additional permissions are * required. * * Generated from protobuf field string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $writer_identity = ''; /** - * Optional. This field applies only to sinks owned by organizations and folders. If the - * field is false, the default, only the logs owned by the sink's parent - * resource are available for export. If the field is true, then log entries - * from all the projects, folders, and billing accounts contained in the - * sink's parent resource are also available for export. Whether a particular - * log entry from the children is exported depends on the sink's filter - * expression. + * Optional. This field applies only to sinks owned by organizations and + * folders. If the field is false, the default, only the logs owned by the + * sink's parent resource are available for export. If the field is true, then + * log entries from all the projects, folders, and billing accounts contained + * in the sink's parent resource are also available for export. Whether a + * particular log entry from the children is exported depends on the sink's + * filter expression. * For example, if this field is true, then the filter * `resource.type=gce_instance` would export all Compute Engine VM instance * log entries from all projects in the sink's parent. @@ -171,18 +173,20 @@ class LogSink extends \Google\Protobuf\Internal\Message * Optional. A description of this sink. * The maximum length of the description is 8000 characters. * @type bool $disabled - * Optional. If set to true, then this sink is disabled and it does not export any log - * entries. + * Optional. If set to true, then this sink is disabled and it does not export + * any log entries. * @type array<\Google\Cloud\Logging\V2\LogExclusion>|\Google\Protobuf\Internal\RepeatedField $exclusions - * Optional. Log entries that match any of these exclusion filters will not be exported. + * Optional. Log entries that match any of these exclusion filters will not be + * exported. * If a log entry is matched by both `filter` and one of `exclusion_filters` * it will not be exported. * @type int $output_version_format * Deprecated. This field is unused. * @type string $writer_identity - * Output only. An IAM identity—a service account or group—under which Cloud - * Logging writes the exported log entries to the sink's destination. This - * field is set by + * Output only. An IAM identity—a service account or group—under + * which Cloud Logging writes the exported log entries to the sink's + * destination. This field is either set by specifying + * `custom_writer_identity` or set automatically by * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the * value of `unique_writer_identity` in those methods. @@ -193,16 +197,16 @@ class LogSink extends \Google\Protobuf\Internal\Message * Consult the destination service's documentation to determine the * appropriate IAM roles to assign to the identity. * Sinks that have a destination that is a log bucket in the same project as - * the sink do not have a writer_identity and no additional permissions are + * the sink cannot have a writer_identity and no additional permissions are * required. * @type bool $include_children - * Optional. This field applies only to sinks owned by organizations and folders. If the - * field is false, the default, only the logs owned by the sink's parent - * resource are available for export. If the field is true, then log entries - * from all the projects, folders, and billing accounts contained in the - * sink's parent resource are also available for export. Whether a particular - * log entry from the children is exported depends on the sink's filter - * expression. + * Optional. This field applies only to sinks owned by organizations and + * folders. If the field is false, the default, only the logs owned by the + * sink's parent resource are available for export. If the field is true, then + * log entries from all the projects, folders, and billing accounts contained + * in the sink's parent resource are also available for export. Whether a + * particular log entry from the children is exported depends on the sink's + * filter expression. * For example, if this field is true, then the filter * `resource.type=gce_instance` would export all Compute Engine VM instance * log entries from all projects in the sink's parent. @@ -366,8 +370,8 @@ public function setDescription($var) } /** - * Optional. If set to true, then this sink is disabled and it does not export any log - * entries. + * Optional. If set to true, then this sink is disabled and it does not export + * any log entries. * * Generated from protobuf field bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -378,8 +382,8 @@ public function getDisabled() } /** - * Optional. If set to true, then this sink is disabled and it does not export any log - * entries. + * Optional. If set to true, then this sink is disabled and it does not export + * any log entries. * * Generated from protobuf field bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var @@ -394,7 +398,8 @@ public function setDisabled($var) } /** - * Optional. Log entries that match any of these exclusion filters will not be exported. + * Optional. Log entries that match any of these exclusion filters will not be + * exported. * If a log entry is matched by both `filter` and one of `exclusion_filters` * it will not be exported. * @@ -407,7 +412,8 @@ public function getExclusions() } /** - * Optional. Log entries that match any of these exclusion filters will not be exported. + * Optional. Log entries that match any of these exclusion filters will not be + * exported. * If a log entry is matched by both `filter` and one of `exclusion_filters` * it will not be exported. * @@ -454,9 +460,10 @@ public function setOutputVersionFormat($var) } /** - * Output only. An IAM identity—a service account or group—under which Cloud - * Logging writes the exported log entries to the sink's destination. This - * field is set by + * Output only. An IAM identity—a service account or group—under + * which Cloud Logging writes the exported log entries to the sink's + * destination. This field is either set by specifying + * `custom_writer_identity` or set automatically by * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the * value of `unique_writer_identity` in those methods. @@ -467,7 +474,7 @@ public function setOutputVersionFormat($var) * Consult the destination service's documentation to determine the * appropriate IAM roles to assign to the identity. * Sinks that have a destination that is a log bucket in the same project as - * the sink do not have a writer_identity and no additional permissions are + * the sink cannot have a writer_identity and no additional permissions are * required. * * Generated from protobuf field string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -479,9 +486,10 @@ public function getWriterIdentity() } /** - * Output only. An IAM identity—a service account or group—under which Cloud - * Logging writes the exported log entries to the sink's destination. This - * field is set by + * Output only. An IAM identity—a service account or group—under + * which Cloud Logging writes the exported log entries to the sink's + * destination. This field is either set by specifying + * `custom_writer_identity` or set automatically by * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the * value of `unique_writer_identity` in those methods. @@ -492,7 +500,7 @@ public function getWriterIdentity() * Consult the destination service's documentation to determine the * appropriate IAM roles to assign to the identity. * Sinks that have a destination that is a log bucket in the same project as - * the sink do not have a writer_identity and no additional permissions are + * the sink cannot have a writer_identity and no additional permissions are * required. * * Generated from protobuf field string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -508,13 +516,13 @@ public function setWriterIdentity($var) } /** - * Optional. This field applies only to sinks owned by organizations and folders. If the - * field is false, the default, only the logs owned by the sink's parent - * resource are available for export. If the field is true, then log entries - * from all the projects, folders, and billing accounts contained in the - * sink's parent resource are also available for export. Whether a particular - * log entry from the children is exported depends on the sink's filter - * expression. + * Optional. This field applies only to sinks owned by organizations and + * folders. If the field is false, the default, only the logs owned by the + * sink's parent resource are available for export. If the field is true, then + * log entries from all the projects, folders, and billing accounts contained + * in the sink's parent resource are also available for export. Whether a + * particular log entry from the children is exported depends on the sink's + * filter expression. * For example, if this field is true, then the filter * `resource.type=gce_instance` would export all Compute Engine VM instance * log entries from all projects in the sink's parent. @@ -532,13 +540,13 @@ public function getIncludeChildren() } /** - * Optional. This field applies only to sinks owned by organizations and folders. If the - * field is false, the default, only the logs owned by the sink's parent - * resource are available for export. If the field is true, then log entries - * from all the projects, folders, and billing accounts contained in the - * sink's parent resource are also available for export. Whether a particular - * log entry from the children is exported depends on the sink's filter - * expression. + * Optional. This field applies only to sinks owned by organizations and + * folders. If the field is false, the default, only the logs owned by the + * sink's parent resource are available for export. If the field is true, then + * log entries from all the projects, folders, and billing accounts contained + * in the sink's parent resource are also available for export. Whether a + * particular log entry from the children is exported depends on the sink's + * filter expression. * For example, if this field is true, then the filter * `resource.type=gce_instance` would export all Compute Engine VM instance * log entries from all projects in the sink's parent. diff --git a/Logging/src/V2/Settings.php b/Logging/src/V2/Settings.php index 3a849856433f..12d2c19b5795 100644 --- a/Logging/src/V2/Settings.php +++ b/Logging/src/V2/Settings.php @@ -45,8 +45,8 @@ class Settings extends \Google\Protobuf\Internal\Message */ private $kms_key_name = ''; /** - * Output only. The service account that will be used by the Log Router to access your - * Cloud KMS key. + * Output only. The service account that will be used by the Log Router to + * access your Cloud KMS key. * Before enabling CMEK for Log Router, you must first assign the role * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that * the Log Router will use to access your Cloud KMS key. Use @@ -60,18 +60,18 @@ class Settings extends \Google\Protobuf\Internal\Message */ private $kms_service_account_id = ''; /** - * Optional. The Cloud region that will be used for _Default and _Required log buckets - * for newly created projects and folders. For example `europe-west1`. + * Optional. The Cloud region that will be used for _Default and _Required log + * buckets for newly created projects and folders. For example `europe-west1`. * This setting does not affect the location of custom log buckets. * * Generated from protobuf field string storage_location = 4 [(.google.api.field_behavior) = OPTIONAL]; */ private $storage_location = ''; /** - * Optional. If set to true, the _Default sink in newly created projects and folders - * will created in a disabled state. This can be used to automatically disable - * log ingestion if there is already an aggregated sink configured in the - * hierarchy. The _Default sink can be re-enabled manually if needed. + * Optional. If set to true, the _Default sink in newly created projects and + * folders will created in a disabled state. This can be used to automatically + * disable log ingestion if there is already an aggregated sink configured in + * the hierarchy. The _Default sink can be re-enabled manually if needed. * * Generated from protobuf field bool disable_default_sink = 5 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -104,8 +104,8 @@ class Settings extends \Google\Protobuf\Internal\Message * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) * for more information. * @type string $kms_service_account_id - * Output only. The service account that will be used by the Log Router to access your - * Cloud KMS key. + * Output only. The service account that will be used by the Log Router to + * access your Cloud KMS key. * Before enabling CMEK for Log Router, you must first assign the role * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that * the Log Router will use to access your Cloud KMS key. Use @@ -115,14 +115,14 @@ class Settings extends \Google\Protobuf\Internal\Message * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) * for more information. * @type string $storage_location - * Optional. The Cloud region that will be used for _Default and _Required log buckets - * for newly created projects and folders. For example `europe-west1`. + * Optional. The Cloud region that will be used for _Default and _Required log + * buckets for newly created projects and folders. For example `europe-west1`. * This setting does not affect the location of custom log buckets. * @type bool $disable_default_sink - * Optional. If set to true, the _Default sink in newly created projects and folders - * will created in a disabled state. This can be used to automatically disable - * log ingestion if there is already an aggregated sink configured in the - * hierarchy. The _Default sink can be re-enabled manually if needed. + * Optional. If set to true, the _Default sink in newly created projects and + * folders will created in a disabled state. This can be used to automatically + * disable log ingestion if there is already an aggregated sink configured in + * the hierarchy. The _Default sink can be re-enabled manually if needed. * } */ public function __construct($data = NULL) { @@ -215,8 +215,8 @@ public function setKmsKeyName($var) } /** - * Output only. The service account that will be used by the Log Router to access your - * Cloud KMS key. + * Output only. The service account that will be used by the Log Router to + * access your Cloud KMS key. * Before enabling CMEK for Log Router, you must first assign the role * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that * the Log Router will use to access your Cloud KMS key. Use @@ -235,8 +235,8 @@ public function getKmsServiceAccountId() } /** - * Output only. The service account that will be used by the Log Router to access your - * Cloud KMS key. + * Output only. The service account that will be used by the Log Router to + * access your Cloud KMS key. * Before enabling CMEK for Log Router, you must first assign the role * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that * the Log Router will use to access your Cloud KMS key. Use @@ -259,8 +259,8 @@ public function setKmsServiceAccountId($var) } /** - * Optional. The Cloud region that will be used for _Default and _Required log buckets - * for newly created projects and folders. For example `europe-west1`. + * Optional. The Cloud region that will be used for _Default and _Required log + * buckets for newly created projects and folders. For example `europe-west1`. * This setting does not affect the location of custom log buckets. * * Generated from protobuf field string storage_location = 4 [(.google.api.field_behavior) = OPTIONAL]; @@ -272,8 +272,8 @@ public function getStorageLocation() } /** - * Optional. The Cloud region that will be used for _Default and _Required log buckets - * for newly created projects and folders. For example `europe-west1`. + * Optional. The Cloud region that will be used for _Default and _Required log + * buckets for newly created projects and folders. For example `europe-west1`. * This setting does not affect the location of custom log buckets. * * Generated from protobuf field string storage_location = 4 [(.google.api.field_behavior) = OPTIONAL]; @@ -289,10 +289,10 @@ public function setStorageLocation($var) } /** - * Optional. If set to true, the _Default sink in newly created projects and folders - * will created in a disabled state. This can be used to automatically disable - * log ingestion if there is already an aggregated sink configured in the - * hierarchy. The _Default sink can be re-enabled manually if needed. + * Optional. If set to true, the _Default sink in newly created projects and + * folders will created in a disabled state. This can be used to automatically + * disable log ingestion if there is already an aggregated sink configured in + * the hierarchy. The _Default sink can be re-enabled manually if needed. * * Generated from protobuf field bool disable_default_sink = 5 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -303,10 +303,10 @@ public function getDisableDefaultSink() } /** - * Optional. If set to true, the _Default sink in newly created projects and folders - * will created in a disabled state. This can be used to automatically disable - * log ingestion if there is already an aggregated sink configured in the - * hierarchy. The _Default sink can be re-enabled manually if needed. + * Optional. If set to true, the _Default sink in newly created projects and + * folders will created in a disabled state. This can be used to automatically + * disable log ingestion if there is already an aggregated sink configured in + * the hierarchy. The _Default sink can be re-enabled manually if needed. * * Generated from protobuf field bool disable_default_sink = 5 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var diff --git a/Logging/src/V2/TailLogEntriesRequest.php b/Logging/src/V2/TailLogEntriesRequest.php index 138b90be981f..88dda477c523 100644 --- a/Logging/src/V2/TailLogEntriesRequest.php +++ b/Logging/src/V2/TailLogEntriesRequest.php @@ -31,13 +31,11 @@ class TailLogEntriesRequest extends \Google\Protobuf\Internal\Message */ private $resource_names; /** - * Optional. A filter that chooses which log entries to return. See [Advanced - * Logs Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * Only log entries that match the filter are returned. An empty filter - * matches all log entries in the resources listed in `resource_names`. - * Referencing a parent resource that is not in `resource_names` will cause - * the filter to return no results. The maximum length of the filter is 20000 - * characters. + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. + * Referencing a parent resource that is not listed in `resource_names` will + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. * * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -70,13 +68,11 @@ class TailLogEntriesRequest extends \Google\Protobuf\Internal\Message * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * @type string $filter - * Optional. A filter that chooses which log entries to return. See [Advanced - * Logs Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * Only log entries that match the filter are returned. An empty filter - * matches all log entries in the resources listed in `resource_names`. - * Referencing a parent resource that is not in `resource_names` will cause - * the filter to return no results. The maximum length of the filter is 20000 - * characters. + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. + * Referencing a parent resource that is not listed in `resource_names` will + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. * @type \Google\Protobuf\Duration $buffer_window * Optional. The amount of time to buffer log entries at the server before * being returned to prevent out of order results due to late arriving log @@ -134,13 +130,11 @@ public function setResourceNames($var) } /** - * Optional. A filter that chooses which log entries to return. See [Advanced - * Logs Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * Only log entries that match the filter are returned. An empty filter - * matches all log entries in the resources listed in `resource_names`. - * Referencing a parent resource that is not in `resource_names` will cause - * the filter to return no results. The maximum length of the filter is 20000 - * characters. + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. + * Referencing a parent resource that is not listed in `resource_names` will + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. * * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -151,13 +145,11 @@ public function getFilter() } /** - * Optional. A filter that chooses which log entries to return. See [Advanced - * Logs Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * Only log entries that match the filter are returned. An empty filter - * matches all log entries in the resources listed in `resource_names`. - * Referencing a parent resource that is not in `resource_names` will cause - * the filter to return no results. The maximum length of the filter is 20000 - * characters. + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. + * Referencing a parent resource that is not listed in `resource_names` will + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. * * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/Logging/src/V2/UpdateBucketRequest.php b/Logging/src/V2/UpdateBucketRequest.php index 7affd918ebd4..d27b328d0f0c 100644 --- a/Logging/src/V2/UpdateBucketRequest.php +++ b/Logging/src/V2/UpdateBucketRequest.php @@ -34,9 +34,9 @@ class UpdateBucketRequest extends \Google\Protobuf\Internal\Message */ private $bucket = null; /** - * Required. Field mask that specifies the fields in `bucket` that need an update. A - * bucket field will be overwritten if, and only if, it is in the update mask. - * `name` and output only fields cannot be updated. + * Required. Field mask that specifies the fields in `bucket` that need an + * update. A bucket field will be overwritten if, and only if, it is in the + * update mask. `name` and output only fields cannot be updated. * For a detailed `FieldMask` definition, see: * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask * For example: `updateMask=retention_days` @@ -62,9 +62,9 @@ class UpdateBucketRequest extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\Logging\V2\LogBucket $bucket * Required. The updated bucket. * @type \Google\Protobuf\FieldMask $update_mask - * Required. Field mask that specifies the fields in `bucket` that need an update. A - * bucket field will be overwritten if, and only if, it is in the update mask. - * `name` and output only fields cannot be updated. + * Required. Field mask that specifies the fields in `bucket` that need an + * update. A bucket field will be overwritten if, and only if, it is in the + * update mask. `name` and output only fields cannot be updated. * For a detailed `FieldMask` definition, see: * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask * For example: `updateMask=retention_days` @@ -150,9 +150,9 @@ public function setBucket($var) } /** - * Required. Field mask that specifies the fields in `bucket` that need an update. A - * bucket field will be overwritten if, and only if, it is in the update mask. - * `name` and output only fields cannot be updated. + * Required. Field mask that specifies the fields in `bucket` that need an + * update. A bucket field will be overwritten if, and only if, it is in the + * update mask. `name` and output only fields cannot be updated. * For a detailed `FieldMask` definition, see: * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask * For example: `updateMask=retention_days` @@ -176,9 +176,9 @@ public function clearUpdateMask() } /** - * Required. Field mask that specifies the fields in `bucket` that need an update. A - * bucket field will be overwritten if, and only if, it is in the update mask. - * `name` and output only fields cannot be updated. + * Required. Field mask that specifies the fields in `bucket` that need an + * update. A bucket field will be overwritten if, and only if, it is in the + * update mask. `name` and output only fields cannot be updated. * For a detailed `FieldMask` definition, see: * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask * For example: `updateMask=retention_days` diff --git a/Logging/src/V2/UpdateExclusionRequest.php b/Logging/src/V2/UpdateExclusionRequest.php index b633ae913a82..bbc3f1682f60 100644 --- a/Logging/src/V2/UpdateExclusionRequest.php +++ b/Logging/src/V2/UpdateExclusionRequest.php @@ -28,17 +28,18 @@ class UpdateExclusionRequest extends \Google\Protobuf\Internal\Message */ private $name = ''; /** - * Required. New values for the existing exclusion. Only the fields specified in - * `update_mask` are relevant. + * Required. New values for the existing exclusion. Only the fields specified + * in `update_mask` are relevant. * * Generated from protobuf field .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; */ private $exclusion = null; /** - * Required. A non-empty list of fields to change in the existing exclusion. New values - * for the fields are taken from the corresponding fields in the - * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in - * `update_mask` are not changed and are ignored in the request. + * Required. A non-empty list of fields to change in the existing exclusion. + * New values for the fields are taken from the corresponding fields in the + * [LogExclusion][google.logging.v2.LogExclusion] included in this request. + * Fields not mentioned in `update_mask` are not changed and are ignored in + * the request. * For example, to change the filter and description of an exclusion, * specify an `update_mask` of `"filter,description"`. * @@ -61,13 +62,14 @@ class UpdateExclusionRequest extends \Google\Protobuf\Internal\Message * For example: * `"projects/my-project/exclusions/my-exclusion"` * @type \Google\Cloud\Logging\V2\LogExclusion $exclusion - * Required. New values for the existing exclusion. Only the fields specified in - * `update_mask` are relevant. + * Required. New values for the existing exclusion. Only the fields specified + * in `update_mask` are relevant. * @type \Google\Protobuf\FieldMask $update_mask - * Required. A non-empty list of fields to change in the existing exclusion. New values - * for the fields are taken from the corresponding fields in the - * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in - * `update_mask` are not changed and are ignored in the request. + * Required. A non-empty list of fields to change in the existing exclusion. + * New values for the fields are taken from the corresponding fields in the + * [LogExclusion][google.logging.v2.LogExclusion] included in this request. + * Fields not mentioned in `update_mask` are not changed and are ignored in + * the request. * For example, to change the filter and description of an exclusion, * specify an `update_mask` of `"filter,description"`. * } @@ -116,8 +118,8 @@ public function setName($var) } /** - * Required. New values for the existing exclusion. Only the fields specified in - * `update_mask` are relevant. + * Required. New values for the existing exclusion. Only the fields specified + * in `update_mask` are relevant. * * Generated from protobuf field .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; * @return \Google\Cloud\Logging\V2\LogExclusion|null @@ -138,8 +140,8 @@ public function clearExclusion() } /** - * Required. New values for the existing exclusion. Only the fields specified in - * `update_mask` are relevant. + * Required. New values for the existing exclusion. Only the fields specified + * in `update_mask` are relevant. * * Generated from protobuf field .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; * @param \Google\Cloud\Logging\V2\LogExclusion $var @@ -154,10 +156,11 @@ public function setExclusion($var) } /** - * Required. A non-empty list of fields to change in the existing exclusion. New values - * for the fields are taken from the corresponding fields in the - * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in - * `update_mask` are not changed and are ignored in the request. + * Required. A non-empty list of fields to change in the existing exclusion. + * New values for the fields are taken from the corresponding fields in the + * [LogExclusion][google.logging.v2.LogExclusion] included in this request. + * Fields not mentioned in `update_mask` are not changed and are ignored in + * the request. * For example, to change the filter and description of an exclusion, * specify an `update_mask` of `"filter,description"`. * @@ -180,10 +183,11 @@ public function clearUpdateMask() } /** - * Required. A non-empty list of fields to change in the existing exclusion. New values - * for the fields are taken from the corresponding fields in the - * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in - * `update_mask` are not changed and are ignored in the request. + * Required. A non-empty list of fields to change in the existing exclusion. + * New values for the fields are taken from the corresponding fields in the + * [LogExclusion][google.logging.v2.LogExclusion] included in this request. + * Fields not mentioned in `update_mask` are not changed and are ignored in + * the request. * For example, to change the filter and description of an exclusion, * specify an `update_mask` of `"filter,description"`. * diff --git a/Logging/src/V2/UpdateSinkRequest.php b/Logging/src/V2/UpdateSinkRequest.php index e5d9b543e1c4..d92b2a789681 100644 --- a/Logging/src/V2/UpdateSinkRequest.php +++ b/Logging/src/V2/UpdateSinkRequest.php @@ -16,8 +16,8 @@ class UpdateSinkRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The full resource name of the sink to update, including the parent - * resource and the sink identifier: + * Required. The full resource name of the sink to update, including the + * parent resource and the sink identifier: * "projects/[PROJECT_ID]/sinks/[SINK_ID]" * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" @@ -29,8 +29,8 @@ class UpdateSinkRequest extends \Google\Protobuf\Internal\Message */ private $sink_name = ''; /** - * Required. The updated sink, whose name is the same identifier that appears as part - * of `sink_name`. + * Required. The updated sink, whose name is the same identifier that appears + * as part of `sink_name`. * * Generated from protobuf field .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; */ @@ -74,8 +74,8 @@ class UpdateSinkRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $sink_name - * Required. The full resource name of the sink to update, including the parent - * resource and the sink identifier: + * Required. The full resource name of the sink to update, including the + * parent resource and the sink identifier: * "projects/[PROJECT_ID]/sinks/[SINK_ID]" * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" @@ -83,8 +83,8 @@ class UpdateSinkRequest extends \Google\Protobuf\Internal\Message * For example: * `"projects/my-project/sinks/my-sink"` * @type \Google\Cloud\Logging\V2\LogSink $sink - * Required. The updated sink, whose name is the same identifier that appears as part - * of `sink_name`. + * Required. The updated sink, whose name is the same identifier that appears + * as part of `sink_name`. * @type bool $unique_writer_identity * Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] * for a description of this field. When updating a sink, the effect of this @@ -116,8 +116,8 @@ public function __construct($data = NULL) { } /** - * Required. The full resource name of the sink to update, including the parent - * resource and the sink identifier: + * Required. The full resource name of the sink to update, including the + * parent resource and the sink identifier: * "projects/[PROJECT_ID]/sinks/[SINK_ID]" * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" @@ -134,8 +134,8 @@ public function getSinkName() } /** - * Required. The full resource name of the sink to update, including the parent - * resource and the sink identifier: + * Required. The full resource name of the sink to update, including the + * parent resource and the sink identifier: * "projects/[PROJECT_ID]/sinks/[SINK_ID]" * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" @@ -156,8 +156,8 @@ public function setSinkName($var) } /** - * Required. The updated sink, whose name is the same identifier that appears as part - * of `sink_name`. + * Required. The updated sink, whose name is the same identifier that appears + * as part of `sink_name`. * * Generated from protobuf field .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; * @return \Google\Cloud\Logging\V2\LogSink|null @@ -178,8 +178,8 @@ public function clearSink() } /** - * Required. The updated sink, whose name is the same identifier that appears as part - * of `sink_name`. + * Required. The updated sink, whose name is the same identifier that appears + * as part of `sink_name`. * * Generated from protobuf field .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; * @param \Google\Cloud\Logging\V2\LogSink $var diff --git a/Logging/src/V2/WriteLogEntriesRequest.php b/Logging/src/V2/WriteLogEntriesRequest.php index 20575291d434..203a0f95bc87 100644 --- a/Logging/src/V2/WriteLogEntriesRequest.php +++ b/Logging/src/V2/WriteLogEntriesRequest.php @@ -80,11 +80,13 @@ class WriteLogEntriesRequest extends \Google\Protobuf\Internal\Message */ private $entries; /** - * Optional. Whether valid entries should be written even if some other - * entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any - * entry is not written, then the response status is the error associated - * with one of the failed entries and the response includes error details - * keyed by the entries' zero-based index in the `entries.write` method. + * Optional. Whether a batch's valid entries should be written even if some + * other entry failed due to a permanent error such as INVALID_ARGUMENT or + * PERMISSION_DENIED. If any entry failed, then the response status is the + * response status of one of the failed entries. The response will include + * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by + * the entries' zero-based index in the `entries`. Failed requests for which + * no entries are written will not include per-entry errors. * * Generated from protobuf field bool partial_success = 5 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -153,11 +155,13 @@ class WriteLogEntriesRequest extends \Google\Protobuf\Internal\Message * `entries.write`, you should try to include several log entries in this * list, rather than calling this method for each individual log entry. * @type bool $partial_success - * Optional. Whether valid entries should be written even if some other - * entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any - * entry is not written, then the response status is the error associated - * with one of the failed entries and the response includes error details - * keyed by the entries' zero-based index in the `entries.write` method. + * Optional. Whether a batch's valid entries should be written even if some + * other entry failed due to a permanent error such as INVALID_ARGUMENT or + * PERMISSION_DENIED. If any entry failed, then the response status is the + * response status of one of the failed entries. The response will include + * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by + * the entries' zero-based index in the `entries`. Failed requests for which + * no entries are written will not include per-entry errors. * @type bool $dry_run * Optional. If true, the request should expect normal response, but the * entries won't be persisted nor exported. Useful for checking whether the @@ -364,11 +368,13 @@ public function setEntries($var) } /** - * Optional. Whether valid entries should be written even if some other - * entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any - * entry is not written, then the response status is the error associated - * with one of the failed entries and the response includes error details - * keyed by the entries' zero-based index in the `entries.write` method. + * Optional. Whether a batch's valid entries should be written even if some + * other entry failed due to a permanent error such as INVALID_ARGUMENT or + * PERMISSION_DENIED. If any entry failed, then the response status is the + * response status of one of the failed entries. The response will include + * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by + * the entries' zero-based index in the `entries`. Failed requests for which + * no entries are written will not include per-entry errors. * * Generated from protobuf field bool partial_success = 5 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -379,11 +385,13 @@ public function getPartialSuccess() } /** - * Optional. Whether valid entries should be written even if some other - * entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any - * entry is not written, then the response status is the error associated - * with one of the failed entries and the response includes error details - * keyed by the entries' zero-based index in the `entries.write` method. + * Optional. Whether a batch's valid entries should be written even if some + * other entry failed due to a permanent error such as INVALID_ARGUMENT or + * PERMISSION_DENIED. If any entry failed, then the response status is the + * response status of one of the failed entries. The response will include + * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by + * the entries' zero-based index in the `entries`. Failed requests for which + * no entries are written will not include per-entry errors. * * Generated from protobuf field bool partial_success = 5 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var diff --git a/Logging/src/V2/gapic_metadata.json b/Logging/src/V2/gapic_metadata.json index 8832bfcc1b96..30328b652386 100644 --- a/Logging/src/V2/gapic_metadata.json +++ b/Logging/src/V2/gapic_metadata.json @@ -59,11 +59,21 @@ "createBucket" ] }, + "CreateBucketAsync": { + "methods": [ + "createBucketAsync" + ] + }, "CreateExclusion": { "methods": [ "createExclusion" ] }, + "CreateLink": { + "methods": [ + "createLink" + ] + }, "CreateSink": { "methods": [ "createSink" @@ -84,6 +94,11 @@ "deleteExclusion" ] }, + "DeleteLink": { + "methods": [ + "deleteLink" + ] + }, "DeleteSink": { "methods": [ "deleteSink" @@ -109,6 +124,11 @@ "getExclusion" ] }, + "GetLink": { + "methods": [ + "getLink" + ] + }, "GetSettings": { "methods": [ "getSettings" @@ -134,6 +154,11 @@ "listExclusions" ] }, + "ListLinks": { + "methods": [ + "listLinks" + ] + }, "ListSinks": { "methods": [ "listSinks" @@ -154,6 +179,11 @@ "updateBucket" ] }, + "UpdateBucketAsync": { + "methods": [ + "updateBucketAsync" + ] + }, "UpdateCmekSettings": { "methods": [ "updateCmekSettings" diff --git a/Logging/src/V2/resources/config_service_v2_client_config.json b/Logging/src/V2/resources/config_service_v2_client_config.json index c7d9294488ff..02c54aca2baf 100644 --- a/Logging/src/V2/resources/config_service_v2_client_config.json +++ b/Logging/src/V2/resources/config_service_v2_client_config.json @@ -50,11 +50,21 @@ "retry_codes_name": "no_retry_codes", "retry_params_name": "no_retry_params" }, + "CreateBucketAsync": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "CreateExclusion": { "timeout_millis": 120000, "retry_codes_name": "no_retry_2_codes", "retry_params_name": "no_retry_2_params" }, + "CreateLink": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "CreateSink": { "timeout_millis": 120000, "retry_codes_name": "no_retry_2_codes", @@ -75,6 +85,11 @@ "retry_codes_name": "retry_policy_3_codes", "retry_params_name": "retry_policy_3_params" }, + "DeleteLink": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "DeleteSink": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_3_codes", @@ -100,6 +115,11 @@ "retry_codes_name": "retry_policy_3_codes", "retry_params_name": "retry_policy_3_params" }, + "GetLink": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "GetSettings": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", @@ -125,6 +145,11 @@ "retry_codes_name": "retry_policy_3_codes", "retry_params_name": "retry_policy_3_params" }, + "ListLinks": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "ListSinks": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_3_codes", @@ -145,6 +170,11 @@ "retry_codes_name": "no_retry_codes", "retry_params_name": "no_retry_params" }, + "UpdateBucketAsync": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "UpdateCmekSettings": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", diff --git a/Logging/src/V2/resources/config_service_v2_descriptor_config.php b/Logging/src/V2/resources/config_service_v2_descriptor_config.php index 0100abd34463..6a39eefe2010 100644 --- a/Logging/src/V2/resources/config_service_v2_descriptor_config.php +++ b/Logging/src/V2/resources/config_service_v2_descriptor_config.php @@ -13,6 +13,46 @@ 'totalPollTimeoutMillis' => '300000', ], ], + 'CreateBucketAsync' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Logging\V2\LogBucket', + 'metadataReturnType' => '\Google\Cloud\Logging\V2\BucketMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateLink' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Logging\V2\Link', + 'metadataReturnType' => '\Google\Cloud\Logging\V2\LinkMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteLink' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Logging\V2\LinkMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateBucketAsync' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Logging\V2\LogBucket', + 'metadataReturnType' => '\Google\Cloud\Logging\V2\BucketMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], 'ListBuckets' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -33,6 +73,16 @@ 'resourcesGetMethod' => 'getExclusions', ], ], + 'ListLinks' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLinks', + ], + ], 'ListSinks' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', diff --git a/Logging/src/V2/resources/config_service_v2_rest_client_config.php b/Logging/src/V2/resources/config_service_v2_rest_client_config.php index 06f61cd9b95f..dac023f81c6c 100644 --- a/Logging/src/V2/resources/config_service_v2_rest_client_config.php +++ b/Logging/src/V2/resources/config_service_v2_rest_client_config.php @@ -57,6 +57,40 @@ 'bucket_id', ], ], + 'CreateBucketAsync' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=*/*/locations/*}/buckets:createAsync', + 'body' => 'bucket', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/buckets:createAsync', + 'body' => 'bucket', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=organizations/*/locations/*}/buckets:createAsync', + 'body' => 'bucket', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=folders/*/locations/*}/buckets:createAsync', + 'body' => 'bucket', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=billingAccounts/*/locations/*}/buckets:createAsync', + 'body' => 'bucket', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'CreateExclusion' => [ 'method' => 'post', 'uriTemplate' => '/v2/{parent=*/*}/exclusions', @@ -91,6 +125,55 @@ ], ], ], + 'CreateLink' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=*/*/locations/*/buckets/*}/links', + 'body' => 'link', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/buckets/*}/links', + 'body' => 'link', + 'queryParams' => [ + 'link_id', + ], + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=organizations/*/locations/*/buckets/*}/links', + 'body' => 'link', + 'queryParams' => [ + 'link_id', + ], + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=folders/*/locations/*/buckets/*}/links', + 'body' => 'link', + 'queryParams' => [ + 'link_id', + ], + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=billingAccounts/*/locations/*/buckets/*}/links', + 'body' => 'link', + 'queryParams' => [ + 'link_id', + ], + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'link_id', + ], + ], 'CreateSink' => [ 'method' => 'post', 'uriTemplate' => '/v2/{parent=*/*}/sinks', @@ -232,6 +315,35 @@ ], ], ], + 'DeleteLink' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*/links/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*/links/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*/links/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*/links/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*/links/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'DeleteSink' => [ 'method' => 'delete', 'uriTemplate' => '/v2/{sink_name=*/*/sinks/*}', @@ -308,7 +420,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v2/{name=billingAccounts/*/buckets/*}', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*}', ], ], 'placeholders' => [ @@ -377,6 +489,35 @@ ], ], ], + 'GetLink' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*/links/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*/links/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*/links/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*/links/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*/links/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetSettings' => [ 'method' => 'get', 'uriTemplate' => '/v2/{name=*/*}/settings', @@ -453,7 +594,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v2/{name=billingAccounts/*/buckets/*/views/*}', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}', ], ], 'placeholders' => [ @@ -522,6 +663,35 @@ ], ], ], + 'ListLinks' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=*/*/locations/*/buckets/*}/links', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/buckets/*}/links', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=organizations/*/locations/*/buckets/*}/links', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=folders/*/locations/*/buckets/*}/links', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=billingAccounts/*/locations/*/buckets/*}/links', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'ListSinks' => [ 'method' => 'get', 'uriTemplate' => '/v2/{parent=*/*}/sinks', @@ -663,6 +833,40 @@ 'update_mask', ], ], + 'UpdateBucketAsync' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*}:updateAsync', + 'body' => 'bucket', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*}:updateAsync', + 'body' => 'bucket', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*}:updateAsync', + 'body' => 'bucket', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*}:updateAsync', + 'body' => 'bucket', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*}:updateAsync', + 'body' => 'bucket', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'UpdateCmekSettings' => [ 'method' => 'patch', 'uriTemplate' => '/v2/{name=*/*}/cmekSettings', @@ -897,7 +1101,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v2/{name=billingAccounts/*/operations/*}', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/operations/*}', ], ], 'placeholders' => [ diff --git a/Logging/src/V2/resources/logging_service_v2_rest_client_config.php b/Logging/src/V2/resources/logging_service_v2_rest_client_config.php index d0099b09a4ae..00e4c2f5ffa8 100644 --- a/Logging/src/V2/resources/logging_service_v2_rest_client_config.php +++ b/Logging/src/V2/resources/logging_service_v2_rest_client_config.php @@ -57,6 +57,22 @@ 'method' => 'get', 'uriTemplate' => '/v2/{parent=billingAccounts/*}/logs', ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/buckets/*/views/*}/logs', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=organizations/*/locations/*/buckets/*/views/*}/logs', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=folders/*/locations/*/buckets/*/views/*}/logs', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=billingAccounts/*/locations/*/buckets/*/views/*}/logs', + ], ], 'placeholders' => [ 'parent' => [ @@ -129,7 +145,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v2/{name=billingAccounts/*/operations/*}', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/operations/*}', ], ], 'placeholders' => [ diff --git a/Logging/src/V2/resources/metrics_service_v2_rest_client_config.php b/Logging/src/V2/resources/metrics_service_v2_rest_client_config.php index 7fbdfce40171..9d07868f5bec 100644 --- a/Logging/src/V2/resources/metrics_service_v2_rest_client_config.php +++ b/Logging/src/V2/resources/metrics_service_v2_rest_client_config.php @@ -114,7 +114,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v2/{name=billingAccounts/*/operations/*}', + 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/operations/*}', ], ], 'placeholders' => [ diff --git a/Logging/tests/Unit/V2/ConfigServiceV2ClientTest.php b/Logging/tests/Unit/V2/ConfigServiceV2ClientTest.php index 381b2e7ae151..06a1f5a65009 100644 --- a/Logging/tests/Unit/V2/ConfigServiceV2ClientTest.php +++ b/Logging/tests/Unit/V2/ConfigServiceV2ClientTest.php @@ -30,8 +30,10 @@ use Google\Cloud\Logging\V2\CmekSettings; use Google\Cloud\Logging\V2\ConfigServiceV2Client; use Google\Cloud\Logging\V2\CopyLogEntriesResponse; +use Google\Cloud\Logging\V2\Link; use Google\Cloud\Logging\V2\ListBucketsResponse; use Google\Cloud\Logging\V2\ListExclusionsResponse; +use Google\Cloud\Logging\V2\ListLinksResponse; use Google\Cloud\Logging\V2\ListSinksResponse; use Google\Cloud\Logging\V2\ListViewsResponse; use Google\Cloud\Logging\V2\LogBucket; @@ -211,11 +213,13 @@ public function createBucketTest() $description = 'description-1724546052'; $retentionDays = 1544391896; $locked = true; + $analyticsEnabled = true; $expectedResponse = new LogBucket(); $expectedResponse->setName($name); $expectedResponse->setDescription($description); $expectedResponse->setRetentionDays($retentionDays); $expectedResponse->setLocked($locked); + $expectedResponse->setAnalyticsEnabled($analyticsEnabled); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); @@ -272,6 +276,141 @@ public function createBucketExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function createBucketAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBucketAsyncTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $retentionDays = 1544391896; + $locked = true; + $analyticsEnabled = true; + $expectedResponse = new LogBucket(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setRetentionDays($retentionDays); + $expectedResponse->setLocked($locked); + $expectedResponse->setAnalyticsEnabled($analyticsEnabled); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createBucketAsyncTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $bucketId = 'bucketId1837164432'; + $bucket = new LogBucket(); + $response = $gapicClient->createBucketAsync($formattedParent, $bucketId, $bucket); + $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.logging.v2.ConfigServiceV2/CreateBucketAsync', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getBucketId(); + $this->assertProtobufEquals($bucketId, $actualValue); + $actualValue = $actualApiRequestObject->getBucket(); + $this->assertProtobufEquals($bucket, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBucketAsyncTest'); + $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 createBucketAsyncExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBucketAsyncTest'); + $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]'); + $bucketId = 'bucketId1837164432'; + $bucket = new LogBucket(); + $response = $gapicClient->createBucketAsync($formattedParent, $bucketId, $bucket); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBucketAsyncTest'); + 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 createExclusionTest() { @@ -350,6 +489,135 @@ public function createExclusionExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function createLinkTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createLinkTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $expectedResponse = new Link(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createLinkTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + $link = new Link(); + $linkId = 'linkId177080192'; + $response = $gapicClient->createLink($formattedParent, $link, $linkId); + $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.logging.v2.ConfigServiceV2/CreateLink', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getLink(); + $this->assertProtobufEquals($link, $actualValue); + $actualValue = $actualApiRequestObject->getLinkId(); + $this->assertProtobufEquals($linkId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createLinkTest'); + $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 createLinkExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createLinkTest'); + $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->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + $link = new Link(); + $linkId = 'linkId177080192'; + $response = $gapicClient->createLink($formattedParent, $link, $linkId); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createLinkTest'); + 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 createSinkTest() { @@ -598,26 +866,143 @@ public function deleteExclusionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ + $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->logExclusionName('[PROJECT]', '[EXCLUSION]'); + try { + $gapicClient->deleteExclusion($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 deleteLinkTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteLinkTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteLinkTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->linkName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[LINK]'); + $response = $gapicClient->deleteLink($formattedName); + $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.logging.v2.ConfigServiceV2/DeleteLink', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteLinkTest'); + $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 deleteLinkExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteLinkTest'); + $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); - $transport->addResponse(null, $status); + $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->logExclusionName('[PROJECT]', '[EXCLUSION]'); + $formattedName = $gapicClient->linkName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[LINK]'); + $response = $gapicClient->deleteLink($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteLinkTest'); try { - $gapicClient->deleteExclusion($formattedName); - // If the $gapicClient method call did not throw, fail the test + $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 stub is exhausted + // Call popReceivedCalls to ensure the stubs are exhausted $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ @@ -747,11 +1132,13 @@ public function getBucketTest() $description = 'description-1724546052'; $retentionDays = 1544391896; $locked = true; + $analyticsEnabled = true; $expectedResponse = new LogBucket(); $expectedResponse->setName($name2); $expectedResponse->setDescription($description); $expectedResponse->setRetentionDays($retentionDays); $expectedResponse->setLocked($locked); + $expectedResponse->setAnalyticsEnabled($analyticsEnabled); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); @@ -811,10 +1198,12 @@ public function getCmekSettingsTest() // Mock response $name2 = 'name2-1052831874'; $kmsKeyName = 'kmsKeyName2094986649'; + $kmsKeyVersionName = 'kmsKeyVersionName-1734350176'; $serviceAccountId = 'serviceAccountId-111486921'; $expectedResponse = new CmekSettings(); $expectedResponse->setName($name2); $expectedResponse->setKmsKeyName($kmsKeyName); + $expectedResponse->setKmsKeyVersionName($kmsKeyVersionName); $expectedResponse->setServiceAccountId($serviceAccountId); $transport->addResponse($expectedResponse); $response = $gapicClient->getCmekSettings(); @@ -924,6 +1313,68 @@ public function getExclusionExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function getLinkTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $expectedResponse = new Link(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->linkName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[LINK]'); + $response = $gapicClient->getLink($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/GetLink', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLinkExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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->linkName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[LINK]'); + try { + $gapicClient->getLink($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 getSettingsTest() { @@ -1264,6 +1715,74 @@ public function listExclusionsExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function listLinksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $linksElement = new Link(); + $links = [ + $linksElement, + ]; + $expectedResponse = new ListLinksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLinks($links); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + $response = $gapicClient->listLinks($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLinks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.logging.v2.ConfigServiceV2/ListLinks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLinksExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + try { + $gapicClient->listLinks($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 listSinksTest() { @@ -1470,11 +1989,13 @@ public function updateBucketTest() $description = 'description-1724546052'; $retentionDays = 1544391896; $locked = true; + $analyticsEnabled = true; $expectedResponse = new LogBucket(); $expectedResponse->setName($name2); $expectedResponse->setDescription($description); $expectedResponse->setRetentionDays($retentionDays); $expectedResponse->setLocked($locked); + $expectedResponse->setAnalyticsEnabled($analyticsEnabled); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); @@ -1531,6 +2052,141 @@ public function updateBucketExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function updateBucketAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateBucketAsyncTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $retentionDays = 1544391896; + $locked = true; + $analyticsEnabled = true; + $expectedResponse = new LogBucket(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setRetentionDays($retentionDays); + $expectedResponse->setLocked($locked); + $expectedResponse->setAnalyticsEnabled($analyticsEnabled); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateBucketAsyncTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + $bucket = new LogBucket(); + $updateMask = new FieldMask(); + $response = $gapicClient->updateBucketAsync($formattedName, $bucket, $updateMask); + $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.logging.v2.ConfigServiceV2/UpdateBucketAsync', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getBucket(); + $this->assertProtobufEquals($bucket, $actualValue); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateBucketAsyncTest'); + $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 updateBucketAsyncExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateBucketAsyncTest'); + $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->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); + $bucket = new LogBucket(); + $updateMask = new FieldMask(); + $response = $gapicClient->updateBucketAsync($formattedName, $bucket, $updateMask); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateBucketAsyncTest'); + 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 updateCmekSettingsTest() { @@ -1542,10 +2198,12 @@ public function updateCmekSettingsTest() // Mock response $name2 = 'name2-1052831874'; $kmsKeyName = 'kmsKeyName2094986649'; + $kmsKeyVersionName = 'kmsKeyVersionName-1734350176'; $serviceAccountId = 'serviceAccountId-111486921'; $expectedResponse = new CmekSettings(); $expectedResponse->setName($name2); $expectedResponse->setKmsKeyName($kmsKeyName); + $expectedResponse->setKmsKeyVersionName($kmsKeyVersionName); $expectedResponse->setServiceAccountId($serviceAccountId); $transport->addResponse($expectedResponse); $response = $gapicClient->updateCmekSettings(); diff --git a/Logging/tests/Unit/V2/MetricsServiceV2ClientTest.php b/Logging/tests/Unit/V2/MetricsServiceV2ClientTest.php index ad74a51b6ab2..266693c43af7 100644 --- a/Logging/tests/Unit/V2/MetricsServiceV2ClientTest.php +++ b/Logging/tests/Unit/V2/MetricsServiceV2ClientTest.php @@ -73,12 +73,14 @@ public function createLogMetricTest() $name = 'name3373707'; $description = 'description-1724546052'; $filter = 'filter-1274492040'; + $bucketName = 'bucketName283610048'; $disabled = true; $valueExtractor = 'valueExtractor2047672534'; $expectedResponse = new LogMetric(); $expectedResponse->setName($name); $expectedResponse->setDescription($description); $expectedResponse->setFilter($filter); + $expectedResponse->setBucketName($bucketName); $expectedResponse->setDisabled($disabled); $expectedResponse->setValueExtractor($valueExtractor); $transport->addResponse($expectedResponse); @@ -210,12 +212,14 @@ public function getLogMetricTest() $name = 'name3373707'; $description = 'description-1724546052'; $filter = 'filter-1274492040'; + $bucketName = 'bucketName283610048'; $disabled = true; $valueExtractor = 'valueExtractor2047672534'; $expectedResponse = new LogMetric(); $expectedResponse->setName($name); $expectedResponse->setDescription($description); $expectedResponse->setFilter($filter); + $expectedResponse->setBucketName($bucketName); $expectedResponse->setDisabled($disabled); $expectedResponse->setValueExtractor($valueExtractor); $transport->addResponse($expectedResponse); @@ -346,12 +350,14 @@ public function updateLogMetricTest() $name = 'name3373707'; $description = 'description-1724546052'; $filter = 'filter-1274492040'; + $bucketName = 'bucketName283610048'; $disabled = true; $valueExtractor = 'valueExtractor2047672534'; $expectedResponse = new LogMetric(); $expectedResponse->setName($name); $expectedResponse->setDescription($description); $expectedResponse->setFilter($filter); + $expectedResponse->setBucketName($bucketName); $expectedResponse->setDisabled($disabled); $expectedResponse->setValueExtractor($valueExtractor); $transport->addResponse($expectedResponse); diff --git a/owl-bot-staging/Logging/v2/proto/src/GPBMetadata/Google/Logging/V2/LogEntry.php b/owl-bot-staging/Logging/v2/proto/src/GPBMetadata/Google/Logging/V2/LogEntry.php deleted file mode 100644 index 91b3c95544578e31041115590b6f8e6fc50c8083..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2774 zcmbVOQBNC35U%Y2_5wwm2wY9mZU7aK!dY@#wK|}cT@n(B6ci{A)k)U*Zf!PQZm)ZL zR-A~Z{+qt`sSo`F{STG;oL|t#&hFkF29p%ZgV~#%Z)SGBncdm>Ha?5dD&8j%5xyiL z?hdg$BRCdZ@_;kkO?y2eaKO)F%7}0<-aEwKAD-aHd(TcD0yN>N2#AaOoc9@NFy8Oe zsNWbg)v`k(DTa==hEU|6lO*;7g7=Tw&x!OyU;5s@26_hu=$$sV5ek@}Bp5`G6&}4o z82;k4%V>ZT=}Y*xMw1SWsH8rluOaYV-1AvN06ebSOQS$i9$^JIi~_Q;iH%LAyB2de z=q}D9IZ|hbb9>JsNkrr`Z;vE_pt0oQ2vl9SPh^oXCE3`_+$wXlhc`@&t~(awE|wxC zquwzVM5ZFz)^RHX7sblEAy2KCdQT`}VVj)!1ImT#UY_dG$h)A=Ii!FK622fAb9aK@ z9hLKXGK`7$RLb}T`8g$tynWbLEWpPx84y9`@b(r8MqAPUK^+5U!5soF+?`M;ci78&9+h0fvSpi^w%tU_@7;7%^MYmnSOEx&H8GF@?+XK&-w3& ztN=`R);}6iy0-P%HLnt=Y@7j=U_*16nYd98;^-t9W7k~iYXKUq;YZmWQU5q|Rcs|X z_Zjfh>$@^fuu)j~rHZOhA^O&^?xU)5u5KNB2A4K!?aJS+vh@Y3=I67kAf9eMaEx6C z66B0Eh(T?kSsha+_J@r7p_CY<{lHp8Gm^ZLg?2^x2YCa{yi9mh$S1Xx zr75W3w2L}Zv6d_s%?lC`Iv|}(tbH47#rg_WbGB>*kPn+Ucb8X` zqThim=Y43LE}|NZ5+Y=WhW0%`>U5W^Z8S4lD)y9)<7T5H*Ml*-gC?2ZB`mS0aRr$2 z)~^RMXsS>&;m(0p)$1Hy<==ygUy`xDr!8Y}x~&Rnz|#sd?{l8$8aJ&_#iNA(~B7()#-k;IHjdsV}i zZ-yT$6%D9wq3Mx~SktKT6B*hi6}B~tCI&uBi7w-sTmHJ_{!x0{`n`neInAagpd}Iq zUjGJU*?Is~{*nYTX}rl+7wVOVPx!sCymc=6enemEV}f+_^NQwjkF$^nP%(=un~%Db zF_qU>ZYiKHK&Xq2jhj?`*6r@^ns0_5}^P7yq1p&th(|`z* z2O|dFdsHOSR!y6+IFIhZNFsG%8_~)SXfgM3l`adEdvJe`x>9%=nRHhQ@A+J!J(+%4 z+0i$crcqIr<{>M}XcUrHI@Aek0d5#Beb&)Mk!TYW?cYl1KCm@j8|~RV*dsOG9F>0j zGGIInb4^8YpDQ-?_y)9_2~K^*-R(>scmFAsel0KU>zU2@PFn!OO3OKI{+aK1p5F3` xsSd`vx8=Hlxvt)H-3;iur_JspFd_Np>&2V*$V^HjgVj5SDy?Zop9^$>(7#`Fd20Xw diff --git a/owl-bot-staging/Logging/v2/proto/src/GPBMetadata/Google/Logging/V2/Logging.php b/owl-bot-staging/Logging/v2/proto/src/GPBMetadata/Google/Logging/V2/Logging.php deleted file mode 100644 index 9f6596d970d8a7f887f278e5379b55d98e5d02ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5213 zcmbVQ&2Jmk7JuW=klfHVy^xPOrA(YwajkR==2e18L!XnlB`9s8BowJK8jZ)-&d|xs zy!l87C=z19f~U9QPe3dlEA%8-!vYDhgk3kVKuEA+iCA&&*LZAC+@#q!y65Bm&N;tx z&z*bomcQ$xIrR>4Nnl2#sWuMPXqTvd;6j z*LG&XH1y)YBD&i4ytYHij@NG6Zo9l+k^gGU7ecPNM?&AUh$YOo zifqqSslkS8k>WL#`=q*8d=H{rQYDa08aM=9Uvnc8xTaHIC7~7Ae&hw4psMR_5+&)P zE5&PKTk6hksYQ-a*ZV*&sZkJ<^zNz}kSGq^MTVO?I7+x4pJdNd238|r!| zrjCo_3|AbRxY6lsZrj9ZE|Xnz-}Zvjncnpv-(EnPTSRc=RA^6c)!`7OQ_YQn!;>RU z>b@F7BS3PWz!VBr+w-GS?7HP!^=&9-d`u}BJFmZH3ocfh&4hZlp&g3}Stxbp(bp<^ z;W2%PFK`9T;T@;#SMpQB#`Nv7#Yn&FyhoOfTqEru)Zu**eL>yS#F8~3HeN~oX`>op^Pl>tuk%PIOKxD>u7wHI3yy# zlr8e_n1m7jCmI1920f>y6;&yYE*E~T=KiW)LV1}iz89n;)Zj!cgK^>49GZM9u$d>y zIh%w79V(A;NMXnGQwstw2=Uu!9P+?>a=Yv|dG<#a@6@N7Dwu?m*^ z0yQ;p1kfnIP|(D>9Y(@micLB?Cwaj*8cvTu1PMv;0FvTo(QwOlV4(4Q@~TXr5ie+x zz-Sx-X(-eF`DA9(fOm%c{!_3I>|&Ma=7h7dk}Z*&akB zJcZ7?UTzS(sNztX%}arXMR~&g^v|fe7tiJPz^no)S#K% z3qrxA`n)V^W}|k{9v|xe6?9%CGYP4JhM~8hBfC$ffdwBx7J2{;wCzeE%~WOzJB%s3 zhQ>RXMW!yGQQC3r(#MXZ(c^>u064#6+D<>`XZko#dBk{^%O>>=be3OPjRV_ldIyZz zW0i}tGIES)a?W!W`~;_XFN7x|@irO{W8Vjsgm8&~OKQu5o}(wts}cg_gqxdVHphzok@hZ zYSrzHd&Zmhwl`}lYq!^GtKyKsx8ZL)BI!W3g) zKcE*HT`4`PsxprY^59$G_lyOhi$7J+Inn-f8p6cF#f<&CRV31^pn5e0(3=eCL}5G) z)Pb?Ua9)=1_>r@~$K8S)aQIsVsnqeH8G`j=a1Sz)kt{xut%$A2Vk=-q-934c-V*od z&fo~~f1W}kB0(W89JA*-@Lb}`YAWdfHsBYiFNYX_&xY^>V=JFGOVAcatZ5!x#+TB9 zPEQH>9G*?fdpbraJ&$M7N=df}@l`yR7WXxZP`iosv|0xWAhnVnZN%0?!kT{HCI__Z zc_3AMD{b8a^h7Qe@vCVUNf;+GUcuG0abJ)paq_4tE(G`^=)LY4lG%IRDv}vlz1OQL z_%V~!dl8Im=)I!yqLTk_?)&PbJeaz_l76WEq3lMHAL`}u!NGx`Z1N3d#?dZ(b$W60 zy6>1#%M11vPN%NH9Bf|qT<7qyh7zIK+_T*iYg7LxR%S=%GTh@P;0v+8KbN0@=A`3) zlRh+UDi3b3*rg)#I7D<1!4Z012MIH@`06`x}P&8OHDBuD?lI;sZf%Zp%v~K&OXpj~u zTJ+rK+!@Y`w1H-StSR1e&fNQ*=RNmwZol4m&_JhCcZ{0REZfFebX*Yh%M`rYiNVhFLY5ld077LTY|tB~_T7T{#7;R=w4%7G-UQKP3tCj&0+G#ghwTf-lYbnC8 zP^%ah##2ltp*_>6!;)W3iRmm76aazM*_v%MYvtv9#Hpy30cC%%uPfw+qhTUq`Zqa!Y0Xy>3st;JXhPj%n)#?O=dd<>x zXHAZXAjW*vG-`HdJTs|y;5_=- zR}<)5JQu?U8Qmmz#mPt6u_K(d+%Pj0s(I#)V<(k?4Wi!C8rLr;II0jdxf1!%X+BhS zG?l4KO>v@QoQQfqxKhR-y5NH%Xvje}g)KmwQ;7LV3R}R+2(-^8(7ufN>8VM0=}snDzQ-Km6T?Uq=V3=7v$( zu2hW@31i0Sei#_co)Q>11~xe-D3=K#g#sT%2g?vMw;@JbC8JhetAgx7DjSBtnCzxm zft*vK3bRHJqc@7K{wl`Z38$uevkLWVVZ2p%+$ zJ?X=i2fAfWroW$jmitl?rNmm8S%9BdlaTW=jw)|}#(&wU*jDBV|Fi=cuEN4n=85>Y zlUbvx2Qv0y2T#?To8_AMNkOXq8CS;jje2$6Xo6JsAuivYHM3d;JaUyvy;UQV=UnHrQV)y{ z(dgjk=3uP_LB}}XLc{fz-DugRN8m~%{B6{mTV;E6FGwHEUhs((AcU-T@;+mjq4ZP9 z(FA@O9eCU{!RkupItixs_Gq7&dk;R2hRhmFa@{CZ9+=hjrcq;ImCYoNhSto@UuhZ5 z?NYr#D;pYI2eO*aB&N*Gj}g)ZMoC4y`4Ml@cnO{!ouIr)gT&)#F70*nk_!UR_1OKw z((>%Wd}(H3>27YNbZ>rnv5=pgnJr8YeFX1C$@|%%1pW8&P*VTX#IxLY5@AkBt?HzY zQ(B+^a4hoA4jxzitIge9q{rJF$u&F~?IJ4uR6p9sRi&lT0ily=*u6l`A$14Y$iPRi z2PNNYf6$A1=ZM3EMom(cw3PwzN)Eq7O$vzkiTbu;jeHTKte6P1M!s_WFCpCiAc>9z zg>4$#<48G5u&Av|YVHmg{zB?F?8WkZzR3(tYT z#%=im4dWV)E|kC%8s$x>N$U?G=uyLFL2m^0(*X;1>2v~n==a($qC>6;SPcm52EK&$ z@lpz=KuSQrnjPXZn>aY&ftvA-4a;;tTl=j9I+Uk{JfnR66~aQ;%!sSY1t#%jw3mHP zR~Ip1vi79*hcLN&w1#(2?z&oHO>yvJRH@Ds$h_iAK}iT?-!&Sv_n0BOL$ViU6aNJ? zbjRREBM|L!(%M~gXxga4p5%pKpe>-`d$5CeaRNVqhKPZZs!{p})G{vrpnJ@YP5GYNE%nX&r3w%upkNJnz3?bjIa?D1vElu%j%j=r$E@h9a7 zuWUU{(wOZ|Pm`2v^_6%4+f91H<7wmS{|ejHe@dX!B3`t&1)T+t`|Mer4n^jP{Jev& zgzjD?A#8Z$=N-IyzHK8bN8OY+qPMjEoZ7nyG)yXyg6Nn?1Ha|**^AU?&*E6nbZqDw zXv8}WZtYiGZ69XxQEi`K(_ch~phS?X6#?p|D=6@##QLJELctKr(9JcOLR_Dqnox^XeP8jNuvF#toB&lgAb$q54Wt+Lt~p2 zaWq&%xAU<0R`gD3iATb7KR$`DWi%g|6+;{=xH52${$~(QzZ)D*U32nl0albFn}`;m zi?qE3=o*gE0#xa>w-5%y5obq2x7S=jWA!`@kf+eefZQS2wJ$)-Wfmj85)yr^C5!r? zx5$pRn4ui=sf2`}=P{BWB~hP{<7Xg8{S1UWFhQzlVkM!rKw9G#+@BzA8gXbwn-2Uu z;1oK{yZ)thW24-v+9g^elXTAt0sWg`P2WgF0*sIOBxV63J{y{fCE3xo+$)FD(b-ne zYHy?Ae7&(v3Z)txdm1vm`luSV>HIuP)lk&Jt-!exd~A53u*PL(ZsoU@1Ie(zq6o)2oe7caP+ z!di|gGzv}&XVp|i&^T?F&|{@1r%+@kF7%KHI>@?IKer&?LBkbxZ-F%<17OLfpvU`8qGJn- zg{9mIIka0|$*mMTXLiTYQ7^%A{>{Sly*W72OW=!W^}KidU@6Ilh zBf;gNBtC|Yc!`(p&Cdhz5IG)gf6~2tzEGHkC-venG~(r*$<2~k?D1pG=jQW;IWoLA z{R9oV@1j6)a%^sPrjUO-KUeTwHbQ%I`IXuG1z6)@G&Eh9D*!Z0g^%4UEU$pjBpluK z-CLXn;OOMxul!Ph{nd+sTg)weAN9*iL}U@O^V5Y-lvdte^ddcs4k}~ID@#Oj0vdQ& z`FeJKrEsUPG?dJ~_cl7f?lGV6X8|6LLdkgXDPHVdEiu}x*1$H_52uXT~JP^kS+ z;?p1g1pnmdXI6CDNiOJqE$852WwTO5{}ZLR;j^xbgGz`&WaR&tx{fp zokoceTBRaFbQ&c`XqC$G)oGLjp;am&RHqS=BDDG+q&=XVl*e|{@W}T?=B2-p)MBL) z>6zEGPEv|w)7`-!M01V@h+uG4>mbF*C*Ib&NHu~R6Vz2N@kL!F5N;F`^(;f38c&E9 z2?(xb8S0ci+H(Y(o@F7JvV~x-TBzW?nq{a{-bfD-T(`3fb;=dnD>ygF@B3NR%~QNz zN>T{~>LVg00XFRDfd0C`$?xe{co#3FJHfe_O?QlMaU$ITuEneAF7U+f_Mk!cZ42zT zX?K%EVfjrKF}{}6F41&GRUBfwEq>iYPo#@CwW|(KwEe2AuW2_O)|fV|^54*|IQ)@z zta84g-Euf%+p;17|1Z?5q>d+76)fL+RgMbu{WhWs5#I>BFQPY|pi}hU2q>J#Il&$yip!;h0_A8ZK-{@Cvq5`0X6 zFB@y3OYGe0(PYBpkcXQ;n@9$>3<7dW9|gF>CLpJ5u>f~?1>}@B0&s^*Ku)=00xr4n zXL=A~WeNq`&y1bnICy`XnfSMoT1O_X)2mFyTiokAGjz`UhSs&Ya|yb;_=wQK4ug^N zPHE3!`b-AZ2CGg2wc!kRq>U`o1~rnv;4jUBFX>iRiNUdbfHS|5W!mV%6SxFjElMJE z;hp+amT99aui)DF=OjX`Y6;YaGc2?bRMN;el})I1Wy`45#lUv;bq#=^ex3SuNaTI9XbYVK|)jj23D>oNB_o?Qg@0 z8xf=4%?+?TIzbeQ-|Iz)Wsg9#oZ&cVeZPlx41cp{EX=9|7Gn&HP}}0PnX%Xw#yQ5v zqV0^6ULK2YZDQ`(4(6Wic<$NwbI*1<_ubr>M4XzzM2j6mlB+Jexk2|J{#}{!0&Rq) zJTfe7Bq-&{sFMz}kK&nh40Ma*>DagyPp6|1EnZB=$I=ybz9UO!a>f`Eb(AB>sOI~R zJFc3^VW_3k+q|7u%_?(uRkJFg)2dnJ?Y3%GWbEb+@i0feoFM;$8&gknhsAFN=inRJ zZGR86$4r=f?W;X!SXg*Oll?Emwmx2MM`lR#ZD+NeWb2}~lf16Rl#`3afiB}Ulwi=uk}J#-g)aqvI)F9*lX1zMC;V&x$cXi=gztlY%H&i*|K_g?6Mqyv|q`FLnzBlhde z+y676v1*TN(qmt`a{<4Yac_?t_*7-93|BQ?14dh&$~LL7axlyQRr>21s|@4VqQbYE z8)6(2(nj!q1L$m16%M+GCN}85EkMsQ(5XSRnW-|#VutT!D5V3r+h$aTt71b#IYNzB zWt-%?8p;)5$144GzO|wB5hkth!TyGDIFPIR8~i@N&#Jj__&qcN{-BMG3=Vu_L+9Lv zy4={%;UK7;jSVFW#aC`@C}{wwa$`e@B9Iip;VS?X#L2wtrvW~>#X}>2@(ZV`EbY$& z!s$*%{Y`*OJ|4t8RH5P2L+c+-Jw)N*)J=?km_V4htGYrw;e%E?S!}?nw6(I~aclQf zboX1jiZ{YMHIx;94lY1~ZkPG5B784ED&t}qVLzMDzRh(0jRZbI+j~^0G#!YW{KXVL z;S4z*0$nUVks|yy&Y|!)he9TLxNgT#2v*PIvyPxPuW%@ZNBk7-{4)JXP<+qgX*WfX z#KPr^43|%3gJ99+uTvme$63C@FrHRau>WeP*RO5P63?lLcu9ra?Oc#W<}kdwFWZPsDi$KE3gt9M={+gQ8Bzi+Jl zS0eHCsQXp*ON}L*Vrm=y(Pa1GAllByrq=v&9pmc2ciE1uF*1< diff --git a/owl-bot-staging/Logging/v2/proto/src/GPBMetadata/Google/Logging/V2/LoggingMetrics.php b/owl-bot-staging/Logging/v2/proto/src/GPBMetadata/Google/Logging/V2/LoggingMetrics.php deleted file mode 100644 index 0867f06aa02d9aac26a229998b8a1d1ecb0247a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3931 zcmb_f&u<$=6lR?!O(t!VPN{255mUEnoYJgY7f`iLsO%(-3Mq+72okbn*6XpebiKRm zjvYdk3lbNkUf{riKLCjXcMkjmJ;JRg4xD;IoDe78{912ZmpFhgUhVra-+b?TZ*~@M zhdUvb$Cl&o!5?@?wqZD!ZjM0jmo zhS#>sw-9nXJC2EZ1)e+$dWZ=8!fwNJ9TGE}!QUk}uDia=T-$R$gH0@vmhHt9QatP1 z>iQ0I1E27K4d0=~c_MRi-%DWtn_eOs&nD*qIH=wA8I63~tF6%3iQJF{(I&WBR-3Yf zJ^rRRua@QM+!iTHjF$Bb$R)y}E={jaNJLpT@^1;;Ji&hQR2#xpC3I^Q-w!wofgf8| ze^31s&kJ1kTEoX$q~htEtr2LWoV`m@Jm(8kRV?%n&B(I}sC!%mD)Oj^> zQzAoNXV9fG6V3CeF$_`N5GJ~cLZd}3qT@Xp#k_RKAmUWHHm4UFx^)IxH?dR8RXQsTFu5ANC8640LuKS}h5S@6%7ZFf8ygnh5O(Cb5$9 z4UqF+l?C*g;|1NO?xK$E+if_02T*LvrSUn0La^6a@PHmre-=#%Lk#DlXn=81+`>mF zI|wHZ;RvC40UcN90T35qqHoPauiO_QtUTj`s_TQx7q-xuHQL{=-tH2bmg!~Z$rdh( zJr@oqyYPj9vdco136nbW%>g1+Qhay?ucHZxNl4?69drINg)afe`$Ff>;P`Jl#Qy@! z2PnHjJ<90+jHUd;B$~Y^zq{U}QO|Ygb{T(Tpi>96gNwtOb(q@o^CNglAr`KE{>yJ) zXD;AZ`M2al*&|CyuU$!+>`6s65dO+QC(@e3$-GNRH|?OLlmADF7ZwGOBEBquq|}>2 zlXU!*{U?>Q!tu8Tni)_m9>&6e&uGwY3uyC&!#J{(z@Jo3N+PeyZQ$EN=c$=5Zyf z#dUBt|6KXq*kLS;tx{=scXx1d+g-K;Uu7`j7edcwtsv@LJ({}-W3agp_}<>3ff}LR z?705O-aP-v&byJzX!S=p=HPVHT&vpy0G!5VSJxCwOMvYfG&rOts`v3Af6pnY;|MEMc@P k6=+%8<;H{%$Bntgoogle.logging.v2.BigQueryOptions - */ -class BigQueryOptions extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Whether to use [BigQuery's partition - * tables](https://cloud.google.com/bigquery/docs/partitioned-tables). By - * default, Cloud Logging creates dated tables based on the log entries' - * timestamps, e.g. syslog_20170523. With partitioned tables the date suffix - * is no longer present and [special query - * syntax](https://cloud.google.com/bigquery/docs/querying-partitioned-tables) - * has to be used instead. In both cases, tables are sharded based on UTC - * timezone. - * - * Generated from protobuf field bool use_partitioned_tables = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $use_partitioned_tables = false; - /** - * Output only. True if new timestamp column based partitioning is in use, - * false if legacy ingestion-time partitioning is in use. - * All new sinks will have this field set true and will use timestamp column - * based partitioning. If use_partitioned_tables is false, this value has no - * meaning and will be false. Legacy sinks using partitioned tables will have - * this field set to false. - * - * Generated from protobuf field bool uses_timestamp_column_partitioning = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uses_timestamp_column_partitioning = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $use_partitioned_tables - * Optional. Whether to use [BigQuery's partition - * tables](https://cloud.google.com/bigquery/docs/partitioned-tables). By - * default, Cloud Logging creates dated tables based on the log entries' - * timestamps, e.g. syslog_20170523. With partitioned tables the date suffix - * is no longer present and [special query - * syntax](https://cloud.google.com/bigquery/docs/querying-partitioned-tables) - * has to be used instead. In both cases, tables are sharded based on UTC - * timezone. - * @type bool $uses_timestamp_column_partitioning - * Output only. True if new timestamp column based partitioning is in use, - * false if legacy ingestion-time partitioning is in use. - * All new sinks will have this field set true and will use timestamp column - * based partitioning. If use_partitioned_tables is false, this value has no - * meaning and will be false. Legacy sinks using partitioned tables will have - * this field set to false. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Whether to use [BigQuery's partition - * tables](https://cloud.google.com/bigquery/docs/partitioned-tables). By - * default, Cloud Logging creates dated tables based on the log entries' - * timestamps, e.g. syslog_20170523. With partitioned tables the date suffix - * is no longer present and [special query - * syntax](https://cloud.google.com/bigquery/docs/querying-partitioned-tables) - * has to be used instead. In both cases, tables are sharded based on UTC - * timezone. - * - * Generated from protobuf field bool use_partitioned_tables = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getUsePartitionedTables() - { - return $this->use_partitioned_tables; - } - - /** - * Optional. Whether to use [BigQuery's partition - * tables](https://cloud.google.com/bigquery/docs/partitioned-tables). By - * default, Cloud Logging creates dated tables based on the log entries' - * timestamps, e.g. syslog_20170523. With partitioned tables the date suffix - * is no longer present and [special query - * syntax](https://cloud.google.com/bigquery/docs/querying-partitioned-tables) - * has to be used instead. In both cases, tables are sharded based on UTC - * timezone. - * - * Generated from protobuf field bool use_partitioned_tables = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setUsePartitionedTables($var) - { - GPBUtil::checkBool($var); - $this->use_partitioned_tables = $var; - - return $this; - } - - /** - * Output only. True if new timestamp column based partitioning is in use, - * false if legacy ingestion-time partitioning is in use. - * All new sinks will have this field set true and will use timestamp column - * based partitioning. If use_partitioned_tables is false, this value has no - * meaning and will be false. Legacy sinks using partitioned tables will have - * this field set to false. - * - * Generated from protobuf field bool uses_timestamp_column_partitioning = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getUsesTimestampColumnPartitioning() - { - return $this->uses_timestamp_column_partitioning; - } - - /** - * Output only. True if new timestamp column based partitioning is in use, - * false if legacy ingestion-time partitioning is in use. - * All new sinks will have this field set true and will use timestamp column - * based partitioning. If use_partitioned_tables is false, this value has no - * meaning and will be false. Legacy sinks using partitioned tables will have - * this field set to false. - * - * Generated from protobuf field bool uses_timestamp_column_partitioning = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setUsesTimestampColumnPartitioning($var) - { - GPBUtil::checkBool($var); - $this->uses_timestamp_column_partitioning = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CmekSettings.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CmekSettings.php deleted file mode 100644 index 80371e43baa0..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CmekSettings.php +++ /dev/null @@ -1,320 +0,0 @@ -google.logging.v2.CmekSettings - */ -class CmekSettings extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name of the CMEK settings. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * The resource name for the configured Cloud KMS key. - * KMS key name format: - * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]" - * For example: - * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"` - * To enable CMEK for the Log Router, set this field to a valid - * `kms_key_name` for which the associated service account has the required - * cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key. - * The Cloud KMS key used by the Log Router can be updated by changing the - * `kms_key_name` to a new valid key name or disabled by setting the key name - * to an empty string. Encryption operations that are in progress will be - * completed with the key that was in use when they started. Decryption - * operations will be completed using the key that was used at the time of - * encryption unless access to that key has been revoked. - * To disable CMEK for the Log Router, set this field to an empty string. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Generated from protobuf field string kms_key_name = 2; - */ - protected $kms_key_name = ''; - /** - * The CryptoKeyVersion resource name for the configured Cloud KMS key. - * KMS key name format: - * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]" - * For example: - * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"` - * This is a read-only field used to convey the specific configured - * CryptoKeyVersion of `kms_key` that has been configured. It will be - * populated in cases where the CMEK settings are bound to a single key - * version. - * If this field is populated, the `kms_key` is tied to a specific - * CryptoKeyVersion. - * - * Generated from protobuf field string kms_key_version_name = 4; - */ - protected $kms_key_version_name = ''; - /** - * Output only. The service account that will be used by the Log Router to - * access your Cloud KMS key. - * Before enabling CMEK for Log Router, you must first assign the - * cloudkms.cryptoKeyEncrypterDecrypter role to the service account that - * the Log Router will use to access your Cloud KMS key. Use - * [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to - * obtain the service account ID. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Generated from protobuf field string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $service_account_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name of the CMEK settings. - * @type string $kms_key_name - * The resource name for the configured Cloud KMS key. - * KMS key name format: - * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]" - * For example: - * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"` - * To enable CMEK for the Log Router, set this field to a valid - * `kms_key_name` for which the associated service account has the required - * cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key. - * The Cloud KMS key used by the Log Router can be updated by changing the - * `kms_key_name` to a new valid key name or disabled by setting the key name - * to an empty string. Encryption operations that are in progress will be - * completed with the key that was in use when they started. Decryption - * operations will be completed using the key that was used at the time of - * encryption unless access to that key has been revoked. - * To disable CMEK for the Log Router, set this field to an empty string. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * @type string $kms_key_version_name - * The CryptoKeyVersion resource name for the configured Cloud KMS key. - * KMS key name format: - * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]" - * For example: - * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"` - * This is a read-only field used to convey the specific configured - * CryptoKeyVersion of `kms_key` that has been configured. It will be - * populated in cases where the CMEK settings are bound to a single key - * version. - * If this field is populated, the `kms_key` is tied to a specific - * CryptoKeyVersion. - * @type string $service_account_id - * Output only. The service account that will be used by the Log Router to - * access your Cloud KMS key. - * Before enabling CMEK for Log Router, you must first assign the - * cloudkms.cryptoKeyEncrypterDecrypter role to the service account that - * the Log Router will use to access your Cloud KMS key. Use - * [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to - * obtain the service account ID. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name of the CMEK settings. - * - * 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 CMEK settings. - * - * 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 resource name for the configured Cloud KMS key. - * KMS key name format: - * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]" - * For example: - * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"` - * To enable CMEK for the Log Router, set this field to a valid - * `kms_key_name` for which the associated service account has the required - * cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key. - * The Cloud KMS key used by the Log Router can be updated by changing the - * `kms_key_name` to a new valid key name or disabled by setting the key name - * to an empty string. Encryption operations that are in progress will be - * completed with the key that was in use when they started. Decryption - * operations will be completed using the key that was used at the time of - * encryption unless access to that key has been revoked. - * To disable CMEK for the Log Router, set this field to an empty string. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Generated from protobuf field string kms_key_name = 2; - * @return string - */ - public function getKmsKeyName() - { - return $this->kms_key_name; - } - - /** - * The resource name for the configured Cloud KMS key. - * KMS key name format: - * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]" - * For example: - * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"` - * To enable CMEK for the Log Router, set this field to a valid - * `kms_key_name` for which the associated service account has the required - * cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key. - * The Cloud KMS key used by the Log Router can be updated by changing the - * `kms_key_name` to a new valid key name or disabled by setting the key name - * to an empty string. Encryption operations that are in progress will be - * completed with the key that was in use when they started. Decryption - * operations will be completed using the key that was used at the time of - * encryption unless access to that key has been revoked. - * To disable CMEK for the Log Router, set this field to an empty string. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Generated from protobuf field string kms_key_name = 2; - * @param string $var - * @return $this - */ - public function setKmsKeyName($var) - { - GPBUtil::checkString($var, True); - $this->kms_key_name = $var; - - return $this; - } - - /** - * The CryptoKeyVersion resource name for the configured Cloud KMS key. - * KMS key name format: - * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]" - * For example: - * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"` - * This is a read-only field used to convey the specific configured - * CryptoKeyVersion of `kms_key` that has been configured. It will be - * populated in cases where the CMEK settings are bound to a single key - * version. - * If this field is populated, the `kms_key` is tied to a specific - * CryptoKeyVersion. - * - * Generated from protobuf field string kms_key_version_name = 4; - * @return string - */ - public function getKmsKeyVersionName() - { - return $this->kms_key_version_name; - } - - /** - * The CryptoKeyVersion resource name for the configured Cloud KMS key. - * KMS key name format: - * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]" - * For example: - * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"` - * This is a read-only field used to convey the specific configured - * CryptoKeyVersion of `kms_key` that has been configured. It will be - * populated in cases where the CMEK settings are bound to a single key - * version. - * If this field is populated, the `kms_key` is tied to a specific - * CryptoKeyVersion. - * - * Generated from protobuf field string kms_key_version_name = 4; - * @param string $var - * @return $this - */ - public function setKmsKeyVersionName($var) - { - GPBUtil::checkString($var, True); - $this->kms_key_version_name = $var; - - return $this; - } - - /** - * Output only. The service account that will be used by the Log Router to - * access your Cloud KMS key. - * Before enabling CMEK for Log Router, you must first assign the - * cloudkms.cryptoKeyEncrypterDecrypter role to the service account that - * the Log Router will use to access your Cloud KMS key. Use - * [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to - * obtain the service account ID. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Generated from protobuf field string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getServiceAccountId() - { - return $this->service_account_id; - } - - /** - * Output only. The service account that will be used by the Log Router to - * access your Cloud KMS key. - * Before enabling CMEK for Log Router, you must first assign the - * cloudkms.cryptoKeyEncrypterDecrypter role to the service account that - * the Log Router will use to access your Cloud KMS key. Use - * [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to - * obtain the service account ID. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Generated from protobuf field string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setServiceAccountId($var) - { - GPBUtil::checkString($var, True); - $this->service_account_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ConfigServiceV2GrpcClient.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ConfigServiceV2GrpcClient.php deleted file mode 100644 index 6ceeff2be35a..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ConfigServiceV2GrpcClient.php +++ /dev/null @@ -1,602 +0,0 @@ -_simpleRequest('/google.logging.v2.ConfigServiceV2/ListBuckets', - $argument, - ['\Google\Cloud\Logging\V2\ListBucketsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a log bucket. - * @param \Google\Cloud\Logging\V2\GetBucketRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetBucket(\Google\Cloud\Logging\V2\GetBucketRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/GetBucket', - $argument, - ['\Google\Cloud\Logging\V2\LogBucket', 'decode'], - $metadata, $options); - } - - /** - * Creates a log bucket asynchronously that can be used to store log entries. - * - * After a bucket has been created, the bucket's location cannot be changed. - * @param \Google\Cloud\Logging\V2\CreateBucketRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateBucketAsync(\Google\Cloud\Logging\V2\CreateBucketRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/CreateBucketAsync', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates a log bucket asynchronously. - * - * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then - * `FAILED_PRECONDITION` will be returned. - * - * After a bucket has been created, the bucket's location cannot be changed. - * @param \Google\Cloud\Logging\V2\UpdateBucketRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateBucketAsync(\Google\Cloud\Logging\V2\UpdateBucketRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/UpdateBucketAsync', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Creates a log bucket that can be used to store log entries. After a bucket - * has been created, the bucket's location cannot be changed. - * @param \Google\Cloud\Logging\V2\CreateBucketRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateBucket(\Google\Cloud\Logging\V2\CreateBucketRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/CreateBucket', - $argument, - ['\Google\Cloud\Logging\V2\LogBucket', 'decode'], - $metadata, $options); - } - - /** - * Updates a log bucket. - * - * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then - * `FAILED_PRECONDITION` will be returned. - * - * After a bucket has been created, the bucket's location cannot be changed. - * @param \Google\Cloud\Logging\V2\UpdateBucketRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateBucket(\Google\Cloud\Logging\V2\UpdateBucketRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/UpdateBucket', - $argument, - ['\Google\Cloud\Logging\V2\LogBucket', 'decode'], - $metadata, $options); - } - - /** - * Deletes a log bucket. - * - * Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state. - * After 7 days, the bucket will be purged and all log entries in the bucket - * will be permanently deleted. - * @param \Google\Cloud\Logging\V2\DeleteBucketRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteBucket(\Google\Cloud\Logging\V2\DeleteBucketRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/DeleteBucket', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Undeletes a log bucket. A bucket that has been deleted can be undeleted - * within the grace period of 7 days. - * @param \Google\Cloud\Logging\V2\UndeleteBucketRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UndeleteBucket(\Google\Cloud\Logging\V2\UndeleteBucketRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/UndeleteBucket', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Lists views on a log bucket. - * @param \Google\Cloud\Logging\V2\ListViewsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListViews(\Google\Cloud\Logging\V2\ListViewsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/ListViews', - $argument, - ['\Google\Cloud\Logging\V2\ListViewsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a view on a log bucket.. - * @param \Google\Cloud\Logging\V2\GetViewRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetView(\Google\Cloud\Logging\V2\GetViewRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/GetView', - $argument, - ['\Google\Cloud\Logging\V2\LogView', 'decode'], - $metadata, $options); - } - - /** - * Creates a view over log entries in a log bucket. A bucket may contain a - * maximum of 30 views. - * @param \Google\Cloud\Logging\V2\CreateViewRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateView(\Google\Cloud\Logging\V2\CreateViewRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/CreateView', - $argument, - ['\Google\Cloud\Logging\V2\LogView', 'decode'], - $metadata, $options); - } - - /** - * Updates a view on a log bucket. This method replaces the following fields - * in the existing view with values from the new view: `filter`. - * If an `UNAVAILABLE` error is returned, this indicates that system is not in - * a state where it can update the view. If this occurs, please try again in a - * few minutes. - * @param \Google\Cloud\Logging\V2\UpdateViewRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateView(\Google\Cloud\Logging\V2\UpdateViewRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/UpdateView', - $argument, - ['\Google\Cloud\Logging\V2\LogView', 'decode'], - $metadata, $options); - } - - /** - * Deletes a view on a log bucket. - * If an `UNAVAILABLE` error is returned, this indicates that system is not in - * a state where it can delete the view. If this occurs, please try again in a - * few minutes. - * @param \Google\Cloud\Logging\V2\DeleteViewRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteView(\Google\Cloud\Logging\V2\DeleteViewRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/DeleteView', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Lists sinks. - * @param \Google\Cloud\Logging\V2\ListSinksRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListSinks(\Google\Cloud\Logging\V2\ListSinksRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/ListSinks', - $argument, - ['\Google\Cloud\Logging\V2\ListSinksResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a sink. - * @param \Google\Cloud\Logging\V2\GetSinkRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetSink(\Google\Cloud\Logging\V2\GetSinkRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/GetSink', - $argument, - ['\Google\Cloud\Logging\V2\LogSink', 'decode'], - $metadata, $options); - } - - /** - * Creates a sink that exports specified log entries to a destination. The - * export of newly-ingested log entries begins immediately, unless the sink's - * `writer_identity` is not permitted to write to the destination. A sink can - * export log entries only from the resource owning the sink. - * @param \Google\Cloud\Logging\V2\CreateSinkRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateSink(\Google\Cloud\Logging\V2\CreateSinkRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/CreateSink', - $argument, - ['\Google\Cloud\Logging\V2\LogSink', 'decode'], - $metadata, $options); - } - - /** - * Updates a sink. This method replaces the following fields in the existing - * sink with values from the new sink: `destination`, and `filter`. - * - * The updated sink might also have a new `writer_identity`; see the - * `unique_writer_identity` field. - * @param \Google\Cloud\Logging\V2\UpdateSinkRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateSink(\Google\Cloud\Logging\V2\UpdateSinkRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/UpdateSink', - $argument, - ['\Google\Cloud\Logging\V2\LogSink', 'decode'], - $metadata, $options); - } - - /** - * Deletes a sink. If the sink has a unique `writer_identity`, then that - * service account is also deleted. - * @param \Google\Cloud\Logging\V2\DeleteSinkRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteSink(\Google\Cloud\Logging\V2\DeleteSinkRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/DeleteSink', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Asynchronously creates a linked dataset in BigQuery which makes it possible - * to use BigQuery to read the logs stored in the log bucket. A log bucket may - * currently only contain one link. - * @param \Google\Cloud\Logging\V2\CreateLinkRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateLink(\Google\Cloud\Logging\V2\CreateLinkRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/CreateLink', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a link. This will also delete the corresponding BigQuery linked - * dataset. - * @param \Google\Cloud\Logging\V2\DeleteLinkRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteLink(\Google\Cloud\Logging\V2\DeleteLinkRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/DeleteLink', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists links. - * @param \Google\Cloud\Logging\V2\ListLinksRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListLinks(\Google\Cloud\Logging\V2\ListLinksRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/ListLinks', - $argument, - ['\Google\Cloud\Logging\V2\ListLinksResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a link. - * @param \Google\Cloud\Logging\V2\GetLinkRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetLink(\Google\Cloud\Logging\V2\GetLinkRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/GetLink', - $argument, - ['\Google\Cloud\Logging\V2\Link', 'decode'], - $metadata, $options); - } - - /** - * Lists all the exclusions on the _Default sink in a parent resource. - * @param \Google\Cloud\Logging\V2\ListExclusionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListExclusions(\Google\Cloud\Logging\V2\ListExclusionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/ListExclusions', - $argument, - ['\Google\Cloud\Logging\V2\ListExclusionsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets the description of an exclusion in the _Default sink. - * @param \Google\Cloud\Logging\V2\GetExclusionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetExclusion(\Google\Cloud\Logging\V2\GetExclusionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/GetExclusion', - $argument, - ['\Google\Cloud\Logging\V2\LogExclusion', 'decode'], - $metadata, $options); - } - - /** - * Creates a new exclusion in the _Default sink in a specified parent - * resource. Only log entries belonging to that resource can be excluded. You - * can have up to 10 exclusions in a resource. - * @param \Google\Cloud\Logging\V2\CreateExclusionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateExclusion(\Google\Cloud\Logging\V2\CreateExclusionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/CreateExclusion', - $argument, - ['\Google\Cloud\Logging\V2\LogExclusion', 'decode'], - $metadata, $options); - } - - /** - * Changes one or more properties of an existing exclusion in the _Default - * sink. - * @param \Google\Cloud\Logging\V2\UpdateExclusionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateExclusion(\Google\Cloud\Logging\V2\UpdateExclusionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/UpdateExclusion', - $argument, - ['\Google\Cloud\Logging\V2\LogExclusion', 'decode'], - $metadata, $options); - } - - /** - * Deletes an exclusion in the _Default sink. - * @param \Google\Cloud\Logging\V2\DeleteExclusionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteExclusion(\Google\Cloud\Logging\V2\DeleteExclusionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/DeleteExclusion', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Gets the Logging CMEK settings for the given resource. - * - * Note: CMEK for the Log Router can be configured for Google Cloud projects, - * folders, organizations and billing accounts. Once configured for an - * organization, it applies to all projects and folders in the Google Cloud - * organization. - * - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * @param \Google\Cloud\Logging\V2\GetCmekSettingsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetCmekSettings(\Google\Cloud\Logging\V2\GetCmekSettingsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/GetCmekSettings', - $argument, - ['\Google\Cloud\Logging\V2\CmekSettings', 'decode'], - $metadata, $options); - } - - /** - * Updates the Log Router CMEK settings for the given resource. - * - * Note: CMEK for the Log Router can currently only be configured for Google - * Cloud organizations. Once configured, it applies to all projects and - * folders in the Google Cloud organization. - * - * [UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings] - * will fail if 1) `kms_key_name` is invalid, or 2) the associated service - * account does not have the required - * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or - * 3) access to the key is disabled. - * - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * @param \Google\Cloud\Logging\V2\UpdateCmekSettingsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateCmekSettings(\Google\Cloud\Logging\V2\UpdateCmekSettingsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/UpdateCmekSettings', - $argument, - ['\Google\Cloud\Logging\V2\CmekSettings', 'decode'], - $metadata, $options); - } - - /** - * Gets the Log Router settings for the given resource. - * - * Note: Settings for the Log Router can be get for Google Cloud projects, - * folders, organizations and billing accounts. Currently it can only be - * configured for organizations. Once configured for an organization, it - * applies to all projects and folders in the Google Cloud organization. - * - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * @param \Google\Cloud\Logging\V2\GetSettingsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetSettings(\Google\Cloud\Logging\V2\GetSettingsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/GetSettings', - $argument, - ['\Google\Cloud\Logging\V2\Settings', 'decode'], - $metadata, $options); - } - - /** - * Updates the Log Router settings for the given resource. - * - * Note: Settings for the Log Router can currently only be configured for - * Google Cloud organizations. Once configured, it applies to all projects and - * folders in the Google Cloud organization. - * - * [UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings] - * will fail if 1) `kms_key_name` is invalid, or 2) the associated service - * account does not have the required - * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or - * 3) access to the key is disabled. 4) `location_id` is not supported by - * Logging. 5) `location_id` violate OrgPolicy. - * - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * @param \Google\Cloud\Logging\V2\UpdateSettingsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateSettings(\Google\Cloud\Logging\V2\UpdateSettingsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/UpdateSettings', - $argument, - ['\Google\Cloud\Logging\V2\Settings', 'decode'], - $metadata, $options); - } - - /** - * Copies a set of log entries from a log bucket to a Cloud Storage bucket. - * @param \Google\Cloud\Logging\V2\CopyLogEntriesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CopyLogEntries(\Google\Cloud\Logging\V2\CopyLogEntriesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.ConfigServiceV2/CopyLogEntries', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesMetadata.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesMetadata.php deleted file mode 100644 index ad1fe195b4f9..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesMetadata.php +++ /dev/null @@ -1,317 +0,0 @@ -google.logging.v2.CopyLogEntriesMetadata - */ -class CopyLogEntriesMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The create time of an operation. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - */ - protected $start_time = null; - /** - * The end time of an operation. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - */ - protected $end_time = null; - /** - * State of an operation. - * - * Generated from protobuf field .google.logging.v2.OperationState state = 3; - */ - protected $state = 0; - /** - * Identifies whether the user has requested cancellation of the operation. - * - * Generated from protobuf field bool cancellation_requested = 4; - */ - protected $cancellation_requested = false; - /** - * CopyLogEntries RPC request. - * - * Generated from protobuf field .google.logging.v2.CopyLogEntriesRequest request = 5; - */ - protected $request = null; - /** - * Estimated progress of the operation (0 - 100%). - * - * Generated from protobuf field int32 progress = 6; - */ - protected $progress = 0; - /** - * The IAM identity of a service account that must be granted access to the - * destination. - * If the service account is not granted permission to the destination within - * an hour, the operation will be cancelled. - * For example: `"serviceAccount:foo@bar.com"` - * - * Generated from protobuf field string writer_identity = 7; - */ - protected $writer_identity = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $start_time - * The create time of an operation. - * @type \Google\Protobuf\Timestamp $end_time - * The end time of an operation. - * @type int $state - * State of an operation. - * @type bool $cancellation_requested - * Identifies whether the user has requested cancellation of the operation. - * @type \Google\Cloud\Logging\V2\CopyLogEntriesRequest $request - * CopyLogEntries RPC request. - * @type int $progress - * Estimated progress of the operation (0 - 100%). - * @type string $writer_identity - * The IAM identity of a service account that must be granted access to the - * destination. - * If the service account is not granted permission to the destination within - * an hour, the operation will be cancelled. - * For example: `"serviceAccount:foo@bar.com"` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * The create time of an operation. - * - * 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); - } - - /** - * The create time of an operation. - * - * 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; - } - - /** - * The end time of an operation. - * - * 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); - } - - /** - * The end time of an operation. - * - * 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; - } - - /** - * State of an operation. - * - * Generated from protobuf field .google.logging.v2.OperationState state = 3; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * State of an operation. - * - * Generated from protobuf field .google.logging.v2.OperationState state = 3; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Logging\V2\OperationState::class); - $this->state = $var; - - return $this; - } - - /** - * Identifies whether the user has requested cancellation of the operation. - * - * Generated from protobuf field bool cancellation_requested = 4; - * @return bool - */ - public function getCancellationRequested() - { - return $this->cancellation_requested; - } - - /** - * Identifies whether the user has requested cancellation of the operation. - * - * Generated from protobuf field bool cancellation_requested = 4; - * @param bool $var - * @return $this - */ - public function setCancellationRequested($var) - { - GPBUtil::checkBool($var); - $this->cancellation_requested = $var; - - return $this; - } - - /** - * CopyLogEntries RPC request. - * - * Generated from protobuf field .google.logging.v2.CopyLogEntriesRequest request = 5; - * @return \Google\Cloud\Logging\V2\CopyLogEntriesRequest|null - */ - public function getRequest() - { - return $this->request; - } - - public function hasRequest() - { - return isset($this->request); - } - - public function clearRequest() - { - unset($this->request); - } - - /** - * CopyLogEntries RPC request. - * - * Generated from protobuf field .google.logging.v2.CopyLogEntriesRequest request = 5; - * @param \Google\Cloud\Logging\V2\CopyLogEntriesRequest $var - * @return $this - */ - public function setRequest($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\CopyLogEntriesRequest::class); - $this->request = $var; - - return $this; - } - - /** - * Estimated progress of the operation (0 - 100%). - * - * Generated from protobuf field int32 progress = 6; - * @return int - */ - public function getProgress() - { - return $this->progress; - } - - /** - * Estimated progress of the operation (0 - 100%). - * - * Generated from protobuf field int32 progress = 6; - * @param int $var - * @return $this - */ - public function setProgress($var) - { - GPBUtil::checkInt32($var); - $this->progress = $var; - - return $this; - } - - /** - * The IAM identity of a service account that must be granted access to the - * destination. - * If the service account is not granted permission to the destination within - * an hour, the operation will be cancelled. - * For example: `"serviceAccount:foo@bar.com"` - * - * Generated from protobuf field string writer_identity = 7; - * @return string - */ - public function getWriterIdentity() - { - return $this->writer_identity; - } - - /** - * The IAM identity of a service account that must be granted access to the - * destination. - * If the service account is not granted permission to the destination within - * an hour, the operation will be cancelled. - * For example: `"serviceAccount:foo@bar.com"` - * - * Generated from protobuf field string writer_identity = 7; - * @param string $var - * @return $this - */ - public function setWriterIdentity($var) - { - GPBUtil::checkString($var, True); - $this->writer_identity = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesRequest.php deleted file mode 100644 index db42fc75bd5d..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesRequest.php +++ /dev/null @@ -1,147 +0,0 @@ -google.logging.v2.CopyLogEntriesRequest - */ -class CopyLogEntriesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Log bucket from which to copy log entries. - * For example: - * `"projects/my-project/locations/global/buckets/my-source-bucket"` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Optional. A filter specifying which log entries to copy. The filter must be - * no more than 20k characters. An empty filter matches all log entries. - * - * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Required. Destination to which to copy log entries. - * - * Generated from protobuf field string destination = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $destination = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Log bucket from which to copy log entries. - * For example: - * `"projects/my-project/locations/global/buckets/my-source-bucket"` - * @type string $filter - * Optional. A filter specifying which log entries to copy. The filter must be - * no more than 20k characters. An empty filter matches all log entries. - * @type string $destination - * Required. Destination to which to copy log entries. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. Log bucket from which to copy log entries. - * For example: - * `"projects/my-project/locations/global/buckets/my-source-bucket"` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Log bucket from which to copy log entries. - * For example: - * `"projects/my-project/locations/global/buckets/my-source-bucket"` - * - * 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. A filter specifying which log entries to copy. The filter must be - * no more than 20k characters. An empty filter matches all log entries. - * - * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. A filter specifying which log entries to copy. The filter must be - * no more than 20k characters. An empty filter matches all log entries. - * - * 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; - } - - /** - * Required. Destination to which to copy log entries. - * - * Generated from protobuf field string destination = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDestination() - { - return $this->destination; - } - - /** - * Required. Destination to which to copy log entries. - * - * Generated from protobuf field string destination = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDestination($var) - { - GPBUtil::checkString($var, True); - $this->destination = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesResponse.php deleted file mode 100644 index 103ccdbe1933..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CopyLogEntriesResponse.php +++ /dev/null @@ -1,67 +0,0 @@ -google.logging.v2.CopyLogEntriesResponse - */ -class CopyLogEntriesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Number of log entries copied. - * - * Generated from protobuf field int64 log_entries_copied_count = 1; - */ - protected $log_entries_copied_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $log_entries_copied_count - * Number of log entries copied. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Number of log entries copied. - * - * Generated from protobuf field int64 log_entries_copied_count = 1; - * @return int|string - */ - public function getLogEntriesCopiedCount() - { - return $this->log_entries_copied_count; - } - - /** - * Number of log entries copied. - * - * Generated from protobuf field int64 log_entries_copied_count = 1; - * @param int|string $var - * @return $this - */ - public function setLogEntriesCopiedCount($var) - { - GPBUtil::checkInt64($var); - $this->log_entries_copied_count = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateBucketRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateBucketRequest.php deleted file mode 100644 index d91743acf052..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateBucketRequest.php +++ /dev/null @@ -1,173 +0,0 @@ -google.logging.v2.CreateBucketRequest - */ -class CreateBucketRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource in which to create the log bucket: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" - * For example: - * `"projects/my-project/locations/global"` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers - * are limited to 100 characters and can include only letters, digits, - * underscores, hyphens, and periods. - * - * Generated from protobuf field string bucket_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $bucket_id = ''; - /** - * Required. The new bucket. The region specified in the new bucket must be - * compliant with any Location Restriction Org Policy. The name field in the - * bucket is ignored. - * - * Generated from protobuf field .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $bucket = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource in which to create the log bucket: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" - * For example: - * `"projects/my-project/locations/global"` - * @type string $bucket_id - * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers - * are limited to 100 characters and can include only letters, digits, - * underscores, hyphens, and periods. - * @type \Google\Cloud\Logging\V2\LogBucket $bucket - * Required. The new bucket. The region specified in the new bucket must be - * compliant with any Location Restriction Org Policy. The name field in the - * bucket is ignored. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource in which to create the log bucket: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" - * For example: - * `"projects/my-project/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. The resource in which to create the log bucket: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" - * For example: - * `"projects/my-project/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; - } - - /** - * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers - * are limited to 100 characters and can include only letters, digits, - * underscores, hyphens, and periods. - * - * Generated from protobuf field string bucket_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getBucketId() - { - return $this->bucket_id; - } - - /** - * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers - * are limited to 100 characters and can include only letters, digits, - * underscores, hyphens, and periods. - * - * Generated from protobuf field string bucket_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setBucketId($var) - { - GPBUtil::checkString($var, True); - $this->bucket_id = $var; - - return $this; - } - - /** - * Required. The new bucket. The region specified in the new bucket must be - * compliant with any Location Restriction Org Policy. The name field in the - * bucket is ignored. - * - * Generated from protobuf field .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Logging\V2\LogBucket|null - */ - public function getBucket() - { - return $this->bucket; - } - - public function hasBucket() - { - return isset($this->bucket); - } - - public function clearBucket() - { - unset($this->bucket); - } - - /** - * Required. The new bucket. The region specified in the new bucket must be - * compliant with any Location Restriction Org Policy. The name field in the - * bucket is ignored. - * - * Generated from protobuf field .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Logging\V2\LogBucket $var - * @return $this - */ - public function setBucket($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogBucket::class); - $this->bucket = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateExclusionRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateExclusionRequest.php deleted file mode 100644 index 0bbd83b99b72..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateExclusionRequest.php +++ /dev/null @@ -1,143 +0,0 @@ -google.logging.v2.CreateExclusionRequest - */ -class CreateExclusionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource in which to create the exclusion: - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" - * For examples: - * `"projects/my-logging-project"` - * `"organizations/123456789"` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The new exclusion, whose `name` parameter is an exclusion name - * that is not already used in the parent resource. - * - * Generated from protobuf field .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $exclusion = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource in which to create the exclusion: - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" - * For examples: - * `"projects/my-logging-project"` - * `"organizations/123456789"` - * @type \Google\Cloud\Logging\V2\LogExclusion $exclusion - * Required. The new exclusion, whose `name` parameter is an exclusion name - * that is not already used in the parent resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource in which to create the exclusion: - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" - * For examples: - * `"projects/my-logging-project"` - * `"organizations/123456789"` - * - * 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 in which to create the exclusion: - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" - * For examples: - * `"projects/my-logging-project"` - * `"organizations/123456789"` - * - * 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 new exclusion, whose `name` parameter is an exclusion name - * that is not already used in the parent resource. - * - * Generated from protobuf field .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Logging\V2\LogExclusion|null - */ - public function getExclusion() - { - return $this->exclusion; - } - - public function hasExclusion() - { - return isset($this->exclusion); - } - - public function clearExclusion() - { - unset($this->exclusion); - } - - /** - * Required. The new exclusion, whose `name` parameter is an exclusion name - * that is not already used in the parent resource. - * - * Generated from protobuf field .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Logging\V2\LogExclusion $var - * @return $this - */ - public function setExclusion($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogExclusion::class); - $this->exclusion = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateLogMetricRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateLogMetricRequest.php deleted file mode 100644 index 78776555edfd..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateLogMetricRequest.php +++ /dev/null @@ -1,123 +0,0 @@ -google.logging.v2.CreateLogMetricRequest - */ -class CreateLogMetricRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the project in which to create the metric: - * "projects/[PROJECT_ID]" - * The new metric must be provided in the request. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The new logs-based metric, which must not have an identifier that - * already exists. - * - * Generated from protobuf field .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $metric = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the project in which to create the metric: - * "projects/[PROJECT_ID]" - * The new metric must be provided in the request. - * @type \Google\Cloud\Logging\V2\LogMetric $metric - * Required. The new logs-based metric, which must not have an identifier that - * already exists. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingMetrics::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the project in which to create the metric: - * "projects/[PROJECT_ID]" - * The new metric must be provided in the request. - * - * 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 project in which to create the metric: - * "projects/[PROJECT_ID]" - * The new metric must be provided in the request. - * - * 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 new logs-based metric, which must not have an identifier that - * already exists. - * - * Generated from protobuf field .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Logging\V2\LogMetric|null - */ - public function getMetric() - { - return $this->metric; - } - - public function hasMetric() - { - return isset($this->metric); - } - - public function clearMetric() - { - unset($this->metric); - } - - /** - * Required. The new logs-based metric, which must not have an identifier that - * already exists. - * - * Generated from protobuf field .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Logging\V2\LogMetric $var - * @return $this - */ - public function setMetric($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogMetric::class); - $this->metric = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateSinkRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateSinkRequest.php deleted file mode 100644 index 974dd3d15f29..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateSinkRequest.php +++ /dev/null @@ -1,217 +0,0 @@ -google.logging.v2.CreateSinkRequest - */ -class CreateSinkRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource in which to create the sink: - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" - * For examples: - * `"projects/my-project"` - * `"organizations/123456789"` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The new sink, whose `name` parameter is a sink identifier that - * is not already in use. - * - * Generated from protobuf field .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $sink = null; - /** - * Optional. Determines the kind of IAM identity returned as `writer_identity` - * in the new sink. If this value is omitted or set to false, and if the - * sink's parent is a project, then the value returned as `writer_identity` is - * the same group or service account used by Cloud Logging before the addition - * of writer identities to this API. The sink's destination must be in the - * same project as the sink itself. - * If this field is set to true, or if the sink is owned by a non-project - * resource such as an organization, then the value of `writer_identity` will - * be a unique service account used only for exports from the new sink. For - * more information, see `writer_identity` in - * [LogSink][google.logging.v2.LogSink]. - * - * Generated from protobuf field bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $unique_writer_identity = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource in which to create the sink: - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" - * For examples: - * `"projects/my-project"` - * `"organizations/123456789"` - * @type \Google\Cloud\Logging\V2\LogSink $sink - * Required. The new sink, whose `name` parameter is a sink identifier that - * is not already in use. - * @type bool $unique_writer_identity - * Optional. Determines the kind of IAM identity returned as `writer_identity` - * in the new sink. If this value is omitted or set to false, and if the - * sink's parent is a project, then the value returned as `writer_identity` is - * the same group or service account used by Cloud Logging before the addition - * of writer identities to this API. The sink's destination must be in the - * same project as the sink itself. - * If this field is set to true, or if the sink is owned by a non-project - * resource such as an organization, then the value of `writer_identity` will - * be a unique service account used only for exports from the new sink. For - * more information, see `writer_identity` in - * [LogSink][google.logging.v2.LogSink]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource in which to create the sink: - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" - * For examples: - * `"projects/my-project"` - * `"organizations/123456789"` - * - * 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 in which to create the sink: - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" - * For examples: - * `"projects/my-project"` - * `"organizations/123456789"` - * - * 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 new sink, whose `name` parameter is a sink identifier that - * is not already in use. - * - * Generated from protobuf field .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Logging\V2\LogSink|null - */ - public function getSink() - { - return $this->sink; - } - - public function hasSink() - { - return isset($this->sink); - } - - public function clearSink() - { - unset($this->sink); - } - - /** - * Required. The new sink, whose `name` parameter is a sink identifier that - * is not already in use. - * - * Generated from protobuf field .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Logging\V2\LogSink $var - * @return $this - */ - public function setSink($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogSink::class); - $this->sink = $var; - - return $this; - } - - /** - * Optional. Determines the kind of IAM identity returned as `writer_identity` - * in the new sink. If this value is omitted or set to false, and if the - * sink's parent is a project, then the value returned as `writer_identity` is - * the same group or service account used by Cloud Logging before the addition - * of writer identities to this API. The sink's destination must be in the - * same project as the sink itself. - * If this field is set to true, or if the sink is owned by a non-project - * resource such as an organization, then the value of `writer_identity` will - * be a unique service account used only for exports from the new sink. For - * more information, see `writer_identity` in - * [LogSink][google.logging.v2.LogSink]. - * - * Generated from protobuf field bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getUniqueWriterIdentity() - { - return $this->unique_writer_identity; - } - - /** - * Optional. Determines the kind of IAM identity returned as `writer_identity` - * in the new sink. If this value is omitted or set to false, and if the - * sink's parent is a project, then the value returned as `writer_identity` is - * the same group or service account used by Cloud Logging before the addition - * of writer identities to this API. The sink's destination must be in the - * same project as the sink itself. - * If this field is set to true, or if the sink is owned by a non-project - * resource such as an organization, then the value of `writer_identity` will - * be a unique service account used only for exports from the new sink. For - * more information, see `writer_identity` in - * [LogSink][google.logging.v2.LogSink]. - * - * Generated from protobuf field bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setUniqueWriterIdentity($var) - { - GPBUtil::checkBool($var); - $this->unique_writer_identity = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateViewRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateViewRequest.php deleted file mode 100644 index 08a1db42522e..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/CreateViewRequest.php +++ /dev/null @@ -1,165 +0,0 @@ -google.logging.v2.CreateViewRequest - */ -class CreateViewRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The bucket in which to create the view - * `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket"` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $parent = ''; - /** - * Required. A client-assigned identifier such as `"my-view"`. Identifiers are - * limited to 100 characters and can include only letters, digits, - * underscores, hyphens, and periods. - * - * Generated from protobuf field string view_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $view_id = ''; - /** - * Required. The new view. - * - * Generated from protobuf field .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $view = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The bucket in which to create the view - * `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket"` - * @type string $view_id - * Required. A client-assigned identifier such as `"my-view"`. Identifiers are - * limited to 100 characters and can include only letters, digits, - * underscores, hyphens, and periods. - * @type \Google\Cloud\Logging\V2\LogView $view - * Required. The new view. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The bucket in which to create the view - * `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket"` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The bucket in which to create the view - * `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket"` - * - * 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. A client-assigned identifier such as `"my-view"`. Identifiers are - * limited to 100 characters and can include only letters, digits, - * underscores, hyphens, and periods. - * - * Generated from protobuf field string view_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getViewId() - { - return $this->view_id; - } - - /** - * Required. A client-assigned identifier such as `"my-view"`. Identifiers are - * limited to 100 characters and can include only letters, digits, - * underscores, hyphens, and periods. - * - * Generated from protobuf field string view_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setViewId($var) - { - GPBUtil::checkString($var, True); - $this->view_id = $var; - - return $this; - } - - /** - * Required. The new view. - * - * Generated from protobuf field .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Logging\V2\LogView|null - */ - public function getView() - { - return $this->view; - } - - public function hasView() - { - return isset($this->view); - } - - public function clearView() - { - unset($this->view); - } - - /** - * Required. The new view. - * - * Generated from protobuf field .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Logging\V2\LogView $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogView::class); - $this->view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteBucketRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteBucketRequest.php deleted file mode 100644 index ede048203de1..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteBucketRequest.php +++ /dev/null @@ -1,91 +0,0 @@ -google.logging.v2.DeleteBucketRequest - */ -class DeleteBucketRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full resource name of the bucket to delete. - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket"` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The full resource name of the bucket to delete. - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket"` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full resource name of the bucket to delete. - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket"` - * - * 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 resource name of the bucket to delete. - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket"` - * - * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteExclusionRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteExclusionRequest.php deleted file mode 100644 index dcce042dc163..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteExclusionRequest.php +++ /dev/null @@ -1,91 +0,0 @@ -google.logging.v2.DeleteExclusionRequest - */ -class DeleteExclusionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of an existing exclusion to delete: - * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - * For example: - * `"projects/my-project/exclusions/my-exclusion"` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of an existing exclusion to delete: - * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - * For example: - * `"projects/my-project/exclusions/my-exclusion"` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of an existing exclusion to delete: - * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - * For example: - * `"projects/my-project/exclusions/my-exclusion"` - * - * 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 an existing exclusion to delete: - * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - * For example: - * `"projects/my-project/exclusions/my-exclusion"` - * - * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLogMetricRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLogMetricRequest.php deleted file mode 100644 index 7c8495085a34..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLogMetricRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.logging.v2.DeleteLogMetricRequest - */ -class DeleteLogMetricRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the metric to delete: - * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - * - * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $metric_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $metric_name - * Required. The resource name of the metric to delete: - * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingMetrics::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the metric to delete: - * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - * - * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getMetricName() - { - return $this->metric_name; - } - - /** - * Required. The resource name of the metric to delete: - * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - * - * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setMetricName($var) - { - GPBUtil::checkString($var, True); - $this->metric_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLogRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLogRequest.php deleted file mode 100644 index 4bfa2460e7c5..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteLogRequest.php +++ /dev/null @@ -1,103 +0,0 @@ -google.logging.v2.DeleteLogRequest - */ -class DeleteLogRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the log to delete: - * * `projects/[PROJECT_ID]/logs/[LOG_ID]` - * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` - * * `folders/[FOLDER_ID]/logs/[LOG_ID]` - * `[LOG_ID]` must be URL-encoded. For example, - * `"projects/my-project-id/logs/syslog"`, - * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. - * For more information about log names, see - * [LogEntry][google.logging.v2.LogEntry]. - * - * Generated from protobuf field string log_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $log_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $log_name - * Required. The resource name of the log to delete: - * * `projects/[PROJECT_ID]/logs/[LOG_ID]` - * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` - * * `folders/[FOLDER_ID]/logs/[LOG_ID]` - * `[LOG_ID]` must be URL-encoded. For example, - * `"projects/my-project-id/logs/syslog"`, - * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. - * For more information about log names, see - * [LogEntry][google.logging.v2.LogEntry]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\Logging::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the log to delete: - * * `projects/[PROJECT_ID]/logs/[LOG_ID]` - * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` - * * `folders/[FOLDER_ID]/logs/[LOG_ID]` - * `[LOG_ID]` must be URL-encoded. For example, - * `"projects/my-project-id/logs/syslog"`, - * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. - * For more information about log names, see - * [LogEntry][google.logging.v2.LogEntry]. - * - * Generated from protobuf field string log_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getLogName() - { - return $this->log_name; - } - - /** - * Required. The resource name of the log to delete: - * * `projects/[PROJECT_ID]/logs/[LOG_ID]` - * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` - * * `folders/[FOLDER_ID]/logs/[LOG_ID]` - * `[LOG_ID]` must be URL-encoded. For example, - * `"projects/my-project-id/logs/syslog"`, - * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. - * For more information about log names, see - * [LogEntry][google.logging.v2.LogEntry]. - * - * Generated from protobuf field string log_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setLogName($var) - { - GPBUtil::checkString($var, True); - $this->log_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteSinkRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteSinkRequest.php deleted file mode 100644 index 9634479cb435..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteSinkRequest.php +++ /dev/null @@ -1,95 +0,0 @@ -google.logging.v2.DeleteSinkRequest - */ -class DeleteSinkRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full resource name of the sink to delete, including the - * parent resource and the sink identifier: - * "projects/[PROJECT_ID]/sinks/[SINK_ID]" - * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * For example: - * `"projects/my-project/sinks/my-sink"` - * - * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $sink_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $sink_name - * Required. The full resource name of the sink to delete, including the - * parent resource and the sink identifier: - * "projects/[PROJECT_ID]/sinks/[SINK_ID]" - * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * For example: - * `"projects/my-project/sinks/my-sink"` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full resource name of the sink to delete, including the - * parent resource and the sink identifier: - * "projects/[PROJECT_ID]/sinks/[SINK_ID]" - * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * For example: - * `"projects/my-project/sinks/my-sink"` - * - * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getSinkName() - { - return $this->sink_name; - } - - /** - * Required. The full resource name of the sink to delete, including the - * parent resource and the sink identifier: - * "projects/[PROJECT_ID]/sinks/[SINK_ID]" - * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * For example: - * `"projects/my-project/sinks/my-sink"` - * - * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSinkName($var) - { - GPBUtil::checkString($var, True); - $this->sink_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteViewRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteViewRequest.php deleted file mode 100644 index bafd213c7851..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/DeleteViewRequest.php +++ /dev/null @@ -1,79 +0,0 @@ -google.logging.v2.DeleteViewRequest - */ -class DeleteViewRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full resource name of the view to delete: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The full resource name of the view to delete: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full resource name of the view to delete: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` - * - * 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 resource name of the view to delete: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` - * - * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetBucketRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetBucketRequest.php deleted file mode 100644 index 782c41088c2b..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetBucketRequest.php +++ /dev/null @@ -1,91 +0,0 @@ -google.logging.v2.GetBucketRequest - */ -class GetBucketRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the bucket: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket"` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the bucket: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket"` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the bucket: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket"` - * - * 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 bucket: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket"` - * - * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetCmekSettingsRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetCmekSettingsRequest.php deleted file mode 100644 index cafdee7bf6e4..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetCmekSettingsRequest.php +++ /dev/null @@ -1,111 +0,0 @@ -google.logging.v2.GetCmekSettingsRequest - */ -class GetCmekSettingsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource for which to retrieve CMEK settings. - * "projects/[PROJECT_ID]/cmekSettings" - * "organizations/[ORGANIZATION_ID]/cmekSettings" - * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" - * "folders/[FOLDER_ID]/cmekSettings" - * For example: - * `"organizations/12345/cmekSettings"` - * Note: CMEK for the Log Router can be configured for Google Cloud projects, - * folders, organizations and billing accounts. Once configured for an - * organization, it applies to all projects and folders in the Google Cloud - * organization. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource for which to retrieve CMEK settings. - * "projects/[PROJECT_ID]/cmekSettings" - * "organizations/[ORGANIZATION_ID]/cmekSettings" - * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" - * "folders/[FOLDER_ID]/cmekSettings" - * For example: - * `"organizations/12345/cmekSettings"` - * Note: CMEK for the Log Router can be configured for Google Cloud projects, - * folders, organizations and billing accounts. Once configured for an - * organization, it applies to all projects and folders in the Google Cloud - * organization. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource for which to retrieve CMEK settings. - * "projects/[PROJECT_ID]/cmekSettings" - * "organizations/[ORGANIZATION_ID]/cmekSettings" - * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" - * "folders/[FOLDER_ID]/cmekSettings" - * For example: - * `"organizations/12345/cmekSettings"` - * Note: CMEK for the Log Router can be configured for Google Cloud projects, - * folders, organizations and billing accounts. Once configured for an - * organization, it applies to all projects and folders in the Google Cloud - * organization. - * - * 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 for which to retrieve CMEK settings. - * "projects/[PROJECT_ID]/cmekSettings" - * "organizations/[ORGANIZATION_ID]/cmekSettings" - * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" - * "folders/[FOLDER_ID]/cmekSettings" - * For example: - * `"organizations/12345/cmekSettings"` - * Note: CMEK for the Log Router can be configured for Google Cloud projects, - * folders, organizations and billing accounts. Once configured for an - * organization, it applies to all projects and folders in the Google Cloud - * organization. - * - * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetExclusionRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetExclusionRequest.php deleted file mode 100644 index 11606278b0eb..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetExclusionRequest.php +++ /dev/null @@ -1,91 +0,0 @@ -google.logging.v2.GetExclusionRequest - */ -class GetExclusionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of an existing exclusion: - * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - * For example: - * `"projects/my-project/exclusions/my-exclusion"` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of an existing exclusion: - * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - * For example: - * `"projects/my-project/exclusions/my-exclusion"` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of an existing exclusion: - * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - * For example: - * `"projects/my-project/exclusions/my-exclusion"` - * - * 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 an existing exclusion: - * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - * For example: - * `"projects/my-project/exclusions/my-exclusion"` - * - * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetLogMetricRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetLogMetricRequest.php deleted file mode 100644 index 5220c283d7ba..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetLogMetricRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.logging.v2.GetLogMetricRequest - */ -class GetLogMetricRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the desired metric: - * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - * - * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $metric_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $metric_name - * Required. The resource name of the desired metric: - * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingMetrics::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the desired metric: - * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - * - * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getMetricName() - { - return $this->metric_name; - } - - /** - * Required. The resource name of the desired metric: - * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - * - * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setMetricName($var) - { - GPBUtil::checkString($var, True); - $this->metric_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetSettingsRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetSettingsRequest.php deleted file mode 100644 index d75c103c02a6..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetSettingsRequest.php +++ /dev/null @@ -1,111 +0,0 @@ -google.logging.v2.GetSettingsRequest - */ -class GetSettingsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource for which to retrieve settings. - * "projects/[PROJECT_ID]/settings" - * "organizations/[ORGANIZATION_ID]/settings" - * "billingAccounts/[BILLING_ACCOUNT_ID]/settings" - * "folders/[FOLDER_ID]/settings" - * For example: - * `"organizations/12345/settings"` - * Note: Settings for the Log Router can be get for Google Cloud projects, - * folders, organizations and billing accounts. Currently it can only be - * configured for organizations. Once configured for an organization, it - * applies to all projects and folders in the Google Cloud organization. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource for which to retrieve settings. - * "projects/[PROJECT_ID]/settings" - * "organizations/[ORGANIZATION_ID]/settings" - * "billingAccounts/[BILLING_ACCOUNT_ID]/settings" - * "folders/[FOLDER_ID]/settings" - * For example: - * `"organizations/12345/settings"` - * Note: Settings for the Log Router can be get for Google Cloud projects, - * folders, organizations and billing accounts. Currently it can only be - * configured for organizations. Once configured for an organization, it - * applies to all projects and folders in the Google Cloud organization. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource for which to retrieve settings. - * "projects/[PROJECT_ID]/settings" - * "organizations/[ORGANIZATION_ID]/settings" - * "billingAccounts/[BILLING_ACCOUNT_ID]/settings" - * "folders/[FOLDER_ID]/settings" - * For example: - * `"organizations/12345/settings"` - * Note: Settings for the Log Router can be get for Google Cloud projects, - * folders, organizations and billing accounts. Currently it can only be - * configured for organizations. Once configured for an organization, it - * applies to all projects and folders in the Google Cloud organization. - * - * 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 for which to retrieve settings. - * "projects/[PROJECT_ID]/settings" - * "organizations/[ORGANIZATION_ID]/settings" - * "billingAccounts/[BILLING_ACCOUNT_ID]/settings" - * "folders/[FOLDER_ID]/settings" - * For example: - * `"organizations/12345/settings"` - * Note: Settings for the Log Router can be get for Google Cloud projects, - * folders, organizations and billing accounts. Currently it can only be - * configured for organizations. Once configured for an organization, it - * applies to all projects and folders in the Google Cloud organization. - * - * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetSinkRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetSinkRequest.php deleted file mode 100644 index 3a2b33f46f28..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetSinkRequest.php +++ /dev/null @@ -1,91 +0,0 @@ -google.logging.v2.GetSinkRequest - */ -class GetSinkRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the sink: - * "projects/[PROJECT_ID]/sinks/[SINK_ID]" - * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * For example: - * `"projects/my-project/sinks/my-sink"` - * - * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $sink_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $sink_name - * Required. The resource name of the sink: - * "projects/[PROJECT_ID]/sinks/[SINK_ID]" - * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * For example: - * `"projects/my-project/sinks/my-sink"` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the sink: - * "projects/[PROJECT_ID]/sinks/[SINK_ID]" - * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * For example: - * `"projects/my-project/sinks/my-sink"` - * - * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getSinkName() - { - return $this->sink_name; - } - - /** - * Required. The resource name of the sink: - * "projects/[PROJECT_ID]/sinks/[SINK_ID]" - * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * For example: - * `"projects/my-project/sinks/my-sink"` - * - * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSinkName($var) - { - GPBUtil::checkString($var, True); - $this->sink_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetViewRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetViewRequest.php deleted file mode 100644 index 3ed30a2531a5..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/GetViewRequest.php +++ /dev/null @@ -1,79 +0,0 @@ -google.logging.v2.GetViewRequest - */ -class GetViewRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the policy: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the policy: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the policy: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` - * - * 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 policy: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` - * - * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/LifecycleState.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LifecycleState.php deleted file mode 100644 index 0fe746cebd4d..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LifecycleState.php +++ /dev/null @@ -1,86 +0,0 @@ -google.logging.v2.LifecycleState - */ -class LifecycleState -{ - /** - * Unspecified state. This is only used/useful for distinguishing unset - * values. - * - * Generated from protobuf enum LIFECYCLE_STATE_UNSPECIFIED = 0; - */ - const LIFECYCLE_STATE_UNSPECIFIED = 0; - /** - * The normal and active state. - * - * Generated from protobuf enum ACTIVE = 1; - */ - const ACTIVE = 1; - /** - * The resource has been marked for deletion by the user. For some resources - * (e.g. buckets), this can be reversed by an un-delete operation. - * - * Generated from protobuf enum DELETE_REQUESTED = 2; - */ - const DELETE_REQUESTED = 2; - /** - * The resource has been marked for an update by the user. It will remain in - * this state until the update is complete. - * - * Generated from protobuf enum UPDATING = 3; - */ - const UPDATING = 3; - /** - * The resource has been marked for creation by the user. It will remain in - * this state until the creation is complete. - * - * Generated from protobuf enum CREATING = 4; - */ - const CREATING = 4; - /** - * The resource is in an INTERNAL error state. - * - * Generated from protobuf enum FAILED = 5; - */ - const FAILED = 5; - - private static $valueToName = [ - self::LIFECYCLE_STATE_UNSPECIFIED => 'LIFECYCLE_STATE_UNSPECIFIED', - self::ACTIVE => 'ACTIVE', - self::DELETE_REQUESTED => 'DELETE_REQUESTED', - self::UPDATING => 'UPDATING', - self::CREATING => 'CREATING', - 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); - } -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListBucketsRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListBucketsRequest.php deleted file mode 100644 index 1e5ef1160cf4..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListBucketsRequest.php +++ /dev/null @@ -1,183 +0,0 @@ -google.logging.v2.ListBucketsRequest - */ -class ListBucketsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource whose buckets are to be listed: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" - * Note: The locations portion of the resource must be specified, but - * supplying the character `-` in place of [LOCATION_ID] will return all - * buckets. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource whose buckets are to be listed: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" - * Note: The locations portion of the resource must be specified, but - * supplying the character `-` in place of [LOCATION_ID] will return all - * buckets. - * @type string $page_token - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * @type int $page_size - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource whose buckets are to be listed: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" - * Note: The locations portion of the resource must be specified, but - * supplying the character `-` in place of [LOCATION_ID] will return all - * buckets. - * - * 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 whose buckets are to be listed: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" - * Note: The locations portion of the resource must be specified, but - * supplying the character `-` in place of [LOCATION_ID] will return all - * buckets. - * - * 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. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * - * 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 results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * - * 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 results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * - * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListBucketsResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListBucketsResponse.php deleted file mode 100644 index 28df3a300104..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListBucketsResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -google.logging.v2.ListBucketsResponse - */ -class ListBucketsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A list of buckets. - * - * Generated from protobuf field repeated .google.logging.v2.LogBucket buckets = 1; - */ - private $buckets; - /** - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call the same - * method again using the value of `nextPageToken` as `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\Logging\V2\LogBucket>|\Google\Protobuf\Internal\RepeatedField $buckets - * A list of buckets. - * @type string $next_page_token - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call the same - * method again using the value of `nextPageToken` as `pageToken`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * A list of buckets. - * - * Generated from protobuf field repeated .google.logging.v2.LogBucket buckets = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBuckets() - { - return $this->buckets; - } - - /** - * A list of buckets. - * - * Generated from protobuf field repeated .google.logging.v2.LogBucket buckets = 1; - * @param array<\Google\Cloud\Logging\V2\LogBucket>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBuckets($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogBucket::class); - $this->buckets = $arr; - - return $this; - } - - /** - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call the same - * method again using the value of `nextPageToken` as `pageToken`. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call the same - * method again using the value of `nextPageToken` as `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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListExclusionsRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListExclusionsRequest.php deleted file mode 100644 index 6cf6f685825f..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListExclusionsRequest.php +++ /dev/null @@ -1,171 +0,0 @@ -google.logging.v2.ListExclusionsRequest - */ -class ListExclusionsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource whose exclusions are to be listed. - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource whose exclusions are to be listed. - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" - * @type string $page_token - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * @type int $page_size - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource whose exclusions are to be listed. - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_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 whose exclusions are to be listed. - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_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. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * - * 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 results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * - * 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 results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * - * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListExclusionsResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListExclusionsResponse.php deleted file mode 100644 index 55311d43e55f..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListExclusionsResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -google.logging.v2.ListExclusionsResponse - */ -class ListExclusionsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A list of exclusions. - * - * Generated from protobuf field repeated .google.logging.v2.LogExclusion exclusions = 1; - */ - private $exclusions; - /** - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call the same - * method again using the value of `nextPageToken` as `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\Logging\V2\LogExclusion>|\Google\Protobuf\Internal\RepeatedField $exclusions - * A list of exclusions. - * @type string $next_page_token - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call the same - * method again using the value of `nextPageToken` as `pageToken`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * A list of exclusions. - * - * Generated from protobuf field repeated .google.logging.v2.LogExclusion exclusions = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getExclusions() - { - return $this->exclusions; - } - - /** - * A list of exclusions. - * - * Generated from protobuf field repeated .google.logging.v2.LogExclusion exclusions = 1; - * @param array<\Google\Cloud\Logging\V2\LogExclusion>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setExclusions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogExclusion::class); - $this->exclusions = $arr; - - return $this; - } - - /** - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call the same - * method again using the value of `nextPageToken` as `pageToken`. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call the same - * method again using the value of `nextPageToken` as `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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogEntriesRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogEntriesRequest.php deleted file mode 100644 index 08859ba8ba62..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogEntriesRequest.php +++ /dev/null @@ -1,311 +0,0 @@ -google.logging.v2.ListLogEntriesRequest - */ -class ListLogEntriesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Names of one or more parent resources from which to - * retrieve log entries: - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * May alternatively be one or more views: - * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * Projects listed in the `project_ids` field are added to this list. - * A maximum of 100 resources may be specified in a single request. - * - * Generated from protobuf field repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $resource_names; - /** - * Optional. Only log entries that match the filter are returned. An empty - * filter matches all log entries in the resources listed in `resource_names`. - * Referencing a parent resource that is not listed in `resource_names` will - * cause the filter to return no results. The maximum length of a filter is - * 20,000 characters. - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. How the results should be sorted. Presently, the only permitted - * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first - * option returns entries in order of increasing values of - * `LogEntry.timestamp` (oldest first), and the second option returns entries - * in order of decreasing timestamps (newest first). Entries with equal - * timestamps are returned in order of their `insert_id` values. - * - * Generated from protobuf field string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - /** - * Optional. The maximum number of results to return from this request. - * Default is 50. If the value is negative or exceeds 1000, the request is - * rejected. The presence of `next_page_token` in the response indicates that - * more results might be available. - * - * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. If present, then retrieve 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 should be identical to those in the previous call. - * - * 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 array|\Google\Protobuf\Internal\RepeatedField $resource_names - * Required. Names of one or more parent resources from which to - * retrieve log entries: - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * May alternatively be one or more views: - * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * Projects listed in the `project_ids` field are added to this list. - * A maximum of 100 resources may be specified in a single request. - * @type string $filter - * Optional. Only log entries that match the filter are returned. An empty - * filter matches all log entries in the resources listed in `resource_names`. - * Referencing a parent resource that is not listed in `resource_names` will - * cause the filter to return no results. The maximum length of a filter is - * 20,000 characters. - * @type string $order_by - * Optional. How the results should be sorted. Presently, the only permitted - * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first - * option returns entries in order of increasing values of - * `LogEntry.timestamp` (oldest first), and the second option returns entries - * in order of decreasing timestamps (newest first). Entries with equal - * timestamps are returned in order of their `insert_id` values. - * @type int $page_size - * Optional. The maximum number of results to return from this request. - * Default is 50. If the value is negative or exceeds 1000, the request is - * rejected. The presence of `next_page_token` in the response indicates that - * more results might be available. - * @type string $page_token - * Optional. If present, then retrieve 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 should be identical to those in the previous call. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\Logging::initOnce(); - parent::__construct($data); - } - - /** - * Required. Names of one or more parent resources from which to - * retrieve log entries: - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * May alternatively be one or more views: - * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * Projects listed in the `project_ids` field are added to this list. - * A maximum of 100 resources may be specified in a single request. - * - * Generated from protobuf field repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getResourceNames() - { - return $this->resource_names; - } - - /** - * Required. Names of one or more parent resources from which to - * retrieve log entries: - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * May alternatively be one or more views: - * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * Projects listed in the `project_ids` field are added to this list. - * A maximum of 100 resources may be specified in a single request. - * - * Generated from protobuf field repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setResourceNames($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->resource_names = $arr; - - return $this; - } - - /** - * Optional. Only log entries that match the filter are returned. An empty - * filter matches all log entries in the resources listed in `resource_names`. - * Referencing a parent resource that is not listed in `resource_names` will - * cause the filter to return no results. The maximum length of a filter is - * 20,000 characters. - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Only log entries that match the filter are returned. An empty - * filter matches all log entries in the resources listed in `resource_names`. - * Referencing a parent resource that is not listed in `resource_names` will - * cause the filter to return no results. The maximum length of a filter is - * 20,000 characters. - * - * Generated from protobuf field string filter = 2 [(.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 the results should be sorted. Presently, the only permitted - * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first - * option returns entries in order of increasing values of - * `LogEntry.timestamp` (oldest first), and the second option returns entries - * in order of decreasing timestamps (newest first). Entries with equal - * timestamps are returned in order of their `insert_id` values. - * - * Generated from protobuf field string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. How the results should be sorted. Presently, the only permitted - * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first - * option returns entries in order of increasing values of - * `LogEntry.timestamp` (oldest first), and the second option returns entries - * in order of decreasing timestamps (newest first). Entries with equal - * timestamps are returned in order of their `insert_id` values. - * - * Generated from protobuf field string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - - /** - * Optional. The maximum number of results to return from this request. - * Default is 50. If the value is negative or exceeds 1000, the request is - * rejected. The presence of `next_page_token` in the response indicates that - * more results might be available. - * - * Generated from protobuf field int32 page_size = 4 [(.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. - * Default is 50. If the value is negative or exceeds 1000, the request is - * rejected. The presence of `next_page_token` in the response indicates that - * more results might be available. - * - * 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. If present, then retrieve 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 should be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. If present, then retrieve 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 should be identical to those in the previous call. - * - * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogEntriesResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogEntriesResponse.php deleted file mode 100644 index 74ceb744157d..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogEntriesResponse.php +++ /dev/null @@ -1,141 +0,0 @@ -google.logging.v2.ListLogEntriesResponse - */ -class ListLogEntriesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A list of log entries. If `entries` is empty, `nextPageToken` may still be - * returned, indicating that more entries may exist. See `nextPageToken` for - * more information. - * - * Generated from protobuf field repeated .google.logging.v2.LogEntry entries = 1; - */ - private $entries; - /** - * If there might be more results than those appearing in this response, then - * `nextPageToken` is included. To get the next set of results, call this - * method again using the value of `nextPageToken` as `pageToken`. - * If a value for `next_page_token` appears and the `entries` field is empty, - * it means that the search found no log entries so far but it did not have - * time to search all the possible log entries. Retry the method with this - * value for `page_token` to continue the search. Alternatively, consider - * speeding up the search by changing your filter to specify a single log name - * or resource type, or to narrow the time range of the search. - * - * 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\Logging\V2\LogEntry>|\Google\Protobuf\Internal\RepeatedField $entries - * A list of log entries. If `entries` is empty, `nextPageToken` may still be - * returned, indicating that more entries may exist. See `nextPageToken` for - * more information. - * @type string $next_page_token - * If there might be more results than those appearing in this response, then - * `nextPageToken` is included. To get the next set of results, call this - * method again using the value of `nextPageToken` as `pageToken`. - * If a value for `next_page_token` appears and the `entries` field is empty, - * it means that the search found no log entries so far but it did not have - * time to search all the possible log entries. Retry the method with this - * value for `page_token` to continue the search. Alternatively, consider - * speeding up the search by changing your filter to specify a single log name - * or resource type, or to narrow the time range of the search. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\Logging::initOnce(); - parent::__construct($data); - } - - /** - * A list of log entries. If `entries` is empty, `nextPageToken` may still be - * returned, indicating that more entries may exist. See `nextPageToken` for - * more information. - * - * Generated from protobuf field repeated .google.logging.v2.LogEntry entries = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEntries() - { - return $this->entries; - } - - /** - * A list of log entries. If `entries` is empty, `nextPageToken` may still be - * returned, indicating that more entries may exist. See `nextPageToken` for - * more information. - * - * Generated from protobuf field repeated .google.logging.v2.LogEntry entries = 1; - * @param array<\Google\Cloud\Logging\V2\LogEntry>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEntries($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogEntry::class); - $this->entries = $arr; - - return $this; - } - - /** - * If there might be more results than those appearing in this response, then - * `nextPageToken` is included. To get the next set of results, call this - * method again using the value of `nextPageToken` as `pageToken`. - * If a value for `next_page_token` appears and the `entries` field is empty, - * it means that the search found no log entries so far but it did not have - * time to search all the possible log entries. Retry the method with this - * value for `page_token` to continue the search. Alternatively, consider - * speeding up the search by changing your filter to specify a single log name - * or resource type, or to narrow the time range of the search. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If there might be more results than those appearing in this response, then - * `nextPageToken` is included. To get the next set of results, call this - * method again using the value of `nextPageToken` as `pageToken`. - * If a value for `next_page_token` appears and the `entries` field is empty, - * it means that the search found no log entries so far but it did not have - * time to search all the possible log entries. Retry the method with this - * value for `page_token` to continue the search. Alternatively, consider - * speeding up the search by changing your filter to specify a single log name - * or resource type, or to narrow the time range of the search. - * - * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogMetricsRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogMetricsRequest.php deleted file mode 100644 index 58efa6ad09d5..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogMetricsRequest.php +++ /dev/null @@ -1,159 +0,0 @@ -google.logging.v2.ListLogMetricsRequest - */ -class ListLogMetricsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project containing the metrics: - * "projects/[PROJECT_ID]" - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the project containing the metrics: - * "projects/[PROJECT_ID]" - * @type string $page_token - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * @type int $page_size - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingMetrics::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project containing the metrics: - * "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 containing the metrics: - * "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; - } - - /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * - * 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 results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * - * 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 results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * - * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogMetricsResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogMetricsResponse.php deleted file mode 100644 index 62b84c3eb3e0..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogMetricsResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -google.logging.v2.ListLogMetricsResponse - */ -class ListLogMetricsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A list of logs-based metrics. - * - * Generated from protobuf field repeated .google.logging.v2.LogMetric metrics = 1; - */ - private $metrics; - /** - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call this - * method again using the value of `nextPageToken` as `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\Logging\V2\LogMetric>|\Google\Protobuf\Internal\RepeatedField $metrics - * A list of logs-based metrics. - * @type string $next_page_token - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call this - * method again using the value of `nextPageToken` as `pageToken`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingMetrics::initOnce(); - parent::__construct($data); - } - - /** - * A list of logs-based metrics. - * - * Generated from protobuf field repeated .google.logging.v2.LogMetric metrics = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMetrics() - { - return $this->metrics; - } - - /** - * A list of logs-based metrics. - * - * Generated from protobuf field repeated .google.logging.v2.LogMetric metrics = 1; - * @param array<\Google\Cloud\Logging\V2\LogMetric>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMetrics($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogMetric::class); - $this->metrics = $arr; - - return $this; - } - - /** - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call this - * method again using the value of `nextPageToken` as `pageToken`. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call this - * method again using the value of `nextPageToken` as `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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogsRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogsRequest.php deleted file mode 100644 index 457a22414856..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogsRequest.php +++ /dev/null @@ -1,245 +0,0 @@ -google.logging.v2.ListLogsRequest - */ -class ListLogsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name to list logs for: - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. List of resource names to list logs for: - * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * To support legacy queries, it could also be: - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * The resource name in the `parent` field is added to this list. - * - * Generated from protobuf field repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - private $resource_names; - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name to list logs for: - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * @type array|\Google\Protobuf\Internal\RepeatedField $resource_names - * Optional. List of resource names to list logs for: - * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * To support legacy queries, it could also be: - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * The resource name in the `parent` field is added to this list. - * @type int $page_size - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * @type string $page_token - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\Logging::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name to list logs for: - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_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 to list logs for: - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_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. List of resource names to list logs for: - * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * To support legacy queries, it could also be: - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * The resource name in the `parent` field is added to this list. - * - * Generated from protobuf field repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getResourceNames() - { - return $this->resource_names; - } - - /** - * Optional. List of resource names to list logs for: - * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * To support legacy queries, it could also be: - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * The resource name in the `parent` field is added to this list. - * - * Generated from protobuf field repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setResourceNames($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->resource_names = $arr; - - return $this; - } - - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * - * 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. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * - * 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, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should 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, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should 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; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogsResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogsResponse.php deleted file mode 100644 index 64ae58f309ed..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListLogsResponse.php +++ /dev/null @@ -1,117 +0,0 @@ -google.logging.v2.ListLogsResponse - */ -class ListLogsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A list of log names. For example, - * `"projects/my-project/logs/syslog"` or - * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`. - * - * Generated from protobuf field repeated string log_names = 3; - */ - private $log_names; - /** - * If there might be more results than those appearing in this response, then - * `nextPageToken` is included. To get the next set of results, call this - * method again using the value of `nextPageToken` as `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\Protobuf\Internal\RepeatedField $log_names - * A list of log names. For example, - * `"projects/my-project/logs/syslog"` or - * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`. - * @type string $next_page_token - * If there might be more results than those appearing in this response, then - * `nextPageToken` is included. To get the next set of results, call this - * method again using the value of `nextPageToken` as `pageToken`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\Logging::initOnce(); - parent::__construct($data); - } - - /** - * A list of log names. For example, - * `"projects/my-project/logs/syslog"` or - * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`. - * - * Generated from protobuf field repeated string log_names = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLogNames() - { - return $this->log_names; - } - - /** - * A list of log names. For example, - * `"projects/my-project/logs/syslog"` or - * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`. - * - * Generated from protobuf field repeated string log_names = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLogNames($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->log_names = $arr; - - return $this; - } - - /** - * If there might be more results than those appearing in this response, then - * `nextPageToken` is included. To get the next set of results, call this - * method again using the value of `nextPageToken` as `pageToken`. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If there might be more results than those appearing in this response, then - * `nextPageToken` is included. To get the next set of results, call this - * method again using the value of `nextPageToken` as `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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListMonitoredResourceDescriptorsRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListMonitoredResourceDescriptorsRequest.php deleted file mode 100644 index fb1027a08115..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListMonitoredResourceDescriptorsRequest.php +++ /dev/null @@ -1,121 +0,0 @@ -google.logging.v2.ListMonitoredResourceDescriptorsRequest - */ -class ListMonitoredResourceDescriptorsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * - * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $page_size - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * @type string $page_token - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\Logging::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * - * 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 results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * - * 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. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * - * 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; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListMonitoredResourceDescriptorsResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListMonitoredResourceDescriptorsResponse.php deleted file mode 100644 index a70971f90d43..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListMonitoredResourceDescriptorsResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -google.logging.v2.ListMonitoredResourceDescriptorsResponse - */ -class ListMonitoredResourceDescriptorsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A list of resource descriptors. - * - * Generated from protobuf field repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - */ - private $resource_descriptors; - /** - * If there might be more results than those appearing in this response, then - * `nextPageToken` is included. To get the next set of results, call this - * method again using the value of `nextPageToken` as `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\Api\MonitoredResourceDescriptor>|\Google\Protobuf\Internal\RepeatedField $resource_descriptors - * A list of resource descriptors. - * @type string $next_page_token - * If there might be more results than those appearing in this response, then - * `nextPageToken` is included. To get the next set of results, call this - * method again using the value of `nextPageToken` as `pageToken`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\Logging::initOnce(); - parent::__construct($data); - } - - /** - * A list of resource descriptors. - * - * Generated from protobuf field repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getResourceDescriptors() - { - return $this->resource_descriptors; - } - - /** - * A list of resource descriptors. - * - * Generated from protobuf field repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * @param array<\Google\Api\MonitoredResourceDescriptor>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setResourceDescriptors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\MonitoredResourceDescriptor::class); - $this->resource_descriptors = $arr; - - return $this; - } - - /** - * If there might be more results than those appearing in this response, then - * `nextPageToken` is included. To get the next set of results, call this - * method again using the value of `nextPageToken` as `pageToken`. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If there might be more results than those appearing in this response, then - * `nextPageToken` is included. To get the next set of results, call this - * method again using the value of `nextPageToken` as `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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListSinksRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListSinksRequest.php deleted file mode 100644 index 1039925ff64b..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListSinksRequest.php +++ /dev/null @@ -1,171 +0,0 @@ -google.logging.v2.ListSinksRequest - */ -class ListSinksRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource whose sinks are to be listed: - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource whose sinks are to be listed: - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" - * @type string $page_token - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * @type int $page_size - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource whose sinks are to be listed: - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_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 whose sinks are to be listed: - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_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. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * - * 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 results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * - * 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 results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * - * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListSinksResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListSinksResponse.php deleted file mode 100644 index 0f7ff3bce972..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListSinksResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -google.logging.v2.ListSinksResponse - */ -class ListSinksResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A list of sinks. - * - * Generated from protobuf field repeated .google.logging.v2.LogSink sinks = 1; - */ - private $sinks; - /** - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call the same - * method again using the value of `nextPageToken` as `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\Logging\V2\LogSink>|\Google\Protobuf\Internal\RepeatedField $sinks - * A list of sinks. - * @type string $next_page_token - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call the same - * method again using the value of `nextPageToken` as `pageToken`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * A list of sinks. - * - * Generated from protobuf field repeated .google.logging.v2.LogSink sinks = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSinks() - { - return $this->sinks; - } - - /** - * A list of sinks. - * - * Generated from protobuf field repeated .google.logging.v2.LogSink sinks = 1; - * @param array<\Google\Cloud\Logging\V2\LogSink>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSinks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogSink::class); - $this->sinks = $arr; - - return $this; - } - - /** - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call the same - * method again using the value of `nextPageToken` as `pageToken`. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call the same - * method again using the value of `nextPageToken` as `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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListViewsRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListViewsRequest.php deleted file mode 100644 index 9cb9d7e0540b..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListViewsRequest.php +++ /dev/null @@ -1,159 +0,0 @@ -google.logging.v2.ListViewsRequest - */ -class ListViewsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The bucket whose views are to be listed: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $parent = ''; - /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The bucket whose views are to be listed: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * @type string $page_token - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * @type int $page_size - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The bucket whose views are to be listed: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The bucket whose views are to be listed: - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * - * 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. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - * - * 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 results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * - * 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 results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - * - * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListViewsResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListViewsResponse.php deleted file mode 100644 index 246cfb190d38..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/ListViewsResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -google.logging.v2.ListViewsResponse - */ -class ListViewsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A list of views. - * - * Generated from protobuf field repeated .google.logging.v2.LogView views = 1; - */ - private $views; - /** - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call the same - * method again using the value of `nextPageToken` as `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\Logging\V2\LogView>|\Google\Protobuf\Internal\RepeatedField $views - * A list of views. - * @type string $next_page_token - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call the same - * method again using the value of `nextPageToken` as `pageToken`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * A list of views. - * - * Generated from protobuf field repeated .google.logging.v2.LogView views = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getViews() - { - return $this->views; - } - - /** - * A list of views. - * - * Generated from protobuf field repeated .google.logging.v2.LogView views = 1; - * @param array<\Google\Cloud\Logging\V2\LogView>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setViews($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogView::class); - $this->views = $arr; - - return $this; - } - - /** - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call the same - * method again using the value of `nextPageToken` as `pageToken`. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call the same - * method again using the value of `nextPageToken` as `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/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogBucket.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogBucket.php deleted file mode 100644 index 775a7fd41535..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogBucket.php +++ /dev/null @@ -1,525 +0,0 @@ -google.logging.v2.LogBucket - */ -class LogBucket extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name of the bucket. - * For example: - * `projects/my-project/locations/global/buckets/my-bucket` - * For a list of supported locations, see [Supported - * Regions](https://cloud.google.com/logging/docs/region-support) - * For the location of `global` it is unspecified where log entries are - * actually stored. - * After a bucket has been created, the location cannot be changed. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Describes this bucket. - * - * Generated from protobuf field string description = 3; - */ - protected $description = ''; - /** - * Output only. The creation timestamp of the bucket. This is not set for any - * of the default buckets. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The last update timestamp of the bucket. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Logs will be retained by default for this amount of time, after which they - * will automatically be deleted. The minimum retention period is 1 day. If - * this value is set to zero at bucket creation time, the default time of 30 - * days will be used. - * - * Generated from protobuf field int32 retention_days = 11; - */ - protected $retention_days = 0; - /** - * Whether the bucket is locked. - * The retention period on a locked bucket cannot be changed. Locked buckets - * may only be deleted if they are empty. - * - * Generated from protobuf field bool locked = 9; - */ - protected $locked = false; - /** - * Output only. The bucket lifecycle state. - * - * Generated from protobuf field .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $lifecycle_state = 0; - /** - * Whether log analytics is enabled for this bucket. - * Once enabled, log analytics features cannot be disabled. - * - * Generated from protobuf field bool analytics_enabled = 14; - */ - protected $analytics_enabled = false; - /** - * Log entry field paths that are denied access in this bucket. - * The following fields and their children are eligible: `textPayload`, - * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`. - * Restricting a repeated field will restrict all values. Adding a parent will - * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`) - * - * Generated from protobuf field repeated string restricted_fields = 15; - */ - private $restricted_fields; - /** - * A list of indexed fields and related configuration data. - * - * Generated from protobuf field repeated .google.logging.v2.IndexConfig index_configs = 17; - */ - private $index_configs; - /** - * The CMEK settings of the log bucket. If present, new log entries written to - * this log bucket are encrypted using the CMEK key provided in this - * configuration. If a log bucket has CMEK settings, the CMEK settings cannot - * be disabled later by updating the log bucket. Changing the KMS key is - * allowed. - * - * Generated from protobuf field .google.logging.v2.CmekSettings cmek_settings = 19; - */ - protected $cmek_settings = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name of the bucket. - * For example: - * `projects/my-project/locations/global/buckets/my-bucket` - * For a list of supported locations, see [Supported - * Regions](https://cloud.google.com/logging/docs/region-support) - * For the location of `global` it is unspecified where log entries are - * actually stored. - * After a bucket has been created, the location cannot be changed. - * @type string $description - * Describes this bucket. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The creation timestamp of the bucket. This is not set for any - * of the default buckets. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The last update timestamp of the bucket. - * @type int $retention_days - * Logs will be retained by default for this amount of time, after which they - * will automatically be deleted. The minimum retention period is 1 day. If - * this value is set to zero at bucket creation time, the default time of 30 - * days will be used. - * @type bool $locked - * Whether the bucket is locked. - * The retention period on a locked bucket cannot be changed. Locked buckets - * may only be deleted if they are empty. - * @type int $lifecycle_state - * Output only. The bucket lifecycle state. - * @type bool $analytics_enabled - * Whether log analytics is enabled for this bucket. - * Once enabled, log analytics features cannot be disabled. - * @type array|\Google\Protobuf\Internal\RepeatedField $restricted_fields - * Log entry field paths that are denied access in this bucket. - * The following fields and their children are eligible: `textPayload`, - * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`. - * Restricting a repeated field will restrict all values. Adding a parent will - * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`) - * @type array<\Google\Cloud\Logging\V2\IndexConfig>|\Google\Protobuf\Internal\RepeatedField $index_configs - * A list of indexed fields and related configuration data. - * @type \Google\Cloud\Logging\V2\CmekSettings $cmek_settings - * The CMEK settings of the log bucket. If present, new log entries written to - * this log bucket are encrypted using the CMEK key provided in this - * configuration. If a log bucket has CMEK settings, the CMEK settings cannot - * be disabled later by updating the log bucket. Changing the KMS key is - * allowed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name of the bucket. - * For example: - * `projects/my-project/locations/global/buckets/my-bucket` - * For a list of supported locations, see [Supported - * Regions](https://cloud.google.com/logging/docs/region-support) - * For the location of `global` it is unspecified where log entries are - * actually stored. - * After a bucket has been created, the location cannot be changed. - * - * 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 bucket. - * For example: - * `projects/my-project/locations/global/buckets/my-bucket` - * For a list of supported locations, see [Supported - * Regions](https://cloud.google.com/logging/docs/region-support) - * For the location of `global` it is unspecified where log entries are - * actually stored. - * After a bucket has been created, the location cannot be changed. - * - * 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; - } - - /** - * Describes this bucket. - * - * Generated from protobuf field string description = 3; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Describes this bucket. - * - * Generated from protobuf field string description = 3; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. The creation timestamp of the bucket. This is not set for any - * of the default buckets. - * - * 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 creation timestamp of the bucket. This is not set for any - * of the default buckets. - * - * 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 last update timestamp of the bucket. - * - * 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 last update timestamp of the bucket. - * - * 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; - } - - /** - * Logs will be retained by default for this amount of time, after which they - * will automatically be deleted. The minimum retention period is 1 day. If - * this value is set to zero at bucket creation time, the default time of 30 - * days will be used. - * - * Generated from protobuf field int32 retention_days = 11; - * @return int - */ - public function getRetentionDays() - { - return $this->retention_days; - } - - /** - * Logs will be retained by default for this amount of time, after which they - * will automatically be deleted. The minimum retention period is 1 day. If - * this value is set to zero at bucket creation time, the default time of 30 - * days will be used. - * - * Generated from protobuf field int32 retention_days = 11; - * @param int $var - * @return $this - */ - public function setRetentionDays($var) - { - GPBUtil::checkInt32($var); - $this->retention_days = $var; - - return $this; - } - - /** - * Whether the bucket is locked. - * The retention period on a locked bucket cannot be changed. Locked buckets - * may only be deleted if they are empty. - * - * Generated from protobuf field bool locked = 9; - * @return bool - */ - public function getLocked() - { - return $this->locked; - } - - /** - * Whether the bucket is locked. - * The retention period on a locked bucket cannot be changed. Locked buckets - * may only be deleted if they are empty. - * - * Generated from protobuf field bool locked = 9; - * @param bool $var - * @return $this - */ - public function setLocked($var) - { - GPBUtil::checkBool($var); - $this->locked = $var; - - return $this; - } - - /** - * Output only. The bucket lifecycle state. - * - * Generated from protobuf field .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getLifecycleState() - { - return $this->lifecycle_state; - } - - /** - * Output only. The bucket lifecycle state. - * - * Generated from protobuf field .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setLifecycleState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Logging\V2\LifecycleState::class); - $this->lifecycle_state = $var; - - return $this; - } - - /** - * Whether log analytics is enabled for this bucket. - * Once enabled, log analytics features cannot be disabled. - * - * Generated from protobuf field bool analytics_enabled = 14; - * @return bool - */ - public function getAnalyticsEnabled() - { - return $this->analytics_enabled; - } - - /** - * Whether log analytics is enabled for this bucket. - * Once enabled, log analytics features cannot be disabled. - * - * Generated from protobuf field bool analytics_enabled = 14; - * @param bool $var - * @return $this - */ - public function setAnalyticsEnabled($var) - { - GPBUtil::checkBool($var); - $this->analytics_enabled = $var; - - return $this; - } - - /** - * Log entry field paths that are denied access in this bucket. - * The following fields and their children are eligible: `textPayload`, - * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`. - * Restricting a repeated field will restrict all values. Adding a parent will - * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`) - * - * Generated from protobuf field repeated string restricted_fields = 15; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRestrictedFields() - { - return $this->restricted_fields; - } - - /** - * Log entry field paths that are denied access in this bucket. - * The following fields and their children are eligible: `textPayload`, - * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`. - * Restricting a repeated field will restrict all values. Adding a parent will - * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`) - * - * Generated from protobuf field repeated string restricted_fields = 15; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRestrictedFields($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->restricted_fields = $arr; - - return $this; - } - - /** - * A list of indexed fields and related configuration data. - * - * Generated from protobuf field repeated .google.logging.v2.IndexConfig index_configs = 17; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getIndexConfigs() - { - return $this->index_configs; - } - - /** - * A list of indexed fields and related configuration data. - * - * Generated from protobuf field repeated .google.logging.v2.IndexConfig index_configs = 17; - * @param array<\Google\Cloud\Logging\V2\IndexConfig>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setIndexConfigs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\IndexConfig::class); - $this->index_configs = $arr; - - return $this; - } - - /** - * The CMEK settings of the log bucket. If present, new log entries written to - * this log bucket are encrypted using the CMEK key provided in this - * configuration. If a log bucket has CMEK settings, the CMEK settings cannot - * be disabled later by updating the log bucket. Changing the KMS key is - * allowed. - * - * Generated from protobuf field .google.logging.v2.CmekSettings cmek_settings = 19; - * @return \Google\Cloud\Logging\V2\CmekSettings|null - */ - public function getCmekSettings() - { - return $this->cmek_settings; - } - - public function hasCmekSettings() - { - return isset($this->cmek_settings); - } - - public function clearCmekSettings() - { - unset($this->cmek_settings); - } - - /** - * The CMEK settings of the log bucket. If present, new log entries written to - * this log bucket are encrypted using the CMEK key provided in this - * configuration. If a log bucket has CMEK settings, the CMEK settings cannot - * be disabled later by updating the log bucket. Changing the KMS key is - * allowed. - * - * Generated from protobuf field .google.logging.v2.CmekSettings cmek_settings = 19; - * @param \Google\Cloud\Logging\V2\CmekSettings $var - * @return $this - */ - public function setCmekSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\CmekSettings::class); - $this->cmek_settings = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntry.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntry.php deleted file mode 100644 index 3fc817730b2d..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntry.php +++ /dev/null @@ -1,1061 +0,0 @@ -google.logging.v2.LogEntry - */ -class LogEntry extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the log to which this log entry belongs: - * "projects/[PROJECT_ID]/logs/[LOG_ID]" - * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - * "folders/[FOLDER_ID]/logs/[LOG_ID]" - * A project number may be used in place of PROJECT_ID. The project number is - * translated to its corresponding PROJECT_ID internally and the `log_name` - * field will contain PROJECT_ID in queries and exports. - * `[LOG_ID]` must be URL-encoded within `log_name`. Example: - * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. - * `[LOG_ID]` must be less than 512 characters long and can only include the - * following characters: upper and lower case alphanumeric characters, - * forward-slash, underscore, hyphen, and period. - * For backward compatibility, if `log_name` begins with a forward-slash, such - * as `/projects/...`, then the log entry is ingested as usual, but the - * forward-slash is removed. Listing the log entry will not show the leading - * slash and filtering for a log name with a leading slash will never return - * any results. - * - * Generated from protobuf field string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $log_name = ''; - /** - * Required. The monitored resource that produced this log entry. - * Example: a log entry that reports a database error would be associated with - * the monitored resource designating the particular database that reported - * the error. - * - * Generated from protobuf field .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $resource = null; - /** - * Optional. The time the event described by the log entry occurred. This time - * is used to compute the log entry's age and to enforce the logs retention - * period. If this field is omitted in a new log entry, then Logging assigns - * it the current time. Timestamps have nanosecond accuracy, but trailing - * zeros in the fractional seconds might be omitted when the timestamp is - * displayed. - * Incoming log entries must have timestamps that don't exceed the - * [logs retention - * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in - * the past, and that don't exceed 24 hours in the future. Log entries outside - * those time boundaries aren't ingested by Logging. - * - * Generated from protobuf field .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $timestamp = null; - /** - * Output only. The time the log entry was received by Logging. - * - * Generated from protobuf field .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $receive_timestamp = null; - /** - * Optional. The severity of the log entry. The default value is - * `LogSeverity.DEFAULT`. - * - * Generated from protobuf field .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $severity = 0; - /** - * Optional. A unique identifier for the log entry. If you provide a value, - * then Logging considers other log entries in the same project, with the same - * `timestamp`, and with the same `insert_id` to be duplicates which are - * removed in a single query result. However, there are no guarantees of - * de-duplication in the export of logs. - * If the `insert_id` is omitted when writing a log entry, the Logging API - * assigns its own unique identifier in this field. - * In queries, the `insert_id` is also used to order log entries that have - * the same `log_name` and `timestamp` values. - * - * Generated from protobuf field string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $insert_id = ''; - /** - * Optional. Information about the HTTP request associated with this log - * entry, if applicable. - * - * Generated from protobuf field .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $http_request = null; - /** - * Optional. A map of key, value pairs that provides additional information - * about the log entry. The labels can be user-defined or system-defined. - * User-defined labels are arbitrary key, value pairs that you can use to - * classify logs. - * System-defined labels are defined by GCP services for platform logs. - * They have two components - a service namespace component and the - * attribute name. For example: `compute.googleapis.com/resource_name`. - * Cloud Logging truncates label keys that exceed 512 B and label - * values that exceed 64 KB upon their associated log entry being - * written. The truncation is indicated by an ellipsis at the - * end of the character string. - * - * Generated from protobuf field map labels = 11 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - /** - * Optional. Information about an operation associated with the log entry, if - * applicable. - * - * Generated from protobuf field .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $operation = null; - /** - * Optional. The REST resource name of the trace being written to - * [Cloud Trace](https://cloud.google.com/trace) in - * association with this log entry. For example, if your trace data is stored - * in the Cloud project "my-trace-project" and if the service that is creating - * the log entry receives a trace header that includes the trace ID "12345", - * then the service should use "projects/my-tracing-project/traces/12345". - * The `trace` field provides the link between logs and traces. By using - * this field, you can navigate from a log entry to a trace. - * - * Generated from protobuf field string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $trace = ''; - /** - * Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span - * associated with the current operation in which the log is being written. - * For example, if a span has the REST resource name of - * "projects/some-project/traces/some-trace/spans/some-span-id", then the - * `span_id` field is "some-span-id". - * A - * [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span) - * represents a single operation within a trace. Whereas a trace may involve - * multiple different microservices running on multiple different machines, - * a span generally corresponds to a single logical operation being performed - * in a single instance of a microservice on one specific machine. Spans - * are the nodes within the tree that is a trace. - * Applications that are [instrumented for - * tracing](https://cloud.google.com/trace/docs/setup) will generally assign a - * new, unique span ID on each incoming request. It is also common to create - * and record additional spans corresponding to internal processing elements - * as well as issuing requests to dependencies. - * The span ID is expected to be a 16-character, hexadecimal encoding of an - * 8-byte array and should not be zero. It should be unique within the trace - * and should, ideally, be generated in a manner that is uniformly random. - * Example values: - * - `000000000000004a` - * - `7a2190356c3fc94b` - * - `0000f00300090021` - * - `d39223e101960076` - * - * Generated from protobuf field string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $span_id = ''; - /** - * Optional. The sampling decision of the trace associated with the log entry. - * True means that the trace resource name in the `trace` field was sampled - * for storage in a trace backend. False means that the trace was not sampled - * for storage when this log entry was written, or the sampling decision was - * unknown at the time. A non-sampled `trace` value is still useful as a - * request correlation identifier. The default is False. - * - * Generated from protobuf field bool trace_sampled = 30 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $trace_sampled = false; - /** - * Optional. Source code location information associated with the log entry, - * if any. - * - * Generated from protobuf field .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $source_location = null; - /** - * Optional. Information indicating this LogEntry is part of a sequence of - * multiple log entries split from a single LogEntry. - * - * Generated from protobuf field .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $split = null; - protected $payload; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $log_name - * Required. The resource name of the log to which this log entry belongs: - * "projects/[PROJECT_ID]/logs/[LOG_ID]" - * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - * "folders/[FOLDER_ID]/logs/[LOG_ID]" - * A project number may be used in place of PROJECT_ID. The project number is - * translated to its corresponding PROJECT_ID internally and the `log_name` - * field will contain PROJECT_ID in queries and exports. - * `[LOG_ID]` must be URL-encoded within `log_name`. Example: - * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. - * `[LOG_ID]` must be less than 512 characters long and can only include the - * following characters: upper and lower case alphanumeric characters, - * forward-slash, underscore, hyphen, and period. - * For backward compatibility, if `log_name` begins with a forward-slash, such - * as `/projects/...`, then the log entry is ingested as usual, but the - * forward-slash is removed. Listing the log entry will not show the leading - * slash and filtering for a log name with a leading slash will never return - * any results. - * @type \Google\Api\MonitoredResource $resource - * Required. The monitored resource that produced this log entry. - * Example: a log entry that reports a database error would be associated with - * the monitored resource designating the particular database that reported - * the error. - * @type \Google\Protobuf\Any $proto_payload - * The log entry payload, represented as a protocol buffer. Some Google - * Cloud Platform services use this field for their log entry payloads. - * The following protocol buffer types are supported; user-defined types - * are not supported: - * "type.googleapis.com/google.cloud.audit.AuditLog" - * "type.googleapis.com/google.appengine.logging.v1.RequestLog" - * @type string $text_payload - * The log entry payload, represented as a Unicode string (UTF-8). - * @type \Google\Protobuf\Struct $json_payload - * The log entry payload, represented as a structure that is - * expressed as a JSON object. - * @type \Google\Protobuf\Timestamp $timestamp - * Optional. The time the event described by the log entry occurred. This time - * is used to compute the log entry's age and to enforce the logs retention - * period. If this field is omitted in a new log entry, then Logging assigns - * it the current time. Timestamps have nanosecond accuracy, but trailing - * zeros in the fractional seconds might be omitted when the timestamp is - * displayed. - * Incoming log entries must have timestamps that don't exceed the - * [logs retention - * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in - * the past, and that don't exceed 24 hours in the future. Log entries outside - * those time boundaries aren't ingested by Logging. - * @type \Google\Protobuf\Timestamp $receive_timestamp - * Output only. The time the log entry was received by Logging. - * @type int $severity - * Optional. The severity of the log entry. The default value is - * `LogSeverity.DEFAULT`. - * @type string $insert_id - * Optional. A unique identifier for the log entry. If you provide a value, - * then Logging considers other log entries in the same project, with the same - * `timestamp`, and with the same `insert_id` to be duplicates which are - * removed in a single query result. However, there are no guarantees of - * de-duplication in the export of logs. - * If the `insert_id` is omitted when writing a log entry, the Logging API - * assigns its own unique identifier in this field. - * In queries, the `insert_id` is also used to order log entries that have - * the same `log_name` and `timestamp` values. - * @type \Google\Cloud\Logging\Type\HttpRequest $http_request - * Optional. Information about the HTTP request associated with this log - * entry, if applicable. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. A map of key, value pairs that provides additional information - * about the log entry. The labels can be user-defined or system-defined. - * User-defined labels are arbitrary key, value pairs that you can use to - * classify logs. - * System-defined labels are defined by GCP services for platform logs. - * They have two components - a service namespace component and the - * attribute name. For example: `compute.googleapis.com/resource_name`. - * Cloud Logging truncates label keys that exceed 512 B and label - * values that exceed 64 KB upon their associated log entry being - * written. The truncation is indicated by an ellipsis at the - * end of the character string. - * @type \Google\Cloud\Logging\V2\LogEntryOperation $operation - * Optional. Information about an operation associated with the log entry, if - * applicable. - * @type string $trace - * Optional. The REST resource name of the trace being written to - * [Cloud Trace](https://cloud.google.com/trace) in - * association with this log entry. For example, if your trace data is stored - * in the Cloud project "my-trace-project" and if the service that is creating - * the log entry receives a trace header that includes the trace ID "12345", - * then the service should use "projects/my-tracing-project/traces/12345". - * The `trace` field provides the link between logs and traces. By using - * this field, you can navigate from a log entry to a trace. - * @type string $span_id - * Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span - * associated with the current operation in which the log is being written. - * For example, if a span has the REST resource name of - * "projects/some-project/traces/some-trace/spans/some-span-id", then the - * `span_id` field is "some-span-id". - * A - * [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span) - * represents a single operation within a trace. Whereas a trace may involve - * multiple different microservices running on multiple different machines, - * a span generally corresponds to a single logical operation being performed - * in a single instance of a microservice on one specific machine. Spans - * are the nodes within the tree that is a trace. - * Applications that are [instrumented for - * tracing](https://cloud.google.com/trace/docs/setup) will generally assign a - * new, unique span ID on each incoming request. It is also common to create - * and record additional spans corresponding to internal processing elements - * as well as issuing requests to dependencies. - * The span ID is expected to be a 16-character, hexadecimal encoding of an - * 8-byte array and should not be zero. It should be unique within the trace - * and should, ideally, be generated in a manner that is uniformly random. - * Example values: - * - `000000000000004a` - * - `7a2190356c3fc94b` - * - `0000f00300090021` - * - `d39223e101960076` - * @type bool $trace_sampled - * Optional. The sampling decision of the trace associated with the log entry. - * True means that the trace resource name in the `trace` field was sampled - * for storage in a trace backend. False means that the trace was not sampled - * for storage when this log entry was written, or the sampling decision was - * unknown at the time. A non-sampled `trace` value is still useful as a - * request correlation identifier. The default is False. - * @type \Google\Cloud\Logging\V2\LogEntrySourceLocation $source_location - * Optional. Source code location information associated with the log entry, - * if any. - * @type \Google\Cloud\Logging\V2\LogSplit $split - * Optional. Information indicating this LogEntry is part of a sequence of - * multiple log entries split from a single LogEntry. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LogEntry::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the log to which this log entry belongs: - * "projects/[PROJECT_ID]/logs/[LOG_ID]" - * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - * "folders/[FOLDER_ID]/logs/[LOG_ID]" - * A project number may be used in place of PROJECT_ID. The project number is - * translated to its corresponding PROJECT_ID internally and the `log_name` - * field will contain PROJECT_ID in queries and exports. - * `[LOG_ID]` must be URL-encoded within `log_name`. Example: - * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. - * `[LOG_ID]` must be less than 512 characters long and can only include the - * following characters: upper and lower case alphanumeric characters, - * forward-slash, underscore, hyphen, and period. - * For backward compatibility, if `log_name` begins with a forward-slash, such - * as `/projects/...`, then the log entry is ingested as usual, but the - * forward-slash is removed. Listing the log entry will not show the leading - * slash and filtering for a log name with a leading slash will never return - * any results. - * - * Generated from protobuf field string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getLogName() - { - return $this->log_name; - } - - /** - * Required. The resource name of the log to which this log entry belongs: - * "projects/[PROJECT_ID]/logs/[LOG_ID]" - * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - * "folders/[FOLDER_ID]/logs/[LOG_ID]" - * A project number may be used in place of PROJECT_ID. The project number is - * translated to its corresponding PROJECT_ID internally and the `log_name` - * field will contain PROJECT_ID in queries and exports. - * `[LOG_ID]` must be URL-encoded within `log_name`. Example: - * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. - * `[LOG_ID]` must be less than 512 characters long and can only include the - * following characters: upper and lower case alphanumeric characters, - * forward-slash, underscore, hyphen, and period. - * For backward compatibility, if `log_name` begins with a forward-slash, such - * as `/projects/...`, then the log entry is ingested as usual, but the - * forward-slash is removed. Listing the log entry will not show the leading - * slash and filtering for a log name with a leading slash will never return - * any results. - * - * Generated from protobuf field string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setLogName($var) - { - GPBUtil::checkString($var, True); - $this->log_name = $var; - - return $this; - } - - /** - * Required. The monitored resource that produced this log entry. - * Example: a log entry that reports a database error would be associated with - * the monitored resource designating the particular database that reported - * the error. - * - * Generated from protobuf field .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Api\MonitoredResource|null - */ - public function getResource() - { - return $this->resource; - } - - public function hasResource() - { - return isset($this->resource); - } - - public function clearResource() - { - unset($this->resource); - } - - /** - * Required. The monitored resource that produced this log entry. - * Example: a log entry that reports a database error would be associated with - * the monitored resource designating the particular database that reported - * the error. - * - * Generated from protobuf field .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Api\MonitoredResource $var - * @return $this - */ - public function setResource($var) - { - GPBUtil::checkMessage($var, \Google\Api\MonitoredResource::class); - $this->resource = $var; - - return $this; - } - - /** - * The log entry payload, represented as a protocol buffer. Some Google - * Cloud Platform services use this field for their log entry payloads. - * The following protocol buffer types are supported; user-defined types - * are not supported: - * "type.googleapis.com/google.cloud.audit.AuditLog" - * "type.googleapis.com/google.appengine.logging.v1.RequestLog" - * - * Generated from protobuf field .google.protobuf.Any proto_payload = 2; - * @return \Google\Protobuf\Any|null - */ - public function getProtoPayload() - { - return $this->readOneof(2); - } - - public function hasProtoPayload() - { - return $this->hasOneof(2); - } - - /** - * The log entry payload, represented as a protocol buffer. Some Google - * Cloud Platform services use this field for their log entry payloads. - * The following protocol buffer types are supported; user-defined types - * are not supported: - * "type.googleapis.com/google.cloud.audit.AuditLog" - * "type.googleapis.com/google.appengine.logging.v1.RequestLog" - * - * Generated from protobuf field .google.protobuf.Any proto_payload = 2; - * @param \Google\Protobuf\Any $var - * @return $this - */ - public function setProtoPayload($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Any::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * The log entry payload, represented as a Unicode string (UTF-8). - * - * Generated from protobuf field string text_payload = 3; - * @return string - */ - public function getTextPayload() - { - return $this->readOneof(3); - } - - public function hasTextPayload() - { - return $this->hasOneof(3); - } - - /** - * The log entry payload, represented as a Unicode string (UTF-8). - * - * Generated from protobuf field string text_payload = 3; - * @param string $var - * @return $this - */ - public function setTextPayload($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * The log entry payload, represented as a structure that is - * expressed as a JSON object. - * - * Generated from protobuf field .google.protobuf.Struct json_payload = 6; - * @return \Google\Protobuf\Struct|null - */ - public function getJsonPayload() - { - return $this->readOneof(6); - } - - public function hasJsonPayload() - { - return $this->hasOneof(6); - } - - /** - * The log entry payload, represented as a structure that is - * expressed as a JSON object. - * - * Generated from protobuf field .google.protobuf.Struct json_payload = 6; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setJsonPayload($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * Optional. The time the event described by the log entry occurred. This time - * is used to compute the log entry's age and to enforce the logs retention - * period. If this field is omitted in a new log entry, then Logging assigns - * it the current time. Timestamps have nanosecond accuracy, but trailing - * zeros in the fractional seconds might be omitted when the timestamp is - * displayed. - * Incoming log entries must have timestamps that don't exceed the - * [logs retention - * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in - * the past, and that don't exceed 24 hours in the future. Log entries outside - * those time boundaries aren't ingested by Logging. - * - * Generated from protobuf field .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getTimestamp() - { - return $this->timestamp; - } - - public function hasTimestamp() - { - return isset($this->timestamp); - } - - public function clearTimestamp() - { - unset($this->timestamp); - } - - /** - * Optional. The time the event described by the log entry occurred. This time - * is used to compute the log entry's age and to enforce the logs retention - * period. If this field is omitted in a new log entry, then Logging assigns - * it the current time. Timestamps have nanosecond accuracy, but trailing - * zeros in the fractional seconds might be omitted when the timestamp is - * displayed. - * Incoming log entries must have timestamps that don't exceed the - * [logs retention - * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in - * the past, and that don't exceed 24 hours in the future. Log entries outside - * those time boundaries aren't ingested by Logging. - * - * Generated from protobuf field .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setTimestamp($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->timestamp = $var; - - return $this; - } - - /** - * Output only. The time the log entry was received by Logging. - * - * Generated from protobuf field .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReceiveTimestamp() - { - return $this->receive_timestamp; - } - - public function hasReceiveTimestamp() - { - return isset($this->receive_timestamp); - } - - public function clearReceiveTimestamp() - { - unset($this->receive_timestamp); - } - - /** - * Output only. The time the log entry was received by Logging. - * - * Generated from protobuf field .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReceiveTimestamp($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->receive_timestamp = $var; - - return $this; - } - - /** - * Optional. The severity of the log entry. The default value is - * `LogSeverity.DEFAULT`. - * - * Generated from protobuf field .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getSeverity() - { - return $this->severity; - } - - /** - * Optional. The severity of the log entry. The default value is - * `LogSeverity.DEFAULT`. - * - * Generated from protobuf field .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setSeverity($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Logging\Type\LogSeverity::class); - $this->severity = $var; - - return $this; - } - - /** - * Optional. A unique identifier for the log entry. If you provide a value, - * then Logging considers other log entries in the same project, with the same - * `timestamp`, and with the same `insert_id` to be duplicates which are - * removed in a single query result. However, there are no guarantees of - * de-duplication in the export of logs. - * If the `insert_id` is omitted when writing a log entry, the Logging API - * assigns its own unique identifier in this field. - * In queries, the `insert_id` is also used to order log entries that have - * the same `log_name` and `timestamp` values. - * - * Generated from protobuf field string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getInsertId() - { - return $this->insert_id; - } - - /** - * Optional. A unique identifier for the log entry. If you provide a value, - * then Logging considers other log entries in the same project, with the same - * `timestamp`, and with the same `insert_id` to be duplicates which are - * removed in a single query result. However, there are no guarantees of - * de-duplication in the export of logs. - * If the `insert_id` is omitted when writing a log entry, the Logging API - * assigns its own unique identifier in this field. - * In queries, the `insert_id` is also used to order log entries that have - * the same `log_name` and `timestamp` values. - * - * Generated from protobuf field string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setInsertId($var) - { - GPBUtil::checkString($var, True); - $this->insert_id = $var; - - return $this; - } - - /** - * Optional. Information about the HTTP request associated with this log - * entry, if applicable. - * - * Generated from protobuf field .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Logging\Type\HttpRequest|null - */ - public function getHttpRequest() - { - return $this->http_request; - } - - public function hasHttpRequest() - { - return isset($this->http_request); - } - - public function clearHttpRequest() - { - unset($this->http_request); - } - - /** - * Optional. Information about the HTTP request associated with this log - * entry, if applicable. - * - * Generated from protobuf field .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Logging\Type\HttpRequest $var - * @return $this - */ - public function setHttpRequest($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Logging\Type\HttpRequest::class); - $this->http_request = $var; - - return $this; - } - - /** - * Optional. A map of key, value pairs that provides additional information - * about the log entry. The labels can be user-defined or system-defined. - * User-defined labels are arbitrary key, value pairs that you can use to - * classify logs. - * System-defined labels are defined by GCP services for platform logs. - * They have two components - a service namespace component and the - * attribute name. For example: `compute.googleapis.com/resource_name`. - * Cloud Logging truncates label keys that exceed 512 B and label - * values that exceed 64 KB upon their associated log entry being - * written. The truncation is indicated by an ellipsis at the - * end of the character string. - * - * Generated from protobuf field map labels = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. A map of key, value pairs that provides additional information - * about the log entry. The labels can be user-defined or system-defined. - * User-defined labels are arbitrary key, value pairs that you can use to - * classify logs. - * System-defined labels are defined by GCP services for platform logs. - * They have two components - a service namespace component and the - * attribute name. For example: `compute.googleapis.com/resource_name`. - * Cloud Logging truncates label keys that exceed 512 B and label - * values that exceed 64 KB upon their associated log entry being - * written. The truncation is indicated by an ellipsis at the - * end of the character string. - * - * Generated from protobuf field map labels = 11 [(.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. Information about an operation associated with the log entry, if - * applicable. - * - * Generated from protobuf field .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Logging\V2\LogEntryOperation|null - */ - public function getOperation() - { - return $this->operation; - } - - public function hasOperation() - { - return isset($this->operation); - } - - public function clearOperation() - { - unset($this->operation); - } - - /** - * Optional. Information about an operation associated with the log entry, if - * applicable. - * - * Generated from protobuf field .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Logging\V2\LogEntryOperation $var - * @return $this - */ - public function setOperation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogEntryOperation::class); - $this->operation = $var; - - return $this; - } - - /** - * Optional. The REST resource name of the trace being written to - * [Cloud Trace](https://cloud.google.com/trace) in - * association with this log entry. For example, if your trace data is stored - * in the Cloud project "my-trace-project" and if the service that is creating - * the log entry receives a trace header that includes the trace ID "12345", - * then the service should use "projects/my-tracing-project/traces/12345". - * The `trace` field provides the link between logs and traces. By using - * this field, you can navigate from a log entry to a trace. - * - * Generated from protobuf field string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getTrace() - { - return $this->trace; - } - - /** - * Optional. The REST resource name of the trace being written to - * [Cloud Trace](https://cloud.google.com/trace) in - * association with this log entry. For example, if your trace data is stored - * in the Cloud project "my-trace-project" and if the service that is creating - * the log entry receives a trace header that includes the trace ID "12345", - * then the service should use "projects/my-tracing-project/traces/12345". - * The `trace` field provides the link between logs and traces. By using - * this field, you can navigate from a log entry to a trace. - * - * Generated from protobuf field string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setTrace($var) - { - GPBUtil::checkString($var, True); - $this->trace = $var; - - return $this; - } - - /** - * Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span - * associated with the current operation in which the log is being written. - * For example, if a span has the REST resource name of - * "projects/some-project/traces/some-trace/spans/some-span-id", then the - * `span_id` field is "some-span-id". - * A - * [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span) - * represents a single operation within a trace. Whereas a trace may involve - * multiple different microservices running on multiple different machines, - * a span generally corresponds to a single logical operation being performed - * in a single instance of a microservice on one specific machine. Spans - * are the nodes within the tree that is a trace. - * Applications that are [instrumented for - * tracing](https://cloud.google.com/trace/docs/setup) will generally assign a - * new, unique span ID on each incoming request. It is also common to create - * and record additional spans corresponding to internal processing elements - * as well as issuing requests to dependencies. - * The span ID is expected to be a 16-character, hexadecimal encoding of an - * 8-byte array and should not be zero. It should be unique within the trace - * and should, ideally, be generated in a manner that is uniformly random. - * Example values: - * - `000000000000004a` - * - `7a2190356c3fc94b` - * - `0000f00300090021` - * - `d39223e101960076` - * - * Generated from protobuf field string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getSpanId() - { - return $this->span_id; - } - - /** - * Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span - * associated with the current operation in which the log is being written. - * For example, if a span has the REST resource name of - * "projects/some-project/traces/some-trace/spans/some-span-id", then the - * `span_id` field is "some-span-id". - * A - * [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span) - * represents a single operation within a trace. Whereas a trace may involve - * multiple different microservices running on multiple different machines, - * a span generally corresponds to a single logical operation being performed - * in a single instance of a microservice on one specific machine. Spans - * are the nodes within the tree that is a trace. - * Applications that are [instrumented for - * tracing](https://cloud.google.com/trace/docs/setup) will generally assign a - * new, unique span ID on each incoming request. It is also common to create - * and record additional spans corresponding to internal processing elements - * as well as issuing requests to dependencies. - * The span ID is expected to be a 16-character, hexadecimal encoding of an - * 8-byte array and should not be zero. It should be unique within the trace - * and should, ideally, be generated in a manner that is uniformly random. - * Example values: - * - `000000000000004a` - * - `7a2190356c3fc94b` - * - `0000f00300090021` - * - `d39223e101960076` - * - * Generated from protobuf field string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setSpanId($var) - { - GPBUtil::checkString($var, True); - $this->span_id = $var; - - return $this; - } - - /** - * Optional. The sampling decision of the trace associated with the log entry. - * True means that the trace resource name in the `trace` field was sampled - * for storage in a trace backend. False means that the trace was not sampled - * for storage when this log entry was written, or the sampling decision was - * unknown at the time. A non-sampled `trace` value is still useful as a - * request correlation identifier. The default is False. - * - * Generated from protobuf field bool trace_sampled = 30 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getTraceSampled() - { - return $this->trace_sampled; - } - - /** - * Optional. The sampling decision of the trace associated with the log entry. - * True means that the trace resource name in the `trace` field was sampled - * for storage in a trace backend. False means that the trace was not sampled - * for storage when this log entry was written, or the sampling decision was - * unknown at the time. A non-sampled `trace` value is still useful as a - * request correlation identifier. The default is False. - * - * Generated from protobuf field bool trace_sampled = 30 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setTraceSampled($var) - { - GPBUtil::checkBool($var); - $this->trace_sampled = $var; - - return $this; - } - - /** - * Optional. Source code location information associated with the log entry, - * if any. - * - * Generated from protobuf field .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Logging\V2\LogEntrySourceLocation|null - */ - public function getSourceLocation() - { - return $this->source_location; - } - - public function hasSourceLocation() - { - return isset($this->source_location); - } - - public function clearSourceLocation() - { - unset($this->source_location); - } - - /** - * Optional. Source code location information associated with the log entry, - * if any. - * - * Generated from protobuf field .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Logging\V2\LogEntrySourceLocation $var - * @return $this - */ - public function setSourceLocation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogEntrySourceLocation::class); - $this->source_location = $var; - - return $this; - } - - /** - * Optional. Information indicating this LogEntry is part of a sequence of - * multiple log entries split from a single LogEntry. - * - * Generated from protobuf field .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Logging\V2\LogSplit|null - */ - public function getSplit() - { - return $this->split; - } - - public function hasSplit() - { - return isset($this->split); - } - - public function clearSplit() - { - unset($this->split); - } - - /** - * Optional. Information indicating this LogEntry is part of a sequence of - * multiple log entries split from a single LogEntry. - * - * Generated from protobuf field .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Logging\V2\LogSplit $var - * @return $this - */ - public function setSplit($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogSplit::class); - $this->split = $var; - - return $this; - } - - /** - * @return string - */ - public function getPayload() - { - return $this->whichOneof("payload"); - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntryOperation.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntryOperation.php deleted file mode 100644 index 81a4bf2d70ae..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntryOperation.php +++ /dev/null @@ -1,182 +0,0 @@ -google.logging.v2.LogEntryOperation - */ -class LogEntryOperation extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. An arbitrary operation identifier. Log entries with the same - * identifier are assumed to be part of the same operation. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $id = ''; - /** - * Optional. An arbitrary producer identifier. The combination of `id` and - * `producer` must be globally unique. Examples for `producer`: - * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. - * - * Generated from protobuf field string producer = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $producer = ''; - /** - * Optional. Set this to True if this is the first log entry in the operation. - * - * Generated from protobuf field bool first = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $first = false; - /** - * Optional. Set this to True if this is the last log entry in the operation. - * - * Generated from protobuf field bool last = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $last = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $id - * Optional. An arbitrary operation identifier. Log entries with the same - * identifier are assumed to be part of the same operation. - * @type string $producer - * Optional. An arbitrary producer identifier. The combination of `id` and - * `producer` must be globally unique. Examples for `producer`: - * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. - * @type bool $first - * Optional. Set this to True if this is the first log entry in the operation. - * @type bool $last - * Optional. Set this to True if this is the last log entry in the operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LogEntry::initOnce(); - parent::__construct($data); - } - - /** - * Optional. An arbitrary operation identifier. Log entries with the same - * identifier are assumed to be part of the same operation. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Optional. An arbitrary operation identifier. Log entries with the same - * identifier are assumed to be part of the same operation. - * - * 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; - } - - /** - * Optional. An arbitrary producer identifier. The combination of `id` and - * `producer` must be globally unique. Examples for `producer`: - * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. - * - * Generated from protobuf field string producer = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getProducer() - { - return $this->producer; - } - - /** - * Optional. An arbitrary producer identifier. The combination of `id` and - * `producer` must be globally unique. Examples for `producer`: - * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. - * - * Generated from protobuf field string producer = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setProducer($var) - { - GPBUtil::checkString($var, True); - $this->producer = $var; - - return $this; - } - - /** - * Optional. Set this to True if this is the first log entry in the operation. - * - * Generated from protobuf field bool first = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getFirst() - { - return $this->first; - } - - /** - * Optional. Set this to True if this is the first log entry in the operation. - * - * Generated from protobuf field bool first = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setFirst($var) - { - GPBUtil::checkBool($var); - $this->first = $var; - - return $this; - } - - /** - * Optional. Set this to True if this is the last log entry in the operation. - * - * Generated from protobuf field bool last = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getLast() - { - return $this->last; - } - - /** - * Optional. Set this to True if this is the last log entry in the operation. - * - * Generated from protobuf field bool last = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setLast($var) - { - GPBUtil::checkBool($var); - $this->last = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntrySourceLocation.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntrySourceLocation.php deleted file mode 100644 index 47279739bd52..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogEntrySourceLocation.php +++ /dev/null @@ -1,164 +0,0 @@ -google.logging.v2.LogEntrySourceLocation - */ -class LogEntrySourceLocation extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Source file name. Depending on the runtime environment, this - * might be a simple name or a fully-qualified name. - * - * Generated from protobuf field string file = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $file = ''; - /** - * Optional. Line within the source file. 1-based; 0 indicates no line number - * available. - * - * Generated from protobuf field int64 line = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $line = 0; - /** - * Optional. Human-readable name of the function or method being invoked, with - * optional context such as the class or package name. This information may be - * used in contexts such as the logs viewer, where a file and line number are - * less meaningful. The format can vary by language. For example: - * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` - * (Python). - * - * Generated from protobuf field string function = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $function = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $file - * Optional. Source file name. Depending on the runtime environment, this - * might be a simple name or a fully-qualified name. - * @type int|string $line - * Optional. Line within the source file. 1-based; 0 indicates no line number - * available. - * @type string $function - * Optional. Human-readable name of the function or method being invoked, with - * optional context such as the class or package name. This information may be - * used in contexts such as the logs viewer, where a file and line number are - * less meaningful. The format can vary by language. For example: - * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` - * (Python). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LogEntry::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Source file name. Depending on the runtime environment, this - * might be a simple name or a fully-qualified name. - * - * Generated from protobuf field string file = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFile() - { - return $this->file; - } - - /** - * Optional. Source file name. Depending on the runtime environment, this - * might be a simple name or a fully-qualified name. - * - * Generated from protobuf field string file = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFile($var) - { - GPBUtil::checkString($var, True); - $this->file = $var; - - return $this; - } - - /** - * Optional. Line within the source file. 1-based; 0 indicates no line number - * available. - * - * Generated from protobuf field int64 line = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string - */ - public function getLine() - { - return $this->line; - } - - /** - * Optional. Line within the source file. 1-based; 0 indicates no line number - * available. - * - * Generated from protobuf field int64 line = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string $var - * @return $this - */ - public function setLine($var) - { - GPBUtil::checkInt64($var); - $this->line = $var; - - return $this; - } - - /** - * Optional. Human-readable name of the function or method being invoked, with - * optional context such as the class or package name. This information may be - * used in contexts such as the logs viewer, where a file and line number are - * less meaningful. The format can vary by language. For example: - * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` - * (Python). - * - * Generated from protobuf field string function = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFunction() - { - return $this->function; - } - - /** - * Optional. Human-readable name of the function or method being invoked, with - * optional context such as the class or package name. This information may be - * used in contexts such as the logs viewer, where a file and line number are - * less meaningful. The format can vary by language. For example: - * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` - * (Python). - * - * Generated from protobuf field string function = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFunction($var) - { - GPBUtil::checkString($var, True); - $this->function = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogExclusion.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogExclusion.php deleted file mode 100644 index bc3c81c62318..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogExclusion.php +++ /dev/null @@ -1,321 +0,0 @@ -google.logging.v2.LogExclusion - */ -class LogExclusion extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A client-assigned identifier, such as - * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and - * can include only letters, digits, underscores, hyphens, and periods. First - * character has to be alphanumeric. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Optional. A description of this exclusion. - * - * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $description = ''; - /** - * Required. An [advanced logs - * filter](https://cloud.google.com/logging/docs/view/advanced-queries) that - * matches the log entries to be excluded. By using the [sample - * function](https://cloud.google.com/logging/docs/view/advanced-queries#sample), - * you can exclude less than 100% of the matching log entries. - * For example, the following query matches 99% of low-severity log entries - * from Google Cloud Storage buckets: - * `resource.type=gcs_bucket severitystring filter = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $filter = ''; - /** - * Optional. If set to True, then this exclusion is disabled and it does not - * exclude any log entries. You can [update an - * exclusion][google.logging.v2.ConfigServiceV2.UpdateExclusion] to change the - * value of this field. - * - * Generated from protobuf field bool disabled = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $disabled = false; - /** - * Output only. The creation timestamp of the exclusion. - * This field may not be present for older exclusions. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The last update timestamp of the exclusion. - * This field may not be present for older exclusions. - * - * 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 - * Required. A client-assigned identifier, such as - * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and - * can include only letters, digits, underscores, hyphens, and periods. First - * character has to be alphanumeric. - * @type string $description - * Optional. A description of this exclusion. - * @type string $filter - * Required. An [advanced logs - * filter](https://cloud.google.com/logging/docs/view/advanced-queries) that - * matches the log entries to be excluded. By using the [sample - * function](https://cloud.google.com/logging/docs/view/advanced-queries#sample), - * you can exclude less than 100% of the matching log entries. - * For example, the following query matches 99% of low-severity log entries - * from Google Cloud Storage buckets: - * `resource.type=gcs_bucket severitystring name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. A client-assigned identifier, such as - * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and - * can include only letters, digits, underscores, hyphens, and periods. First - * character has to be alphanumeric. - * - * 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. A description of this exclusion. - * - * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Optional. A description of this exclusion. - * - * 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; - } - - /** - * Required. An [advanced logs - * filter](https://cloud.google.com/logging/docs/view/advanced-queries) that - * matches the log entries to be excluded. By using the [sample - * function](https://cloud.google.com/logging/docs/view/advanced-queries#sample), - * you can exclude less than 100% of the matching log entries. - * For example, the following query matches 99% of low-severity log entries - * from Google Cloud Storage buckets: - * `resource.type=gcs_bucket severitystring filter = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Required. An [advanced logs - * filter](https://cloud.google.com/logging/docs/view/advanced-queries) that - * matches the log entries to be excluded. By using the [sample - * function](https://cloud.google.com/logging/docs/view/advanced-queries#sample), - * you can exclude less than 100% of the matching log entries. - * For example, the following query matches 99% of low-severity log entries - * from Google Cloud Storage buckets: - * `resource.type=gcs_bucket severitystring filter = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. If set to True, then this exclusion is disabled and it does not - * exclude any log entries. You can [update an - * exclusion][google.logging.v2.ConfigServiceV2.UpdateExclusion] to change the - * value of this field. - * - * Generated from protobuf field bool disabled = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getDisabled() - { - return $this->disabled; - } - - /** - * Optional. If set to True, then this exclusion is disabled and it does not - * exclude any log entries. You can [update an - * exclusion][google.logging.v2.ConfigServiceV2.UpdateExclusion] to change the - * value of this field. - * - * Generated from protobuf field bool disabled = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setDisabled($var) - { - GPBUtil::checkBool($var); - $this->disabled = $var; - - return $this; - } - - /** - * Output only. The creation timestamp of the exclusion. - * This field may not be present for older exclusions. - * - * 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 creation timestamp of the exclusion. - * This field may not be present for older exclusions. - * - * 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 last update timestamp of the exclusion. - * This field may not be present for older exclusions. - * - * 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 last update timestamp of the exclusion. - * This field may not be present for older exclusions. - * - * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric.php deleted file mode 100644 index b542f6adc62e..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric.php +++ /dev/null @@ -1,767 +0,0 @@ -google.logging.v2.LogMetric - */ -class LogMetric extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The client-assigned metric identifier. - * Examples: `"error_count"`, `"nginx/requests"`. - * Metric identifiers are limited to 100 characters and can include only the - * following characters: `A-Z`, `a-z`, `0-9`, and the special characters - * `_-.,+!*',()%/`. The forward-slash character (`/`) denotes a hierarchy of - * name pieces, and it cannot be the first character of the name. - * This field is the `[METRIC_ID]` part of a metric resource name in the - * format "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Example: If the - * resource name of a metric is - * `"projects/my-project/metrics/nginx%2Frequests"`, this field's value is - * `"nginx/requests"`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Optional. A description of this metric, which is used in documentation. - * The maximum length of the description is 8000 characters. - * - * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $description = ''; - /** - * Required. An [advanced logs - * filter](https://cloud.google.com/logging/docs/view/advanced_filters) which - * is used to match log entries. Example: - * "resource.type=gae_app AND severity>=ERROR" - * The maximum length of the filter is 20000 characters. - * - * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $filter = ''; - /** - * Optional. The resource name of the Log Bucket that owns the Log Metric. - * Only Log Buckets in projects are supported. The bucket has to be in the - * same project as the metric. - * For example: - * `projects/my-project/locations/global/buckets/my-bucket` - * If empty, then the Log Metric is considered a non-Bucket Log Metric. - * - * Generated from protobuf field string bucket_name = 13 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $bucket_name = ''; - /** - * Optional. If set to True, then this metric is disabled and it does not - * generate any points. - * - * Generated from protobuf field bool disabled = 12 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $disabled = false; - /** - * Optional. The metric descriptor associated with the logs-based metric. - * If unspecified, it uses a default metric descriptor with a DELTA metric - * kind, INT64 value type, with no labels and a unit of "1". Such a metric - * counts the number of log entries matching the `filter` expression. - * The `name`, `type`, and `description` fields in the `metric_descriptor` - * are output only, and is constructed using the `name` and `description` - * field in the LogMetric. - * To create a logs-based metric that records a distribution of log values, a - * DELTA metric kind with a DISTRIBUTION value type must be used along with - * a `value_extractor` expression in the LogMetric. - * Each label in the metric descriptor must have a matching label - * name as the key and an extractor expression as the value in the - * `label_extractors` map. - * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot - * be updated once initially configured. New labels can be added in the - * `metric_descriptor`, but existing labels cannot be modified except for - * their description. - * - * Generated from protobuf field .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $metric_descriptor = null; - /** - * Optional. A `value_extractor` is required when using a distribution - * logs-based metric to extract the values to record from a log entry. - * Two functions are supported for value extraction: `EXTRACT(field)` or - * `REGEXP_EXTRACT(field, regex)`. The arguments are: - * 1. field: The name of the log entry field from which the value is to be - * extracted. - * 2. regex: A regular expression using the Google RE2 syntax - * (https://github.com/google/re2/wiki/Syntax) with a single capture - * group to extract data from the specified log entry field. The value - * of the field is converted to a string before applying the regex. - * It is an error to specify a regex that does not include exactly one - * capture group. - * The result of the extraction must be convertible to a double type, as the - * distribution always records double values. If either the extraction or - * the conversion to double fails, then those values are not recorded in the - * distribution. - * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` - * - * Generated from protobuf field string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $value_extractor = ''; - /** - * Optional. A map from a label key string to an extractor expression which is - * used to extract data from a log entry field and assign as the label value. - * Each label key specified in the LabelDescriptor must have an associated - * extractor expression in this map. The syntax of the extractor expression - * is the same as for the `value_extractor` field. - * The extracted value is converted to the type defined in the label - * descriptor. If either the extraction or the type conversion fails, - * the label will have a default value. The default value for a string - * label is an empty string, for an integer label its 0, and for a boolean - * label its `false`. - * Note that there are upper bounds on the maximum number of labels and the - * number of active time series that are allowed in a project. - * - * Generated from protobuf field map label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $label_extractors; - /** - * Optional. The `bucket_options` are required when the logs-based metric is - * using a DISTRIBUTION value type and it describes the bucket boundaries - * used to create a histogram of the extracted values. - * - * Generated from protobuf field .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $bucket_options = null; - /** - * Output only. The creation timestamp of the metric. - * This field may not be present for older metrics. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The last update timestamp of the metric. - * This field may not be present for older metrics. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Deprecated. The API version that created or updated this metric. - * The v2 format is used by default and cannot be changed. - * - * Generated from protobuf field .google.logging.v2.LogMetric.ApiVersion version = 4 [deprecated = true]; - * @deprecated - */ - protected $version = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The client-assigned metric identifier. - * Examples: `"error_count"`, `"nginx/requests"`. - * Metric identifiers are limited to 100 characters and can include only the - * following characters: `A-Z`, `a-z`, `0-9`, and the special characters - * `_-.,+!*',()%/`. The forward-slash character (`/`) denotes a hierarchy of - * name pieces, and it cannot be the first character of the name. - * This field is the `[METRIC_ID]` part of a metric resource name in the - * format "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Example: If the - * resource name of a metric is - * `"projects/my-project/metrics/nginx%2Frequests"`, this field's value is - * `"nginx/requests"`. - * @type string $description - * Optional. A description of this metric, which is used in documentation. - * The maximum length of the description is 8000 characters. - * @type string $filter - * Required. An [advanced logs - * filter](https://cloud.google.com/logging/docs/view/advanced_filters) which - * is used to match log entries. Example: - * "resource.type=gae_app AND severity>=ERROR" - * The maximum length of the filter is 20000 characters. - * @type string $bucket_name - * Optional. The resource name of the Log Bucket that owns the Log Metric. - * Only Log Buckets in projects are supported. The bucket has to be in the - * same project as the metric. - * For example: - * `projects/my-project/locations/global/buckets/my-bucket` - * If empty, then the Log Metric is considered a non-Bucket Log Metric. - * @type bool $disabled - * Optional. If set to True, then this metric is disabled and it does not - * generate any points. - * @type \Google\Api\MetricDescriptor $metric_descriptor - * Optional. The metric descriptor associated with the logs-based metric. - * If unspecified, it uses a default metric descriptor with a DELTA metric - * kind, INT64 value type, with no labels and a unit of "1". Such a metric - * counts the number of log entries matching the `filter` expression. - * The `name`, `type`, and `description` fields in the `metric_descriptor` - * are output only, and is constructed using the `name` and `description` - * field in the LogMetric. - * To create a logs-based metric that records a distribution of log values, a - * DELTA metric kind with a DISTRIBUTION value type must be used along with - * a `value_extractor` expression in the LogMetric. - * Each label in the metric descriptor must have a matching label - * name as the key and an extractor expression as the value in the - * `label_extractors` map. - * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot - * be updated once initially configured. New labels can be added in the - * `metric_descriptor`, but existing labels cannot be modified except for - * their description. - * @type string $value_extractor - * Optional. A `value_extractor` is required when using a distribution - * logs-based metric to extract the values to record from a log entry. - * Two functions are supported for value extraction: `EXTRACT(field)` or - * `REGEXP_EXTRACT(field, regex)`. The arguments are: - * 1. field: The name of the log entry field from which the value is to be - * extracted. - * 2. regex: A regular expression using the Google RE2 syntax - * (https://github.com/google/re2/wiki/Syntax) with a single capture - * group to extract data from the specified log entry field. The value - * of the field is converted to a string before applying the regex. - * It is an error to specify a regex that does not include exactly one - * capture group. - * The result of the extraction must be convertible to a double type, as the - * distribution always records double values. If either the extraction or - * the conversion to double fails, then those values are not recorded in the - * distribution. - * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` - * @type array|\Google\Protobuf\Internal\MapField $label_extractors - * Optional. A map from a label key string to an extractor expression which is - * used to extract data from a log entry field and assign as the label value. - * Each label key specified in the LabelDescriptor must have an associated - * extractor expression in this map. The syntax of the extractor expression - * is the same as for the `value_extractor` field. - * The extracted value is converted to the type defined in the label - * descriptor. If either the extraction or the type conversion fails, - * the label will have a default value. The default value for a string - * label is an empty string, for an integer label its 0, and for a boolean - * label its `false`. - * Note that there are upper bounds on the maximum number of labels and the - * number of active time series that are allowed in a project. - * @type \Google\Api\Distribution\BucketOptions $bucket_options - * Optional. The `bucket_options` are required when the logs-based metric is - * using a DISTRIBUTION value type and it describes the bucket boundaries - * used to create a histogram of the extracted values. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The creation timestamp of the metric. - * This field may not be present for older metrics. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The last update timestamp of the metric. - * This field may not be present for older metrics. - * @type int $version - * Deprecated. The API version that created or updated this metric. - * The v2 format is used by default and cannot be changed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingMetrics::initOnce(); - parent::__construct($data); - } - - /** - * Required. The client-assigned metric identifier. - * Examples: `"error_count"`, `"nginx/requests"`. - * Metric identifiers are limited to 100 characters and can include only the - * following characters: `A-Z`, `a-z`, `0-9`, and the special characters - * `_-.,+!*',()%/`. The forward-slash character (`/`) denotes a hierarchy of - * name pieces, and it cannot be the first character of the name. - * This field is the `[METRIC_ID]` part of a metric resource name in the - * format "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Example: If the - * resource name of a metric is - * `"projects/my-project/metrics/nginx%2Frequests"`, this field's value is - * `"nginx/requests"`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The client-assigned metric identifier. - * Examples: `"error_count"`, `"nginx/requests"`. - * Metric identifiers are limited to 100 characters and can include only the - * following characters: `A-Z`, `a-z`, `0-9`, and the special characters - * `_-.,+!*',()%/`. The forward-slash character (`/`) denotes a hierarchy of - * name pieces, and it cannot be the first character of the name. - * This field is the `[METRIC_ID]` part of a metric resource name in the - * format "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Example: If the - * resource name of a metric is - * `"projects/my-project/metrics/nginx%2Frequests"`, this field's value is - * `"nginx/requests"`. - * - * 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. A description of this metric, which is used in documentation. - * The maximum length of the description is 8000 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 this metric, which is used in documentation. - * The maximum length of the description is 8000 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; - } - - /** - * Required. An [advanced logs - * filter](https://cloud.google.com/logging/docs/view/advanced_filters) which - * is used to match log entries. Example: - * "resource.type=gae_app AND severity>=ERROR" - * The maximum length of the filter is 20000 characters. - * - * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Required. An [advanced logs - * filter](https://cloud.google.com/logging/docs/view/advanced_filters) which - * is used to match log entries. Example: - * "resource.type=gae_app AND severity>=ERROR" - * The maximum length of the filter is 20000 characters. - * - * Generated from protobuf field string filter = 3 [(.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 resource name of the Log Bucket that owns the Log Metric. - * Only Log Buckets in projects are supported. The bucket has to be in the - * same project as the metric. - * For example: - * `projects/my-project/locations/global/buckets/my-bucket` - * If empty, then the Log Metric is considered a non-Bucket Log Metric. - * - * Generated from protobuf field string bucket_name = 13 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getBucketName() - { - return $this->bucket_name; - } - - /** - * Optional. The resource name of the Log Bucket that owns the Log Metric. - * Only Log Buckets in projects are supported. The bucket has to be in the - * same project as the metric. - * For example: - * `projects/my-project/locations/global/buckets/my-bucket` - * If empty, then the Log Metric is considered a non-Bucket Log Metric. - * - * Generated from protobuf field string bucket_name = 13 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setBucketName($var) - { - GPBUtil::checkString($var, True); - $this->bucket_name = $var; - - return $this; - } - - /** - * Optional. If set to True, then this metric is disabled and it does not - * generate any points. - * - * Generated from protobuf field bool disabled = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getDisabled() - { - return $this->disabled; - } - - /** - * Optional. If set to True, then this metric is disabled and it does not - * generate any points. - * - * Generated from protobuf field bool disabled = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setDisabled($var) - { - GPBUtil::checkBool($var); - $this->disabled = $var; - - return $this; - } - - /** - * Optional. The metric descriptor associated with the logs-based metric. - * If unspecified, it uses a default metric descriptor with a DELTA metric - * kind, INT64 value type, with no labels and a unit of "1". Such a metric - * counts the number of log entries matching the `filter` expression. - * The `name`, `type`, and `description` fields in the `metric_descriptor` - * are output only, and is constructed using the `name` and `description` - * field in the LogMetric. - * To create a logs-based metric that records a distribution of log values, a - * DELTA metric kind with a DISTRIBUTION value type must be used along with - * a `value_extractor` expression in the LogMetric. - * Each label in the metric descriptor must have a matching label - * name as the key and an extractor expression as the value in the - * `label_extractors` map. - * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot - * be updated once initially configured. New labels can be added in the - * `metric_descriptor`, but existing labels cannot be modified except for - * their description. - * - * Generated from protobuf field .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Api\MetricDescriptor|null - */ - public function getMetricDescriptor() - { - return $this->metric_descriptor; - } - - public function hasMetricDescriptor() - { - return isset($this->metric_descriptor); - } - - public function clearMetricDescriptor() - { - unset($this->metric_descriptor); - } - - /** - * Optional. The metric descriptor associated with the logs-based metric. - * If unspecified, it uses a default metric descriptor with a DELTA metric - * kind, INT64 value type, with no labels and a unit of "1". Such a metric - * counts the number of log entries matching the `filter` expression. - * The `name`, `type`, and `description` fields in the `metric_descriptor` - * are output only, and is constructed using the `name` and `description` - * field in the LogMetric. - * To create a logs-based metric that records a distribution of log values, a - * DELTA metric kind with a DISTRIBUTION value type must be used along with - * a `value_extractor` expression in the LogMetric. - * Each label in the metric descriptor must have a matching label - * name as the key and an extractor expression as the value in the - * `label_extractors` map. - * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot - * be updated once initially configured. New labels can be added in the - * `metric_descriptor`, but existing labels cannot be modified except for - * their description. - * - * Generated from protobuf field .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Api\MetricDescriptor $var - * @return $this - */ - public function setMetricDescriptor($var) - { - GPBUtil::checkMessage($var, \Google\Api\MetricDescriptor::class); - $this->metric_descriptor = $var; - - return $this; - } - - /** - * Optional. A `value_extractor` is required when using a distribution - * logs-based metric to extract the values to record from a log entry. - * Two functions are supported for value extraction: `EXTRACT(field)` or - * `REGEXP_EXTRACT(field, regex)`. The arguments are: - * 1. field: The name of the log entry field from which the value is to be - * extracted. - * 2. regex: A regular expression using the Google RE2 syntax - * (https://github.com/google/re2/wiki/Syntax) with a single capture - * group to extract data from the specified log entry field. The value - * of the field is converted to a string before applying the regex. - * It is an error to specify a regex that does not include exactly one - * capture group. - * The result of the extraction must be convertible to a double type, as the - * distribution always records double values. If either the extraction or - * the conversion to double fails, then those values are not recorded in the - * distribution. - * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` - * - * Generated from protobuf field string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getValueExtractor() - { - return $this->value_extractor; - } - - /** - * Optional. A `value_extractor` is required when using a distribution - * logs-based metric to extract the values to record from a log entry. - * Two functions are supported for value extraction: `EXTRACT(field)` or - * `REGEXP_EXTRACT(field, regex)`. The arguments are: - * 1. field: The name of the log entry field from which the value is to be - * extracted. - * 2. regex: A regular expression using the Google RE2 syntax - * (https://github.com/google/re2/wiki/Syntax) with a single capture - * group to extract data from the specified log entry field. The value - * of the field is converted to a string before applying the regex. - * It is an error to specify a regex that does not include exactly one - * capture group. - * The result of the extraction must be convertible to a double type, as the - * distribution always records double values. If either the extraction or - * the conversion to double fails, then those values are not recorded in the - * distribution. - * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` - * - * Generated from protobuf field string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setValueExtractor($var) - { - GPBUtil::checkString($var, True); - $this->value_extractor = $var; - - return $this; - } - - /** - * Optional. A map from a label key string to an extractor expression which is - * used to extract data from a log entry field and assign as the label value. - * Each label key specified in the LabelDescriptor must have an associated - * extractor expression in this map. The syntax of the extractor expression - * is the same as for the `value_extractor` field. - * The extracted value is converted to the type defined in the label - * descriptor. If either the extraction or the type conversion fails, - * the label will have a default value. The default value for a string - * label is an empty string, for an integer label its 0, and for a boolean - * label its `false`. - * Note that there are upper bounds on the maximum number of labels and the - * number of active time series that are allowed in a project. - * - * Generated from protobuf field map label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabelExtractors() - { - return $this->label_extractors; - } - - /** - * Optional. A map from a label key string to an extractor expression which is - * used to extract data from a log entry field and assign as the label value. - * Each label key specified in the LabelDescriptor must have an associated - * extractor expression in this map. The syntax of the extractor expression - * is the same as for the `value_extractor` field. - * The extracted value is converted to the type defined in the label - * descriptor. If either the extraction or the type conversion fails, - * the label will have a default value. The default value for a string - * label is an empty string, for an integer label its 0, and for a boolean - * label its `false`. - * Note that there are upper bounds on the maximum number of labels and the - * number of active time series that are allowed in a project. - * - * Generated from protobuf field map label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabelExtractors($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->label_extractors = $arr; - - return $this; - } - - /** - * Optional. The `bucket_options` are required when the logs-based metric is - * using a DISTRIBUTION value type and it describes the bucket boundaries - * used to create a histogram of the extracted values. - * - * Generated from protobuf field .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Api\Distribution\BucketOptions|null - */ - public function getBucketOptions() - { - return $this->bucket_options; - } - - public function hasBucketOptions() - { - return isset($this->bucket_options); - } - - public function clearBucketOptions() - { - unset($this->bucket_options); - } - - /** - * Optional. The `bucket_options` are required when the logs-based metric is - * using a DISTRIBUTION value type and it describes the bucket boundaries - * used to create a histogram of the extracted values. - * - * Generated from protobuf field .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Api\Distribution\BucketOptions $var - * @return $this - */ - public function setBucketOptions($var) - { - GPBUtil::checkMessage($var, \Google\Api\Distribution\BucketOptions::class); - $this->bucket_options = $var; - - return $this; - } - - /** - * Output only. The creation timestamp of the metric. - * This field may not be present for older metrics. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 9 [(.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 metric. - * This field may not be present for older metrics. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 9 [(.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 metric. - * This field may not be present for older metrics. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 10 [(.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 metric. - * This field may not be present for older metrics. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 10 [(.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; - } - - /** - * Deprecated. The API version that created or updated this metric. - * The v2 format is used by default and cannot be changed. - * - * Generated from protobuf field .google.logging.v2.LogMetric.ApiVersion version = 4 [deprecated = true]; - * @return int - * @deprecated - */ - public function getVersion() - { - @trigger_error('version is deprecated.', E_USER_DEPRECATED); - return $this->version; - } - - /** - * Deprecated. The API version that created or updated this metric. - * The v2 format is used by default and cannot be changed. - * - * Generated from protobuf field .google.logging.v2.LogMetric.ApiVersion version = 4 [deprecated = true]; - * @param int $var - * @return $this - * @deprecated - */ - public function setVersion($var) - { - @trigger_error('version is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkEnum($var, \Google\Cloud\Logging\V2\LogMetric\ApiVersion::class); - $this->version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric/ApiVersion.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric/ApiVersion.php deleted file mode 100644 index 393ff635b652..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric/ApiVersion.php +++ /dev/null @@ -1,57 +0,0 @@ -google.logging.v2.LogMetric.ApiVersion - */ -class ApiVersion -{ - /** - * Logging API v2. - * - * Generated from protobuf enum V2 = 0; - */ - const V2 = 0; - /** - * Logging API v1. - * - * Generated from protobuf enum V1 = 1; - */ - const V1 = 1; - - private static $valueToName = [ - self::V2 => 'V2', - self::V1 => 'V1', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __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(ApiVersion::class, \Google\Cloud\Logging\V2\LogMetric_ApiVersion::class); - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric_ApiVersion.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric_ApiVersion.php deleted file mode 100644 index b25048d05d57..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogMetric_ApiVersion.php +++ /dev/null @@ -1,16 +0,0 @@ -google.logging.v2.LogSink - */ -class LogSink extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The client-assigned sink identifier, unique within the project. - * For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited - * to 100 characters and can include only the following characters: upper and - * lower-case alphanumeric characters, underscores, hyphens, and periods. - * First character has to be alphanumeric. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Required. The export destination: - * "storage.googleapis.com/[GCS_BUCKET]" - * "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" - * "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" - * The sink's `writer_identity`, set when the sink is created, must have - * permission to write to the destination or else the log entries are not - * exported. For more information, see - * [Exporting Logs with - * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). - * - * Generated from protobuf field string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $destination = ''; - /** - * Optional. An [advanced logs - * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The - * only exported log entries are those that are in the resource owning the - * sink and that match the filter. - * For example: - * `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR` - * - * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. A description of this sink. - * The maximum length of the description is 8000 characters. - * - * Generated from protobuf field string description = 18 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $description = ''; - /** - * Optional. If set to true, then this sink is disabled and it does not export - * any log entries. - * - * Generated from protobuf field bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $disabled = false; - /** - * Optional. Log entries that match any of these exclusion filters will not be - * exported. - * If a log entry is matched by both `filter` and one of `exclusion_filters` - * it will not be exported. - * - * Generated from protobuf field repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $exclusions; - /** - * Deprecated. This field is unused. - * - * Generated from protobuf field .google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true]; - * @deprecated - */ - protected $output_version_format = 0; - /** - * Output only. An IAM identity—a service account or group—under - * which Cloud Logging writes the exported log entries to the sink's - * destination. This field is either set by specifying - * `custom_writer_identity` or set automatically by - * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and - * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the - * value of `unique_writer_identity` in those methods. - * Until you grant this identity write-access to the destination, log entry - * exports from this sink will fail. For more information, see [Granting - * Access for a - * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource). - * Consult the destination service's documentation to determine the - * appropriate IAM roles to assign to the identity. - * Sinks that have a destination that is a log bucket in the same project as - * the sink cannot have a writer_identity and no additional permissions are - * required. - * - * Generated from protobuf field string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $writer_identity = ''; - /** - * Optional. This field applies only to sinks owned by organizations and - * folders. If the field is false, the default, only the logs owned by the - * sink's parent resource are available for export. If the field is true, then - * log entries from all the projects, folders, and billing accounts contained - * in the sink's parent resource are also available for export. Whether a - * particular log entry from the children is exported depends on the sink's - * filter expression. - * For example, if this field is true, then the filter - * `resource.type=gce_instance` would export all Compute Engine VM instance - * log entries from all projects in the sink's parent. - * To only export entries from certain child projects, filter on the project - * part of the log name: - * logName:("projects/test-project1/" OR "projects/test-project2/") AND - * resource.type=gce_instance - * - * Generated from protobuf field bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $include_children = false; - /** - * Output only. The creation timestamp of the sink. - * This field may not be present for older sinks. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The last update timestamp of the sink. - * This field may not be present for older sinks. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - protected $options; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The client-assigned sink identifier, unique within the project. - * For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited - * to 100 characters and can include only the following characters: upper and - * lower-case alphanumeric characters, underscores, hyphens, and periods. - * First character has to be alphanumeric. - * @type string $destination - * Required. The export destination: - * "storage.googleapis.com/[GCS_BUCKET]" - * "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" - * "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" - * The sink's `writer_identity`, set when the sink is created, must have - * permission to write to the destination or else the log entries are not - * exported. For more information, see - * [Exporting Logs with - * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). - * @type string $filter - * Optional. An [advanced logs - * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The - * only exported log entries are those that are in the resource owning the - * sink and that match the filter. - * For example: - * `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR` - * @type string $description - * Optional. A description of this sink. - * The maximum length of the description is 8000 characters. - * @type bool $disabled - * Optional. If set to true, then this sink is disabled and it does not export - * any log entries. - * @type array<\Google\Cloud\Logging\V2\LogExclusion>|\Google\Protobuf\Internal\RepeatedField $exclusions - * Optional. Log entries that match any of these exclusion filters will not be - * exported. - * If a log entry is matched by both `filter` and one of `exclusion_filters` - * it will not be exported. - * @type int $output_version_format - * Deprecated. This field is unused. - * @type string $writer_identity - * Output only. An IAM identity—a service account or group—under - * which Cloud Logging writes the exported log entries to the sink's - * destination. This field is either set by specifying - * `custom_writer_identity` or set automatically by - * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and - * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the - * value of `unique_writer_identity` in those methods. - * Until you grant this identity write-access to the destination, log entry - * exports from this sink will fail. For more information, see [Granting - * Access for a - * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource). - * Consult the destination service's documentation to determine the - * appropriate IAM roles to assign to the identity. - * Sinks that have a destination that is a log bucket in the same project as - * the sink cannot have a writer_identity and no additional permissions are - * required. - * @type bool $include_children - * Optional. This field applies only to sinks owned by organizations and - * folders. If the field is false, the default, only the logs owned by the - * sink's parent resource are available for export. If the field is true, then - * log entries from all the projects, folders, and billing accounts contained - * in the sink's parent resource are also available for export. Whether a - * particular log entry from the children is exported depends on the sink's - * filter expression. - * For example, if this field is true, then the filter - * `resource.type=gce_instance` would export all Compute Engine VM instance - * log entries from all projects in the sink's parent. - * To only export entries from certain child projects, filter on the project - * part of the log name: - * logName:("projects/test-project1/" OR "projects/test-project2/") AND - * resource.type=gce_instance - * @type \Google\Cloud\Logging\V2\BigQueryOptions $bigquery_options - * Optional. Options that affect sinks exporting data to BigQuery. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The creation timestamp of the sink. - * This field may not be present for older sinks. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The last update timestamp of the sink. - * This field may not be present for older sinks. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The client-assigned sink identifier, unique within the project. - * For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited - * to 100 characters and can include only the following characters: upper and - * lower-case alphanumeric characters, underscores, hyphens, and periods. - * First character has to be alphanumeric. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The client-assigned sink identifier, unique within the project. - * For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited - * to 100 characters and can include only the following characters: upper and - * lower-case alphanumeric characters, underscores, hyphens, and periods. - * First character has to be alphanumeric. - * - * 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 export destination: - * "storage.googleapis.com/[GCS_BUCKET]" - * "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" - * "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" - * The sink's `writer_identity`, set when the sink is created, must have - * permission to write to the destination or else the log entries are not - * exported. For more information, see - * [Exporting Logs with - * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). - * - * Generated from protobuf field string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getDestination() - { - return $this->destination; - } - - /** - * Required. The export destination: - * "storage.googleapis.com/[GCS_BUCKET]" - * "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" - * "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" - * The sink's `writer_identity`, set when the sink is created, must have - * permission to write to the destination or else the log entries are not - * exported. For more information, see - * [Exporting Logs with - * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). - * - * Generated from protobuf field string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setDestination($var) - { - GPBUtil::checkString($var, True); - $this->destination = $var; - - return $this; - } - - /** - * Optional. An [advanced logs - * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The - * only exported log entries are those that are in the resource owning the - * sink and that match the filter. - * For example: - * `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR` - * - * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. An [advanced logs - * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The - * only exported log entries are those that are in the resource owning the - * sink and that match the filter. - * For example: - * `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR` - * - * Generated from protobuf field string filter = 5 [(.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 description of this sink. - * The maximum length of the description is 8000 characters. - * - * Generated from protobuf field string description = 18 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Optional. A description of this sink. - * The maximum length of the description is 8000 characters. - * - * Generated from protobuf field string description = 18 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Optional. If set to true, then this sink is disabled and it does not export - * any log entries. - * - * Generated from protobuf field bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getDisabled() - { - return $this->disabled; - } - - /** - * Optional. If set to true, then this sink is disabled and it does not export - * any log entries. - * - * Generated from protobuf field bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setDisabled($var) - { - GPBUtil::checkBool($var); - $this->disabled = $var; - - return $this; - } - - /** - * Optional. Log entries that match any of these exclusion filters will not be - * exported. - * If a log entry is matched by both `filter` and one of `exclusion_filters` - * it will not be exported. - * - * Generated from protobuf field repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getExclusions() - { - return $this->exclusions; - } - - /** - * Optional. Log entries that match any of these exclusion filters will not be - * exported. - * If a log entry is matched by both `filter` and one of `exclusion_filters` - * it will not be exported. - * - * Generated from protobuf field repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\Logging\V2\LogExclusion>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setExclusions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogExclusion::class); - $this->exclusions = $arr; - - return $this; - } - - /** - * Deprecated. This field is unused. - * - * Generated from protobuf field .google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true]; - * @return int - * @deprecated - */ - public function getOutputVersionFormat() - { - @trigger_error('output_version_format is deprecated.', E_USER_DEPRECATED); - return $this->output_version_format; - } - - /** - * Deprecated. This field is unused. - * - * Generated from protobuf field .google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true]; - * @param int $var - * @return $this - * @deprecated - */ - public function setOutputVersionFormat($var) - { - @trigger_error('output_version_format is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkEnum($var, \Google\Cloud\Logging\V2\LogSink\VersionFormat::class); - $this->output_version_format = $var; - - return $this; - } - - /** - * Output only. An IAM identity—a service account or group—under - * which Cloud Logging writes the exported log entries to the sink's - * destination. This field is either set by specifying - * `custom_writer_identity` or set automatically by - * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and - * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the - * value of `unique_writer_identity` in those methods. - * Until you grant this identity write-access to the destination, log entry - * exports from this sink will fail. For more information, see [Granting - * Access for a - * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource). - * Consult the destination service's documentation to determine the - * appropriate IAM roles to assign to the identity. - * Sinks that have a destination that is a log bucket in the same project as - * the sink cannot have a writer_identity and no additional permissions are - * required. - * - * Generated from protobuf field string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getWriterIdentity() - { - return $this->writer_identity; - } - - /** - * Output only. An IAM identity—a service account or group—under - * which Cloud Logging writes the exported log entries to the sink's - * destination. This field is either set by specifying - * `custom_writer_identity` or set automatically by - * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and - * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the - * value of `unique_writer_identity` in those methods. - * Until you grant this identity write-access to the destination, log entry - * exports from this sink will fail. For more information, see [Granting - * Access for a - * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource). - * Consult the destination service's documentation to determine the - * appropriate IAM roles to assign to the identity. - * Sinks that have a destination that is a log bucket in the same project as - * the sink cannot have a writer_identity and no additional permissions are - * required. - * - * Generated from protobuf field string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setWriterIdentity($var) - { - GPBUtil::checkString($var, True); - $this->writer_identity = $var; - - return $this; - } - - /** - * Optional. This field applies only to sinks owned by organizations and - * folders. If the field is false, the default, only the logs owned by the - * sink's parent resource are available for export. If the field is true, then - * log entries from all the projects, folders, and billing accounts contained - * in the sink's parent resource are also available for export. Whether a - * particular log entry from the children is exported depends on the sink's - * filter expression. - * For example, if this field is true, then the filter - * `resource.type=gce_instance` would export all Compute Engine VM instance - * log entries from all projects in the sink's parent. - * To only export entries from certain child projects, filter on the project - * part of the log name: - * logName:("projects/test-project1/" OR "projects/test-project2/") AND - * resource.type=gce_instance - * - * Generated from protobuf field bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getIncludeChildren() - { - return $this->include_children; - } - - /** - * Optional. This field applies only to sinks owned by organizations and - * folders. If the field is false, the default, only the logs owned by the - * sink's parent resource are available for export. If the field is true, then - * log entries from all the projects, folders, and billing accounts contained - * in the sink's parent resource are also available for export. Whether a - * particular log entry from the children is exported depends on the sink's - * filter expression. - * For example, if this field is true, then the filter - * `resource.type=gce_instance` would export all Compute Engine VM instance - * log entries from all projects in the sink's parent. - * To only export entries from certain child projects, filter on the project - * part of the log name: - * logName:("projects/test-project1/" OR "projects/test-project2/") AND - * resource.type=gce_instance - * - * Generated from protobuf field bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setIncludeChildren($var) - { - GPBUtil::checkBool($var); - $this->include_children = $var; - - return $this; - } - - /** - * Optional. Options that affect sinks exporting data to BigQuery. - * - * Generated from protobuf field .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Logging\V2\BigQueryOptions|null - */ - public function getBigqueryOptions() - { - return $this->readOneof(12); - } - - public function hasBigqueryOptions() - { - return $this->hasOneof(12); - } - - /** - * Optional. Options that affect sinks exporting data to BigQuery. - * - * Generated from protobuf field .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Logging\V2\BigQueryOptions $var - * @return $this - */ - public function setBigqueryOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\BigQueryOptions::class); - $this->writeOneof(12, $var); - - return $this; - } - - /** - * Output only. The creation timestamp of the sink. - * This field may not be present for older sinks. - * - * 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 creation timestamp of the sink. - * This field may not be present for older sinks. - * - * 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 last update timestamp of the sink. - * This field may not be present for older sinks. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 14 [(.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 sink. - * This field may not be present for older sinks. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 14 [(.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; - } - - /** - * @return string - */ - public function getOptions() - { - return $this->whichOneof("options"); - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogSink/VersionFormat.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogSink/VersionFormat.php deleted file mode 100644 index 4cdb89f2b82d..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogSink/VersionFormat.php +++ /dev/null @@ -1,64 +0,0 @@ -google.logging.v2.LogSink.VersionFormat - */ -class VersionFormat -{ - /** - * An unspecified format version that will default to V2. - * - * Generated from protobuf enum VERSION_FORMAT_UNSPECIFIED = 0; - */ - const VERSION_FORMAT_UNSPECIFIED = 0; - /** - * `LogEntry` version 2 format. - * - * Generated from protobuf enum V2 = 1; - */ - const V2 = 1; - /** - * `LogEntry` version 1 format. - * - * Generated from protobuf enum V1 = 2; - */ - const V1 = 2; - - private static $valueToName = [ - self::VERSION_FORMAT_UNSPECIFIED => 'VERSION_FORMAT_UNSPECIFIED', - self::V2 => 'V2', - self::V1 => 'V1', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __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(VersionFormat::class, \Google\Cloud\Logging\V2\LogSink_VersionFormat::class); - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogSink_VersionFormat.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogSink_VersionFormat.php deleted file mode 100644 index d18a03549846..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogSink_VersionFormat.php +++ /dev/null @@ -1,16 +0,0 @@ -google.logging.v2.LogSplit - */ -class LogSplit extends \Google\Protobuf\Internal\Message -{ - /** - * A globally unique identifier for all log entries in a sequence of split log - * entries. All log entries with the same |LogSplit.uid| are assumed to be - * part of the same sequence of split log entries. - * - * Generated from protobuf field string uid = 1; - */ - protected $uid = ''; - /** - * The index of this LogEntry in the sequence of split log entries. Log - * entries are given |index| values 0, 1, ..., n-1 for a sequence of n log - * entries. - * - * Generated from protobuf field int32 index = 2; - */ - protected $index = 0; - /** - * The total number of log entries that the original LogEntry was split into. - * - * Generated from protobuf field int32 total_splits = 3; - */ - protected $total_splits = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uid - * A globally unique identifier for all log entries in a sequence of split log - * entries. All log entries with the same |LogSplit.uid| are assumed to be - * part of the same sequence of split log entries. - * @type int $index - * The index of this LogEntry in the sequence of split log entries. Log - * entries are given |index| values 0, 1, ..., n-1 for a sequence of n log - * entries. - * @type int $total_splits - * The total number of log entries that the original LogEntry was split into. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LogEntry::initOnce(); - parent::__construct($data); - } - - /** - * A globally unique identifier for all log entries in a sequence of split log - * entries. All log entries with the same |LogSplit.uid| are assumed to be - * part of the same sequence of split log entries. - * - * Generated from protobuf field string uid = 1; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * A globally unique identifier for all log entries in a sequence of split log - * entries. All log entries with the same |LogSplit.uid| are assumed to be - * part of the same sequence of split log entries. - * - * Generated from protobuf field string uid = 1; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * The index of this LogEntry in the sequence of split log entries. Log - * entries are given |index| values 0, 1, ..., n-1 for a sequence of n log - * entries. - * - * Generated from protobuf field int32 index = 2; - * @return int - */ - public function getIndex() - { - return $this->index; - } - - /** - * The index of this LogEntry in the sequence of split log entries. Log - * entries are given |index| values 0, 1, ..., n-1 for a sequence of n log - * entries. - * - * Generated from protobuf field int32 index = 2; - * @param int $var - * @return $this - */ - public function setIndex($var) - { - GPBUtil::checkInt32($var); - $this->index = $var; - - return $this; - } - - /** - * The total number of log entries that the original LogEntry was split into. - * - * Generated from protobuf field int32 total_splits = 3; - * @return int - */ - public function getTotalSplits() - { - return $this->total_splits; - } - - /** - * The total number of log entries that the original LogEntry was split into. - * - * Generated from protobuf field int32 total_splits = 3; - * @param int $var - * @return $this - */ - public function setTotalSplits($var) - { - GPBUtil::checkInt32($var); - $this->total_splits = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogView.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogView.php deleted file mode 100644 index 3b506053a5a4..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LogView.php +++ /dev/null @@ -1,267 +0,0 @@ -google.logging.v2.LogView - */ -class LogView extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the view. - * For example: - * `projects/my-project/locations/global/buckets/my-bucket/views/my-view` - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Describes this view. - * - * Generated from protobuf field string description = 3; - */ - protected $description = ''; - /** - * Output only. The creation timestamp of the view. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The last update timestamp of the view. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Filter that restricts which log entries in a bucket are visible in this - * view. - * Filters are restricted to be a logical AND of ==/!= of any of the - * following: - * - originating project/folder/organization/billing account. - * - resource type - * - log id - * For example: - * SOURCE("projects/myproject") AND resource.type = "gce_instance" - * AND LOG_ID("stdout") - * - * Generated from protobuf field string filter = 7; - */ - protected $filter = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The resource name of the view. - * For example: - * `projects/my-project/locations/global/buckets/my-bucket/views/my-view` - * @type string $description - * Describes this view. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The creation timestamp of the view. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The last update timestamp of the view. - * @type string $filter - * Filter that restricts which log entries in a bucket are visible in this - * view. - * Filters are restricted to be a logical AND of ==/!= of any of the - * following: - * - originating project/folder/organization/billing account. - * - resource type - * - log id - * For example: - * SOURCE("projects/myproject") AND resource.type = "gce_instance" - * AND LOG_ID("stdout") - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the view. - * For example: - * `projects/my-project/locations/global/buckets/my-bucket/views/my-view` - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the view. - * For example: - * `projects/my-project/locations/global/buckets/my-bucket/views/my-view` - * - * 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; - } - - /** - * Describes this view. - * - * Generated from protobuf field string description = 3; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Describes this view. - * - * Generated from protobuf field string description = 3; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. The creation timestamp of the view. - * - * 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 creation timestamp of the view. - * - * 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 last update timestamp of the view. - * - * 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 last update timestamp of the view. - * - * 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; - } - - /** - * Filter that restricts which log entries in a bucket are visible in this - * view. - * Filters are restricted to be a logical AND of ==/!= of any of the - * following: - * - originating project/folder/organization/billing account. - * - resource type - * - log id - * For example: - * SOURCE("projects/myproject") AND resource.type = "gce_instance" - * AND LOG_ID("stdout") - * - * Generated from protobuf field string filter = 7; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Filter that restricts which log entries in a bucket are visible in this - * view. - * Filters are restricted to be a logical AND of ==/!= of any of the - * following: - * - originating project/folder/organization/billing account. - * - resource type - * - log id - * For example: - * SOURCE("projects/myproject") AND resource.type = "gce_instance" - * AND LOG_ID("stdout") - * - * Generated from protobuf field string filter = 7; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LoggingServiceV2GrpcClient.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LoggingServiceV2GrpcClient.php deleted file mode 100644 index fc97349a0548..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/LoggingServiceV2GrpcClient.php +++ /dev/null @@ -1,136 +0,0 @@ -_simpleRequest('/google.logging.v2.LoggingServiceV2/DeleteLog', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Writes log entries to Logging. This API method is the - * only way to send log entries to Logging. This method - * is used, directly or indirectly, by the Logging agent - * (fluentd) and all logging libraries configured to use Logging. - * A single request may contain log entries for a maximum of 1000 - * different resources (projects, organizations, billing accounts or - * folders) - * @param \Google\Cloud\Logging\V2\WriteLogEntriesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function WriteLogEntries(\Google\Cloud\Logging\V2\WriteLogEntriesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.LoggingServiceV2/WriteLogEntries', - $argument, - ['\Google\Cloud\Logging\V2\WriteLogEntriesResponse', 'decode'], - $metadata, $options); - } - - /** - * Lists log entries. Use this method to retrieve log entries that originated - * from a project/folder/organization/billing account. For ways to export log - * entries, see [Exporting - * Logs](https://cloud.google.com/logging/docs/export). - * @param \Google\Cloud\Logging\V2\ListLogEntriesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListLogEntries(\Google\Cloud\Logging\V2\ListLogEntriesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.LoggingServiceV2/ListLogEntries', - $argument, - ['\Google\Cloud\Logging\V2\ListLogEntriesResponse', 'decode'], - $metadata, $options); - } - - /** - * Lists the descriptors for monitored resource types used by Logging. - * @param \Google\Cloud\Logging\V2\ListMonitoredResourceDescriptorsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListMonitoredResourceDescriptors(\Google\Cloud\Logging\V2\ListMonitoredResourceDescriptorsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.LoggingServiceV2/ListMonitoredResourceDescriptors', - $argument, - ['\Google\Cloud\Logging\V2\ListMonitoredResourceDescriptorsResponse', 'decode'], - $metadata, $options); - } - - /** - * Lists the logs in projects, organizations, folders, or billing accounts. - * Only logs that have entries are listed. - * @param \Google\Cloud\Logging\V2\ListLogsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListLogs(\Google\Cloud\Logging\V2\ListLogsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.LoggingServiceV2/ListLogs', - $argument, - ['\Google\Cloud\Logging\V2\ListLogsResponse', 'decode'], - $metadata, $options); - } - - /** - * Streaming read of log entries as they are ingested. Until the stream is - * terminated, it will continue reading logs. - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\BidiStreamingCall - */ - public function TailLogEntries($metadata = [], $options = []) { - return $this->_bidiRequest('/google.logging.v2.LoggingServiceV2/TailLogEntries', - ['\Google\Cloud\Logging\V2\TailLogEntriesResponse','decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/MetricsServiceV2GrpcClient.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/MetricsServiceV2GrpcClient.php deleted file mode 100644 index f671b2f3b410..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/MetricsServiceV2GrpcClient.php +++ /dev/null @@ -1,110 +0,0 @@ -_simpleRequest('/google.logging.v2.MetricsServiceV2/ListLogMetrics', - $argument, - ['\Google\Cloud\Logging\V2\ListLogMetricsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a logs-based metric. - * @param \Google\Cloud\Logging\V2\GetLogMetricRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetLogMetric(\Google\Cloud\Logging\V2\GetLogMetricRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.MetricsServiceV2/GetLogMetric', - $argument, - ['\Google\Cloud\Logging\V2\LogMetric', 'decode'], - $metadata, $options); - } - - /** - * Creates a logs-based metric. - * @param \Google\Cloud\Logging\V2\CreateLogMetricRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateLogMetric(\Google\Cloud\Logging\V2\CreateLogMetricRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.MetricsServiceV2/CreateLogMetric', - $argument, - ['\Google\Cloud\Logging\V2\LogMetric', 'decode'], - $metadata, $options); - } - - /** - * Creates or updates a logs-based metric. - * @param \Google\Cloud\Logging\V2\UpdateLogMetricRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateLogMetric(\Google\Cloud\Logging\V2\UpdateLogMetricRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.MetricsServiceV2/UpdateLogMetric', - $argument, - ['\Google\Cloud\Logging\V2\LogMetric', 'decode'], - $metadata, $options); - } - - /** - * Deletes a logs-based metric. - * @param \Google\Cloud\Logging\V2\DeleteLogMetricRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteLogMetric(\Google\Cloud\Logging\V2\DeleteLogMetricRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.logging.v2.MetricsServiceV2/DeleteLogMetric', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/OperationState.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/OperationState.php deleted file mode 100644 index 32d50436ce86..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/OperationState.php +++ /dev/null @@ -1,93 +0,0 @@ -google.logging.v2.OperationState - */ -class OperationState -{ - /** - * Should not be used. - * - * Generated from protobuf enum OPERATION_STATE_UNSPECIFIED = 0; - */ - const OPERATION_STATE_UNSPECIFIED = 0; - /** - * The operation is scheduled. - * - * Generated from protobuf enum OPERATION_STATE_SCHEDULED = 1; - */ - const OPERATION_STATE_SCHEDULED = 1; - /** - * Waiting for necessary permissions. - * - * Generated from protobuf enum OPERATION_STATE_WAITING_FOR_PERMISSIONS = 2; - */ - const OPERATION_STATE_WAITING_FOR_PERMISSIONS = 2; - /** - * The operation is running. - * - * Generated from protobuf enum OPERATION_STATE_RUNNING = 3; - */ - const OPERATION_STATE_RUNNING = 3; - /** - * The operation was completed successfully. - * - * Generated from protobuf enum OPERATION_STATE_SUCCEEDED = 4; - */ - const OPERATION_STATE_SUCCEEDED = 4; - /** - * The operation failed. - * - * Generated from protobuf enum OPERATION_STATE_FAILED = 5; - */ - const OPERATION_STATE_FAILED = 5; - /** - * The operation was cancelled by the user. - * - * Generated from protobuf enum OPERATION_STATE_CANCELLED = 6; - */ - const OPERATION_STATE_CANCELLED = 6; - - private static $valueToName = [ - self::OPERATION_STATE_UNSPECIFIED => 'OPERATION_STATE_UNSPECIFIED', - self::OPERATION_STATE_SCHEDULED => 'OPERATION_STATE_SCHEDULED', - self::OPERATION_STATE_WAITING_FOR_PERMISSIONS => 'OPERATION_STATE_WAITING_FOR_PERMISSIONS', - self::OPERATION_STATE_RUNNING => 'OPERATION_STATE_RUNNING', - self::OPERATION_STATE_SUCCEEDED => 'OPERATION_STATE_SUCCEEDED', - self::OPERATION_STATE_FAILED => 'OPERATION_STATE_FAILED', - self::OPERATION_STATE_CANCELLED => 'OPERATION_STATE_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); - } -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/Settings.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/Settings.php deleted file mode 100644 index b66463e4ad75..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/Settings.php +++ /dev/null @@ -1,324 +0,0 @@ -google.logging.v2.Settings - */ -class Settings extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name of the settings. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Optional. The resource name for the configured Cloud KMS key. - * KMS key name format: - * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]" - * For example: - * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"` - * To enable CMEK for the Log Router, set this field to a valid - * `kms_key_name` for which the associated service account has the required - * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key. - * The Cloud KMS key used by the Log Router can be updated by changing the - * `kms_key_name` to a new valid key name. Encryption operations that are in - * progress will be completed with the key that was in use when they started. - * Decryption operations will be completed using the key that was used at the - * time of encryption unless access to that key has been revoked. - * To disable CMEK for the Log Router, set this field to an empty string. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Generated from protobuf field string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $kms_key_name = ''; - /** - * Output only. The service account that will be used by the Log Router to - * access your Cloud KMS key. - * Before enabling CMEK for Log Router, you must first assign the role - * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that - * the Log Router will use to access your Cloud KMS key. Use - * [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings] to - * obtain the service account ID. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Generated from protobuf field string kms_service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $kms_service_account_id = ''; - /** - * Optional. The Cloud region that will be used for _Default and _Required log - * buckets for newly created projects and folders. For example `europe-west1`. - * This setting does not affect the location of custom log buckets. - * - * Generated from protobuf field string storage_location = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $storage_location = ''; - /** - * Optional. If set to true, the _Default sink in newly created projects and - * folders will created in a disabled state. This can be used to automatically - * disable log ingestion if there is already an aggregated sink configured in - * the hierarchy. The _Default sink can be re-enabled manually if needed. - * - * Generated from protobuf field bool disable_default_sink = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $disable_default_sink = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name of the settings. - * @type string $kms_key_name - * Optional. The resource name for the configured Cloud KMS key. - * KMS key name format: - * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]" - * For example: - * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"` - * To enable CMEK for the Log Router, set this field to a valid - * `kms_key_name` for which the associated service account has the required - * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key. - * The Cloud KMS key used by the Log Router can be updated by changing the - * `kms_key_name` to a new valid key name. Encryption operations that are in - * progress will be completed with the key that was in use when they started. - * Decryption operations will be completed using the key that was used at the - * time of encryption unless access to that key has been revoked. - * To disable CMEK for the Log Router, set this field to an empty string. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * @type string $kms_service_account_id - * Output only. The service account that will be used by the Log Router to - * access your Cloud KMS key. - * Before enabling CMEK for Log Router, you must first assign the role - * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that - * the Log Router will use to access your Cloud KMS key. Use - * [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings] to - * obtain the service account ID. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * @type string $storage_location - * Optional. The Cloud region that will be used for _Default and _Required log - * buckets for newly created projects and folders. For example `europe-west1`. - * This setting does not affect the location of custom log buckets. - * @type bool $disable_default_sink - * Optional. If set to true, the _Default sink in newly created projects and - * folders will created in a disabled state. This can be used to automatically - * disable log ingestion if there is already an aggregated sink configured in - * the hierarchy. The _Default sink can be re-enabled manually if needed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name of the settings. - * - * 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 settings. - * - * 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. The resource name for the configured Cloud KMS key. - * KMS key name format: - * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]" - * For example: - * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"` - * To enable CMEK for the Log Router, set this field to a valid - * `kms_key_name` for which the associated service account has the required - * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key. - * The Cloud KMS key used by the Log Router can be updated by changing the - * `kms_key_name` to a new valid key name. Encryption operations that are in - * progress will be completed with the key that was in use when they started. - * Decryption operations will be completed using the key that was used at the - * time of encryption unless access to that key has been revoked. - * To disable CMEK for the Log Router, set this field to an empty string. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Generated from protobuf field string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getKmsKeyName() - { - return $this->kms_key_name; - } - - /** - * Optional. The resource name for the configured Cloud KMS key. - * KMS key name format: - * "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]" - * For example: - * `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"` - * To enable CMEK for the Log Router, set this field to a valid - * `kms_key_name` for which the associated service account has the required - * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key. - * The Cloud KMS key used by the Log Router can be updated by changing the - * `kms_key_name` to a new valid key name. Encryption operations that are in - * progress will be completed with the key that was in use when they started. - * Decryption operations will be completed using the key that was used at the - * time of encryption unless access to that key has been revoked. - * To disable CMEK for the Log Router, set this field to an empty string. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Generated from protobuf field string kms_key_name = 2 [(.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; - } - - /** - * Output only. The service account that will be used by the Log Router to - * access your Cloud KMS key. - * Before enabling CMEK for Log Router, you must first assign the role - * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that - * the Log Router will use to access your Cloud KMS key. Use - * [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings] to - * obtain the service account ID. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Generated from protobuf field string kms_service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getKmsServiceAccountId() - { - return $this->kms_service_account_id; - } - - /** - * Output only. The service account that will be used by the Log Router to - * access your Cloud KMS key. - * Before enabling CMEK for Log Router, you must first assign the role - * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that - * the Log Router will use to access your Cloud KMS key. Use - * [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings] to - * obtain the service account ID. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Generated from protobuf field string kms_service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setKmsServiceAccountId($var) - { - GPBUtil::checkString($var, True); - $this->kms_service_account_id = $var; - - return $this; - } - - /** - * Optional. The Cloud region that will be used for _Default and _Required log - * buckets for newly created projects and folders. For example `europe-west1`. - * This setting does not affect the location of custom log buckets. - * - * Generated from protobuf field string storage_location = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getStorageLocation() - { - return $this->storage_location; - } - - /** - * Optional. The Cloud region that will be used for _Default and _Required log - * buckets for newly created projects and folders. For example `europe-west1`. - * This setting does not affect the location of custom log buckets. - * - * Generated from protobuf field string storage_location = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setStorageLocation($var) - { - GPBUtil::checkString($var, True); - $this->storage_location = $var; - - return $this; - } - - /** - * Optional. If set to true, the _Default sink in newly created projects and - * folders will created in a disabled state. This can be used to automatically - * disable log ingestion if there is already an aggregated sink configured in - * the hierarchy. The _Default sink can be re-enabled manually if needed. - * - * Generated from protobuf field bool disable_default_sink = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getDisableDefaultSink() - { - return $this->disable_default_sink; - } - - /** - * Optional. If set to true, the _Default sink in newly created projects and - * folders will created in a disabled state. This can be used to automatically - * disable log ingestion if there is already an aggregated sink configured in - * the hierarchy. The _Default sink can be re-enabled manually if needed. - * - * Generated from protobuf field bool disable_default_sink = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setDisableDefaultSink($var) - { - GPBUtil::checkBool($var); - $this->disable_default_sink = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesRequest.php deleted file mode 100644 index 87b5718221cf..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesRequest.php +++ /dev/null @@ -1,209 +0,0 @@ -google.logging.v2.TailLogEntriesRequest - */ -class TailLogEntriesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of a parent resource from which to retrieve log entries: - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * May alternatively be one or more views: - * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * - * Generated from protobuf field repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $resource_names; - /** - * Optional. Only log entries that match the filter are returned. An empty - * filter matches all log entries in the resources listed in `resource_names`. - * Referencing a parent resource that is not listed in `resource_names` will - * cause the filter to return no results. The maximum length of a filter is - * 20,000 characters. - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. The amount of time to buffer log entries at the server before - * being returned to prevent out of order results due to late arriving log - * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000 - * milliseconds. - * - * Generated from protobuf field .google.protobuf.Duration buffer_window = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $buffer_window = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $resource_names - * Required. Name of a parent resource from which to retrieve log entries: - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * May alternatively be one or more views: - * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * @type string $filter - * Optional. Only log entries that match the filter are returned. An empty - * filter matches all log entries in the resources listed in `resource_names`. - * Referencing a parent resource that is not listed in `resource_names` will - * cause the filter to return no results. The maximum length of a filter is - * 20,000 characters. - * @type \Google\Protobuf\Duration $buffer_window - * Optional. The amount of time to buffer log entries at the server before - * being returned to prevent out of order results due to late arriving log - * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000 - * milliseconds. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\Logging::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of a parent resource from which to retrieve log entries: - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * May alternatively be one or more views: - * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * - * Generated from protobuf field repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getResourceNames() - { - return $this->resource_names; - } - - /** - * Required. Name of a parent resource from which to retrieve log entries: - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * May alternatively be one or more views: - * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * - * Generated from protobuf field repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setResourceNames($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->resource_names = $arr; - - return $this; - } - - /** - * Optional. Only log entries that match the filter are returned. An empty - * filter matches all log entries in the resources listed in `resource_names`. - * Referencing a parent resource that is not listed in `resource_names` will - * cause the filter to return no results. The maximum length of a filter is - * 20,000 characters. - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Only log entries that match the filter are returned. An empty - * filter matches all log entries in the resources listed in `resource_names`. - * Referencing a parent resource that is not listed in `resource_names` will - * cause the filter to return no results. The maximum length of a filter is - * 20,000 characters. - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. The amount of time to buffer log entries at the server before - * being returned to prevent out of order results due to late arriving log - * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000 - * milliseconds. - * - * Generated from protobuf field .google.protobuf.Duration buffer_window = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Duration|null - */ - public function getBufferWindow() - { - return $this->buffer_window; - } - - public function hasBufferWindow() - { - return isset($this->buffer_window); - } - - public function clearBufferWindow() - { - unset($this->buffer_window); - } - - /** - * Optional. The amount of time to buffer log entries at the server before - * being returned to prevent out of order results due to late arriving log - * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000 - * milliseconds. - * - * Generated from protobuf field .google.protobuf.Duration buffer_window = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setBufferWindow($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->buffer_window = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse.php deleted file mode 100644 index a5d94ed0e2e6..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse.php +++ /dev/null @@ -1,125 +0,0 @@ -google.logging.v2.TailLogEntriesResponse - */ -class TailLogEntriesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A list of log entries. Each response in the stream will order entries with - * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed - * between separate responses. - * - * Generated from protobuf field repeated .google.logging.v2.LogEntry entries = 1; - */ - private $entries; - /** - * If entries that otherwise would have been included in the session were not - * sent back to the client, counts of relevant entries omitted from the - * session with the reason that they were not included. There will be at most - * one of each reason per response. The counts represent the number of - * suppressed entries since the last streamed response. - * - * Generated from protobuf field repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; - */ - private $suppression_info; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Logging\V2\LogEntry>|\Google\Protobuf\Internal\RepeatedField $entries - * A list of log entries. Each response in the stream will order entries with - * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed - * between separate responses. - * @type array<\Google\Cloud\Logging\V2\TailLogEntriesResponse\SuppressionInfo>|\Google\Protobuf\Internal\RepeatedField $suppression_info - * If entries that otherwise would have been included in the session were not - * sent back to the client, counts of relevant entries omitted from the - * session with the reason that they were not included. There will be at most - * one of each reason per response. The counts represent the number of - * suppressed entries since the last streamed response. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\Logging::initOnce(); - parent::__construct($data); - } - - /** - * A list of log entries. Each response in the stream will order entries with - * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed - * between separate responses. - * - * Generated from protobuf field repeated .google.logging.v2.LogEntry entries = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEntries() - { - return $this->entries; - } - - /** - * A list of log entries. Each response in the stream will order entries with - * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed - * between separate responses. - * - * Generated from protobuf field repeated .google.logging.v2.LogEntry entries = 1; - * @param array<\Google\Cloud\Logging\V2\LogEntry>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEntries($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogEntry::class); - $this->entries = $arr; - - return $this; - } - - /** - * If entries that otherwise would have been included in the session were not - * sent back to the client, counts of relevant entries omitted from the - * session with the reason that they were not included. There will be at most - * one of each reason per response. The counts represent the number of - * suppressed entries since the last streamed response. - * - * Generated from protobuf field repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSuppressionInfo() - { - return $this->suppression_info; - } - - /** - * If entries that otherwise would have been included in the session were not - * sent back to the client, counts of relevant entries omitted from the - * session with the reason that they were not included. There will be at most - * one of each reason per response. The counts represent the number of - * suppressed entries since the last streamed response. - * - * Generated from protobuf field repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; - * @param array<\Google\Cloud\Logging\V2\TailLogEntriesResponse\SuppressionInfo>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSuppressionInfo($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\TailLogEntriesResponse\SuppressionInfo::class); - $this->suppression_info = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse/SuppressionInfo.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse/SuppressionInfo.php deleted file mode 100644 index f8b88df264a0..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse/SuppressionInfo.php +++ /dev/null @@ -1,104 +0,0 @@ -google.logging.v2.TailLogEntriesResponse.SuppressionInfo - */ -class SuppressionInfo extends \Google\Protobuf\Internal\Message -{ - /** - * The reason that entries were omitted from the session. - * - * Generated from protobuf field .google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason reason = 1; - */ - protected $reason = 0; - /** - * A lower bound on the count of entries omitted due to `reason`. - * - * Generated from protobuf field int32 suppressed_count = 2; - */ - protected $suppressed_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $reason - * The reason that entries were omitted from the session. - * @type int $suppressed_count - * A lower bound on the count of entries omitted due to `reason`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\Logging::initOnce(); - parent::__construct($data); - } - - /** - * The reason that entries were omitted from the session. - * - * Generated from protobuf field .google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason reason = 1; - * @return int - */ - public function getReason() - { - return $this->reason; - } - - /** - * The reason that entries were omitted from the session. - * - * Generated from protobuf field .google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason reason = 1; - * @param int $var - * @return $this - */ - public function setReason($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Logging\V2\TailLogEntriesResponse\SuppressionInfo\Reason::class); - $this->reason = $var; - - return $this; - } - - /** - * A lower bound on the count of entries omitted due to `reason`. - * - * Generated from protobuf field int32 suppressed_count = 2; - * @return int - */ - public function getSuppressedCount() - { - return $this->suppressed_count; - } - - /** - * A lower bound on the count of entries omitted due to `reason`. - * - * Generated from protobuf field int32 suppressed_count = 2; - * @param int $var - * @return $this - */ - public function setSuppressedCount($var) - { - GPBUtil::checkInt32($var); - $this->suppressed_count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SuppressionInfo::class, \Google\Cloud\Logging\V2\TailLogEntriesResponse_SuppressionInfo::class); - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse/SuppressionInfo/Reason.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse/SuppressionInfo/Reason.php deleted file mode 100644 index a626cf2f1b84..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse/SuppressionInfo/Reason.php +++ /dev/null @@ -1,68 +0,0 @@ -google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason - */ -class Reason -{ - /** - * Unexpected default. - * - * Generated from protobuf enum REASON_UNSPECIFIED = 0; - */ - const REASON_UNSPECIFIED = 0; - /** - * Indicates suppression occurred due to relevant entries being - * received in excess of rate limits. For quotas and limits, see - * [Logging API quotas and - * limits](https://cloud.google.com/logging/quotas#api-limits). - * - * Generated from protobuf enum RATE_LIMIT = 1; - */ - const RATE_LIMIT = 1; - /** - * Indicates suppression occurred due to the client not consuming - * responses quickly enough. - * - * Generated from protobuf enum NOT_CONSUMED = 2; - */ - const NOT_CONSUMED = 2; - - private static $valueToName = [ - self::REASON_UNSPECIFIED => 'REASON_UNSPECIFIED', - self::RATE_LIMIT => 'RATE_LIMIT', - self::NOT_CONSUMED => 'NOT_CONSUMED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __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\Logging\V2\TailLogEntriesResponse_SuppressionInfo_Reason::class); - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse_SuppressionInfo.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse_SuppressionInfo.php deleted file mode 100644 index d3e4b91ac857..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/TailLogEntriesResponse_SuppressionInfo.php +++ /dev/null @@ -1,16 +0,0 @@ -google.logging.v2.UndeleteBucketRequest - */ -class UndeleteBucketRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full resource name of the bucket to undelete. - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket"` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The full resource name of the bucket to undelete. - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket"` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full resource name of the bucket to undelete. - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket"` - * - * 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 resource name of the bucket to undelete. - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket"` - * - * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateBucketRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateBucketRequest.php deleted file mode 100644 index 8fc50d3f20df..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateBucketRequest.php +++ /dev/null @@ -1,199 +0,0 @@ -google.logging.v2.UpdateBucketRequest - */ -class UpdateBucketRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full resource name of the bucket to update. - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket"` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. The updated bucket. - * - * Generated from protobuf field .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $bucket = null; - /** - * Required. Field mask that specifies the fields in `bucket` that need an - * update. A bucket field will be overwritten if, and only if, it is in the - * update mask. `name` and output only fields cannot be updated. - * For a detailed `FieldMask` definition, see: - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * For example: `updateMask=retention_days` - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The full resource name of the bucket to update. - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket"` - * @type \Google\Cloud\Logging\V2\LogBucket $bucket - * Required. The updated bucket. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. Field mask that specifies the fields in `bucket` that need an - * update. A bucket field will be overwritten if, and only if, it is in the - * update mask. `name` and output only fields cannot be updated. - * For a detailed `FieldMask` definition, see: - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * For example: `updateMask=retention_days` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full resource name of the bucket to update. - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket"` - * - * 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 resource name of the bucket to update. - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket"` - * - * 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 updated bucket. - * - * Generated from protobuf field .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Logging\V2\LogBucket|null - */ - public function getBucket() - { - return $this->bucket; - } - - public function hasBucket() - { - return isset($this->bucket); - } - - public function clearBucket() - { - unset($this->bucket); - } - - /** - * Required. The updated bucket. - * - * Generated from protobuf field .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Logging\V2\LogBucket $var - * @return $this - */ - public function setBucket($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogBucket::class); - $this->bucket = $var; - - return $this; - } - - /** - * Required. Field mask that specifies the fields in `bucket` that need an - * update. A bucket field will be overwritten if, and only if, it is in the - * update mask. `name` and output only fields cannot be updated. - * For a detailed `FieldMask` definition, see: - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * For example: `updateMask=retention_days` - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.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 that specifies the fields in `bucket` that need an - * update. A bucket field will be overwritten if, and only if, it is in the - * update mask. `name` and output only fields cannot be updated. - * For a detailed `FieldMask` definition, see: - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * For example: `updateMask=retention_days` - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.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/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateCmekSettingsRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateCmekSettingsRequest.php deleted file mode 100644 index 29cc0edeed5b..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateCmekSettingsRequest.php +++ /dev/null @@ -1,223 +0,0 @@ -google.logging.v2.UpdateCmekSettingsRequest - */ -class UpdateCmekSettingsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name for the CMEK settings to update. - * "projects/[PROJECT_ID]/cmekSettings" - * "organizations/[ORGANIZATION_ID]/cmekSettings" - * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" - * "folders/[FOLDER_ID]/cmekSettings" - * For example: - * `"organizations/12345/cmekSettings"` - * Note: CMEK for the Log Router can currently only be configured for Google - * Cloud organizations. Once configured, it applies to all projects and - * folders in the Google Cloud organization. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Required. The CMEK settings to update. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Generated from protobuf field .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cmek_settings = null; - /** - * Optional. Field mask identifying which fields from `cmek_settings` should - * be updated. A field will be overwritten if and only if it is in the update - * mask. Output only fields cannot be updated. - * See [FieldMask][google.protobuf.FieldMask] for more information. - * For example: `"updateMask=kmsKeyName"` - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name for the CMEK settings to update. - * "projects/[PROJECT_ID]/cmekSettings" - * "organizations/[ORGANIZATION_ID]/cmekSettings" - * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" - * "folders/[FOLDER_ID]/cmekSettings" - * For example: - * `"organizations/12345/cmekSettings"` - * Note: CMEK for the Log Router can currently only be configured for Google - * Cloud organizations. Once configured, it applies to all projects and - * folders in the Google Cloud organization. - * @type \Google\Cloud\Logging\V2\CmekSettings $cmek_settings - * Required. The CMEK settings to update. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Field mask identifying which fields from `cmek_settings` should - * be updated. A field will be overwritten if and only if it is in the update - * mask. Output only fields cannot be updated. - * See [FieldMask][google.protobuf.FieldMask] for more information. - * For example: `"updateMask=kmsKeyName"` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name for the CMEK settings to update. - * "projects/[PROJECT_ID]/cmekSettings" - * "organizations/[ORGANIZATION_ID]/cmekSettings" - * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" - * "folders/[FOLDER_ID]/cmekSettings" - * For example: - * `"organizations/12345/cmekSettings"` - * Note: CMEK for the Log Router can currently only be configured for Google - * Cloud organizations. Once configured, it applies to all projects and - * folders in the Google Cloud organization. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name for the CMEK settings to update. - * "projects/[PROJECT_ID]/cmekSettings" - * "organizations/[ORGANIZATION_ID]/cmekSettings" - * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" - * "folders/[FOLDER_ID]/cmekSettings" - * For example: - * `"organizations/12345/cmekSettings"` - * Note: CMEK for the Log Router can currently only be configured for Google - * Cloud organizations. Once configured, it applies to all projects and - * folders in the Google Cloud organization. - * - * 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 CMEK settings to update. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Generated from protobuf field .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Logging\V2\CmekSettings|null - */ - public function getCmekSettings() - { - return $this->cmek_settings; - } - - public function hasCmekSettings() - { - return isset($this->cmek_settings); - } - - public function clearCmekSettings() - { - unset($this->cmek_settings); - } - - /** - * Required. The CMEK settings to update. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Generated from protobuf field .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Logging\V2\CmekSettings $var - * @return $this - */ - public function setCmekSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\CmekSettings::class); - $this->cmek_settings = $var; - - return $this; - } - - /** - * Optional. Field mask identifying which fields from `cmek_settings` should - * be updated. A field will be overwritten if and only if it is in the update - * mask. Output only fields cannot be updated. - * See [FieldMask][google.protobuf.FieldMask] for more information. - * For example: `"updateMask=kmsKeyName"` - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.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 identifying which fields from `cmek_settings` should - * be updated. A field will be overwritten if and only if it is in the update - * mask. Output only fields cannot be updated. - * See [FieldMask][google.protobuf.FieldMask] for more information. - * For example: `"updateMask=kmsKeyName"` - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.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/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateExclusionRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateExclusionRequest.php deleted file mode 100644 index 890aea124e7b..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateExclusionRequest.php +++ /dev/null @@ -1,207 +0,0 @@ -google.logging.v2.UpdateExclusionRequest - */ -class UpdateExclusionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the exclusion to update: - * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - * For example: - * `"projects/my-project/exclusions/my-exclusion"` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. New values for the existing exclusion. Only the fields specified - * in `update_mask` are relevant. - * - * Generated from protobuf field .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $exclusion = null; - /** - * Required. A non-empty list of fields to change in the existing exclusion. - * New values for the fields are taken from the corresponding fields in the - * [LogExclusion][google.logging.v2.LogExclusion] included in this request. - * Fields not mentioned in `update_mask` are not changed and are ignored in - * the request. - * For example, to change the filter and description of an exclusion, - * specify an `update_mask` of `"filter,description"`. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the exclusion to update: - * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - * For example: - * `"projects/my-project/exclusions/my-exclusion"` - * @type \Google\Cloud\Logging\V2\LogExclusion $exclusion - * Required. New values for the existing exclusion. Only the fields specified - * in `update_mask` are relevant. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. A non-empty list of fields to change in the existing exclusion. - * New values for the fields are taken from the corresponding fields in the - * [LogExclusion][google.logging.v2.LogExclusion] included in this request. - * Fields not mentioned in `update_mask` are not changed and are ignored in - * the request. - * For example, to change the filter and description of an exclusion, - * specify an `update_mask` of `"filter,description"`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the exclusion to update: - * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - * For example: - * `"projects/my-project/exclusions/my-exclusion"` - * - * 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 exclusion to update: - * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - * For example: - * `"projects/my-project/exclusions/my-exclusion"` - * - * 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. New values for the existing exclusion. Only the fields specified - * in `update_mask` are relevant. - * - * Generated from protobuf field .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Logging\V2\LogExclusion|null - */ - public function getExclusion() - { - return $this->exclusion; - } - - public function hasExclusion() - { - return isset($this->exclusion); - } - - public function clearExclusion() - { - unset($this->exclusion); - } - - /** - * Required. New values for the existing exclusion. Only the fields specified - * in `update_mask` are relevant. - * - * Generated from protobuf field .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Logging\V2\LogExclusion $var - * @return $this - */ - public function setExclusion($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogExclusion::class); - $this->exclusion = $var; - - return $this; - } - - /** - * Required. A non-empty list of fields to change in the existing exclusion. - * New values for the fields are taken from the corresponding fields in the - * [LogExclusion][google.logging.v2.LogExclusion] included in this request. - * Fields not mentioned in `update_mask` are not changed and are ignored in - * the request. - * For example, to change the filter and description of an exclusion, - * specify an `update_mask` of `"filter,description"`. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.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. A non-empty list of fields to change in the existing exclusion. - * New values for the fields are taken from the corresponding fields in the - * [LogExclusion][google.logging.v2.LogExclusion] included in this request. - * Fields not mentioned in `update_mask` are not changed and are ignored in - * the request. - * For example, to change the filter and description of an exclusion, - * specify an `update_mask` of `"filter,description"`. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.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/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateLogMetricRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateLogMetricRequest.php deleted file mode 100644 index 5236c519607f..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateLogMetricRequest.php +++ /dev/null @@ -1,127 +0,0 @@ -google.logging.v2.UpdateLogMetricRequest - */ -class UpdateLogMetricRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the metric to update: - * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - * The updated metric must be provided in the request and it's - * `name` field must be the same as `[METRIC_ID]` If the metric - * does not exist in `[PROJECT_ID]`, then a new metric is created. - * - * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $metric_name = ''; - /** - * Required. The updated metric. - * - * Generated from protobuf field .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $metric = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $metric_name - * Required. The resource name of the metric to update: - * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - * The updated metric must be provided in the request and it's - * `name` field must be the same as `[METRIC_ID]` If the metric - * does not exist in `[PROJECT_ID]`, then a new metric is created. - * @type \Google\Cloud\Logging\V2\LogMetric $metric - * Required. The updated metric. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingMetrics::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the metric to update: - * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - * The updated metric must be provided in the request and it's - * `name` field must be the same as `[METRIC_ID]` If the metric - * does not exist in `[PROJECT_ID]`, then a new metric is created. - * - * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getMetricName() - { - return $this->metric_name; - } - - /** - * Required. The resource name of the metric to update: - * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - * The updated metric must be provided in the request and it's - * `name` field must be the same as `[METRIC_ID]` If the metric - * does not exist in `[PROJECT_ID]`, then a new metric is created. - * - * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setMetricName($var) - { - GPBUtil::checkString($var, True); - $this->metric_name = $var; - - return $this; - } - - /** - * Required. The updated metric. - * - * Generated from protobuf field .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Logging\V2\LogMetric|null - */ - public function getMetric() - { - return $this->metric; - } - - public function hasMetric() - { - return isset($this->metric); - } - - public function clearMetric() - { - unset($this->metric); - } - - /** - * Required. The updated metric. - * - * Generated from protobuf field .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Logging\V2\LogMetric $var - * @return $this - */ - public function setMetric($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogMetric::class); - $this->metric = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateSettingsRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateSettingsRequest.php deleted file mode 100644 index 6f410aa2c384..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateSettingsRequest.php +++ /dev/null @@ -1,211 +0,0 @@ -google.logging.v2.UpdateSettingsRequest - */ -class UpdateSettingsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name for the settings to update. - * "organizations/[ORGANIZATION_ID]/settings" - * For example: - * `"organizations/12345/settings"` - * Note: Settings for the Log Router can currently only be configured for - * Google Cloud organizations. Once configured, it applies to all projects and - * folders in the Google Cloud organization. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Required. The settings to update. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Generated from protobuf field .google.logging.v2.Settings settings = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $settings = null; - /** - * Optional. Field mask identifying which fields from `settings` should - * be updated. A field will be overwritten if and only if it is in the update - * mask. Output only fields cannot be updated. - * See [FieldMask][google.protobuf.FieldMask] for more information. - * For example: `"updateMask=kmsKeyName"` - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name for the settings to update. - * "organizations/[ORGANIZATION_ID]/settings" - * For example: - * `"organizations/12345/settings"` - * Note: Settings for the Log Router can currently only be configured for - * Google Cloud organizations. Once configured, it applies to all projects and - * folders in the Google Cloud organization. - * @type \Google\Cloud\Logging\V2\Settings $settings - * Required. The settings to update. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Field mask identifying which fields from `settings` should - * be updated. A field will be overwritten if and only if it is in the update - * mask. Output only fields cannot be updated. - * See [FieldMask][google.protobuf.FieldMask] for more information. - * For example: `"updateMask=kmsKeyName"` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name for the settings to update. - * "organizations/[ORGANIZATION_ID]/settings" - * For example: - * `"organizations/12345/settings"` - * Note: Settings for the Log Router can currently only be configured for - * Google Cloud organizations. Once configured, it applies to all projects and - * folders in the Google Cloud organization. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name for the settings to update. - * "organizations/[ORGANIZATION_ID]/settings" - * For example: - * `"organizations/12345/settings"` - * Note: Settings for the Log Router can currently only be configured for - * Google Cloud organizations. Once configured, it applies to all projects and - * folders in the Google Cloud organization. - * - * 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 settings to update. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Generated from protobuf field .google.logging.v2.Settings settings = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Logging\V2\Settings|null - */ - public function getSettings() - { - return $this->settings; - } - - public function hasSettings() - { - return isset($this->settings); - } - - public function clearSettings() - { - unset($this->settings); - } - - /** - * Required. The settings to update. - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Generated from protobuf field .google.logging.v2.Settings settings = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Logging\V2\Settings $var - * @return $this - */ - public function setSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\Settings::class); - $this->settings = $var; - - return $this; - } - - /** - * Optional. Field mask identifying which fields from `settings` should - * be updated. A field will be overwritten if and only if it is in the update - * mask. Output only fields cannot be updated. - * See [FieldMask][google.protobuf.FieldMask] for more information. - * For example: `"updateMask=kmsKeyName"` - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.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 identifying which fields from `settings` should - * be updated. A field will be overwritten if and only if it is in the update - * mask. Output only fields cannot be updated. - * See [FieldMask][google.protobuf.FieldMask] for more information. - * For example: `"updateMask=kmsKeyName"` - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.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/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateSinkRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateSinkRequest.php deleted file mode 100644 index a3ea6f1c69b4..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateSinkRequest.php +++ /dev/null @@ -1,297 +0,0 @@ -google.logging.v2.UpdateSinkRequest - */ -class UpdateSinkRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full resource name of the sink to update, including the - * parent resource and the sink identifier: - * "projects/[PROJECT_ID]/sinks/[SINK_ID]" - * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * For example: - * `"projects/my-project/sinks/my-sink"` - * - * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $sink_name = ''; - /** - * Required. The updated sink, whose name is the same identifier that appears - * as part of `sink_name`. - * - * Generated from protobuf field .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $sink = null; - /** - * Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] - * for a description of this field. When updating a sink, the effect of this - * field on the value of `writer_identity` in the updated sink depends on both - * the old and new values of this field: - * + If the old and new values of this field are both false or both true, - * then there is no change to the sink's `writer_identity`. - * + If the old value is false and the new value is true, then - * `writer_identity` is changed to a unique service account. - * + It is an error if the old value is true and the new value is - * set to false or defaulted to false. - * - * Generated from protobuf field bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $unique_writer_identity = false; - /** - * Optional. Field mask that specifies the fields in `sink` that need - * an update. A sink field will be overwritten if, and only if, it is - * in the update mask. `name` and output only fields cannot be updated. - * An empty `updateMask` is temporarily treated as using the following mask - * for backwards compatibility purposes: - * `destination,filter,includeChildren` - * At some point in the future, behavior will be removed and specifying an - * empty `updateMask` will be an error. - * For a detailed `FieldMask` definition, see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * For example: `updateMask=filter` - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $sink_name - * Required. The full resource name of the sink to update, including the - * parent resource and the sink identifier: - * "projects/[PROJECT_ID]/sinks/[SINK_ID]" - * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * For example: - * `"projects/my-project/sinks/my-sink"` - * @type \Google\Cloud\Logging\V2\LogSink $sink - * Required. The updated sink, whose name is the same identifier that appears - * as part of `sink_name`. - * @type bool $unique_writer_identity - * Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] - * for a description of this field. When updating a sink, the effect of this - * field on the value of `writer_identity` in the updated sink depends on both - * the old and new values of this field: - * + If the old and new values of this field are both false or both true, - * then there is no change to the sink's `writer_identity`. - * + If the old value is false and the new value is true, then - * `writer_identity` is changed to a unique service account. - * + It is an error if the old value is true and the new value is - * set to false or defaulted to false. - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Field mask that specifies the fields in `sink` that need - * an update. A sink field will be overwritten if, and only if, it is - * in the update mask. `name` and output only fields cannot be updated. - * An empty `updateMask` is temporarily treated as using the following mask - * for backwards compatibility purposes: - * `destination,filter,includeChildren` - * At some point in the future, behavior will be removed and specifying an - * empty `updateMask` will be an error. - * For a detailed `FieldMask` definition, see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * For example: `updateMask=filter` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full resource name of the sink to update, including the - * parent resource and the sink identifier: - * "projects/[PROJECT_ID]/sinks/[SINK_ID]" - * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * For example: - * `"projects/my-project/sinks/my-sink"` - * - * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getSinkName() - { - return $this->sink_name; - } - - /** - * Required. The full resource name of the sink to update, including the - * parent resource and the sink identifier: - * "projects/[PROJECT_ID]/sinks/[SINK_ID]" - * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * For example: - * `"projects/my-project/sinks/my-sink"` - * - * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSinkName($var) - { - GPBUtil::checkString($var, True); - $this->sink_name = $var; - - return $this; - } - - /** - * Required. The updated sink, whose name is the same identifier that appears - * as part of `sink_name`. - * - * Generated from protobuf field .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Logging\V2\LogSink|null - */ - public function getSink() - { - return $this->sink; - } - - public function hasSink() - { - return isset($this->sink); - } - - public function clearSink() - { - unset($this->sink); - } - - /** - * Required. The updated sink, whose name is the same identifier that appears - * as part of `sink_name`. - * - * Generated from protobuf field .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Logging\V2\LogSink $var - * @return $this - */ - public function setSink($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogSink::class); - $this->sink = $var; - - return $this; - } - - /** - * Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] - * for a description of this field. When updating a sink, the effect of this - * field on the value of `writer_identity` in the updated sink depends on both - * the old and new values of this field: - * + If the old and new values of this field are both false or both true, - * then there is no change to the sink's `writer_identity`. - * + If the old value is false and the new value is true, then - * `writer_identity` is changed to a unique service account. - * + It is an error if the old value is true and the new value is - * set to false or defaulted to false. - * - * Generated from protobuf field bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getUniqueWriterIdentity() - { - return $this->unique_writer_identity; - } - - /** - * Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] - * for a description of this field. When updating a sink, the effect of this - * field on the value of `writer_identity` in the updated sink depends on both - * the old and new values of this field: - * + If the old and new values of this field are both false or both true, - * then there is no change to the sink's `writer_identity`. - * + If the old value is false and the new value is true, then - * `writer_identity` is changed to a unique service account. - * + It is an error if the old value is true and the new value is - * set to false or defaulted to false. - * - * Generated from protobuf field bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setUniqueWriterIdentity($var) - { - GPBUtil::checkBool($var); - $this->unique_writer_identity = $var; - - return $this; - } - - /** - * Optional. Field mask that specifies the fields in `sink` that need - * an update. A sink field will be overwritten if, and only if, it is - * in the update mask. `name` and output only fields cannot be updated. - * An empty `updateMask` is temporarily treated as using the following mask - * for backwards compatibility purposes: - * `destination,filter,includeChildren` - * At some point in the future, behavior will be removed and specifying an - * empty `updateMask` will be an error. - * For a detailed `FieldMask` definition, see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * For example: `updateMask=filter` - * - * 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. Field mask that specifies the fields in `sink` that need - * an update. A sink field will be overwritten if, and only if, it is - * in the update mask. `name` and output only fields cannot be updated. - * An empty `updateMask` is temporarily treated as using the following mask - * for backwards compatibility purposes: - * `destination,filter,includeChildren` - * At some point in the future, behavior will be removed and specifying an - * empty `updateMask` will be an error. - * For a detailed `FieldMask` definition, see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * For example: `updateMask=filter` - * - * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateViewRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateViewRequest.php deleted file mode 100644 index 1058f7b4409d..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/UpdateViewRequest.php +++ /dev/null @@ -1,187 +0,0 @@ -google.logging.v2.UpdateViewRequest - */ -class UpdateViewRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full resource name of the view to update - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Required. The updated view. - * - * Generated from protobuf field .google.logging.v2.LogView view = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $view = null; - /** - * Optional. Field mask that specifies the fields in `view` that need - * an update. A field will be overwritten if, and only if, it is - * in the update mask. `name` and output only fields cannot be updated. - * For a detailed `FieldMask` definition, see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * For example: `updateMask=filter` - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The full resource name of the view to update - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` - * @type \Google\Cloud\Logging\V2\LogView $view - * Required. The updated view. - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Field mask that specifies the fields in `view` that need - * an update. A field will be overwritten if, and only if, it is - * in the update mask. `name` and output only fields cannot be updated. - * For a detailed `FieldMask` definition, see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * For example: `updateMask=filter` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full resource name of the view to update - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The full resource name of the view to update - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * For example: - * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` - * - * 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 updated view. - * - * Generated from protobuf field .google.logging.v2.LogView view = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Logging\V2\LogView|null - */ - public function getView() - { - return $this->view; - } - - public function hasView() - { - return isset($this->view); - } - - public function clearView() - { - unset($this->view); - } - - /** - * Required. The updated view. - * - * Generated from protobuf field .google.logging.v2.LogView view = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Logging\V2\LogView $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogView::class); - $this->view = $var; - - return $this; - } - - /** - * Optional. Field mask that specifies the fields in `view` that need - * an update. A field will be overwritten if, and only if, it is - * in the update mask. `name` and output only fields cannot be updated. - * For a detailed `FieldMask` definition, see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * For example: `updateMask=filter` - * - * 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. Field mask that specifies the fields in `view` that need - * an update. A field will be overwritten if, and only if, it is - * in the update mask. `name` and output only fields cannot be updated. - * For a detailed `FieldMask` definition, see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * For example: `updateMask=filter` - * - * 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/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesPartialErrors.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesPartialErrors.php deleted file mode 100644 index 7ff395ccb489..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesPartialErrors.php +++ /dev/null @@ -1,83 +0,0 @@ -google.logging.v2.WriteLogEntriesPartialErrors - */ -class WriteLogEntriesPartialErrors extends \Google\Protobuf\Internal\Message -{ - /** - * When `WriteLogEntriesRequest.partial_success` is true, records the error - * status for entries that were not written due to a permanent error, keyed - * by the entry's zero-based index in `WriteLogEntriesRequest.entries`. - * Failed requests for which no entries are written will not include - * per-entry errors. - * - * Generated from protobuf field map log_entry_errors = 1; - */ - private $log_entry_errors; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\MapField $log_entry_errors - * When `WriteLogEntriesRequest.partial_success` is true, records the error - * status for entries that were not written due to a permanent error, keyed - * by the entry's zero-based index in `WriteLogEntriesRequest.entries`. - * Failed requests for which no entries are written will not include - * per-entry errors. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\Logging::initOnce(); - parent::__construct($data); - } - - /** - * When `WriteLogEntriesRequest.partial_success` is true, records the error - * status for entries that were not written due to a permanent error, keyed - * by the entry's zero-based index in `WriteLogEntriesRequest.entries`. - * Failed requests for which no entries are written will not include - * per-entry errors. - * - * Generated from protobuf field map log_entry_errors = 1; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLogEntryErrors() - { - return $this->log_entry_errors; - } - - /** - * When `WriteLogEntriesRequest.partial_success` is true, records the error - * status for entries that were not written due to a permanent error, keyed - * by the entry's zero-based index in `WriteLogEntriesRequest.entries`. - * Failed requests for which no entries are written will not include - * per-entry errors. - * - * Generated from protobuf field map log_entry_errors = 1; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLogEntryErrors($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::INT32, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); - $this->log_entry_errors = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesRequest.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesRequest.php deleted file mode 100644 index b692c454f128..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesRequest.php +++ /dev/null @@ -1,439 +0,0 @@ -google.logging.v2.WriteLogEntriesRequest - */ -class WriteLogEntriesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. A default log resource name that is assigned to all log entries - * in `entries` that do not specify a value for `log_name`: - * * `projects/[PROJECT_ID]/logs/[LOG_ID]` - * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` - * * `folders/[FOLDER_ID]/logs/[LOG_ID]` - * `[LOG_ID]` must be URL-encoded. For example: - * "projects/my-project-id/logs/syslog" - * "organizations/123/logs/cloudaudit.googleapis.com%2Factivity" - * The permission `logging.logEntries.create` is needed on each project, - * organization, billing account, or folder that is receiving new log - * entries, whether the resource is specified in `logName` or in an - * individual log entry. - * - * Generated from protobuf field string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $log_name = ''; - /** - * Optional. A default monitored resource object that is assigned to all log - * entries in `entries` that do not specify a value for `resource`. Example: - * { "type": "gce_instance", - * "labels": { - * "zone": "us-central1-a", "instance_id": "00000000000000000000" }} - * See [LogEntry][google.logging.v2.LogEntry]. - * - * Generated from protobuf field .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $resource = null; - /** - * Optional. Default labels that are added to the `labels` field of all log - * entries in `entries`. If a log entry already has a label with the same key - * as a label in this parameter, then the log entry's label is not changed. - * See [LogEntry][google.logging.v2.LogEntry]. - * - * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - /** - * Required. The log entries to send to Logging. The order of log - * entries in this list does not matter. Values supplied in this method's - * `log_name`, `resource`, and `labels` fields are copied into those log - * entries in this list that do not include values for their corresponding - * fields. For more information, see the - * [LogEntry][google.logging.v2.LogEntry] type. - * If the `timestamp` or `insert_id` fields are missing in log entries, then - * this method supplies the current time or a unique identifier, respectively. - * The supplied values are chosen so that, among the log entries that did not - * supply their own values, the entries earlier in the list will sort before - * the entries later in the list. See the `entries.list` method. - * Log entries with timestamps that are more than the - * [logs retention period](https://cloud.google.com/logging/quotas) in - * the past or more than 24 hours in the future will not be available when - * calling `entries.list`. However, those log entries can still be [exported - * with - * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). - * To improve throughput and to avoid exceeding the - * [quota limit](https://cloud.google.com/logging/quotas) for calls to - * `entries.write`, you should try to include several log entries in this - * list, rather than calling this method for each individual log entry. - * - * Generated from protobuf field repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - private $entries; - /** - * Optional. Whether a batch's valid entries should be written even if some - * other entry failed due to a permanent error such as INVALID_ARGUMENT or - * PERMISSION_DENIED. If any entry failed, then the response status is the - * response status of one of the failed entries. The response will include - * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by - * the entries' zero-based index in the `entries`. Failed requests for which - * no entries are written will not include per-entry errors. - * - * Generated from protobuf field bool partial_success = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $partial_success = false; - /** - * Optional. If true, the request should expect normal response, but the - * entries won't be persisted nor exported. Useful for checking whether the - * logging API endpoints are working properly before sending valuable data. - * - * Generated from protobuf field bool dry_run = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $dry_run = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $log_name - * Optional. A default log resource name that is assigned to all log entries - * in `entries` that do not specify a value for `log_name`: - * * `projects/[PROJECT_ID]/logs/[LOG_ID]` - * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` - * * `folders/[FOLDER_ID]/logs/[LOG_ID]` - * `[LOG_ID]` must be URL-encoded. For example: - * "projects/my-project-id/logs/syslog" - * "organizations/123/logs/cloudaudit.googleapis.com%2Factivity" - * The permission `logging.logEntries.create` is needed on each project, - * organization, billing account, or folder that is receiving new log - * entries, whether the resource is specified in `logName` or in an - * individual log entry. - * @type \Google\Api\MonitoredResource $resource - * Optional. A default monitored resource object that is assigned to all log - * entries in `entries` that do not specify a value for `resource`. Example: - * { "type": "gce_instance", - * "labels": { - * "zone": "us-central1-a", "instance_id": "00000000000000000000" }} - * See [LogEntry][google.logging.v2.LogEntry]. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. Default labels that are added to the `labels` field of all log - * entries in `entries`. If a log entry already has a label with the same key - * as a label in this parameter, then the log entry's label is not changed. - * See [LogEntry][google.logging.v2.LogEntry]. - * @type array<\Google\Cloud\Logging\V2\LogEntry>|\Google\Protobuf\Internal\RepeatedField $entries - * Required. The log entries to send to Logging. The order of log - * entries in this list does not matter. Values supplied in this method's - * `log_name`, `resource`, and `labels` fields are copied into those log - * entries in this list that do not include values for their corresponding - * fields. For more information, see the - * [LogEntry][google.logging.v2.LogEntry] type. - * If the `timestamp` or `insert_id` fields are missing in log entries, then - * this method supplies the current time or a unique identifier, respectively. - * The supplied values are chosen so that, among the log entries that did not - * supply their own values, the entries earlier in the list will sort before - * the entries later in the list. See the `entries.list` method. - * Log entries with timestamps that are more than the - * [logs retention period](https://cloud.google.com/logging/quotas) in - * the past or more than 24 hours in the future will not be available when - * calling `entries.list`. However, those log entries can still be [exported - * with - * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). - * To improve throughput and to avoid exceeding the - * [quota limit](https://cloud.google.com/logging/quotas) for calls to - * `entries.write`, you should try to include several log entries in this - * list, rather than calling this method for each individual log entry. - * @type bool $partial_success - * Optional. Whether a batch's valid entries should be written even if some - * other entry failed due to a permanent error such as INVALID_ARGUMENT or - * PERMISSION_DENIED. If any entry failed, then the response status is the - * response status of one of the failed entries. The response will include - * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by - * the entries' zero-based index in the `entries`. Failed requests for which - * no entries are written will not include per-entry errors. - * @type bool $dry_run - * Optional. If true, the request should expect normal response, but the - * entries won't be persisted nor exported. Useful for checking whether the - * logging API endpoints are working properly before sending valuable data. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\Logging::initOnce(); - parent::__construct($data); - } - - /** - * Optional. A default log resource name that is assigned to all log entries - * in `entries` that do not specify a value for `log_name`: - * * `projects/[PROJECT_ID]/logs/[LOG_ID]` - * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` - * * `folders/[FOLDER_ID]/logs/[LOG_ID]` - * `[LOG_ID]` must be URL-encoded. For example: - * "projects/my-project-id/logs/syslog" - * "organizations/123/logs/cloudaudit.googleapis.com%2Factivity" - * The permission `logging.logEntries.create` is needed on each project, - * organization, billing account, or folder that is receiving new log - * entries, whether the resource is specified in `logName` or in an - * individual log entry. - * - * Generated from protobuf field string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getLogName() - { - return $this->log_name; - } - - /** - * Optional. A default log resource name that is assigned to all log entries - * in `entries` that do not specify a value for `log_name`: - * * `projects/[PROJECT_ID]/logs/[LOG_ID]` - * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` - * * `folders/[FOLDER_ID]/logs/[LOG_ID]` - * `[LOG_ID]` must be URL-encoded. For example: - * "projects/my-project-id/logs/syslog" - * "organizations/123/logs/cloudaudit.googleapis.com%2Factivity" - * The permission `logging.logEntries.create` is needed on each project, - * organization, billing account, or folder that is receiving new log - * entries, whether the resource is specified in `logName` or in an - * individual log entry. - * - * Generated from protobuf field string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setLogName($var) - { - GPBUtil::checkString($var, True); - $this->log_name = $var; - - return $this; - } - - /** - * Optional. A default monitored resource object that is assigned to all log - * entries in `entries` that do not specify a value for `resource`. Example: - * { "type": "gce_instance", - * "labels": { - * "zone": "us-central1-a", "instance_id": "00000000000000000000" }} - * See [LogEntry][google.logging.v2.LogEntry]. - * - * Generated from protobuf field .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Api\MonitoredResource|null - */ - public function getResource() - { - return $this->resource; - } - - public function hasResource() - { - return isset($this->resource); - } - - public function clearResource() - { - unset($this->resource); - } - - /** - * Optional. A default monitored resource object that is assigned to all log - * entries in `entries` that do not specify a value for `resource`. Example: - * { "type": "gce_instance", - * "labels": { - * "zone": "us-central1-a", "instance_id": "00000000000000000000" }} - * See [LogEntry][google.logging.v2.LogEntry]. - * - * Generated from protobuf field .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Api\MonitoredResource $var - * @return $this - */ - public function setResource($var) - { - GPBUtil::checkMessage($var, \Google\Api\MonitoredResource::class); - $this->resource = $var; - - return $this; - } - - /** - * Optional. Default labels that are added to the `labels` field of all log - * entries in `entries`. If a log entry already has a label with the same key - * as a label in this parameter, then the log entry's label is not changed. - * See [LogEntry][google.logging.v2.LogEntry]. - * - * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. Default labels that are added to the `labels` field of all log - * entries in `entries`. If a log entry already has a label with the same key - * as a label in this parameter, then the log entry's label is not changed. - * See [LogEntry][google.logging.v2.LogEntry]. - * - * 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; - } - - /** - * Required. The log entries to send to Logging. The order of log - * entries in this list does not matter. Values supplied in this method's - * `log_name`, `resource`, and `labels` fields are copied into those log - * entries in this list that do not include values for their corresponding - * fields. For more information, see the - * [LogEntry][google.logging.v2.LogEntry] type. - * If the `timestamp` or `insert_id` fields are missing in log entries, then - * this method supplies the current time or a unique identifier, respectively. - * The supplied values are chosen so that, among the log entries that did not - * supply their own values, the entries earlier in the list will sort before - * the entries later in the list. See the `entries.list` method. - * Log entries with timestamps that are more than the - * [logs retention period](https://cloud.google.com/logging/quotas) in - * the past or more than 24 hours in the future will not be available when - * calling `entries.list`. However, those log entries can still be [exported - * with - * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). - * To improve throughput and to avoid exceeding the - * [quota limit](https://cloud.google.com/logging/quotas) for calls to - * `entries.write`, you should try to include several log entries in this - * list, rather than calling this method for each individual log entry. - * - * Generated from protobuf field repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEntries() - { - return $this->entries; - } - - /** - * Required. The log entries to send to Logging. The order of log - * entries in this list does not matter. Values supplied in this method's - * `log_name`, `resource`, and `labels` fields are copied into those log - * entries in this list that do not include values for their corresponding - * fields. For more information, see the - * [LogEntry][google.logging.v2.LogEntry] type. - * If the `timestamp` or `insert_id` fields are missing in log entries, then - * this method supplies the current time or a unique identifier, respectively. - * The supplied values are chosen so that, among the log entries that did not - * supply their own values, the entries earlier in the list will sort before - * the entries later in the list. See the `entries.list` method. - * Log entries with timestamps that are more than the - * [logs retention period](https://cloud.google.com/logging/quotas) in - * the past or more than 24 hours in the future will not be available when - * calling `entries.list`. However, those log entries can still be [exported - * with - * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). - * To improve throughput and to avoid exceeding the - * [quota limit](https://cloud.google.com/logging/quotas) for calls to - * `entries.write`, you should try to include several log entries in this - * list, rather than calling this method for each individual log entry. - * - * Generated from protobuf field repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param array<\Google\Cloud\Logging\V2\LogEntry>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEntries($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogEntry::class); - $this->entries = $arr; - - return $this; - } - - /** - * Optional. Whether a batch's valid entries should be written even if some - * other entry failed due to a permanent error such as INVALID_ARGUMENT or - * PERMISSION_DENIED. If any entry failed, then the response status is the - * response status of one of the failed entries. The response will include - * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by - * the entries' zero-based index in the `entries`. Failed requests for which - * no entries are written will not include per-entry errors. - * - * Generated from protobuf field bool partial_success = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getPartialSuccess() - { - return $this->partial_success; - } - - /** - * Optional. Whether a batch's valid entries should be written even if some - * other entry failed due to a permanent error such as INVALID_ARGUMENT or - * PERMISSION_DENIED. If any entry failed, then the response status is the - * response status of one of the failed entries. The response will include - * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by - * the entries' zero-based index in the `entries`. Failed requests for which - * no entries are written will not include per-entry errors. - * - * Generated from protobuf field bool partial_success = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setPartialSuccess($var) - { - GPBUtil::checkBool($var); - $this->partial_success = $var; - - return $this; - } - - /** - * Optional. If true, the request should expect normal response, but the - * entries won't be persisted nor exported. Useful for checking whether the - * logging API endpoints are working properly before sending valuable data. - * - * Generated from protobuf field bool dry_run = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getDryRun() - { - return $this->dry_run; - } - - /** - * Optional. If true, the request should expect normal response, but the - * entries won't be persisted nor exported. Useful for checking whether the - * logging API endpoints are working properly before sending valuable data. - * - * Generated from protobuf field bool dry_run = 6 [(.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/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesResponse.php b/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesResponse.php deleted file mode 100644 index 006dcaf82055..000000000000 --- a/owl-bot-staging/Logging/v2/proto/src/Google/Cloud/Logging/V2/WriteLogEntriesResponse.php +++ /dev/null @@ -1,33 +0,0 @@ -google.logging.v2.WriteLogEntriesResponse - */ -class WriteLogEntriesResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Logging\V2\Logging::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/copy_log_entries.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/copy_log_entries.php deleted file mode 100644 index 5234133bcf86..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/copy_log_entries.php +++ /dev/null @@ -1,83 +0,0 @@ -copyLogEntries($name, $destination); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var CopyLogEntriesResponse $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]'; - $destination = '[DESTINATION]'; - - copy_log_entries_sample($name, $destination); -} -// [END logging_v2_generated_ConfigServiceV2_CopyLogEntries_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_bucket.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_bucket.php deleted file mode 100644 index e1112e178d83..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_bucket.php +++ /dev/null @@ -1,80 +0,0 @@ -createBucket($formattedParent, $bucketId, $bucket); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - 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 = ConfigServiceV2Client::organizationLocationName('[ORGANIZATION]', '[LOCATION]'); - $bucketId = '[BUCKET_ID]'; - - create_bucket_sample($formattedParent, $bucketId); -} -// [END logging_v2_generated_ConfigServiceV2_CreateBucket_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_exclusion.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_exclusion.php deleted file mode 100644 index 915057c7dc25..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_exclusion.php +++ /dev/null @@ -1,102 +0,0 @@ -setName($exclusionName) - ->setFilter($exclusionFilter); - - // Call the API and handle any network failures. - try { - /** @var LogExclusion $response */ - $response = $configServiceV2Client->createExclusion($formattedParent, $exclusion); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - 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 = ConfigServiceV2Client::projectName('[PROJECT]'); - $exclusionName = '[NAME]'; - $exclusionFilter = '[FILTER]'; - - create_exclusion_sample($formattedParent, $exclusionName, $exclusionFilter); -} -// [END logging_v2_generated_ConfigServiceV2_CreateExclusion_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_sink.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_sink.php deleted file mode 100644 index 375c4761e9a8..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_sink.php +++ /dev/null @@ -1,106 +0,0 @@ -setName($sinkName) - ->setDestination($sinkDestination); - - // Call the API and handle any network failures. - try { - /** @var LogSink $response */ - $response = $configServiceV2Client->createSink($formattedParent, $sink); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - 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 = ConfigServiceV2Client::projectName('[PROJECT]'); - $sinkName = '[NAME]'; - $sinkDestination = '[DESTINATION]'; - - create_sink_sample($formattedParent, $sinkName, $sinkDestination); -} -// [END logging_v2_generated_ConfigServiceV2_CreateSink_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_view.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_view.php deleted file mode 100644 index b76c064d0d21..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/create_view.php +++ /dev/null @@ -1,79 +0,0 @@ -createView($parent, $viewId, $view); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - 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]'; - $viewId = '[VIEW_ID]'; - - create_view_sample($parent, $viewId); -} -// [END logging_v2_generated_ConfigServiceV2_CreateView_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_bucket.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_bucket.php deleted file mode 100644 index 8f34265aa899..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_bucket.php +++ /dev/null @@ -1,77 +0,0 @@ -deleteBucket($formattedName); - 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 = ConfigServiceV2Client::logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - - delete_bucket_sample($formattedName); -} -// [END logging_v2_generated_ConfigServiceV2_DeleteBucket_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_exclusion.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_exclusion.php deleted file mode 100644 index 2491c77e24f6..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_exclusion.php +++ /dev/null @@ -1,73 +0,0 @@ -deleteExclusion($formattedName); - 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 = ConfigServiceV2Client::logExclusionName('[PROJECT]', '[EXCLUSION]'); - - delete_exclusion_sample($formattedName); -} -// [END logging_v2_generated_ConfigServiceV2_DeleteExclusion_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_sink.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_sink.php deleted file mode 100644 index 48b1dd0a3598..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_sink.php +++ /dev/null @@ -1,75 +0,0 @@ -deleteSink($formattedSinkName); - 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 -{ - $formattedSinkName = ConfigServiceV2Client::logSinkName('[PROJECT]', '[SINK]'); - - delete_sink_sample($formattedSinkName); -} -// [END logging_v2_generated_ConfigServiceV2_DeleteSink_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_view.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_view.php deleted file mode 100644 index 50ad44896b9f..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/delete_view.php +++ /dev/null @@ -1,78 +0,0 @@ -deleteView($formattedName); - 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 = ConfigServiceV2Client::logViewName( - '[PROJECT]', - '[LOCATION]', - '[BUCKET]', - '[VIEW]' - ); - - delete_view_sample($formattedName); -} -// [END logging_v2_generated_ConfigServiceV2_DeleteView_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_bucket.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_bucket.php deleted file mode 100644 index 9c8d0317d0c0..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_bucket.php +++ /dev/null @@ -1,75 +0,0 @@ -getBucket($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - 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 = ConfigServiceV2Client::logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - - get_bucket_sample($formattedName); -} -// [END logging_v2_generated_ConfigServiceV2_GetBucket_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_cmek_settings.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_cmek_settings.php deleted file mode 100644 index b33229bac7e7..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_cmek_settings.php +++ /dev/null @@ -1,62 +0,0 @@ -getCmekSettings(); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END logging_v2_generated_ConfigServiceV2_GetCmekSettings_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_exclusion.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_exclusion.php deleted file mode 100644 index 3d5bf7aeea32..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_exclusion.php +++ /dev/null @@ -1,75 +0,0 @@ -getExclusion($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - 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 = ConfigServiceV2Client::logExclusionName('[PROJECT]', '[EXCLUSION]'); - - get_exclusion_sample($formattedName); -} -// [END logging_v2_generated_ConfigServiceV2_GetExclusion_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_settings.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_settings.php deleted file mode 100644 index 7d49c190e210..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_settings.php +++ /dev/null @@ -1,89 +0,0 @@ -getSettings($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - 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 = ConfigServiceV2Client::settingsName('[PROJECT]'); - - get_settings_sample($formattedName); -} -// [END logging_v2_generated_ConfigServiceV2_GetSettings_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_sink.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_sink.php deleted file mode 100644 index 3302fd369a33..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_sink.php +++ /dev/null @@ -1,75 +0,0 @@ -getSink($formattedSinkName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedSinkName = ConfigServiceV2Client::logSinkName('[PROJECT]', '[SINK]'); - - get_sink_sample($formattedSinkName); -} -// [END logging_v2_generated_ConfigServiceV2_GetSink_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_view.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_view.php deleted file mode 100644 index 3473f3433474..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/get_view.php +++ /dev/null @@ -1,77 +0,0 @@ -getView($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - 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 = ConfigServiceV2Client::logViewName( - '[PROJECT]', - '[LOCATION]', - '[BUCKET]', - '[VIEW]' - ); - - get_view_sample($formattedName); -} -// [END logging_v2_generated_ConfigServiceV2_GetView_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_buckets.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_buckets.php deleted file mode 100644 index 2491b879b177..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_buckets.php +++ /dev/null @@ -1,80 +0,0 @@ -listBuckets($formattedParent); - - /** @var LogBucket $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 = ConfigServiceV2Client::organizationLocationName('[ORGANIZATION]', '[LOCATION]'); - - list_buckets_sample($formattedParent); -} -// [END logging_v2_generated_ConfigServiceV2_ListBuckets_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_exclusions.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_exclusions.php deleted file mode 100644 index bb0036617b43..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_exclusions.php +++ /dev/null @@ -1,76 +0,0 @@ -listExclusions($formattedParent); - - /** @var LogExclusion $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 = ConfigServiceV2Client::projectName('[PROJECT]'); - - list_exclusions_sample($formattedParent); -} -// [END logging_v2_generated_ConfigServiceV2_ListExclusions_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_sinks.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_sinks.php deleted file mode 100644 index f7668bcf5619..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_sinks.php +++ /dev/null @@ -1,76 +0,0 @@ -listSinks($formattedParent); - - /** @var LogSink $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 = ConfigServiceV2Client::projectName('[PROJECT]'); - - list_sinks_sample($formattedParent); -} -// [END logging_v2_generated_ConfigServiceV2_ListSinks_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_views.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_views.php deleted file mode 100644 index bd7d34d2fd59..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/list_views.php +++ /dev/null @@ -1,72 +0,0 @@ -listViews($parent); - - /** @var LogView $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_views_sample($parent); -} -// [END logging_v2_generated_ConfigServiceV2_ListViews_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/undelete_bucket.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/undelete_bucket.php deleted file mode 100644 index 1890823207ae..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/undelete_bucket.php +++ /dev/null @@ -1,74 +0,0 @@ -undeleteBucket($formattedName); - 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 = ConfigServiceV2Client::logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - - undelete_bucket_sample($formattedName); -} -// [END logging_v2_generated_ConfigServiceV2_UndeleteBucket_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_bucket.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_bucket.php deleted file mode 100644 index 1cd46f881164..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_bucket.php +++ /dev/null @@ -1,85 +0,0 @@ -updateBucket($formattedName, $bucket, $updateMask); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - 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 = ConfigServiceV2Client::logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - - update_bucket_sample($formattedName); -} -// [END logging_v2_generated_ConfigServiceV2_UpdateBucket_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_cmek_settings.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_cmek_settings.php deleted file mode 100644 index 2d924f8c272c..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_cmek_settings.php +++ /dev/null @@ -1,67 +0,0 @@ -updateCmekSettings(); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END logging_v2_generated_ConfigServiceV2_UpdateCmekSettings_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_exclusion.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_exclusion.php deleted file mode 100644 index 28f227546709..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_exclusion.php +++ /dev/null @@ -1,102 +0,0 @@ -setName($exclusionName) - ->setFilter($exclusionFilter); - $updateMask = new FieldMask(); - - // Call the API and handle any network failures. - try { - /** @var LogExclusion $response */ - $response = $configServiceV2Client->updateExclusion($formattedName, $exclusion, $updateMask); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - 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 = ConfigServiceV2Client::logExclusionName('[PROJECT]', '[EXCLUSION]'); - $exclusionName = '[NAME]'; - $exclusionFilter = '[FILTER]'; - - update_exclusion_sample($formattedName, $exclusionName, $exclusionFilter); -} -// [END logging_v2_generated_ConfigServiceV2_UpdateExclusion_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_settings.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_settings.php deleted file mode 100644 index 5021dc20e44d..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_settings.php +++ /dev/null @@ -1,93 +0,0 @@ -updateSettings($name, $settings); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - 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]'; - - update_settings_sample($name); -} -// [END logging_v2_generated_ConfigServiceV2_UpdateSettings_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_sink.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_sink.php deleted file mode 100644 index 9e83e5dc2901..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_sink.php +++ /dev/null @@ -1,107 +0,0 @@ -setName($sinkName) - ->setDestination($sinkDestination); - - // Call the API and handle any network failures. - try { - /** @var LogSink $response */ - $response = $configServiceV2Client->updateSink($formattedSinkName, $sink); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedSinkName = ConfigServiceV2Client::logSinkName('[PROJECT]', '[SINK]'); - $sinkName = '[NAME]'; - $sinkDestination = '[DESTINATION]'; - - update_sink_sample($formattedSinkName, $sinkName, $sinkDestination); -} -// [END logging_v2_generated_ConfigServiceV2_UpdateSink_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_view.php b/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_view.php deleted file mode 100644 index da603e9f4c8a..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/ConfigServiceV2Client/update_view.php +++ /dev/null @@ -1,78 +0,0 @@ -updateView($name, $view); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - 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]'; - - update_view_sample($name); -} -// [END logging_v2_generated_ConfigServiceV2_UpdateView_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/delete_log.php b/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/delete_log.php deleted file mode 100644 index 813c0f3e4b65..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/delete_log.php +++ /dev/null @@ -1,79 +0,0 @@ -deleteLog($formattedLogName); - 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 -{ - $formattedLogName = LoggingServiceV2Client::logName('[PROJECT]', '[LOG]'); - - delete_log_sample($formattedLogName); -} -// [END logging_v2_generated_LoggingServiceV2_DeleteLog_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_log_entries.php b/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_log_entries.php deleted file mode 100644 index 11ecf1f1c9a2..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_log_entries.php +++ /dev/null @@ -1,93 +0,0 @@ -listLogEntries($formattedResourceNames); - - /** @var LogEntry $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 -{ - $formattedResourceNamesElement = LoggingServiceV2Client::projectName('[PROJECT]'); - - list_log_entries_sample($formattedResourceNamesElement); -} -// [END logging_v2_generated_LoggingServiceV2_ListLogEntries_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_logs.php b/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_logs.php deleted file mode 100644 index dc830797e63e..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_logs.php +++ /dev/null @@ -1,76 +0,0 @@ -listLogs($formattedParent); - - /** @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 -{ - $formattedParent = LoggingServiceV2Client::projectName('[PROJECT]'); - - list_logs_sample($formattedParent); -} -// [END logging_v2_generated_LoggingServiceV2_ListLogs_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_monitored_resource_descriptors.php b/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_monitored_resource_descriptors.php deleted file mode 100644 index 0f4961127543..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/list_monitored_resource_descriptors.php +++ /dev/null @@ -1,58 +0,0 @@ -listMonitoredResourceDescriptors(); - - /** @var MonitoredResourceDescriptor $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 logging_v2_generated_LoggingServiceV2_ListMonitoredResourceDescriptors_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/tail_log_entries.php b/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/tail_log_entries.php deleted file mode 100644 index 3afb4406b571..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/tail_log_entries.php +++ /dev/null @@ -1,90 +0,0 @@ -setResourceNames($resourceNames); - - // Call the API and handle any network failures. - try { - /** @var BidiStream $stream */ - $stream = $loggingServiceV2Client->tailLogEntries(); - $stream->writeAll([$request,]); - - /** @var TailLogEntriesResponse $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 -{ - $resourceNamesElement = '[RESOURCE_NAMES]'; - - tail_log_entries_sample($resourceNamesElement); -} -// [END logging_v2_generated_LoggingServiceV2_TailLogEntries_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/write_log_entries.php b/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/write_log_entries.php deleted file mode 100644 index e2fc147a12f4..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/LoggingServiceV2Client/write_log_entries.php +++ /dev/null @@ -1,102 +0,0 @@ -setLogName($entriesLogName) - ->setResource($entriesResource); - $entries = [$logEntry,]; - - // Call the API and handle any network failures. - try { - /** @var WriteLogEntriesResponse $response */ - $response = $loggingServiceV2Client->writeLogEntries($entries); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $entriesLogName = '[LOG_NAME]'; - - write_log_entries_sample($entriesLogName); -} -// [END logging_v2_generated_LoggingServiceV2_WriteLogEntries_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/create_log_metric.php b/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/create_log_metric.php deleted file mode 100644 index a873a9f9639e..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/create_log_metric.php +++ /dev/null @@ -1,100 +0,0 @@ -=ERROR" - * - * The maximum length of the filter is 20000 characters. - */ -function create_log_metric_sample( - string $formattedParent, - string $metricName, - string $metricFilter -): void { - // Create a client. - $metricsServiceV2Client = new MetricsServiceV2Client(); - - // Prepare any non-scalar elements to be passed along with the request. - $metric = (new LogMetric()) - ->setName($metricName) - ->setFilter($metricFilter); - - // Call the API and handle any network failures. - try { - /** @var LogMetric $response */ - $response = $metricsServiceV2Client->createLogMetric($formattedParent, $metric); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - 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 = MetricsServiceV2Client::projectName('[PROJECT]'); - $metricName = '[NAME]'; - $metricFilter = '[FILTER]'; - - create_log_metric_sample($formattedParent, $metricName, $metricFilter); -} -// [END logging_v2_generated_MetricsServiceV2_CreateLogMetric_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/delete_log_metric.php b/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/delete_log_metric.php deleted file mode 100644 index 8f76819f29ce..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/delete_log_metric.php +++ /dev/null @@ -1,66 +0,0 @@ -deleteLogMetric($formattedMetricName); - 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 -{ - $formattedMetricName = MetricsServiceV2Client::logMetricName('[PROJECT]', '[METRIC]'); - - delete_log_metric_sample($formattedMetricName); -} -// [END logging_v2_generated_MetricsServiceV2_DeleteLogMetric_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/get_log_metric.php b/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/get_log_metric.php deleted file mode 100644 index a2851efe73ca..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/get_log_metric.php +++ /dev/null @@ -1,68 +0,0 @@ -getLogMetric($formattedMetricName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedMetricName = MetricsServiceV2Client::logMetricName('[PROJECT]', '[METRIC]'); - - get_log_metric_sample($formattedMetricName); -} -// [END logging_v2_generated_MetricsServiceV2_GetLogMetric_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/list_log_metrics.php b/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/list_log_metrics.php deleted file mode 100644 index 4b62e905f0d1..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/list_log_metrics.php +++ /dev/null @@ -1,73 +0,0 @@ -listLogMetrics($formattedParent); - - /** @var LogMetric $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 = MetricsServiceV2Client::projectName('[PROJECT]'); - - list_log_metrics_sample($formattedParent); -} -// [END logging_v2_generated_MetricsServiceV2_ListLogMetrics_sync] diff --git a/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/update_log_metric.php b/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/update_log_metric.php deleted file mode 100644 index 2aa78c5446f3..000000000000 --- a/owl-bot-staging/Logging/v2/samples/V2/MetricsServiceV2Client/update_log_metric.php +++ /dev/null @@ -1,102 +0,0 @@ -=ERROR" - * - * The maximum length of the filter is 20000 characters. - */ -function update_log_metric_sample( - string $formattedMetricName, - string $metricName, - string $metricFilter -): void { - // Create a client. - $metricsServiceV2Client = new MetricsServiceV2Client(); - - // Prepare any non-scalar elements to be passed along with the request. - $metric = (new LogMetric()) - ->setName($metricName) - ->setFilter($metricFilter); - - // Call the API and handle any network failures. - try { - /** @var LogMetric $response */ - $response = $metricsServiceV2Client->updateLogMetric($formattedMetricName, $metric); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedMetricName = MetricsServiceV2Client::logMetricName('[PROJECT]', '[METRIC]'); - $metricName = '[NAME]'; - $metricFilter = '[FILTER]'; - - update_log_metric_sample($formattedMetricName, $metricName, $metricFilter); -} -// [END logging_v2_generated_MetricsServiceV2_UpdateLogMetric_sync] diff --git a/owl-bot-staging/Logging/v2/src/V2/ConfigServiceV2Client.php b/owl-bot-staging/Logging/v2/src/V2/ConfigServiceV2Client.php deleted file mode 100644 index 7fb015b5335c..000000000000 --- a/owl-bot-staging/Logging/v2/src/V2/ConfigServiceV2Client.php +++ /dev/null @@ -1,34 +0,0 @@ -copyLogEntries($name, $destination); - * $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 = $configServiceV2Client->copyLogEntries($name, $destination); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $configServiceV2Client->resumeOperation($operationName, 'copyLogEntries'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $configServiceV2Client->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. - */ -class ConfigServiceV2GapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.logging.v2.ConfigServiceV2'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'logging.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - 'https://www.googleapis.com/auth/logging.admin', - 'https://www.googleapis.com/auth/logging.read', - ]; - - private static $billingAccountNameTemplate; - - private static $billingAccountCmekSettingsNameTemplate; - - private static $billingAccountExclusionNameTemplate; - - private static $billingAccountLocationNameTemplate; - - private static $billingAccountLocationBucketNameTemplate; - - private static $billingAccountLocationBucketLinkNameTemplate; - - private static $billingAccountLocationBucketViewNameTemplate; - - private static $billingAccountSettingsNameTemplate; - - private static $billingAccountSinkNameTemplate; - - private static $cmekSettingsNameTemplate; - - private static $folderNameTemplate; - - private static $folderCmekSettingsNameTemplate; - - private static $folderExclusionNameTemplate; - - private static $folderLocationNameTemplate; - - private static $folderLocationBucketNameTemplate; - - private static $folderLocationBucketLinkNameTemplate; - - private static $folderLocationBucketViewNameTemplate; - - private static $folderSettingsNameTemplate; - - private static $folderSinkNameTemplate; - - private static $linkNameTemplate; - - private static $locationNameTemplate; - - private static $logBucketNameTemplate; - - private static $logExclusionNameTemplate; - - private static $logSinkNameTemplate; - - private static $logViewNameTemplate; - - private static $organizationNameTemplate; - - private static $organizationCmekSettingsNameTemplate; - - private static $organizationExclusionNameTemplate; - - private static $organizationLocationNameTemplate; - - private static $organizationLocationBucketNameTemplate; - - private static $organizationLocationBucketLinkNameTemplate; - - private static $organizationLocationBucketViewNameTemplate; - - private static $organizationSettingsNameTemplate; - - private static $organizationSinkNameTemplate; - - private static $projectNameTemplate; - - private static $projectCmekSettingsNameTemplate; - - private static $projectExclusionNameTemplate; - - private static $projectLocationBucketNameTemplate; - - private static $projectLocationBucketLinkNameTemplate; - - private static $projectLocationBucketViewNameTemplate; - - private static $projectSettingsNameTemplate; - - private static $projectSinkNameTemplate; - - private static $settingsNameTemplate; - - 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/config_service_v2_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/config_service_v2_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/config_service_v2_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/config_service_v2_rest_client_config.php', - ], - ], - ]; - } - - private static function getBillingAccountNameTemplate() - { - if (self::$billingAccountNameTemplate == null) { - self::$billingAccountNameTemplate = new PathTemplate('billingAccounts/{billing_account}'); - } - - return self::$billingAccountNameTemplate; - } - - private static function getBillingAccountCmekSettingsNameTemplate() - { - if (self::$billingAccountCmekSettingsNameTemplate == null) { - self::$billingAccountCmekSettingsNameTemplate = new PathTemplate('billingAccounts/{billing_account}/cmekSettings'); - } - - return self::$billingAccountCmekSettingsNameTemplate; - } - - private static function getBillingAccountExclusionNameTemplate() - { - if (self::$billingAccountExclusionNameTemplate == null) { - self::$billingAccountExclusionNameTemplate = new PathTemplate('billingAccounts/{billing_account}/exclusions/{exclusion}'); - } - - return self::$billingAccountExclusionNameTemplate; - } - - private static function getBillingAccountLocationNameTemplate() - { - if (self::$billingAccountLocationNameTemplate == null) { - self::$billingAccountLocationNameTemplate = new PathTemplate('billingAccounts/{billing_account}/locations/{location}'); - } - - return self::$billingAccountLocationNameTemplate; - } - - private static function getBillingAccountLocationBucketNameTemplate() - { - if (self::$billingAccountLocationBucketNameTemplate == null) { - self::$billingAccountLocationBucketNameTemplate = new PathTemplate('billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}'); - } - - return self::$billingAccountLocationBucketNameTemplate; - } - - private static function getBillingAccountLocationBucketLinkNameTemplate() - { - if (self::$billingAccountLocationBucketLinkNameTemplate == null) { - self::$billingAccountLocationBucketLinkNameTemplate = new PathTemplate('billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/links/{link}'); - } - - return self::$billingAccountLocationBucketLinkNameTemplate; - } - - private static function getBillingAccountLocationBucketViewNameTemplate() - { - if (self::$billingAccountLocationBucketViewNameTemplate == null) { - self::$billingAccountLocationBucketViewNameTemplate = new PathTemplate('billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/views/{view}'); - } - - return self::$billingAccountLocationBucketViewNameTemplate; - } - - private static function getBillingAccountSettingsNameTemplate() - { - if (self::$billingAccountSettingsNameTemplate == null) { - self::$billingAccountSettingsNameTemplate = new PathTemplate('billingAccounts/{billing_account}/settings'); - } - - return self::$billingAccountSettingsNameTemplate; - } - - private static function getBillingAccountSinkNameTemplate() - { - if (self::$billingAccountSinkNameTemplate == null) { - self::$billingAccountSinkNameTemplate = new PathTemplate('billingAccounts/{billing_account}/sinks/{sink}'); - } - - return self::$billingAccountSinkNameTemplate; - } - - private static function getCmekSettingsNameTemplate() - { - if (self::$cmekSettingsNameTemplate == null) { - self::$cmekSettingsNameTemplate = new PathTemplate('projects/{project}/cmekSettings'); - } - - return self::$cmekSettingsNameTemplate; - } - - private static function getFolderNameTemplate() - { - if (self::$folderNameTemplate == null) { - self::$folderNameTemplate = new PathTemplate('folders/{folder}'); - } - - return self::$folderNameTemplate; - } - - private static function getFolderCmekSettingsNameTemplate() - { - if (self::$folderCmekSettingsNameTemplate == null) { - self::$folderCmekSettingsNameTemplate = new PathTemplate('folders/{folder}/cmekSettings'); - } - - return self::$folderCmekSettingsNameTemplate; - } - - private static function getFolderExclusionNameTemplate() - { - if (self::$folderExclusionNameTemplate == null) { - self::$folderExclusionNameTemplate = new PathTemplate('folders/{folder}/exclusions/{exclusion}'); - } - - return self::$folderExclusionNameTemplate; - } - - private static function getFolderLocationNameTemplate() - { - if (self::$folderLocationNameTemplate == null) { - self::$folderLocationNameTemplate = new PathTemplate('folders/{folder}/locations/{location}'); - } - - return self::$folderLocationNameTemplate; - } - - private static function getFolderLocationBucketNameTemplate() - { - if (self::$folderLocationBucketNameTemplate == null) { - self::$folderLocationBucketNameTemplate = new PathTemplate('folders/{folder}/locations/{location}/buckets/{bucket}'); - } - - return self::$folderLocationBucketNameTemplate; - } - - private static function getFolderLocationBucketLinkNameTemplate() - { - if (self::$folderLocationBucketLinkNameTemplate == null) { - self::$folderLocationBucketLinkNameTemplate = new PathTemplate('folders/{folder}/locations/{location}/buckets/{bucket}/links/{link}'); - } - - return self::$folderLocationBucketLinkNameTemplate; - } - - private static function getFolderLocationBucketViewNameTemplate() - { - if (self::$folderLocationBucketViewNameTemplate == null) { - self::$folderLocationBucketViewNameTemplate = new PathTemplate('folders/{folder}/locations/{location}/buckets/{bucket}/views/{view}'); - } - - return self::$folderLocationBucketViewNameTemplate; - } - - private static function getFolderSettingsNameTemplate() - { - if (self::$folderSettingsNameTemplate == null) { - self::$folderSettingsNameTemplate = new PathTemplate('folders/{folder}/settings'); - } - - return self::$folderSettingsNameTemplate; - } - - private static function getFolderSinkNameTemplate() - { - if (self::$folderSinkNameTemplate == null) { - self::$folderSinkNameTemplate = new PathTemplate('folders/{folder}/sinks/{sink}'); - } - - return self::$folderSinkNameTemplate; - } - - private static function getLinkNameTemplate() - { - if (self::$linkNameTemplate == null) { - self::$linkNameTemplate = new PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}/links/{link}'); - } - - return self::$linkNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getLogBucketNameTemplate() - { - if (self::$logBucketNameTemplate == null) { - self::$logBucketNameTemplate = new PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}'); - } - - return self::$logBucketNameTemplate; - } - - private static function getLogExclusionNameTemplate() - { - if (self::$logExclusionNameTemplate == null) { - self::$logExclusionNameTemplate = new PathTemplate('projects/{project}/exclusions/{exclusion}'); - } - - return self::$logExclusionNameTemplate; - } - - private static function getLogSinkNameTemplate() - { - if (self::$logSinkNameTemplate == null) { - self::$logSinkNameTemplate = new PathTemplate('projects/{project}/sinks/{sink}'); - } - - return self::$logSinkNameTemplate; - } - - private static function getLogViewNameTemplate() - { - if (self::$logViewNameTemplate == null) { - self::$logViewNameTemplate = new PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}/views/{view}'); - } - - return self::$logViewNameTemplate; - } - - private static function getOrganizationNameTemplate() - { - if (self::$organizationNameTemplate == null) { - self::$organizationNameTemplate = new PathTemplate('organizations/{organization}'); - } - - return self::$organizationNameTemplate; - } - - private static function getOrganizationCmekSettingsNameTemplate() - { - if (self::$organizationCmekSettingsNameTemplate == null) { - self::$organizationCmekSettingsNameTemplate = new PathTemplate('organizations/{organization}/cmekSettings'); - } - - return self::$organizationCmekSettingsNameTemplate; - } - - private static function getOrganizationExclusionNameTemplate() - { - if (self::$organizationExclusionNameTemplate == null) { - self::$organizationExclusionNameTemplate = new PathTemplate('organizations/{organization}/exclusions/{exclusion}'); - } - - return self::$organizationExclusionNameTemplate; - } - - private static function getOrganizationLocationNameTemplate() - { - if (self::$organizationLocationNameTemplate == null) { - self::$organizationLocationNameTemplate = new PathTemplate('organizations/{organization}/locations/{location}'); - } - - return self::$organizationLocationNameTemplate; - } - - private static function getOrganizationLocationBucketNameTemplate() - { - if (self::$organizationLocationBucketNameTemplate == null) { - self::$organizationLocationBucketNameTemplate = new PathTemplate('organizations/{organization}/locations/{location}/buckets/{bucket}'); - } - - return self::$organizationLocationBucketNameTemplate; - } - - private static function getOrganizationLocationBucketLinkNameTemplate() - { - if (self::$organizationLocationBucketLinkNameTemplate == null) { - self::$organizationLocationBucketLinkNameTemplate = new PathTemplate('organizations/{organization}/locations/{location}/buckets/{bucket}/links/{link}'); - } - - return self::$organizationLocationBucketLinkNameTemplate; - } - - private static function getOrganizationLocationBucketViewNameTemplate() - { - if (self::$organizationLocationBucketViewNameTemplate == null) { - self::$organizationLocationBucketViewNameTemplate = new PathTemplate('organizations/{organization}/locations/{location}/buckets/{bucket}/views/{view}'); - } - - return self::$organizationLocationBucketViewNameTemplate; - } - - private static function getOrganizationSettingsNameTemplate() - { - if (self::$organizationSettingsNameTemplate == null) { - self::$organizationSettingsNameTemplate = new PathTemplate('organizations/{organization}/settings'); - } - - return self::$organizationSettingsNameTemplate; - } - - private static function getOrganizationSinkNameTemplate() - { - if (self::$organizationSinkNameTemplate == null) { - self::$organizationSinkNameTemplate = new PathTemplate('organizations/{organization}/sinks/{sink}'); - } - - return self::$organizationSinkNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getProjectCmekSettingsNameTemplate() - { - if (self::$projectCmekSettingsNameTemplate == null) { - self::$projectCmekSettingsNameTemplate = new PathTemplate('projects/{project}/cmekSettings'); - } - - return self::$projectCmekSettingsNameTemplate; - } - - private static function getProjectExclusionNameTemplate() - { - if (self::$projectExclusionNameTemplate == null) { - self::$projectExclusionNameTemplate = new PathTemplate('projects/{project}/exclusions/{exclusion}'); - } - - return self::$projectExclusionNameTemplate; - } - - private static function getProjectLocationBucketNameTemplate() - { - if (self::$projectLocationBucketNameTemplate == null) { - self::$projectLocationBucketNameTemplate = new PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}'); - } - - return self::$projectLocationBucketNameTemplate; - } - - private static function getProjectLocationBucketLinkNameTemplate() - { - if (self::$projectLocationBucketLinkNameTemplate == null) { - self::$projectLocationBucketLinkNameTemplate = new PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}/links/{link}'); - } - - return self::$projectLocationBucketLinkNameTemplate; - } - - private static function getProjectLocationBucketViewNameTemplate() - { - if (self::$projectLocationBucketViewNameTemplate == null) { - self::$projectLocationBucketViewNameTemplate = new PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}/views/{view}'); - } - - return self::$projectLocationBucketViewNameTemplate; - } - - private static function getProjectSettingsNameTemplate() - { - if (self::$projectSettingsNameTemplate == null) { - self::$projectSettingsNameTemplate = new PathTemplate('projects/{project}/settings'); - } - - return self::$projectSettingsNameTemplate; - } - - private static function getProjectSinkNameTemplate() - { - if (self::$projectSinkNameTemplate == null) { - self::$projectSinkNameTemplate = new PathTemplate('projects/{project}/sinks/{sink}'); - } - - return self::$projectSinkNameTemplate; - } - - private static function getSettingsNameTemplate() - { - if (self::$settingsNameTemplate == null) { - self::$settingsNameTemplate = new PathTemplate('projects/{project}/settings'); - } - - return self::$settingsNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'billingAccount' => self::getBillingAccountNameTemplate(), - 'billingAccountCmekSettings' => self::getBillingAccountCmekSettingsNameTemplate(), - 'billingAccountExclusion' => self::getBillingAccountExclusionNameTemplate(), - 'billingAccountLocation' => self::getBillingAccountLocationNameTemplate(), - 'billingAccountLocationBucket' => self::getBillingAccountLocationBucketNameTemplate(), - 'billingAccountLocationBucketLink' => self::getBillingAccountLocationBucketLinkNameTemplate(), - 'billingAccountLocationBucketView' => self::getBillingAccountLocationBucketViewNameTemplate(), - 'billingAccountSettings' => self::getBillingAccountSettingsNameTemplate(), - 'billingAccountSink' => self::getBillingAccountSinkNameTemplate(), - 'cmekSettings' => self::getCmekSettingsNameTemplate(), - 'folder' => self::getFolderNameTemplate(), - 'folderCmekSettings' => self::getFolderCmekSettingsNameTemplate(), - 'folderExclusion' => self::getFolderExclusionNameTemplate(), - 'folderLocation' => self::getFolderLocationNameTemplate(), - 'folderLocationBucket' => self::getFolderLocationBucketNameTemplate(), - 'folderLocationBucketLink' => self::getFolderLocationBucketLinkNameTemplate(), - 'folderLocationBucketView' => self::getFolderLocationBucketViewNameTemplate(), - 'folderSettings' => self::getFolderSettingsNameTemplate(), - 'folderSink' => self::getFolderSinkNameTemplate(), - 'link' => self::getLinkNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'logBucket' => self::getLogBucketNameTemplate(), - 'logExclusion' => self::getLogExclusionNameTemplate(), - 'logSink' => self::getLogSinkNameTemplate(), - 'logView' => self::getLogViewNameTemplate(), - 'organization' => self::getOrganizationNameTemplate(), - 'organizationCmekSettings' => self::getOrganizationCmekSettingsNameTemplate(), - 'organizationExclusion' => self::getOrganizationExclusionNameTemplate(), - 'organizationLocation' => self::getOrganizationLocationNameTemplate(), - 'organizationLocationBucket' => self::getOrganizationLocationBucketNameTemplate(), - 'organizationLocationBucketLink' => self::getOrganizationLocationBucketLinkNameTemplate(), - 'organizationLocationBucketView' => self::getOrganizationLocationBucketViewNameTemplate(), - 'organizationSettings' => self::getOrganizationSettingsNameTemplate(), - 'organizationSink' => self::getOrganizationSinkNameTemplate(), - 'project' => self::getProjectNameTemplate(), - 'projectCmekSettings' => self::getProjectCmekSettingsNameTemplate(), - 'projectExclusion' => self::getProjectExclusionNameTemplate(), - 'projectLocationBucket' => self::getProjectLocationBucketNameTemplate(), - 'projectLocationBucketLink' => self::getProjectLocationBucketLinkNameTemplate(), - 'projectLocationBucketView' => self::getProjectLocationBucketViewNameTemplate(), - 'projectSettings' => self::getProjectSettingsNameTemplate(), - 'projectSink' => self::getProjectSinkNameTemplate(), - 'settings' => self::getSettingsNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account resource. - * - * @param string $billingAccount - * - * @return string The formatted billing_account resource. - */ - public static function billingAccountName($billingAccount) - { - return self::getBillingAccountNameTemplate()->render([ - 'billing_account' => $billingAccount, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_cmekSettings resource. - * - * @param string $billingAccount - * - * @return string The formatted billing_account_cmekSettings resource. - */ - public static function billingAccountCmekSettingsName($billingAccount) - { - return self::getBillingAccountCmekSettingsNameTemplate()->render([ - 'billing_account' => $billingAccount, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_exclusion resource. - * - * @param string $billingAccount - * @param string $exclusion - * - * @return string The formatted billing_account_exclusion resource. - */ - public static function billingAccountExclusionName($billingAccount, $exclusion) - { - return self::getBillingAccountExclusionNameTemplate()->render([ - 'billing_account' => $billingAccount, - 'exclusion' => $exclusion, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location resource. - * - * @param string $billingAccount - * @param string $location - * - * @return string The formatted billing_account_location resource. - */ - public static function billingAccountLocationName($billingAccount, $location) - { - return self::getBillingAccountLocationNameTemplate()->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location_bucket resource. - * - * @param string $billingAccount - * @param string $location - * @param string $bucket - * - * @return string The formatted billing_account_location_bucket resource. - */ - public static function billingAccountLocationBucketName($billingAccount, $location, $bucket) - { - return self::getBillingAccountLocationBucketNameTemplate()->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - 'bucket' => $bucket, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location_bucket_link resource. - * - * @param string $billingAccount - * @param string $location - * @param string $bucket - * @param string $link - * - * @return string The formatted billing_account_location_bucket_link resource. - */ - public static function billingAccountLocationBucketLinkName($billingAccount, $location, $bucket, $link) - { - return self::getBillingAccountLocationBucketLinkNameTemplate()->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - 'bucket' => $bucket, - 'link' => $link, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location_bucket_view resource. - * - * @param string $billingAccount - * @param string $location - * @param string $bucket - * @param string $view - * - * @return string The formatted billing_account_location_bucket_view resource. - */ - public static function billingAccountLocationBucketViewName($billingAccount, $location, $bucket, $view) - { - return self::getBillingAccountLocationBucketViewNameTemplate()->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - 'bucket' => $bucket, - 'view' => $view, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_settings resource. - * - * @param string $billingAccount - * - * @return string The formatted billing_account_settings resource. - */ - public static function billingAccountSettingsName($billingAccount) - { - return self::getBillingAccountSettingsNameTemplate()->render([ - 'billing_account' => $billingAccount, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_sink resource. - * - * @param string $billingAccount - * @param string $sink - * - * @return string The formatted billing_account_sink resource. - */ - public static function billingAccountSinkName($billingAccount, $sink) - { - return self::getBillingAccountSinkNameTemplate()->render([ - 'billing_account' => $billingAccount, - 'sink' => $sink, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * cmek_settings resource. - * - * @param string $project - * - * @return string The formatted cmek_settings resource. - */ - public static function cmekSettingsName($project) - { - return self::getCmekSettingsNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * 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($folder) - { - return self::getFolderNameTemplate()->render([ - 'folder' => $folder, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_cmekSettings resource. - * - * @param string $folder - * - * @return string The formatted folder_cmekSettings resource. - */ - public static function folderCmekSettingsName($folder) - { - return self::getFolderCmekSettingsNameTemplate()->render([ - 'folder' => $folder, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_exclusion resource. - * - * @param string $folder - * @param string $exclusion - * - * @return string The formatted folder_exclusion resource. - */ - public static function folderExclusionName($folder, $exclusion) - { - return self::getFolderExclusionNameTemplate()->render([ - 'folder' => $folder, - 'exclusion' => $exclusion, - ]); - } - - /** - * 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($folder, $location) - { - return self::getFolderLocationNameTemplate()->render([ - 'folder' => $folder, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location_bucket resource. - * - * @param string $folder - * @param string $location - * @param string $bucket - * - * @return string The formatted folder_location_bucket resource. - */ - public static function folderLocationBucketName($folder, $location, $bucket) - { - return self::getFolderLocationBucketNameTemplate()->render([ - 'folder' => $folder, - 'location' => $location, - 'bucket' => $bucket, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location_bucket_link resource. - * - * @param string $folder - * @param string $location - * @param string $bucket - * @param string $link - * - * @return string The formatted folder_location_bucket_link resource. - */ - public static function folderLocationBucketLinkName($folder, $location, $bucket, $link) - { - return self::getFolderLocationBucketLinkNameTemplate()->render([ - 'folder' => $folder, - 'location' => $location, - 'bucket' => $bucket, - 'link' => $link, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location_bucket_view resource. - * - * @param string $folder - * @param string $location - * @param string $bucket - * @param string $view - * - * @return string The formatted folder_location_bucket_view resource. - */ - public static function folderLocationBucketViewName($folder, $location, $bucket, $view) - { - return self::getFolderLocationBucketViewNameTemplate()->render([ - 'folder' => $folder, - 'location' => $location, - 'bucket' => $bucket, - 'view' => $view, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_settings resource. - * - * @param string $folder - * - * @return string The formatted folder_settings resource. - */ - public static function folderSettingsName($folder) - { - return self::getFolderSettingsNameTemplate()->render([ - 'folder' => $folder, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a folder_sink - * resource. - * - * @param string $folder - * @param string $sink - * - * @return string The formatted folder_sink resource. - */ - public static function folderSinkName($folder, $sink) - { - return self::getFolderSinkNameTemplate()->render([ - 'folder' => $folder, - 'sink' => $sink, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a link - * resource. - * - * @param string $project - * @param string $location - * @param string $bucket - * @param string $link - * - * @return string The formatted link resource. - */ - public static function linkName($project, $location, $bucket, $link) - { - return self::getLinkNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'bucket' => $bucket, - 'link' => $link, - ]); - } - - /** - * 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($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a log_bucket - * resource. - * - * @param string $project - * @param string $location - * @param string $bucket - * - * @return string The formatted log_bucket resource. - */ - public static function logBucketName($project, $location, $bucket) - { - return self::getLogBucketNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'bucket' => $bucket, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * log_exclusion resource. - * - * @param string $project - * @param string $exclusion - * - * @return string The formatted log_exclusion resource. - */ - public static function logExclusionName($project, $exclusion) - { - return self::getLogExclusionNameTemplate()->render([ - 'project' => $project, - 'exclusion' => $exclusion, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a log_sink - * resource. - * - * @param string $project - * @param string $sink - * - * @return string The formatted log_sink resource. - */ - public static function logSinkName($project, $sink) - { - return self::getLogSinkNameTemplate()->render([ - 'project' => $project, - 'sink' => $sink, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a log_view - * resource. - * - * @param string $project - * @param string $location - * @param string $bucket - * @param string $view - * - * @return string The formatted log_view resource. - */ - public static function logViewName($project, $location, $bucket, $view) - { - return self::getLogViewNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'bucket' => $bucket, - 'view' => $view, - ]); - } - - /** - * 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($organization) - { - return self::getOrganizationNameTemplate()->render([ - 'organization' => $organization, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_cmekSettings resource. - * - * @param string $organization - * - * @return string The formatted organization_cmekSettings resource. - */ - public static function organizationCmekSettingsName($organization) - { - return self::getOrganizationCmekSettingsNameTemplate()->render([ - 'organization' => $organization, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_exclusion resource. - * - * @param string $organization - * @param string $exclusion - * - * @return string The formatted organization_exclusion resource. - */ - public static function organizationExclusionName($organization, $exclusion) - { - return self::getOrganizationExclusionNameTemplate()->render([ - 'organization' => $organization, - 'exclusion' => $exclusion, - ]); - } - - /** - * 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($organization, $location) - { - return self::getOrganizationLocationNameTemplate()->render([ - 'organization' => $organization, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_bucket resource. - * - * @param string $organization - * @param string $location - * @param string $bucket - * - * @return string The formatted organization_location_bucket resource. - */ - public static function organizationLocationBucketName($organization, $location, $bucket) - { - return self::getOrganizationLocationBucketNameTemplate()->render([ - 'organization' => $organization, - 'location' => $location, - 'bucket' => $bucket, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_bucket_link resource. - * - * @param string $organization - * @param string $location - * @param string $bucket - * @param string $link - * - * @return string The formatted organization_location_bucket_link resource. - */ - public static function organizationLocationBucketLinkName($organization, $location, $bucket, $link) - { - return self::getOrganizationLocationBucketLinkNameTemplate()->render([ - 'organization' => $organization, - 'location' => $location, - 'bucket' => $bucket, - 'link' => $link, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_bucket_view resource. - * - * @param string $organization - * @param string $location - * @param string $bucket - * @param string $view - * - * @return string The formatted organization_location_bucket_view resource. - */ - public static function organizationLocationBucketViewName($organization, $location, $bucket, $view) - { - return self::getOrganizationLocationBucketViewNameTemplate()->render([ - 'organization' => $organization, - 'location' => $location, - 'bucket' => $bucket, - 'view' => $view, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_settings resource. - * - * @param string $organization - * - * @return string The formatted organization_settings resource. - */ - public static function organizationSettingsName($organization) - { - return self::getOrganizationSettingsNameTemplate()->render([ - 'organization' => $organization, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_sink resource. - * - * @param string $organization - * @param string $sink - * - * @return string The formatted organization_sink resource. - */ - public static function organizationSinkName($organization, $sink) - { - return self::getOrganizationSinkNameTemplate()->render([ - 'organization' => $organization, - 'sink' => $sink, - ]); - } - - /** - * 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 - * project_cmekSettings resource. - * - * @param string $project - * - * @return string The formatted project_cmekSettings resource. - */ - public static function projectCmekSettingsName($project) - { - return self::getProjectCmekSettingsNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_exclusion resource. - * - * @param string $project - * @param string $exclusion - * - * @return string The formatted project_exclusion resource. - */ - public static function projectExclusionName($project, $exclusion) - { - return self::getProjectExclusionNameTemplate()->render([ - 'project' => $project, - 'exclusion' => $exclusion, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_bucket resource. - * - * @param string $project - * @param string $location - * @param string $bucket - * - * @return string The formatted project_location_bucket resource. - */ - public static function projectLocationBucketName($project, $location, $bucket) - { - return self::getProjectLocationBucketNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'bucket' => $bucket, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_bucket_link resource. - * - * @param string $project - * @param string $location - * @param string $bucket - * @param string $link - * - * @return string The formatted project_location_bucket_link resource. - */ - public static function projectLocationBucketLinkName($project, $location, $bucket, $link) - { - return self::getProjectLocationBucketLinkNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'bucket' => $bucket, - 'link' => $link, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_bucket_view resource. - * - * @param string $project - * @param string $location - * @param string $bucket - * @param string $view - * - * @return string The formatted project_location_bucket_view resource. - */ - public static function projectLocationBucketViewName($project, $location, $bucket, $view) - { - return self::getProjectLocationBucketViewNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'bucket' => $bucket, - 'view' => $view, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_settings resource. - * - * @param string $project - * - * @return string The formatted project_settings resource. - */ - public static function projectSettingsName($project) - { - return self::getProjectSettingsNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project_sink - * resource. - * - * @param string $project - * @param string $sink - * - * @return string The formatted project_sink resource. - */ - public static function projectSinkName($project, $sink) - { - return self::getProjectSinkNameTemplate()->render([ - 'project' => $project, - 'sink' => $sink, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a settings - * resource. - * - * @param string $project - * - * @return string The formatted settings resource. - */ - public static function settingsName($project) - { - return self::getSettingsNameTemplate()->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 - * - billingAccount: billingAccounts/{billing_account} - * - billingAccountCmekSettings: billingAccounts/{billing_account}/cmekSettings - * - billingAccountExclusion: billingAccounts/{billing_account}/exclusions/{exclusion} - * - billingAccountLocation: billingAccounts/{billing_account}/locations/{location} - * - billingAccountLocationBucket: billingAccounts/{billing_account}/locations/{location}/buckets/{bucket} - * - billingAccountLocationBucketLink: billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/links/{link} - * - billingAccountLocationBucketView: billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/views/{view} - * - billingAccountSettings: billingAccounts/{billing_account}/settings - * - billingAccountSink: billingAccounts/{billing_account}/sinks/{sink} - * - cmekSettings: projects/{project}/cmekSettings - * - folder: folders/{folder} - * - folderCmekSettings: folders/{folder}/cmekSettings - * - folderExclusion: folders/{folder}/exclusions/{exclusion} - * - folderLocation: folders/{folder}/locations/{location} - * - folderLocationBucket: folders/{folder}/locations/{location}/buckets/{bucket} - * - folderLocationBucketLink: folders/{folder}/locations/{location}/buckets/{bucket}/links/{link} - * - folderLocationBucketView: folders/{folder}/locations/{location}/buckets/{bucket}/views/{view} - * - folderSettings: folders/{folder}/settings - * - folderSink: folders/{folder}/sinks/{sink} - * - link: projects/{project}/locations/{location}/buckets/{bucket}/links/{link} - * - location: projects/{project}/locations/{location} - * - logBucket: projects/{project}/locations/{location}/buckets/{bucket} - * - logExclusion: projects/{project}/exclusions/{exclusion} - * - logSink: projects/{project}/sinks/{sink} - * - logView: projects/{project}/locations/{location}/buckets/{bucket}/views/{view} - * - organization: organizations/{organization} - * - organizationCmekSettings: organizations/{organization}/cmekSettings - * - organizationExclusion: organizations/{organization}/exclusions/{exclusion} - * - organizationLocation: organizations/{organization}/locations/{location} - * - organizationLocationBucket: organizations/{organization}/locations/{location}/buckets/{bucket} - * - organizationLocationBucketLink: organizations/{organization}/locations/{location}/buckets/{bucket}/links/{link} - * - organizationLocationBucketView: organizations/{organization}/locations/{location}/buckets/{bucket}/views/{view} - * - organizationSettings: organizations/{organization}/settings - * - organizationSink: organizations/{organization}/sinks/{sink} - * - project: projects/{project} - * - projectCmekSettings: projects/{project}/cmekSettings - * - projectExclusion: projects/{project}/exclusions/{exclusion} - * - projectLocationBucket: projects/{project}/locations/{location}/buckets/{bucket} - * - projectLocationBucketLink: projects/{project}/locations/{location}/buckets/{bucket}/links/{link} - * - projectLocationBucketView: projects/{project}/locations/{location}/buckets/{bucket}/views/{view} - * - projectSettings: projects/{project}/settings - * - projectSink: projects/{project}/sinks/{sink} - * - settings: projects/{project}/settings - * - * 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"); - } - - /** - * 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; - } - - /** - * 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 'logging.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); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Copies a set of log entries from a log bucket to a Cloud Storage bucket. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $name = 'name'; - * $destination = 'destination'; - * $operationResponse = $configServiceV2Client->copyLogEntries($name, $destination); - * $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 = $configServiceV2Client->copyLogEntries($name, $destination); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $configServiceV2Client->resumeOperation($operationName, 'copyLogEntries'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $name Required. Log bucket from which to copy log entries. - * - * For example: - * - * `"projects/my-project/locations/global/buckets/my-source-bucket"` - * @param string $destination Required. Destination to which to copy log entries. - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Optional. A filter specifying which log entries to copy. The filter must be - * no more than 20k characters. An empty filter matches all log entries. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. 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 - */ - public function copyLogEntries($name, $destination, array $optionalArgs = []) - { - $request = new CopyLogEntriesRequest(); - $request->setName($name); - $request->setDestination($destination); - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - return $this->startOperationsCall('CopyLogEntries', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a log bucket that can be used to store log entries. After a bucket - * has been created, the bucket's location cannot be changed. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedParent = $configServiceV2Client->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); - * $bucketId = 'bucket_id'; - * $bucket = new LogBucket(); - * $response = $configServiceV2Client->createBucket($formattedParent, $bucketId, $bucket); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $parent Required. The resource in which to create the log bucket: - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" - * - * For example: - * - * `"projects/my-project/locations/global"` - * @param string $bucketId Required. A client-assigned identifier such as `"my-bucket"`. Identifiers - * are limited to 100 characters and can include only letters, digits, - * underscores, hyphens, and periods. - * @param LogBucket $bucket Required. The new bucket. The region specified in the new bucket must be - * compliant with any Location Restriction Org Policy. The name field in the - * bucket is ignored. - * @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\Logging\V2\LogBucket - * - * @throws ApiException if the remote call fails - */ - public function createBucket($parent, $bucketId, $bucket, array $optionalArgs = []) - { - $request = new CreateBucketRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setBucketId($bucketId); - $request->setBucket($bucket); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateBucket', LogBucket::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a log bucket asynchronously that can be used to store log entries. - * - * After a bucket has been created, the bucket's location cannot be changed. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedParent = $configServiceV2Client->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); - * $bucketId = 'bucket_id'; - * $bucket = new LogBucket(); - * $operationResponse = $configServiceV2Client->createBucketAsync($formattedParent, $bucketId, $bucket); - * $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 = $configServiceV2Client->createBucketAsync($formattedParent, $bucketId, $bucket); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $configServiceV2Client->resumeOperation($operationName, 'createBucketAsync'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $parent Required. The resource in which to create the log bucket: - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" - * - * For example: - * - * `"projects/my-project/locations/global"` - * @param string $bucketId Required. A client-assigned identifier such as `"my-bucket"`. Identifiers - * are limited to 100 characters and can include only letters, digits, - * underscores, hyphens, and periods. - * @param LogBucket $bucket Required. The new bucket. The region specified in the new bucket must be - * compliant with any Location Restriction Org Policy. The name field in the - * bucket is ignored. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createBucketAsync($parent, $bucketId, $bucket, array $optionalArgs = []) - { - $request = new CreateBucketRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setBucketId($bucketId); - $request->setBucket($bucket); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateBucketAsync', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new exclusion in the _Default sink in a specified parent - * resource. Only log entries belonging to that resource can be excluded. You - * can have up to 10 exclusions in a resource. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedParent = $configServiceV2Client->projectName('[PROJECT]'); - * $exclusion = new LogExclusion(); - * $response = $configServiceV2Client->createExclusion($formattedParent, $exclusion); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource in which to create the exclusion: - * - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" - * - * For examples: - * - * `"projects/my-logging-project"` - * `"organizations/123456789"` - * @param LogExclusion $exclusion Required. The new exclusion, whose `name` parameter is an exclusion name - * that is not already used in the parent resource. - * @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\Logging\V2\LogExclusion - * - * @throws ApiException if the remote call fails - */ - public function createExclusion($parent, $exclusion, array $optionalArgs = []) - { - $request = new CreateExclusionRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setExclusion($exclusion); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateExclusion', LogExclusion::class, $optionalArgs, $request)->wait(); - } - - /** - * Asynchronously creates a linked dataset in BigQuery which makes it possible - * to use BigQuery to read the logs stored in the log bucket. A log bucket may - * currently only contain one link. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedParent = $configServiceV2Client->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - * $link = new Link(); - * $linkId = 'link_id'; - * $operationResponse = $configServiceV2Client->createLink($formattedParent, $link, $linkId); - * $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 = $configServiceV2Client->createLink($formattedParent, $link, $linkId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $configServiceV2Client->resumeOperation($operationName, 'createLink'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $parent Required. The full resource name of the bucket to create a link for. - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * @param Link $link Required. The new link. - * @param string $linkId Required. The ID to use for the link. The link_id can have up to 100 - * characters. A valid link_id must only have alphanumeric characters and - * underscores within it. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createLink($parent, $link, $linkId, array $optionalArgs = []) - { - $request = new CreateLinkRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setLink($link); - $request->setLinkId($linkId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateLink', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a sink that exports specified log entries to a destination. The - * export of newly-ingested log entries begins immediately, unless the sink's - * `writer_identity` is not permitted to write to the destination. A sink can - * export log entries only from the resource owning the sink. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedParent = $configServiceV2Client->projectName('[PROJECT]'); - * $sink = new LogSink(); - * $response = $configServiceV2Client->createSink($formattedParent, $sink); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $parent Required. The resource in which to create the sink: - * - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" - * - * For examples: - * - * `"projects/my-project"` - * `"organizations/123456789"` - * @param LogSink $sink Required. The new sink, whose `name` parameter is a sink identifier that - * is not already in use. - * @param array $optionalArgs { - * Optional. - * - * @type bool $uniqueWriterIdentity - * Optional. Determines the kind of IAM identity returned as `writer_identity` - * in the new sink. If this value is omitted or set to false, and if the - * sink's parent is a project, then the value returned as `writer_identity` is - * the same group or service account used by Cloud Logging before the addition - * of writer identities to this API. The sink's destination must be in the - * same project as the sink itself. - * - * If this field is set to true, or if the sink is owned by a non-project - * resource such as an organization, then the value of `writer_identity` will - * be a unique service account used only for exports from the new sink. For - * more information, see `writer_identity` in - * [LogSink][google.logging.v2.LogSink]. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. 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\Logging\V2\LogSink - * - * @throws ApiException if the remote call fails - */ - public function createSink($parent, $sink, array $optionalArgs = []) - { - $request = new CreateSinkRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setSink($sink); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['uniqueWriterIdentity'])) { - $request->setUniqueWriterIdentity($optionalArgs['uniqueWriterIdentity']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateSink', LogSink::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a view over log entries in a log bucket. A bucket may contain a - * maximum of 30 views. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $parent = 'parent'; - * $viewId = 'view_id'; - * $view = new LogView(); - * $response = $configServiceV2Client->createView($parent, $viewId, $view); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $parent Required. The bucket in which to create the view - * - * `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` - * - * For example: - * - * `"projects/my-project/locations/global/buckets/my-bucket"` - * @param string $viewId Required. A client-assigned identifier such as `"my-view"`. Identifiers are - * limited to 100 characters and can include only letters, digits, - * underscores, hyphens, and periods. - * @param LogView $view Required. The new view. - * @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\Logging\V2\LogView - * - * @throws ApiException if the remote call fails - */ - public function createView($parent, $viewId, $view, array $optionalArgs = []) - { - $request = new CreateViewRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setViewId($viewId); - $request->setView($view); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateView', LogView::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a log bucket. - * - * Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state. - * After 7 days, the bucket will be purged and all log entries in the bucket - * will be permanently deleted. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedName = $configServiceV2Client->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - * $configServiceV2Client->deleteBucket($formattedName); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $name Required. The full resource name of the bucket to delete. - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * - * For example: - * - * `"projects/my-project/locations/global/buckets/my-bucket"` - * @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 deleteBucket($name, array $optionalArgs = []) - { - $request = new DeleteBucketRequest(); - $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('DeleteBucket', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes an exclusion in the _Default sink. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedName = $configServiceV2Client->logExclusionName('[PROJECT]', '[EXCLUSION]'); - * $configServiceV2Client->deleteExclusion($formattedName); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $name Required. The resource name of an existing exclusion to delete: - * - * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - * - * For example: - * - * `"projects/my-project/exclusions/my-exclusion"` - * @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 deleteExclusion($name, array $optionalArgs = []) - { - $request = new DeleteExclusionRequest(); - $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('DeleteExclusion', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a link. This will also delete the corresponding BigQuery linked - * dataset. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedName = $configServiceV2Client->linkName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[LINK]'); - * $operationResponse = $configServiceV2Client->deleteLink($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $configServiceV2Client->deleteLink($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $configServiceV2Client->resumeOperation($operationName, 'deleteLink'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $name Required. The full resource name of the link to delete. - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteLink($name, array $optionalArgs = []) - { - $request = new DeleteLinkRequest(); - $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->startOperationsCall('DeleteLink', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a sink. If the sink has a unique `writer_identity`, then that - * service account is also deleted. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedSinkName = $configServiceV2Client->logSinkName('[PROJECT]', '[SINK]'); - * $configServiceV2Client->deleteSink($formattedSinkName); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $sinkName Required. The full resource name of the sink to delete, including the - * parent resource and the sink identifier: - * - * "projects/[PROJECT_ID]/sinks/[SINK_ID]" - * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * - * For example: - * - * `"projects/my-project/sinks/my-sink"` - * @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 deleteSink($sinkName, array $optionalArgs = []) - { - $request = new DeleteSinkRequest(); - $requestParamHeaders = []; - $request->setSinkName($sinkName); - $requestParamHeaders['sink_name'] = $sinkName; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteSink', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a view on a log bucket. - * If an `UNAVAILABLE` error is returned, this indicates that system is not in - * a state where it can delete the view. If this occurs, please try again in a - * few minutes. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedName = $configServiceV2Client->logViewName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[VIEW]'); - * $configServiceV2Client->deleteView($formattedName); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $name Required. The full resource name of the view to delete: - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * - * For example: - * - * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` - * @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 deleteView($name, array $optionalArgs = []) - { - $request = new DeleteViewRequest(); - $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('DeleteView', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a log bucket. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedName = $configServiceV2Client->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - * $response = $configServiceV2Client->getBucket($formattedName); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the bucket: - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * - * For example: - * - * `"projects/my-project/locations/global/buckets/my-bucket"` - * @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\Logging\V2\LogBucket - * - * @throws ApiException if the remote call fails - */ - public function getBucket($name, array $optionalArgs = []) - { - $request = new GetBucketRequest(); - $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('GetBucket', LogBucket::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the Logging CMEK settings for the given resource. - * - * Note: CMEK for the Log Router can be configured for Google Cloud projects, - * folders, organizations and billing accounts. Once configured for an - * organization, it applies to all projects and folders in the Google Cloud - * organization. - * - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $response = $configServiceV2Client->getCmekSettings(); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Required. The resource for which to retrieve CMEK settings. - * - * "projects/[PROJECT_ID]/cmekSettings" - * "organizations/[ORGANIZATION_ID]/cmekSettings" - * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" - * "folders/[FOLDER_ID]/cmekSettings" - * - * For example: - * - * `"organizations/12345/cmekSettings"` - * - * Note: CMEK for the Log Router can be configured for Google Cloud projects, - * folders, organizations and billing accounts. Once configured for an - * organization, it applies to all projects and folders in the Google Cloud - * organization. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. 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\Logging\V2\CmekSettings - * - * @throws ApiException if the remote call fails - */ - public function getCmekSettings(array $optionalArgs = []) - { - $request = new GetCmekSettingsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetCmekSettings', CmekSettings::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the description of an exclusion in the _Default sink. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedName = $configServiceV2Client->logExclusionName('[PROJECT]', '[EXCLUSION]'); - * $response = $configServiceV2Client->getExclusion($formattedName); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $name Required. The resource name of an existing exclusion: - * - * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - * - * For example: - * - * `"projects/my-project/exclusions/my-exclusion"` - * @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\Logging\V2\LogExclusion - * - * @throws ApiException if the remote call fails - */ - public function getExclusion($name, array $optionalArgs = []) - { - $request = new GetExclusionRequest(); - $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('GetExclusion', LogExclusion::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a link. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedName = $configServiceV2Client->linkName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[LINK]'); - * $response = $configServiceV2Client->getLink($formattedName); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the link: - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_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\Logging\V2\Link - * - * @throws ApiException if the remote call fails - */ - public function getLink($name, array $optionalArgs = []) - { - $request = new GetLinkRequest(); - $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('GetLink', Link::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the Log Router settings for the given resource. - * - * Note: Settings for the Log Router can be get for Google Cloud projects, - * folders, organizations and billing accounts. Currently it can only be - * configured for organizations. Once configured for an organization, it - * applies to all projects and folders in the Google Cloud organization. - * - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedName = $configServiceV2Client->settingsName('[PROJECT]'); - * $response = $configServiceV2Client->getSettings($formattedName); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $name Required. The resource for which to retrieve settings. - * - * "projects/[PROJECT_ID]/settings" - * "organizations/[ORGANIZATION_ID]/settings" - * "billingAccounts/[BILLING_ACCOUNT_ID]/settings" - * "folders/[FOLDER_ID]/settings" - * - * For example: - * - * `"organizations/12345/settings"` - * - * Note: Settings for the Log Router can be get for Google Cloud projects, - * folders, organizations and billing accounts. Currently it can only be - * configured for organizations. Once configured for an organization, it - * applies to all projects and folders in the Google Cloud organization. - * @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\Logging\V2\Settings - * - * @throws ApiException if the remote call fails - */ - public function getSettings($name, array $optionalArgs = []) - { - $request = new GetSettingsRequest(); - $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('GetSettings', Settings::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a sink. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedSinkName = $configServiceV2Client->logSinkName('[PROJECT]', '[SINK]'); - * $response = $configServiceV2Client->getSink($formattedSinkName); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $sinkName Required. The resource name of the sink: - * - * "projects/[PROJECT_ID]/sinks/[SINK_ID]" - * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * - * For example: - * - * `"projects/my-project/sinks/my-sink"` - * @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\Logging\V2\LogSink - * - * @throws ApiException if the remote call fails - */ - public function getSink($sinkName, array $optionalArgs = []) - { - $request = new GetSinkRequest(); - $requestParamHeaders = []; - $request->setSinkName($sinkName); - $requestParamHeaders['sink_name'] = $sinkName; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetSink', LogSink::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a view on a log bucket.. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedName = $configServiceV2Client->logViewName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[VIEW]'); - * $response = $configServiceV2Client->getView($formattedName); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the policy: - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * - * For example: - * - * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` - * @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\Logging\V2\LogView - * - * @throws ApiException if the remote call fails - */ - public function getView($name, array $optionalArgs = []) - { - $request = new GetViewRequest(); - $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('GetView', LogView::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists log buckets. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedParent = $configServiceV2Client->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $configServiceV2Client->listBuckets($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $configServiceV2Client->listBuckets($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource whose buckets are to be listed: - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" - * - * Note: The locations portion of the resource must be specified, but - * supplying the character `-` in place of [LOCATION_ID] will return all - * buckets. - * @param array $optionalArgs { - * Optional. - * - * @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 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 RetrySettings|array $retrySettings - * Retry settings to use for this call. 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 listBuckets($parent, array $optionalArgs = []) - { - $request = new ListBucketsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListBuckets', $optionalArgs, ListBucketsResponse::class, $request); - } - - /** - * Lists all the exclusions on the _Default sink in a parent resource. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedParent = $configServiceV2Client->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $configServiceV2Client->listExclusions($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $configServiceV2Client->listExclusions($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource whose exclusions are to be listed. - * - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" - * @param array $optionalArgs { - * Optional. - * - * @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 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 RetrySettings|array $retrySettings - * Retry settings to use for this call. 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 listExclusions($parent, array $optionalArgs = []) - { - $request = new ListExclusionsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListExclusions', $optionalArgs, ListExclusionsResponse::class, $request); - } - - /** - * Lists links. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedParent = $configServiceV2Client->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - * // Iterate over pages of elements - * $pagedResponse = $configServiceV2Client->listLinks($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $configServiceV2Client->listLinks($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource whose links are to be listed: - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/ - * @param array $optionalArgs { - * Optional. - * - * @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 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 RetrySettings|array $retrySettings - * Retry settings to use for this call. 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 listLinks($parent, array $optionalArgs = []) - { - $request = new ListLinksRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLinks', $optionalArgs, ListLinksResponse::class, $request); - } - - /** - * Lists sinks. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedParent = $configServiceV2Client->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $configServiceV2Client->listSinks($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $configServiceV2Client->listSinks($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource whose sinks are to be listed: - * - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" - * @param array $optionalArgs { - * Optional. - * - * @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 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 RetrySettings|array $retrySettings - * Retry settings to use for this call. 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 listSinks($parent, array $optionalArgs = []) - { - $request = new ListSinksRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListSinks', $optionalArgs, ListSinksResponse::class, $request); - } - - /** - * Lists views on a log bucket. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $parent = 'parent'; - * // Iterate over pages of elements - * $pagedResponse = $configServiceV2Client->listViews($parent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $configServiceV2Client->listViews($parent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $parent Required. The bucket whose views are to be listed: - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * @param array $optionalArgs { - * Optional. - * - * @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 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 RetrySettings|array $retrySettings - * Retry settings to use for this call. 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 listViews($parent, array $optionalArgs = []) - { - $request = new ListViewsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListViews', $optionalArgs, ListViewsResponse::class, $request); - } - - /** - * Undeletes a log bucket. A bucket that has been deleted can be undeleted - * within the grace period of 7 days. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedName = $configServiceV2Client->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - * $configServiceV2Client->undeleteBucket($formattedName); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $name Required. The full resource name of the bucket to undelete. - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * - * For example: - * - * `"projects/my-project/locations/global/buckets/my-bucket"` - * @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 undeleteBucket($name, array $optionalArgs = []) - { - $request = new UndeleteBucketRequest(); - $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('UndeleteBucket', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a log bucket. - * - * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then - * `FAILED_PRECONDITION` will be returned. - * - * After a bucket has been created, the bucket's location cannot be changed. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedName = $configServiceV2Client->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - * $bucket = new LogBucket(); - * $updateMask = new FieldMask(); - * $response = $configServiceV2Client->updateBucket($formattedName, $bucket, $updateMask); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $name Required. The full resource name of the bucket to update. - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * - * For example: - * - * `"projects/my-project/locations/global/buckets/my-bucket"` - * @param LogBucket $bucket Required. The updated bucket. - * @param FieldMask $updateMask Required. Field mask that specifies the fields in `bucket` that need an - * update. A bucket field will be overwritten if, and only if, it is in the - * update mask. `name` and output only fields cannot be updated. - * - * For a detailed `FieldMask` definition, see: - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * - * For example: `updateMask=retention_days` - * @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\Logging\V2\LogBucket - * - * @throws ApiException if the remote call fails - */ - public function updateBucket($name, $bucket, $updateMask, array $optionalArgs = []) - { - $request = new UpdateBucketRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setBucket($bucket); - $request->setUpdateMask($updateMask); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateBucket', LogBucket::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a log bucket asynchronously. - * - * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then - * `FAILED_PRECONDITION` will be returned. - * - * After a bucket has been created, the bucket's location cannot be changed. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedName = $configServiceV2Client->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - * $bucket = new LogBucket(); - * $updateMask = new FieldMask(); - * $operationResponse = $configServiceV2Client->updateBucketAsync($formattedName, $bucket, $updateMask); - * $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 = $configServiceV2Client->updateBucketAsync($formattedName, $bucket, $updateMask); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $configServiceV2Client->resumeOperation($operationName, 'updateBucketAsync'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $name Required. The full resource name of the bucket to update. - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * - * For example: - * - * `"projects/my-project/locations/global/buckets/my-bucket"` - * @param LogBucket $bucket Required. The updated bucket. - * @param FieldMask $updateMask Required. Field mask that specifies the fields in `bucket` that need an - * update. A bucket field will be overwritten if, and only if, it is in the - * update mask. `name` and output only fields cannot be updated. - * - * For a detailed `FieldMask` definition, see: - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * - * For example: `updateMask=retention_days` - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateBucketAsync($name, $bucket, $updateMask, array $optionalArgs = []) - { - $request = new UpdateBucketRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setBucket($bucket); - $request->setUpdateMask($updateMask); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateBucketAsync', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the Log Router CMEK settings for the given resource. - * - * Note: CMEK for the Log Router can currently only be configured for Google - * Cloud organizations. Once configured, it applies to all projects and - * folders in the Google Cloud organization. - * - * [UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings] - * will fail if 1) `kms_key_name` is invalid, or 2) the associated service - * account does not have the required - * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or - * 3) access to the key is disabled. - * - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $response = $configServiceV2Client->updateCmekSettings(); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Required. The resource name for the CMEK settings to update. - * - * "projects/[PROJECT_ID]/cmekSettings" - * "organizations/[ORGANIZATION_ID]/cmekSettings" - * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" - * "folders/[FOLDER_ID]/cmekSettings" - * - * For example: - * - * `"organizations/12345/cmekSettings"` - * - * Note: CMEK for the Log Router can currently only be configured for Google - * Cloud organizations. Once configured, it applies to all projects and - * folders in the Google Cloud organization. - * @type CmekSettings $cmekSettings - * Required. The CMEK settings to update. - * - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * @type FieldMask $updateMask - * Optional. Field mask identifying which fields from `cmek_settings` should - * be updated. A field will be overwritten if and only if it is in the update - * mask. Output only fields cannot be updated. - * - * See [FieldMask][google.protobuf.FieldMask] for more information. - * - * For example: `"updateMask=kmsKeyName"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. 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\Logging\V2\CmekSettings - * - * @throws ApiException if the remote call fails - */ - public function updateCmekSettings(array $optionalArgs = []) - { - $request = new UpdateCmekSettingsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['cmekSettings'])) { - $request->setCmekSettings($optionalArgs['cmekSettings']); - } - - 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('UpdateCmekSettings', CmekSettings::class, $optionalArgs, $request)->wait(); - } - - /** - * Changes one or more properties of an existing exclusion in the _Default - * sink. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedName = $configServiceV2Client->logExclusionName('[PROJECT]', '[EXCLUSION]'); - * $exclusion = new LogExclusion(); - * $updateMask = new FieldMask(); - * $response = $configServiceV2Client->updateExclusion($formattedName, $exclusion, $updateMask); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the exclusion to update: - * - * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - * - * For example: - * - * `"projects/my-project/exclusions/my-exclusion"` - * @param LogExclusion $exclusion Required. New values for the existing exclusion. Only the fields specified - * in `update_mask` are relevant. - * @param FieldMask $updateMask Required. A non-empty list of fields to change in the existing exclusion. - * New values for the fields are taken from the corresponding fields in the - * [LogExclusion][google.logging.v2.LogExclusion] included in this request. - * Fields not mentioned in `update_mask` are not changed and are ignored in - * the request. - * - * For example, to change the filter and description of an exclusion, - * specify an `update_mask` of `"filter,description"`. - * @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\Logging\V2\LogExclusion - * - * @throws ApiException if the remote call fails - */ - public function updateExclusion($name, $exclusion, $updateMask, array $optionalArgs = []) - { - $request = new UpdateExclusionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setExclusion($exclusion); - $request->setUpdateMask($updateMask); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateExclusion', LogExclusion::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates the Log Router settings for the given resource. - * - * Note: Settings for the Log Router can currently only be configured for - * Google Cloud organizations. Once configured, it applies to all projects and - * folders in the Google Cloud organization. - * - * [UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings] - * will fail if 1) `kms_key_name` is invalid, or 2) the associated service - * account does not have the required - * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or - * 3) access to the key is disabled. 4) `location_id` is not supported by - * Logging. 5) `location_id` violate OrgPolicy. - * - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $name = 'name'; - * $settings = new Settings(); - * $response = $configServiceV2Client->updateSettings($name, $settings); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $name Required. The resource name for the settings to update. - * - * "organizations/[ORGANIZATION_ID]/settings" - * - * For example: - * - * `"organizations/12345/settings"` - * - * Note: Settings for the Log Router can currently only be configured for - * Google Cloud organizations. Once configured, it applies to all projects and - * folders in the Google Cloud organization. - * @param Settings $settings Required. The settings to update. - * - * See [Enabling CMEK for Log - * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) - * for more information. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. Field mask identifying which fields from `settings` should - * be updated. A field will be overwritten if and only if it is in the update - * mask. Output only fields cannot be updated. - * - * See [FieldMask][google.protobuf.FieldMask] for more information. - * - * For example: `"updateMask=kmsKeyName"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. 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\Logging\V2\Settings - * - * @throws ApiException if the remote call fails - */ - public function updateSettings($name, $settings, array $optionalArgs = []) - { - $request = new UpdateSettingsRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setSettings($settings); - $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('UpdateSettings', Settings::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a sink. This method replaces the following fields in the existing - * sink with values from the new sink: `destination`, and `filter`. - * - * The updated sink might also have a new `writer_identity`; see the - * `unique_writer_identity` field. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $formattedSinkName = $configServiceV2Client->logSinkName('[PROJECT]', '[SINK]'); - * $sink = new LogSink(); - * $response = $configServiceV2Client->updateSink($formattedSinkName, $sink); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $sinkName Required. The full resource name of the sink to update, including the - * parent resource and the sink identifier: - * - * "projects/[PROJECT_ID]/sinks/[SINK_ID]" - * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * - * For example: - * - * `"projects/my-project/sinks/my-sink"` - * @param LogSink $sink Required. The updated sink, whose name is the same identifier that appears - * as part of `sink_name`. - * @param array $optionalArgs { - * Optional. - * - * @type bool $uniqueWriterIdentity - * Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] - * for a description of this field. When updating a sink, the effect of this - * field on the value of `writer_identity` in the updated sink depends on both - * the old and new values of this field: - * - * + If the old and new values of this field are both false or both true, - * then there is no change to the sink's `writer_identity`. - * + If the old value is false and the new value is true, then - * `writer_identity` is changed to a unique service account. - * + It is an error if the old value is true and the new value is - * set to false or defaulted to false. - * @type FieldMask $updateMask - * Optional. Field mask that specifies the fields in `sink` that need - * an update. A sink field will be overwritten if, and only if, it is - * in the update mask. `name` and output only fields cannot be updated. - * - * An empty `updateMask` is temporarily treated as using the following mask - * for backwards compatibility purposes: - * - * `destination,filter,includeChildren` - * - * At some point in the future, behavior will be removed and specifying an - * empty `updateMask` will be an error. - * - * For a detailed `FieldMask` definition, see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * - * For example: `updateMask=filter` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. 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\Logging\V2\LogSink - * - * @throws ApiException if the remote call fails - */ - public function updateSink($sinkName, $sink, array $optionalArgs = []) - { - $request = new UpdateSinkRequest(); - $requestParamHeaders = []; - $request->setSinkName($sinkName); - $request->setSink($sink); - $requestParamHeaders['sink_name'] = $sinkName; - if (isset($optionalArgs['uniqueWriterIdentity'])) { - $request->setUniqueWriterIdentity($optionalArgs['uniqueWriterIdentity']); - } - - 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('UpdateSink', LogSink::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a view on a log bucket. This method replaces the following fields - * in the existing view with values from the new view: `filter`. - * If an `UNAVAILABLE` error is returned, this indicates that system is not in - * a state where it can update the view. If this occurs, please try again in a - * few minutes. - * - * Sample code: - * ``` - * $configServiceV2Client = new ConfigServiceV2Client(); - * try { - * $name = 'name'; - * $view = new LogView(); - * $response = $configServiceV2Client->updateView($name, $view); - * } finally { - * $configServiceV2Client->close(); - * } - * ``` - * - * @param string $name Required. The full resource name of the view to update - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * - * For example: - * - * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` - * @param LogView $view Required. The updated view. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. Field mask that specifies the fields in `view` that need - * an update. A field will be overwritten if, and only if, it is - * in the update mask. `name` and output only fields cannot be updated. - * - * For a detailed `FieldMask` definition, see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * - * For example: `updateMask=filter` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. 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\Logging\V2\LogView - * - * @throws ApiException if the remote call fails - */ - public function updateView($name, $view, array $optionalArgs = []) - { - $request = new UpdateViewRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setView($view); - $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('UpdateView', LogView::class, $optionalArgs, $request)->wait(); - } -} diff --git a/owl-bot-staging/Logging/v2/src/V2/Gapic/LoggingServiceV2GapicClient.php b/owl-bot-staging/Logging/v2/src/V2/Gapic/LoggingServiceV2GapicClient.php deleted file mode 100644 index 6ff51b575efe..000000000000 --- a/owl-bot-staging/Logging/v2/src/V2/Gapic/LoggingServiceV2GapicClient.php +++ /dev/null @@ -1,993 +0,0 @@ -logName('[PROJECT]', '[LOG]'); - * $loggingServiceV2Client->deleteLog($formattedLogName); - * } finally { - * $loggingServiceV2Client->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. - */ -class LoggingServiceV2GapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.logging.v2.LoggingServiceV2'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'logging.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - 'https://www.googleapis.com/auth/logging.admin', - 'https://www.googleapis.com/auth/logging.read', - 'https://www.googleapis.com/auth/logging.write', - ]; - - private static $billingAccountNameTemplate; - - private static $billingAccountLogNameTemplate; - - private static $folderNameTemplate; - - private static $folderLogNameTemplate; - - private static $logNameTemplate; - - private static $organizationNameTemplate; - - private static $organizationLogNameTemplate; - - private static $projectNameTemplate; - - private static $projectLogNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/logging_service_v2_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/logging_service_v2_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/logging_service_v2_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/logging_service_v2_rest_client_config.php', - ], - ], - ]; - } - - private static function getBillingAccountNameTemplate() - { - if (self::$billingAccountNameTemplate == null) { - self::$billingAccountNameTemplate = new PathTemplate('billingAccounts/{billing_account}'); - } - - return self::$billingAccountNameTemplate; - } - - private static function getBillingAccountLogNameTemplate() - { - if (self::$billingAccountLogNameTemplate == null) { - self::$billingAccountLogNameTemplate = new PathTemplate('billingAccounts/{billing_account}/logs/{log}'); - } - - return self::$billingAccountLogNameTemplate; - } - - private static function getFolderNameTemplate() - { - if (self::$folderNameTemplate == null) { - self::$folderNameTemplate = new PathTemplate('folders/{folder}'); - } - - return self::$folderNameTemplate; - } - - private static function getFolderLogNameTemplate() - { - if (self::$folderLogNameTemplate == null) { - self::$folderLogNameTemplate = new PathTemplate('folders/{folder}/logs/{log}'); - } - - return self::$folderLogNameTemplate; - } - - private static function getLogNameTemplate() - { - if (self::$logNameTemplate == null) { - self::$logNameTemplate = new PathTemplate('projects/{project}/logs/{log}'); - } - - return self::$logNameTemplate; - } - - private static function getOrganizationNameTemplate() - { - if (self::$organizationNameTemplate == null) { - self::$organizationNameTemplate = new PathTemplate('organizations/{organization}'); - } - - return self::$organizationNameTemplate; - } - - private static function getOrganizationLogNameTemplate() - { - if (self::$organizationLogNameTemplate == null) { - self::$organizationLogNameTemplate = new PathTemplate('organizations/{organization}/logs/{log}'); - } - - return self::$organizationLogNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getProjectLogNameTemplate() - { - if (self::$projectLogNameTemplate == null) { - self::$projectLogNameTemplate = new PathTemplate('projects/{project}/logs/{log}'); - } - - return self::$projectLogNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'billingAccount' => self::getBillingAccountNameTemplate(), - 'billingAccountLog' => self::getBillingAccountLogNameTemplate(), - 'folder' => self::getFolderNameTemplate(), - 'folderLog' => self::getFolderLogNameTemplate(), - 'log' => self::getLogNameTemplate(), - 'organization' => self::getOrganizationNameTemplate(), - 'organizationLog' => self::getOrganizationLogNameTemplate(), - 'project' => self::getProjectNameTemplate(), - 'projectLog' => self::getProjectLogNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account resource. - * - * @param string $billingAccount - * - * @return string The formatted billing_account resource. - */ - public static function billingAccountName($billingAccount) - { - return self::getBillingAccountNameTemplate()->render([ - 'billing_account' => $billingAccount, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_log resource. - * - * @param string $billingAccount - * @param string $log - * - * @return string The formatted billing_account_log resource. - */ - public static function billingAccountLogName($billingAccount, $log) - { - return self::getBillingAccountLogNameTemplate()->render([ - 'billing_account' => $billingAccount, - 'log' => $log, - ]); - } - - /** - * 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($folder) - { - return self::getFolderNameTemplate()->render([ - 'folder' => $folder, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a folder_log - * resource. - * - * @param string $folder - * @param string $log - * - * @return string The formatted folder_log resource. - */ - public static function folderLogName($folder, $log) - { - return self::getFolderLogNameTemplate()->render([ - 'folder' => $folder, - 'log' => $log, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a log - * resource. - * - * @param string $project - * @param string $log - * - * @return string The formatted log resource. - */ - public static function logName($project, $log) - { - return self::getLogNameTemplate()->render([ - 'project' => $project, - 'log' => $log, - ]); - } - - /** - * 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($organization) - { - return self::getOrganizationNameTemplate()->render([ - 'organization' => $organization, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_log resource. - * - * @param string $organization - * @param string $log - * - * @return string The formatted organization_log resource. - */ - public static function organizationLogName($organization, $log) - { - return self::getOrganizationLogNameTemplate()->render([ - 'organization' => $organization, - 'log' => $log, - ]); - } - - /** - * 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 project_log - * resource. - * - * @param string $project - * @param string $log - * - * @return string The formatted project_log resource. - */ - public static function projectLogName($project, $log) - { - return self::getProjectLogNameTemplate()->render([ - 'project' => $project, - 'log' => $log, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - billingAccount: billingAccounts/{billing_account} - * - billingAccountLog: billingAccounts/{billing_account}/logs/{log} - * - folder: folders/{folder} - * - folderLog: folders/{folder}/logs/{log} - * - log: projects/{project}/logs/{log} - * - organization: organizations/{organization} - * - organizationLog: organizations/{organization}/logs/{log} - * - project: projects/{project} - * - projectLog: projects/{project}/logs/{log} - * - * 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 'logging.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); - } - - /** - * Deletes all the log entries in a log for the _Default Log Bucket. The log - * reappears if it receives new entries. Log entries written shortly before - * the delete operation might not be deleted. Entries received after the - * delete operation with a timestamp before the operation will be deleted. - * - * Sample code: - * ``` - * $loggingServiceV2Client = new LoggingServiceV2Client(); - * try { - * $formattedLogName = $loggingServiceV2Client->logName('[PROJECT]', '[LOG]'); - * $loggingServiceV2Client->deleteLog($formattedLogName); - * } finally { - * $loggingServiceV2Client->close(); - * } - * ``` - * - * @param string $logName Required. The resource name of the log to delete: - * - * * `projects/[PROJECT_ID]/logs/[LOG_ID]` - * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` - * * `folders/[FOLDER_ID]/logs/[LOG_ID]` - * - * `[LOG_ID]` must be URL-encoded. For example, - * `"projects/my-project-id/logs/syslog"`, - * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. - * - * For more information about log names, see - * [LogEntry][google.logging.v2.LogEntry]. - * @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 deleteLog($logName, array $optionalArgs = []) - { - $request = new DeleteLogRequest(); - $requestParamHeaders = []; - $request->setLogName($logName); - $requestParamHeaders['log_name'] = $logName; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteLog', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists log entries. Use this method to retrieve log entries that originated - * from a project/folder/organization/billing account. For ways to export log - * entries, see [Exporting - * Logs](https://cloud.google.com/logging/docs/export). - * - * Sample code: - * ``` - * $loggingServiceV2Client = new LoggingServiceV2Client(); - * try { - * $formattedResourceNames = [ - * $loggingServiceV2Client->projectName('[PROJECT]'), - * ]; - * // Iterate over pages of elements - * $pagedResponse = $loggingServiceV2Client->listLogEntries($formattedResourceNames); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $loggingServiceV2Client->listLogEntries($formattedResourceNames); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $loggingServiceV2Client->close(); - * } - * ``` - * - * @param string[] $resourceNames Required. Names of one or more parent resources from which to - * retrieve log entries: - * - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * - * May alternatively be one or more views: - * - * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * - * Projects listed in the `project_ids` field are added to this list. - * A maximum of 100 resources may be specified in a single request. - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Optional. Only log entries that match the filter are returned. An empty - * filter matches all log entries in the resources listed in `resource_names`. - * Referencing a parent resource that is not listed in `resource_names` will - * cause the filter to return no results. The maximum length of a filter is - * 20,000 characters. - * @type string $orderBy - * Optional. How the results should be sorted. Presently, the only permitted - * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first - * option returns entries in order of increasing values of - * `LogEntry.timestamp` (oldest first), and the second option returns entries - * in order of decreasing timestamps (newest first). Entries with equal - * timestamps are returned in order of their `insert_id` values. - * @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 listLogEntries($resourceNames, array $optionalArgs = []) - { - $request = new ListLogEntriesRequest(); - $request->setResourceNames($resourceNames); - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - return $this->getPagedListResponse('ListLogEntries', $optionalArgs, ListLogEntriesResponse::class, $request); - } - - /** - * Lists the logs in projects, organizations, folders, or billing accounts. - * Only logs that have entries are listed. - * - * Sample code: - * ``` - * $loggingServiceV2Client = new LoggingServiceV2Client(); - * try { - * $formattedParent = $loggingServiceV2Client->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $loggingServiceV2Client->listLogs($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $loggingServiceV2Client->listLogs($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $loggingServiceV2Client->close(); - * } - * ``` - * - * @param string $parent Required. The resource name to list logs for: - * - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * @param array $optionalArgs { - * Optional. - * - * @type string[] $resourceNames - * Optional. List of resource names to list logs for: - * - * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * - * To support legacy queries, it could also be: - * - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * - * The resource name in the `parent` field is added to this list. - * @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 listLogs($parent, array $optionalArgs = []) - { - $request = new ListLogsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['resourceNames'])) { - $request->setResourceNames($optionalArgs['resourceNames']); - } - - 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('ListLogs', $optionalArgs, ListLogsResponse::class, $request); - } - - /** - * Lists the descriptors for monitored resource types used by Logging. - * - * Sample code: - * ``` - * $loggingServiceV2Client = new LoggingServiceV2Client(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $loggingServiceV2Client->listMonitoredResourceDescriptors(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $loggingServiceV2Client->listMonitoredResourceDescriptors(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $loggingServiceV2Client->close(); - * } - * ``` - * - * @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 listMonitoredResourceDescriptors(array $optionalArgs = []) - { - $request = new ListMonitoredResourceDescriptorsRequest(); - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - return $this->getPagedListResponse('ListMonitoredResourceDescriptors', $optionalArgs, ListMonitoredResourceDescriptorsResponse::class, $request); - } - - /** - * Streaming read of log entries as they are ingested. Until the stream is - * terminated, it will continue reading logs. - * - * Sample code: - * ``` - * $loggingServiceV2Client = new LoggingServiceV2Client(); - * try { - * $resourceNames = []; - * $request = new TailLogEntriesRequest(); - * $request->setResourceNames($resourceNames); - * // Write all requests to the server, then read all responses until the - * // stream is complete - * $requests = [ - * $request, - * ]; - * $stream = $loggingServiceV2Client->tailLogEntries(); - * $stream->writeAll($requests); - * foreach ($stream->closeWriteAndReadAll() as $element) { - * // doSomethingWith($element); - * } - * // Alternatively: - * // Write requests individually, making read() calls if - * // required. Call closeWrite() once writes are complete, and read the - * // remaining responses from the server. - * $requests = [ - * $request, - * ]; - * $stream = $loggingServiceV2Client->tailLogEntries(); - * foreach ($requests as $request) { - * $stream->write($request); - * // if required, read a single response from the stream - * $element = $stream->read(); - * // doSomethingWith($element) - * } - * $stream->closeWrite(); - * $element = $stream->read(); - * while (!is_null($element)) { - * // doSomethingWith($element) - * $element = $stream->read(); - * } - * } finally { - * $loggingServiceV2Client->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\BidiStream - * - * @throws ApiException if the remote call fails - */ - public function tailLogEntries(array $optionalArgs = []) - { - return $this->startCall('TailLogEntries', TailLogEntriesResponse::class, $optionalArgs, null, Call::BIDI_STREAMING_CALL); - } - - /** - * Writes log entries to Logging. This API method is the - * only way to send log entries to Logging. This method - * is used, directly or indirectly, by the Logging agent - * (fluentd) and all logging libraries configured to use Logging. - * A single request may contain log entries for a maximum of 1000 - * different resources (projects, organizations, billing accounts or - * folders) - * - * Sample code: - * ``` - * $loggingServiceV2Client = new LoggingServiceV2Client(); - * try { - * $entries = []; - * $response = $loggingServiceV2Client->writeLogEntries($entries); - * } finally { - * $loggingServiceV2Client->close(); - * } - * ``` - * - * @param LogEntry[] $entries Required. The log entries to send to Logging. The order of log - * entries in this list does not matter. Values supplied in this method's - * `log_name`, `resource`, and `labels` fields are copied into those log - * entries in this list that do not include values for their corresponding - * fields. For more information, see the - * [LogEntry][google.logging.v2.LogEntry] type. - * - * If the `timestamp` or `insert_id` fields are missing in log entries, then - * this method supplies the current time or a unique identifier, respectively. - * The supplied values are chosen so that, among the log entries that did not - * supply their own values, the entries earlier in the list will sort before - * the entries later in the list. See the `entries.list` method. - * - * Log entries with timestamps that are more than the - * [logs retention period](https://cloud.google.com/logging/quotas) in - * the past or more than 24 hours in the future will not be available when - * calling `entries.list`. However, those log entries can still be [exported - * with - * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). - * - * To improve throughput and to avoid exceeding the - * [quota limit](https://cloud.google.com/logging/quotas) for calls to - * `entries.write`, you should try to include several log entries in this - * list, rather than calling this method for each individual log entry. - * @param array $optionalArgs { - * Optional. - * - * @type string $logName - * Optional. A default log resource name that is assigned to all log entries - * in `entries` that do not specify a value for `log_name`: - * - * * `projects/[PROJECT_ID]/logs/[LOG_ID]` - * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` - * * `folders/[FOLDER_ID]/logs/[LOG_ID]` - * - * `[LOG_ID]` must be URL-encoded. For example: - * - * "projects/my-project-id/logs/syslog" - * "organizations/123/logs/cloudaudit.googleapis.com%2Factivity" - * - * The permission `logging.logEntries.create` is needed on each project, - * organization, billing account, or folder that is receiving new log - * entries, whether the resource is specified in `logName` or in an - * individual log entry. - * @type MonitoredResource $resource - * Optional. A default monitored resource object that is assigned to all log - * entries in `entries` that do not specify a value for `resource`. Example: - * - * { "type": "gce_instance", - * "labels": { - * "zone": "us-central1-a", "instance_id": "00000000000000000000" }} - * - * See [LogEntry][google.logging.v2.LogEntry]. - * @type array $labels - * Optional. Default labels that are added to the `labels` field of all log - * entries in `entries`. If a log entry already has a label with the same key - * as a label in this parameter, then the log entry's label is not changed. - * See [LogEntry][google.logging.v2.LogEntry]. - * @type bool $partialSuccess - * Optional. Whether a batch's valid entries should be written even if some - * other entry failed due to a permanent error such as INVALID_ARGUMENT or - * PERMISSION_DENIED. If any entry failed, then the response status is the - * response status of one of the failed entries. The response will include - * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by - * the entries' zero-based index in the `entries`. Failed requests for which - * no entries are written will not include per-entry errors. - * @type bool $dryRun - * Optional. If true, the request should expect normal response, but the - * entries won't be persisted nor exported. Useful for checking whether the - * logging API endpoints are working properly before sending valuable data. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. 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\Logging\V2\WriteLogEntriesResponse - * - * @throws ApiException if the remote call fails - */ - public function writeLogEntries($entries, array $optionalArgs = []) - { - $request = new WriteLogEntriesRequest(); - $request->setEntries($entries); - if (isset($optionalArgs['logName'])) { - $request->setLogName($optionalArgs['logName']); - } - - if (isset($optionalArgs['resource'])) { - $request->setResource($optionalArgs['resource']); - } - - if (isset($optionalArgs['labels'])) { - $request->setLabels($optionalArgs['labels']); - } - - if (isset($optionalArgs['partialSuccess'])) { - $request->setPartialSuccess($optionalArgs['partialSuccess']); - } - - if (isset($optionalArgs['dryRun'])) { - $request->setDryRun($optionalArgs['dryRun']); - } - - return $this->startCall('WriteLogEntries', WriteLogEntriesResponse::class, $optionalArgs, $request)->wait(); - } -} diff --git a/owl-bot-staging/Logging/v2/src/V2/Gapic/MetricsServiceV2GapicClient.php b/owl-bot-staging/Logging/v2/src/V2/Gapic/MetricsServiceV2GapicClient.php deleted file mode 100644 index 951f82e4defd..000000000000 --- a/owl-bot-staging/Logging/v2/src/V2/Gapic/MetricsServiceV2GapicClient.php +++ /dev/null @@ -1,525 +0,0 @@ -projectName('[PROJECT]'); - * $metric = new LogMetric(); - * $response = $metricsServiceV2Client->createLogMetric($formattedParent, $metric); - * } finally { - * $metricsServiceV2Client->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. - */ -class MetricsServiceV2GapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.logging.v2.MetricsServiceV2'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'logging.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - 'https://www.googleapis.com/auth/logging.admin', - 'https://www.googleapis.com/auth/logging.read', - 'https://www.googleapis.com/auth/logging.write', - ]; - - private static $logMetricNameTemplate; - - private static $projectNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/metrics_service_v2_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/metrics_service_v2_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/metrics_service_v2_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/metrics_service_v2_rest_client_config.php', - ], - ], - ]; - } - - private static function getLogMetricNameTemplate() - { - if (self::$logMetricNameTemplate == null) { - self::$logMetricNameTemplate = new PathTemplate('projects/{project}/metrics/{metric}'); - } - - return self::$logMetricNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'logMetric' => self::getLogMetricNameTemplate(), - 'project' => self::getProjectNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a log_metric - * resource. - * - * @param string $project - * @param string $metric - * - * @return string The formatted log_metric resource. - */ - public static function logMetricName($project, $metric) - { - return self::getLogMetricNameTemplate()->render([ - 'project' => $project, - 'metric' => $metric, - ]); - } - - /** - * 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, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - logMetric: projects/{project}/metrics/{metric} - * - 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($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 'logging.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); - } - - /** - * Creates a logs-based metric. - * - * Sample code: - * ``` - * $metricsServiceV2Client = new MetricsServiceV2Client(); - * try { - * $formattedParent = $metricsServiceV2Client->projectName('[PROJECT]'); - * $metric = new LogMetric(); - * $response = $metricsServiceV2Client->createLogMetric($formattedParent, $metric); - * } finally { - * $metricsServiceV2Client->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the project in which to create the metric: - * - * "projects/[PROJECT_ID]" - * - * The new metric must be provided in the request. - * @param LogMetric $metric Required. The new logs-based metric, which must not have an identifier that - * already exists. - * @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\Logging\V2\LogMetric - * - * @throws ApiException if the remote call fails - */ - public function createLogMetric($parent, $metric, array $optionalArgs = []) - { - $request = new CreateLogMetricRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setMetric($metric); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateLogMetric', LogMetric::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a logs-based metric. - * - * Sample code: - * ``` - * $metricsServiceV2Client = new MetricsServiceV2Client(); - * try { - * $formattedMetricName = $metricsServiceV2Client->logMetricName('[PROJECT]', '[METRIC]'); - * $metricsServiceV2Client->deleteLogMetric($formattedMetricName); - * } finally { - * $metricsServiceV2Client->close(); - * } - * ``` - * - * @param string $metricName Required. The resource name of the metric to delete: - * - * "projects/[PROJECT_ID]/metrics/[METRIC_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 - */ - public function deleteLogMetric($metricName, array $optionalArgs = []) - { - $request = new DeleteLogMetricRequest(); - $requestParamHeaders = []; - $request->setMetricName($metricName); - $requestParamHeaders['metric_name'] = $metricName; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteLogMetric', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a logs-based metric. - * - * Sample code: - * ``` - * $metricsServiceV2Client = new MetricsServiceV2Client(); - * try { - * $formattedMetricName = $metricsServiceV2Client->logMetricName('[PROJECT]', '[METRIC]'); - * $response = $metricsServiceV2Client->getLogMetric($formattedMetricName); - * } finally { - * $metricsServiceV2Client->close(); - * } - * ``` - * - * @param string $metricName Required. The resource name of the desired metric: - * - * "projects/[PROJECT_ID]/metrics/[METRIC_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\Logging\V2\LogMetric - * - * @throws ApiException if the remote call fails - */ - public function getLogMetric($metricName, array $optionalArgs = []) - { - $request = new GetLogMetricRequest(); - $requestParamHeaders = []; - $request->setMetricName($metricName); - $requestParamHeaders['metric_name'] = $metricName; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLogMetric', LogMetric::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists logs-based metrics. - * - * Sample code: - * ``` - * $metricsServiceV2Client = new MetricsServiceV2Client(); - * try { - * $formattedParent = $metricsServiceV2Client->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $metricsServiceV2Client->listLogMetrics($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $metricsServiceV2Client->listLogMetrics($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $metricsServiceV2Client->close(); - * } - * ``` - * - * @param string $parent Required. The name of the project containing the metrics: - * - * "projects/[PROJECT_ID]" - * @param array $optionalArgs { - * Optional. - * - * @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 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 RetrySettings|array $retrySettings - * Retry settings to use for this call. 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 listLogMetrics($parent, array $optionalArgs = []) - { - $request = new ListLogMetricsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLogMetrics', $optionalArgs, ListLogMetricsResponse::class, $request); - } - - /** - * Creates or updates a logs-based metric. - * - * Sample code: - * ``` - * $metricsServiceV2Client = new MetricsServiceV2Client(); - * try { - * $formattedMetricName = $metricsServiceV2Client->logMetricName('[PROJECT]', '[METRIC]'); - * $metric = new LogMetric(); - * $response = $metricsServiceV2Client->updateLogMetric($formattedMetricName, $metric); - * } finally { - * $metricsServiceV2Client->close(); - * } - * ``` - * - * @param string $metricName Required. The resource name of the metric to update: - * - * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - * - * The updated metric must be provided in the request and it's - * `name` field must be the same as `[METRIC_ID]` If the metric - * does not exist in `[PROJECT_ID]`, then a new metric is created. - * @param LogMetric $metric Required. The updated metric. - * @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\Logging\V2\LogMetric - * - * @throws ApiException if the remote call fails - */ - public function updateLogMetric($metricName, $metric, array $optionalArgs = []) - { - $request = new UpdateLogMetricRequest(); - $requestParamHeaders = []; - $request->setMetricName($metricName); - $request->setMetric($metric); - $requestParamHeaders['metric_name'] = $metricName; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateLogMetric', LogMetric::class, $optionalArgs, $request)->wait(); - } -} diff --git a/owl-bot-staging/Logging/v2/src/V2/LoggingServiceV2Client.php b/owl-bot-staging/Logging/v2/src/V2/LoggingServiceV2Client.php deleted file mode 100644 index d738ceb98d83..000000000000 --- a/owl-bot-staging/Logging/v2/src/V2/LoggingServiceV2Client.php +++ /dev/null @@ -1,34 +0,0 @@ - [ - 'google.logging.v2.ConfigServiceV2' => [ - 'CopyLogEntries' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Logging\V2\CopyLogEntriesResponse', - 'metadataReturnType' => '\Google\Cloud\Logging\V2\CopyLogEntriesMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateBucketAsync' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Logging\V2\LogBucket', - 'metadataReturnType' => '\Google\Cloud\Logging\V2\BucketMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateLink' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Logging\V2\Link', - 'metadataReturnType' => '\Google\Cloud\Logging\V2\LinkMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteLink' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Logging\V2\LinkMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateBucketAsync' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Logging\V2\LogBucket', - 'metadataReturnType' => '\Google\Cloud\Logging\V2\BucketMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListBuckets' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getBuckets', - ], - ], - 'ListExclusions' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getExclusions', - ], - ], - 'ListLinks' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLinks', - ], - ], - 'ListSinks' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getSinks', - ], - ], - 'ListViews' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getViews', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/Logging/v2/src/V2/resources/config_service_v2_rest_client_config.php b/owl-bot-staging/Logging/v2/src/V2/resources/config_service_v2_rest_client_config.php deleted file mode 100644 index dac023f81c6c..000000000000 --- a/owl-bot-staging/Logging/v2/src/V2/resources/config_service_v2_rest_client_config.php +++ /dev/null @@ -1,1147 +0,0 @@ - [ - 'google.logging.v2.ConfigServiceV2' => [ - 'CopyLogEntries' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/entries:copy', - 'body' => '*', - ], - 'CreateBucket' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=*/*/locations/*}/buckets', - 'body' => 'bucket', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/buckets', - 'body' => 'bucket', - 'queryParams' => [ - 'bucket_id', - ], - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=organizations/*/locations/*}/buckets', - 'body' => 'bucket', - 'queryParams' => [ - 'bucket_id', - ], - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=folders/*/locations/*}/buckets', - 'body' => 'bucket', - 'queryParams' => [ - 'bucket_id', - ], - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=billingAccounts/*/locations/*}/buckets', - 'body' => 'bucket', - 'queryParams' => [ - 'bucket_id', - ], - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'bucket_id', - ], - ], - 'CreateBucketAsync' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=*/*/locations/*}/buckets:createAsync', - 'body' => 'bucket', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/buckets:createAsync', - 'body' => 'bucket', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=organizations/*/locations/*}/buckets:createAsync', - 'body' => 'bucket', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=folders/*/locations/*}/buckets:createAsync', - 'body' => 'bucket', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=billingAccounts/*/locations/*}/buckets:createAsync', - 'body' => 'bucket', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateExclusion' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=*/*}/exclusions', - 'body' => 'exclusion', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*}/exclusions', - 'body' => 'exclusion', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=organizations/*}/exclusions', - 'body' => 'exclusion', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=folders/*}/exclusions', - 'body' => 'exclusion', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=billingAccounts/*}/exclusions', - 'body' => 'exclusion', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateLink' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=*/*/locations/*/buckets/*}/links', - 'body' => 'link', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/buckets/*}/links', - 'body' => 'link', - 'queryParams' => [ - 'link_id', - ], - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=organizations/*/locations/*/buckets/*}/links', - 'body' => 'link', - 'queryParams' => [ - 'link_id', - ], - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=folders/*/locations/*/buckets/*}/links', - 'body' => 'link', - 'queryParams' => [ - 'link_id', - ], - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=billingAccounts/*/locations/*/buckets/*}/links', - 'body' => 'link', - 'queryParams' => [ - 'link_id', - ], - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'link_id', - ], - ], - 'CreateSink' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=*/*}/sinks', - 'body' => 'sink', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*}/sinks', - 'body' => 'sink', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=organizations/*}/sinks', - 'body' => 'sink', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=folders/*}/sinks', - 'body' => 'sink', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=billingAccounts/*}/sinks', - 'body' => 'sink', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateView' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=*/*/locations/*/buckets/*}/views', - 'body' => 'view', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/buckets/*}/views', - 'body' => 'view', - 'queryParams' => [ - 'view_id', - ], - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=organizations/*/locations/*/buckets/*}/views', - 'body' => 'view', - 'queryParams' => [ - 'view_id', - ], - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=folders/*/locations/*/buckets/*}/views', - 'body' => 'view', - 'queryParams' => [ - 'view_id', - ], - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=billingAccounts/*/locations/*/buckets/*}/views', - 'body' => 'view', - 'queryParams' => [ - 'view_id', - ], - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'view_id', - ], - ], - 'DeleteBucket' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*}', - 'additionalBindings' => [ - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*}', - ], - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*}', - ], - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*}', - ], - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteExclusion' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=*/*/exclusions/*}', - 'additionalBindings' => [ - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/exclusions/*}', - ], - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=organizations/*/exclusions/*}', - ], - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=folders/*/exclusions/*}', - ], - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=billingAccounts/*/exclusions/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteLink' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*/links/*}', - 'additionalBindings' => [ - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*/links/*}', - ], - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*/links/*}', - ], - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*/links/*}', - ], - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*/links/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteSink' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{sink_name=*/*/sinks/*}', - 'additionalBindings' => [ - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{sink_name=projects/*/sinks/*}', - ], - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{sink_name=organizations/*/sinks/*}', - ], - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{sink_name=folders/*/sinks/*}', - ], - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{sink_name=billingAccounts/*/sinks/*}', - ], - ], - 'placeholders' => [ - 'sink_name' => [ - 'getters' => [ - 'getSinkName', - ], - ], - ], - ], - 'DeleteView' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*/views/*}', - 'additionalBindings' => [ - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*/views/*}', - ], - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*/views/*}', - ], - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*/views/*}', - ], - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetBucket' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetCmekSettings' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=*/*}/cmekSettings', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/cmekSettings', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=organizations/*}/cmekSettings', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=folders/*}/cmekSettings', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=billingAccounts/*}/cmekSettings', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetExclusion' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=*/*/exclusions/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/exclusions/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=organizations/*/exclusions/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=folders/*/exclusions/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=billingAccounts/*/exclusions/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetLink' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*/links/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*/links/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*/links/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*/links/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*/links/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetSettings' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=*/*}/settings', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/settings', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=organizations/*}/settings', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=folders/*}/settings', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=billingAccounts/*}/settings', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetSink' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{sink_name=*/*/sinks/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{sink_name=projects/*/sinks/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{sink_name=organizations/*/sinks/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{sink_name=folders/*/sinks/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{sink_name=billingAccounts/*/sinks/*}', - ], - ], - 'placeholders' => [ - 'sink_name' => [ - 'getters' => [ - 'getSinkName', - ], - ], - ], - ], - 'GetView' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*/views/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*/views/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*/views/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*/views/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListBuckets' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=*/*/locations/*}/buckets', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/buckets', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=organizations/*/locations/*}/buckets', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=folders/*/locations/*}/buckets', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=billingAccounts/*/locations/*}/buckets', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListExclusions' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=*/*}/exclusions', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*}/exclusions', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=organizations/*}/exclusions', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=folders/*}/exclusions', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=billingAccounts/*}/exclusions', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListLinks' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=*/*/locations/*/buckets/*}/links', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/buckets/*}/links', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=organizations/*/locations/*/buckets/*}/links', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=folders/*/locations/*/buckets/*}/links', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=billingAccounts/*/locations/*/buckets/*}/links', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListSinks' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=*/*}/sinks', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*}/sinks', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=organizations/*}/sinks', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=folders/*}/sinks', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=billingAccounts/*}/sinks', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListViews' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=*/*/locations/*/buckets/*}/views', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/buckets/*}/views', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=organizations/*/locations/*/buckets/*}/views', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=folders/*/locations/*/buckets/*}/views', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=billingAccounts/*/locations/*/buckets/*}/views', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UndeleteBucket' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*}:undelete', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*}:undelete', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*}:undelete', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*}:undelete', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*}:undelete', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'UpdateBucket' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*}', - 'body' => 'bucket', - 'additionalBindings' => [ - [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*}', - 'body' => 'bucket', - 'queryParams' => [ - 'update_mask', - ], - ], - [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*}', - 'body' => 'bucket', - 'queryParams' => [ - 'update_mask', - ], - ], - [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*}', - 'body' => 'bucket', - 'queryParams' => [ - 'update_mask', - ], - ], - [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*}', - 'body' => 'bucket', - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - 'UpdateBucketAsync' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*}:updateAsync', - 'body' => 'bucket', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*}:updateAsync', - 'body' => 'bucket', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*}:updateAsync', - 'body' => 'bucket', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*}:updateAsync', - 'body' => 'bucket', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*}:updateAsync', - 'body' => 'bucket', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'UpdateCmekSettings' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{name=*/*}/cmekSettings', - 'body' => 'cmek_settings', - 'additionalBindings' => [ - [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{name=organizations/*}/cmekSettings', - 'body' => 'cmek_settings', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'UpdateExclusion' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{name=*/*/exclusions/*}', - 'body' => 'exclusion', - 'additionalBindings' => [ - [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{name=projects/*/exclusions/*}', - 'body' => 'exclusion', - 'queryParams' => [ - 'update_mask', - ], - ], - [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{name=organizations/*/exclusions/*}', - 'body' => 'exclusion', - 'queryParams' => [ - 'update_mask', - ], - ], - [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{name=folders/*/exclusions/*}', - 'body' => 'exclusion', - 'queryParams' => [ - 'update_mask', - ], - ], - [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{name=billingAccounts/*/exclusions/*}', - 'body' => 'exclusion', - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - 'UpdateSettings' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{name=*/*}/settings', - 'body' => 'settings', - 'additionalBindings' => [ - [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{name=organizations/*}/settings', - 'body' => 'settings', - ], - [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{name=folders/*}/settings', - 'body' => 'settings', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'UpdateSink' => [ - 'method' => 'put', - 'uriTemplate' => '/v2/{sink_name=*/*/sinks/*}', - 'body' => 'sink', - 'additionalBindings' => [ - [ - 'method' => 'put', - 'uriTemplate' => '/v2/{sink_name=projects/*/sinks/*}', - 'body' => 'sink', - ], - [ - 'method' => 'put', - 'uriTemplate' => '/v2/{sink_name=organizations/*/sinks/*}', - 'body' => 'sink', - ], - [ - 'method' => 'put', - 'uriTemplate' => '/v2/{sink_name=folders/*/sinks/*}', - 'body' => 'sink', - ], - [ - 'method' => 'put', - 'uriTemplate' => '/v2/{sink_name=billingAccounts/*/sinks/*}', - 'body' => 'sink', - ], - [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{sink_name=projects/*/sinks/*}', - 'body' => 'sink', - ], - [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{sink_name=organizations/*/sinks/*}', - 'body' => 'sink', - ], - [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{sink_name=folders/*/sinks/*}', - 'body' => 'sink', - ], - [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{sink_name=billingAccounts/*/sinks/*}', - 'body' => 'sink', - ], - ], - 'placeholders' => [ - 'sink_name' => [ - 'getters' => [ - 'getSinkName', - ], - ], - ], - ], - 'UpdateView' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{name=*/*/locations/*/buckets/*/views/*}', - 'body' => 'view', - 'additionalBindings' => [ - [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/buckets/*/views/*}', - 'body' => 'view', - ], - [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{name=organizations/*/locations/*/buckets/*/views/*}', - 'body' => 'view', - ], - [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{name=folders/*/locations/*/buckets/*/views/*}', - 'body' => 'view', - ], - [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}', - 'body' => 'view', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=*/*/locations/*/operations/*}:cancel', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=organizations/*/locations/*/operations/*}:cancel', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=folders/*/locations/*/operations/*}:cancel', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/operations/*}:cancel', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=*/*/locations/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=organizations/*/locations/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=folders/*/locations/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=*/*/locations/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=organizations/*/locations/*}/operations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=folders/*/locations/*}/operations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_client_config.json b/owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_client_config.json deleted file mode 100644 index f5ac1a4d058e..000000000000 --- a/owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_client_config.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "interfaces": { - "google.logging.v2.LoggingServiceV2": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "DEADLINE_EXCEEDED", - "INTERNAL", - "UNAVAILABLE" - ], - "retry_policy_2_codes": [ - "DEADLINE_EXCEEDED", - "INTERNAL", - "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": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 3600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 3600000, - "total_timeout_millis": 3600000 - } - }, - "methods": { - "DeleteLog": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListLogEntries": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListLogs": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListMonitoredResourceDescriptors": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "TailLogEntries": { - "timeout_millis": 3600000 - }, - "WriteLogEntries": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params", - "bundling": { - "delay_threshold_millis": 50, - "element_count_threshold": 1000, - "request_byte_threshold": 1048576 - } - } - } - } - } -} diff --git a/owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_descriptor_config.php b/owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_descriptor_config.php deleted file mode 100644 index dccb09092992..000000000000 --- a/owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_descriptor_config.php +++ /dev/null @@ -1,43 +0,0 @@ - [ - 'google.logging.v2.LoggingServiceV2' => [ - 'ListLogEntries' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getEntries', - ], - ], - 'ListLogs' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLogNames', - ], - ], - 'ListMonitoredResourceDescriptors' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getResourceDescriptors', - ], - ], - 'TailLogEntries' => [ - 'grpcStreaming' => [ - 'grpcStreamingType' => 'BidiStreaming', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_rest_client_config.php b/owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_rest_client_config.php deleted file mode 100644 index 00e4c2f5ffa8..000000000000 --- a/owl-bot-staging/Logging/v2/src/V2/resources/logging_service_v2_rest_client_config.php +++ /dev/null @@ -1,191 +0,0 @@ - [ - 'google.logging.v2.LoggingServiceV2' => [ - 'DeleteLog' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{log_name=projects/*/logs/*}', - 'additionalBindings' => [ - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{log_name=*/*/logs/*}', - ], - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{log_name=organizations/*/logs/*}', - ], - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{log_name=folders/*/logs/*}', - ], - [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{log_name=billingAccounts/*/logs/*}', - ], - ], - 'placeholders' => [ - 'log_name' => [ - 'getters' => [ - 'getLogName', - ], - ], - ], - ], - 'ListLogEntries' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/entries:list', - 'body' => '*', - ], - 'ListLogs' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=*/*}/logs', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*}/logs', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=organizations/*}/logs', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=folders/*}/logs', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=billingAccounts/*}/logs', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/buckets/*/views/*}/logs', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=organizations/*/locations/*/buckets/*/views/*}/logs', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=folders/*/locations/*/buckets/*/views/*}/logs', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=billingAccounts/*/locations/*/buckets/*/views/*}/logs', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListMonitoredResourceDescriptors' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/monitoredResourceDescriptors', - ], - 'WriteLogEntries' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/entries:write', - 'body' => '*', - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=*/*/locations/*/operations/*}:cancel', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=organizations/*/locations/*/operations/*}:cancel', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=folders/*/locations/*/operations/*}:cancel', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/operations/*}:cancel', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=*/*/locations/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=organizations/*/locations/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=folders/*/locations/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=*/*/locations/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=organizations/*/locations/*}/operations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=folders/*/locations/*}/operations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_client_config.json b/owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_client_config.json deleted file mode 100644 index 8d1153764e81..000000000000 --- a/owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_client_config.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "interfaces": { - "google.logging.v2.MetricsServiceV2": { - "retry_codes": { - "no_retry_codes": [], - "no_retry_1_codes": [], - "retry_policy_4_codes": [ - "DEADLINE_EXCEEDED", - "INTERNAL", - "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 - }, - "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 - }, - "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": { - "CreateLogMetric": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteLogMetric": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_4_codes", - "retry_params_name": "retry_policy_4_params" - }, - "GetLogMetric": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_4_codes", - "retry_params_name": "retry_policy_4_params" - }, - "ListLogMetrics": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_4_codes", - "retry_params_name": "retry_policy_4_params" - }, - "UpdateLogMetric": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_4_codes", - "retry_params_name": "retry_policy_4_params" - } - } - } - } -} diff --git a/owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_descriptor_config.php b/owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_descriptor_config.php deleted file mode 100644 index d0dfc9cbfe12..000000000000 --- a/owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_descriptor_config.php +++ /dev/null @@ -1,18 +0,0 @@ - [ - 'google.logging.v2.MetricsServiceV2' => [ - 'ListLogMetrics' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getMetrics', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_rest_client_config.php b/owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_rest_client_config.php deleted file mode 100644 index 9d07868f5bec..000000000000 --- a/owl-bot-staging/Logging/v2/src/V2/resources/metrics_service_v2_rest_client_config.php +++ /dev/null @@ -1,160 +0,0 @@ - [ - 'google.logging.v2.MetricsServiceV2' => [ - 'CreateLogMetric' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*}/metrics', - 'body' => 'metric', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteLogMetric' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{metric_name=projects/*/metrics/*}', - 'placeholders' => [ - 'metric_name' => [ - 'getters' => [ - 'getMetricName', - ], - ], - ], - ], - 'GetLogMetric' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{metric_name=projects/*/metrics/*}', - 'placeholders' => [ - 'metric_name' => [ - 'getters' => [ - 'getMetricName', - ], - ], - ], - ], - 'ListLogMetrics' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*}/metrics', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateLogMetric' => [ - 'method' => 'put', - 'uriTemplate' => '/v2/{metric_name=projects/*/metrics/*}', - 'body' => 'metric', - 'placeholders' => [ - 'metric_name' => [ - 'getters' => [ - 'getMetricName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=*/*/locations/*/operations/*}:cancel', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=organizations/*/locations/*/operations/*}:cancel', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=folders/*/locations/*/operations/*}:cancel', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/operations/*}:cancel', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=*/*/locations/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=organizations/*/locations/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=folders/*/locations/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=*/*/locations/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=organizations/*/locations/*}/operations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=folders/*/locations/*}/operations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=billingAccounts/*/locations/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Logging/v2/tests/Unit/V2/ConfigServiceV2ClientTest.php b/owl-bot-staging/Logging/v2/tests/Unit/V2/ConfigServiceV2ClientTest.php deleted file mode 100644 index 1dc001d1440e..000000000000 --- a/owl-bot-staging/Logging/v2/tests/Unit/V2/ConfigServiceV2ClientTest.php +++ /dev/null @@ -1,2555 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ConfigServiceV2Client */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ConfigServiceV2Client($options); - } - - /** @test */ - public function copyLogEntriesTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/copyLogEntriesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $logEntriesCopiedCount = 2134326978; - $expectedResponse = new CopyLogEntriesResponse(); - $expectedResponse->setLogEntriesCopiedCount($logEntriesCopiedCount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/copyLogEntriesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $destination = 'destination-1429847026'; - $response = $gapicClient->copyLogEntries($name, $destination); - $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.logging.v2.ConfigServiceV2/CopyLogEntries', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualApiRequestObject->getDestination(); - $this->assertProtobufEquals($destination, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/copyLogEntriesTest'); - $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 copyLogEntriesExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/copyLogEntriesTest'); - $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'; - $destination = 'destination-1429847026'; - $response = $gapicClient->copyLogEntries($name, $destination); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/copyLogEntriesTest'); - 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 createBucketTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $retentionDays = 1544391896; - $locked = true; - $analyticsEnabled = true; - $expectedResponse = new LogBucket(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setRetentionDays($retentionDays); - $expectedResponse->setLocked($locked); - $expectedResponse->setAnalyticsEnabled($analyticsEnabled); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); - $bucketId = 'bucketId1837164432'; - $bucket = new LogBucket(); - $response = $gapicClient->createBucket($formattedParent, $bucketId, $bucket); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/CreateBucket', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getBucketId(); - $this->assertProtobufEquals($bucketId, $actualValue); - $actualValue = $actualRequestObject->getBucket(); - $this->assertProtobufEquals($bucket, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createBucketExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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]'); - $bucketId = 'bucketId1837164432'; - $bucket = new LogBucket(); - try { - $gapicClient->createBucket($formattedParent, $bucketId, $bucket); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createBucketAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBucketAsyncTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $retentionDays = 1544391896; - $locked = true; - $analyticsEnabled = true; - $expectedResponse = new LogBucket(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setRetentionDays($retentionDays); - $expectedResponse->setLocked($locked); - $expectedResponse->setAnalyticsEnabled($analyticsEnabled); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createBucketAsyncTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); - $bucketId = 'bucketId1837164432'; - $bucket = new LogBucket(); - $response = $gapicClient->createBucketAsync($formattedParent, $bucketId, $bucket); - $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.logging.v2.ConfigServiceV2/CreateBucketAsync', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getBucketId(); - $this->assertProtobufEquals($bucketId, $actualValue); - $actualValue = $actualApiRequestObject->getBucket(); - $this->assertProtobufEquals($bucket, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBucketAsyncTest'); - $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 createBucketAsyncExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBucketAsyncTest'); - $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]'); - $bucketId = 'bucketId1837164432'; - $bucket = new LogBucket(); - $response = $gapicClient->createBucketAsync($formattedParent, $bucketId, $bucket); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBucketAsyncTest'); - 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 createExclusionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $filter = 'filter-1274492040'; - $disabled = true; - $expectedResponse = new LogExclusion(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setFilter($filter); - $expectedResponse->setDisabled($disabled); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $exclusion = new LogExclusion(); - $exclusionName = 'exclusionName1004344697'; - $exclusion->setName($exclusionName); - $exclusionFilter = 'exclusionFilter-1414044954'; - $exclusion->setFilter($exclusionFilter); - $response = $gapicClient->createExclusion($formattedParent, $exclusion); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/CreateExclusion', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getExclusion(); - $this->assertProtobufEquals($exclusion, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createExclusionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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]'); - $exclusion = new LogExclusion(); - $exclusionName = 'exclusionName1004344697'; - $exclusion->setName($exclusionName); - $exclusionFilter = 'exclusionFilter-1414044954'; - $exclusion->setFilter($exclusionFilter); - try { - $gapicClient->createExclusion($formattedParent, $exclusion); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createLinkTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createLinkTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new Link(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createLinkTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - $link = new Link(); - $linkId = 'linkId177080192'; - $response = $gapicClient->createLink($formattedParent, $link, $linkId); - $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.logging.v2.ConfigServiceV2/CreateLink', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getLink(); - $this->assertProtobufEquals($link, $actualValue); - $actualValue = $actualApiRequestObject->getLinkId(); - $this->assertProtobufEquals($linkId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createLinkTest'); - $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 createLinkExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createLinkTest'); - $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->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - $link = new Link(); - $linkId = 'linkId177080192'; - $response = $gapicClient->createLink($formattedParent, $link, $linkId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createLinkTest'); - 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 createSinkTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $destination = 'destination-1429847026'; - $filter = 'filter-1274492040'; - $description = 'description-1724546052'; - $disabled = true; - $writerIdentity = 'writerIdentity775638794'; - $includeChildren = true; - $expectedResponse = new LogSink(); - $expectedResponse->setName($name); - $expectedResponse->setDestination($destination); - $expectedResponse->setFilter($filter); - $expectedResponse->setDescription($description); - $expectedResponse->setDisabled($disabled); - $expectedResponse->setWriterIdentity($writerIdentity); - $expectedResponse->setIncludeChildren($includeChildren); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $sink = new LogSink(); - $sinkName = 'sinkName508775358'; - $sink->setName($sinkName); - $sinkDestination = 'sinkDestination-1018870917'; - $sink->setDestination($sinkDestination); - $response = $gapicClient->createSink($formattedParent, $sink); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/CreateSink', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getSink(); - $this->assertProtobufEquals($sink, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createSinkExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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]'); - $sink = new LogSink(); - $sinkName = 'sinkName508775358'; - $sink->setName($sinkName); - $sinkDestination = 'sinkDestination-1018870917'; - $sink->setDestination($sinkDestination); - try { - $gapicClient->createSink($formattedParent, $sink); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createViewTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $filter = 'filter-1274492040'; - $expectedResponse = new LogView(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setFilter($filter); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $viewId = 'viewId454228213'; - $view = new LogView(); - $response = $gapicClient->createView($parent, $viewId, $view); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/CreateView', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualRequestObject->getViewId(); - $this->assertProtobufEquals($viewId, $actualValue); - $actualValue = $actualRequestObject->getView(); - $this->assertProtobufEquals($view, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createViewExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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'; - $viewId = 'viewId454228213'; - $view = new LogView(); - try { - $gapicClient->createView($parent, $viewId, $view); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteBucketTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - $gapicClient->deleteBucket($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/DeleteBucket', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteBucketExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - try { - $gapicClient->deleteBucket($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 deleteExclusionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->logExclusionName('[PROJECT]', '[EXCLUSION]'); - $gapicClient->deleteExclusion($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/DeleteExclusion', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteExclusionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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->logExclusionName('[PROJECT]', '[EXCLUSION]'); - try { - $gapicClient->deleteExclusion($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 deleteLinkTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteLinkTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteLinkTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->linkName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[LINK]'); - $response = $gapicClient->deleteLink($formattedName); - $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.logging.v2.ConfigServiceV2/DeleteLink', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteLinkTest'); - $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 deleteLinkExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteLinkTest'); - $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->linkName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[LINK]'); - $response = $gapicClient->deleteLink($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteLinkTest'); - 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 deleteSinkTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedSinkName = $gapicClient->logSinkName('[PROJECT]', '[SINK]'); - $gapicClient->deleteSink($formattedSinkName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/DeleteSink', $actualFuncCall); - $actualValue = $actualRequestObject->getSinkName(); - $this->assertProtobufEquals($formattedSinkName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteSinkExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedSinkName = $gapicClient->logSinkName('[PROJECT]', '[SINK]'); - try { - $gapicClient->deleteSink($formattedSinkName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteViewTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->logViewName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[VIEW]'); - $gapicClient->deleteView($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/DeleteView', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteViewExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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->logViewName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[VIEW]'); - try { - $gapicClient->deleteView($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 getBucketTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $retentionDays = 1544391896; - $locked = true; - $analyticsEnabled = true; - $expectedResponse = new LogBucket(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setRetentionDays($retentionDays); - $expectedResponse->setLocked($locked); - $expectedResponse->setAnalyticsEnabled($analyticsEnabled); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - $response = $gapicClient->getBucket($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/GetBucket', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBucketExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - try { - $gapicClient->getBucket($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 getCmekSettingsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $kmsKeyName = 'kmsKeyName2094986649'; - $kmsKeyVersionName = 'kmsKeyVersionName-1734350176'; - $serviceAccountId = 'serviceAccountId-111486921'; - $expectedResponse = new CmekSettings(); - $expectedResponse->setName($name2); - $expectedResponse->setKmsKeyName($kmsKeyName); - $expectedResponse->setKmsKeyVersionName($kmsKeyVersionName); - $expectedResponse->setServiceAccountId($serviceAccountId); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getCmekSettings(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/GetCmekSettings', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getCmekSettingsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getCmekSettings(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getExclusionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $filter = 'filter-1274492040'; - $disabled = true; - $expectedResponse = new LogExclusion(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setFilter($filter); - $expectedResponse->setDisabled($disabled); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->logExclusionName('[PROJECT]', '[EXCLUSION]'); - $response = $gapicClient->getExclusion($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/GetExclusion', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getExclusionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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->logExclusionName('[PROJECT]', '[EXCLUSION]'); - try { - $gapicClient->getExclusion($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 getLinkTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new Link(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->linkName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[LINK]'); - $response = $gapicClient->getLink($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/GetLink', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLinkExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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->linkName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[LINK]'); - try { - $gapicClient->getLink($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 getSettingsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $kmsKeyName = 'kmsKeyName2094986649'; - $kmsServiceAccountId = 'kmsServiceAccountId-263326747'; - $storageLocation = 'storageLocation-612882183'; - $disableDefaultSink = true; - $expectedResponse = new Settings(); - $expectedResponse->setName($name2); - $expectedResponse->setKmsKeyName($kmsKeyName); - $expectedResponse->setKmsServiceAccountId($kmsServiceAccountId); - $expectedResponse->setStorageLocation($storageLocation); - $expectedResponse->setDisableDefaultSink($disableDefaultSink); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->settingsName('[PROJECT]'); - $response = $gapicClient->getSettings($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/GetSettings', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getSettingsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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->settingsName('[PROJECT]'); - try { - $gapicClient->getSettings($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 getSinkTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $destination = 'destination-1429847026'; - $filter = 'filter-1274492040'; - $description = 'description-1724546052'; - $disabled = true; - $writerIdentity = 'writerIdentity775638794'; - $includeChildren = true; - $expectedResponse = new LogSink(); - $expectedResponse->setName($name); - $expectedResponse->setDestination($destination); - $expectedResponse->setFilter($filter); - $expectedResponse->setDescription($description); - $expectedResponse->setDisabled($disabled); - $expectedResponse->setWriterIdentity($writerIdentity); - $expectedResponse->setIncludeChildren($includeChildren); - $transport->addResponse($expectedResponse); - // Mock request - $formattedSinkName = $gapicClient->logSinkName('[PROJECT]', '[SINK]'); - $response = $gapicClient->getSink($formattedSinkName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/GetSink', $actualFuncCall); - $actualValue = $actualRequestObject->getSinkName(); - $this->assertProtobufEquals($formattedSinkName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getSinkExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedSinkName = $gapicClient->logSinkName('[PROJECT]', '[SINK]'); - try { - $gapicClient->getSink($formattedSinkName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getViewTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $filter = 'filter-1274492040'; - $expectedResponse = new LogView(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setFilter($filter); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->logViewName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[VIEW]'); - $response = $gapicClient->getView($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/GetView', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getViewExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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->logViewName('[PROJECT]', '[LOCATION]', '[BUCKET]', '[VIEW]'); - try { - $gapicClient->getView($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 listBucketsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $bucketsElement = new LogBucket(); - $buckets = [ - $bucketsElement, - ]; - $expectedResponse = new ListBucketsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setBuckets($buckets); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); - $response = $gapicClient->listBuckets($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getBuckets()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/ListBuckets', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBucketsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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]'); - try { - $gapicClient->listBuckets($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 listExclusionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $exclusionsElement = new LogExclusion(); - $exclusions = [ - $exclusionsElement, - ]; - $expectedResponse = new ListExclusionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setExclusions($exclusions); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->listExclusions($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getExclusions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/ListExclusions', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listExclusionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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->listExclusions($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 listLinksTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $linksElement = new Link(); - $links = [ - $linksElement, - ]; - $expectedResponse = new ListLinksResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLinks($links); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - $response = $gapicClient->listLinks($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLinks()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/ListLinks', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLinksExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - try { - $gapicClient->listLinks($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 listSinksTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $sinksElement = new LogSink(); - $sinks = [ - $sinksElement, - ]; - $expectedResponse = new ListSinksResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSinks($sinks); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->listSinks($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSinks()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/ListSinks', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSinksExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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->listSinks($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 listViewsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $viewsElement = new LogView(); - $views = [ - $viewsElement, - ]; - $expectedResponse = new ListViewsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setViews($views); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $response = $gapicClient->listViews($parent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getViews()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/ListViews', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listViewsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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'; - try { - $gapicClient->listViews($parent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function undeleteBucketTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - $gapicClient->undeleteBucket($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/UndeleteBucket', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function undeleteBucketExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - try { - $gapicClient->undeleteBucket($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 updateBucketTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $retentionDays = 1544391896; - $locked = true; - $analyticsEnabled = true; - $expectedResponse = new LogBucket(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setRetentionDays($retentionDays); - $expectedResponse->setLocked($locked); - $expectedResponse->setAnalyticsEnabled($analyticsEnabled); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - $bucket = new LogBucket(); - $updateMask = new FieldMask(); - $response = $gapicClient->updateBucket($formattedName, $bucket, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/UpdateBucket', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getBucket(); - $this->assertProtobufEquals($bucket, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateBucketExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - $bucket = new LogBucket(); - $updateMask = new FieldMask(); - try { - $gapicClient->updateBucket($formattedName, $bucket, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateBucketAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateBucketAsyncTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $retentionDays = 1544391896; - $locked = true; - $analyticsEnabled = true; - $expectedResponse = new LogBucket(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setRetentionDays($retentionDays); - $expectedResponse->setLocked($locked); - $expectedResponse->setAnalyticsEnabled($analyticsEnabled); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateBucketAsyncTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - $bucket = new LogBucket(); - $updateMask = new FieldMask(); - $response = $gapicClient->updateBucketAsync($formattedName, $bucket, $updateMask); - $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.logging.v2.ConfigServiceV2/UpdateBucketAsync', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualApiRequestObject->getBucket(); - $this->assertProtobufEquals($bucket, $actualValue); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateBucketAsyncTest'); - $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 updateBucketAsyncExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateBucketAsyncTest'); - $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->logBucketName('[PROJECT]', '[LOCATION]', '[BUCKET]'); - $bucket = new LogBucket(); - $updateMask = new FieldMask(); - $response = $gapicClient->updateBucketAsync($formattedName, $bucket, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateBucketAsyncTest'); - 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 updateCmekSettingsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $kmsKeyName = 'kmsKeyName2094986649'; - $kmsKeyVersionName = 'kmsKeyVersionName-1734350176'; - $serviceAccountId = 'serviceAccountId-111486921'; - $expectedResponse = new CmekSettings(); - $expectedResponse->setName($name2); - $expectedResponse->setKmsKeyName($kmsKeyName); - $expectedResponse->setKmsKeyVersionName($kmsKeyVersionName); - $expectedResponse->setServiceAccountId($serviceAccountId); - $transport->addResponse($expectedResponse); - $response = $gapicClient->updateCmekSettings(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/UpdateCmekSettings', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateCmekSettingsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->updateCmekSettings(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateExclusionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $filter = 'filter-1274492040'; - $disabled = true; - $expectedResponse = new LogExclusion(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setFilter($filter); - $expectedResponse->setDisabled($disabled); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->logExclusionName('[PROJECT]', '[EXCLUSION]'); - $exclusion = new LogExclusion(); - $exclusionName = 'exclusionName1004344697'; - $exclusion->setName($exclusionName); - $exclusionFilter = 'exclusionFilter-1414044954'; - $exclusion->setFilter($exclusionFilter); - $updateMask = new FieldMask(); - $response = $gapicClient->updateExclusion($formattedName, $exclusion, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/UpdateExclusion', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getExclusion(); - $this->assertProtobufEquals($exclusion, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateExclusionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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->logExclusionName('[PROJECT]', '[EXCLUSION]'); - $exclusion = new LogExclusion(); - $exclusionName = 'exclusionName1004344697'; - $exclusion->setName($exclusionName); - $exclusionFilter = 'exclusionFilter-1414044954'; - $exclusion->setFilter($exclusionFilter); - $updateMask = new FieldMask(); - try { - $gapicClient->updateExclusion($formattedName, $exclusion, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateSettingsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $kmsKeyName = 'kmsKeyName2094986649'; - $kmsServiceAccountId = 'kmsServiceAccountId-263326747'; - $storageLocation = 'storageLocation-612882183'; - $disableDefaultSink = true; - $expectedResponse = new Settings(); - $expectedResponse->setName($name2); - $expectedResponse->setKmsKeyName($kmsKeyName); - $expectedResponse->setKmsServiceAccountId($kmsServiceAccountId); - $expectedResponse->setStorageLocation($storageLocation); - $expectedResponse->setDisableDefaultSink($disableDefaultSink); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $settings = new Settings(); - $response = $gapicClient->updateSettings($name, $settings); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/UpdateSettings', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualRequestObject->getSettings(); - $this->assertProtobufEquals($settings, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateSettingsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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'; - $settings = new Settings(); - try { - $gapicClient->updateSettings($name, $settings); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateSinkTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $destination = 'destination-1429847026'; - $filter = 'filter-1274492040'; - $description = 'description-1724546052'; - $disabled = true; - $writerIdentity = 'writerIdentity775638794'; - $includeChildren = true; - $expectedResponse = new LogSink(); - $expectedResponse->setName($name); - $expectedResponse->setDestination($destination); - $expectedResponse->setFilter($filter); - $expectedResponse->setDescription($description); - $expectedResponse->setDisabled($disabled); - $expectedResponse->setWriterIdentity($writerIdentity); - $expectedResponse->setIncludeChildren($includeChildren); - $transport->addResponse($expectedResponse); - // Mock request - $formattedSinkName = $gapicClient->logSinkName('[PROJECT]', '[SINK]'); - $sink = new LogSink(); - $sinkName = 'sinkName508775358'; - $sink->setName($sinkName); - $sinkDestination = 'sinkDestination-1018870917'; - $sink->setDestination($sinkDestination); - $response = $gapicClient->updateSink($formattedSinkName, $sink); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/UpdateSink', $actualFuncCall); - $actualValue = $actualRequestObject->getSinkName(); - $this->assertProtobufEquals($formattedSinkName, $actualValue); - $actualValue = $actualRequestObject->getSink(); - $this->assertProtobufEquals($sink, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateSinkExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedSinkName = $gapicClient->logSinkName('[PROJECT]', '[SINK]'); - $sink = new LogSink(); - $sinkName = 'sinkName508775358'; - $sink->setName($sinkName); - $sinkDestination = 'sinkDestination-1018870917'; - $sink->setDestination($sinkDestination); - try { - $gapicClient->updateSink($formattedSinkName, $sink); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateViewTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $filter = 'filter-1274492040'; - $expectedResponse = new LogView(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setFilter($filter); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $view = new LogView(); - $response = $gapicClient->updateView($name, $view); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.ConfigServiceV2/UpdateView', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualRequestObject->getView(); - $this->assertProtobufEquals($view, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateViewExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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'; - $view = new LogView(); - try { - $gapicClient->updateView($name, $view); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->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/Logging/v2/tests/Unit/V2/LoggingServiceV2ClientTest.php b/owl-bot-staging/Logging/v2/tests/Unit/V2/LoggingServiceV2ClientTest.php deleted file mode 100644 index 5e311530b0d1..000000000000 --- a/owl-bot-staging/Logging/v2/tests/Unit/V2/LoggingServiceV2ClientTest.php +++ /dev/null @@ -1,481 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return LoggingServiceV2Client */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new LoggingServiceV2Client($options); - } - - /** @test */ - public function deleteLogTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedLogName = $gapicClient->logName('[PROJECT]', '[LOG]'); - $gapicClient->deleteLog($formattedLogName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.LoggingServiceV2/DeleteLog', $actualFuncCall); - $actualValue = $actualRequestObject->getLogName(); - $this->assertProtobufEquals($formattedLogName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteLogExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedLogName = $gapicClient->logName('[PROJECT]', '[LOG]'); - try { - $gapicClient->deleteLog($formattedLogName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLogEntriesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $entriesElement = new LogEntry(); - $entries = [ - $entriesElement, - ]; - $expectedResponse = new ListLogEntriesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setEntries($entries); - $transport->addResponse($expectedResponse); - // Mock request - $formattedResourceNames = [ - $gapicClient->projectName('[PROJECT]'), - ]; - $response = $gapicClient->listLogEntries($formattedResourceNames); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getEntries()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.LoggingServiceV2/ListLogEntries', $actualFuncCall); - $actualValue = $actualRequestObject->getResourceNames(); - $this->assertProtobufEquals($formattedResourceNames, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLogEntriesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedResourceNames = [ - $gapicClient->projectName('[PROJECT]'), - ]; - try { - $gapicClient->listLogEntries($formattedResourceNames); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLogsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $logNamesElement = 'logNamesElement-1079688374'; - $logNames = [ - $logNamesElement, - ]; - $expectedResponse = new ListLogsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLogNames($logNames); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->listLogs($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLogNames()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.LoggingServiceV2/ListLogs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLogsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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->listLogs($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 listMonitoredResourceDescriptorsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $resourceDescriptorsElement = new MonitoredResourceDescriptor(); - $resourceDescriptors = [ - $resourceDescriptorsElement, - ]; - $expectedResponse = new ListMonitoredResourceDescriptorsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setResourceDescriptors($resourceDescriptors); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listMonitoredResourceDescriptors(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getResourceDescriptors()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.LoggingServiceV2/ListMonitoredResourceDescriptors', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listMonitoredResourceDescriptorsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listMonitoredResourceDescriptors(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function tailLogEntriesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TailLogEntriesResponse(); - $transport->addResponse($expectedResponse); - $expectedResponse2 = new TailLogEntriesResponse(); - $transport->addResponse($expectedResponse2); - $expectedResponse3 = new TailLogEntriesResponse(); - $transport->addResponse($expectedResponse3); - // Mock request - $resourceNames = []; - $request = new TailLogEntriesRequest(); - $request->setResourceNames($resourceNames); - $resourceNames2 = []; - $request2 = new TailLogEntriesRequest(); - $request2->setResourceNames($resourceNames2); - $resourceNames3 = []; - $request3 = new TailLogEntriesRequest(); - $request3->setResourceNames($resourceNames3); - $bidi = $gapicClient->tailLogEntries(); - $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.logging.v2.LoggingServiceV2/TailLogEntries', $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 tailLogEntriesExceptionTest() - { - $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->tailLogEntries(); - $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 writeLogEntriesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new WriteLogEntriesResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $entries = []; - $response = $gapicClient->writeLogEntries($entries); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.LoggingServiceV2/WriteLogEntries', $actualFuncCall); - $actualValue = $actualRequestObject->getEntries(); - $this->assertProtobufEquals($entries, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function writeLogEntriesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $entries = []; - try { - $gapicClient->writeLogEntries($entries); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->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/Logging/v2/tests/Unit/V2/MetricsServiceV2ClientTest.php b/owl-bot-staging/Logging/v2/tests/Unit/V2/MetricsServiceV2ClientTest.php deleted file mode 100644 index 30ef70a229b4..000000000000 --- a/owl-bot-staging/Logging/v2/tests/Unit/V2/MetricsServiceV2ClientTest.php +++ /dev/null @@ -1,422 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return MetricsServiceV2Client */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new MetricsServiceV2Client($options); - } - - /** @test */ - public function createLogMetricTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $filter = 'filter-1274492040'; - $bucketName = 'bucketName283610048'; - $disabled = true; - $valueExtractor = 'valueExtractor2047672534'; - $expectedResponse = new LogMetric(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setFilter($filter); - $expectedResponse->setBucketName($bucketName); - $expectedResponse->setDisabled($disabled); - $expectedResponse->setValueExtractor($valueExtractor); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $metric = new LogMetric(); - $metricName = 'metricName-610759589'; - $metric->setName($metricName); - $metricFilter = 'metricFilter1248897352'; - $metric->setFilter($metricFilter); - $response = $gapicClient->createLogMetric($formattedParent, $metric); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.MetricsServiceV2/CreateLogMetric', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getMetric(); - $this->assertProtobufEquals($metric, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createLogMetricExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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]'); - $metric = new LogMetric(); - $metricName = 'metricName-610759589'; - $metric->setName($metricName); - $metricFilter = 'metricFilter1248897352'; - $metric->setFilter($metricFilter); - try { - $gapicClient->createLogMetric($formattedParent, $metric); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteLogMetricTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedMetricName = $gapicClient->logMetricName('[PROJECT]', '[METRIC]'); - $gapicClient->deleteLogMetric($formattedMetricName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.MetricsServiceV2/DeleteLogMetric', $actualFuncCall); - $actualValue = $actualRequestObject->getMetricName(); - $this->assertProtobufEquals($formattedMetricName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteLogMetricExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedMetricName = $gapicClient->logMetricName('[PROJECT]', '[METRIC]'); - try { - $gapicClient->deleteLogMetric($formattedMetricName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLogMetricTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $filter = 'filter-1274492040'; - $bucketName = 'bucketName283610048'; - $disabled = true; - $valueExtractor = 'valueExtractor2047672534'; - $expectedResponse = new LogMetric(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setFilter($filter); - $expectedResponse->setBucketName($bucketName); - $expectedResponse->setDisabled($disabled); - $expectedResponse->setValueExtractor($valueExtractor); - $transport->addResponse($expectedResponse); - // Mock request - $formattedMetricName = $gapicClient->logMetricName('[PROJECT]', '[METRIC]'); - $response = $gapicClient->getLogMetric($formattedMetricName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.MetricsServiceV2/GetLogMetric', $actualFuncCall); - $actualValue = $actualRequestObject->getMetricName(); - $this->assertProtobufEquals($formattedMetricName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLogMetricExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedMetricName = $gapicClient->logMetricName('[PROJECT]', '[METRIC]'); - try { - $gapicClient->getLogMetric($formattedMetricName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLogMetricsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $metricsElement = new LogMetric(); - $metrics = [ - $metricsElement, - ]; - $expectedResponse = new ListLogMetricsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setMetrics($metrics); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->listLogMetrics($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getMetrics()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.MetricsServiceV2/ListLogMetrics', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLogMetricsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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->listLogMetrics($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 updateLogMetricTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $filter = 'filter-1274492040'; - $bucketName = 'bucketName283610048'; - $disabled = true; - $valueExtractor = 'valueExtractor2047672534'; - $expectedResponse = new LogMetric(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setFilter($filter); - $expectedResponse->setBucketName($bucketName); - $expectedResponse->setDisabled($disabled); - $expectedResponse->setValueExtractor($valueExtractor); - $transport->addResponse($expectedResponse); - // Mock request - $formattedMetricName = $gapicClient->logMetricName('[PROJECT]', '[METRIC]'); - $metric = new LogMetric(); - $metricName = 'metricName-610759589'; - $metric->setName($metricName); - $metricFilter = 'metricFilter1248897352'; - $metric->setFilter($metricFilter); - $response = $gapicClient->updateLogMetric($formattedMetricName, $metric); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.logging.v2.MetricsServiceV2/UpdateLogMetric', $actualFuncCall); - $actualValue = $actualRequestObject->getMetricName(); - $this->assertProtobufEquals($formattedMetricName, $actualValue); - $actualValue = $actualRequestObject->getMetric(); - $this->assertProtobufEquals($metric, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateLogMetricExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedMetricName = $gapicClient->logMetricName('[PROJECT]', '[METRIC]'); - $metric = new LogMetric(); - $metricName = 'metricName-610759589'; - $metric->setName($metricName); - $metricFilter = 'metricFilter1248897352'; - $metric->setFilter($metricFilter); - try { - $gapicClient->updateLogMetric($formattedMetricName, $metric); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -}