diff --git a/google-cloud-chronicle-v1/.owlbot-manifest.json b/google-cloud-chronicle-v1/.owlbot-manifest.json index 7e4341f2706c..650e97379e4e 100644 --- a/google-cloud-chronicle-v1/.owlbot-manifest.json +++ b/google-cloud-chronicle-v1/.owlbot-manifest.json @@ -15,6 +15,33 @@ "google-cloud-chronicle-v1.gemspec", "lib/google-cloud-chronicle-v1.rb", "lib/google/cloud/chronicle/v1.rb", + "lib/google/cloud/chronicle/v1/big_query_export_pb.rb", + "lib/google/cloud/chronicle/v1/big_query_export_service.rb", + "lib/google/cloud/chronicle/v1/big_query_export_service/client.rb", + "lib/google/cloud/chronicle/v1/big_query_export_service/credentials.rb", + "lib/google/cloud/chronicle/v1/big_query_export_service/paths.rb", + "lib/google/cloud/chronicle/v1/big_query_export_service/rest.rb", + "lib/google/cloud/chronicle/v1/big_query_export_service/rest/client.rb", + "lib/google/cloud/chronicle/v1/big_query_export_service/rest/service_stub.rb", + "lib/google/cloud/chronicle/v1/big_query_export_services_pb.rb", + "lib/google/cloud/chronicle/v1/dashboard_chart_pb.rb", + "lib/google/cloud/chronicle/v1/dashboard_chart_service.rb", + "lib/google/cloud/chronicle/v1/dashboard_chart_service/client.rb", + "lib/google/cloud/chronicle/v1/dashboard_chart_service/credentials.rb", + "lib/google/cloud/chronicle/v1/dashboard_chart_service/paths.rb", + "lib/google/cloud/chronicle/v1/dashboard_chart_service/rest.rb", + "lib/google/cloud/chronicle/v1/dashboard_chart_service/rest/client.rb", + "lib/google/cloud/chronicle/v1/dashboard_chart_service/rest/service_stub.rb", + "lib/google/cloud/chronicle/v1/dashboard_chart_services_pb.rb", + "lib/google/cloud/chronicle/v1/dashboard_query_pb.rb", + "lib/google/cloud/chronicle/v1/dashboard_query_service.rb", + "lib/google/cloud/chronicle/v1/dashboard_query_service/client.rb", + "lib/google/cloud/chronicle/v1/dashboard_query_service/credentials.rb", + "lib/google/cloud/chronicle/v1/dashboard_query_service/paths.rb", + "lib/google/cloud/chronicle/v1/dashboard_query_service/rest.rb", + "lib/google/cloud/chronicle/v1/dashboard_query_service/rest/client.rb", + "lib/google/cloud/chronicle/v1/dashboard_query_service/rest/service_stub.rb", + "lib/google/cloud/chronicle/v1/dashboard_query_services_pb.rb", "lib/google/cloud/chronicle/v1/data_access_control_pb.rb", "lib/google/cloud/chronicle/v1/data_access_control_service.rb", "lib/google/cloud/chronicle/v1/data_access_control_service/client.rb", @@ -42,6 +69,16 @@ "lib/google/cloud/chronicle/v1/entity_service/rest/client.rb", "lib/google/cloud/chronicle/v1/entity_service/rest/service_stub.rb", "lib/google/cloud/chronicle/v1/entity_services_pb.rb", + "lib/google/cloud/chronicle/v1/featured_content_metadata_pb.rb", + "lib/google/cloud/chronicle/v1/featured_content_native_dashboard_pb.rb", + "lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service.rb", + "lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/client.rb", + "lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/credentials.rb", + "lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/paths.rb", + "lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest.rb", + "lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest/client.rb", + "lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest/service_stub.rb", + "lib/google/cloud/chronicle/v1/featured_content_native_dashboard_services_pb.rb", "lib/google/cloud/chronicle/v1/instance_pb.rb", "lib/google/cloud/chronicle/v1/instance_service.rb", "lib/google/cloud/chronicle/v1/instance_service/client.rb", @@ -51,6 +88,15 @@ "lib/google/cloud/chronicle/v1/instance_service/rest/client.rb", "lib/google/cloud/chronicle/v1/instance_service/rest/service_stub.rb", "lib/google/cloud/chronicle/v1/instance_services_pb.rb", + "lib/google/cloud/chronicle/v1/native_dashboard_pb.rb", + "lib/google/cloud/chronicle/v1/native_dashboard_service.rb", + "lib/google/cloud/chronicle/v1/native_dashboard_service/client.rb", + "lib/google/cloud/chronicle/v1/native_dashboard_service/credentials.rb", + "lib/google/cloud/chronicle/v1/native_dashboard_service/paths.rb", + "lib/google/cloud/chronicle/v1/native_dashboard_service/rest.rb", + "lib/google/cloud/chronicle/v1/native_dashboard_service/rest/client.rb", + "lib/google/cloud/chronicle/v1/native_dashboard_service/rest/service_stub.rb", + "lib/google/cloud/chronicle/v1/native_dashboard_services_pb.rb", "lib/google/cloud/chronicle/v1/reference_list_pb.rb", "lib/google/cloud/chronicle/v1/reference_list_service.rb", "lib/google/cloud/chronicle/v1/reference_list_service/client.rb", @@ -78,10 +124,16 @@ "proto_docs/google/api/field_behavior.rb", "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", + "proto_docs/google/cloud/chronicle/v1/big_query_export.rb", + "proto_docs/google/cloud/chronicle/v1/dashboard_chart.rb", + "proto_docs/google/cloud/chronicle/v1/dashboard_query.rb", "proto_docs/google/cloud/chronicle/v1/data_access_control.rb", "proto_docs/google/cloud/chronicle/v1/data_table.rb", "proto_docs/google/cloud/chronicle/v1/entity.rb", + "proto_docs/google/cloud/chronicle/v1/featured_content_metadata.rb", + "proto_docs/google/cloud/chronicle/v1/featured_content_native_dashboard.rb", "proto_docs/google/cloud/chronicle/v1/instance.rb", + "proto_docs/google/cloud/chronicle/v1/native_dashboard.rb", "proto_docs/google/cloud/chronicle/v1/reference_list.rb", "proto_docs/google/cloud/chronicle/v1/rule.rb", "proto_docs/google/longrunning/operations.rb", @@ -91,8 +143,16 @@ "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/timestamp.rb", "proto_docs/google/rpc/status.rb", + "proto_docs/google/type/date.rb", "proto_docs/google/type/interval.rb", "snippets/Gemfile", + "snippets/big_query_export_service/get_big_query_export.rb", + "snippets/big_query_export_service/provision_big_query_export.rb", + "snippets/big_query_export_service/update_big_query_export.rb", + "snippets/dashboard_chart_service/batch_get_dashboard_charts.rb", + "snippets/dashboard_chart_service/get_dashboard_chart.rb", + "snippets/dashboard_query_service/execute_dashboard_query.rb", + "snippets/dashboard_query_service/get_dashboard_query.rb", "snippets/data_access_control_service/create_data_access_label.rb", "snippets/data_access_control_service/create_data_access_scope.rb", "snippets/data_access_control_service/delete_data_access_label.rb", @@ -123,7 +183,22 @@ "snippets/entity_service/get_watchlist.rb", "snippets/entity_service/list_watchlists.rb", "snippets/entity_service/update_watchlist.rb", + "snippets/featured_content_native_dashboard_service/get_featured_content_native_dashboard.rb", + "snippets/featured_content_native_dashboard_service/install_featured_content_native_dashboard.rb", + "snippets/featured_content_native_dashboard_service/list_featured_content_native_dashboards.rb", "snippets/instance_service/get_instance.rb", + "snippets/native_dashboard_service/add_chart.rb", + "snippets/native_dashboard_service/create_native_dashboard.rb", + "snippets/native_dashboard_service/delete_native_dashboard.rb", + "snippets/native_dashboard_service/duplicate_chart.rb", + "snippets/native_dashboard_service/duplicate_native_dashboard.rb", + "snippets/native_dashboard_service/edit_chart.rb", + "snippets/native_dashboard_service/export_native_dashboards.rb", + "snippets/native_dashboard_service/get_native_dashboard.rb", + "snippets/native_dashboard_service/import_native_dashboards.rb", + "snippets/native_dashboard_service/list_native_dashboards.rb", + "snippets/native_dashboard_service/remove_chart.rb", + "snippets/native_dashboard_service/update_native_dashboard.rb", "snippets/reference_list_service/create_reference_list.rb", "snippets/reference_list_service/get_reference_list.rb", "snippets/reference_list_service/list_reference_lists.rb", @@ -141,6 +216,15 @@ "snippets/rule_service/update_rule.rb", "snippets/rule_service/update_rule_deployment.rb", "snippets/snippet_metadata_google.cloud.chronicle.v1.json", + "test/google/cloud/chronicle/v1/big_query_export_service_paths_test.rb", + "test/google/cloud/chronicle/v1/big_query_export_service_rest_test.rb", + "test/google/cloud/chronicle/v1/big_query_export_service_test.rb", + "test/google/cloud/chronicle/v1/dashboard_chart_service_paths_test.rb", + "test/google/cloud/chronicle/v1/dashboard_chart_service_rest_test.rb", + "test/google/cloud/chronicle/v1/dashboard_chart_service_test.rb", + "test/google/cloud/chronicle/v1/dashboard_query_service_paths_test.rb", + "test/google/cloud/chronicle/v1/dashboard_query_service_rest_test.rb", + "test/google/cloud/chronicle/v1/dashboard_query_service_test.rb", "test/google/cloud/chronicle/v1/data_access_control_service_paths_test.rb", "test/google/cloud/chronicle/v1/data_access_control_service_rest_test.rb", "test/google/cloud/chronicle/v1/data_access_control_service_test.rb", @@ -150,9 +234,15 @@ "test/google/cloud/chronicle/v1/entity_service_paths_test.rb", "test/google/cloud/chronicle/v1/entity_service_rest_test.rb", "test/google/cloud/chronicle/v1/entity_service_test.rb", + "test/google/cloud/chronicle/v1/featured_content_native_dashboard_service_paths_test.rb", + "test/google/cloud/chronicle/v1/featured_content_native_dashboard_service_rest_test.rb", + "test/google/cloud/chronicle/v1/featured_content_native_dashboard_service_test.rb", "test/google/cloud/chronicle/v1/instance_service_paths_test.rb", "test/google/cloud/chronicle/v1/instance_service_rest_test.rb", "test/google/cloud/chronicle/v1/instance_service_test.rb", + "test/google/cloud/chronicle/v1/native_dashboard_service_paths_test.rb", + "test/google/cloud/chronicle/v1/native_dashboard_service_rest_test.rb", + "test/google/cloud/chronicle/v1/native_dashboard_service_test.rb", "test/google/cloud/chronicle/v1/reference_list_service_paths_test.rb", "test/google/cloud/chronicle/v1/reference_list_service_rest_test.rb", "test/google/cloud/chronicle/v1/reference_list_service_test.rb", diff --git a/google-cloud-chronicle-v1/AUTHENTICATION.md b/google-cloud-chronicle-v1/AUTHENTICATION.md index 2b6138fc6b12..1cb69c3578b1 100644 --- a/google-cloud-chronicle-v1/AUTHENTICATION.md +++ b/google-cloud-chronicle-v1/AUTHENTICATION.md @@ -56,7 +56,7 @@ To configure a credentials file for an individual client initialization: ```ruby require "google/cloud/chronicle/v1" -client = ::Google::Cloud::Chronicle::V1::DataAccessControlService::Client.new do |config| +client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Client.new do |config| config.credentials = "path/to/credentialfile.json" end ``` @@ -66,11 +66,11 @@ To configure a credentials file globally for all clients: ```ruby require "google/cloud/chronicle/v1" -::Google::Cloud::Chronicle::V1::DataAccessControlService::Client.configure do |config| +::Google::Cloud::Chronicle::V1::BigQueryExportService::Client.configure do |config| config.credentials = "path/to/credentialfile.json" end -client = ::Google::Cloud::Chronicle::V1::DataAccessControlService::Client.new +client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Client.new ``` ### Environment Variables @@ -100,7 +100,7 @@ require "google/cloud/chronicle/v1" ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" -client = ::Google::Cloud::Chronicle::V1::DataAccessControlService::Client.new +client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Client.new ``` ### Local ADC file diff --git a/google-cloud-chronicle-v1/README.md b/google-cloud-chronicle-v1/README.md index f525377210ba..d569847e64fe 100644 --- a/google-cloud-chronicle-v1/README.md +++ b/google-cloud-chronicle-v1/README.md @@ -32,9 +32,9 @@ In order to use this library, you first need to go through the following steps: ```ruby require "google/cloud/chronicle/v1" -client = ::Google::Cloud::Chronicle::V1::DataAccessControlService::Client.new -request = ::Google::Cloud::Chronicle::V1::CreateDataAccessLabelRequest.new # (request fields as keyword arguments...) -response = client.create_data_access_label request +client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Client.new +request = ::Google::Cloud::Chronicle::V1::GetBigQueryExportRequest.new # (request fields as keyword arguments...) +response = client.get_big_query_export request ``` View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-chronicle-v1/latest) @@ -75,7 +75,7 @@ constructing a client object. For example: require "google/cloud/chronicle/v1" require "logger" -client = ::Google::Cloud::Chronicle::V1::DataAccessControlService::Client.new do |config| +client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Client.new do |config| config.logger = Logger.new "my-app.log" end ``` diff --git a/google-cloud-chronicle-v1/Rakefile b/google-cloud-chronicle-v1/Rakefile index 32147f14bfcf..9c3ed806ebfb 100644 --- a/google-cloud-chronicle-v1/Rakefile +++ b/google-cloud-chronicle-v1/Rakefile @@ -57,8 +57,8 @@ task :acceptance, :project, :keyfile do |t, args| if project.nil? || keyfile.nil? fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" end - require "google/cloud/chronicle/v1/data_access_control_service/credentials" - ::Google::Cloud::Chronicle::V1::DataAccessControlService::Credentials.env_vars.each do |path| + require "google/cloud/chronicle/v1/big_query_export_service/credentials" + ::Google::Cloud::Chronicle::V1::BigQueryExportService::Credentials.env_vars.each do |path| ENV[path] = nil end ENV["GOOGLE_CLOUD_PROJECT"] = project diff --git a/google-cloud-chronicle-v1/gapic_metadata.json b/google-cloud-chronicle-v1/gapic_metadata.json index be88621b6d88..a97437d01ef0 100644 --- a/google-cloud-chronicle-v1/gapic_metadata.json +++ b/google-cloud-chronicle-v1/gapic_metadata.json @@ -5,6 +5,68 @@ "protoPackage": "google.cloud.chronicle.v1", "libraryPackage": "::Google::Cloud::Chronicle::V1", "services": { + "BigQueryExportService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Chronicle::V1::BigQueryExportService::Client", + "rpcs": { + "GetBigQueryExport": { + "methods": [ + "get_big_query_export" + ] + }, + "UpdateBigQueryExport": { + "methods": [ + "update_big_query_export" + ] + }, + "ProvisionBigQueryExport": { + "methods": [ + "provision_big_query_export" + ] + } + } + } + } + }, + "DashboardQueryService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Chronicle::V1::DashboardQueryService::Client", + "rpcs": { + "GetDashboardQuery": { + "methods": [ + "get_dashboard_query" + ] + }, + "ExecuteDashboardQuery": { + "methods": [ + "execute_dashboard_query" + ] + } + } + } + } + }, + "DashboardChartService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Chronicle::V1::DashboardChartService::Client", + "rpcs": { + "GetDashboardChart": { + "methods": [ + "get_dashboard_chart" + ] + }, + "BatchGetDashboardCharts": { + "methods": [ + "batch_get_dashboard_charts" + ] + } + } + } + } + }, "DataAccessControlService": { "clients": { "grpc": { @@ -182,6 +244,99 @@ } } }, + "NativeDashboardService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client", + "rpcs": { + "CreateNativeDashboard": { + "methods": [ + "create_native_dashboard" + ] + }, + "GetNativeDashboard": { + "methods": [ + "get_native_dashboard" + ] + }, + "ListNativeDashboards": { + "methods": [ + "list_native_dashboards" + ] + }, + "UpdateNativeDashboard": { + "methods": [ + "update_native_dashboard" + ] + }, + "DuplicateNativeDashboard": { + "methods": [ + "duplicate_native_dashboard" + ] + }, + "DeleteNativeDashboard": { + "methods": [ + "delete_native_dashboard" + ] + }, + "AddChart": { + "methods": [ + "add_chart" + ] + }, + "RemoveChart": { + "methods": [ + "remove_chart" + ] + }, + "EditChart": { + "methods": [ + "edit_chart" + ] + }, + "DuplicateChart": { + "methods": [ + "duplicate_chart" + ] + }, + "ExportNativeDashboards": { + "methods": [ + "export_native_dashboards" + ] + }, + "ImportNativeDashboards": { + "methods": [ + "import_native_dashboards" + ] + } + } + } + } + }, + "FeaturedContentNativeDashboardService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client", + "rpcs": { + "GetFeaturedContentNativeDashboard": { + "methods": [ + "get_featured_content_native_dashboard" + ] + }, + "ListFeaturedContentNativeDashboards": { + "methods": [ + "list_featured_content_native_dashboards" + ] + }, + "InstallFeaturedContentNativeDashboard": { + "methods": [ + "install_featured_content_native_dashboard" + ] + } + } + } + } + }, "InstanceService": { "clients": { "grpc": { diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1.rb index 3ba17735a7ae..bf04e41d2967 100644 --- a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1.rb +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1.rb @@ -16,9 +16,14 @@ # Auto-generated by gapic-generator-ruby. DO NOT EDIT! +require "google/cloud/chronicle/v1/big_query_export_service" +require "google/cloud/chronicle/v1/dashboard_query_service" +require "google/cloud/chronicle/v1/dashboard_chart_service" require "google/cloud/chronicle/v1/data_access_control_service" require "google/cloud/chronicle/v1/data_table_service" require "google/cloud/chronicle/v1/entity_service" +require "google/cloud/chronicle/v1/native_dashboard_service" +require "google/cloud/chronicle/v1/featured_content_native_dashboard_service" require "google/cloud/chronicle/v1/instance_service" require "google/cloud/chronicle/v1/reference_list_service" require "google/cloud/chronicle/v1/rule_service" @@ -33,12 +38,12 @@ module Chronicle # @example Load this package, including all its services, and instantiate a gRPC client # # require "google/cloud/chronicle/v1" - # client = ::Google::Cloud::Chronicle::V1::DataAccessControlService::Client.new + # client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Client.new # # @example Load this package, including all its services, and instantiate a REST client # # require "google/cloud/chronicle/v1" - # client = ::Google::Cloud::Chronicle::V1::DataAccessControlService::Rest::Client.new + # client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::Client.new # module V1 end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/big_query_export_pb.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/big_query_export_pb.rb new file mode 100644 index 000000000000..adf4271454b5 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/big_query_export_pb.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/chronicle/v1/big_query_export.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n0google/cloud/chronicle/v1/big_query_export.proto\x12\x19google.cloud.chronicle.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf9\x05\n\x0e\x42igQueryExport\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x18\n\x0bprovisioned\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03\x12W\n\x18\x62ig_query_export_package\x18\x03 \x01(\x0e\x32\x30.google.cloud.chronicle.v1.BigQueryExportPackageB\x03\xe0\x41\x03\x12W\n\x15\x65ntity_graph_settings\x18\x04 \x01(\x0b\x32\x33.google.cloud.chronicle.v1.DataSourceExportSettingsB\x03\xe0\x41\x01\x12V\n\x14ioc_matches_settings\x18\x05 \x01(\x0b\x32\x33.google.cloud.chronicle.v1.DataSourceExportSettingsB\x03\xe0\x41\x01\x12Z\n\x18rule_detections_settings\x18\x06 \x01(\x0b\x32\x33.google.cloud.chronicle.v1.DataSourceExportSettingsB\x03\xe0\x41\x01\x12`\n\x1eudm_events_aggregates_settings\x18\x07 \x01(\x0b\x32\x33.google.cloud.chronicle.v1.DataSourceExportSettingsB\x03\xe0\x41\x01\x12U\n\x13udm_events_settings\x18\x08 \x01(\x0b\x32\x33.google.cloud.chronicle.v1.DataSourceExportSettingsB\x03\xe0\x41\x01:\x9a\x01\xea\x41\x96\x01\n\'chronicle.googleapis.com/BigQueryExport\x12Kprojects/{project}/locations/{location}/instances/{instance}/bigQueryExport*\x0e\x62igQueryExport2\x0e\x62igQueryExport\"\xfc\x01\n\x18\x44\x61taSourceExportSettings\x12\x14\n\x07\x65nabled\x18\x01 \x01(\x08\x42\x03\xe0\x41\x02\x12\x1b\n\x0eretention_days\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12U\n\x17latest_export_job_state\x18\x03 \x01(\x0e\x32/.google.cloud.chronicle.v1.LatestExportJobStateB\x03\xe0\x41\x03\x12<\n\x13\x64\x61ta_freshness_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x61ta_volume\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03\"Y\n\x18GetBigQueryExportRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'chronicle.googleapis.com/BigQueryExport\"\x9d\x01\n\x1bUpdateBigQueryExportRequest\x12H\n\x10\x62ig_query_export\x18\x01 \x01(\x0b\x32).google.cloud.chronicle.v1.BigQueryExportB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"a\n\x1eProvisionBigQueryExportRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'chronicle.googleapis.com/BigQueryExport*\x8c\x01\n\x15\x42igQueryExportPackage\x12(\n$BIG_QUERY_EXPORT_PACKAGE_UNSPECIFIED\x10\x00\x12\"\n\x1e\x42IG_QUERY_EXPORT_PACKAGE_BYOBQ\x10\x01\x12%\n!BIG_QUERY_EXPORT_PACKAGE_ADVANCED\x10\x02*\x88\x01\n\x14LatestExportJobState\x12\'\n#LATEST_EXPORT_JOB_STATE_UNSPECIFIED\x10\x00\x12#\n\x1fLATEST_EXPORT_JOB_STATE_SUCCESS\x10\x01\x12\"\n\x1eLATEST_EXPORT_JOB_STATE_FAILED\x10\x02\x32\xec\x06\n\x15\x42igQueryExportService\x12\xc0\x01\n\x11GetBigQueryExport\x12\x33.google.cloud.chronicle.v1.GetBigQueryExportRequest\x1a).google.cloud.chronicle.v1.BigQueryExport\"K\xda\x41\x04name\x82\xd3\xe4\x93\x02>\x12 e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update the BigQuery export configuration for a Chronicle instance. + # + # @overload update_big_query_export(request, options = nil) + # Pass arguments to `update_big_query_export` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::UpdateBigQueryExportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::UpdateBigQueryExportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_big_query_export(big_query_export: nil, update_mask: nil) + # Pass arguments to `update_big_query_export` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param big_query_export [::Google::Cloud::Chronicle::V1::BigQueryExport, ::Hash] + # Required. The BigQueryExport settings to update. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/bigQueryExport + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The list of fields to update. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Chronicle::V1::BigQueryExport] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Chronicle::V1::BigQueryExport] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::BigQueryExportService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::UpdateBigQueryExportRequest.new + # + # # Call the update_big_query_export method. + # result = client.update_big_query_export request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::BigQueryExport. + # p result + # + def update_big_query_export request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::UpdateBigQueryExportRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_big_query_export.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.big_query_export&.name + header_params["big_query_export.name"] = request.big_query_export.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_big_query_export.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_big_query_export.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @big_query_export_service_stub.call_rpc :update_big_query_export, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Provision the BigQuery export for a Chronicle instance. This will create + # \\{\\{gcp_name}} resources like \\{\\{storage_name}} buckets, BigQuery datasets + # and set default export settings for each data source. + # + # @overload provision_big_query_export(request, options = nil) + # Pass arguments to `provision_big_query_export` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::ProvisionBigQueryExportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::ProvisionBigQueryExportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload provision_big_query_export(parent: nil) + # Pass arguments to `provision_big_query_export` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The instance for which BigQuery export is being provisioned. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Chronicle::V1::BigQueryExport] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Chronicle::V1::BigQueryExport] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::BigQueryExportService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::ProvisionBigQueryExportRequest.new + # + # # Call the provision_big_query_export method. + # result = client.provision_big_query_export request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::BigQueryExport. + # p result + # + def provision_big_query_export request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ProvisionBigQueryExportRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.provision_big_query_export.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.provision_big_query_export.timeout, + metadata: metadata, + retry_policy: @config.rpcs.provision_big_query_export.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @big_query_export_service_stub.call_rpc :provision_big_query_export, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the BigQueryExportService API. + # + # This class represents the configuration for BigQueryExportService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Chronicle::V1::BigQueryExportService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_big_query_export to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Chronicle::V1::BigQueryExportService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_big_query_export.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_big_query_export.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "chronicle.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the BigQueryExportService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :get_big_query_export + ## + # RPC-specific configuration for `update_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :update_big_query_export + ## + # RPC-specific configuration for `provision_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :provision_big_query_export + + # @private + def initialize parent_rpcs = nil + get_big_query_export_config = parent_rpcs.get_big_query_export if parent_rpcs.respond_to? :get_big_query_export + @get_big_query_export = ::Gapic::Config::Method.new get_big_query_export_config + update_big_query_export_config = parent_rpcs.update_big_query_export if parent_rpcs.respond_to? :update_big_query_export + @update_big_query_export = ::Gapic::Config::Method.new update_big_query_export_config + provision_big_query_export_config = parent_rpcs.provision_big_query_export if parent_rpcs.respond_to? :provision_big_query_export + @provision_big_query_export = ::Gapic::Config::Method.new provision_big_query_export_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/big_query_export_service/credentials.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/big_query_export_service/credentials.rb new file mode 100644 index 000000000000..e1de4c525f2d --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/big_query_export_service/credentials.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Chronicle + module V1 + module BigQueryExportService + # Credentials for the BigQueryExportService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/chronicle", + "https://www.googleapis.com/auth/chronicle.readonly", + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/big_query_export_service/paths.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/big_query_export_service/paths.rb new file mode 100644 index 000000000000..f0e3f0cb4d02 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/big_query_export_service/paths.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Chronicle + module V1 + module BigQueryExportService + # Path helper methods for the BigQueryExportService API. + module Paths + ## + # Create a fully-qualified BigQueryExport resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/instances/{instance}/bigQueryExport` + # + # @param project [String] + # @param location [String] + # @param instance [String] + # + # @return [::String] + def big_query_export_path project:, location:, instance: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/instances/#{instance}/bigQueryExport" + end + + ## + # Create a fully-qualified Instance resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/instances/{instance}` + # + # @param project [String] + # @param location [String] + # @param instance [String] + # + # @return [::String] + def instance_path project:, location:, instance: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/instances/#{instance}" + end + + extend self + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/big_query_export_service/rest.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/big_query_export_service/rest.rb new file mode 100644 index 000000000000..f1737c604643 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/big_query_export_service/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/chronicle/v1/version" + +require "google/cloud/chronicle/v1/big_query_export_service/credentials" +require "google/cloud/chronicle/v1/big_query_export_service/paths" +require "google/cloud/chronicle/v1/big_query_export_service/rest/client" + +module Google + module Cloud + module Chronicle + module V1 + ## + # Service for managing BigQuery export configurations for Chronicle instances. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/chronicle/v1/big_query_export_service/rest" + # client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::Client.new + # + module BigQueryExportService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/chronicle/v1/big_query_export_service/rest/helpers" if ::File.file? helper_path diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/big_query_export_service/rest/client.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/big_query_export_service/rest/client.rb new file mode 100644 index 000000000000..72aa6ac72078 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/big_query_export_service/rest/client.rb @@ -0,0 +1,618 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/chronicle/v1/big_query_export_pb" +require "google/cloud/chronicle/v1/big_query_export_service/rest/service_stub" + +module Google + module Cloud + module Chronicle + module V1 + module BigQueryExportService + module Rest + ## + # REST client for the BigQueryExportService service. + # + # Service for managing BigQuery export configurations for Chronicle instances. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "chronicle.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :big_query_export_service_stub + + ## + # Configure the BigQueryExportService Client class. + # + # See {::Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all BigQueryExportService clients + # ::Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Chronicle", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.get_big_query_export.timeout = 120.0 + default_config.rpcs.get_big_query_export.retry_policy = { + initial_delay: 1.0, max_delay: 120.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_big_query_export.timeout = 120.0 + default_config.rpcs.update_big_query_export.retry_policy = { + initial_delay: 1.0, max_delay: 120.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.provision_big_query_export.timeout = 120.0 + default_config.rpcs.provision_big_query_export.retry_policy = { + initial_delay: 1.0, max_delay: 120.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the BigQueryExportService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @big_query_export_service_stub.universe_domain + end + + ## + # Create a new BigQueryExportService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the BigQueryExportService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @big_query_export_service_stub = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @big_query_export_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @big_query_export_service_stub.logger + end + + # Service calls + + ## + # Get the BigQuery export configuration for a Chronicle instance. + # + # @overload get_big_query_export(request, options = nil) + # Pass arguments to `get_big_query_export` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::GetBigQueryExportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::GetBigQueryExportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_big_query_export(name: nil) + # Pass arguments to `get_big_query_export` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the BigqueryExport to retrieve. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/bigQueryExport + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::BigQueryExport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::BigQueryExport] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::GetBigQueryExportRequest.new + # + # # Call the get_big_query_export method. + # result = client.get_big_query_export request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::BigQueryExport. + # p result + # + def get_big_query_export request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::GetBigQueryExportRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_big_query_export.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_big_query_export.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_big_query_export.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @big_query_export_service_stub.get_big_query_export request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update the BigQuery export configuration for a Chronicle instance. + # + # @overload update_big_query_export(request, options = nil) + # Pass arguments to `update_big_query_export` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::UpdateBigQueryExportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::UpdateBigQueryExportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_big_query_export(big_query_export: nil, update_mask: nil) + # Pass arguments to `update_big_query_export` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param big_query_export [::Google::Cloud::Chronicle::V1::BigQueryExport, ::Hash] + # Required. The BigQueryExport settings to update. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/bigQueryExport + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The list of fields to update. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::BigQueryExport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::BigQueryExport] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::UpdateBigQueryExportRequest.new + # + # # Call the update_big_query_export method. + # result = client.update_big_query_export request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::BigQueryExport. + # p result + # + def update_big_query_export request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::UpdateBigQueryExportRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_big_query_export.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_big_query_export.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_big_query_export.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @big_query_export_service_stub.update_big_query_export request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Provision the BigQuery export for a Chronicle instance. This will create + # \\{\\{gcp_name}} resources like \\{\\{storage_name}} buckets, BigQuery datasets + # and set default export settings for each data source. + # + # @overload provision_big_query_export(request, options = nil) + # Pass arguments to `provision_big_query_export` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::ProvisionBigQueryExportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::ProvisionBigQueryExportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload provision_big_query_export(parent: nil) + # Pass arguments to `provision_big_query_export` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The instance for which BigQuery export is being provisioned. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::BigQueryExport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::BigQueryExport] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::ProvisionBigQueryExportRequest.new + # + # # Call the provision_big_query_export method. + # result = client.provision_big_query_export request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::BigQueryExport. + # p result + # + def provision_big_query_export request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ProvisionBigQueryExportRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.provision_big_query_export.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.provision_big_query_export.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.provision_big_query_export.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @big_query_export_service_stub.provision_big_query_export request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the BigQueryExportService REST API. + # + # This class represents the configuration for BigQueryExportService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_big_query_export to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_big_query_export.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_big_query_export.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "chronicle.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the BigQueryExportService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :get_big_query_export + ## + # RPC-specific configuration for `update_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :update_big_query_export + ## + # RPC-specific configuration for `provision_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :provision_big_query_export + + # @private + def initialize parent_rpcs = nil + get_big_query_export_config = parent_rpcs.get_big_query_export if parent_rpcs.respond_to? :get_big_query_export + @get_big_query_export = ::Gapic::Config::Method.new get_big_query_export_config + update_big_query_export_config = parent_rpcs.update_big_query_export if parent_rpcs.respond_to? :update_big_query_export + @update_big_query_export = ::Gapic::Config::Method.new update_big_query_export_config + provision_big_query_export_config = parent_rpcs.provision_big_query_export if parent_rpcs.respond_to? :provision_big_query_export + @provision_big_query_export = ::Gapic::Config::Method.new provision_big_query_export_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/big_query_export_service/rest/service_stub.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/big_query_export_service/rest/service_stub.rb new file mode 100644 index 000000000000..46fcbadb0291 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/big_query_export_service/rest/service_stub.rb @@ -0,0 +1,266 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/chronicle/v1/big_query_export_pb" + +module Google + module Cloud + module Chronicle + module V1 + module BigQueryExportService + module Rest + ## + # REST service stub for the BigQueryExportService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the get_big_query_export REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::GetBigQueryExportRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::BigQueryExport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::BigQueryExport] + # A result object deserialized from the server's reply + def get_big_query_export request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_big_query_export_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_big_query_export", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Chronicle::V1::BigQueryExport.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_big_query_export REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::UpdateBigQueryExportRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::BigQueryExport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::BigQueryExport] + # A result object deserialized from the server's reply + def update_big_query_export request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_big_query_export_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_big_query_export", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Chronicle::V1::BigQueryExport.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the provision_big_query_export REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::ProvisionBigQueryExportRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::BigQueryExport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::BigQueryExport] + # A result object deserialized from the server's reply + def provision_big_query_export request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_provision_big_query_export_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "provision_big_query_export", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Chronicle::V1::BigQueryExport.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the get_big_query_export REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::GetBigQueryExportRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_big_query_export_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/bigQueryExport/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_big_query_export REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::UpdateBigQueryExportRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_big_query_export_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{big_query_export.name}", + body: "big_query_export", + matches: [ + ["big_query_export.name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/bigQueryExport/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the provision_big_query_export REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::ProvisionBigQueryExportRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_provision_big_query_export_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/bigQueryExport:provision", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/big_query_export_services_pb.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/big_query_export_services_pb.rb new file mode 100644 index 000000000000..0f9f2eefb72c --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/big_query_export_services_pb.rb @@ -0,0 +1,51 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/chronicle/v1/big_query_export.proto for package 'Google.Cloud.Chronicle.V1' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/chronicle/v1/big_query_export_pb' + +module Google + module Cloud + module Chronicle + module V1 + module BigQueryExportService + # Service for managing BigQuery export configurations for Chronicle instances. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.chronicle.v1.BigQueryExportService' + + # Get the BigQuery export configuration for a Chronicle instance. + rpc :GetBigQueryExport, ::Google::Cloud::Chronicle::V1::GetBigQueryExportRequest, ::Google::Cloud::Chronicle::V1::BigQueryExport + # Update the BigQuery export configuration for a Chronicle instance. + rpc :UpdateBigQueryExport, ::Google::Cloud::Chronicle::V1::UpdateBigQueryExportRequest, ::Google::Cloud::Chronicle::V1::BigQueryExport + # Provision the BigQuery export for a Chronicle instance. This will create + # {{gcp_name}} resources like {{storage_name}} buckets, BigQuery datasets + # and set default export settings for each data source. + rpc :ProvisionBigQueryExport, ::Google::Cloud::Chronicle::V1::ProvisionBigQueryExportRequest, ::Google::Cloud::Chronicle::V1::BigQueryExport + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_pb.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_pb.rb new file mode 100644 index 000000000000..8ac2f8e6e1cb --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_pb.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/chronicle/v1/dashboard_chart.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/chronicle/v1/dashboard_query_pb' + + +descriptor_data = "\n/google/cloud/chronicle/v1/dashboard_chart.proto\x12\x19google.cloud.chronicle.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a/google/cloud/chronicle/v1/dashboard_query.proto\"\xfd=\n\x0e\x44\x61shboardChart\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x03\xfa\x41)\n\'chronicle.googleapis.com/DashboardChart\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12J\n\x10native_dashboard\x18\x04 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(chronicle.googleapis.com/NativeDashboard\x12;\n\ttile_type\x18\x07 \x01(\x0e\x32#.google.cloud.chronicle.v1.TileTypeB\x03\xe0\x41\x01\x12X\n\x10\x63hart_datasource\x18\x05 \x01(\x0b\x32\x39.google.cloud.chronicle.v1.DashboardChart.ChartDatasourceB\x03\xe0\x41\x01\x12S\n\rvisualization\x18\x06 \x01(\x0b\x32\x37.google.cloud.chronicle.v1.DashboardChart.VisualizationB\x03\xe0\x41\x02\x12\x11\n\x04\x65tag\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12Y\n\x11\x64rill_down_config\x18\t \x01(\x0b\x32\x39.google.cloud.chronicle.v1.DashboardChart.DrillDownConfigB\x03\xe0\x41\x01\x12\x13\n\x06tokens\x18\n \x03(\tB\x03\xe0\x41\x01\x1a\x95\x01\n\x0f\x43hartDatasource\x12\x45\n\x0f\x64\x61shboard_query\x18\x01 \x01(\tB,\xfa\x41)\n\'chronicle.googleapis.com/DashboardQuery\x12;\n\x0c\x64\x61ta_sources\x18\x03 \x03(\x0e\x32%.google.cloud.chronicle.v1.DataSource\x1a\x8c+\n\rVisualization\x12L\n\x06x_axes\x18\x07 \x03(\x0b\x32<.google.cloud.chronicle.v1.DashboardChart.Visualization.Axis\x12L\n\x06y_axes\x18\x08 \x03(\x0b\x32<.google.cloud.chronicle.v1.DashboardChart.Visualization.Axis\x12N\n\x06series\x18\x03 \x03(\x0b\x32>.google.cloud.chronicle.v1.DashboardChart.Visualization.Series\x12P\n\x07tooltip\x18\x04 \x01(\x0b\x32?.google.cloud.chronicle.v1.DashboardChart.Visualization.Tooltip\x12O\n\x07legends\x18\t \x03(\x0b\x32>.google.cloud.chronicle.v1.DashboardChart.Visualization.Legend\x12V\n\x0b\x63olumn_defs\x18\n \x03(\x0b\x32\x41.google.cloud.chronicle.v1.DashboardChart.Visualization.ColumnDef\x12^\n\x0ctable_config\x18\x12 \x01(\x0b\x32\x43.google.cloud.chronicle.v1.DashboardChart.Visualization.TableConfigB\x03\xe0\x41\x01\x12\x31\n\x06\x62utton\x18\x0b \x01(\x0b\x32!.google.cloud.chronicle.v1.Button\x12:\n\x08markdown\x18\x11 \x01(\x0b\x32#.google.cloud.chronicle.v1.MarkdownB\x03\xe0\x41\x01\x12\x1a\n\rseries_column\x18\x0c \x03(\tB\x03\xe0\x41\x01\x12\x1a\n\rgrouping_type\x18\r \x01(\tB\x03\xe0\x41\x01\x12i\n\x12google_maps_config\x18\x0e \x01(\x0b\x32H.google.cloud.chronicle.v1.DashboardChart.Visualization.GoogleMapsConfigB\x03\xe0\x41\x01\x12\'\n\x1athreshold_coloring_enabled\x18\x0f \x01(\x08\x42\x03\xe0\x41\x01\x12[\n\x0bvisual_maps\x18\x10 \x03(\x0b\x32\x41.google.cloud.chronicle.v1.DashboardChart.Visualization.VisualMapB\x03\xe0\x41\x01\x1a\x88\x01\n\x04\x41xis\x12\x36\n\taxis_type\x18\x04 \x01(\x0e\x32#.google.cloud.chronicle.v1.AxisType\x12\x14\n\x0c\x64isplay_name\x18\x05 \x01(\t\x12\x10\n\x03min\x18\x06 \x01(\x05H\x00\x88\x01\x01\x12\x10\n\x03max\x18\x07 \x01(\x05H\x01\x88\x01\x01\x42\x06\n\x04_minB\x06\n\x04_max\x1a\xc1\x12\n\x06Series\x12:\n\x0bseries_type\x18\x08 \x01(\x0e\x32%.google.cloud.chronicle.v1.SeriesType\x12\x13\n\x0bseries_name\x18\x02 \x01(\t\x12\x13\n\x0bshow_symbol\x18\x04 \x01(\x08\x12\x17\n\x0fshow_background\x18\x05 \x01(\x08\x12\r\n\x05stack\x18\x06 \x01(\t\x12M\n\x15series_stack_strategy\x18\t \x01(\x0e\x32..google.cloud.chronicle.v1.SeriesStackStrategy\x12U\n\x06\x65ncode\x18\n \x01(\x0b\x32\x45.google.cloud.chronicle.v1.DashboardChart.Visualization.Series.Encode\x12\r\n\x05label\x18\x0b \x01(\t\x12\r\n\x05\x66ield\x18\x0c \x01(\t\x12\x61\n\ndata_label\x18\r \x01(\x0b\x32H.google.cloud.chronicle.v1.DashboardChart.Visualization.Series.DataLabelB\x03\xe0\x41\x01\x12\x13\n\x06radius\x18\x0e \x03(\tB\x03\xe0\x41\x01\x12\x61\n\nitem_style\x18\x0f \x01(\x0b\x32H.google.cloud.chronicle.v1.DashboardChart.Visualization.Series.ItemStyleB\x03\xe0\x41\x01\x12 \n\x13series_unique_value\x18\x10 \x01(\tB\x03\xe0\x41\x01\x12\x61\n\narea_style\x18\x11 \x01(\x0b\x32H.google.cloud.chronicle.v1.DashboardChart.Visualization.Series.AreaStyleB\x03\xe0\x41\x01\x12\x63\n\x0bitem_colors\x18\x12 \x01(\x0b\x32I.google.cloud.chronicle.v1.DashboardChart.Visualization.Series.ItemColorsB\x03\xe0\x41\x01\x12\x65\n\x0cgauge_config\x18\x13 \x01(\x0b\x32J.google.cloud.chronicle.v1.DashboardChart.Visualization.Series.GaugeConfigB\x03\xe0\x41\x01\x12r\n\x13metric_trend_config\x18\x14 \x01(\x0b\x32P.google.cloud.chronicle.v1.DashboardChart.Visualization.Series.MetricTrendConfigB\x03\xe0\x41\x01\x1a@\n\x06\x45ncode\x12\t\n\x01x\x18\x01 \x01(\t\x12\t\n\x01y\x18\x02 \x01(\t\x12\r\n\x05value\x18\x03 \x01(\t\x12\x11\n\titem_name\x18\x04 \x01(\t\x1a\x1e\n\tDataLabel\x12\x11\n\x04show\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x1aU\n\tItemStyle\x12\x19\n\x0c\x62order_width\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x19\n\x0c\x62order_color\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x63olor\x18\x03 \x01(\tB\x03\xe0\x41\x01\x1a\xbb\x01\n\tAreaStyle\x12\x12\n\x05\x63olor\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06origin\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bshadow_blur\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x19\n\x0cshadow_color\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0fshadow_offset_x\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1c\n\x0fshadow_offset_y\x18\x06 \x01(\x05\x42\x03\xe0\x41\x01\x12\x14\n\x07opacity\x18\x07 \x01(\x05\x42\x03\xe0\x41\x01\x1a<\n\x12UserSelectedValues\x12\x12\n\x05\x63olor\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05label\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a\x8a\x01\n\x0f\x43hartSliceColor\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x65\n\x05value\x18\x02 \x01(\x0b\x32Q.google.cloud.chronicle.v1.DashboardChart.Visualization.Series.UserSelectedValuesB\x03\xe0\x41\x01\x1aq\n\nItemColors\x12\x63\n\x06\x63olors\x18\x01 \x03(\x0b\x32N.google.cloud.chronicle.v1.DashboardChart.Visualization.Series.ChartSliceColorB\x03\xe0\x41\x01\x1a\x34\n\nGaugeValue\x12\x12\n\x05value\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x12\n\x05\x63olor\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a\xc0\x02\n\x0bGaugeConfig\x12\x62\n\nbase_value\x18\x01 \x01(\x0b\x32I.google.cloud.chronicle.v1.DashboardChart.Visualization.Series.GaugeValueB\x03\xe0\x41\x01\x12\x63\n\x0blimit_value\x18\x02 \x01(\x0b\x32I.google.cloud.chronicle.v1.DashboardChart.Visualization.Series.GaugeValueB\x03\xe0\x41\x01\x12h\n\x10threshold_values\x18\x03 \x03(\x0b\x32I.google.cloud.chronicle.v1.DashboardChart.Visualization.Series.GaugeValueB\x03\xe0\x41\x01\x1a\x96\x02\n\x11MetricTrendConfig\x12\x43\n\rmetric_format\x18\x01 \x01(\x0e\x32\'.google.cloud.chronicle.v1.MetricFormatB\x03\xe0\x41\x01\x12\x1e\n\x11show_metric_trend\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12P\n\x14metric_display_trend\x18\x03 \x01(\x0e\x32-.google.cloud.chronicle.v1.MetricDisplayTrendB\x03\xe0\x41\x01\x12J\n\x11metric_trend_type\x18\x04 \x01(\x0e\x32*.google.cloud.chronicle.v1.MetricTrendTypeB\x03\xe0\x41\x01\x1a[\n\x07Tooltip\x12\x0c\n\x04show\x18\x01 \x01(\x08\x12\x42\n\x0ftooltip_trigger\x18\x03 \x01(\x0e\x32).google.cloud.chronicle.v1.ToolTipTrigger\x1a\x87\x02\n\x06Legend\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04show\x18\x02 \x01(\x08\x12\x0f\n\x07z_level\x18\x03 \x01(\x05\x12\t\n\x01z\x18\x04 \x01(\x05\x12\x0c\n\x04left\x18\x05 \x01(\x05\x12\x0b\n\x03top\x18\x06 \x01(\x05\x12\r\n\x05right\x18\x07 \x01(\x05\x12\x0e\n\x06\x62ottom\x18\x08 \x01(\x05\x12>\n\rlegend_orient\x18\x0c \x01(\x0e\x32\'.google.cloud.chronicle.v1.LegendOrient\x12<\n\x0clegend_align\x18\r \x01(\x0e\x32&.google.cloud.chronicle.v1.LegendAlign\x12\x0f\n\x07padding\x18\x0b \x03(\x05\x1a*\n\tColumnDef\x12\r\n\x05\x66ield\x18\x01 \x01(\t\x12\x0e\n\x06header\x18\x02 \x01(\t\x1av\n\x18\x43olumnRenderTypeSettings\x12\x12\n\x05\x66ield\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x46\n\x12\x63olumn_render_type\x18\x02 \x01(\x0e\x32%.google.cloud.chronicle.v1.RenderTypeB\x03\xe0\x41\x01\x1am\n\x15\x43olumnTooltipSettings\x12\x12\n\x05\x66ield\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12 \n\x13header_tooltip_text\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11\x63\x65ll_tooltip_text\x18\x03 \x01(\tB\x03\xe0\x41\x01\x1a\x9d\x02\n\x0bTableConfig\x12\x1d\n\x10\x65nable_text_wrap\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12z\n\x1b\x63olumn_render_type_settings\x18\x02 \x03(\x0b\x32P.google.cloud.chronicle.v1.DashboardChart.Visualization.ColumnRenderTypeSettingsB\x03\xe0\x41\x01\x12s\n\x17\x63olumn_tooltip_settings\x18\x03 \x03(\x0b\x32M.google.cloud.chronicle.v1.DashboardChart.Visualization.ColumnTooltipSettingsB\x03\xe0\x41\x01\x1a\xfd\x05\n\x10GoogleMapsConfig\x12q\n\rdata_settings\x18\x01 \x01(\x0b\x32U.google.cloud.chronicle.v1.DashboardChart.Visualization.GoogleMapsConfig.DataSettingsB\x03\xe0\x41\x01\x12;\n\tplot_mode\x18\x02 \x01(\x0e\x32#.google.cloud.chronicle.v1.PlotModeB\x03\xe0\x41\x01\x12o\n\x0cmap_position\x18\x03 \x01(\x0b\x32T.google.cloud.chronicle.v1.DashboardChart.Visualization.GoogleMapsConfig.MapPositionB\x03\xe0\x41\x01\x12s\n\x0epoint_settings\x18\x04 \x01(\x0b\x32V.google.cloud.chronicle.v1.DashboardChart.Visualization.GoogleMapsConfig.PointSettingsB\x03\xe0\x41\x01\x1a\x66\n\x0c\x44\x61taSettings\x12\x1c\n\x0flatitude_column\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10longitude_column\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x63ount_column\x18\x03 \x01(\tB\x03\xe0\x41\x01\x1a~\n\x0bMapPosition\x12\x15\n\x08\x66it_data\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1b\n\x0elatitude_value\x18\x05 \x01(\x01\x42\x03\xe0\x41\x01\x12\x1c\n\x0flongitude_value\x18\x06 \x01(\x01\x42\x03\xe0\x41\x01\x12\x1d\n\x10zoom_scale_value\x18\x07 \x01(\x01\x42\x03\xe0\x41\x01\x1ak\n\rPointSettings\x12\x46\n\x0fpoint_size_type\x18\x01 \x01(\x0e\x32(.google.cloud.chronicle.v1.PointSizeTypeB\x03\xe0\x41\x01\x12\x12\n\x05\x63olor\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a\xb2\x02\n\tVisualMap\x12\x46\n\x0fvisual_map_type\x18\x01 \x01(\x0e\x32(.google.cloud.chronicle.v1.VisualMapTypeB\x03\xe0\x41\x01\x12\x65\n\x06pieces\x18\x02 \x03(\x0b\x32P.google.cloud.chronicle.v1.DashboardChart.Visualization.VisualMap.VisualMapPieceB\x03\xe0\x41\x01\x1av\n\x0eVisualMapPiece\x12\x15\n\x03min\x18\x01 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x15\n\x03max\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x12\n\x05\x63olor\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05label\x18\x04 \x01(\tB\x03\xe0\x41\x01\x42\x06\n\x04_minB\x06\n\x04_max\x1a\xed\x0b\n\x0f\x44rillDownConfig\x12\x62\n\x10left_drill_downs\x18\x01 \x03(\x0b\x32\x43.google.cloud.chronicle.v1.DashboardChart.DrillDownConfig.DrillDownB\x03\xe0\x41\x02\x12\x63\n\x11right_drill_downs\x18\x02 \x03(\x0b\x32\x43.google.cloud.chronicle.v1.DashboardChart.DrillDownConfig.DrillDownB\x03\xe0\x41\x02\x1a\x90\n\n\tDrillDown\x12x\n\x10\x64\x65\x66\x61ult_settings\x18\x03 \x01(\x0b\x32\\.google.cloud.chronicle.v1.DashboardChart.DrillDownConfig.DrillDown.DefaultDrillDownSettingsH\x00\x12v\n\x0f\x63ustom_settings\x18\x04 \x01(\x0b\x32[.google.cloud.chronicle.v1.DashboardChart.DrillDownConfig.DrillDown.CustomDrillDownSettingsH\x00\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x1a\x30\n\x18\x44\x65\x66\x61ultDrillDownSettings\x12\x14\n\x07\x65nabled\x18\x01 \x01(\x08\x42\x03\xe0\x41\x02\x1a\xa6\x07\n\x17\x43ustomDrillDownSettings\x12{\n\x05query\x18\x03 \x01(\x0b\x32j.google.cloud.chronicle.v1.DashboardChart.DrillDownConfig.DrillDown.CustomDrillDownSettings.DrillDownQueryH\x00\x12}\n\x06\x66ilter\x18\x04 \x01(\x0b\x32k.google.cloud.chronicle.v1.DashboardChart.DrillDownConfig.DrillDown.CustomDrillDownSettings.DrillDownFilterH\x00\x12\x8a\x01\n\rexternal_link\x18\x05 \x01(\x0b\x32q.google.cloud.chronicle.v1.DashboardChart.DrillDownConfig.DrillDown.CustomDrillDownSettings.DrillDownExternalLinkH\x00\x12\x14\n\x07new_tab\x18\x01 \x01(\x08\x42\x03\xe0\x41\x02\x12\x1e\n\x11left_click_column\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a$\n\x0e\x44rillDownQuery\x12\x12\n\x05query\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a\xd5\x02\n\x0f\x44rillDownFilter\x12\xa5\x01\n\x11\x64\x61shboard_filters\x18\x01 \x03(\x0b\x32\x84\x01.google.cloud.chronicle.v1.DashboardChart.DrillDownConfig.DrillDown.CustomDrillDownSettings.DrillDownFilter.DrillDownDashboardFilterB\x03\xe0\x41\x02\x1a\x99\x01\n\x18\x44rillDownDashboardFilter\x12 \n\x13\x64\x61shboard_filter_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12[\n\x1a\x66ilter_operator_and_values\x18\x02 \x03(\x0b\x32\x32.google.cloud.chronicle.v1.FilterOperatorAndValuesB\x03\xe0\x41\x02\x1a\x44\n\x15\x44rillDownExternalLink\x12\x11\n\x04link\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x01\x42\x08\n\x06\x61\x63tionB\n\n\x08settings:\xa4\x01\xea\x41\xa0\x01\n\'chronicle.googleapis.com/DashboardChart\x12Tprojects/{project}/locations/{location}/instances/{instance}/dashboardCharts/{chart}*\x0f\x64\x61shboardCharts2\x0e\x64\x61shboardChart\"\x90\x02\n\x06\x42utton\x12\x12\n\x05label\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\thyperlink\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07new_tab\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x45\n\nproperties\x18\x05 \x01(\x0b\x32,.google.cloud.chronicle.v1.Button.PropertiesB\x03\xe0\x41\x01\x1a\x63\n\nProperties\x12\x12\n\x05\x63olor\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x41\n\x0c\x62utton_style\x18\x02 \x01(\x0e\x32&.google.cloud.chronicle.v1.ButtonStyleB\x03\xe0\x41\x01\"\xa6\x01\n\x08Markdown\x12\x14\n\x07\x63ontent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12O\n\nproperties\x18\x02 \x01(\x0b\x32\x36.google.cloud.chronicle.v1.Markdown.MarkdownPropertiesB\x03\xe0\x41\x01\x1a\x33\n\x12MarkdownProperties\x12\x1d\n\x10\x62\x61\x63kground_color\x18\x03 \x01(\tB\x03\xe0\x41\x01\"Y\n\x18GetDashboardChartRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'chronicle.googleapis.com/DashboardChart\"\xa1\x01\n\x1e\x42\x61tchGetDashboardChartsRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'chronicle.googleapis.com/DashboardChart\x12>\n\x05names\x18\x02 \x03(\tB/\xe0\x41\x02\xfa\x41)\n\'chronicle.googleapis.com/DashboardChart\"f\n\x1f\x42\x61tchGetDashboardChartsResponse\x12\x43\n\x10\x64\x61shboard_charts\x18\x01 \x03(\x0b\x32).google.cloud.chronicle.v1.DashboardChart*p\n\x08TileType\x12\x19\n\x15TILE_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n\x17TILE_TYPE_VISUALIZATION\x10\x01\x12\x14\n\x10TILE_TYPE_BUTTON\x10\x02\x12\x16\n\x12TILE_TYPE_MARKDOWN\x10\x03*t\n\nRenderType\x12\x1b\n\x17RENDER_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10RENDER_TYPE_TEXT\x10\x01\x12\x14\n\x10RENDER_TYPE_ICON\x10\x02\x12\x1d\n\x19RENDER_TYPE_ICON_AND_TEXT\x10\x03*Q\n\x08\x41xisType\x12\x19\n\x15\x41XIS_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05VALUE\x10\x01\x12\x0c\n\x08\x43\x41TEGORY\x10\x02\x12\x08\n\x04TIME\x10\x03\x12\x07\n\x03LOG\x10\x04*t\n\nSeriesType\x12\x1b\n\x17SERIES_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04LINE\x10\x01\x12\x07\n\x03\x42\x41R\x10\x02\x12\x07\n\x03PIE\x10\x03\x12\x08\n\x04TEXT\x10\x04\x12\x07\n\x03MAP\x10\x05\x12\t\n\x05GAUGE\x10\x06\x12\x0f\n\x0bSCATTERPLOT\x10\x07*o\n\x13SeriesStackStrategy\x12%\n!SERIES_STACK_STRATEGY_UNSPECIFIED\x10\x00\x12\x0c\n\x08SAMESIGN\x10\x01\x12\x07\n\x03\x41LL\x10\x02\x12\x0c\n\x08POSITIVE\x10\x03\x12\x0c\n\x08NEGATIVE\x10\x04*\x7f\n\x0eToolTipTrigger\x12\x1f\n\x1bTOOLTIP_TRIGGER_UNSPECIFIED\x10\x00\x12\x18\n\x14TOOLTIP_TRIGGER_NONE\x10\x01\x12\x18\n\x14TOOLTIP_TRIGGER_ITEM\x10\x02\x12\x18\n\x14TOOLTIP_TRIGGER_AXIS\x10\x03*K\n\x0cLegendOrient\x12\x1d\n\x19LEGEND_ORIENT_UNSPECIFIED\x10\x00\x12\x0c\n\x08VERTICAL\x10\x01\x12\x0e\n\nHORIZONTAL\x10\x02*J\n\x0bLegendAlign\x12\x1c\n\x18LEGEND_ALIGN_UNSPECIFIED\x10\x00\x12\x08\n\x04\x41UTO\x10\x01\x12\x08\n\x04LEFT\x10\x02\x12\t\n\x05RIGHT\x10\x03*}\n\x0b\x42uttonStyle\x12\x1c\n\x18\x42UTTON_STYLE_UNSPECIFIED\x10\x00\x12\x17\n\x13\x42UTTON_STYLE_FILLED\x10\x01\x12\x19\n\x15\x42UTTON_STYLE_OUTLINED\x10\x02\x12\x1c\n\x18\x42UTTON_STYLE_TRANSPARENT\x10\x03*f\n\x08PlotMode\x12\x19\n\x15PLOT_MODE_UNSPECIFIED\x10\x00\x12\x14\n\x10PLOT_MODE_POINTS\x10\x01\x12\x15\n\x11PLOT_MODE_HEATMAP\x10\x02\x12\x12\n\x0ePLOT_MODE_BOTH\x10\x03*u\n\rPointSizeType\x12\x1f\n\x1bPOINT_SIZE_TYPE_UNSPECIFIED\x10\x00\x12\x19\n\x15POINT_SIZE_TYPE_FIXED\x10\x01\x12(\n$POINT_SIZE_TYPE_PROPORTIONAL_TO_SIZE\x10\x02*e\n\x0cMetricFormat\x12\x1d\n\x19METRIC_FORMAT_UNSPECIFIED\x10\x00\x12\x18\n\x14METRIC_FORMAT_NUMBER\x10\x01\x12\x1c\n\x18METRIC_FORMAT_PLAIN_TEXT\x10\x02*\xc0\x01\n\x12MetricDisplayTrend\x12$\n METRIC_DISPLAY_TREND_UNSPECIFIED\x10\x00\x12\'\n#METRIC_DISPLAY_TREND_ABSOLUTE_VALUE\x10\x02\x12#\n\x1fMETRIC_DISPLAY_TREND_PERCENTAGE\x10\x03\x12\x36\n2METRIC_DISPLAY_TREND_ABSOLUTE_VALUE_AND_PERCENTAGE\x10\x04*r\n\x0fMetricTrendType\x12!\n\x1dMETRIC_TREND_TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19METRIC_TREND_TYPE_REGULAR\x10\x01\x12\x1d\n\x19METRIC_TREND_TYPE_INVERSE\x10\x02*O\n\rVisualMapType\x12\x1f\n\x1bVISUAL_MAP_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nCONTINUOUS\x10\x01\x12\r\n\tPIECEWISE\x10\x02\x32\xfe\x04\n\x15\x44\x61shboardChartService\x12\xc3\x01\n\x11GetDashboardChart\x12\x33.google.cloud.chronicle.v1.GetDashboardChartRequest\x1a).google.cloud.chronicle.v1.DashboardChart\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\x12?/v1/{name=projects/*/locations/*/instances/*/dashboardCharts/*}\x12\xf1\x01\n\x17\x42\x61tchGetDashboardCharts\x12\x39.google.cloud.chronicle.v1.BatchGetDashboardChartsRequest\x1a:.google.cloud.chronicle.v1.BatchGetDashboardChartsResponse\"_\xda\x41\x0cparent,names\x82\xd3\xe4\x93\x02J\x12H/v1/{parent=projects/*/locations/*/instances/*}/dashboardCharts:batchGet\x1a\xaa\x01\xca\x41\x18\x63hronicle.googleapis.com\xd2\x41\x8b\x01https://www.googleapis.com/auth/chronicle,https://www.googleapis.com/auth/chronicle.readonly,https://www.googleapis.com/auth/cloud-platformB\xca\x01\n\x1d\x63om.google.cloud.chronicle.v1B\x13\x44\x61shboardChartProtoP\x01Z;cloud.google.com/go/chronicle/apiv1/chroniclepb;chroniclepb\xaa\x02\x19Google.Cloud.Chronicle.V1\xca\x02\x19Google\\Cloud\\Chronicle\\V1\xea\x02\x1cGoogle::Cloud::Chronicle::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Chronicle + module V1 + DashboardChart = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart").msgclass + DashboardChart::ChartDatasource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.ChartDatasource").msgclass + DashboardChart::Visualization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization").msgclass + DashboardChart::Visualization::Axis = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.Axis").msgclass + DashboardChart::Visualization::Series = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.Series").msgclass + DashboardChart::Visualization::Series::Encode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.Series.Encode").msgclass + DashboardChart::Visualization::Series::DataLabel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.Series.DataLabel").msgclass + DashboardChart::Visualization::Series::ItemStyle = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.Series.ItemStyle").msgclass + DashboardChart::Visualization::Series::AreaStyle = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.Series.AreaStyle").msgclass + DashboardChart::Visualization::Series::UserSelectedValues = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.Series.UserSelectedValues").msgclass + DashboardChart::Visualization::Series::ChartSliceColor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.Series.ChartSliceColor").msgclass + DashboardChart::Visualization::Series::ItemColors = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.Series.ItemColors").msgclass + DashboardChart::Visualization::Series::GaugeValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.Series.GaugeValue").msgclass + DashboardChart::Visualization::Series::GaugeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.Series.GaugeConfig").msgclass + DashboardChart::Visualization::Series::MetricTrendConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.Series.MetricTrendConfig").msgclass + DashboardChart::Visualization::Tooltip = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.Tooltip").msgclass + DashboardChart::Visualization::Legend = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.Legend").msgclass + DashboardChart::Visualization::ColumnDef = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.ColumnDef").msgclass + DashboardChart::Visualization::ColumnRenderTypeSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.ColumnRenderTypeSettings").msgclass + DashboardChart::Visualization::ColumnTooltipSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.ColumnTooltipSettings").msgclass + DashboardChart::Visualization::TableConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.TableConfig").msgclass + DashboardChart::Visualization::GoogleMapsConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.GoogleMapsConfig").msgclass + DashboardChart::Visualization::GoogleMapsConfig::DataSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.GoogleMapsConfig.DataSettings").msgclass + DashboardChart::Visualization::GoogleMapsConfig::MapPosition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.GoogleMapsConfig.MapPosition").msgclass + DashboardChart::Visualization::GoogleMapsConfig::PointSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.GoogleMapsConfig.PointSettings").msgclass + DashboardChart::Visualization::VisualMap = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.VisualMap").msgclass + DashboardChart::Visualization::VisualMap::VisualMapPiece = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.Visualization.VisualMap.VisualMapPiece").msgclass + DashboardChart::DrillDownConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.DrillDownConfig").msgclass + DashboardChart::DrillDownConfig::DrillDown = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.DrillDownConfig.DrillDown").msgclass + DashboardChart::DrillDownConfig::DrillDown::DefaultDrillDownSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.DrillDownConfig.DrillDown.DefaultDrillDownSettings").msgclass + DashboardChart::DrillDownConfig::DrillDown::CustomDrillDownSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.DrillDownConfig.DrillDown.CustomDrillDownSettings").msgclass + DashboardChart::DrillDownConfig::DrillDown::CustomDrillDownSettings::DrillDownQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.DrillDownConfig.DrillDown.CustomDrillDownSettings.DrillDownQuery").msgclass + DashboardChart::DrillDownConfig::DrillDown::CustomDrillDownSettings::DrillDownFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.DrillDownConfig.DrillDown.CustomDrillDownSettings.DrillDownFilter").msgclass + DashboardChart::DrillDownConfig::DrillDown::CustomDrillDownSettings::DrillDownFilter::DrillDownDashboardFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.DrillDownConfig.DrillDown.CustomDrillDownSettings.DrillDownFilter.DrillDownDashboardFilter").msgclass + DashboardChart::DrillDownConfig::DrillDown::CustomDrillDownSettings::DrillDownExternalLink = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardChart.DrillDownConfig.DrillDown.CustomDrillDownSettings.DrillDownExternalLink").msgclass + Button = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.Button").msgclass + Button::Properties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.Button.Properties").msgclass + Markdown = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.Markdown").msgclass + Markdown::MarkdownProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.Markdown.MarkdownProperties").msgclass + GetDashboardChartRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.GetDashboardChartRequest").msgclass + BatchGetDashboardChartsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.BatchGetDashboardChartsRequest").msgclass + BatchGetDashboardChartsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.BatchGetDashboardChartsResponse").msgclass + TileType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.TileType").enummodule + RenderType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.RenderType").enummodule + AxisType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.AxisType").enummodule + SeriesType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.SeriesType").enummodule + SeriesStackStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.SeriesStackStrategy").enummodule + ToolTipTrigger = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.ToolTipTrigger").enummodule + LegendOrient = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.LegendOrient").enummodule + LegendAlign = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.LegendAlign").enummodule + ButtonStyle = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.ButtonStyle").enummodule + PlotMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.PlotMode").enummodule + PointSizeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.PointSizeType").enummodule + MetricFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.MetricFormat").enummodule + MetricDisplayTrend = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.MetricDisplayTrend").enummodule + MetricTrendType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.MetricTrendType").enummodule + VisualMapType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.VisualMapType").enummodule + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_service.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_service.rb new file mode 100644 index 000000000000..6a8b4f84d9ac --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/chronicle/v1/version" + +require "google/cloud/chronicle/v1/dashboard_chart_service/credentials" +require "google/cloud/chronicle/v1/dashboard_chart_service/paths" +require "google/cloud/chronicle/v1/dashboard_chart_service/client" +require "google/cloud/chronicle/v1/dashboard_chart_service/rest" + +module Google + module Cloud + module Chronicle + module V1 + ## + # A service providing functionality for managing dashboards' charts. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/chronicle/v1/dashboard_chart_service" + # client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/chronicle/v1/dashboard_chart_service/rest" + # client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client.new + # + module DashboardChartService + end + end + end + end +end + +helper_path = ::File.join __dir__, "dashboard_chart_service", "helpers.rb" +require "google/cloud/chronicle/v1/dashboard_chart_service/helpers" if ::File.file? helper_path diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_service/client.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_service/client.rb new file mode 100644 index 000000000000..47581154918d --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_service/client.rb @@ -0,0 +1,584 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/chronicle/v1/dashboard_chart_pb" + +module Google + module Cloud + module Chronicle + module V1 + module DashboardChartService + ## + # Client for the DashboardChartService service. + # + # A service providing functionality for managing dashboards' charts. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "chronicle.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :dashboard_chart_service_stub + + ## + # Configure the DashboardChartService Client class. + # + # See {::Google::Cloud::Chronicle::V1::DashboardChartService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DashboardChartService clients + # ::Google::Cloud::Chronicle::V1::DashboardChartService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Chronicle", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.get_dashboard_chart.timeout = 60.0 + default_config.rpcs.get_dashboard_chart.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.batch_get_dashboard_charts.timeout = 60.0 + default_config.rpcs.batch_get_dashboard_charts.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the DashboardChartService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Chronicle::V1::DashboardChartService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @dashboard_chart_service_stub.universe_domain + end + + ## + # Create a new DashboardChartService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the DashboardChartService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/chronicle/v1/dashboard_chart_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @dashboard_chart_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Chronicle::V1::DashboardChartService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @dashboard_chart_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @dashboard_chart_service_stub.logger + end + + # Service calls + + ## + # Get a dashboard chart. + # + # @overload get_dashboard_chart(request, options = nil) + # Pass arguments to `get_dashboard_chart` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::GetDashboardChartRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::GetDashboardChartRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_dashboard_chart(name: nil) + # Pass arguments to `get_dashboard_chart` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the dashboardChart to retrieve. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/dashboardCharts/\\{chart} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Chronicle::V1::DashboardChart] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Chronicle::V1::DashboardChart] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::DashboardChartService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::GetDashboardChartRequest.new + # + # # Call the get_dashboard_chart method. + # result = client.get_dashboard_chart request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::DashboardChart. + # p result + # + def get_dashboard_chart request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::GetDashboardChartRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_dashboard_chart.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_dashboard_chart.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_dashboard_chart.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dashboard_chart_service_stub.call_rpc :get_dashboard_chart, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get dashboard charts in batches. + # + # @overload batch_get_dashboard_charts(request, options = nil) + # Pass arguments to `batch_get_dashboard_charts` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_get_dashboard_charts(parent: nil, names: nil) + # Pass arguments to `batch_get_dashboard_charts` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource shared by all dashboard charts being + # retrieved. Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance} If this is + # set, the parent of all of the dashboard charts specified in `names` must + # match this field. + # @param names [::Array<::String>] + # Required. The names of the dashboard charts to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::DashboardChartService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest.new + # + # # Call the batch_get_dashboard_charts method. + # result = client.batch_get_dashboard_charts request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::BatchGetDashboardChartsResponse. + # p result + # + def batch_get_dashboard_charts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.batch_get_dashboard_charts.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_get_dashboard_charts.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_get_dashboard_charts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dashboard_chart_service_stub.call_rpc :batch_get_dashboard_charts, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the DashboardChartService API. + # + # This class represents the configuration for DashboardChartService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Chronicle::V1::DashboardChartService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_dashboard_chart to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Chronicle::V1::DashboardChartService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_dashboard_chart.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_dashboard_chart.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "chronicle.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the DashboardChartService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_dashboard_chart` + # @return [::Gapic::Config::Method] + # + attr_reader :get_dashboard_chart + ## + # RPC-specific configuration for `batch_get_dashboard_charts` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_get_dashboard_charts + + # @private + def initialize parent_rpcs = nil + get_dashboard_chart_config = parent_rpcs.get_dashboard_chart if parent_rpcs.respond_to? :get_dashboard_chart + @get_dashboard_chart = ::Gapic::Config::Method.new get_dashboard_chart_config + batch_get_dashboard_charts_config = parent_rpcs.batch_get_dashboard_charts if parent_rpcs.respond_to? :batch_get_dashboard_charts + @batch_get_dashboard_charts = ::Gapic::Config::Method.new batch_get_dashboard_charts_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_service/credentials.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_service/credentials.rb new file mode 100644 index 000000000000..8c5f54e38221 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_service/credentials.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Chronicle + module V1 + module DashboardChartService + # Credentials for the DashboardChartService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/chronicle", + "https://www.googleapis.com/auth/chronicle.readonly", + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_service/paths.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_service/paths.rb new file mode 100644 index 000000000000..9bbfee50192d --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_service/paths.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Chronicle + module V1 + module DashboardChartService + # Path helper methods for the DashboardChartService API. + module Paths + ## + # Create a fully-qualified DashboardChart resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/instances/{instance}/dashboardCharts/{chart}` + # + # @param project [String] + # @param location [String] + # @param instance [String] + # @param chart [String] + # + # @return [::String] + def dashboard_chart_path project:, location:, instance:, chart: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + + "projects/#{project}/locations/#{location}/instances/#{instance}/dashboardCharts/#{chart}" + end + + ## + # Create a fully-qualified Instance resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/instances/{instance}` + # + # @param project [String] + # @param location [String] + # @param instance [String] + # + # @return [::String] + def instance_path project:, location:, instance: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/instances/#{instance}" + end + + extend self + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_service/rest.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_service/rest.rb new file mode 100644 index 000000000000..6a4e38024078 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_service/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/chronicle/v1/version" + +require "google/cloud/chronicle/v1/dashboard_chart_service/credentials" +require "google/cloud/chronicle/v1/dashboard_chart_service/paths" +require "google/cloud/chronicle/v1/dashboard_chart_service/rest/client" + +module Google + module Cloud + module Chronicle + module V1 + ## + # A service providing functionality for managing dashboards' charts. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/chronicle/v1/dashboard_chart_service/rest" + # client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client.new + # + module DashboardChartService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/chronicle/v1/dashboard_chart_service/rest/helpers" if ::File.file? helper_path diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_service/rest/client.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_service/rest/client.rb new file mode 100644 index 000000000000..1abece7b2fd4 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_service/rest/client.rb @@ -0,0 +1,527 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/chronicle/v1/dashboard_chart_pb" +require "google/cloud/chronicle/v1/dashboard_chart_service/rest/service_stub" + +module Google + module Cloud + module Chronicle + module V1 + module DashboardChartService + module Rest + ## + # REST client for the DashboardChartService service. + # + # A service providing functionality for managing dashboards' charts. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "chronicle.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :dashboard_chart_service_stub + + ## + # Configure the DashboardChartService Client class. + # + # See {::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DashboardChartService clients + # ::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Chronicle", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.get_dashboard_chart.timeout = 60.0 + default_config.rpcs.get_dashboard_chart.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.batch_get_dashboard_charts.timeout = 60.0 + default_config.rpcs.batch_get_dashboard_charts.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the DashboardChartService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @dashboard_chart_service_stub.universe_domain + end + + ## + # Create a new DashboardChartService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the DashboardChartService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @dashboard_chart_service_stub = ::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @dashboard_chart_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @dashboard_chart_service_stub.logger + end + + # Service calls + + ## + # Get a dashboard chart. + # + # @overload get_dashboard_chart(request, options = nil) + # Pass arguments to `get_dashboard_chart` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::GetDashboardChartRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::GetDashboardChartRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_dashboard_chart(name: nil) + # Pass arguments to `get_dashboard_chart` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the dashboardChart to retrieve. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/dashboardCharts/\\{chart} + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::DashboardChart] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::DashboardChart] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::GetDashboardChartRequest.new + # + # # Call the get_dashboard_chart method. + # result = client.get_dashboard_chart request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::DashboardChart. + # p result + # + def get_dashboard_chart request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::GetDashboardChartRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_dashboard_chart.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_dashboard_chart.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_dashboard_chart.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dashboard_chart_service_stub.get_dashboard_chart request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get dashboard charts in batches. + # + # @overload batch_get_dashboard_charts(request, options = nil) + # Pass arguments to `batch_get_dashboard_charts` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_get_dashboard_charts(parent: nil, names: nil) + # Pass arguments to `batch_get_dashboard_charts` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource shared by all dashboard charts being + # retrieved. Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance} If this is + # set, the parent of all of the dashboard charts specified in `names` must + # match this field. + # @param names [::Array<::String>] + # Required. The names of the dashboard charts to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest.new + # + # # Call the batch_get_dashboard_charts method. + # result = client.batch_get_dashboard_charts request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::BatchGetDashboardChartsResponse. + # p result + # + def batch_get_dashboard_charts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.batch_get_dashboard_charts.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.batch_get_dashboard_charts.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_get_dashboard_charts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dashboard_chart_service_stub.batch_get_dashboard_charts request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the DashboardChartService REST API. + # + # This class represents the configuration for DashboardChartService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_dashboard_chart to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_dashboard_chart.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_dashboard_chart.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "chronicle.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the DashboardChartService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_dashboard_chart` + # @return [::Gapic::Config::Method] + # + attr_reader :get_dashboard_chart + ## + # RPC-specific configuration for `batch_get_dashboard_charts` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_get_dashboard_charts + + # @private + def initialize parent_rpcs = nil + get_dashboard_chart_config = parent_rpcs.get_dashboard_chart if parent_rpcs.respond_to? :get_dashboard_chart + @get_dashboard_chart = ::Gapic::Config::Method.new get_dashboard_chart_config + batch_get_dashboard_charts_config = parent_rpcs.batch_get_dashboard_charts if parent_rpcs.respond_to? :batch_get_dashboard_charts + @batch_get_dashboard_charts = ::Gapic::Config::Method.new batch_get_dashboard_charts_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_service/rest/service_stub.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_service/rest/service_stub.rb new file mode 100644 index 000000000000..e79d617d732c --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_service/rest/service_stub.rb @@ -0,0 +1,203 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/chronicle/v1/dashboard_chart_pb" + +module Google + module Cloud + module Chronicle + module V1 + module DashboardChartService + module Rest + ## + # REST service stub for the DashboardChartService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the get_dashboard_chart REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::GetDashboardChartRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::DashboardChart] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::DashboardChart] + # A result object deserialized from the server's reply + def get_dashboard_chart request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_dashboard_chart_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_dashboard_chart", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Chronicle::V1::DashboardChart.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_get_dashboard_charts REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsResponse] + # A result object deserialized from the server's reply + def batch_get_dashboard_charts request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_get_dashboard_charts_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "batch_get_dashboard_charts", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the get_dashboard_chart REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::GetDashboardChartRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_dashboard_chart_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/dashboardCharts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_get_dashboard_charts REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_get_dashboard_charts_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/dashboardCharts:batchGet", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_services_pb.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_services_pb.rb new file mode 100644 index 000000000000..33780def2e31 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_chart_services_pb.rb @@ -0,0 +1,47 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/chronicle/v1/dashboard_chart.proto for package 'Google.Cloud.Chronicle.V1' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/chronicle/v1/dashboard_chart_pb' + +module Google + module Cloud + module Chronicle + module V1 + module DashboardChartService + # A service providing functionality for managing dashboards' charts. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.chronicle.v1.DashboardChartService' + + # Get a dashboard chart. + rpc :GetDashboardChart, ::Google::Cloud::Chronicle::V1::GetDashboardChartRequest, ::Google::Cloud::Chronicle::V1::DashboardChart + # Get dashboard charts in batches. + rpc :BatchGetDashboardCharts, ::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest, ::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_pb.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_pb.rb new file mode 100644 index 000000000000..25fc186ae397 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/chronicle/v1/dashboard_query.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/any_pb' +require 'google/protobuf/timestamp_pb' +require 'google/type/date_pb' +require 'google/type/interval_pb' + + +descriptor_data = "\n/google/cloud/chronicle/v1/dashboard_query.proto\x12\x19google.cloud.chronicle.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x19google/protobuf/any.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x16google/type/date.proto\x1a\x1agoogle/type/interval.proto\"\xb5\x05\n\x0e\x44\x61shboardQuery\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x03\xfa\x41)\n\'chronicle.googleapis.com/DashboardQuery\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x43\n\x05input\x18\x03 \x01(\x0b\x32/.google.cloud.chronicle.v1.DashboardQuery.InputB\x03\xe0\x41\x02\x12H\n\x0f\x64\x61shboard_chart\x18\x04 \x01(\tB/\xe0\x41\x03\xfa\x41)\n\'chronicle.googleapis.com/DashboardChart\x12\x11\n\x04\x65tag\x18\x05 \x01(\tB\x03\xe0\x41\x01\x1a\x84\x02\n\x05Input\x12,\n\x0btime_window\x18\x01 \x01(\x0b\x32\x15.google.type.IntervalH\x00\x12U\n\rrelative_time\x18\x03 \x01(\x0b\x32<.google.cloud.chronicle.v1.DashboardQuery.Input.RelativeTimeH\x00\x1ah\n\x0cRelativeTime\x12;\n\ttime_unit\x18\x01 \x01(\x0e\x32#.google.cloud.chronicle.v1.TimeUnitB\x03\xe0\x41\x02\x12\x1b\n\x0estart_time_val\x18\x02 \x01(\x03\x42\x03\xe0\x41\x02\x42\x0c\n\ntime_input:\xa6\x01\xea\x41\xa2\x01\n\'chronicle.googleapis.com/DashboardQuery\x12Uprojects/{project}/locations/{location}/instances/{instance}/dashboardQueries/{query}*\x10\x64\x61shboardQueries2\x0e\x64\x61shboardQuery\"Y\n\x18GetDashboardQueryRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'chronicle.googleapis.com/DashboardQuery\"\xa0\x02\n\x1c\x45xecuteDashboardQueryRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'chronicle.googleapis.com/DashboardQuery\x12=\n\x05query\x18\x02 \x01(\x0b\x32).google.cloud.chronicle.v1.DashboardQueryB\x03\xe0\x41\x02\x12@\n\x07\x66ilters\x18\x03 \x03(\x0b\x32*.google.cloud.chronicle.v1.DashboardFilterB\x03\xe0\x41\x01\x12\x18\n\x0b\x63lear_cache\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12$\n\x17use_previous_time_range\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xd6\x05\n\x11QueryRuntimeError\x12\x13\n\x0b\x65rror_title\x18\x01 \x01(\t\x12\x19\n\x11\x65rror_description\x18\x02 \x01(\t\x12R\n\x0e\x65rror_severity\x18\x03 \x01(\x0e\x32:.google.cloud.chronicle.v1.QueryRuntimeError.ErrorSeverity\x12X\n\x08metadata\x18\x04 \x03(\x0b\x32\x46.google.cloud.chronicle.v1.QueryRuntimeError.QueryRuntimeErrorMetadata\x12R\n\x0ewarning_reason\x18\x05 \x01(\x0e\x32:.google.cloud.chronicle.v1.QueryRuntimeError.WarningReason\x1aq\n\x19QueryRuntimeErrorMetadata\x12\x45\n\x03key\x18\x01 \x01(\x0e\x32\x38.google.cloud.chronicle.v1.QueryRuntimeError.MetadataKey\x12\r\n\x05value\x18\x02 \x01(\t\"H\n\rErrorSeverity\x12\x1e\n\x1a\x45RROR_SEVERITY_UNSPECIFIED\x10\x00\x12\x0b\n\x07WARNING\x10\x01\x12\n\n\x06SEVERE\x10\x02\":\n\x0bMetadataKey\x12\x1c\n\x18METADATA_KEY_UNSPECIFIED\x10\x00\x12\r\n\tROW_LIMIT\x10\x01\"\x95\x01\n\rWarningReason\x12\x1e\n\x1aWARNING_REASON_UNSPECIFIED\x10\x00\x12\x16\n\x12ROW_LIMIT_EXCEEDED\x10\x01\x12\x1e\n\x1a\x44\x45\x46\x41ULT_ROW_LIMIT_EXCEEDED\x10\x02\x12,\n(CURATED_QUERY_DEFAULT_ROW_LIMIT_EXCEEDED\x10\x03\"\xc2\x0b\n\x1d\x45xecuteDashboardQueryResponse\x12T\n\x07results\x18\x01 \x03(\x0b\x32\x43.google.cloud.chronicle.v1.ExecuteDashboardQueryResponse.ColumnData\x12;\n\x0c\x64\x61ta_sources\x18\x03 \x03(\x0e\x32%.google.cloud.chronicle.v1.DataSource\x12J\n!last_backend_cache_refreshed_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12*\n\x0btime_window\x18\x05 \x01(\x0b\x32\x15.google.type.Interval\x12J\n\x14query_runtime_errors\x18\x06 \x03(\x0b\x32,.google.cloud.chronicle.v1.QueryRuntimeError\x12J\n\x11language_features\x18\x07 \x03(\x0e\x32*.google.cloud.chronicle.v1.LanguageFeatureB\x03\xe0\x41\x01\x1a\xa6\x04\n\x0b\x43olumnValue\x12\x12\n\x08null_val\x18\x01 \x01(\x08H\x00\x12\x12\n\x08\x62ool_val\x18\x02 \x01(\x08H\x00\x12\x13\n\tbytes_val\x18\x03 \x01(\x0cH\x00\x12\x14\n\ndouble_val\x18\x04 \x01(\x01H\x00\x12\x13\n\tint64_val\x18\x05 \x01(\x03H\x00\x12\x14\n\nuint64_val\x18\x06 \x01(\x04H\x00\x12\x14\n\nstring_val\x18\x07 \x01(\tH\x00\x12\x33\n\rtimestamp_val\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12%\n\x08\x64\x61te_val\x18\t \x01(\x0b\x32\x11.google.type.DateH\x00\x12)\n\tproto_val\x18\n \x01(\x0b\x32\x14.google.protobuf.AnyH\x00\x12\x64\n\x08metadata\x18\x0b \x01(\x0b\x32R.google.cloud.chronicle.v1.ExecuteDashboardQueryResponse.ColumnValue.ValueMetadata\x1a\x8c\x01\n\rValueMetadata\x12\x33\n\x05links\x18\x01 \x03(\x0b\x32$.google.cloud.chronicle.v1.InAppLink\x12\x13\n\x0b\x66ield_paths\x18\x02 \x03(\t\x12\x31\n\rtimestamp_val\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x07\n\x05value\x1a\xa3\x02\n\nColumnType\x12U\n\x05value\x18\x01 \x01(\x0b\x32\x44.google.cloud.chronicle.v1.ExecuteDashboardQueryResponse.ColumnValueH\x00\x12X\n\x04list\x18\x02 \x01(\x0b\x32H.google.cloud.chronicle.v1.ExecuteDashboardQueryResponse.ColumnType.ListH\x00\x1a\\\n\x04List\x12T\n\x06values\x18\x01 \x03(\x0b\x32\x44.google.cloud.chronicle.v1.ExecuteDashboardQueryResponse.ColumnValueB\x06\n\x04type\x1a\xae\x01\n\nColumnData\x12\x0e\n\x06\x63olumn\x18\x01 \x01(\t\x12S\n\x06values\x18\x02 \x03(\x0b\x32\x43.google.cloud.chronicle.v1.ExecuteDashboardQueryResponse.ColumnType\x12;\n\x08metadata\x18\x03 \x01(\x0b\x32).google.cloud.chronicle.v1.ColumnMetadata\"\xf4\x03\n\x0f\x44\x61shboardFilter\x12\n\n\x02id\x18\x01 \x01(\t\x12:\n\x0b\x64\x61ta_source\x18\x02 \x01(\x0e\x32%.google.cloud.chronicle.v1.DataSource\x12\x12\n\nfield_path\x18\x03 \x01(\t\x12\\\n filter_operator_and_field_values\x18\x04 \x03(\x0b\x32\x32.google.cloud.chronicle.v1.FilterOperatorAndValues\x12\x14\n\x0c\x64isplay_name\x18\x05 \x01(\t\x12\x11\n\tchart_ids\x18\x06 \x03(\t\x12*\n\x1dis_standard_time_range_filter\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x12\x19\n\x0cis_mandatory\x18\x08 \x01(\x08\x42\x03\xe0\x41\x01\x12\x37\n%is_standard_time_range_filter_enabled\x18\t \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12T\n\x16\x61\x64vanced_filter_config\x18\n \x01(\x0b\x32/.google.cloud.chronicle.v1.AdvancedFilterConfigB\x03\xe0\x41\x01\x42(\n&_is_standard_time_range_filter_enabled\"s\n\x17\x46ilterOperatorAndValues\x12\x42\n\x0f\x66ilter_operator\x18\x01 \x01(\x0e\x32).google.cloud.chronicle.v1.FilterOperator\x12\x14\n\x0c\x66ield_values\x18\x02 \x03(\t\"\xc6\x05\n\x14\x41\x64vancedFilterConfig\x12\x12\n\x05token\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06prefix\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06suffix\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tseparator\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10multiple_allowed\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1b\n\x0e\x64\x65\x66\x61ult_values\x18\x06 \x03(\tB\x03\xe0\x41\x01\x12!\n\x14skip_default_affixes\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x12V\n\x0cvalue_source\x18\x08 \x01(\x0b\x32;.google.cloud.chronicle.v1.AdvancedFilterConfig.ValueSourceB\x03\xe0\x41\x02\x1a\xd1\x01\n\x0bValueSource\x12\\\n\x0emanual_options\x18\x01 \x01(\x0b\x32=.google.cloud.chronicle.v1.AdvancedFilterConfig.ManualOptionsB\x03\xe0\x41\x01H\x00\x12Z\n\rquery_options\x18\x02 \x01(\x0b\x32<.google.cloud.chronicle.v1.AdvancedFilterConfig.QueryOptionsB\x03\xe0\x41\x01H\x00\x42\x08\n\x06source\x1a%\n\rManualOptions\x12\x14\n\x07options\x18\x01 \x03(\tB\x03\xe0\x41\x01\x1a\xa5\x01\n\x0cQueryOptions\x12\x12\n\x05query\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06\x63olumn\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\'\n\x1aglobal_time_filter_enabled\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x43\n\x05input\x18\x04 \x01(\x0b\x32/.google.cloud.chronicle.v1.DashboardQuery.InputB\x03\xe0\x41\x01\"9\n\tInAppLink\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\r\n\x05label\x18\x02 \x01(\t\x12\x10\n\x08icon_url\x18\x03 \x01(\t\"\xb5\x02\n\x0e\x43olumnMetadata\x12\x0e\n\x06\x63olumn\x18\x01 \x01(\t\x12\x12\n\nfield_path\x18\x02 \x01(\t\x12\x15\n\rfunction_name\x18\x03 \x01(\t\x12\x17\n\x0f\x66unction_module\x18\x04 \x01(\t\x12:\n\x0b\x64\x61ta_source\x18\x05 \x01(\x0e\x32%.google.cloud.chronicle.v1.DataSource\x12H\n\x12timestamp_metadata\x18\x06 \x01(\x0b\x32,.google.cloud.chronicle.v1.TimestampMetadata\x12\x11\n\tlongitude\x18\x07 \x01(\x08\x12\x10\n\x08latitude\x18\x08 \x01(\x08\x12\x10\n\x08selected\x18\t \x01(\x08\x12\x12\n\nunselected\x18\n \x01(\x08\"\x83\x01\n\x11TimestampMetadata\x12\x13\n\x0btime_format\x18\x01 \x01(\t\x12\x11\n\ttime_zone\x18\x02 \x01(\t\x12\x18\n\x10time_granularity\x18\x03 \x01(\t\x12\x13\n\x0bis_sortable\x18\x04 \x01(\x08\x12\x17\n\x0fis_interpolable\x18\x05 \x01(\x08*[\n\x0fLanguageFeature\x12 \n\x1cLANGUAGE_FEATURE_UNSPECIFIED\x10\x00\x12\t\n\x05JOINS\x10\x01\x12\n\n\x06STAGES\x10\x02\x12\x0f\n\x0b\x44\x41TA_TABLES\x10\x03*\xe4\x02\n\x0e\x46ilterOperator\x12\x1f\n\x1b\x46ILTER_OPERATOR_UNSPECIFIED\x10\x00\x12\t\n\x05\x45QUAL\x10\x01\x12\r\n\tNOT_EQUAL\x10\x02\x12\x06\n\x02IN\x10\x03\x12\x10\n\x0cGREATER_THAN\x10\x04\x12\x1c\n\x18GREATER_THAN_OR_EQUAL_TO\x10\x05\x12\r\n\tLESS_THAN\x10\x06\x12\x19\n\x15LESS_THAN_OR_EQUAL_TO\x10\x07\x12\x0b\n\x07\x42\x45TWEEN\x10\x08\x12\x08\n\x04PAST\x10\t\x12\x0b\n\x07IS_NULL\x10\n\x12\x0f\n\x0bIS_NOT_NULL\x10\x0b\x12\x0f\n\x0bSTARTS_WITH\x10\x0c\x12\r\n\tENDS_WITH\x10\r\x12\x18\n\x14\x44OES_NOT_STARTS_WITH\x10\x0e\x12\x16\n\x12\x44OES_NOT_ENDS_WITH\x10\x0f\x12\n\n\x06NOT_IN\x10\x10\x12\x0c\n\x08\x43ONTAINS\x10\x11\x12\x14\n\x10\x44OES_NOT_CONTAIN\x10\x12*\x9a\x02\n\nDataSource\x12\x1b\n\x17\x44\x41TA_SOURCE_UNSPECIFIED\x10\x00\x12\x07\n\x03UDM\x10\x01\x12\n\n\x06\x45NTITY\x10\x02\x12\x15\n\x11INGESTION_METRICS\x10\x03\x12\x13\n\x0fRULE_DETECTIONS\x10\x04\x12\x0c\n\x08RULESETS\x10\x05\x12\n\n\x06GLOBAL\x10\x06\x12\x0f\n\x0bIOC_MATCHES\x10\x07\x12\t\n\x05RULES\x10\x08\x12\x0e\n\nSOAR_CASES\x10\t\x12\x12\n\x0eSOAR_PLAYBOOKS\x10\n\x12\x15\n\x11SOAR_CASE_HISTORY\x10\x0b\x12\x0e\n\nDATA_TABLE\x10\x0c\x12\x11\n\rINVESTIGATION\x10\r\x12\x1a\n\x16INVESTIGATION_FEEDBACK\x10\x0e*o\n\x08TimeUnit\x12\x19\n\x15TIME_UNIT_UNSPECIFIED\x10\x00\x12\n\n\x06SECOND\x10\x01\x12\n\n\x06MINUTE\x10\x02\x12\x08\n\x04HOUR\x10\x03\x12\x07\n\x03\x44\x41Y\x10\x04\x12\x08\n\x04WEEK\x10\x05\x12\t\n\x05MONTH\x10\x06\x12\x08\n\x04YEAR\x10\x07\x32\xfc\x04\n\x15\x44\x61shboardQueryService\x12\xc4\x01\n\x11GetDashboardQuery\x12\x33.google.cloud.chronicle.v1.GetDashboardQueryRequest\x1a).google.cloud.chronicle.v1.DashboardQuery\"O\xda\x41\x04name\x82\xd3\xe4\x93\x02\x42\x12@/v1/{name=projects/*/locations/*/instances/*/dashboardQueries/*}\x12\xee\x01\n\x15\x45xecuteDashboardQuery\x12\x37.google.cloud.chronicle.v1.ExecuteDashboardQueryRequest\x1a\x38.google.cloud.chronicle.v1.ExecuteDashboardQueryResponse\"b\xda\x41\x0cparent,query\x82\xd3\xe4\x93\x02M\"H/v1/{parent=projects/*/locations/*/instances/*}/dashboardQueries:execute:\x01*\x1a\xaa\x01\xca\x41\x18\x63hronicle.googleapis.com\xd2\x41\x8b\x01https://www.googleapis.com/auth/chronicle,https://www.googleapis.com/auth/chronicle.readonly,https://www.googleapis.com/auth/cloud-platformB\xca\x01\n\x1d\x63om.google.cloud.chronicle.v1B\x13\x44\x61shboardQueryProtoP\x01Z;cloud.google.com/go/chronicle/apiv1/chroniclepb;chroniclepb\xaa\x02\x19Google.Cloud.Chronicle.V1\xca\x02\x19Google\\Cloud\\Chronicle\\V1\xea\x02\x1cGoogle::Cloud::Chronicle::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Chronicle + module V1 + DashboardQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardQuery").msgclass + DashboardQuery::Input = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardQuery.Input").msgclass + DashboardQuery::Input::RelativeTime = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardQuery.Input.RelativeTime").msgclass + GetDashboardQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.GetDashboardQueryRequest").msgclass + ExecuteDashboardQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.ExecuteDashboardQueryRequest").msgclass + QueryRuntimeError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.QueryRuntimeError").msgclass + QueryRuntimeError::QueryRuntimeErrorMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.QueryRuntimeError.QueryRuntimeErrorMetadata").msgclass + QueryRuntimeError::ErrorSeverity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.QueryRuntimeError.ErrorSeverity").enummodule + QueryRuntimeError::MetadataKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.QueryRuntimeError.MetadataKey").enummodule + QueryRuntimeError::WarningReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.QueryRuntimeError.WarningReason").enummodule + ExecuteDashboardQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.ExecuteDashboardQueryResponse").msgclass + ExecuteDashboardQueryResponse::ColumnValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.ExecuteDashboardQueryResponse.ColumnValue").msgclass + ExecuteDashboardQueryResponse::ColumnValue::ValueMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.ExecuteDashboardQueryResponse.ColumnValue.ValueMetadata").msgclass + ExecuteDashboardQueryResponse::ColumnType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.ExecuteDashboardQueryResponse.ColumnType").msgclass + ExecuteDashboardQueryResponse::ColumnType::List = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.ExecuteDashboardQueryResponse.ColumnType.List").msgclass + ExecuteDashboardQueryResponse::ColumnData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.ExecuteDashboardQueryResponse.ColumnData").msgclass + DashboardFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardFilter").msgclass + FilterOperatorAndValues = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.FilterOperatorAndValues").msgclass + AdvancedFilterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.AdvancedFilterConfig").msgclass + AdvancedFilterConfig::ValueSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.AdvancedFilterConfig.ValueSource").msgclass + AdvancedFilterConfig::ManualOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.AdvancedFilterConfig.ManualOptions").msgclass + AdvancedFilterConfig::QueryOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.AdvancedFilterConfig.QueryOptions").msgclass + InAppLink = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.InAppLink").msgclass + ColumnMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.ColumnMetadata").msgclass + TimestampMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.TimestampMetadata").msgclass + LanguageFeature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.LanguageFeature").enummodule + FilterOperator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.FilterOperator").enummodule + DataSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DataSource").enummodule + TimeUnit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.TimeUnit").enummodule + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_service.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_service.rb new file mode 100644 index 000000000000..fea1bce2d395 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/chronicle/v1/version" + +require "google/cloud/chronicle/v1/dashboard_query_service/credentials" +require "google/cloud/chronicle/v1/dashboard_query_service/paths" +require "google/cloud/chronicle/v1/dashboard_query_service/client" +require "google/cloud/chronicle/v1/dashboard_query_service/rest" + +module Google + module Cloud + module Chronicle + module V1 + ## + # A service providing functionality for managing dashboards' queries. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/chronicle/v1/dashboard_query_service" + # client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/chronicle/v1/dashboard_query_service/rest" + # client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Rest::Client.new + # + module DashboardQueryService + end + end + end + end +end + +helper_path = ::File.join __dir__, "dashboard_query_service", "helpers.rb" +require "google/cloud/chronicle/v1/dashboard_query_service/helpers" if ::File.file? helper_path diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_service/client.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_service/client.rb new file mode 100644 index 000000000000..75eb19e93766 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_service/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/chronicle/v1/dashboard_query_pb" + +module Google + module Cloud + module Chronicle + module V1 + module DashboardQueryService + ## + # Client for the DashboardQueryService service. + # + # A service providing functionality for managing dashboards' queries. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "chronicle.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :dashboard_query_service_stub + + ## + # Configure the DashboardQueryService Client class. + # + # See {::Google::Cloud::Chronicle::V1::DashboardQueryService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DashboardQueryService clients + # ::Google::Cloud::Chronicle::V1::DashboardQueryService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Chronicle", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.get_dashboard_query.timeout = 60.0 + default_config.rpcs.get_dashboard_query.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.execute_dashboard_query.timeout = 1800.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the DashboardQueryService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Chronicle::V1::DashboardQueryService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @dashboard_query_service_stub.universe_domain + end + + ## + # Create a new DashboardQueryService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the DashboardQueryService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/chronicle/v1/dashboard_query_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @dashboard_query_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Chronicle::V1::DashboardQueryService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @dashboard_query_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @dashboard_query_service_stub.logger + end + + # Service calls + + ## + # Get a dashboard query. + # + # @overload get_dashboard_query(request, options = nil) + # Pass arguments to `get_dashboard_query` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::GetDashboardQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::GetDashboardQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_dashboard_query(name: nil) + # Pass arguments to `get_dashboard_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the dashboardQuery to retrieve. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/dashboardQueries/\\{query} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Chronicle::V1::DashboardQuery] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Chronicle::V1::DashboardQuery] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::GetDashboardQueryRequest.new + # + # # Call the get_dashboard_query method. + # result = client.get_dashboard_query request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::DashboardQuery. + # p result + # + def get_dashboard_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::GetDashboardQueryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_dashboard_query.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_dashboard_query.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_dashboard_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dashboard_query_service_stub.call_rpc :get_dashboard_query, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Execute a query and return the data. + # + # @overload execute_dashboard_query(request, options = nil) + # Pass arguments to `execute_dashboard_query` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload execute_dashboard_query(parent: nil, query: nil, filters: nil, clear_cache: nil, use_previous_time_range: nil) + # Pass arguments to `execute_dashboard_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent, under which to run this dashboardQuery. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @param query [::Google::Cloud::Chronicle::V1::DashboardQuery, ::Hash] + # Required. The query to execute and get results back for. + # QueryID or 'query', 'input.time_window' fields will be used. Use + # 'native_dashboard' and 'dashboard_chart' fields if it is an in-dashboard + # query. + # @param filters [::Array<::Google::Cloud::Chronicle::V1::DashboardFilter, ::Hash>] + # Optional. Dashboard level filters other than query string. + # @param clear_cache [::Boolean] + # Optional. When true, the backend would read from the database, rather than + # fetching data directly from the cache. + # @param use_previous_time_range [::Boolean] + # Optional. When true, the backend will execute the query against the + # previous time range of the query. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest.new + # + # # Call the execute_dashboard_query method. + # result = client.execute_dashboard_query request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse. + # p result + # + def execute_dashboard_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.execute_dashboard_query.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.execute_dashboard_query.timeout, + metadata: metadata, + retry_policy: @config.rpcs.execute_dashboard_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dashboard_query_service_stub.call_rpc :execute_dashboard_query, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the DashboardQueryService API. + # + # This class represents the configuration for DashboardQueryService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Chronicle::V1::DashboardQueryService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_dashboard_query to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Chronicle::V1::DashboardQueryService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_dashboard_query.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_dashboard_query.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "chronicle.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the DashboardQueryService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_dashboard_query` + # @return [::Gapic::Config::Method] + # + attr_reader :get_dashboard_query + ## + # RPC-specific configuration for `execute_dashboard_query` + # @return [::Gapic::Config::Method] + # + attr_reader :execute_dashboard_query + + # @private + def initialize parent_rpcs = nil + get_dashboard_query_config = parent_rpcs.get_dashboard_query if parent_rpcs.respond_to? :get_dashboard_query + @get_dashboard_query = ::Gapic::Config::Method.new get_dashboard_query_config + execute_dashboard_query_config = parent_rpcs.execute_dashboard_query if parent_rpcs.respond_to? :execute_dashboard_query + @execute_dashboard_query = ::Gapic::Config::Method.new execute_dashboard_query_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_service/credentials.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_service/credentials.rb new file mode 100644 index 000000000000..18fdc4a6bfae --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_service/credentials.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Chronicle + module V1 + module DashboardQueryService + # Credentials for the DashboardQueryService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/chronicle", + "https://www.googleapis.com/auth/chronicle.readonly", + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_service/paths.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_service/paths.rb new file mode 100644 index 000000000000..937d3f33b4e2 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_service/paths.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Chronicle + module V1 + module DashboardQueryService + # Path helper methods for the DashboardQueryService API. + module Paths + ## + # Create a fully-qualified DashboardChart resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/instances/{instance}/dashboardCharts/{chart}` + # + # @param project [String] + # @param location [String] + # @param instance [String] + # @param chart [String] + # + # @return [::String] + def dashboard_chart_path project:, location:, instance:, chart: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + + "projects/#{project}/locations/#{location}/instances/#{instance}/dashboardCharts/#{chart}" + end + + ## + # Create a fully-qualified DashboardQuery resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/instances/{instance}/dashboardQueries/{query}` + # + # @param project [String] + # @param location [String] + # @param instance [String] + # @param query [String] + # + # @return [::String] + def dashboard_query_path project:, location:, instance:, query: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + + "projects/#{project}/locations/#{location}/instances/#{instance}/dashboardQueries/#{query}" + end + + ## + # Create a fully-qualified Instance resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/instances/{instance}` + # + # @param project [String] + # @param location [String] + # @param instance [String] + # + # @return [::String] + def instance_path project:, location:, instance: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/instances/#{instance}" + end + + extend self + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_service/rest.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_service/rest.rb new file mode 100644 index 000000000000..7679559f64da --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_service/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/chronicle/v1/version" + +require "google/cloud/chronicle/v1/dashboard_query_service/credentials" +require "google/cloud/chronicle/v1/dashboard_query_service/paths" +require "google/cloud/chronicle/v1/dashboard_query_service/rest/client" + +module Google + module Cloud + module Chronicle + module V1 + ## + # A service providing functionality for managing dashboards' queries. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/chronicle/v1/dashboard_query_service/rest" + # client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Rest::Client.new + # + module DashboardQueryService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/chronicle/v1/dashboard_query_service/rest/helpers" if ::File.file? helper_path diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_service/rest/client.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_service/rest/client.rb new file mode 100644 index 000000000000..2653019e183b --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_service/rest/client.rb @@ -0,0 +1,532 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/chronicle/v1/dashboard_query_pb" +require "google/cloud/chronicle/v1/dashboard_query_service/rest/service_stub" + +module Google + module Cloud + module Chronicle + module V1 + module DashboardQueryService + module Rest + ## + # REST client for the DashboardQueryService service. + # + # A service providing functionality for managing dashboards' queries. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "chronicle.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :dashboard_query_service_stub + + ## + # Configure the DashboardQueryService Client class. + # + # See {::Google::Cloud::Chronicle::V1::DashboardQueryService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DashboardQueryService clients + # ::Google::Cloud::Chronicle::V1::DashboardQueryService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Chronicle", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.get_dashboard_query.timeout = 60.0 + default_config.rpcs.get_dashboard_query.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.execute_dashboard_query.timeout = 1800.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the DashboardQueryService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Chronicle::V1::DashboardQueryService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @dashboard_query_service_stub.universe_domain + end + + ## + # Create a new DashboardQueryService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the DashboardQueryService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @dashboard_query_service_stub = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @dashboard_query_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @dashboard_query_service_stub.logger + end + + # Service calls + + ## + # Get a dashboard query. + # + # @overload get_dashboard_query(request, options = nil) + # Pass arguments to `get_dashboard_query` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::GetDashboardQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::GetDashboardQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_dashboard_query(name: nil) + # Pass arguments to `get_dashboard_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the dashboardQuery to retrieve. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/dashboardQueries/\\{query} + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::DashboardQuery] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::DashboardQuery] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::DashboardQueryService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::GetDashboardQueryRequest.new + # + # # Call the get_dashboard_query method. + # result = client.get_dashboard_query request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::DashboardQuery. + # p result + # + def get_dashboard_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::GetDashboardQueryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_dashboard_query.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_dashboard_query.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_dashboard_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dashboard_query_service_stub.get_dashboard_query request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Execute a query and return the data. + # + # @overload execute_dashboard_query(request, options = nil) + # Pass arguments to `execute_dashboard_query` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload execute_dashboard_query(parent: nil, query: nil, filters: nil, clear_cache: nil, use_previous_time_range: nil) + # Pass arguments to `execute_dashboard_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent, under which to run this dashboardQuery. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @param query [::Google::Cloud::Chronicle::V1::DashboardQuery, ::Hash] + # Required. The query to execute and get results back for. + # QueryID or 'query', 'input.time_window' fields will be used. Use + # 'native_dashboard' and 'dashboard_chart' fields if it is an in-dashboard + # query. + # @param filters [::Array<::Google::Cloud::Chronicle::V1::DashboardFilter, ::Hash>] + # Optional. Dashboard level filters other than query string. + # @param clear_cache [::Boolean] + # Optional. When true, the backend would read from the database, rather than + # fetching data directly from the cache. + # @param use_previous_time_range [::Boolean] + # Optional. When true, the backend will execute the query against the + # previous time range of the query. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::DashboardQueryService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest.new + # + # # Call the execute_dashboard_query method. + # result = client.execute_dashboard_query request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse. + # p result + # + def execute_dashboard_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.execute_dashboard_query.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.execute_dashboard_query.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.execute_dashboard_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dashboard_query_service_stub.execute_dashboard_query request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the DashboardQueryService REST API. + # + # This class represents the configuration for DashboardQueryService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Chronicle::V1::DashboardQueryService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_dashboard_query to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Chronicle::V1::DashboardQueryService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_dashboard_query.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_dashboard_query.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "chronicle.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the DashboardQueryService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_dashboard_query` + # @return [::Gapic::Config::Method] + # + attr_reader :get_dashboard_query + ## + # RPC-specific configuration for `execute_dashboard_query` + # @return [::Gapic::Config::Method] + # + attr_reader :execute_dashboard_query + + # @private + def initialize parent_rpcs = nil + get_dashboard_query_config = parent_rpcs.get_dashboard_query if parent_rpcs.respond_to? :get_dashboard_query + @get_dashboard_query = ::Gapic::Config::Method.new get_dashboard_query_config + execute_dashboard_query_config = parent_rpcs.execute_dashboard_query if parent_rpcs.respond_to? :execute_dashboard_query + @execute_dashboard_query = ::Gapic::Config::Method.new execute_dashboard_query_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_service/rest/service_stub.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_service/rest/service_stub.rb new file mode 100644 index 000000000000..b58063ce1d9b --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_service/rest/service_stub.rb @@ -0,0 +1,204 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/chronicle/v1/dashboard_query_pb" + +module Google + module Cloud + module Chronicle + module V1 + module DashboardQueryService + module Rest + ## + # REST service stub for the DashboardQueryService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the get_dashboard_query REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::GetDashboardQueryRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::DashboardQuery] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::DashboardQuery] + # A result object deserialized from the server's reply + def get_dashboard_query request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_dashboard_query_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_dashboard_query", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Chronicle::V1::DashboardQuery.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the execute_dashboard_query REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse] + # A result object deserialized from the server's reply + def execute_dashboard_query request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_execute_dashboard_query_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "execute_dashboard_query", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the get_dashboard_query REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::GetDashboardQueryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_dashboard_query_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/dashboardQueries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the execute_dashboard_query REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_execute_dashboard_query_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/dashboardQueries:execute", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_services_pb.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_services_pb.rb new file mode 100644 index 000000000000..f96c55661d70 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/dashboard_query_services_pb.rb @@ -0,0 +1,47 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/chronicle/v1/dashboard_query.proto for package 'Google.Cloud.Chronicle.V1' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/chronicle/v1/dashboard_query_pb' + +module Google + module Cloud + module Chronicle + module V1 + module DashboardQueryService + # A service providing functionality for managing dashboards' queries. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.chronicle.v1.DashboardQueryService' + + # Get a dashboard query. + rpc :GetDashboardQuery, ::Google::Cloud::Chronicle::V1::GetDashboardQueryRequest, ::Google::Cloud::Chronicle::V1::DashboardQuery + # Execute a query and return the data. + rpc :ExecuteDashboardQuery, ::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest, ::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_metadata_pb.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_metadata_pb.rb new file mode 100644 index 000000000000..3248928b99dd --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_metadata_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/chronicle/v1/featured_content_metadata.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n9google/cloud/chronicle/v1/featured_content_metadata.proto\x12\x19google.cloud.chronicle.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x92\x04\n\x17\x46\x65\x61turedContentMetadata\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06\x61uthor\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x16\n\tcertified\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\ncategories\x18\x08 \x03(\tB\x03\xe0\x41\x03\x12\x14\n\x07version\x18\t \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\x08verified\x18\n \x01(\x08\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12^\n\x0bsource_type\x18\x0b \x01(\x0e\x32\x44.google.cloud.chronicle.v1.FeaturedContentMetadata.ContentSourceTypeB\x03\xe0\x41\x03\"`\n\x11\x43ontentSourceType\x12#\n\x1f\x43ONTENT_SOURCE_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06GOOGLE\x10\x01\x12\r\n\tCOMMUNITY\x10\x02\x12\x0b\n\x07PARTNER\x10\x03\x42\x0b\n\t_verifiedB\xd3\x01\n\x1d\x63om.google.cloud.chronicle.v1B\x1c\x46\x65\x61turedContentMetadataProtoP\x01Z;cloud.google.com/go/chronicle/apiv1/chroniclepb;chroniclepb\xaa\x02\x19Google.Cloud.Chronicle.V1\xca\x02\x19Google\\Cloud\\Chronicle\\V1\xea\x02\x1cGoogle::Cloud::Chronicle::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Chronicle + module V1 + FeaturedContentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.FeaturedContentMetadata").msgclass + FeaturedContentMetadata::ContentSourceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.FeaturedContentMetadata.ContentSourceType").enummodule + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_pb.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_pb.rb new file mode 100644 index 000000000000..bd3faf5f2172 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_pb.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/chronicle/v1/featured_content_native_dashboard.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/chronicle/v1/featured_content_metadata_pb' +require 'google/cloud/chronicle/v1/native_dashboard_pb' + + +descriptor_data = "\nAgoogle/cloud/chronicle/v1/featured_content_native_dashboard.proto\x12\x19google.cloud.chronicle.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x39google/cloud/chronicle/v1/featured_content_metadata.proto\x1a\x30google/cloud/chronicle/v1/native_dashboard.proto\"\xf5\x03\n\x1e\x46\x65\x61turedContentNativeDashboard\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12Q\n\x10\x63ontent_metadata\x18\x02 \x01(\x0b\x32\x32.google.cloud.chronicle.v1.FeaturedContentMetadataB\x03\xe0\x41\x03\x12^\n\x11\x64\x61shboard_content\x18\x03 \x01(\x0b\x32>.google.cloud.chronicle.v1.NativeDashboardWithChartsAndQueriesB\x03\xe0\x41\x01:\x8c\x02\xea\x41\x88\x02\n7chronicle.googleapis.com/FeaturedContentNativeDashboard\x12\x8b\x01projects/{project}/locations/{location}/instances/{instance}/contentHub/featuredContentNativeDashboards/{featured_content_native_dashboard}*\x1f\x66\x65\x61turedContentNativeDashboards2\x1e\x66\x65\x61turedContentNativeDashboard\"y\n(GetFeaturedContentNativeDashboardRequest\x12M\n\x04name\x18\x01 \x01(\tB?\xe0\x41\x02\xfa\x41\x39\n7chronicle.googleapis.com/FeaturedContentNativeDashboard\"\xc3\x01\n*ListFeaturedContentNativeDashboardsRequest\x12O\n\x06parent\x18\x01 \x01(\tB?\xe0\x41\x02\xfa\x41\x39\x12\x37\x63hronicle.googleapis.com/FeaturedContentNativeDashboard\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xad\x01\n+ListFeaturedContentNativeDashboardsResponse\x12\x65\n\"featured_content_native_dashboards\x18\x01 \x03(\x0b\x32\x39.google.cloud.chronicle.v1.FeaturedContentNativeDashboard\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xe8\x01\n,InstallFeaturedContentNativeDashboardRequest\x12M\n\x04name\x18\x01 \x01(\tB?\xe0\x41\x02\xfa\x41\x39\n7chronicle.googleapis.com/FeaturedContentNativeDashboard\x12i\n!featured_content_native_dashboard\x18\x02 \x01(\x0b\x32\x39.google.cloud.chronicle.v1.FeaturedContentNativeDashboardB\x03\xe0\x41\x01\"{\n-InstallFeaturedContentNativeDashboardResponse\x12J\n\x10native_dashboard\x18\x01 \x01(\tB0\xe0\x41\x01\xfa\x41*\n(chronicle.googleapis.com/NativeDashboard2\xbc\x08\n%FeaturedContentNativeDashboardService\x12\x8e\x02\n!GetFeaturedContentNativeDashboard\x12\x43.google.cloud.chronicle.v1.GetFeaturedContentNativeDashboardRequest\x1a\x39.google.cloud.chronicle.v1.FeaturedContentNativeDashboard\"i\xda\x41\x04name\x82\xd3\xe4\x93\x02\\\x12Z/v1/{name=projects/*/locations/*/instances/*/contentHub/featuredContentNativeDashboards/*}\x12\xa1\x02\n#ListFeaturedContentNativeDashboards\x12\x45.google.cloud.chronicle.v1.ListFeaturedContentNativeDashboardsRequest\x1a\x46.google.cloud.chronicle.v1.ListFeaturedContentNativeDashboardsResponse\"k\xda\x41\x06parent\x82\xd3\xe4\x93\x02\\\x12Z/v1/{parent=projects/*/locations/*/instances/*/contentHub}/featuredContentNativeDashboards\x12\xb0\x02\n%InstallFeaturedContentNativeDashboard\x12G.google.cloud.chronicle.v1.InstallFeaturedContentNativeDashboardRequest\x1aH.google.cloud.chronicle.v1.InstallFeaturedContentNativeDashboardResponse\"t\xda\x41\x04name\x82\xd3\xe4\x93\x02g\"b/v1/{name=projects/*/locations/*/instances/*/contentHub/featuredContentNativeDashboards/*}:install:\x01*\x1a\xaa\x01\xca\x41\x18\x63hronicle.googleapis.com\xd2\x41\x8b\x01https://www.googleapis.com/auth/chronicle,https://www.googleapis.com/auth/chronicle.readonly,https://www.googleapis.com/auth/cloud-platformB\xe4\x02\n\x1d\x63om.google.cloud.chronicle.v1B#FeaturedContentNativeDashboardProtoP\x01Z;cloud.google.com/go/chronicle/apiv1/chroniclepb;chroniclepb\xaa\x02\x19Google.Cloud.Chronicle.V1\xca\x02\x19Google\\Cloud\\Chronicle\\V1\xea\x02\x1cGoogle::Cloud::Chronicle::V1\xea\x41\x86\x01\n#chronicle.googleapis.com/ContentHub\x12Gprojects/{project}/locations/{location}/instances/{instance}/contentHub*\ncontentHub2\ncontentHubb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Chronicle + module V1 + FeaturedContentNativeDashboard = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.FeaturedContentNativeDashboard").msgclass + GetFeaturedContentNativeDashboardRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.GetFeaturedContentNativeDashboardRequest").msgclass + ListFeaturedContentNativeDashboardsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.ListFeaturedContentNativeDashboardsRequest").msgclass + ListFeaturedContentNativeDashboardsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.ListFeaturedContentNativeDashboardsResponse").msgclass + InstallFeaturedContentNativeDashboardRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.InstallFeaturedContentNativeDashboardRequest").msgclass + InstallFeaturedContentNativeDashboardResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.InstallFeaturedContentNativeDashboardResponse").msgclass + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service.rb new file mode 100644 index 000000000000..d9b60adfefbe --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/chronicle/v1/version" + +require "google/cloud/chronicle/v1/featured_content_native_dashboard_service/credentials" +require "google/cloud/chronicle/v1/featured_content_native_dashboard_service/paths" +require "google/cloud/chronicle/v1/featured_content_native_dashboard_service/client" +require "google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest" + +module Google + module Cloud + module Chronicle + module V1 + ## + # This service provides functionality for managing + # FeaturedContentNativeDashboard. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/chronicle/v1/featured_content_native_dashboard_service" + # client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest" + # client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::Client.new + # + module FeaturedContentNativeDashboardService + end + end + end + end +end + +helper_path = ::File.join __dir__, "featured_content_native_dashboard_service", "helpers.rb" +require "google/cloud/chronicle/v1/featured_content_native_dashboard_service/helpers" if ::File.file? helper_path diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/client.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/client.rb new file mode 100644 index 000000000000..5da633a058dc --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/client.rb @@ -0,0 +1,717 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/chronicle/v1/featured_content_native_dashboard_pb" + +module Google + module Cloud + module Chronicle + module V1 + module FeaturedContentNativeDashboardService + ## + # Client for the FeaturedContentNativeDashboardService service. + # + # This service provides functionality for managing + # FeaturedContentNativeDashboard. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "chronicle.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :featured_content_native_dashboard_service_stub + + ## + # Configure the FeaturedContentNativeDashboardService Client class. + # + # See {::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all FeaturedContentNativeDashboardService clients + # ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Chronicle", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.get_featured_content_native_dashboard.timeout = 60.0 + default_config.rpcs.get_featured_content_native_dashboard.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_featured_content_native_dashboards.timeout = 60.0 + default_config.rpcs.list_featured_content_native_dashboards.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the FeaturedContentNativeDashboardService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @featured_content_native_dashboard_service_stub.universe_domain + end + + ## + # Create a new FeaturedContentNativeDashboardService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the FeaturedContentNativeDashboardService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/chronicle/v1/featured_content_native_dashboard_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @featured_content_native_dashboard_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @featured_content_native_dashboard_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @featured_content_native_dashboard_service_stub.logger + end + + # Service calls + + ## + # Get a native dashboard featured content. + # + # @overload get_featured_content_native_dashboard(request, options = nil) + # Pass arguments to `get_featured_content_native_dashboard` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::GetFeaturedContentNativeDashboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::GetFeaturedContentNativeDashboardRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_featured_content_native_dashboard(name: nil) + # Pass arguments to `get_featured_content_native_dashboard` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the FeaturedContentNativeDashboard to + # retrieve. Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/contentHub/featuredContentNativeDashboards/\\{featured_content_native_dashboard} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::GetFeaturedContentNativeDashboardRequest.new + # + # # Call the get_featured_content_native_dashboard method. + # result = client.get_featured_content_native_dashboard request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard. + # p result + # + def get_featured_content_native_dashboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::GetFeaturedContentNativeDashboardRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_featured_content_native_dashboard.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_featured_content_native_dashboard.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_featured_content_native_dashboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featured_content_native_dashboard_service_stub.call_rpc :get_featured_content_native_dashboard, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List all native dashboards featured content. + # + # @overload list_featured_content_native_dashboards(request, options = nil) + # Pass arguments to `list_featured_content_native_dashboards` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_featured_content_native_dashboards(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_featured_content_native_dashboards` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent, which owns this collection of + # FeaturedContentNativeDashboards. Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/contentHub + # @param page_size [::Integer] + # Optional. The maximum number of FeaturedContentNativeDashboards to return. + # The service may return fewer than this value. If unspecified, at most 100 + # FeaturedContentNativeDashboards will be returned. The maximum value is 100; + # values above 100 will be coerced to 100. + # @param page_token [::String] + # Optional. A page token, received from a previous + # `ListFeaturedContentNativeDashboards` call. Provide this to retrieve the + # subsequent page. + # + # When paginating, all other parameters provided to + # `ListFeaturedContentNativeDashboards` must match the call that provided the + # page token. + # @param filter [::String] + # Optional. The filter to apply to list the FeaturedContentNativeDashboards. + # + # The filter syntax follows Google Cloud syntax: https://google.aip.dev/160. + # + # Supported fields for filtering: + # + # * `name`: The resource name of the featured content. + # * `content_metadata.description`: The description of the featured + # content. + # + # When a literal value is provided without a field, it will perform a + # substring search across both `name` and `content_metadata.description`. + # + # Examples: + # + # * `"test"`: Matches featured content where either the name or description + # contains "test" as a substring. + # * `name="test"`: Matches featured content where the name contains "test". + # * `content_metadata.description="test"`: Matches featured content where + # the description contains "test". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsRequest.new + # + # # Call the list_featured_content_native_dashboards method. + # result = client.list_featured_content_native_dashboards request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard. + # p item + # end + # + def list_featured_content_native_dashboards request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_featured_content_native_dashboards.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_featured_content_native_dashboards.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_featured_content_native_dashboards.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featured_content_native_dashboard_service_stub.call_rpc :list_featured_content_native_dashboards, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @featured_content_native_dashboard_service_stub, :list_featured_content_native_dashboards, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Install a native dashboard featured content. + # + # @overload install_featured_content_native_dashboard(request, options = nil) + # Pass arguments to `install_featured_content_native_dashboard` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload install_featured_content_native_dashboard(name: nil, featured_content_native_dashboard: nil) + # Pass arguments to `install_featured_content_native_dashboard` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the FeaturedContentNativeDashboard to + # install. Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/contentHub/featuredContentNativeDashboards/\\{featured_content_native_dashboard} + # @param featured_content_native_dashboard [::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard, ::Hash] + # Optional. The FeaturedContentNativeDashboard to install. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardRequest.new + # + # # Call the install_featured_content_native_dashboard method. + # result = client.install_featured_content_native_dashboard request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardResponse. + # p result + # + def install_featured_content_native_dashboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.install_featured_content_native_dashboard.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.install_featured_content_native_dashboard.timeout, + metadata: metadata, + retry_policy: @config.rpcs.install_featured_content_native_dashboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featured_content_native_dashboard_service_stub.call_rpc :install_featured_content_native_dashboard, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the FeaturedContentNativeDashboardService API. + # + # This class represents the configuration for FeaturedContentNativeDashboardService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_featured_content_native_dashboard to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_featured_content_native_dashboard.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_featured_content_native_dashboard.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "chronicle.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the FeaturedContentNativeDashboardService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_featured_content_native_dashboard` + # @return [::Gapic::Config::Method] + # + attr_reader :get_featured_content_native_dashboard + ## + # RPC-specific configuration for `list_featured_content_native_dashboards` + # @return [::Gapic::Config::Method] + # + attr_reader :list_featured_content_native_dashboards + ## + # RPC-specific configuration for `install_featured_content_native_dashboard` + # @return [::Gapic::Config::Method] + # + attr_reader :install_featured_content_native_dashboard + + # @private + def initialize parent_rpcs = nil + get_featured_content_native_dashboard_config = parent_rpcs.get_featured_content_native_dashboard if parent_rpcs.respond_to? :get_featured_content_native_dashboard + @get_featured_content_native_dashboard = ::Gapic::Config::Method.new get_featured_content_native_dashboard_config + list_featured_content_native_dashboards_config = parent_rpcs.list_featured_content_native_dashboards if parent_rpcs.respond_to? :list_featured_content_native_dashboards + @list_featured_content_native_dashboards = ::Gapic::Config::Method.new list_featured_content_native_dashboards_config + install_featured_content_native_dashboard_config = parent_rpcs.install_featured_content_native_dashboard if parent_rpcs.respond_to? :install_featured_content_native_dashboard + @install_featured_content_native_dashboard = ::Gapic::Config::Method.new install_featured_content_native_dashboard_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/credentials.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/credentials.rb new file mode 100644 index 000000000000..2989f4bffb1d --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/credentials.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Chronicle + module V1 + module FeaturedContentNativeDashboardService + # Credentials for the FeaturedContentNativeDashboardService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/chronicle", + "https://www.googleapis.com/auth/chronicle.readonly", + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/paths.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/paths.rb new file mode 100644 index 000000000000..a71c8d10fcf5 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/paths.rb @@ -0,0 +1,136 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Chronicle + module V1 + module FeaturedContentNativeDashboardService + # Path helper methods for the FeaturedContentNativeDashboardService API. + module Paths + ## + # Create a fully-qualified ContentHub resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/instances/{instance}/contentHub` + # + # @param project [String] + # @param location [String] + # @param instance [String] + # + # @return [::String] + def content_hub_path project:, location:, instance: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/instances/#{instance}/contentHub" + end + + ## + # Create a fully-qualified DashboardChart resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/instances/{instance}/dashboardCharts/{chart}` + # + # @param project [String] + # @param location [String] + # @param instance [String] + # @param chart [String] + # + # @return [::String] + def dashboard_chart_path project:, location:, instance:, chart: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + + "projects/#{project}/locations/#{location}/instances/#{instance}/dashboardCharts/#{chart}" + end + + ## + # Create a fully-qualified DashboardQuery resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/instances/{instance}/dashboardQueries/{query}` + # + # @param project [String] + # @param location [String] + # @param instance [String] + # @param query [String] + # + # @return [::String] + def dashboard_query_path project:, location:, instance:, query: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + + "projects/#{project}/locations/#{location}/instances/#{instance}/dashboardQueries/#{query}" + end + + ## + # Create a fully-qualified FeaturedContentNativeDashboard resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/instances/{instance}/contentHub/featuredContentNativeDashboards/{featured_content_native_dashboard}` + # + # @param project [String] + # @param location [String] + # @param instance [String] + # @param featured_content_native_dashboard [String] + # + # @return [::String] + def featured_content_native_dashboard_path project:, location:, instance:, featured_content_native_dashboard: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + + "projects/#{project}/locations/#{location}/instances/#{instance}/contentHub/featuredContentNativeDashboards/#{featured_content_native_dashboard}" + end + + ## + # Create a fully-qualified NativeDashboard resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/instances/{instance}/nativeDashboards/{dashboard}` + # + # @param project [String] + # @param location [String] + # @param instance [String] + # @param dashboard [String] + # + # @return [::String] + def native_dashboard_path project:, location:, instance:, dashboard: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + + "projects/#{project}/locations/#{location}/instances/#{instance}/nativeDashboards/#{dashboard}" + end + + extend self + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest.rb new file mode 100644 index 000000000000..f3fc177c90e7 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/chronicle/v1/version" + +require "google/cloud/chronicle/v1/featured_content_native_dashboard_service/credentials" +require "google/cloud/chronicle/v1/featured_content_native_dashboard_service/paths" +require "google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest/client" + +module Google + module Cloud + module Chronicle + module V1 + ## + # This service provides functionality for managing + # FeaturedContentNativeDashboard. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest" + # client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::Client.new + # + module FeaturedContentNativeDashboardService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest/helpers" if ::File.file? helper_path diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest/client.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest/client.rb new file mode 100644 index 000000000000..77ac512963a7 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest/client.rb @@ -0,0 +1,653 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/chronicle/v1/featured_content_native_dashboard_pb" +require "google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest/service_stub" + +module Google + module Cloud + module Chronicle + module V1 + module FeaturedContentNativeDashboardService + module Rest + ## + # REST client for the FeaturedContentNativeDashboardService service. + # + # This service provides functionality for managing + # FeaturedContentNativeDashboard. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "chronicle.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :featured_content_native_dashboard_service_stub + + ## + # Configure the FeaturedContentNativeDashboardService Client class. + # + # See {::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all FeaturedContentNativeDashboardService clients + # ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Chronicle", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.get_featured_content_native_dashboard.timeout = 60.0 + default_config.rpcs.get_featured_content_native_dashboard.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_featured_content_native_dashboards.timeout = 60.0 + default_config.rpcs.list_featured_content_native_dashboards.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the FeaturedContentNativeDashboardService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @featured_content_native_dashboard_service_stub.universe_domain + end + + ## + # Create a new FeaturedContentNativeDashboardService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the FeaturedContentNativeDashboardService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @featured_content_native_dashboard_service_stub = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @featured_content_native_dashboard_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @featured_content_native_dashboard_service_stub.logger + end + + # Service calls + + ## + # Get a native dashboard featured content. + # + # @overload get_featured_content_native_dashboard(request, options = nil) + # Pass arguments to `get_featured_content_native_dashboard` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::GetFeaturedContentNativeDashboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::GetFeaturedContentNativeDashboardRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_featured_content_native_dashboard(name: nil) + # Pass arguments to `get_featured_content_native_dashboard` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the FeaturedContentNativeDashboard to + # retrieve. Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/contentHub/featuredContentNativeDashboards/\\{featured_content_native_dashboard} + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::GetFeaturedContentNativeDashboardRequest.new + # + # # Call the get_featured_content_native_dashboard method. + # result = client.get_featured_content_native_dashboard request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard. + # p result + # + def get_featured_content_native_dashboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::GetFeaturedContentNativeDashboardRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_featured_content_native_dashboard.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_featured_content_native_dashboard.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_featured_content_native_dashboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featured_content_native_dashboard_service_stub.get_featured_content_native_dashboard request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List all native dashboards featured content. + # + # @overload list_featured_content_native_dashboards(request, options = nil) + # Pass arguments to `list_featured_content_native_dashboards` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_featured_content_native_dashboards(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_featured_content_native_dashboards` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent, which owns this collection of + # FeaturedContentNativeDashboards. Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/contentHub + # @param page_size [::Integer] + # Optional. The maximum number of FeaturedContentNativeDashboards to return. + # The service may return fewer than this value. If unspecified, at most 100 + # FeaturedContentNativeDashboards will be returned. The maximum value is 100; + # values above 100 will be coerced to 100. + # @param page_token [::String] + # Optional. A page token, received from a previous + # `ListFeaturedContentNativeDashboards` call. Provide this to retrieve the + # subsequent page. + # + # When paginating, all other parameters provided to + # `ListFeaturedContentNativeDashboards` must match the call that provided the + # page token. + # @param filter [::String] + # Optional. The filter to apply to list the FeaturedContentNativeDashboards. + # + # The filter syntax follows Google Cloud syntax: https://google.aip.dev/160. + # + # Supported fields for filtering: + # + # * `name`: The resource name of the featured content. + # * `content_metadata.description`: The description of the featured + # content. + # + # When a literal value is provided without a field, it will perform a + # substring search across both `name` and `content_metadata.description`. + # + # Examples: + # + # * `"test"`: Matches featured content where either the name or description + # contains "test" as a substring. + # * `name="test"`: Matches featured content where the name contains "test". + # * `content_metadata.description="test"`: Matches featured content where + # the description contains "test". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsRequest.new + # + # # Call the list_featured_content_native_dashboards method. + # result = client.list_featured_content_native_dashboards request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard. + # p item + # end + # + def list_featured_content_native_dashboards request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_featured_content_native_dashboards.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_featured_content_native_dashboards.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_featured_content_native_dashboards.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featured_content_native_dashboard_service_stub.list_featured_content_native_dashboards request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @featured_content_native_dashboard_service_stub, :list_featured_content_native_dashboards, "featured_content_native_dashboards", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Install a native dashboard featured content. + # + # @overload install_featured_content_native_dashboard(request, options = nil) + # Pass arguments to `install_featured_content_native_dashboard` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload install_featured_content_native_dashboard(name: nil, featured_content_native_dashboard: nil) + # Pass arguments to `install_featured_content_native_dashboard` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the FeaturedContentNativeDashboard to + # install. Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/contentHub/featuredContentNativeDashboards/\\{featured_content_native_dashboard} + # @param featured_content_native_dashboard [::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard, ::Hash] + # Optional. The FeaturedContentNativeDashboard to install. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardRequest.new + # + # # Call the install_featured_content_native_dashboard method. + # result = client.install_featured_content_native_dashboard request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardResponse. + # p result + # + def install_featured_content_native_dashboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.install_featured_content_native_dashboard.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.install_featured_content_native_dashboard.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.install_featured_content_native_dashboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featured_content_native_dashboard_service_stub.install_featured_content_native_dashboard request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the FeaturedContentNativeDashboardService REST API. + # + # This class represents the configuration for FeaturedContentNativeDashboardService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_featured_content_native_dashboard to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_featured_content_native_dashboard.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_featured_content_native_dashboard.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "chronicle.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the FeaturedContentNativeDashboardService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_featured_content_native_dashboard` + # @return [::Gapic::Config::Method] + # + attr_reader :get_featured_content_native_dashboard + ## + # RPC-specific configuration for `list_featured_content_native_dashboards` + # @return [::Gapic::Config::Method] + # + attr_reader :list_featured_content_native_dashboards + ## + # RPC-specific configuration for `install_featured_content_native_dashboard` + # @return [::Gapic::Config::Method] + # + attr_reader :install_featured_content_native_dashboard + + # @private + def initialize parent_rpcs = nil + get_featured_content_native_dashboard_config = parent_rpcs.get_featured_content_native_dashboard if parent_rpcs.respond_to? :get_featured_content_native_dashboard + @get_featured_content_native_dashboard = ::Gapic::Config::Method.new get_featured_content_native_dashboard_config + list_featured_content_native_dashboards_config = parent_rpcs.list_featured_content_native_dashboards if parent_rpcs.respond_to? :list_featured_content_native_dashboards + @list_featured_content_native_dashboards = ::Gapic::Config::Method.new list_featured_content_native_dashboards_config + install_featured_content_native_dashboard_config = parent_rpcs.install_featured_content_native_dashboard if parent_rpcs.respond_to? :install_featured_content_native_dashboard + @install_featured_content_native_dashboard = ::Gapic::Config::Method.new install_featured_content_native_dashboard_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest/service_stub.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest/service_stub.rb new file mode 100644 index 000000000000..87f450115dc7 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest/service_stub.rb @@ -0,0 +1,265 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/chronicle/v1/featured_content_native_dashboard_pb" + +module Google + module Cloud + module Chronicle + module V1 + module FeaturedContentNativeDashboardService + module Rest + ## + # REST service stub for the FeaturedContentNativeDashboardService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the get_featured_content_native_dashboard REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::GetFeaturedContentNativeDashboardRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard] + # A result object deserialized from the server's reply + def get_featured_content_native_dashboard request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_featured_content_native_dashboard_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_featured_content_native_dashboard", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_featured_content_native_dashboards REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsResponse] + # A result object deserialized from the server's reply + def list_featured_content_native_dashboards request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_featured_content_native_dashboards_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_featured_content_native_dashboards", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the install_featured_content_native_dashboard REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardResponse] + # A result object deserialized from the server's reply + def install_featured_content_native_dashboard request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_install_featured_content_native_dashboard_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "install_featured_content_native_dashboard", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the get_featured_content_native_dashboard REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::GetFeaturedContentNativeDashboardRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_featured_content_native_dashboard_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/contentHub/featuredContentNativeDashboards/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_featured_content_native_dashboards REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_featured_content_native_dashboards_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/featuredContentNativeDashboards", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/contentHub/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the install_featured_content_native_dashboard REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_install_featured_content_native_dashboard_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:install", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/contentHub/featuredContentNativeDashboards/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_services_pb.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_services_pb.rb new file mode 100644 index 000000000000..8f949b5ddb61 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/chronicle/v1/featured_content_native_dashboard.proto for package 'Google.Cloud.Chronicle.V1' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/chronicle/v1/featured_content_native_dashboard_pb' + +module Google + module Cloud + module Chronicle + module V1 + module FeaturedContentNativeDashboardService + # This service provides functionality for managing + # FeaturedContentNativeDashboard. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.chronicle.v1.FeaturedContentNativeDashboardService' + + # Get a native dashboard featured content. + rpc :GetFeaturedContentNativeDashboard, ::Google::Cloud::Chronicle::V1::GetFeaturedContentNativeDashboardRequest, ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard + # List all native dashboards featured content. + rpc :ListFeaturedContentNativeDashboards, ::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsRequest, ::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsResponse + # Install a native dashboard featured content. + rpc :InstallFeaturedContentNativeDashboard, ::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardRequest, ::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_pb.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_pb.rb new file mode 100644 index 000000000000..d5d773013043 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_pb.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/chronicle/v1/native_dashboard.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/chronicle/v1/dashboard_chart_pb' +require 'google/cloud/chronicle/v1/dashboard_query_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n0google/cloud/chronicle/v1/native_dashboard.proto\x12\x19google.cloud.chronicle.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a/google/cloud/chronicle/v1/dashboard_chart.proto\x1a/google/cloud/chronicle/v1/dashboard_query.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"u\n\x1d\x45xportNativeDashboardsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(chronicle.googleapis.com/NativeDashboard\x12\x12\n\x05names\x18\x02 \x03(\tB\x03\xe0\x41\x02\"{\n\x1e\x45xportNativeDashboardsResponse\x12J\n\x12inline_destination\x18\x01 \x01(\x0b\x32,.google.cloud.chronicle.v1.InlineDestinationH\x00\x42\r\n\x0b\x64\x65stination\"g\n\x11InlineDestination\x12R\n\ndashboards\x18\x01 \x03(\x0b\x32>.google.cloud.chronicle.v1.NativeDashboardWithChartsAndQueries\"\xfe\x01\n#NativeDashboardWithChartsAndQueries\x12\x42\n\tdashboard\x18\x01 \x01(\x0b\x32*.google.cloud.chronicle.v1.NativeDashboardB\x03\xe0\x41\x01\x12H\n\x10\x64\x61shboard_charts\x18\x02 \x03(\x0b\x32).google.cloud.chronicle.v1.DashboardChartB\x03\xe0\x41\x01\x12I\n\x11\x64\x61shboard_queries\x18\x03 \x03(\x0b\x32).google.cloud.chronicle.v1.DashboardQueryB\x03\xe0\x41\x01\"\xb5\x01\n\x1dImportNativeDashboardsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(chronicle.googleapis.com/NativeDashboard\x12R\n\x06source\x18\x02 \x01(\x0b\x32=.google.cloud.chronicle.v1.ImportNativeDashboardsInlineSourceB\x03\xe0\x41\x02\"}\n\"ImportNativeDashboardsInlineSource\x12W\n\ndashboards\x18\x01 \x03(\x0b\x32>.google.cloud.chronicle.v1.NativeDashboardWithChartsAndQueriesB\x03\xe0\x41\x02\"e\n\x1eImportNativeDashboardsResponse\x12\x43\n\x07results\x18\x01 \x03(\x0b\x32-.google.cloud.chronicle.v1.ImportExportStatusB\x03\xe0\x41\x03\"P\n\x12ImportExportStatus\x12\x11\n\tdashboard\x18\x01 \x01(\t\x12\'\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\"\x85\x06\n\x0fNativeDashboard\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(chronicle.googleapis.com/NativeDashboard\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12G\n\ndefinition\x18\x04 \x01(\x0b\x32..google.cloud.chronicle.v1.DashboardDefinitionB\x03\xe0\x41\x01\x12;\n\x04type\x18\x05 \x01(\x0e\x32(.google.cloud.chronicle.v1.DashboardTypeB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1b\n\x0e\x63reate_user_id\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0eupdate_user_id\x18\t \x01(\tB\x03\xe0\x41\x03\x12N\n\x13\x64\x61shboard_user_data\x18\n \x01(\x0b\x32,.google.cloud.chronicle.v1.DashboardUserDataB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x0b \x01(\tB\x03\xe0\x41\x01\x12?\n\x06\x61\x63\x63\x65ss\x18\x0c \x01(\x0e\x32*.google.cloud.chronicle.v1.DashboardAccessB\x03\xe0\x41\x03:\xac\x01\xea\x41\xa8\x01\n(chronicle.googleapis.com/NativeDashboard\x12Yprojects/{project}/locations/{location}/instances/{instance}/nativeDashboards/{dashboard}*\x10nativeDashboards2\x0fnativeDashboard\"\xab\x01\n\x1c\x43reateNativeDashboardRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(chronicle.googleapis.com/NativeDashboard\x12I\n\x10native_dashboard\x18\x02 \x01(\x0b\x32*.google.cloud.chronicle.v1.NativeDashboardB\x03\xe0\x41\x02\"\x9e\x01\n\x19GetNativeDashboardRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(chronicle.googleapis.com/NativeDashboard\x12\x41\n\x04view\x18\x02 \x01(\x0e\x32..google.cloud.chronicle.v1.NativeDashboardViewB\x03\xe0\x41\x01\"\xd3\x01\n\x1bListNativeDashboardsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(chronicle.googleapis.com/NativeDashboard\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x41\n\x04view\x18\x04 \x01(\x0e\x32..google.cloud.chronicle.v1.NativeDashboardViewB\x03\xe0\x41\x01\"~\n\x1cListNativeDashboardsResponse\x12\x45\n\x11native_dashboards\x18\x01 \x03(\x0b\x32*.google.cloud.chronicle.v1.NativeDashboard\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x9f\x01\n\x1cUpdateNativeDashboardRequest\x12I\n\x10native_dashboard\x18\x01 \x01(\x0b\x32*.google.cloud.chronicle.v1.NativeDashboardB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\xac\x01\n\x1f\x44uplicateNativeDashboardRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(chronicle.googleapis.com/NativeDashboard\x12I\n\x10native_dashboard\x18\x02 \x01(\x0b\x32*.google.cloud.chronicle.v1.NativeDashboardB\x03\xe0\x41\x02\"^\n\x1c\x44\x65leteNativeDashboardRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(chronicle.googleapis.com/NativeDashboard\"\xc6\x02\n\x0f\x41\x64\x64\x43hartRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(chronicle.googleapis.com/NativeDashboard\x12G\n\x0f\x64\x61shboard_query\x18\x02 \x01(\x0b\x32).google.cloud.chronicle.v1.DashboardQueryB\x03\xe0\x41\x01\x12G\n\x0f\x64\x61shboard_chart\x18\x03 \x01(\x0b\x32).google.cloud.chronicle.v1.DashboardChartB\x03\xe0\x41\x02\x12\x61\n\x0c\x63hart_layout\x18\x04 \x01(\x0b\x32\x46.google.cloud.chronicle.v1.DashboardDefinition.ChartConfig.ChartLayoutB\x03\xe0\x41\x02\"\x9c\x01\n\x10\x41\x64\x64\x43hartResponse\x12\x44\n\x10native_dashboard\x18\x01 \x01(\x0b\x32*.google.cloud.chronicle.v1.NativeDashboard\x12\x42\n\x0f\x64\x61shboard_chart\x18\x02 \x01(\x0b\x32).google.cloud.chronicle.v1.DashboardChart\"\xe4\x02\n\x10\x45\x64itChartRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(chronicle.googleapis.com/NativeDashboard\x12G\n\x0f\x64\x61shboard_query\x18\x02 \x01(\x0b\x32).google.cloud.chronicle.v1.DashboardQueryB\x03\xe0\x41\x01\x12G\n\x0f\x64\x61shboard_chart\x18\x03 \x01(\x0b\x32).google.cloud.chronicle.v1.DashboardChartB\x03\xe0\x41\x01\x12\x32\n\tedit_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12J\n\x11language_features\x18\x05 \x03(\x0e\x32*.google.cloud.chronicle.v1.LanguageFeatureB\x03\xe0\x41\x01\"\x9d\x01\n\x11\x45\x64itChartResponse\x12\x44\n\x10native_dashboard\x18\x01 \x01(\x0b\x32*.google.cloud.chronicle.v1.NativeDashboard\x12\x42\n\x0f\x64\x61shboard_chart\x18\x02 \x01(\x0b\x32).google.cloud.chronicle.v1.DashboardChart\"\x9e\x01\n\x12RemoveChartRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(chronicle.googleapis.com/NativeDashboard\x12H\n\x0f\x64\x61shboard_chart\x18\x02 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'chronicle.googleapis.com/DashboardChart\"\xa1\x01\n\x15\x44uplicateChartRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(chronicle.googleapis.com/NativeDashboard\x12H\n\x0f\x64\x61shboard_chart\x18\x02 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'chronicle.googleapis.com/DashboardChart\"\xa2\x01\n\x16\x44uplicateChartResponse\x12\x44\n\x10native_dashboard\x18\x01 \x01(\x0b\x32*.google.cloud.chronicle.v1.NativeDashboard\x12\x42\n\x0f\x64\x61shboard_chart\x18\x02 \x01(\x0b\x32).google.cloud.chronicle.v1.DashboardChart\"\\\n\x11\x44\x61shboardUserData\x12\x34\n\x10last_viewed_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x11\n\tis_pinned\x18\x02 \x01(\x08\"\xf3\x03\n\x13\x44\x61shboardDefinition\x12;\n\x07\x66ilters\x18\x01 \x03(\x0b\x32*.google.cloud.chronicle.v1.DashboardFilter\x12\x13\n\x0b\x66ingerprint\x18\x02 \x01(\t\x12J\n\x06\x63harts\x18\x04 \x03(\x0b\x32:.google.cloud.chronicle.v1.DashboardDefinition.ChartConfig\x1a\xbd\x02\n\x0b\x43hartConfig\x12H\n\x0f\x64\x61shboard_chart\x18\x01 \x01(\tB/\xe0\x41\x03\xfa\x41)\n\'chronicle.googleapis.com/DashboardChart\x12\\\n\x0c\x63hart_layout\x18\x02 \x01(\x0b\x32\x46.google.cloud.chronicle.v1.DashboardDefinition.ChartConfig.ChartLayout\x12\x13\n\x0b\x66ilters_ids\x18\x04 \x03(\t\x1aq\n\x0b\x43hartLayout\x12\x14\n\x07start_x\x18\t \x01(\x05H\x00\x88\x01\x01\x12\x0e\n\x06span_x\x18\n \x01(\x05\x12\x14\n\x07start_y\x18\x0b \x01(\x05H\x01\x88\x01\x01\x12\x0e\n\x06span_y\x18\x0c \x01(\x05\x42\n\n\x08_start_xB\n\n\x08_start_y*r\n\rDashboardType\x12\x1e\n\x1a\x44\x41SHBOARD_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43URATED\x10\x01\x12\x0b\n\x07PRIVATE\x10\x02\x12\n\n\x06PUBLIC\x10\x03\x12\n\n\x06\x43USTOM\x10\x04\x12\x0f\n\x0bMARKETPLACE\x10\x05*`\n\x0f\x44\x61shboardAccess\x12 \n\x1c\x44\x41SHBOARD_ACCESS_UNSPECIFIED\x10\x00\x12\x15\n\x11\x44\x41SHBOARD_PRIVATE\x10\x01\x12\x14\n\x10\x44\x41SHBOARD_PUBLIC\x10\x02*}\n\x13NativeDashboardView\x12%\n!NATIVE_DASHBOARD_VIEW_UNSPECIFIED\x10\x00\x12\x1f\n\x1bNATIVE_DASHBOARD_VIEW_BASIC\x10\x01\x12\x1e\n\x1aNATIVE_DASHBOARD_VIEW_FULL\x10\x02\x32\x86\x17\n\x16NativeDashboardService\x12\xf2\x01\n\x15\x43reateNativeDashboard\x12\x37.google.cloud.chronicle.v1.CreateNativeDashboardRequest\x1a*.google.cloud.chronicle.v1.NativeDashboard\"t\xda\x41\x17parent,native_dashboard\x82\xd3\xe4\x93\x02T\"@/v1/{parent=projects/*/locations/*/instances/*}/nativeDashboards:\x10native_dashboard\x12\xc7\x01\n\x12GetNativeDashboard\x12\x34.google.cloud.chronicle.v1.GetNativeDashboardRequest\x1a*.google.cloud.chronicle.v1.NativeDashboard\"O\xda\x41\x04name\x82\xd3\xe4\x93\x02\x42\x12@/v1/{name=projects/*/locations/*/instances/*/nativeDashboards/*}\x12\xda\x01\n\x14ListNativeDashboards\x12\x36.google.cloud.chronicle.v1.ListNativeDashboardsRequest\x1a\x37.google.cloud.chronicle.v1.ListNativeDashboardsResponse\"Q\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x42\x12@/v1/{parent=projects/*/locations/*/instances/*}/nativeDashboards\x12\x89\x02\n\x15UpdateNativeDashboard\x12\x37.google.cloud.chronicle.v1.UpdateNativeDashboardRequest\x1a*.google.cloud.chronicle.v1.NativeDashboard\"\x8a\x01\xda\x41\x1cnative_dashboard,update_mask\x82\xd3\xe4\x93\x02\x65\x32Q/v1/{native_dashboard.name=projects/*/locations/*/instances/*/nativeDashboards/*}:\x10native_dashboard\x12\xf2\x01\n\x18\x44uplicateNativeDashboard\x12:.google.cloud.chronicle.v1.DuplicateNativeDashboardRequest\x1a*.google.cloud.chronicle.v1.NativeDashboard\"n\xda\x41\x16name, native_dashboard\x82\xd3\xe4\x93\x02O\"J/v1/{name=projects/*/locations/*/instances/*/nativeDashboards/*}:duplicate:\x01*\x12\xb9\x01\n\x15\x44\x65leteNativeDashboard\x12\x37.google.cloud.chronicle.v1.DeleteNativeDashboardRequest\x1a\x16.google.protobuf.Empty\"O\xda\x41\x04name\x82\xd3\xe4\x93\x02\x42*@/v1/{name=projects/*/locations/*/instances/*/nativeDashboards/*}\x12\xe2\x01\n\x08\x41\x64\x64\x43hart\x12*.google.cloud.chronicle.v1.AddChartRequest\x1a+.google.cloud.chronicle.v1.AddChartResponse\"}\xda\x41&name, dashboard_query, dashboard_chart\x82\xd3\xe4\x93\x02N\"I/v1/{name=projects/*/locations/*/instances/*/nativeDashboards/*}:addChart:\x01*\x12\xc8\x01\n\x0bRemoveChart\x12-.google.cloud.chronicle.v1.RemoveChartRequest\x1a*.google.cloud.chronicle.v1.NativeDashboard\"^\xda\x41\x04name\x82\xd3\xe4\x93\x02Q\"L/v1/{name=projects/*/locations/*/instances/*/nativeDashboards/*}:removeChart:\x01*\x12\xf2\x01\n\tEditChart\x12+.google.cloud.chronicle.v1.EditChartRequest\x1a,.google.cloud.chronicle.v1.EditChartResponse\"\x89\x01\xda\x41\x31name, dashboard_query, dashboard_chart, edit_mask\x82\xd3\xe4\x93\x02O\"J/v1/{name=projects/*/locations/*/instances/*/nativeDashboards/*}:editChart:\x01*\x12\xd8\x01\n\x0e\x44uplicateChart\x12\x30.google.cloud.chronicle.v1.DuplicateChartRequest\x1a\x31.google.cloud.chronicle.v1.DuplicateChartResponse\"a\xda\x41\x04name\x82\xd3\xe4\x93\x02T\"O/v1/{name=projects/*/locations/*/instances/*/nativeDashboards/*}:duplicateChart:\x01*\x12\xf1\x01\n\x16\x45xportNativeDashboards\x12\x38.google.cloud.chronicle.v1.ExportNativeDashboardsRequest\x1a\x39.google.cloud.chronicle.v1.ExportNativeDashboardsResponse\"b\xda\x41\rparent, names\x82\xd3\xe4\x93\x02L\"G/v1/{parent=projects/*/locations/*/instances/*}/nativeDashboards:export:\x01*\x12\xf1\x01\n\x16ImportNativeDashboards\x12\x38.google.cloud.chronicle.v1.ImportNativeDashboardsRequest\x1a\x39.google.cloud.chronicle.v1.ImportNativeDashboardsResponse\"b\xda\x41\rparent,source\x82\xd3\xe4\x93\x02L\"G/v1/{parent=projects/*/locations/*/instances/*}/nativeDashboards:import:\x01*\x1a\xaa\x01\xca\x41\x18\x63hronicle.googleapis.com\xd2\x41\x8b\x01https://www.googleapis.com/auth/chronicle,https://www.googleapis.com/auth/chronicle.readonly,https://www.googleapis.com/auth/cloud-platformB\xcb\x01\n\x1d\x63om.google.cloud.chronicle.v1B\x14NativeDashboardProtoP\x01Z;cloud.google.com/go/chronicle/apiv1/chroniclepb;chroniclepb\xaa\x02\x19Google.Cloud.Chronicle.V1\xca\x02\x19Google\\Cloud\\Chronicle\\V1\xea\x02\x1cGoogle::Cloud::Chronicle::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Chronicle + module V1 + ExportNativeDashboardsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.ExportNativeDashboardsRequest").msgclass + ExportNativeDashboardsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.ExportNativeDashboardsResponse").msgclass + InlineDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.InlineDestination").msgclass + NativeDashboardWithChartsAndQueries = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.NativeDashboardWithChartsAndQueries").msgclass + ImportNativeDashboardsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.ImportNativeDashboardsRequest").msgclass + ImportNativeDashboardsInlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.ImportNativeDashboardsInlineSource").msgclass + ImportNativeDashboardsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.ImportNativeDashboardsResponse").msgclass + ImportExportStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.ImportExportStatus").msgclass + NativeDashboard = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.NativeDashboard").msgclass + CreateNativeDashboardRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.CreateNativeDashboardRequest").msgclass + GetNativeDashboardRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.GetNativeDashboardRequest").msgclass + ListNativeDashboardsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.ListNativeDashboardsRequest").msgclass + ListNativeDashboardsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.ListNativeDashboardsResponse").msgclass + UpdateNativeDashboardRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.UpdateNativeDashboardRequest").msgclass + DuplicateNativeDashboardRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DuplicateNativeDashboardRequest").msgclass + DeleteNativeDashboardRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DeleteNativeDashboardRequest").msgclass + AddChartRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.AddChartRequest").msgclass + AddChartResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.AddChartResponse").msgclass + EditChartRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.EditChartRequest").msgclass + EditChartResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.EditChartResponse").msgclass + RemoveChartRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.RemoveChartRequest").msgclass + DuplicateChartRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DuplicateChartRequest").msgclass + DuplicateChartResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DuplicateChartResponse").msgclass + DashboardUserData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardUserData").msgclass + DashboardDefinition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardDefinition").msgclass + DashboardDefinition::ChartConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardDefinition.ChartConfig").msgclass + DashboardDefinition::ChartConfig::ChartLayout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardDefinition.ChartConfig.ChartLayout").msgclass + DashboardType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardType").enummodule + DashboardAccess = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.DashboardAccess").enummodule + NativeDashboardView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.chronicle.v1.NativeDashboardView").enummodule + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_service.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_service.rb new file mode 100644 index 000000000000..f3a0d86312bc --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/chronicle/v1/version" + +require "google/cloud/chronicle/v1/native_dashboard_service/credentials" +require "google/cloud/chronicle/v1/native_dashboard_service/paths" +require "google/cloud/chronicle/v1/native_dashboard_service/client" +require "google/cloud/chronicle/v1/native_dashboard_service/rest" + +module Google + module Cloud + module Chronicle + module V1 + ## + # A service providing functionality for managing native dashboards. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/chronicle/v1/native_dashboard_service" + # client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/chronicle/v1/native_dashboard_service/rest" + # client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new + # + module NativeDashboardService + end + end + end + end +end + +helper_path = ::File.join __dir__, "native_dashboard_service", "helpers.rb" +require "google/cloud/chronicle/v1/native_dashboard_service/helpers" if ::File.file? helper_path diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_service/client.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_service/client.rb new file mode 100644 index 000000000000..4c00e3fd8a9d --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_service/client.rb @@ -0,0 +1,1611 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/chronicle/v1/native_dashboard_pb" + +module Google + module Cloud + module Chronicle + module V1 + module NativeDashboardService + ## + # Client for the NativeDashboardService service. + # + # A service providing functionality for managing native dashboards. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "chronicle.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :native_dashboard_service_stub + + ## + # Configure the NativeDashboardService Client class. + # + # See {::Google::Cloud::Chronicle::V1::NativeDashboardService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all NativeDashboardService clients + # ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Chronicle", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_native_dashboard.timeout = 60.0 + + default_config.rpcs.get_native_dashboard.timeout = 60.0 + default_config.rpcs.get_native_dashboard.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_native_dashboards.timeout = 60.0 + default_config.rpcs.list_native_dashboards.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_native_dashboard.timeout = 60.0 + + default_config.rpcs.duplicate_native_dashboard.timeout = 60.0 + + default_config.rpcs.delete_native_dashboard.timeout = 60.0 + + default_config.rpcs.add_chart.timeout = 60.0 + + default_config.rpcs.remove_chart.timeout = 60.0 + + default_config.rpcs.edit_chart.timeout = 60.0 + + default_config.rpcs.duplicate_chart.timeout = 60.0 + + default_config.rpcs.export_native_dashboards.timeout = 60.0 + default_config.rpcs.export_native_dashboards.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.import_native_dashboards.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the NativeDashboardService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Chronicle::V1::NativeDashboardService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @native_dashboard_service_stub.universe_domain + end + + ## + # Create a new NativeDashboardService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the NativeDashboardService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/chronicle/v1/native_dashboard_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @native_dashboard_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Chronicle::V1::NativeDashboardService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @native_dashboard_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @native_dashboard_service_stub.logger + end + + # Service calls + + ## + # Create a dashboard. + # + # @overload create_native_dashboard(request, options = nil) + # Pass arguments to `create_native_dashboard` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::CreateNativeDashboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::CreateNativeDashboardRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_native_dashboard(parent: nil, native_dashboard: nil) + # Pass arguments to `create_native_dashboard` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this dashboard will be created. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @param native_dashboard [::Google::Cloud::Chronicle::V1::NativeDashboard, ::Hash] + # Required. The dashboard to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Chronicle::V1::NativeDashboard] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::CreateNativeDashboardRequest.new + # + # # Call the create_native_dashboard method. + # result = client.create_native_dashboard request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::NativeDashboard. + # p result + # + def create_native_dashboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::CreateNativeDashboardRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_native_dashboard.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_native_dashboard.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_native_dashboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.call_rpc :create_native_dashboard, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get a dashboard. + # + # @overload get_native_dashboard(request, options = nil) + # Pass arguments to `get_native_dashboard` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::GetNativeDashboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::GetNativeDashboardRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_native_dashboard(name: nil, view: nil) + # Pass arguments to `get_native_dashboard` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The dashboard name to fetch. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @param view [::Google::Cloud::Chronicle::V1::NativeDashboardView] + # Optional. View indicates the scope of fields to populate when returning the + # dashboard resource. If unspecified, defaults to the basic view. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Chronicle::V1::NativeDashboard] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::GetNativeDashboardRequest.new + # + # # Call the get_native_dashboard method. + # result = client.get_native_dashboard request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::NativeDashboard. + # p result + # + def get_native_dashboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::GetNativeDashboardRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_native_dashboard.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_native_dashboard.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_native_dashboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.call_rpc :get_native_dashboard, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List all dashboards. + # + # @overload list_native_dashboards(request, options = nil) + # Pass arguments to `list_native_dashboards` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::ListNativeDashboardsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::ListNativeDashboardsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_native_dashboards(parent: nil, page_size: nil, page_token: nil, view: nil) + # Pass arguments to `list_native_dashboards` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent owning this dashboard collection. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @param page_size [::Integer] + # Optional. The maximum number of dashboards to return. The service may + # return fewer than this value. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListDashboards` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListDashboards` must + # match the call that provided the page token. + # @param view [::Google::Cloud::Chronicle::V1::NativeDashboardView] + # Optional. View indicates the scope of fields to populate when returning the + # dashboard resource. If unspecified, defaults to the basic view. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Chronicle::V1::NativeDashboard>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Chronicle::V1::NativeDashboard>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::ListNativeDashboardsRequest.new + # + # # Call the list_native_dashboards method. + # result = client.list_native_dashboards request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Chronicle::V1::NativeDashboard. + # p item + # end + # + def list_native_dashboards request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ListNativeDashboardsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_native_dashboards.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_native_dashboards.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_native_dashboards.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.call_rpc :list_native_dashboards, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @native_dashboard_service_stub, :list_native_dashboards, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a dashboard. + # + # @overload update_native_dashboard(request, options = nil) + # Pass arguments to `update_native_dashboard` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::UpdateNativeDashboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::UpdateNativeDashboardRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_native_dashboard(native_dashboard: nil, update_mask: nil) + # Pass arguments to `update_native_dashboard` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param native_dashboard [::Google::Cloud::Chronicle::V1::NativeDashboard, ::Hash] + # Required. The dashboard to update. + # + # The dashboard's `name` field is used to identify the dashboard to update. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. LINT.IfChange(update_mask_values) + # The list of fields to update. + # Supported paths are - + # display_name + # description + # definition.filters + # definition.charts + # type + # access + # dashboard_user_data.is_pinned + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Chronicle::V1::NativeDashboard] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::UpdateNativeDashboardRequest.new + # + # # Call the update_native_dashboard method. + # result = client.update_native_dashboard request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::NativeDashboard. + # p result + # + def update_native_dashboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::UpdateNativeDashboardRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_native_dashboard.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.native_dashboard&.name + header_params["native_dashboard.name"] = request.native_dashboard.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_native_dashboard.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_native_dashboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.call_rpc :update_native_dashboard, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Duplicate a dashboard. + # + # @overload duplicate_native_dashboard(request, options = nil) + # Pass arguments to `duplicate_native_dashboard` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::DuplicateNativeDashboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::DuplicateNativeDashboardRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload duplicate_native_dashboard(name: nil, native_dashboard: nil) + # Pass arguments to `duplicate_native_dashboard` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The dashboard name to duplicate. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @param native_dashboard [::Google::Cloud::Chronicle::V1::NativeDashboard, ::Hash] + # Required. Any fields that need modification can be passed through this like + # name, description etc. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Chronicle::V1::NativeDashboard] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::DuplicateNativeDashboardRequest.new + # + # # Call the duplicate_native_dashboard method. + # result = client.duplicate_native_dashboard request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::NativeDashboard. + # p result + # + def duplicate_native_dashboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::DuplicateNativeDashboardRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.duplicate_native_dashboard.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.duplicate_native_dashboard.timeout, + metadata: metadata, + retry_policy: @config.rpcs.duplicate_native_dashboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.call_rpc :duplicate_native_dashboard, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Delete a dashboard. + # + # @overload delete_native_dashboard(request, options = nil) + # Pass arguments to `delete_native_dashboard` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::DeleteNativeDashboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::DeleteNativeDashboardRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_native_dashboard(name: nil) + # Pass arguments to `delete_native_dashboard` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The dashboard name to delete. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::DeleteNativeDashboardRequest.new + # + # # Call the delete_native_dashboard method. + # result = client.delete_native_dashboard request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_native_dashboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::DeleteNativeDashboardRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_native_dashboard.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_native_dashboard.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_native_dashboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.call_rpc :delete_native_dashboard, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Add chart in a dashboard. + # + # @overload add_chart(request, options = nil) + # Pass arguments to `add_chart` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::AddChartRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::AddChartRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload add_chart(name: nil, dashboard_query: nil, dashboard_chart: nil, chart_layout: nil) + # Pass arguments to `add_chart` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The dashboard name to add chart in. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @param dashboard_query [::Google::Cloud::Chronicle::V1::DashboardQuery, ::Hash] + # Optional. Query used to create the chart. + # @param dashboard_chart [::Google::Cloud::Chronicle::V1::DashboardChart, ::Hash] + # Required. Chart to be added to the dashboard. + # @param chart_layout [::Google::Cloud::Chronicle::V1::DashboardDefinition::ChartConfig::ChartLayout, ::Hash] + # Required. ChartLayout for newly added chart. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Chronicle::V1::AddChartResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Chronicle::V1::AddChartResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::AddChartRequest.new + # + # # Call the add_chart method. + # result = client.add_chart request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::AddChartResponse. + # p result + # + def add_chart request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::AddChartRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.add_chart.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.add_chart.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_chart.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.call_rpc :add_chart, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Remove chart from a dashboard. + # + # @overload remove_chart(request, options = nil) + # Pass arguments to `remove_chart` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::RemoveChartRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::RemoveChartRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload remove_chart(name: nil, dashboard_chart: nil) + # Pass arguments to `remove_chart` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The dashboard name to remove chart from. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @param dashboard_chart [::String] + # Required. The dashboard chart name to remove. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Chronicle::V1::NativeDashboard] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::RemoveChartRequest.new + # + # # Call the remove_chart method. + # result = client.remove_chart request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::NativeDashboard. + # p result + # + def remove_chart request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::RemoveChartRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.remove_chart.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.remove_chart.timeout, + metadata: metadata, + retry_policy: @config.rpcs.remove_chart.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.call_rpc :remove_chart, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Edit chart in a dashboard. + # + # @overload edit_chart(request, options = nil) + # Pass arguments to `edit_chart` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::EditChartRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::EditChartRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload edit_chart(name: nil, dashboard_query: nil, dashboard_chart: nil, edit_mask: nil, language_features: nil) + # Pass arguments to `edit_chart` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The dashboard name to edit chart in. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @param dashboard_query [::Google::Cloud::Chronicle::V1::DashboardQuery, ::Hash] + # Optional. Query for the edited chart. + # @param dashboard_chart [::Google::Cloud::Chronicle::V1::DashboardChart, ::Hash] + # Optional. Edited chart. + # @param edit_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The list of fields to edit for chart and query. + # Supported paths in chart are - + # dashboard_chart.display_name + # dashboard_chart.description + # dashboard_chart.chart_datasource.data_sources + # dashboard_chart.visualization + # dashboard_chart.visualization.button + # dashboard_chart.visualization.markdown + # dashboard_chart.drill_down_config + # Supported paths in query are - + # dashboard_query.query + # dashboard_query.input + # @param language_features [::Array<::Google::Cloud::Chronicle::V1::LanguageFeature>] + # Optional. Language Features present in the query. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Chronicle::V1::EditChartResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Chronicle::V1::EditChartResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::EditChartRequest.new + # + # # Call the edit_chart method. + # result = client.edit_chart request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::EditChartResponse. + # p result + # + def edit_chart request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::EditChartRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.edit_chart.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.edit_chart.timeout, + metadata: metadata, + retry_policy: @config.rpcs.edit_chart.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.call_rpc :edit_chart, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Duplicate chart in a dashboard. + # + # @overload duplicate_chart(request, options = nil) + # Pass arguments to `duplicate_chart` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::DuplicateChartRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::DuplicateChartRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload duplicate_chart(name: nil, dashboard_chart: nil) + # Pass arguments to `duplicate_chart` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The dashboard name that involves chart duplication. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @param dashboard_chart [::String] + # Required. The dashboard chart name to duplicate. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Chronicle::V1::DuplicateChartResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Chronicle::V1::DuplicateChartResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::DuplicateChartRequest.new + # + # # Call the duplicate_chart method. + # result = client.duplicate_chart request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::DuplicateChartResponse. + # p result + # + def duplicate_chart request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::DuplicateChartRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.duplicate_chart.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.duplicate_chart.timeout, + metadata: metadata, + retry_policy: @config.rpcs.duplicate_chart.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.call_rpc :duplicate_chart, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Exports the dashboards. + # + # @overload export_native_dashboards(request, options = nil) + # Pass arguments to `export_native_dashboards` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::ExportNativeDashboardsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::ExportNativeDashboardsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload export_native_dashboards(parent: nil, names: nil) + # Pass arguments to `export_native_dashboards` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource that the dashboards to be exported belong to. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @param names [::Array<::String>] + # Required. The resource names of the dashboards to export. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Chronicle::V1::ExportNativeDashboardsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Chronicle::V1::ExportNativeDashboardsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::ExportNativeDashboardsRequest.new + # + # # Call the export_native_dashboards method. + # result = client.export_native_dashboards request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::ExportNativeDashboardsResponse. + # p result + # + def export_native_dashboards request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ExportNativeDashboardsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.export_native_dashboards.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.export_native_dashboards.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_native_dashboards.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.call_rpc :export_native_dashboards, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Imports the dashboards. + # + # @overload import_native_dashboards(request, options = nil) + # Pass arguments to `import_native_dashboards` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::ImportNativeDashboardsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::ImportNativeDashboardsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload import_native_dashboards(parent: nil, source: nil) + # Pass arguments to `import_native_dashboards` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this dashboard will be created. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @param source [::Google::Cloud::Chronicle::V1::ImportNativeDashboardsInlineSource, ::Hash] + # Required. The data will imported from this proto. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Chronicle::V1::ImportNativeDashboardsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Chronicle::V1::ImportNativeDashboardsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::ImportNativeDashboardsRequest.new + # + # # Call the import_native_dashboards method. + # result = client.import_native_dashboards request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::ImportNativeDashboardsResponse. + # p result + # + def import_native_dashboards request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ImportNativeDashboardsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.import_native_dashboards.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.import_native_dashboards.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_native_dashboards.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.call_rpc :import_native_dashboards, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the NativeDashboardService API. + # + # This class represents the configuration for NativeDashboardService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Chronicle::V1::NativeDashboardService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_native_dashboard to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_native_dashboard.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_native_dashboard.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "chronicle.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the NativeDashboardService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_native_dashboard` + # @return [::Gapic::Config::Method] + # + attr_reader :create_native_dashboard + ## + # RPC-specific configuration for `get_native_dashboard` + # @return [::Gapic::Config::Method] + # + attr_reader :get_native_dashboard + ## + # RPC-specific configuration for `list_native_dashboards` + # @return [::Gapic::Config::Method] + # + attr_reader :list_native_dashboards + ## + # RPC-specific configuration for `update_native_dashboard` + # @return [::Gapic::Config::Method] + # + attr_reader :update_native_dashboard + ## + # RPC-specific configuration for `duplicate_native_dashboard` + # @return [::Gapic::Config::Method] + # + attr_reader :duplicate_native_dashboard + ## + # RPC-specific configuration for `delete_native_dashboard` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_native_dashboard + ## + # RPC-specific configuration for `add_chart` + # @return [::Gapic::Config::Method] + # + attr_reader :add_chart + ## + # RPC-specific configuration for `remove_chart` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_chart + ## + # RPC-specific configuration for `edit_chart` + # @return [::Gapic::Config::Method] + # + attr_reader :edit_chart + ## + # RPC-specific configuration for `duplicate_chart` + # @return [::Gapic::Config::Method] + # + attr_reader :duplicate_chart + ## + # RPC-specific configuration for `export_native_dashboards` + # @return [::Gapic::Config::Method] + # + attr_reader :export_native_dashboards + ## + # RPC-specific configuration for `import_native_dashboards` + # @return [::Gapic::Config::Method] + # + attr_reader :import_native_dashboards + + # @private + def initialize parent_rpcs = nil + create_native_dashboard_config = parent_rpcs.create_native_dashboard if parent_rpcs.respond_to? :create_native_dashboard + @create_native_dashboard = ::Gapic::Config::Method.new create_native_dashboard_config + get_native_dashboard_config = parent_rpcs.get_native_dashboard if parent_rpcs.respond_to? :get_native_dashboard + @get_native_dashboard = ::Gapic::Config::Method.new get_native_dashboard_config + list_native_dashboards_config = parent_rpcs.list_native_dashboards if parent_rpcs.respond_to? :list_native_dashboards + @list_native_dashboards = ::Gapic::Config::Method.new list_native_dashboards_config + update_native_dashboard_config = parent_rpcs.update_native_dashboard if parent_rpcs.respond_to? :update_native_dashboard + @update_native_dashboard = ::Gapic::Config::Method.new update_native_dashboard_config + duplicate_native_dashboard_config = parent_rpcs.duplicate_native_dashboard if parent_rpcs.respond_to? :duplicate_native_dashboard + @duplicate_native_dashboard = ::Gapic::Config::Method.new duplicate_native_dashboard_config + delete_native_dashboard_config = parent_rpcs.delete_native_dashboard if parent_rpcs.respond_to? :delete_native_dashboard + @delete_native_dashboard = ::Gapic::Config::Method.new delete_native_dashboard_config + add_chart_config = parent_rpcs.add_chart if parent_rpcs.respond_to? :add_chart + @add_chart = ::Gapic::Config::Method.new add_chart_config + remove_chart_config = parent_rpcs.remove_chart if parent_rpcs.respond_to? :remove_chart + @remove_chart = ::Gapic::Config::Method.new remove_chart_config + edit_chart_config = parent_rpcs.edit_chart if parent_rpcs.respond_to? :edit_chart + @edit_chart = ::Gapic::Config::Method.new edit_chart_config + duplicate_chart_config = parent_rpcs.duplicate_chart if parent_rpcs.respond_to? :duplicate_chart + @duplicate_chart = ::Gapic::Config::Method.new duplicate_chart_config + export_native_dashboards_config = parent_rpcs.export_native_dashboards if parent_rpcs.respond_to? :export_native_dashboards + @export_native_dashboards = ::Gapic::Config::Method.new export_native_dashboards_config + import_native_dashboards_config = parent_rpcs.import_native_dashboards if parent_rpcs.respond_to? :import_native_dashboards + @import_native_dashboards = ::Gapic::Config::Method.new import_native_dashboards_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_service/credentials.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_service/credentials.rb new file mode 100644 index 000000000000..ac3f7512afa5 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_service/credentials.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Chronicle + module V1 + module NativeDashboardService + # Credentials for the NativeDashboardService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/chronicle", + "https://www.googleapis.com/auth/chronicle.readonly", + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_service/paths.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_service/paths.rb new file mode 100644 index 000000000000..0b8f9b39f7ea --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_service/paths.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Chronicle + module V1 + module NativeDashboardService + # Path helper methods for the NativeDashboardService API. + module Paths + ## + # Create a fully-qualified DashboardChart resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/instances/{instance}/dashboardCharts/{chart}` + # + # @param project [String] + # @param location [String] + # @param instance [String] + # @param chart [String] + # + # @return [::String] + def dashboard_chart_path project:, location:, instance:, chart: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + + "projects/#{project}/locations/#{location}/instances/#{instance}/dashboardCharts/#{chart}" + end + + ## + # Create a fully-qualified DashboardQuery resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/instances/{instance}/dashboardQueries/{query}` + # + # @param project [String] + # @param location [String] + # @param instance [String] + # @param query [String] + # + # @return [::String] + def dashboard_query_path project:, location:, instance:, query: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + + "projects/#{project}/locations/#{location}/instances/#{instance}/dashboardQueries/#{query}" + end + + ## + # Create a fully-qualified Instance resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/instances/{instance}` + # + # @param project [String] + # @param location [String] + # @param instance [String] + # + # @return [::String] + def instance_path project:, location:, instance: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/instances/#{instance}" + end + + ## + # Create a fully-qualified NativeDashboard resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/instances/{instance}/nativeDashboards/{dashboard}` + # + # @param project [String] + # @param location [String] + # @param instance [String] + # @param dashboard [String] + # + # @return [::String] + def native_dashboard_path project:, location:, instance:, dashboard: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + + "projects/#{project}/locations/#{location}/instances/#{instance}/nativeDashboards/#{dashboard}" + end + + extend self + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_service/rest.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_service/rest.rb new file mode 100644 index 000000000000..2a050c29ca53 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_service/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/chronicle/v1/version" + +require "google/cloud/chronicle/v1/native_dashboard_service/credentials" +require "google/cloud/chronicle/v1/native_dashboard_service/paths" +require "google/cloud/chronicle/v1/native_dashboard_service/rest/client" + +module Google + module Cloud + module Chronicle + module V1 + ## + # A service providing functionality for managing native dashboards. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/chronicle/v1/native_dashboard_service/rest" + # client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new + # + module NativeDashboardService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/chronicle/v1/native_dashboard_service/rest/helpers" if ::File.file? helper_path diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_service/rest/client.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_service/rest/client.rb new file mode 100644 index 000000000000..0445e075d588 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_service/rest/client.rb @@ -0,0 +1,1484 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/chronicle/v1/native_dashboard_pb" +require "google/cloud/chronicle/v1/native_dashboard_service/rest/service_stub" + +module Google + module Cloud + module Chronicle + module V1 + module NativeDashboardService + module Rest + ## + # REST client for the NativeDashboardService service. + # + # A service providing functionality for managing native dashboards. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "chronicle.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :native_dashboard_service_stub + + ## + # Configure the NativeDashboardService Client class. + # + # See {::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all NativeDashboardService clients + # ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Chronicle", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_native_dashboard.timeout = 60.0 + + default_config.rpcs.get_native_dashboard.timeout = 60.0 + default_config.rpcs.get_native_dashboard.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_native_dashboards.timeout = 60.0 + default_config.rpcs.list_native_dashboards.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_native_dashboard.timeout = 60.0 + + default_config.rpcs.duplicate_native_dashboard.timeout = 60.0 + + default_config.rpcs.delete_native_dashboard.timeout = 60.0 + + default_config.rpcs.add_chart.timeout = 60.0 + + default_config.rpcs.remove_chart.timeout = 60.0 + + default_config.rpcs.edit_chart.timeout = 60.0 + + default_config.rpcs.duplicate_chart.timeout = 60.0 + + default_config.rpcs.export_native_dashboards.timeout = 60.0 + default_config.rpcs.export_native_dashboards.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.import_native_dashboards.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the NativeDashboardService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @native_dashboard_service_stub.universe_domain + end + + ## + # Create a new NativeDashboardService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the NativeDashboardService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @native_dashboard_service_stub = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @native_dashboard_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @native_dashboard_service_stub.logger + end + + # Service calls + + ## + # Create a dashboard. + # + # @overload create_native_dashboard(request, options = nil) + # Pass arguments to `create_native_dashboard` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::CreateNativeDashboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::CreateNativeDashboardRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_native_dashboard(parent: nil, native_dashboard: nil) + # Pass arguments to `create_native_dashboard` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this dashboard will be created. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @param native_dashboard [::Google::Cloud::Chronicle::V1::NativeDashboard, ::Hash] + # Required. The dashboard to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::NativeDashboard] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::CreateNativeDashboardRequest.new + # + # # Call the create_native_dashboard method. + # result = client.create_native_dashboard request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::NativeDashboard. + # p result + # + def create_native_dashboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::CreateNativeDashboardRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_native_dashboard.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_native_dashboard.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_native_dashboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.create_native_dashboard request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get a dashboard. + # + # @overload get_native_dashboard(request, options = nil) + # Pass arguments to `get_native_dashboard` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::GetNativeDashboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::GetNativeDashboardRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_native_dashboard(name: nil, view: nil) + # Pass arguments to `get_native_dashboard` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The dashboard name to fetch. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @param view [::Google::Cloud::Chronicle::V1::NativeDashboardView] + # Optional. View indicates the scope of fields to populate when returning the + # dashboard resource. If unspecified, defaults to the basic view. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::NativeDashboard] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::GetNativeDashboardRequest.new + # + # # Call the get_native_dashboard method. + # result = client.get_native_dashboard request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::NativeDashboard. + # p result + # + def get_native_dashboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::GetNativeDashboardRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_native_dashboard.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_native_dashboard.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_native_dashboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.get_native_dashboard request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List all dashboards. + # + # @overload list_native_dashboards(request, options = nil) + # Pass arguments to `list_native_dashboards` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::ListNativeDashboardsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::ListNativeDashboardsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_native_dashboards(parent: nil, page_size: nil, page_token: nil, view: nil) + # Pass arguments to `list_native_dashboards` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent owning this dashboard collection. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @param page_size [::Integer] + # Optional. The maximum number of dashboards to return. The service may + # return fewer than this value. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListDashboards` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListDashboards` must + # match the call that provided the page token. + # @param view [::Google::Cloud::Chronicle::V1::NativeDashboardView] + # Optional. View indicates the scope of fields to populate when returning the + # dashboard resource. If unspecified, defaults to the basic view. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::NativeDashboard>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::NativeDashboard>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::ListNativeDashboardsRequest.new + # + # # Call the list_native_dashboards method. + # result = client.list_native_dashboards request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Chronicle::V1::NativeDashboard. + # p item + # end + # + def list_native_dashboards request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ListNativeDashboardsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_native_dashboards.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_native_dashboards.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_native_dashboards.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.list_native_dashboards request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @native_dashboard_service_stub, :list_native_dashboards, "native_dashboards", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a dashboard. + # + # @overload update_native_dashboard(request, options = nil) + # Pass arguments to `update_native_dashboard` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::UpdateNativeDashboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::UpdateNativeDashboardRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_native_dashboard(native_dashboard: nil, update_mask: nil) + # Pass arguments to `update_native_dashboard` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param native_dashboard [::Google::Cloud::Chronicle::V1::NativeDashboard, ::Hash] + # Required. The dashboard to update. + # + # The dashboard's `name` field is used to identify the dashboard to update. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. LINT.IfChange(update_mask_values) + # The list of fields to update. + # Supported paths are - + # display_name + # description + # definition.filters + # definition.charts + # type + # access + # dashboard_user_data.is_pinned + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::NativeDashboard] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::UpdateNativeDashboardRequest.new + # + # # Call the update_native_dashboard method. + # result = client.update_native_dashboard request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::NativeDashboard. + # p result + # + def update_native_dashboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::UpdateNativeDashboardRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_native_dashboard.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_native_dashboard.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_native_dashboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.update_native_dashboard request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Duplicate a dashboard. + # + # @overload duplicate_native_dashboard(request, options = nil) + # Pass arguments to `duplicate_native_dashboard` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::DuplicateNativeDashboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::DuplicateNativeDashboardRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload duplicate_native_dashboard(name: nil, native_dashboard: nil) + # Pass arguments to `duplicate_native_dashboard` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The dashboard name to duplicate. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @param native_dashboard [::Google::Cloud::Chronicle::V1::NativeDashboard, ::Hash] + # Required. Any fields that need modification can be passed through this like + # name, description etc. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::NativeDashboard] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::DuplicateNativeDashboardRequest.new + # + # # Call the duplicate_native_dashboard method. + # result = client.duplicate_native_dashboard request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::NativeDashboard. + # p result + # + def duplicate_native_dashboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::DuplicateNativeDashboardRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.duplicate_native_dashboard.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.duplicate_native_dashboard.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.duplicate_native_dashboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.duplicate_native_dashboard request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Delete a dashboard. + # + # @overload delete_native_dashboard(request, options = nil) + # Pass arguments to `delete_native_dashboard` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::DeleteNativeDashboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::DeleteNativeDashboardRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_native_dashboard(name: nil) + # Pass arguments to `delete_native_dashboard` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The dashboard name to delete. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::DeleteNativeDashboardRequest.new + # + # # Call the delete_native_dashboard method. + # result = client.delete_native_dashboard request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_native_dashboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::DeleteNativeDashboardRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_native_dashboard.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_native_dashboard.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_native_dashboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.delete_native_dashboard request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Add chart in a dashboard. + # + # @overload add_chart(request, options = nil) + # Pass arguments to `add_chart` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::AddChartRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::AddChartRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload add_chart(name: nil, dashboard_query: nil, dashboard_chart: nil, chart_layout: nil) + # Pass arguments to `add_chart` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The dashboard name to add chart in. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @param dashboard_query [::Google::Cloud::Chronicle::V1::DashboardQuery, ::Hash] + # Optional. Query used to create the chart. + # @param dashboard_chart [::Google::Cloud::Chronicle::V1::DashboardChart, ::Hash] + # Required. Chart to be added to the dashboard. + # @param chart_layout [::Google::Cloud::Chronicle::V1::DashboardDefinition::ChartConfig::ChartLayout, ::Hash] + # Required. ChartLayout for newly added chart. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::AddChartResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::AddChartResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::AddChartRequest.new + # + # # Call the add_chart method. + # result = client.add_chart request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::AddChartResponse. + # p result + # + def add_chart request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::AddChartRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.add_chart.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.add_chart.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_chart.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.add_chart request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Remove chart from a dashboard. + # + # @overload remove_chart(request, options = nil) + # Pass arguments to `remove_chart` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::RemoveChartRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::RemoveChartRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload remove_chart(name: nil, dashboard_chart: nil) + # Pass arguments to `remove_chart` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The dashboard name to remove chart from. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @param dashboard_chart [::String] + # Required. The dashboard chart name to remove. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::NativeDashboard] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::RemoveChartRequest.new + # + # # Call the remove_chart method. + # result = client.remove_chart request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::NativeDashboard. + # p result + # + def remove_chart request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::RemoveChartRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.remove_chart.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.remove_chart.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.remove_chart.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.remove_chart request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Edit chart in a dashboard. + # + # @overload edit_chart(request, options = nil) + # Pass arguments to `edit_chart` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::EditChartRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::EditChartRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload edit_chart(name: nil, dashboard_query: nil, dashboard_chart: nil, edit_mask: nil, language_features: nil) + # Pass arguments to `edit_chart` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The dashboard name to edit chart in. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @param dashboard_query [::Google::Cloud::Chronicle::V1::DashboardQuery, ::Hash] + # Optional. Query for the edited chart. + # @param dashboard_chart [::Google::Cloud::Chronicle::V1::DashboardChart, ::Hash] + # Optional. Edited chart. + # @param edit_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The list of fields to edit for chart and query. + # Supported paths in chart are - + # dashboard_chart.display_name + # dashboard_chart.description + # dashboard_chart.chart_datasource.data_sources + # dashboard_chart.visualization + # dashboard_chart.visualization.button + # dashboard_chart.visualization.markdown + # dashboard_chart.drill_down_config + # Supported paths in query are - + # dashboard_query.query + # dashboard_query.input + # @param language_features [::Array<::Google::Cloud::Chronicle::V1::LanguageFeature>] + # Optional. Language Features present in the query. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::EditChartResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::EditChartResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::EditChartRequest.new + # + # # Call the edit_chart method. + # result = client.edit_chart request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::EditChartResponse. + # p result + # + def edit_chart request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::EditChartRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.edit_chart.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.edit_chart.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.edit_chart.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.edit_chart request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Duplicate chart in a dashboard. + # + # @overload duplicate_chart(request, options = nil) + # Pass arguments to `duplicate_chart` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::DuplicateChartRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::DuplicateChartRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload duplicate_chart(name: nil, dashboard_chart: nil) + # Pass arguments to `duplicate_chart` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The dashboard name that involves chart duplication. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @param dashboard_chart [::String] + # Required. The dashboard chart name to duplicate. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::DuplicateChartResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::DuplicateChartResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::DuplicateChartRequest.new + # + # # Call the duplicate_chart method. + # result = client.duplicate_chart request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::DuplicateChartResponse. + # p result + # + def duplicate_chart request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::DuplicateChartRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.duplicate_chart.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.duplicate_chart.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.duplicate_chart.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.duplicate_chart request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Exports the dashboards. + # + # @overload export_native_dashboards(request, options = nil) + # Pass arguments to `export_native_dashboards` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::ExportNativeDashboardsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::ExportNativeDashboardsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload export_native_dashboards(parent: nil, names: nil) + # Pass arguments to `export_native_dashboards` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource that the dashboards to be exported belong to. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @param names [::Array<::String>] + # Required. The resource names of the dashboards to export. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::ExportNativeDashboardsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::ExportNativeDashboardsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::ExportNativeDashboardsRequest.new + # + # # Call the export_native_dashboards method. + # result = client.export_native_dashboards request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::ExportNativeDashboardsResponse. + # p result + # + def export_native_dashboards request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ExportNativeDashboardsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.export_native_dashboards.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.export_native_dashboards.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_native_dashboards.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.export_native_dashboards request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Imports the dashboards. + # + # @overload import_native_dashboards(request, options = nil) + # Pass arguments to `import_native_dashboards` via a request object, either of type + # {::Google::Cloud::Chronicle::V1::ImportNativeDashboardsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Chronicle::V1::ImportNativeDashboardsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload import_native_dashboards(parent: nil, source: nil) + # Pass arguments to `import_native_dashboards` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this dashboard will be created. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @param source [::Google::Cloud::Chronicle::V1::ImportNativeDashboardsInlineSource, ::Hash] + # Required. The data will imported from this proto. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::ImportNativeDashboardsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::ImportNativeDashboardsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/chronicle/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Chronicle::V1::ImportNativeDashboardsRequest.new + # + # # Call the import_native_dashboards method. + # result = client.import_native_dashboards request + # + # # The returned object is of type Google::Cloud::Chronicle::V1::ImportNativeDashboardsResponse. + # p result + # + def import_native_dashboards request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ImportNativeDashboardsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.import_native_dashboards.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Chronicle::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.import_native_dashboards.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_native_dashboards.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @native_dashboard_service_stub.import_native_dashboards request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the NativeDashboardService REST API. + # + # This class represents the configuration for NativeDashboardService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_native_dashboard to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_native_dashboard.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_native_dashboard.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "chronicle.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the NativeDashboardService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_native_dashboard` + # @return [::Gapic::Config::Method] + # + attr_reader :create_native_dashboard + ## + # RPC-specific configuration for `get_native_dashboard` + # @return [::Gapic::Config::Method] + # + attr_reader :get_native_dashboard + ## + # RPC-specific configuration for `list_native_dashboards` + # @return [::Gapic::Config::Method] + # + attr_reader :list_native_dashboards + ## + # RPC-specific configuration for `update_native_dashboard` + # @return [::Gapic::Config::Method] + # + attr_reader :update_native_dashboard + ## + # RPC-specific configuration for `duplicate_native_dashboard` + # @return [::Gapic::Config::Method] + # + attr_reader :duplicate_native_dashboard + ## + # RPC-specific configuration for `delete_native_dashboard` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_native_dashboard + ## + # RPC-specific configuration for `add_chart` + # @return [::Gapic::Config::Method] + # + attr_reader :add_chart + ## + # RPC-specific configuration for `remove_chart` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_chart + ## + # RPC-specific configuration for `edit_chart` + # @return [::Gapic::Config::Method] + # + attr_reader :edit_chart + ## + # RPC-specific configuration for `duplicate_chart` + # @return [::Gapic::Config::Method] + # + attr_reader :duplicate_chart + ## + # RPC-specific configuration for `export_native_dashboards` + # @return [::Gapic::Config::Method] + # + attr_reader :export_native_dashboards + ## + # RPC-specific configuration for `import_native_dashboards` + # @return [::Gapic::Config::Method] + # + attr_reader :import_native_dashboards + + # @private + def initialize parent_rpcs = nil + create_native_dashboard_config = parent_rpcs.create_native_dashboard if parent_rpcs.respond_to? :create_native_dashboard + @create_native_dashboard = ::Gapic::Config::Method.new create_native_dashboard_config + get_native_dashboard_config = parent_rpcs.get_native_dashboard if parent_rpcs.respond_to? :get_native_dashboard + @get_native_dashboard = ::Gapic::Config::Method.new get_native_dashboard_config + list_native_dashboards_config = parent_rpcs.list_native_dashboards if parent_rpcs.respond_to? :list_native_dashboards + @list_native_dashboards = ::Gapic::Config::Method.new list_native_dashboards_config + update_native_dashboard_config = parent_rpcs.update_native_dashboard if parent_rpcs.respond_to? :update_native_dashboard + @update_native_dashboard = ::Gapic::Config::Method.new update_native_dashboard_config + duplicate_native_dashboard_config = parent_rpcs.duplicate_native_dashboard if parent_rpcs.respond_to? :duplicate_native_dashboard + @duplicate_native_dashboard = ::Gapic::Config::Method.new duplicate_native_dashboard_config + delete_native_dashboard_config = parent_rpcs.delete_native_dashboard if parent_rpcs.respond_to? :delete_native_dashboard + @delete_native_dashboard = ::Gapic::Config::Method.new delete_native_dashboard_config + add_chart_config = parent_rpcs.add_chart if parent_rpcs.respond_to? :add_chart + @add_chart = ::Gapic::Config::Method.new add_chart_config + remove_chart_config = parent_rpcs.remove_chart if parent_rpcs.respond_to? :remove_chart + @remove_chart = ::Gapic::Config::Method.new remove_chart_config + edit_chart_config = parent_rpcs.edit_chart if parent_rpcs.respond_to? :edit_chart + @edit_chart = ::Gapic::Config::Method.new edit_chart_config + duplicate_chart_config = parent_rpcs.duplicate_chart if parent_rpcs.respond_to? :duplicate_chart + @duplicate_chart = ::Gapic::Config::Method.new duplicate_chart_config + export_native_dashboards_config = parent_rpcs.export_native_dashboards if parent_rpcs.respond_to? :export_native_dashboards + @export_native_dashboards = ::Gapic::Config::Method.new export_native_dashboards_config + import_native_dashboards_config = parent_rpcs.import_native_dashboards if parent_rpcs.respond_to? :import_native_dashboards + @import_native_dashboards = ::Gapic::Config::Method.new import_native_dashboards_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_service/rest/service_stub.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_service/rest/service_stub.rb new file mode 100644 index 000000000000..86cf453f442d --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_service/rest/service_stub.rb @@ -0,0 +1,822 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/chronicle/v1/native_dashboard_pb" + +module Google + module Cloud + module Chronicle + module V1 + module NativeDashboardService + module Rest + ## + # REST service stub for the NativeDashboardService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the create_native_dashboard REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::CreateNativeDashboardRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::NativeDashboard] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # A result object deserialized from the server's reply + def create_native_dashboard request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_native_dashboard_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_native_dashboard", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Chronicle::V1::NativeDashboard.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_native_dashboard REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::GetNativeDashboardRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::NativeDashboard] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # A result object deserialized from the server's reply + def get_native_dashboard request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_native_dashboard_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_native_dashboard", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Chronicle::V1::NativeDashboard.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_native_dashboards REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::ListNativeDashboardsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::ListNativeDashboardsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::ListNativeDashboardsResponse] + # A result object deserialized from the server's reply + def list_native_dashboards request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_native_dashboards_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_native_dashboards", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Chronicle::V1::ListNativeDashboardsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_native_dashboard REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::UpdateNativeDashboardRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::NativeDashboard] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # A result object deserialized from the server's reply + def update_native_dashboard request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_native_dashboard_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_native_dashboard", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Chronicle::V1::NativeDashboard.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the duplicate_native_dashboard REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::DuplicateNativeDashboardRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::NativeDashboard] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # A result object deserialized from the server's reply + def duplicate_native_dashboard request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_duplicate_native_dashboard_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "duplicate_native_dashboard", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Chronicle::V1::NativeDashboard.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_native_dashboard REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::DeleteNativeDashboardRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_native_dashboard request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_native_dashboard_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_native_dashboard", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the add_chart REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::AddChartRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::AddChartResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::AddChartResponse] + # A result object deserialized from the server's reply + def add_chart request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_chart_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "add_chart", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Chronicle::V1::AddChartResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the remove_chart REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::RemoveChartRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::NativeDashboard] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # A result object deserialized from the server's reply + def remove_chart request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_remove_chart_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "remove_chart", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Chronicle::V1::NativeDashboard.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the edit_chart REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::EditChartRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::EditChartResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::EditChartResponse] + # A result object deserialized from the server's reply + def edit_chart request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_edit_chart_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "edit_chart", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Chronicle::V1::EditChartResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the duplicate_chart REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::DuplicateChartRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::DuplicateChartResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::DuplicateChartResponse] + # A result object deserialized from the server's reply + def duplicate_chart request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_duplicate_chart_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "duplicate_chart", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Chronicle::V1::DuplicateChartResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the export_native_dashboards REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::ExportNativeDashboardsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::ExportNativeDashboardsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::ExportNativeDashboardsResponse] + # A result object deserialized from the server's reply + def export_native_dashboards request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_native_dashboards_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "export_native_dashboards", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Chronicle::V1::ExportNativeDashboardsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the import_native_dashboards REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::ImportNativeDashboardsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Chronicle::V1::ImportNativeDashboardsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Chronicle::V1::ImportNativeDashboardsResponse] + # A result object deserialized from the server's reply + def import_native_dashboards request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_native_dashboards_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "import_native_dashboards", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Chronicle::V1::ImportNativeDashboardsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_native_dashboard REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::CreateNativeDashboardRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_native_dashboard_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/nativeDashboards", + body: "native_dashboard", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_native_dashboard REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::GetNativeDashboardRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_native_dashboard_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/nativeDashboards/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_native_dashboards REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::ListNativeDashboardsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_native_dashboards_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/nativeDashboards", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_native_dashboard REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::UpdateNativeDashboardRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_native_dashboard_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{native_dashboard.name}", + body: "native_dashboard", + matches: [ + ["native_dashboard.name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/nativeDashboards/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the duplicate_native_dashboard REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::DuplicateNativeDashboardRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_duplicate_native_dashboard_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:duplicate", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/nativeDashboards/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_native_dashboard REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::DeleteNativeDashboardRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_native_dashboard_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/nativeDashboards/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_chart REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::AddChartRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_chart_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:addChart", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/nativeDashboards/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the remove_chart REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::RemoveChartRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_remove_chart_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:removeChart", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/nativeDashboards/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the edit_chart REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::EditChartRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_edit_chart_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:editChart", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/nativeDashboards/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the duplicate_chart REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::DuplicateChartRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_duplicate_chart_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:duplicateChart", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/nativeDashboards/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_native_dashboards REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::ExportNativeDashboardsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_export_native_dashboards_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/nativeDashboards:export", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_native_dashboards REST call + # + # @param request_pb [::Google::Cloud::Chronicle::V1::ImportNativeDashboardsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_native_dashboards_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/nativeDashboards:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_services_pb.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_services_pb.rb new file mode 100644 index 000000000000..c0256a88d967 --- /dev/null +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/native_dashboard_services_pb.rb @@ -0,0 +1,67 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/chronicle/v1/native_dashboard.proto for package 'Google.Cloud.Chronicle.V1' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/chronicle/v1/native_dashboard_pb' + +module Google + module Cloud + module Chronicle + module V1 + module NativeDashboardService + # A service providing functionality for managing native dashboards. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.chronicle.v1.NativeDashboardService' + + # Create a dashboard. + rpc :CreateNativeDashboard, ::Google::Cloud::Chronicle::V1::CreateNativeDashboardRequest, ::Google::Cloud::Chronicle::V1::NativeDashboard + # Get a dashboard. + rpc :GetNativeDashboard, ::Google::Cloud::Chronicle::V1::GetNativeDashboardRequest, ::Google::Cloud::Chronicle::V1::NativeDashboard + # List all dashboards. + rpc :ListNativeDashboards, ::Google::Cloud::Chronicle::V1::ListNativeDashboardsRequest, ::Google::Cloud::Chronicle::V1::ListNativeDashboardsResponse + # Update a dashboard. + rpc :UpdateNativeDashboard, ::Google::Cloud::Chronicle::V1::UpdateNativeDashboardRequest, ::Google::Cloud::Chronicle::V1::NativeDashboard + # Duplicate a dashboard. + rpc :DuplicateNativeDashboard, ::Google::Cloud::Chronicle::V1::DuplicateNativeDashboardRequest, ::Google::Cloud::Chronicle::V1::NativeDashboard + # Delete a dashboard. + rpc :DeleteNativeDashboard, ::Google::Cloud::Chronicle::V1::DeleteNativeDashboardRequest, ::Google::Protobuf::Empty + # Add chart in a dashboard. + rpc :AddChart, ::Google::Cloud::Chronicle::V1::AddChartRequest, ::Google::Cloud::Chronicle::V1::AddChartResponse + # Remove chart from a dashboard. + rpc :RemoveChart, ::Google::Cloud::Chronicle::V1::RemoveChartRequest, ::Google::Cloud::Chronicle::V1::NativeDashboard + # Edit chart in a dashboard. + rpc :EditChart, ::Google::Cloud::Chronicle::V1::EditChartRequest, ::Google::Cloud::Chronicle::V1::EditChartResponse + # Duplicate chart in a dashboard. + rpc :DuplicateChart, ::Google::Cloud::Chronicle::V1::DuplicateChartRequest, ::Google::Cloud::Chronicle::V1::DuplicateChartResponse + # Exports the dashboards. + rpc :ExportNativeDashboards, ::Google::Cloud::Chronicle::V1::ExportNativeDashboardsRequest, ::Google::Cloud::Chronicle::V1::ExportNativeDashboardsResponse + # Imports the dashboards. + rpc :ImportNativeDashboards, ::Google::Cloud::Chronicle::V1::ImportNativeDashboardsRequest, ::Google::Cloud::Chronicle::V1::ImportNativeDashboardsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/rest.rb b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/rest.rb index 4a0f6a9111e2..dabfca52785d 100644 --- a/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/rest.rb +++ b/google-cloud-chronicle-v1/lib/google/cloud/chronicle/v1/rest.rb @@ -16,9 +16,14 @@ # Auto-generated by gapic-generator-ruby. DO NOT EDIT! +require "google/cloud/chronicle/v1/big_query_export_service/rest" +require "google/cloud/chronicle/v1/dashboard_query_service/rest" +require "google/cloud/chronicle/v1/dashboard_chart_service/rest" require "google/cloud/chronicle/v1/data_access_control_service/rest" require "google/cloud/chronicle/v1/data_table_service/rest" require "google/cloud/chronicle/v1/entity_service/rest" +require "google/cloud/chronicle/v1/native_dashboard_service/rest" +require "google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest" require "google/cloud/chronicle/v1/instance_service/rest" require "google/cloud/chronicle/v1/reference_list_service/rest" require "google/cloud/chronicle/v1/rule_service/rest" @@ -33,7 +38,7 @@ module Chronicle # @example # # require "google/cloud/chronicle/v1/rest" - # client = ::Google::Cloud::Chronicle::V1::DataAccessControlService::Rest::Client.new + # client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::Client.new # module V1 end diff --git a/google-cloud-chronicle-v1/proto_docs/google/cloud/chronicle/v1/big_query_export.rb b/google-cloud-chronicle-v1/proto_docs/google/cloud/chronicle/v1/big_query_export.rb new file mode 100644 index 000000000000..3d7099af5b15 --- /dev/null +++ b/google-cloud-chronicle-v1/proto_docs/google/cloud/chronicle/v1/big_query_export.rb @@ -0,0 +1,142 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Chronicle + module V1 + # This resource represents the BigQuery export configuration for a Chronicle + # instance which includes Google Cloud Platform resources like Cloud Storage + # buckets, BigQuery datasets etc and the export settings for each data source. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the BigQueryExport. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/bigQueryExport + # @!attribute [r] provisioned + # @return [::Boolean] + # Output only. Whether the BigQueryExport has been provisioned for the + # Chronicle instance. + # @!attribute [r] big_query_export_package + # @return [::Google::Cloud::Chronicle::V1::BigQueryExportPackage] + # Output only. The BigQueryExportPackage entitled for the Chronicle instance. + # @!attribute [rw] entity_graph_settings + # @return [::Google::Cloud::Chronicle::V1::DataSourceExportSettings] + # Optional. The export settings for the Entity Graph data source. + # @!attribute [rw] ioc_matches_settings + # @return [::Google::Cloud::Chronicle::V1::DataSourceExportSettings] + # Optional. The export settings for the IOC Matches data source. + # @!attribute [rw] rule_detections_settings + # @return [::Google::Cloud::Chronicle::V1::DataSourceExportSettings] + # Optional. The export settings for the Rule Detections data source. + # @!attribute [rw] udm_events_aggregates_settings + # @return [::Google::Cloud::Chronicle::V1::DataSourceExportSettings] + # Optional. The export settings for the UDM Events Aggregates data source. + # @!attribute [rw] udm_events_settings + # @return [::Google::Cloud::Chronicle::V1::DataSourceExportSettings] + # Optional. The export settings for the UDM Events data source. + class BigQueryExport + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The export settings for a data source. + # @!attribute [rw] enabled + # @return [::Boolean] + # Required. Whether the data source is enabled for export. + # @!attribute [rw] retention_days + # @return [::Integer] + # Required. The retention period for the data source in days. + # @!attribute [r] latest_export_job_state + # @return [::Google::Cloud::Chronicle::V1::LatestExportJobState] + # Output only. The state of the latest data source export job. + # @!attribute [r] data_freshness_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The data freshness of the given export which represents the + # time bucket at which the latest event was exported. + # @!attribute [r] data_volume + # @return [::Integer] + # Output only. The stored data volume of all the exports. + class DataSourceExportSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message to fetch BigQuery Export configuration. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the BigqueryExport to retrieve. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/bigQueryExport + class GetBigQueryExportRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message to update BigQuery Export configuration. + # @!attribute [rw] big_query_export + # @return [::Google::Cloud::Chronicle::V1::BigQueryExport] + # Required. The BigQueryExport settings to update. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/bigQueryExport + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. The list of fields to update. + class UpdateBigQueryExportRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message to provision BigQuery Export configuration. + # @!attribute [rw] parent + # @return [::String] + # Required. The instance for which BigQuery export is being provisioned. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + class ProvisionBigQueryExportRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The BigQueryExportPackage entitled for the Chronicle instance. + module BigQueryExportPackage + # The BigQueryExportPackage is unspecified. + BIG_QUERY_EXPORT_PACKAGE_UNSPECIFIED = 0 + + # The BigQueryExportPackage is Bring Your Own BigQuery. + BIG_QUERY_EXPORT_PACKAGE_BYOBQ = 1 + + # The BigQueryExportPackage is Advanced BigQuery. + BIG_QUERY_EXPORT_PACKAGE_ADVANCED = 2 + end + + # The state of the latest data source export job. + module LatestExportJobState + # The latest export job state is unspecified. + LATEST_EXPORT_JOB_STATE_UNSPECIFIED = 0 + + # The latest export job state is successful. + LATEST_EXPORT_JOB_STATE_SUCCESS = 1 + + # The latest export job state is failed. + LATEST_EXPORT_JOB_STATE_FAILED = 2 + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/proto_docs/google/cloud/chronicle/v1/dashboard_chart.rb b/google-cloud-chronicle-v1/proto_docs/google/cloud/chronicle/v1/dashboard_chart.rb new file mode 100644 index 000000000000..068b7f8c9990 --- /dev/null +++ b/google-cloud-chronicle-v1/proto_docs/google/cloud/chronicle/v1/dashboard_chart.rb @@ -0,0 +1,923 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Chronicle + module V1 + # DashboardChart resource. + # @!attribute [r] name + # @return [::String] + # Output only. Name of the dashboardChart. + # @!attribute [rw] display_name + # @return [::String] + # Required. Display name/Title of the dashboardChart visible to users. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the dashboardChart. + # @!attribute [r] native_dashboard + # @return [::String] + # Output only. NativeDashboard this chart belongs to. + # @!attribute [rw] tile_type + # @return [::Google::Cloud::Chronicle::V1::TileType] + # Optional. Type of tile i.e., visualization, button or text. + # @!attribute [rw] chart_datasource + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::ChartDatasource] + # Optional. Query and datasource used in the chart. Should be empty for + # Button Tiles. + # @!attribute [rw] visualization + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::Visualization] + # Required. Depending on tile_type one of below fields will be required. + # @!attribute [rw] etag + # @return [::String] + # Optional. This checksum is computed by the server based on the value of + # other fields, and may be sent on update and delete requests to ensure the + # client has an up-to-date value before proceeding. + # @!attribute [rw] drill_down_config + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::DrillDownConfig] + # Optional. Drill down configuration. + # @!attribute [rw] tokens + # @return [::Array<::String>] + # Optional. List of Advanced Filter tokens used in this chart's query (e.g., + # "hostname", "ip"). This allows the UI to identify dependencies without + # parsing the query text. The tokens are stored without the wrapping '$' + # characters. + # The number of tokens are not expected to be more than 10. + class DashboardChart + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Datasource of the chart including the query reference and source name. + # @!attribute [rw] dashboard_query + # @return [::String] + # Reference to dashboard query resource used in the chart. + # @!attribute [rw] data_sources + # @return [::Array<::Google::Cloud::Chronicle::V1::DataSource>] + # Name of the datasource used in the chart. + class ChartDatasource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Visualization config for a chart. + # https://echarts.apache.org/en/option.html#series + # @!attribute [rw] x_axes + # @return [::Array<::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::Axis>] + # @!attribute [rw] y_axes + # @return [::Array<::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::Axis>] + # @!attribute [rw] series + # @return [::Array<::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::Series>] + # @!attribute [rw] tooltip + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::Tooltip] + # @!attribute [rw] legends + # @return [::Array<::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::Legend>] + # @!attribute [rw] column_defs + # @return [::Array<::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::ColumnDef>] + # Column Definition to represent chart as a table. + # @!attribute [rw] table_config + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::TableConfig] + # Optional. Configuration for table appearance. + # @!attribute [rw] button + # @return [::Google::Cloud::Chronicle::V1::Button] + # Button config for a chart if tileType is TILE_TYPE_BUTTON. + # @!attribute [rw] markdown + # @return [::Google::Cloud::Chronicle::V1::Markdown] + # Optional. Markdown config for a chart if tileType is TILE_TYPE_MARKDOWN. + # @!attribute [rw] series_column + # @return [::Array<::String>] + # Optional. Selected column for series + # @!attribute [rw] grouping_type + # @return [::String] + # Optional. Selected grouping type for series + # @!attribute [rw] google_maps_config + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::GoogleMapsConfig] + # Optional. Google Maps config for a chart if type is GOOGLE MAPS. + # @!attribute [rw] threshold_coloring_enabled + # @return [::Boolean] + # Optional. Whether threshold coloring is enabled for the chart. If it's + # enabled, the chart will be colored based on the values stored in + # VisualMap below. + # @!attribute [rw] visual_maps + # @return [::Array<::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::VisualMap>] + # Optional. Visual maps for the chart. + class Visualization + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] axis_type + # @return [::Google::Cloud::Chronicle::V1::AxisType] + # @!attribute [rw] display_name + # @return [::String] + # @!attribute [rw] min + # @return [::Integer] + # Minimum value to be rendered in ECharts as per + # https://echarts.apache.org/en/option.html#xAxis.min + # @!attribute [rw] max + # @return [::Integer] + # Maximum value to be rendered in ECharts as per + # https://echarts.apache.org/en/option.html#xAxis.max + class Axis + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] series_type + # @return [::Google::Cloud::Chronicle::V1::SeriesType] + # @!attribute [rw] series_name + # @return [::String] + # user specified series label + # @!attribute [rw] show_symbol + # @return [::Boolean] + # @!attribute [rw] show_background + # @return [::Boolean] + # @!attribute [rw] stack + # @return [::String] + # @!attribute [rw] series_stack_strategy + # @return [::Google::Cloud::Chronicle::V1::SeriesStackStrategy] + # @!attribute [rw] encode + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::Series::Encode] + # @!attribute [rw] label + # @return [::String] + # @!attribute [rw] field + # @return [::String] + # @!attribute [rw] data_label + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::Series::DataLabel] + # Optional. Data label config for a series. + # Displays data vaule in the chart + # @!attribute [rw] radius + # @return [::Array<::String>] + # Optional. Used to make a pie chart into a douhnut chart + # @!attribute [rw] item_style + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::Series::ItemStyle] + # Optional. Custom styling for chart + # @!attribute [rw] series_unique_value + # @return [::String] + # Optional. Series unique value from the query result + # @!attribute [rw] area_style + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::Series::AreaStyle] + # Optional. Custom styling for area chart + # @!attribute [rw] item_colors + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::Series::ItemColors] + # Optional. Field to be saved for retrieving slice colors for the chart + # @!attribute [rw] gauge_config + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::Series::GaugeConfig] + # Optional. Field to be saved for retrieving gauge config for gauge chart + # @!attribute [rw] metric_trend_config + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::Series::MetricTrendConfig] + # Optional. Fields to capture trend config for metric charts + class Series + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] x + # @return [::String] + # @!attribute [rw] y + # @return [::String] + # @!attribute [rw] value + # @return [::String] + # For some type of series that are not in any coordinate system, like + # 'pie' + # @!attribute [rw] item_name + # @return [::String] + # This is useful in charts like 'pie', where data item name can be + # displayed in legend. + class Encode + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Data label config for a series. + # @!attribute [rw] show + # @return [::Boolean] + # Optional. Whether to show data label. + class DataLabel + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Custom styling for chart + # @!attribute [rw] border_width + # @return [::Integer] + # Optional. Used to add border width + # @!attribute [rw] border_color + # @return [::String] + # Optional. Used to add border color + # @!attribute [rw] color + # @return [::String] + # Optional. Used to add color + class ItemStyle + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Custom styling for area chart + # @!attribute [rw] color + # @return [::String] + # Optional. Used to add color + # @!attribute [rw] origin + # @return [::String] + # Optional. Used to add origin + # @!attribute [rw] shadow_blur + # @return [::Integer] + # Optional. Used to add shadow blur + # @!attribute [rw] shadow_color + # @return [::String] + # Optional. Used to add shadow color + # @!attribute [rw] shadow_offset_x + # @return [::Integer] + # Optional. Used to add shadow offsetX + # @!attribute [rw] shadow_offset_y + # @return [::Integer] + # Optional. Used to add shadow offsetY + # @!attribute [rw] opacity + # @return [::Integer] + # Optional. Used to add opacity + class AreaStyle + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # User selected color and label for the slice of the chart + # @!attribute [rw] color + # @return [::String] + # Optional. User specified color of a pie slice + # @!attribute [rw] label + # @return [::String] + # Optional. User specified label for a pie slice + class UserSelectedValues + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Slice containing the key and value for a slice in the chart + # @!attribute [rw] key + # @return [::String] + # Optional. Key for the slice + # @!attribute [rw] value + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::Series::UserSelectedValues] + # Optional. Value for the slice + class ChartSliceColor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Field to be saved for retrieving slice colors for the chart + # @!attribute [rw] colors + # @return [::Array<::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::Series::ChartSliceColor>] + # Optional. Slice colors array + class ItemColors + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Field to be saved for retrieving value and color for gauge chart + # @!attribute [rw] value + # @return [::Integer] + # Optional. Value for gauge chart + # @!attribute [rw] color + # @return [::String] + # Optional. Color for gauge chart + class GaugeValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Field to be saved for retrieving value and color for gauge chart + # @!attribute [rw] base_value + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::Series::GaugeValue] + # Optional. Base value for gauge chart + # @!attribute [rw] limit_value + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::Series::GaugeValue] + # Optional. Limit value for gauge chart + # @!attribute [rw] threshold_values + # @return [::Array<::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::Series::GaugeValue>] + # Optional. Threshold values for gauge chart + class GaugeConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metric trend config for displaying trend value in Metrics chart + # @!attribute [rw] metric_format + # @return [::Google::Cloud::Chronicle::V1::MetricFormat] + # Optional. Metric chart configuration to display metric trend + # @!attribute [rw] show_metric_trend + # @return [::Boolean] + # Optional. Metric chart configuration to toggle the trend value + # display + # @!attribute [rw] metric_display_trend + # @return [::Google::Cloud::Chronicle::V1::MetricDisplayTrend] + # Optional. Metric chart configuration to display the trend value + # @!attribute [rw] metric_trend_type + # @return [::Google::Cloud::Chronicle::V1::MetricTrendType] + # Optional. Metric chart configuration to display trend type whether + # regular or inverse + class MetricTrendConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # @!attribute [rw] show + # @return [::Boolean] + # @!attribute [rw] tooltip_trigger + # @return [::Google::Cloud::Chronicle::V1::ToolTipTrigger] + class Tooltip + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] id + # @return [::String] + # @!attribute [rw] show + # @return [::Boolean] + # @!attribute [rw] z_level + # @return [::Integer] + # @!attribute [rw] z + # @return [::Integer] + # @!attribute [rw] left + # @return [::Integer] + # @!attribute [rw] top + # @return [::Integer] + # @!attribute [rw] right + # @return [::Integer] + # @!attribute [rw] bottom + # @return [::Integer] + # @!attribute [rw] legend_orient + # @return [::Google::Cloud::Chronicle::V1::LegendOrient] + # @!attribute [rw] legend_align + # @return [::Google::Cloud::Chronicle::V1::LegendAlign] + # @!attribute [rw] padding + # @return [::Array<::Integer>] + class Legend + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Column Definition. + # @!attribute [rw] field + # @return [::String] + # Field key in data. + # @!attribute [rw] header + # @return [::String] + # Header name for column. + class ColumnDef + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Column render type settings. This is used to determine the data render + # type of the column in the table. + # @!attribute [rw] field + # @return [::String] + # Optional. Field key in data. + # @!attribute [rw] column_render_type + # @return [::Google::Cloud::Chronicle::V1::RenderType] + # Optional. Column render type. + class ColumnRenderTypeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for tooltip for column header and cell. + # @!attribute [rw] field + # @return [::String] + # Required. Field key in data. + # @!attribute [rw] header_tooltip_text + # @return [::String] + # Optional. Column header tooltip text. + # @!attribute [rw] cell_tooltip_text + # @return [::String] + # Optional. Column cell tooltip text. + class ColumnTooltipSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for table appearance. + # @!attribute [rw] enable_text_wrap + # @return [::Boolean] + # Optional. Whether to show the table. + # @!attribute [rw] column_render_type_settings + # @return [::Array<::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::ColumnRenderTypeSettings>] + # Optional. Column render type settings. + # @!attribute [rw] column_tooltip_settings + # @return [::Array<::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::ColumnTooltipSettings>] + # Optional. Settings for tooltip for column header and cell. + class TableConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Google Maps config for a chart if chart type is map. + # @!attribute [rw] data_settings + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::GoogleMapsConfig::DataSettings] + # Optional. Data settings for the map. + # @!attribute [rw] plot_mode + # @return [::Google::Cloud::Chronicle::V1::PlotMode] + # Optional. Plot mode for the map. This is used to determine whether to + # show points, heatmap or both. + # @!attribute [rw] map_position + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::GoogleMapsConfig::MapPosition] + # Optional. Map position settings for the map. + # @!attribute [rw] point_settings + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::GoogleMapsConfig::PointSettings] + # Optional. Point settings for the map. + class GoogleMapsConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Data settings for the map. + # @!attribute [rw] latitude_column + # @return [::String] + # Optional. Latitude column. + # @!attribute [rw] longitude_column + # @return [::String] + # Optional. Longitude column. + # @!attribute [rw] count_column + # @return [::String] + # Optional. Field to count. + class DataSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Map position settings for the map. + # @!attribute [rw] fit_data + # @return [::Boolean] + # Optional. Whether to fit the map to the data. + # If true, the map will be resized to fit the data. + # If false, langitude and longitude will be used to set the map size. + # @!attribute [rw] latitude_value + # @return [::Float] + # Optional. Latitude of the map. + # @!attribute [rw] longitude_value + # @return [::Float] + # Optional. Longitude of the map. + # @!attribute [rw] zoom_scale_value + # @return [::Float] + # Optional. Scale of the map. + class MapPosition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Point settings for the map. + # @!attribute [rw] point_size_type + # @return [::Google::Cloud::Chronicle::V1::PointSizeType] + # Optional. Point size type for the map. This is used to + # determine the size of the points on the map. + # @!attribute [rw] color + # @return [::String] + # Optional. Color for the point on the map. + class PointSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Conveys what range of values should be rendered in what color. This field + # is used when threshold_coloring_enabled is true. + # @!attribute [rw] visual_map_type + # @return [::Google::Cloud::Chronicle::V1::VisualMapType] + # Optional. Contains one of the valid visual map types such as + # 'continuous' or 'piecewise'. + # @!attribute [rw] pieces + # @return [::Array<::Google::Cloud::Chronicle::V1::DashboardChart::Visualization::VisualMap::VisualMapPiece>] + # Optional. Pieces of the visual map. + class VisualMap + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An ECharts visual map of type 'piecewise' contain many pieces. Each + # piece has a min, max, and color with which it's rendered. + # @!attribute [rw] min + # @return [::Integer] + # Optional. Minimum value for the piece. + # @!attribute [rw] max + # @return [::Integer] + # Optional. Minimum value for the piece. + # @!attribute [rw] color + # @return [::String] + # Optional. Color to render the piece in when the value is between min + # and max. + # @!attribute [rw] label + # @return [::String] + # Optional. Label used in visual map controller. + class VisualMapPiece + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Drill down configuration. + # @!attribute [rw] left_drill_downs + # @return [::Array<::Google::Cloud::Chronicle::V1::DashboardChart::DrillDownConfig::DrillDown>] + # Required. Left click drill downs. + # @!attribute [rw] right_drill_downs + # @return [::Array<::Google::Cloud::Chronicle::V1::DashboardChart::DrillDownConfig::DrillDown>] + # Required. Right click drill downs. + class DrillDownConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Drill down config. + # @!attribute [rw] default_settings + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::DrillDownConfig::DrillDown::DefaultDrillDownSettings] + # Default drill down settings. + # + # Note: The following fields are mutually exclusive: `default_settings`, `custom_settings`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] custom_settings + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::DrillDownConfig::DrillDown::CustomDrillDownSettings] + # Custom drill down settings. + # + # Note: The following fields are mutually exclusive: `custom_settings`, `default_settings`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] id + # @return [::String] + # Required. ID of the drill down. + # @!attribute [rw] display_name + # @return [::String] + # Required. Display name of the drill down. + class DrillDown + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Default drill down settings. + # @!attribute [rw] enabled + # @return [::Boolean] + # Required. Whether the default drill down is enabled. + class DefaultDrillDownSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Custom drill down settings. + # @!attribute [rw] query + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::DrillDownConfig::DrillDown::CustomDrillDownSettings::DrillDownQuery] + # Drill down query action config. + # + # Note: The following fields are mutually exclusive: `query`, `filter`, `external_link`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] filter + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::DrillDownConfig::DrillDown::CustomDrillDownSettings::DrillDownFilter] + # Drill down filter action config. + # + # Note: The following fields are mutually exclusive: `filter`, `query`, `external_link`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] external_link + # @return [::Google::Cloud::Chronicle::V1::DashboardChart::DrillDownConfig::DrillDown::CustomDrillDownSettings::DrillDownExternalLink] + # Drill down external link action config. + # + # Note: The following fields are mutually exclusive: `external_link`, `query`, `filter`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] new_tab + # @return [::Boolean] + # Required. Whether to open the drill down action in a new tab. + # @!attribute [rw] left_click_column + # @return [::String] + # Optional. Table chart column name to associate the custom drill down + # action on left click. + class CustomDrillDownSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Drill down query config. + # @!attribute [rw] query + # @return [::String] + # Required. Search query to be executed on drill down. + class DrillDownQuery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Drill down filter config. + # @!attribute [rw] dashboard_filters + # @return [::Array<::Google::Cloud::Chronicle::V1::DashboardChart::DrillDownConfig::DrillDown::CustomDrillDownSettings::DrillDownFilter::DrillDownDashboardFilter>] + # Required. Dashboard filters to be applied on drill down. + class DrillDownFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Drill down dashboard filter config. + # @!attribute [rw] dashboard_filter_id + # @return [::String] + # Required. ID of the dashboard filter. + # @!attribute [rw] filter_operator_and_values + # @return [::Array<::Google::Cloud::Chronicle::V1::FilterOperatorAndValues>] + # Required. Filter operator and field values for the dashboard + # filter. + class DrillDownDashboardFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Drill down external link config. + # @!attribute [rw] link + # @return [::String] + # Required. External link the drill down action should redirect to. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the external link. + class DrillDownExternalLink + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + + # Button config for a chart. + # @!attribute [rw] label + # @return [::String] + # @!attribute [rw] hyperlink + # @return [::String] + # @!attribute [rw] description + # @return [::String] + # @!attribute [rw] new_tab + # @return [::Boolean] + # Optional. Whether to open the link in a new tab. + # @!attribute [rw] properties + # @return [::Google::Cloud::Chronicle::V1::Button::Properties] + class Button + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] color + # @return [::String] + # @!attribute [rw] button_style + # @return [::Google::Cloud::Chronicle::V1::ButtonStyle] + class Properties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Markdown config for a dashboard tile. + # @!attribute [rw] content + # @return [::String] + # Required. Markdown content. + # @!attribute [rw] properties + # @return [::Google::Cloud::Chronicle::V1::Markdown::MarkdownProperties] + # Optional. Properties for the markdown. + class Markdown + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Properties for the markdown. + # @!attribute [rw] background_color + # @return [::String] + # Optional. Background color of the markdown. + class MarkdownProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message to get a dashboard chart. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the dashboardChart to retrieve. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/dashboardCharts/\\{chart} + class GetDashboardChartRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to get dashboard charts in batch. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource shared by all dashboard charts being + # retrieved. Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance} If this is + # set, the parent of all of the dashboard charts specified in `names` must + # match this field. + # @!attribute [rw] names + # @return [::Array<::String>] + # Required. The names of the dashboard charts to get. + class BatchGetDashboardChartsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for getting dashboard charts in batch. + # @!attribute [rw] dashboard_charts + # @return [::Array<::Google::Cloud::Chronicle::V1::DashboardChart>] + # The dashboardCharts from the specified chronicle instance. + class BatchGetDashboardChartsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # TileType indicates what type of chart tile it is i.e., visualization chart, + # button or text. + module TileType + # Defaults to VISUALIZATION. + TILE_TYPE_UNSPECIFIED = 0 + + # Visualization i.e., bar charts, pie charts etc. + TILE_TYPE_VISUALIZATION = 1 + + # Button with hyperlink. + TILE_TYPE_BUTTON = 2 + + # Markdown tile. + TILE_TYPE_MARKDOWN = 3 + end + + # Render type of the data in the chart. + module RenderType + # Defaults to Unspecified. + RENDER_TYPE_UNSPECIFIED = 0 + + # Text render type. + RENDER_TYPE_TEXT = 1 + + # Icon render type. + RENDER_TYPE_ICON = 2 + + # Icon and text render type. + RENDER_TYPE_ICON_AND_TEXT = 3 + end + + module AxisType + AXIS_TYPE_UNSPECIFIED = 0 + + VALUE = 1 + + CATEGORY = 2 + + TIME = 3 + + LOG = 4 + end + + module SeriesType + SERIES_TYPE_UNSPECIFIED = 0 + + LINE = 1 + + BAR = 2 + + PIE = 3 + + TEXT = 4 + + # Represents map chart type. + MAP = 5 + + # Represents gauge chart type. + GAUGE = 6 + + # Represents scatterplot chart type. + SCATTERPLOT = 7 + end + + module SeriesStackStrategy + SERIES_STACK_STRATEGY_UNSPECIFIED = 0 + + SAMESIGN = 1 + + ALL = 2 + + POSITIVE = 3 + + NEGATIVE = 4 + end + + module ToolTipTrigger + TOOLTIP_TRIGGER_UNSPECIFIED = 0 + + TOOLTIP_TRIGGER_NONE = 1 + + TOOLTIP_TRIGGER_ITEM = 2 + + TOOLTIP_TRIGGER_AXIS = 3 + end + + module LegendOrient + LEGEND_ORIENT_UNSPECIFIED = 0 + + VERTICAL = 1 + + HORIZONTAL = 2 + end + + module LegendAlign + LEGEND_ALIGN_UNSPECIFIED = 0 + + AUTO = 1 + + LEFT = 2 + + RIGHT = 3 + end + + module ButtonStyle + BUTTON_STYLE_UNSPECIFIED = 0 + + BUTTON_STYLE_FILLED = 1 + + BUTTON_STYLE_OUTLINED = 2 + + BUTTON_STYLE_TRANSPARENT = 3 + end + + # Plot mode for the map. + module PlotMode + # Plot mode is not specified. + PLOT_MODE_UNSPECIFIED = 0 + + # Plot mode is points. + PLOT_MODE_POINTS = 1 + + # Plot mode is heatmap. + PLOT_MODE_HEATMAP = 2 + + # Plot mode is both points and heatmap. + PLOT_MODE_BOTH = 3 + end + + # Point size type for the map. + module PointSizeType + # Point size is not specified. + POINT_SIZE_TYPE_UNSPECIFIED = 0 + + # Point size is fixed. + POINT_SIZE_TYPE_FIXED = 1 + + # Point size is proportional to the size of the data point. + POINT_SIZE_TYPE_PROPORTIONAL_TO_SIZE = 2 + end + + # Metric format to be displayed for the metric charts. + module MetricFormat + # Metric format is not specified. + METRIC_FORMAT_UNSPECIFIED = 0 + + # Metric format in number + METRIC_FORMAT_NUMBER = 1 + + # Metric format in plain text + METRIC_FORMAT_PLAIN_TEXT = 2 + end + + # Trend to be displayed for the metric charts as. + module MetricDisplayTrend + # Trend is not specified. + METRIC_DISPLAY_TREND_UNSPECIFIED = 0 + + # Trend data in absolute value + METRIC_DISPLAY_TREND_ABSOLUTE_VALUE = 2 + + # Trend data in percentage + METRIC_DISPLAY_TREND_PERCENTAGE = 3 + + # Trend data in both absolute value and percentage + METRIC_DISPLAY_TREND_ABSOLUTE_VALUE_AND_PERCENTAGE = 4 + end + + # Trend to be displayed for the metric charts as. + module MetricTrendType + # Trend type is not specified. + METRIC_TREND_TYPE_UNSPECIFIED = 0 + + # The trend type is regular(green for positive delta) + METRIC_TREND_TYPE_REGULAR = 1 + + # The trend type is inverse(red for positive delta) + METRIC_TREND_TYPE_INVERSE = 2 + end + + # Visual map for various charts. More info: + # https://echarts.apache.org/en/option.html#visualMap + module VisualMapType + # Visual map type is not specified + VISUAL_MAP_TYPE_UNSPECIFIED = 0 + + # Continuous visual map + CONTINUOUS = 1 + + # Piecewise visual map + PIECEWISE = 2 + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/proto_docs/google/cloud/chronicle/v1/dashboard_query.rb b/google-cloud-chronicle-v1/proto_docs/google/cloud/chronicle/v1/dashboard_query.rb new file mode 100644 index 000000000000..7a1dca16bc9a --- /dev/null +++ b/google-cloud-chronicle-v1/proto_docs/google/cloud/chronicle/v1/dashboard_query.rb @@ -0,0 +1,653 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Chronicle + module V1 + # DashboardQuery resource. + # @!attribute [r] name + # @return [::String] + # Output only. Name of the dashboardQuery. + # @!attribute [rw] query + # @return [::String] + # Required. Search query string. + # @!attribute [rw] input + # @return [::Google::Cloud::Chronicle::V1::DashboardQuery::Input] + # Required. Inputs to the query. + # @!attribute [r] dashboard_chart + # @return [::String] + # Output only. DashboardChart this query belongs to. + # @!attribute [rw] etag + # @return [::String] + # Optional. This checksum is computed by the server based on the value of + # other fields, and may be sent on update and delete requests to ensure the + # client has an up-to-date value before proceeding. + class DashboardQuery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Input to the query like time window. + # @!attribute [rw] time_window + # @return [::Google::Type::Interval] + # time range to fetch the data for. + # + # Note: The following fields are mutually exclusive: `time_window`, `relative_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] relative_time + # @return [::Google::Cloud::Chronicle::V1::DashboardQuery::Input::RelativeTime] + # time range for last x units. + # + # Note: The following fields are mutually exclusive: `relative_time`, `time_window`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Input + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # time representation for last x units. + # @!attribute [rw] time_unit + # @return [::Google::Cloud::Chronicle::V1::TimeUnit] + # @!attribute [rw] start_time_val + # @return [::Integer] + class RelativeTime + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Request message to get a dashboard query. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the dashboardQuery to retrieve. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/dashboardQueries/\\{query} + class GetDashboardQueryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to execute a dashboard query. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, under which to run this dashboardQuery. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @!attribute [rw] query + # @return [::Google::Cloud::Chronicle::V1::DashboardQuery] + # Required. The query to execute and get results back for. + # QueryID or 'query', 'input.time_window' fields will be used. Use + # 'native_dashboard' and 'dashboard_chart' fields if it is an in-dashboard + # query. + # @!attribute [rw] filters + # @return [::Array<::Google::Cloud::Chronicle::V1::DashboardFilter>] + # Optional. Dashboard level filters other than query string. + # @!attribute [rw] clear_cache + # @return [::Boolean] + # Optional. When true, the backend would read from the database, rather than + # fetching data directly from the cache. + # @!attribute [rw] use_previous_time_range + # @return [::Boolean] + # Optional. When true, the backend will execute the query against the + # previous time range of the query. + class ExecuteDashboardQueryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime error for a dashboard query. + # @!attribute [rw] error_title + # @return [::String] + # Short Description of the error. + # @!attribute [rw] error_description + # @return [::String] + # Error message + # @!attribute [rw] error_severity + # @return [::Google::Cloud::Chronicle::V1::QueryRuntimeError::ErrorSeverity] + # Severity of the error. + # @!attribute [rw] metadata + # @return [::Array<::Google::Cloud::Chronicle::V1::QueryRuntimeError::QueryRuntimeErrorMetadata>] + # Metadata for the error. + # @!attribute [rw] warning_reason + # @return [::Google::Cloud::Chronicle::V1::QueryRuntimeError::WarningReason] + # Reason for the error. + class QueryRuntimeError + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Metadata for the error. + # @!attribute [rw] key + # @return [::Google::Cloud::Chronicle::V1::QueryRuntimeError::MetadataKey] + # Metadata key. + # @!attribute [rw] value + # @return [::String] + # Metadata value. + class QueryRuntimeErrorMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Based on ErrorSeverity, UI will choose to format the error differently. + module ErrorSeverity + # Severity is unknown. + ERROR_SEVERITY_UNSPECIFIED = 0 + + # Severity is warning. + WARNING = 1 + + # Error is severe. + SEVERE = 2 + end + + # Metadata enum to identify the metadata key. + module MetadataKey + # Key is unknown. + METADATA_KEY_UNSPECIFIED = 0 + + # Key is row limit. + ROW_LIMIT = 1 + end + + # Warning reason. + module WarningReason + # Reason is unknown. + WARNING_REASON_UNSPECIFIED = 0 + + # Reason is row limit exceeded. + ROW_LIMIT_EXCEEDED = 1 + + # Reason is default row limit exceeded. + DEFAULT_ROW_LIMIT_EXCEEDED = 2 + + # Reason is curated query default row limit exceeded. + CURATED_QUERY_DEFAULT_ROW_LIMIT_EXCEEDED = 3 + end + end + + # Response message for executing a dashboard query. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse::ColumnData>] + # Result rows that are queried. + # @!attribute [rw] data_sources + # @return [::Array<::Google::Cloud::Chronicle::V1::DataSource>] + # Datasource of the query and results. + # @!attribute [rw] last_backend_cache_refreshed_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Last time the cache was refreshed. This would be used by the UI + # to show the last updated time. + # @!attribute [rw] time_window + # @return [::Google::Type::Interval] + # Time window against which query was executed. + # @!attribute [rw] query_runtime_errors + # @return [::Array<::Google::Cloud::Chronicle::V1::QueryRuntimeError>] + # Runtime errors + # @!attribute [rw] language_features + # @return [::Array<::Google::Cloud::Chronicle::V1::LanguageFeature>] + # Optional. Language features found in the query. + class ExecuteDashboardQueryResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # LINT.IfChange(stats_data) + # Value of the column based on data type. + # @!attribute [rw] null_val + # @return [::Boolean] + # True if the value is NULL. + # + # Note: The following fields are mutually exclusive: `null_val`, `bool_val`, `bytes_val`, `double_val`, `int64_val`, `uint64_val`, `string_val`, `timestamp_val`, `date_val`, `proto_val`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bool_val + # @return [::Boolean] + # Boolean value. + # + # Note: The following fields are mutually exclusive: `bool_val`, `null_val`, `bytes_val`, `double_val`, `int64_val`, `uint64_val`, `string_val`, `timestamp_val`, `date_val`, `proto_val`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bytes_val + # @return [::String] + # Bytes value. + # + # Note: The following fields are mutually exclusive: `bytes_val`, `null_val`, `bool_val`, `double_val`, `int64_val`, `uint64_val`, `string_val`, `timestamp_val`, `date_val`, `proto_val`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] double_val + # @return [::Float] + # Double value. + # + # Note: The following fields are mutually exclusive: `double_val`, `null_val`, `bool_val`, `bytes_val`, `int64_val`, `uint64_val`, `string_val`, `timestamp_val`, `date_val`, `proto_val`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] int64_val + # @return [::Integer] + # Integer value (signed). + # + # Note: The following fields are mutually exclusive: `int64_val`, `null_val`, `bool_val`, `bytes_val`, `double_val`, `uint64_val`, `string_val`, `timestamp_val`, `date_val`, `proto_val`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] uint64_val + # @return [::Integer] + # Un-signed integer value. + # + # Note: The following fields are mutually exclusive: `uint64_val`, `null_val`, `bool_val`, `bytes_val`, `double_val`, `int64_val`, `string_val`, `timestamp_val`, `date_val`, `proto_val`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] string_val + # @return [::String] + # String value. Enum values are returned as strings. + # + # Note: The following fields are mutually exclusive: `string_val`, `null_val`, `bool_val`, `bytes_val`, `double_val`, `int64_val`, `uint64_val`, `timestamp_val`, `date_val`, `proto_val`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] timestamp_val + # @return [::Google::Protobuf::Timestamp] + # Timestamp values. Does not handle `interval`. + # + # Note: The following fields are mutually exclusive: `timestamp_val`, `null_val`, `bool_val`, `bytes_val`, `double_val`, `int64_val`, `uint64_val`, `string_val`, `date_val`, `proto_val`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] date_val + # @return [::Google::Type::Date] + # Date values. + # + # Note: The following fields are mutually exclusive: `date_val`, `null_val`, `bool_val`, `bytes_val`, `double_val`, `int64_val`, `uint64_val`, `string_val`, `timestamp_val`, `proto_val`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] proto_val + # @return [::Google::Protobuf::Any] + # For any proto values that are not any of the above. + # + # Note: The following fields are mutually exclusive: `proto_val`, `null_val`, `bool_val`, `bytes_val`, `double_val`, `int64_val`, `uint64_val`, `string_val`, `timestamp_val`, `date_val`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse::ColumnValue::ValueMetadata] + class ColumnValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] links + # @return [::Array<::Google::Cloud::Chronicle::V1::InAppLink>] + # "Auto" generated In-app links. + # @!attribute [rw] field_paths + # @return [::Array<::String>] + # @!attribute [rw] timestamp_val + # @return [::Google::Protobuf::Timestamp] + # Timestamp value to store the timestamp for the case of the date and + # time data type. + class ValueMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Singular vs list of values in a column. + # @!attribute [rw] value + # @return [::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse::ColumnValue] + # Single value in a column. + # + # Note: The following fields are mutually exclusive: `value`, `list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] list + # @return [::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse::ColumnType::List] + # List of values in a column e.g. IPs + # + # Note: The following fields are mutually exclusive: `list`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ColumnType + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Store list of values in a column. + # @!attribute [rw] values + # @return [::Array<::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse::ColumnValue>] + class List + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # @!attribute [rw] column + # @return [::String] + # Used to store column names. + # @!attribute [rw] values + # @return [::Array<::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse::ColumnType>] + # To store column data. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Chronicle::V1::ColumnMetadata] + # To store column metadata. + class ColumnData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Dashboard level filter that can be used in native dashboards as well as + # inputs to execute query. + # @!attribute [rw] id + # @return [::String] + # ID of the filter. + # @!attribute [rw] data_source + # @return [::Google::Cloud::Chronicle::V1::DataSource] + # Datasource the filter is applicable for. + # @!attribute [rw] field_path + # @return [::String] + # Filter field path. + # @!attribute [rw] filter_operator_and_field_values + # @return [::Array<::Google::Cloud::Chronicle::V1::FilterOperatorAndValues>] + # Operator and values. Can include multiple modifiers. + # @!attribute [rw] display_name + # @return [::String] + # Display name of the filter. + # @!attribute [rw] chart_ids + # @return [::Array<::String>] + # Chart IDs the filter is applicable for. + # @!attribute [rw] is_standard_time_range_filter + # @return [::Boolean] + # Optional. Whether the filter is a standard time range filter, + # meaning that it has to be used as the query time range, + # and not as a predicate in the query. + # A chart can have at most one standard time range filter applied. + # @!attribute [rw] is_mandatory + # @return [::Boolean] + # Optional. Whether this filter is required to be populated by the + # dashboard consumer prior to the dashboard loading. + # @!attribute [rw] is_standard_time_range_filter_enabled + # @return [::Boolean] + # Optional. Whether this standard time range filter is enabled. + # @!attribute [rw] advanced_filter_config + # @return [::Google::Cloud::Chronicle::V1::AdvancedFilterConfig] + # Optional. Advanced filter configuration for the filter widget. + class DashboardFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] filter_operator + # @return [::Google::Cloud::Chronicle::V1::FilterOperator] + # Operator for a single filter modifier. + # @!attribute [rw] field_values + # @return [::Array<::String>] + # Values for the modifier. All operators should have a single value other + # than 'IN' and 'BETWEEN'. 'PAST' will have negative seconds + # like -86400 is past 1 day. + class FilterOperatorAndValues + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Advanced filter configuration for the filter widget. + # @!attribute [rw] token + # @return [::String] + # Required. The token name to look for in the query (e.g., "hostname"). + # The system will automatically wrap this in '$' (e.g., "$hostname$"). + # @!attribute [rw] prefix + # @return [::String] + # Optional. String to prepend to the final replaced value (e.g., "/", "^(", + # "\""). + # @!attribute [rw] suffix + # @return [::String] + # Optional. String to append to the final replaced value (e.g., "/", ")$", + # "\""). + # @!attribute [rw] separator + # @return [::String] + # Optional. Delimiter to join multiple selected values (e.g., "|", " OR field + # = "). + # @!attribute [rw] multiple_allowed + # @return [::Boolean] + # Optional. Whether to allow selection of multiple values. + # @!attribute [rw] default_values + # @return [::Array<::String>] + # Optional. Default values to use if no value is selected/provided. + # @!attribute [rw] skip_default_affixes + # @return [::Boolean] + # Optional. Whether to skip the configured prefix and suffix when using + # default values. If true, default values are inserted raw (joined by the + # separator). + # @!attribute [rw] value_source + # @return [::Google::Cloud::Chronicle::V1::AdvancedFilterConfig::ValueSource] + # Required. Source of the values for the filter. + class AdvancedFilterConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Source of the values for the filter. + # @!attribute [rw] manual_options + # @return [::Google::Cloud::Chronicle::V1::AdvancedFilterConfig::ManualOptions] + # Optional. Manual options provided by the user. + # + # Note: The following fields are mutually exclusive: `manual_options`, `query_options`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] query_options + # @return [::Google::Cloud::Chronicle::V1::AdvancedFilterConfig::QueryOptions] + # Optional. Query options to fetch the values from the query engine. + # This is used for the filter's population query. + # + # Note: The following fields are mutually exclusive: `query_options`, `manual_options`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ValueSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Manual options provided by the user. + # @!attribute [rw] options + # @return [::Array<::String>] + # Optional. The options provided by the user. + # The max number of options is limited to 10000. + class ManualOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Query options to fetch the values from the query engine. + # This is used for the filter's population query. + # @!attribute [rw] query + # @return [::String] + # Required. The query to execute to fetch the values. + # @!attribute [rw] column + # @return [::String] + # Required. The column name to use for the values. + # @!attribute [rw] global_time_filter_enabled + # @return [::Boolean] + # Optional. Enable global time filter + # @!attribute [rw] input + # @return [::Google::Cloud::Chronicle::V1::DashboardQuery::Input] + # Optional. Time range input specifically for the filter's population + # query. + class QueryOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # In app linking start + # @!attribute [rw] url + # @return [::String] + # URL to redirect to. + # @!attribute [rw] label + # @return [::String] + # Label for the link. + # @!attribute [rw] icon_url + # @return [::String] + # Icon url for the link. + class InAppLink + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata of the column. + # @!attribute [rw] column + # @return [::String] + # Name of the column. + # @!attribute [rw] field_path + # @return [::String] + # Field path of the queried field, if any. + # @!attribute [rw] function_name + # @return [::String] + # Name of the function used to query the field, if any. + # @!attribute [rw] function_module + # @return [::String] + # Module of the function used to query the field, if any. + # @!attribute [rw] data_source + # @return [::Google::Cloud::Chronicle::V1::DataSource] + # Data source queried. + # @!attribute [rw] timestamp_metadata + # @return [::Google::Cloud::Chronicle::V1::TimestampMetadata] + # Timestamp Metadata + # @!attribute [rw] longitude + # @return [::Boolean] + # Whether the column is a longitude field. + # @!attribute [rw] latitude + # @return [::Boolean] + # Whether the column is a latitude field. + # @!attribute [rw] selected + # @return [::Boolean] + # Whether the column is selected in the final response. + # @!attribute [rw] unselected + # @return [::Boolean] + # Whether the column is unselected in the final response. + class ColumnMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata of the timestamp column. + # @!attribute [rw] time_format + # @return [::String] + # Time format of the timestamp column. + # @!attribute [rw] time_zone + # @return [::String] + # Time zone of the timestamp column. + # @!attribute [rw] time_granularity + # @return [::String] + # Time granularity of the timestamp column. + # @!attribute [rw] is_sortable + # @return [::Boolean] + # Whether the timestamp column is sortable in UI. + # @!attribute [rw] is_interpolable + # @return [::Boolean] + # Whether the timestamp column is interpolable in UI. + class TimestampMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A language feature describes a specific capability or syntax of the query + # language used in a dashboard query, such as `JOINS`, `STAGES`, or + # `DATA_TABLES`. + module LanguageFeature + # Language feature is unknown. + LANGUAGE_FEATURE_UNSPECIFIED = 0 + + # Language feature is joins. + JOINS = 1 + + # Language feature is stages. + STAGES = 2 + + # Language feature is data table. + DATA_TABLES = 3 + end + + module FilterOperator + # Default unspecified. + FILTER_OPERATOR_UNSPECIFIED = 0 + + EQUAL = 1 + + NOT_EQUAL = 2 + + IN = 3 + + GREATER_THAN = 4 + + GREATER_THAN_OR_EQUAL_TO = 5 + + LESS_THAN = 6 + + LESS_THAN_OR_EQUAL_TO = 7 + + BETWEEN = 8 + + PAST = 9 + + IS_NULL = 10 + + IS_NOT_NULL = 11 + + STARTS_WITH = 12 + + ENDS_WITH = 13 + + DOES_NOT_STARTS_WITH = 14 + + DOES_NOT_ENDS_WITH = 15 + + NOT_IN = 16 + + # CONTAINS is used for substring match. + CONTAINS = 17 + + # Used if we want to check if the field does not contain the substring. + DOES_NOT_CONTAIN = 18 + end + + # LINT.IfChange(data_sources) + module DataSource + DATA_SOURCE_UNSPECIFIED = 0 + + UDM = 1 + + ENTITY = 2 + + INGESTION_METRICS = 3 + + # RULE_DETECTIONS is used for detections datasource. + RULE_DETECTIONS = 4 + + # RULESETS is used for ruleset with detections datasource. + RULESETS = 5 + + # GLOBAL is used for standard time range filter. + GLOBAL = 6 + + # IOC_MATCHES is used for ioc_matches datasource. + IOC_MATCHES = 7 + + # RULES is used for rules datasource. + RULES = 8 + + # SOAR Cases - identified as `case`. + SOAR_CASES = 9 + + # SOAR Playbooks - identified as `playbook`. + SOAR_PLAYBOOKS = 10 + + # SOAR Case History - identified as `case_history`. + SOAR_CASE_HISTORY = 11 + + # DATA_TABLE is used for data tables source. + DATA_TABLE = 12 + + # INVESTIGATION is used as the data source for triage agent investigations. + # Identified as `gemini_investigation`. + INVESTIGATION = 13 + + # INVESTIGATION_FEEDBACK is used as the data source for user feedback on + # triage agent investigations. Identified as `gemini_investigation_feedback`. + INVESTIGATION_FEEDBACK = 14 + end + + # TimeUnit supported for PAST filter operator. + module TimeUnit + # Default unspecified. + TIME_UNIT_UNSPECIFIED = 0 + + SECOND = 1 + + MINUTE = 2 + + HOUR = 3 + + DAY = 4 + + WEEK = 5 + + MONTH = 6 + + YEAR = 7 + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/proto_docs/google/cloud/chronicle/v1/featured_content_metadata.rb b/google-cloud-chronicle-v1/proto_docs/google/cloud/chronicle/v1/featured_content_metadata.rb new file mode 100644 index 000000000000..278cfefa1bc0 --- /dev/null +++ b/google-cloud-chronicle-v1/proto_docs/google/cloud/chronicle/v1/featured_content_metadata.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Chronicle + module V1 + # FeaturedContentMetadata holds metadata about the Featured Content. + # @!attribute [rw] id + # @return [::String] + # Required. Unique identifier of the featured content. + # @!attribute [r] display_name + # @return [::String] + # Output only. The display name of the featured content. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp indicating when the item was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp indicating when the item was updated. + # @!attribute [r] author + # @return [::String] + # Output only. Content item author full name. + # @!attribute [r] certified + # @return [::Boolean] + # Output only. Determine if this content item is officially certified by + # Google or created by the community. + # @!attribute [r] description + # @return [::String] + # Output only. The description of the content item. + # @!attribute [r] categories + # @return [::Array<::String>] + # Output only. Categories the content is associated with. + # @!attribute [r] version + # @return [::String] + # Output only. Featured content version (Major.Minor.Patch). + # @!attribute [r] verified + # @return [::Boolean] + # Output only. Whether the content is verified by Google (applicable for 3rd + # party content). + # @!attribute [r] source_type + # @return [::Google::Cloud::Chronicle::V1::FeaturedContentMetadata::ContentSourceType] + # Output only. The source type of the content. + class FeaturedContentMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # ContentSourceType specifying the content source of origin + module ContentSourceType + # Unspecified content source type + CONTENT_SOURCE_TYPE_UNSPECIFIED = 0 + + # Certified Google content source type + GOOGLE = 1 + + # Community content source type + COMMUNITY = 2 + + # Partner content source type + PARTNER = 3 + end + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/proto_docs/google/cloud/chronicle/v1/featured_content_native_dashboard.rb b/google-cloud-chronicle-v1/proto_docs/google/cloud/chronicle/v1/featured_content_native_dashboard.rb new file mode 100644 index 000000000000..7086b2dc1e63 --- /dev/null +++ b/google-cloud-chronicle-v1/proto_docs/google/cloud/chronicle/v1/featured_content_native_dashboard.rb @@ -0,0 +1,141 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Chronicle + module V1 + # FeaturedContentNativeDashboard resource. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the FeaturedContentNativeDashboard. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/contentHub/featuredContentNativeDashboards/\\{featured_content_native_dashboard} + # @!attribute [r] content_metadata + # @return [::Google::Cloud::Chronicle::V1::FeaturedContentMetadata] + # Output only. Metadata about the FeaturedContentNativeDashboard. + # @!attribute [rw] dashboard_content + # @return [::Google::Cloud::Chronicle::V1::NativeDashboardWithChartsAndQueries] + # Optional. The dashboard content. + class FeaturedContentNativeDashboard + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to get a FeaturedContentNativeDashboard. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the FeaturedContentNativeDashboard to + # retrieve. Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/contentHub/featuredContentNativeDashboards/\\{featured_content_native_dashboard} + class GetFeaturedContentNativeDashboardRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to list FeaturedContentNativeDashboards. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of + # FeaturedContentNativeDashboards. Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/contentHub + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of FeaturedContentNativeDashboards to return. + # The service may return fewer than this value. If unspecified, at most 100 + # FeaturedContentNativeDashboards will be returned. The maximum value is 100; + # values above 100 will be coerced to 100. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous + # `ListFeaturedContentNativeDashboards` call. Provide this to retrieve the + # subsequent page. + # + # When paginating, all other parameters provided to + # `ListFeaturedContentNativeDashboards` must match the call that provided the + # page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter to apply to list the FeaturedContentNativeDashboards. + # + # The filter syntax follows Google Cloud syntax: https://google.aip.dev/160. + # + # Supported fields for filtering: + # + # * `name`: The resource name of the featured content. + # * `content_metadata.description`: The description of the featured + # content. + # + # When a literal value is provided without a field, it will perform a + # substring search across both `name` and `content_metadata.description`. + # + # Examples: + # + # * `"test"`: Matches featured content where either the name or description + # contains "test" as a substring. + # * `name="test"`: Matches featured content where the name contains "test". + # * `content_metadata.description="test"`: Matches featured content where + # the description contains "test". + class ListFeaturedContentNativeDashboardsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing FeaturedContentNativeDashboards. + # @!attribute [rw] featured_content_native_dashboards + # @return [::Array<::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard>] + # The list of FeaturedContentNativeDashboards. + # Ordered by name by default. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListFeaturedContentNativeDashboardsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to install a FeaturedContentNativeDashboard. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the FeaturedContentNativeDashboard to + # install. Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/contentHub/featuredContentNativeDashboards/\\{featured_content_native_dashboard} + # @!attribute [rw] featured_content_native_dashboard + # @return [::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard] + # Optional. The FeaturedContentNativeDashboard to install. + class InstallFeaturedContentNativeDashboardRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for installing a FeaturedContentNativeDashboard. + # @!attribute [rw] native_dashboard + # @return [::String] + # Optional. The resource name of the NativeDashboard created. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{native_dashboard_id} + class InstallFeaturedContentNativeDashboardResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/proto_docs/google/cloud/chronicle/v1/native_dashboard.rb b/google-cloud-chronicle-v1/proto_docs/google/cloud/chronicle/v1/native_dashboard.rb new file mode 100644 index 000000000000..da820f0b06de --- /dev/null +++ b/google-cloud-chronicle-v1/proto_docs/google/cloud/chronicle/v1/native_dashboard.rb @@ -0,0 +1,502 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Chronicle + module V1 + # Request message to export list of dashboard. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource that the dashboards to be exported belong to. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @!attribute [rw] names + # @return [::Array<::String>] + # Required. The resource names of the dashboards to export. + class ExportNativeDashboardsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for exporting a dashboard. + # @!attribute [rw] inline_destination + # @return [::Google::Cloud::Chronicle::V1::InlineDestination] + # The data for the exported dashboards included directly in the response. + class ExportNativeDashboardsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # InlineDestination for exporting a dashboard. + # @!attribute [rw] dashboards + # @return [::Array<::Google::Cloud::Chronicle::V1::NativeDashboardWithChartsAndQueries>] + # Dashboards with charts and queries. + class InlineDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # NativeDashboardWithChartsAndQueries for exporting a dashboard. + # @!attribute [rw] dashboard + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # Optional. Native dashboard. + # @!attribute [rw] dashboard_charts + # @return [::Array<::Google::Cloud::Chronicle::V1::DashboardChart>] + # Optional. Charts in the dashboard. + # @!attribute [rw] dashboard_queries + # @return [::Array<::Google::Cloud::Chronicle::V1::DashboardQuery>] + # Optional. Queries in the dashboard. + class NativeDashboardWithChartsAndQueries + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to import dashboards. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this dashboard will be created. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @!attribute [rw] source + # @return [::Google::Cloud::Chronicle::V1::ImportNativeDashboardsInlineSource] + # Required. The data will imported from this proto. + class ImportNativeDashboardsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Inline source for importing dashboards. + # @!attribute [rw] dashboards + # @return [::Array<::Google::Cloud::Chronicle::V1::NativeDashboardWithChartsAndQueries>] + # Required. Dashboards with charts and queries. + class ImportNativeDashboardsInlineSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for importing dashboards. + # @!attribute [r] results + # @return [::Array<::Google::Cloud::Chronicle::V1::ImportExportStatus>] + # Output only. Represents the status of an import operation for multiple + # dashboards. Each dashboard's import status is tracked. A status of OK + # indicates the dashboard was ready for import. Otherwise, an appropriate + # error code and message are provided. Importantly, the import process is + # all-or-nothing: if even one dashboard fails to import, the entire import + # operation is aborted, and none of the dashboards are imported. The order of + # the statuses will be the same as in the import request. + class ImportNativeDashboardsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ImportExportStatus is a wrapper for dashboard name and status. + # @!attribute [rw] dashboard + # @return [::String] + # The resource name of the dashboard if it was supplied in the request. + # @!attribute [r] status + # @return [::Google::Rpc::Status] + # Output only. Status of the import/export operation. + class ImportExportStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # NativeDashboard resource. + # @!attribute [r] name + # @return [::String] + # Output only. Name of the dashboard. + # @!attribute [rw] display_name + # @return [::String] + # Required. Dashboard display name/title visible to users. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the dashboard. + # @!attribute [rw] definition + # @return [::Google::Cloud::Chronicle::V1::DashboardDefinition] + # Optional. Definition of the dashboard like metadata, visualization and + # datasource configuration etc. + # @!attribute [r] type + # @return [::Google::Cloud::Chronicle::V1::DashboardType] + # Output only. Whether it's an out of the box or custom created dashboard. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time of dashboard. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time the dashboard was last edited. + # @!attribute [r] create_user_id + # @return [::String] + # Output only. User who created the dashboard. + # @!attribute [r] update_user_id + # @return [::String] + # Output only. User who last edited the dashboard. + # @!attribute [r] dashboard_user_data + # @return [::Google::Cloud::Chronicle::V1::DashboardUserData] + # Output only. User Preferences for a dashboard + # @!attribute [rw] etag + # @return [::String] + # Optional. This checksum is computed by the server based on the value of + # other fields, and may be sent on update and delete requests to ensure the + # client has an up-to-date value before proceeding. + # @!attribute [r] access + # @return [::Google::Cloud::Chronicle::V1::DashboardAccess] + # Output only. Access of the dashboard + class NativeDashboard + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to create a dashboard. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this dashboard will be created. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @!attribute [rw] native_dashboard + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # Required. The dashboard to create. + class CreateNativeDashboardRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to get a dashboard. + # @!attribute [rw] name + # @return [::String] + # Required. The dashboard name to fetch. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @!attribute [rw] view + # @return [::Google::Cloud::Chronicle::V1::NativeDashboardView] + # Optional. View indicates the scope of fields to populate when returning the + # dashboard resource. If unspecified, defaults to the basic view. + class GetNativeDashboardRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to list dashboards. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent owning this dashboard collection. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of dashboards to return. The service may + # return fewer than this value. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous `ListDashboards` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListDashboards` must + # match the call that provided the page token. + # @!attribute [rw] view + # @return [::Google::Cloud::Chronicle::V1::NativeDashboardView] + # Optional. View indicates the scope of fields to populate when returning the + # dashboard resource. If unspecified, defaults to the basic view. + class ListNativeDashboardsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing dashboards. + # @!attribute [rw] native_dashboards + # @return [::Array<::Google::Cloud::Chronicle::V1::NativeDashboard>] + # The dashboards from the specified chronicle instance. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListNativeDashboardsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to update a dashboard. + # @!attribute [rw] native_dashboard + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # Required. The dashboard to update. + # + # The dashboard's `name` field is used to identify the dashboard to update. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. LINT.IfChange(update_mask_values) + # The list of fields to update. + # Supported paths are - + # display_name + # description + # definition.filters + # definition.charts + # type + # access + # dashboard_user_data.is_pinned + class UpdateNativeDashboardRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to duplicate a dashboard. + # @!attribute [rw] name + # @return [::String] + # Required. The dashboard name to duplicate. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @!attribute [rw] native_dashboard + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # Required. Any fields that need modification can be passed through this like + # name, description etc. + class DuplicateNativeDashboardRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to delete a dashboard. + # @!attribute [rw] name + # @return [::String] + # Required. The dashboard name to delete. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + class DeleteNativeDashboardRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to add chart in a dashboard. + # @!attribute [rw] name + # @return [::String] + # Required. The dashboard name to add chart in. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @!attribute [rw] dashboard_query + # @return [::Google::Cloud::Chronicle::V1::DashboardQuery] + # Optional. Query used to create the chart. + # @!attribute [rw] dashboard_chart + # @return [::Google::Cloud::Chronicle::V1::DashboardChart] + # Required. Chart to be added to the dashboard. + # @!attribute [rw] chart_layout + # @return [::Google::Cloud::Chronicle::V1::DashboardDefinition::ChartConfig::ChartLayout] + # Required. ChartLayout for newly added chart. + class AddChartRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for adding chart in a dashboard. + # @!attribute [rw] native_dashboard + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # Dashboard with chart added in definition. + # @!attribute [rw] dashboard_chart + # @return [::Google::Cloud::Chronicle::V1::DashboardChart] + # Created chart resource. + class AddChartResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to edit chart in a dashboard. + # @!attribute [rw] name + # @return [::String] + # Required. The dashboard name to edit chart in. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @!attribute [rw] dashboard_query + # @return [::Google::Cloud::Chronicle::V1::DashboardQuery] + # Optional. Query for the edited chart. + # @!attribute [rw] dashboard_chart + # @return [::Google::Cloud::Chronicle::V1::DashboardChart] + # Optional. Edited chart. + # @!attribute [rw] edit_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The list of fields to edit for chart and query. + # Supported paths in chart are - + # dashboard_chart.display_name + # dashboard_chart.description + # dashboard_chart.chart_datasource.data_sources + # dashboard_chart.visualization + # dashboard_chart.visualization.button + # dashboard_chart.visualization.markdown + # dashboard_chart.drill_down_config + # Supported paths in query are - + # dashboard_query.query + # dashboard_query.input + # @!attribute [rw] language_features + # @return [::Array<::Google::Cloud::Chronicle::V1::LanguageFeature>] + # Optional. Language Features present in the query. + class EditChartRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for editing chart in a dashboard. + # @!attribute [rw] native_dashboard + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # Edited dashboard. + # @!attribute [rw] dashboard_chart + # @return [::Google::Cloud::Chronicle::V1::DashboardChart] + # Edited chart resource. + class EditChartResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to remove chart from a dashboard. + # @!attribute [rw] name + # @return [::String] + # Required. The dashboard name to remove chart from. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @!attribute [rw] dashboard_chart + # @return [::String] + # Required. The dashboard chart name to remove. + class RemoveChartRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to duplicate chart in a dashboard. + # @!attribute [rw] name + # @return [::String] + # Required. The dashboard name that involves chart duplication. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/nativeDashboards/\\{dashboard} + # @!attribute [rw] dashboard_chart + # @return [::String] + # Required. The dashboard chart name to duplicate. + class DuplicateChartRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for duplicating chart in a dashboard. + # @!attribute [rw] native_dashboard + # @return [::Google::Cloud::Chronicle::V1::NativeDashboard] + # Dashboard with chart added in definition. + # @!attribute [rw] dashboard_chart + # @return [::Google::Cloud::Chronicle::V1::DashboardChart] + # Duplicated chart resource. + class DuplicateChartResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # User Data for Native Dashboard + # @!attribute [rw] last_viewed_time + # @return [::Google::Protobuf::Timestamp] + # time when this dashboard is last viewed + # @!attribute [rw] is_pinned + # @return [::Boolean] + # is dashboard pinned by user + class DashboardUserData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Definition of the dashboard including filters, layout, charts' + # configurations. + # @!attribute [rw] filters + # @return [::Array<::Google::Cloud::Chronicle::V1::DashboardFilter>] + # Filters for the dashboard. + # @!attribute [rw] fingerprint + # @return [::String] + # Fingerprint of the dashboard definition. + # @!attribute [rw] charts + # @return [::Array<::Google::Cloud::Chronicle::V1::DashboardDefinition::ChartConfig>] + # Charts in the dashboard. + class DashboardDefinition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration of the chart including chart reference, layout and filters. + # @!attribute [r] dashboard_chart + # @return [::String] + # @!attribute [rw] chart_layout + # @return [::Google::Cloud::Chronicle::V1::DashboardDefinition::ChartConfig::ChartLayout] + # @!attribute [rw] filters_ids + # @return [::Array<::String>] + # Dashboard filters applied to the chart. + class ChartConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Layout of the chart. + # @!attribute [rw] start_x + # @return [::Integer] + # @!attribute [rw] span_x + # @return [::Integer] + # @!attribute [rw] start_y + # @return [::Integer] + # @!attribute [rw] span_y + # @return [::Integer] + class ChartLayout + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Type of the dashboard. + module DashboardType + # Default unspecified. + DASHBOARD_TYPE_UNSPECIFIED = 0 + + # Out of the box curated dashboards provided by Chronicle. + CURATED = 1 + + # Private dashboards created by users/customers. + PRIVATE = 2 + + # Public dashboards created by users/customers. + PUBLIC = 3 + + # Custom dashboards + CUSTOM = 4 + + # Marketplace dashboards + MARKETPLACE = 5 + end + + # AccessType of the dashboard. + module DashboardAccess + # Default unspecified. + DASHBOARD_ACCESS_UNSPECIFIED = 0 + + # Private dashboards created by users/customers. + DASHBOARD_PRIVATE = 1 + + # Public dashboards created by users/customers. + DASHBOARD_PUBLIC = 2 + end + + # NativeDashboardView indicates the scope of fields to populate when returning + # the dashboard resource. + module NativeDashboardView + # Defaults to basic. + NATIVE_DASHBOARD_VIEW_UNSPECIFIED = 0 + + # Include basic metadata about the dashboard without full definition. + NATIVE_DASHBOARD_VIEW_BASIC = 1 + + # Include everything. + NATIVE_DASHBOARD_VIEW_FULL = 2 + end + end + end + end +end diff --git a/google-cloud-chronicle-v1/proto_docs/google/type/date.rb b/google-cloud-chronicle-v1/proto_docs/google/type/date.rb new file mode 100644 index 000000000000..a52275cebf89 --- /dev/null +++ b/google-cloud-chronicle-v1/proto_docs/google/type/date.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a whole or partial calendar date, such as a birthday. The time of + # day and time zone are either specified elsewhere or are insignificant. The + # date is relative to the Gregorian Calendar. This can represent one of the + # following: + # + # * A full date, with non-zero year, month, and day values. + # * A month and day, with a zero year (for example, an anniversary). + # * A year on its own, with a zero month and a zero day. + # * A year and month, with a zero day (for example, a credit card expiration + # date). + # + # Related types: + # + # * [google.type.TimeOfDay][google.type.TimeOfDay] + # * [google.type.DateTime][google.type.DateTime] + # * {::Google::Protobuf::Timestamp google.protobuf.Timestamp} + # @!attribute [rw] year + # @return [::Integer] + # Year of the date. Must be from 1 to 9999, or 0 to specify a date without + # a year. + # @!attribute [rw] month + # @return [::Integer] + # Month of a year. Must be from 1 to 12, or 0 to specify a year without a + # month and day. + # @!attribute [rw] day + # @return [::Integer] + # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 + # to specify a year by itself or a year and month where the day isn't + # significant. + class Date + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-chronicle-v1/snippets/big_query_export_service/get_big_query_export.rb b/google-cloud-chronicle-v1/snippets/big_query_export_service/get_big_query_export.rb new file mode 100644 index 000000000000..9071532a425c --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/big_query_export_service/get_big_query_export.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_BigQueryExportService_GetBigQueryExport_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the get_big_query_export call in the BigQueryExportService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::BigQueryExportService::Client#get_big_query_export. +# +def get_big_query_export + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::BigQueryExportService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::GetBigQueryExportRequest.new + + # Call the get_big_query_export method. + result = client.get_big_query_export request + + # The returned object is of type Google::Cloud::Chronicle::V1::BigQueryExport. + p result +end +# [END chronicle_v1_generated_BigQueryExportService_GetBigQueryExport_sync] diff --git a/google-cloud-chronicle-v1/snippets/big_query_export_service/provision_big_query_export.rb b/google-cloud-chronicle-v1/snippets/big_query_export_service/provision_big_query_export.rb new file mode 100644 index 000000000000..cea45bf0a4de --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/big_query_export_service/provision_big_query_export.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_BigQueryExportService_ProvisionBigQueryExport_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the provision_big_query_export call in the BigQueryExportService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::BigQueryExportService::Client#provision_big_query_export. +# +def provision_big_query_export + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::BigQueryExportService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::ProvisionBigQueryExportRequest.new + + # Call the provision_big_query_export method. + result = client.provision_big_query_export request + + # The returned object is of type Google::Cloud::Chronicle::V1::BigQueryExport. + p result +end +# [END chronicle_v1_generated_BigQueryExportService_ProvisionBigQueryExport_sync] diff --git a/google-cloud-chronicle-v1/snippets/big_query_export_service/update_big_query_export.rb b/google-cloud-chronicle-v1/snippets/big_query_export_service/update_big_query_export.rb new file mode 100644 index 000000000000..86c1956bbe9a --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/big_query_export_service/update_big_query_export.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_BigQueryExportService_UpdateBigQueryExport_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the update_big_query_export call in the BigQueryExportService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::BigQueryExportService::Client#update_big_query_export. +# +def update_big_query_export + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::BigQueryExportService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::UpdateBigQueryExportRequest.new + + # Call the update_big_query_export method. + result = client.update_big_query_export request + + # The returned object is of type Google::Cloud::Chronicle::V1::BigQueryExport. + p result +end +# [END chronicle_v1_generated_BigQueryExportService_UpdateBigQueryExport_sync] diff --git a/google-cloud-chronicle-v1/snippets/dashboard_chart_service/batch_get_dashboard_charts.rb b/google-cloud-chronicle-v1/snippets/dashboard_chart_service/batch_get_dashboard_charts.rb new file mode 100644 index 000000000000..b946884ee81c --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/dashboard_chart_service/batch_get_dashboard_charts.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_DashboardChartService_BatchGetDashboardCharts_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the batch_get_dashboard_charts call in the DashboardChartService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::DashboardChartService::Client#batch_get_dashboard_charts. +# +def batch_get_dashboard_charts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::DashboardChartService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest.new + + # Call the batch_get_dashboard_charts method. + result = client.batch_get_dashboard_charts request + + # The returned object is of type Google::Cloud::Chronicle::V1::BatchGetDashboardChartsResponse. + p result +end +# [END chronicle_v1_generated_DashboardChartService_BatchGetDashboardCharts_sync] diff --git a/google-cloud-chronicle-v1/snippets/dashboard_chart_service/get_dashboard_chart.rb b/google-cloud-chronicle-v1/snippets/dashboard_chart_service/get_dashboard_chart.rb new file mode 100644 index 000000000000..f2cf1b752bfe --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/dashboard_chart_service/get_dashboard_chart.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_DashboardChartService_GetDashboardChart_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the get_dashboard_chart call in the DashboardChartService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::DashboardChartService::Client#get_dashboard_chart. +# +def get_dashboard_chart + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::DashboardChartService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::GetDashboardChartRequest.new + + # Call the get_dashboard_chart method. + result = client.get_dashboard_chart request + + # The returned object is of type Google::Cloud::Chronicle::V1::DashboardChart. + p result +end +# [END chronicle_v1_generated_DashboardChartService_GetDashboardChart_sync] diff --git a/google-cloud-chronicle-v1/snippets/dashboard_query_service/execute_dashboard_query.rb b/google-cloud-chronicle-v1/snippets/dashboard_query_service/execute_dashboard_query.rb new file mode 100644 index 000000000000..c13ee1ca8e7d --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/dashboard_query_service/execute_dashboard_query.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_DashboardQueryService_ExecuteDashboardQuery_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the execute_dashboard_query call in the DashboardQueryService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::DashboardQueryService::Client#execute_dashboard_query. +# +def execute_dashboard_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest.new + + # Call the execute_dashboard_query method. + result = client.execute_dashboard_query request + + # The returned object is of type Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse. + p result +end +# [END chronicle_v1_generated_DashboardQueryService_ExecuteDashboardQuery_sync] diff --git a/google-cloud-chronicle-v1/snippets/dashboard_query_service/get_dashboard_query.rb b/google-cloud-chronicle-v1/snippets/dashboard_query_service/get_dashboard_query.rb new file mode 100644 index 000000000000..67a0b2143915 --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/dashboard_query_service/get_dashboard_query.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_DashboardQueryService_GetDashboardQuery_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the get_dashboard_query call in the DashboardQueryService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::DashboardQueryService::Client#get_dashboard_query. +# +def get_dashboard_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::GetDashboardQueryRequest.new + + # Call the get_dashboard_query method. + result = client.get_dashboard_query request + + # The returned object is of type Google::Cloud::Chronicle::V1::DashboardQuery. + p result +end +# [END chronicle_v1_generated_DashboardQueryService_GetDashboardQuery_sync] diff --git a/google-cloud-chronicle-v1/snippets/featured_content_native_dashboard_service/get_featured_content_native_dashboard.rb b/google-cloud-chronicle-v1/snippets/featured_content_native_dashboard_service/get_featured_content_native_dashboard.rb new file mode 100644 index 000000000000..6b0caad0a1c5 --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/featured_content_native_dashboard_service/get_featured_content_native_dashboard.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_FeaturedContentNativeDashboardService_GetFeaturedContentNativeDashboard_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the get_featured_content_native_dashboard call in the FeaturedContentNativeDashboardService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client#get_featured_content_native_dashboard. +# +def get_featured_content_native_dashboard + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::GetFeaturedContentNativeDashboardRequest.new + + # Call the get_featured_content_native_dashboard method. + result = client.get_featured_content_native_dashboard request + + # The returned object is of type Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard. + p result +end +# [END chronicle_v1_generated_FeaturedContentNativeDashboardService_GetFeaturedContentNativeDashboard_sync] diff --git a/google-cloud-chronicle-v1/snippets/featured_content_native_dashboard_service/install_featured_content_native_dashboard.rb b/google-cloud-chronicle-v1/snippets/featured_content_native_dashboard_service/install_featured_content_native_dashboard.rb new file mode 100644 index 000000000000..4af32dbf10f9 --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/featured_content_native_dashboard_service/install_featured_content_native_dashboard.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_FeaturedContentNativeDashboardService_InstallFeaturedContentNativeDashboard_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the install_featured_content_native_dashboard call in the FeaturedContentNativeDashboardService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client#install_featured_content_native_dashboard. +# +def install_featured_content_native_dashboard + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardRequest.new + + # Call the install_featured_content_native_dashboard method. + result = client.install_featured_content_native_dashboard request + + # The returned object is of type Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardResponse. + p result +end +# [END chronicle_v1_generated_FeaturedContentNativeDashboardService_InstallFeaturedContentNativeDashboard_sync] diff --git a/google-cloud-chronicle-v1/snippets/featured_content_native_dashboard_service/list_featured_content_native_dashboards.rb b/google-cloud-chronicle-v1/snippets/featured_content_native_dashboard_service/list_featured_content_native_dashboards.rb new file mode 100644 index 000000000000..85c26982e0a0 --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/featured_content_native_dashboard_service/list_featured_content_native_dashboards.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_FeaturedContentNativeDashboardService_ListFeaturedContentNativeDashboards_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the list_featured_content_native_dashboards call in the FeaturedContentNativeDashboardService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client#list_featured_content_native_dashboards. +# +def list_featured_content_native_dashboards + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsRequest.new + + # Call the list_featured_content_native_dashboards method. + result = client.list_featured_content_native_dashboards request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard. + p item + end +end +# [END chronicle_v1_generated_FeaturedContentNativeDashboardService_ListFeaturedContentNativeDashboards_sync] diff --git a/google-cloud-chronicle-v1/snippets/native_dashboard_service/add_chart.rb b/google-cloud-chronicle-v1/snippets/native_dashboard_service/add_chart.rb new file mode 100644 index 000000000000..0e419e2bf8ef --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/native_dashboard_service/add_chart.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_NativeDashboardService_AddChart_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the add_chart call in the NativeDashboardService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::NativeDashboardService::Client#add_chart. +# +def add_chart + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::AddChartRequest.new + + # Call the add_chart method. + result = client.add_chart request + + # The returned object is of type Google::Cloud::Chronicle::V1::AddChartResponse. + p result +end +# [END chronicle_v1_generated_NativeDashboardService_AddChart_sync] diff --git a/google-cloud-chronicle-v1/snippets/native_dashboard_service/create_native_dashboard.rb b/google-cloud-chronicle-v1/snippets/native_dashboard_service/create_native_dashboard.rb new file mode 100644 index 000000000000..9c417af9d3bf --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/native_dashboard_service/create_native_dashboard.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_NativeDashboardService_CreateNativeDashboard_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the create_native_dashboard call in the NativeDashboardService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::NativeDashboardService::Client#create_native_dashboard. +# +def create_native_dashboard + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::CreateNativeDashboardRequest.new + + # Call the create_native_dashboard method. + result = client.create_native_dashboard request + + # The returned object is of type Google::Cloud::Chronicle::V1::NativeDashboard. + p result +end +# [END chronicle_v1_generated_NativeDashboardService_CreateNativeDashboard_sync] diff --git a/google-cloud-chronicle-v1/snippets/native_dashboard_service/delete_native_dashboard.rb b/google-cloud-chronicle-v1/snippets/native_dashboard_service/delete_native_dashboard.rb new file mode 100644 index 000000000000..18b1e963382b --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/native_dashboard_service/delete_native_dashboard.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_NativeDashboardService_DeleteNativeDashboard_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the delete_native_dashboard call in the NativeDashboardService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::NativeDashboardService::Client#delete_native_dashboard. +# +def delete_native_dashboard + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::DeleteNativeDashboardRequest.new + + # Call the delete_native_dashboard method. + result = client.delete_native_dashboard request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END chronicle_v1_generated_NativeDashboardService_DeleteNativeDashboard_sync] diff --git a/google-cloud-chronicle-v1/snippets/native_dashboard_service/duplicate_chart.rb b/google-cloud-chronicle-v1/snippets/native_dashboard_service/duplicate_chart.rb new file mode 100644 index 000000000000..0c5d87a4034e --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/native_dashboard_service/duplicate_chart.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_NativeDashboardService_DuplicateChart_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the duplicate_chart call in the NativeDashboardService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::NativeDashboardService::Client#duplicate_chart. +# +def duplicate_chart + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::DuplicateChartRequest.new + + # Call the duplicate_chart method. + result = client.duplicate_chart request + + # The returned object is of type Google::Cloud::Chronicle::V1::DuplicateChartResponse. + p result +end +# [END chronicle_v1_generated_NativeDashboardService_DuplicateChart_sync] diff --git a/google-cloud-chronicle-v1/snippets/native_dashboard_service/duplicate_native_dashboard.rb b/google-cloud-chronicle-v1/snippets/native_dashboard_service/duplicate_native_dashboard.rb new file mode 100644 index 000000000000..f93d74d1ef9b --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/native_dashboard_service/duplicate_native_dashboard.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_NativeDashboardService_DuplicateNativeDashboard_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the duplicate_native_dashboard call in the NativeDashboardService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::NativeDashboardService::Client#duplicate_native_dashboard. +# +def duplicate_native_dashboard + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::DuplicateNativeDashboardRequest.new + + # Call the duplicate_native_dashboard method. + result = client.duplicate_native_dashboard request + + # The returned object is of type Google::Cloud::Chronicle::V1::NativeDashboard. + p result +end +# [END chronicle_v1_generated_NativeDashboardService_DuplicateNativeDashboard_sync] diff --git a/google-cloud-chronicle-v1/snippets/native_dashboard_service/edit_chart.rb b/google-cloud-chronicle-v1/snippets/native_dashboard_service/edit_chart.rb new file mode 100644 index 000000000000..e8371b33f150 --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/native_dashboard_service/edit_chart.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_NativeDashboardService_EditChart_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the edit_chart call in the NativeDashboardService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::NativeDashboardService::Client#edit_chart. +# +def edit_chart + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::EditChartRequest.new + + # Call the edit_chart method. + result = client.edit_chart request + + # The returned object is of type Google::Cloud::Chronicle::V1::EditChartResponse. + p result +end +# [END chronicle_v1_generated_NativeDashboardService_EditChart_sync] diff --git a/google-cloud-chronicle-v1/snippets/native_dashboard_service/export_native_dashboards.rb b/google-cloud-chronicle-v1/snippets/native_dashboard_service/export_native_dashboards.rb new file mode 100644 index 000000000000..3f6651321533 --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/native_dashboard_service/export_native_dashboards.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_NativeDashboardService_ExportNativeDashboards_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the export_native_dashboards call in the NativeDashboardService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::NativeDashboardService::Client#export_native_dashboards. +# +def export_native_dashboards + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::ExportNativeDashboardsRequest.new + + # Call the export_native_dashboards method. + result = client.export_native_dashboards request + + # The returned object is of type Google::Cloud::Chronicle::V1::ExportNativeDashboardsResponse. + p result +end +# [END chronicle_v1_generated_NativeDashboardService_ExportNativeDashboards_sync] diff --git a/google-cloud-chronicle-v1/snippets/native_dashboard_service/get_native_dashboard.rb b/google-cloud-chronicle-v1/snippets/native_dashboard_service/get_native_dashboard.rb new file mode 100644 index 000000000000..21ece4372e52 --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/native_dashboard_service/get_native_dashboard.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_NativeDashboardService_GetNativeDashboard_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the get_native_dashboard call in the NativeDashboardService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::NativeDashboardService::Client#get_native_dashboard. +# +def get_native_dashboard + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::GetNativeDashboardRequest.new + + # Call the get_native_dashboard method. + result = client.get_native_dashboard request + + # The returned object is of type Google::Cloud::Chronicle::V1::NativeDashboard. + p result +end +# [END chronicle_v1_generated_NativeDashboardService_GetNativeDashboard_sync] diff --git a/google-cloud-chronicle-v1/snippets/native_dashboard_service/import_native_dashboards.rb b/google-cloud-chronicle-v1/snippets/native_dashboard_service/import_native_dashboards.rb new file mode 100644 index 000000000000..bd4953102a2b --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/native_dashboard_service/import_native_dashboards.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_NativeDashboardService_ImportNativeDashboards_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the import_native_dashboards call in the NativeDashboardService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::NativeDashboardService::Client#import_native_dashboards. +# +def import_native_dashboards + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::ImportNativeDashboardsRequest.new + + # Call the import_native_dashboards method. + result = client.import_native_dashboards request + + # The returned object is of type Google::Cloud::Chronicle::V1::ImportNativeDashboardsResponse. + p result +end +# [END chronicle_v1_generated_NativeDashboardService_ImportNativeDashboards_sync] diff --git a/google-cloud-chronicle-v1/snippets/native_dashboard_service/list_native_dashboards.rb b/google-cloud-chronicle-v1/snippets/native_dashboard_service/list_native_dashboards.rb new file mode 100644 index 000000000000..7835cddbae64 --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/native_dashboard_service/list_native_dashboards.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_NativeDashboardService_ListNativeDashboards_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the list_native_dashboards call in the NativeDashboardService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::NativeDashboardService::Client#list_native_dashboards. +# +def list_native_dashboards + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::ListNativeDashboardsRequest.new + + # Call the list_native_dashboards method. + result = client.list_native_dashboards request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Chronicle::V1::NativeDashboard. + p item + end +end +# [END chronicle_v1_generated_NativeDashboardService_ListNativeDashboards_sync] diff --git a/google-cloud-chronicle-v1/snippets/native_dashboard_service/remove_chart.rb b/google-cloud-chronicle-v1/snippets/native_dashboard_service/remove_chart.rb new file mode 100644 index 000000000000..23318b075f45 --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/native_dashboard_service/remove_chart.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_NativeDashboardService_RemoveChart_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the remove_chart call in the NativeDashboardService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::NativeDashboardService::Client#remove_chart. +# +def remove_chart + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::RemoveChartRequest.new + + # Call the remove_chart method. + result = client.remove_chart request + + # The returned object is of type Google::Cloud::Chronicle::V1::NativeDashboard. + p result +end +# [END chronicle_v1_generated_NativeDashboardService_RemoveChart_sync] diff --git a/google-cloud-chronicle-v1/snippets/native_dashboard_service/update_native_dashboard.rb b/google-cloud-chronicle-v1/snippets/native_dashboard_service/update_native_dashboard.rb new file mode 100644 index 000000000000..883df5cbae10 --- /dev/null +++ b/google-cloud-chronicle-v1/snippets/native_dashboard_service/update_native_dashboard.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chronicle_v1_generated_NativeDashboardService_UpdateNativeDashboard_sync] +require "google/cloud/chronicle/v1" + +## +# Snippet for the update_native_dashboard call in the NativeDashboardService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Chronicle::V1::NativeDashboardService::Client#update_native_dashboard. +# +def update_native_dashboard + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Chronicle::V1::UpdateNativeDashboardRequest.new + + # Call the update_native_dashboard method. + result = client.update_native_dashboard request + + # The returned object is of type Google::Cloud::Chronicle::V1::NativeDashboard. + p result +end +# [END chronicle_v1_generated_NativeDashboardService_UpdateNativeDashboard_sync] diff --git a/google-cloud-chronicle-v1/snippets/snippet_metadata_google.cloud.chronicle.v1.json b/google-cloud-chronicle-v1/snippets/snippet_metadata_google.cloud.chronicle.v1.json index 4053fa787a07..343b766d38d1 100644 --- a/google-cloud-chronicle-v1/snippets/snippet_metadata_google.cloud.chronicle.v1.json +++ b/google-cloud-chronicle-v1/snippets/snippet_metadata_google.cloud.chronicle.v1.json @@ -11,6 +11,286 @@ ] }, "snippets": [ + { + "region_tag": "chronicle_v1_generated_BigQueryExportService_GetBigQueryExport_sync", + "title": "Snippet for the get_big_query_export call in the BigQueryExportService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::BigQueryExportService::Client#get_big_query_export.", + "file": "big_query_export_service/get_big_query_export.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_big_query_export", + "full_name": "::Google::Cloud::Chronicle::V1::BigQueryExportService::Client#get_big_query_export", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::GetBigQueryExportRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Chronicle::V1::BigQueryExport", + "client": { + "short_name": "BigQueryExportService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::BigQueryExportService::Client" + }, + "method": { + "short_name": "GetBigQueryExport", + "full_name": "google.cloud.chronicle.v1.BigQueryExportService.GetBigQueryExport", + "service": { + "short_name": "BigQueryExportService", + "full_name": "google.cloud.chronicle.v1.BigQueryExportService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chronicle_v1_generated_BigQueryExportService_UpdateBigQueryExport_sync", + "title": "Snippet for the update_big_query_export call in the BigQueryExportService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::BigQueryExportService::Client#update_big_query_export.", + "file": "big_query_export_service/update_big_query_export.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_big_query_export", + "full_name": "::Google::Cloud::Chronicle::V1::BigQueryExportService::Client#update_big_query_export", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::UpdateBigQueryExportRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Chronicle::V1::BigQueryExport", + "client": { + "short_name": "BigQueryExportService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::BigQueryExportService::Client" + }, + "method": { + "short_name": "UpdateBigQueryExport", + "full_name": "google.cloud.chronicle.v1.BigQueryExportService.UpdateBigQueryExport", + "service": { + "short_name": "BigQueryExportService", + "full_name": "google.cloud.chronicle.v1.BigQueryExportService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chronicle_v1_generated_BigQueryExportService_ProvisionBigQueryExport_sync", + "title": "Snippet for the provision_big_query_export call in the BigQueryExportService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::BigQueryExportService::Client#provision_big_query_export.", + "file": "big_query_export_service/provision_big_query_export.rb", + "language": "RUBY", + "client_method": { + "short_name": "provision_big_query_export", + "full_name": "::Google::Cloud::Chronicle::V1::BigQueryExportService::Client#provision_big_query_export", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::ProvisionBigQueryExportRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Chronicle::V1::BigQueryExport", + "client": { + "short_name": "BigQueryExportService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::BigQueryExportService::Client" + }, + "method": { + "short_name": "ProvisionBigQueryExport", + "full_name": "google.cloud.chronicle.v1.BigQueryExportService.ProvisionBigQueryExport", + "service": { + "short_name": "BigQueryExportService", + "full_name": "google.cloud.chronicle.v1.BigQueryExportService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chronicle_v1_generated_DashboardQueryService_GetDashboardQuery_sync", + "title": "Snippet for the get_dashboard_query call in the DashboardQueryService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::DashboardQueryService::Client#get_dashboard_query.", + "file": "dashboard_query_service/get_dashboard_query.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_dashboard_query", + "full_name": "::Google::Cloud::Chronicle::V1::DashboardQueryService::Client#get_dashboard_query", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::GetDashboardQueryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Chronicle::V1::DashboardQuery", + "client": { + "short_name": "DashboardQueryService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::DashboardQueryService::Client" + }, + "method": { + "short_name": "GetDashboardQuery", + "full_name": "google.cloud.chronicle.v1.DashboardQueryService.GetDashboardQuery", + "service": { + "short_name": "DashboardQueryService", + "full_name": "google.cloud.chronicle.v1.DashboardQueryService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chronicle_v1_generated_DashboardQueryService_ExecuteDashboardQuery_sync", + "title": "Snippet for the execute_dashboard_query call in the DashboardQueryService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::DashboardQueryService::Client#execute_dashboard_query.", + "file": "dashboard_query_service/execute_dashboard_query.rb", + "language": "RUBY", + "client_method": { + "short_name": "execute_dashboard_query", + "full_name": "::Google::Cloud::Chronicle::V1::DashboardQueryService::Client#execute_dashboard_query", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse", + "client": { + "short_name": "DashboardQueryService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::DashboardQueryService::Client" + }, + "method": { + "short_name": "ExecuteDashboardQuery", + "full_name": "google.cloud.chronicle.v1.DashboardQueryService.ExecuteDashboardQuery", + "service": { + "short_name": "DashboardQueryService", + "full_name": "google.cloud.chronicle.v1.DashboardQueryService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chronicle_v1_generated_DashboardChartService_GetDashboardChart_sync", + "title": "Snippet for the get_dashboard_chart call in the DashboardChartService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::DashboardChartService::Client#get_dashboard_chart.", + "file": "dashboard_chart_service/get_dashboard_chart.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_dashboard_chart", + "full_name": "::Google::Cloud::Chronicle::V1::DashboardChartService::Client#get_dashboard_chart", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::GetDashboardChartRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Chronicle::V1::DashboardChart", + "client": { + "short_name": "DashboardChartService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::DashboardChartService::Client" + }, + "method": { + "short_name": "GetDashboardChart", + "full_name": "google.cloud.chronicle.v1.DashboardChartService.GetDashboardChart", + "service": { + "short_name": "DashboardChartService", + "full_name": "google.cloud.chronicle.v1.DashboardChartService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chronicle_v1_generated_DashboardChartService_BatchGetDashboardCharts_sync", + "title": "Snippet for the batch_get_dashboard_charts call in the DashboardChartService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::DashboardChartService::Client#batch_get_dashboard_charts.", + "file": "dashboard_chart_service/batch_get_dashboard_charts.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_get_dashboard_charts", + "full_name": "::Google::Cloud::Chronicle::V1::DashboardChartService::Client#batch_get_dashboard_charts", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsResponse", + "client": { + "short_name": "DashboardChartService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::DashboardChartService::Client" + }, + "method": { + "short_name": "BatchGetDashboardCharts", + "full_name": "google.cloud.chronicle.v1.DashboardChartService.BatchGetDashboardCharts", + "service": { + "short_name": "DashboardChartService", + "full_name": "google.cloud.chronicle.v1.DashboardChartService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, { "region_tag": "chronicle_v1_generated_DataAccessControlService_CreateDataAccessLabel_sync", "title": "Snippet for the create_data_access_label call in the DataAccessControlService service", @@ -1211,6 +1491,606 @@ } ] }, + { + "region_tag": "chronicle_v1_generated_NativeDashboardService_CreateNativeDashboard_sync", + "title": "Snippet for the create_native_dashboard call in the NativeDashboardService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::NativeDashboardService::Client#create_native_dashboard.", + "file": "native_dashboard_service/create_native_dashboard.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_native_dashboard", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client#create_native_dashboard", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::CreateNativeDashboardRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Chronicle::V1::NativeDashboard", + "client": { + "short_name": "NativeDashboardService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client" + }, + "method": { + "short_name": "CreateNativeDashboard", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService.CreateNativeDashboard", + "service": { + "short_name": "NativeDashboardService", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chronicle_v1_generated_NativeDashboardService_GetNativeDashboard_sync", + "title": "Snippet for the get_native_dashboard call in the NativeDashboardService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::NativeDashboardService::Client#get_native_dashboard.", + "file": "native_dashboard_service/get_native_dashboard.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_native_dashboard", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client#get_native_dashboard", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::GetNativeDashboardRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Chronicle::V1::NativeDashboard", + "client": { + "short_name": "NativeDashboardService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client" + }, + "method": { + "short_name": "GetNativeDashboard", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService.GetNativeDashboard", + "service": { + "short_name": "NativeDashboardService", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chronicle_v1_generated_NativeDashboardService_ListNativeDashboards_sync", + "title": "Snippet for the list_native_dashboards call in the NativeDashboardService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::NativeDashboardService::Client#list_native_dashboards.", + "file": "native_dashboard_service/list_native_dashboards.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_native_dashboards", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client#list_native_dashboards", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::ListNativeDashboardsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Chronicle::V1::ListNativeDashboardsResponse", + "client": { + "short_name": "NativeDashboardService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client" + }, + "method": { + "short_name": "ListNativeDashboards", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService.ListNativeDashboards", + "service": { + "short_name": "NativeDashboardService", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "chronicle_v1_generated_NativeDashboardService_UpdateNativeDashboard_sync", + "title": "Snippet for the update_native_dashboard call in the NativeDashboardService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::NativeDashboardService::Client#update_native_dashboard.", + "file": "native_dashboard_service/update_native_dashboard.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_native_dashboard", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client#update_native_dashboard", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::UpdateNativeDashboardRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Chronicle::V1::NativeDashboard", + "client": { + "short_name": "NativeDashboardService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client" + }, + "method": { + "short_name": "UpdateNativeDashboard", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService.UpdateNativeDashboard", + "service": { + "short_name": "NativeDashboardService", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chronicle_v1_generated_NativeDashboardService_DuplicateNativeDashboard_sync", + "title": "Snippet for the duplicate_native_dashboard call in the NativeDashboardService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::NativeDashboardService::Client#duplicate_native_dashboard.", + "file": "native_dashboard_service/duplicate_native_dashboard.rb", + "language": "RUBY", + "client_method": { + "short_name": "duplicate_native_dashboard", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client#duplicate_native_dashboard", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::DuplicateNativeDashboardRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Chronicle::V1::NativeDashboard", + "client": { + "short_name": "NativeDashboardService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client" + }, + "method": { + "short_name": "DuplicateNativeDashboard", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService.DuplicateNativeDashboard", + "service": { + "short_name": "NativeDashboardService", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chronicle_v1_generated_NativeDashboardService_DeleteNativeDashboard_sync", + "title": "Snippet for the delete_native_dashboard call in the NativeDashboardService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::NativeDashboardService::Client#delete_native_dashboard.", + "file": "native_dashboard_service/delete_native_dashboard.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_native_dashboard", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client#delete_native_dashboard", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::DeleteNativeDashboardRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "NativeDashboardService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client" + }, + "method": { + "short_name": "DeleteNativeDashboard", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService.DeleteNativeDashboard", + "service": { + "short_name": "NativeDashboardService", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chronicle_v1_generated_NativeDashboardService_AddChart_sync", + "title": "Snippet for the add_chart call in the NativeDashboardService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::NativeDashboardService::Client#add_chart.", + "file": "native_dashboard_service/add_chart.rb", + "language": "RUBY", + "client_method": { + "short_name": "add_chart", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client#add_chart", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::AddChartRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Chronicle::V1::AddChartResponse", + "client": { + "short_name": "NativeDashboardService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client" + }, + "method": { + "short_name": "AddChart", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService.AddChart", + "service": { + "short_name": "NativeDashboardService", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chronicle_v1_generated_NativeDashboardService_RemoveChart_sync", + "title": "Snippet for the remove_chart call in the NativeDashboardService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::NativeDashboardService::Client#remove_chart.", + "file": "native_dashboard_service/remove_chart.rb", + "language": "RUBY", + "client_method": { + "short_name": "remove_chart", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client#remove_chart", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::RemoveChartRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Chronicle::V1::NativeDashboard", + "client": { + "short_name": "NativeDashboardService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client" + }, + "method": { + "short_name": "RemoveChart", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService.RemoveChart", + "service": { + "short_name": "NativeDashboardService", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chronicle_v1_generated_NativeDashboardService_EditChart_sync", + "title": "Snippet for the edit_chart call in the NativeDashboardService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::NativeDashboardService::Client#edit_chart.", + "file": "native_dashboard_service/edit_chart.rb", + "language": "RUBY", + "client_method": { + "short_name": "edit_chart", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client#edit_chart", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::EditChartRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Chronicle::V1::EditChartResponse", + "client": { + "short_name": "NativeDashboardService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client" + }, + "method": { + "short_name": "EditChart", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService.EditChart", + "service": { + "short_name": "NativeDashboardService", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chronicle_v1_generated_NativeDashboardService_DuplicateChart_sync", + "title": "Snippet for the duplicate_chart call in the NativeDashboardService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::NativeDashboardService::Client#duplicate_chart.", + "file": "native_dashboard_service/duplicate_chart.rb", + "language": "RUBY", + "client_method": { + "short_name": "duplicate_chart", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client#duplicate_chart", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::DuplicateChartRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Chronicle::V1::DuplicateChartResponse", + "client": { + "short_name": "NativeDashboardService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client" + }, + "method": { + "short_name": "DuplicateChart", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService.DuplicateChart", + "service": { + "short_name": "NativeDashboardService", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chronicle_v1_generated_NativeDashboardService_ExportNativeDashboards_sync", + "title": "Snippet for the export_native_dashboards call in the NativeDashboardService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::NativeDashboardService::Client#export_native_dashboards.", + "file": "native_dashboard_service/export_native_dashboards.rb", + "language": "RUBY", + "client_method": { + "short_name": "export_native_dashboards", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client#export_native_dashboards", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::ExportNativeDashboardsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Chronicle::V1::ExportNativeDashboardsResponse", + "client": { + "short_name": "NativeDashboardService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client" + }, + "method": { + "short_name": "ExportNativeDashboards", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService.ExportNativeDashboards", + "service": { + "short_name": "NativeDashboardService", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chronicle_v1_generated_NativeDashboardService_ImportNativeDashboards_sync", + "title": "Snippet for the import_native_dashboards call in the NativeDashboardService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::NativeDashboardService::Client#import_native_dashboards.", + "file": "native_dashboard_service/import_native_dashboards.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_native_dashboards", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client#import_native_dashboards", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::ImportNativeDashboardsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Chronicle::V1::ImportNativeDashboardsResponse", + "client": { + "short_name": "NativeDashboardService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::NativeDashboardService::Client" + }, + "method": { + "short_name": "ImportNativeDashboards", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService.ImportNativeDashboards", + "service": { + "short_name": "NativeDashboardService", + "full_name": "google.cloud.chronicle.v1.NativeDashboardService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chronicle_v1_generated_FeaturedContentNativeDashboardService_GetFeaturedContentNativeDashboard_sync", + "title": "Snippet for the get_featured_content_native_dashboard call in the FeaturedContentNativeDashboardService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client#get_featured_content_native_dashboard.", + "file": "featured_content_native_dashboard_service/get_featured_content_native_dashboard.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_featured_content_native_dashboard", + "full_name": "::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client#get_featured_content_native_dashboard", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::GetFeaturedContentNativeDashboardRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard", + "client": { + "short_name": "FeaturedContentNativeDashboardService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client" + }, + "method": { + "short_name": "GetFeaturedContentNativeDashboard", + "full_name": "google.cloud.chronicle.v1.FeaturedContentNativeDashboardService.GetFeaturedContentNativeDashboard", + "service": { + "short_name": "FeaturedContentNativeDashboardService", + "full_name": "google.cloud.chronicle.v1.FeaturedContentNativeDashboardService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chronicle_v1_generated_FeaturedContentNativeDashboardService_ListFeaturedContentNativeDashboards_sync", + "title": "Snippet for the list_featured_content_native_dashboards call in the FeaturedContentNativeDashboardService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client#list_featured_content_native_dashboards.", + "file": "featured_content_native_dashboard_service/list_featured_content_native_dashboards.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_featured_content_native_dashboards", + "full_name": "::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client#list_featured_content_native_dashboards", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsResponse", + "client": { + "short_name": "FeaturedContentNativeDashboardService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client" + }, + "method": { + "short_name": "ListFeaturedContentNativeDashboards", + "full_name": "google.cloud.chronicle.v1.FeaturedContentNativeDashboardService.ListFeaturedContentNativeDashboards", + "service": { + "short_name": "FeaturedContentNativeDashboardService", + "full_name": "google.cloud.chronicle.v1.FeaturedContentNativeDashboardService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "chronicle_v1_generated_FeaturedContentNativeDashboardService_InstallFeaturedContentNativeDashboard_sync", + "title": "Snippet for the install_featured_content_native_dashboard call in the FeaturedContentNativeDashboardService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client#install_featured_content_native_dashboard.", + "file": "featured_content_native_dashboard_service/install_featured_content_native_dashboard.rb", + "language": "RUBY", + "client_method": { + "short_name": "install_featured_content_native_dashboard", + "full_name": "::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client#install_featured_content_native_dashboard", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardResponse", + "client": { + "short_name": "FeaturedContentNativeDashboardService::Client", + "full_name": "::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client" + }, + "method": { + "short_name": "InstallFeaturedContentNativeDashboard", + "full_name": "google.cloud.chronicle.v1.FeaturedContentNativeDashboardService.InstallFeaturedContentNativeDashboard", + "service": { + "short_name": "FeaturedContentNativeDashboardService", + "full_name": "google.cloud.chronicle.v1.FeaturedContentNativeDashboardService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, { "region_tag": "chronicle_v1_generated_InstanceService_GetInstance_sync", "title": "Snippet for the get_instance call in the InstanceService service", diff --git a/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/big_query_export_service_paths_test.rb b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/big_query_export_service_paths_test.rb new file mode 100644 index 000000000000..8f5ca6d79947 --- /dev/null +++ b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/big_query_export_service_paths_test.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/chronicle/v1/big_query_export_service" + +class ::Google::Cloud::Chronicle::V1::BigQueryExportService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_big_query_export_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.big_query_export_path project: "value0", location: "value1", instance: "value2" + assert_equal "projects/value0/locations/value1/instances/value2/bigQueryExport", path + end + end + + def test_instance_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.instance_path project: "value0", location: "value1", instance: "value2" + assert_equal "projects/value0/locations/value1/instances/value2", path + end + end +end diff --git a/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/big_query_export_service_rest_test.rb b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/big_query_export_service_rest_test.rb new file mode 100644 index 000000000000..971ffd42e437 --- /dev/null +++ b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/big_query_export_service_rest_test.rb @@ -0,0 +1,262 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/chronicle/v1/big_query_export_pb" +require "google/cloud/chronicle/v1/big_query_export_service/rest" + + +class ::Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_big_query_export + # Create test objects. + client_result = ::Google::Cloud::Chronicle::V1::BigQueryExport.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_big_query_export_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::ServiceStub.stub :transcode_get_big_query_export_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_big_query_export({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_big_query_export name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_big_query_export ::Google::Cloud::Chronicle::V1::GetBigQueryExportRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_big_query_export({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_big_query_export(::Google::Cloud::Chronicle::V1::GetBigQueryExportRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_big_query_export_client_stub.call_count + end + end + end + + def test_update_big_query_export + # Create test objects. + client_result = ::Google::Cloud::Chronicle::V1::BigQueryExport.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + big_query_export = {} + update_mask = {} + + update_big_query_export_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::ServiceStub.stub :transcode_update_big_query_export_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_big_query_export({ big_query_export: big_query_export, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_big_query_export big_query_export: big_query_export, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_big_query_export ::Google::Cloud::Chronicle::V1::UpdateBigQueryExportRequest.new(big_query_export: big_query_export, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_big_query_export({ big_query_export: big_query_export, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_big_query_export(::Google::Cloud::Chronicle::V1::UpdateBigQueryExportRequest.new(big_query_export: big_query_export, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_big_query_export_client_stub.call_count + end + end + end + + def test_provision_big_query_export + # Create test objects. + client_result = ::Google::Cloud::Chronicle::V1::BigQueryExport.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + provision_big_query_export_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::ServiceStub.stub :transcode_provision_big_query_export_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, provision_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.provision_big_query_export({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.provision_big_query_export parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.provision_big_query_export ::Google::Cloud::Chronicle::V1::ProvisionBigQueryExportRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.provision_big_query_export({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.provision_big_query_export(::Google::Cloud::Chronicle::V1::ProvisionBigQueryExportRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, provision_big_query_export_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Chronicle::V1::BigQueryExportService::Rest::Client::Configuration, config + end +end diff --git a/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/big_query_export_service_test.rb b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/big_query_export_service_test.rb new file mode 100644 index 000000000000..bf405d39fbd2 --- /dev/null +++ b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/big_query_export_service_test.rb @@ -0,0 +1,280 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/chronicle/v1/big_query_export_pb" +require "google/cloud/chronicle/v1/big_query_export_service" + +class ::Google::Cloud::Chronicle::V1::BigQueryExportService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_big_query_export + # Create GRPC objects. + grpc_response = ::Google::Cloud::Chronicle::V1::BigQueryExport.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_big_query_export_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_big_query_export, name + assert_kind_of ::Google::Cloud::Chronicle::V1::GetBigQueryExportRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_big_query_export({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_big_query_export name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_big_query_export ::Google::Cloud::Chronicle::V1::GetBigQueryExportRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_big_query_export({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_big_query_export(::Google::Cloud::Chronicle::V1::GetBigQueryExportRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_big_query_export_client_stub.call_rpc_count + end + end + + def test_update_big_query_export + # Create GRPC objects. + grpc_response = ::Google::Cloud::Chronicle::V1::BigQueryExport.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + big_query_export = {} + update_mask = {} + + update_big_query_export_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_big_query_export, name + assert_kind_of ::Google::Cloud::Chronicle::V1::UpdateBigQueryExportRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Chronicle::V1::BigQueryExport), request["big_query_export"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_big_query_export({ big_query_export: big_query_export, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_big_query_export big_query_export: big_query_export, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_big_query_export ::Google::Cloud::Chronicle::V1::UpdateBigQueryExportRequest.new(big_query_export: big_query_export, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_big_query_export({ big_query_export: big_query_export, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_big_query_export(::Google::Cloud::Chronicle::V1::UpdateBigQueryExportRequest.new(big_query_export: big_query_export, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_big_query_export_client_stub.call_rpc_count + end + end + + def test_provision_big_query_export + # Create GRPC objects. + grpc_response = ::Google::Cloud::Chronicle::V1::BigQueryExport.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + provision_big_query_export_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :provision_big_query_export, name + assert_kind_of ::Google::Cloud::Chronicle::V1::ProvisionBigQueryExportRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, provision_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.provision_big_query_export({ parent: parent }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.provision_big_query_export parent: parent do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.provision_big_query_export ::Google::Cloud::Chronicle::V1::ProvisionBigQueryExportRequest.new(parent: parent) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.provision_big_query_export({ parent: parent }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.provision_big_query_export(::Google::Cloud::Chronicle::V1::ProvisionBigQueryExportRequest.new(parent: parent), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, provision_big_query_export_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Chronicle::V1::BigQueryExportService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Chronicle::V1::BigQueryExportService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Chronicle::V1::BigQueryExportService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/dashboard_chart_service_paths_test.rb b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/dashboard_chart_service_paths_test.rb new file mode 100644 index 000000000000..19d05a898902 --- /dev/null +++ b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/dashboard_chart_service_paths_test.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/chronicle/v1/dashboard_chart_service" + +class ::Google::Cloud::Chronicle::V1::DashboardChartService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_dashboard_chart_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.dashboard_chart_path project: "value0", location: "value1", instance: "value2", chart: "value3" + assert_equal "projects/value0/locations/value1/instances/value2/dashboardCharts/value3", path + end + end + + def test_instance_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.instance_path project: "value0", location: "value1", instance: "value2" + assert_equal "projects/value0/locations/value1/instances/value2", path + end + end +end diff --git a/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/dashboard_chart_service_rest_test.rb b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/dashboard_chart_service_rest_test.rb new file mode 100644 index 000000000000..8efea8f4f55f --- /dev/null +++ b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/dashboard_chart_service_rest_test.rb @@ -0,0 +1,208 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/chronicle/v1/dashboard_chart_pb" +require "google/cloud/chronicle/v1/dashboard_chart_service/rest" + + +class ::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_dashboard_chart + # Create test objects. + client_result = ::Google::Cloud::Chronicle::V1::DashboardChart.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_dashboard_chart_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::ServiceStub.stub :transcode_get_dashboard_chart_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_dashboard_chart_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_dashboard_chart({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_dashboard_chart name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_dashboard_chart ::Google::Cloud::Chronicle::V1::GetDashboardChartRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_dashboard_chart({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_dashboard_chart(::Google::Cloud::Chronicle::V1::GetDashboardChartRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_dashboard_chart_client_stub.call_count + end + end + end + + def test_batch_get_dashboard_charts + # Create test objects. + client_result = ::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + names = ["hello world"] + + batch_get_dashboard_charts_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::ServiceStub.stub :transcode_batch_get_dashboard_charts_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_get_dashboard_charts_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_get_dashboard_charts({ parent: parent, names: names }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_get_dashboard_charts parent: parent, names: names do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_get_dashboard_charts ::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest.new(parent: parent, names: names) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_get_dashboard_charts({ parent: parent, names: names }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_get_dashboard_charts(::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest.new(parent: parent, names: names), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_get_dashboard_charts_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client::Configuration, config + end +end diff --git a/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/dashboard_chart_service_test.rb b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/dashboard_chart_service_test.rb new file mode 100644 index 000000000000..f2b3e78e90c6 --- /dev/null +++ b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/dashboard_chart_service_test.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/chronicle/v1/dashboard_chart_pb" +require "google/cloud/chronicle/v1/dashboard_chart_service" + +class ::Google::Cloud::Chronicle::V1::DashboardChartService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_dashboard_chart + # Create GRPC objects. + grpc_response = ::Google::Cloud::Chronicle::V1::DashboardChart.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_dashboard_chart_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_dashboard_chart, name + assert_kind_of ::Google::Cloud::Chronicle::V1::GetDashboardChartRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_dashboard_chart_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_dashboard_chart({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_dashboard_chart name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_dashboard_chart ::Google::Cloud::Chronicle::V1::GetDashboardChartRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_dashboard_chart({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_dashboard_chart(::Google::Cloud::Chronicle::V1::GetDashboardChartRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_dashboard_chart_client_stub.call_rpc_count + end + end + + def test_batch_get_dashboard_charts + # Create GRPC objects. + grpc_response = ::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + names = ["hello world"] + + batch_get_dashboard_charts_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_get_dashboard_charts, name + assert_kind_of ::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest, request + assert_equal "hello world", request["parent"] + assert_equal ["hello world"], request["names"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_get_dashboard_charts_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_get_dashboard_charts({ parent: parent, names: names }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_get_dashboard_charts parent: parent, names: names do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_get_dashboard_charts ::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest.new(parent: parent, names: names) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_get_dashboard_charts({ parent: parent, names: names }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_get_dashboard_charts(::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest.new(parent: parent, names: names), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_get_dashboard_charts_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Chronicle::V1::DashboardChartService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Chronicle::V1::DashboardChartService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/dashboard_query_service_paths_test.rb b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/dashboard_query_service_paths_test.rb new file mode 100644 index 000000000000..5ea1405fc02d --- /dev/null +++ b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/dashboard_query_service_paths_test.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/chronicle/v1/dashboard_query_service" + +class ::Google::Cloud::Chronicle::V1::DashboardQueryService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_dashboard_chart_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.dashboard_chart_path project: "value0", location: "value1", instance: "value2", chart: "value3" + assert_equal "projects/value0/locations/value1/instances/value2/dashboardCharts/value3", path + end + end + + def test_dashboard_query_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.dashboard_query_path project: "value0", location: "value1", instance: "value2", query: "value3" + assert_equal "projects/value0/locations/value1/instances/value2/dashboardQueries/value3", path + end + end + + def test_instance_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.instance_path project: "value0", location: "value1", instance: "value2" + assert_equal "projects/value0/locations/value1/instances/value2", path + end + end +end diff --git a/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/dashboard_query_service_rest_test.rb b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/dashboard_query_service_rest_test.rb new file mode 100644 index 000000000000..f1b467a4b248 --- /dev/null +++ b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/dashboard_query_service_rest_test.rb @@ -0,0 +1,211 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/chronicle/v1/dashboard_query_pb" +require "google/cloud/chronicle/v1/dashboard_query_service/rest" + + +class ::Google::Cloud::Chronicle::V1::DashboardQueryService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_dashboard_query + # Create test objects. + client_result = ::Google::Cloud::Chronicle::V1::DashboardQuery.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_dashboard_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::DashboardQueryService::Rest::ServiceStub.stub :transcode_get_dashboard_query_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_dashboard_query_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_dashboard_query({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_dashboard_query name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_dashboard_query ::Google::Cloud::Chronicle::V1::GetDashboardQueryRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_dashboard_query({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_dashboard_query(::Google::Cloud::Chronicle::V1::GetDashboardQueryRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_dashboard_query_client_stub.call_count + end + end + end + + def test_execute_dashboard_query + # Create test objects. + client_result = ::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + query = {} + filters = [{}] + clear_cache = true + use_previous_time_range = true + + execute_dashboard_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::DashboardQueryService::Rest::ServiceStub.stub :transcode_execute_dashboard_query_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, execute_dashboard_query_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.execute_dashboard_query({ parent: parent, query: query, filters: filters, clear_cache: clear_cache, use_previous_time_range: use_previous_time_range }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.execute_dashboard_query parent: parent, query: query, filters: filters, clear_cache: clear_cache, use_previous_time_range: use_previous_time_range do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.execute_dashboard_query ::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest.new(parent: parent, query: query, filters: filters, clear_cache: clear_cache, use_previous_time_range: use_previous_time_range) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.execute_dashboard_query({ parent: parent, query: query, filters: filters, clear_cache: clear_cache, use_previous_time_range: use_previous_time_range }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.execute_dashboard_query(::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest.new(parent: parent, query: query, filters: filters, clear_cache: clear_cache, use_previous_time_range: use_previous_time_range), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, execute_dashboard_query_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Chronicle::V1::DashboardQueryService::Rest::Client::Configuration, config + end +end diff --git a/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/dashboard_query_service_test.rb b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/dashboard_query_service_test.rb new file mode 100644 index 000000000000..17503831b5bc --- /dev/null +++ b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/dashboard_query_service_test.rb @@ -0,0 +1,228 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/chronicle/v1/dashboard_query_pb" +require "google/cloud/chronicle/v1/dashboard_query_service" + +class ::Google::Cloud::Chronicle::V1::DashboardQueryService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_dashboard_query + # Create GRPC objects. + grpc_response = ::Google::Cloud::Chronicle::V1::DashboardQuery.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_dashboard_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_dashboard_query, name + assert_kind_of ::Google::Cloud::Chronicle::V1::GetDashboardQueryRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_dashboard_query_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_dashboard_query({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_dashboard_query name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_dashboard_query ::Google::Cloud::Chronicle::V1::GetDashboardQueryRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_dashboard_query({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_dashboard_query(::Google::Cloud::Chronicle::V1::GetDashboardQueryRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_dashboard_query_client_stub.call_rpc_count + end + end + + def test_execute_dashboard_query + # Create GRPC objects. + grpc_response = ::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + query = {} + filters = [{}] + clear_cache = true + use_previous_time_range = true + + execute_dashboard_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :execute_dashboard_query, name + assert_kind_of ::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Chronicle::V1::DashboardQuery), request["query"] + assert_kind_of ::Google::Cloud::Chronicle::V1::DashboardFilter, request["filters"].first + assert_equal true, request["clear_cache"] + assert_equal true, request["use_previous_time_range"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, execute_dashboard_query_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.execute_dashboard_query({ parent: parent, query: query, filters: filters, clear_cache: clear_cache, use_previous_time_range: use_previous_time_range }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.execute_dashboard_query parent: parent, query: query, filters: filters, clear_cache: clear_cache, use_previous_time_range: use_previous_time_range do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.execute_dashboard_query ::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest.new(parent: parent, query: query, filters: filters, clear_cache: clear_cache, use_previous_time_range: use_previous_time_range) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.execute_dashboard_query({ parent: parent, query: query, filters: filters, clear_cache: clear_cache, use_previous_time_range: use_previous_time_range }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.execute_dashboard_query(::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest.new(parent: parent, query: query, filters: filters, clear_cache: clear_cache, use_previous_time_range: use_previous_time_range), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, execute_dashboard_query_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Chronicle::V1::DashboardQueryService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Chronicle::V1::DashboardQueryService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/featured_content_native_dashboard_service_paths_test.rb b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/featured_content_native_dashboard_service_paths_test.rb new file mode 100644 index 000000000000..90c49bafd600 --- /dev/null +++ b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/featured_content_native_dashboard_service_paths_test.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/chronicle/v1/featured_content_native_dashboard_service" + +class ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_content_hub_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.content_hub_path project: "value0", location: "value1", instance: "value2" + assert_equal "projects/value0/locations/value1/instances/value2/contentHub", path + end + end + + def test_dashboard_chart_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.dashboard_chart_path project: "value0", location: "value1", instance: "value2", chart: "value3" + assert_equal "projects/value0/locations/value1/instances/value2/dashboardCharts/value3", path + end + end + + def test_dashboard_query_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.dashboard_query_path project: "value0", location: "value1", instance: "value2", query: "value3" + assert_equal "projects/value0/locations/value1/instances/value2/dashboardQueries/value3", path + end + end + + def test_featured_content_native_dashboard_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.featured_content_native_dashboard_path project: "value0", location: "value1", instance: "value2", featured_content_native_dashboard: "value3" + assert_equal "projects/value0/locations/value1/instances/value2/contentHub/featuredContentNativeDashboards/value3", path + end + end + + def test_native_dashboard_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.native_dashboard_path project: "value0", location: "value1", instance: "value2", dashboard: "value3" + assert_equal "projects/value0/locations/value1/instances/value2/nativeDashboards/value3", path + end + end +end diff --git a/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/featured_content_native_dashboard_service_rest_test.rb b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/featured_content_native_dashboard_service_rest_test.rb new file mode 100644 index 000000000000..823c3c2b5967 --- /dev/null +++ b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/featured_content_native_dashboard_service_rest_test.rb @@ -0,0 +1,265 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/chronicle/v1/featured_content_native_dashboard_pb" +require "google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest" + + +class ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_featured_content_native_dashboard + # Create test objects. + client_result = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_featured_content_native_dashboard_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::ServiceStub.stub :transcode_get_featured_content_native_dashboard_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_featured_content_native_dashboard_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_featured_content_native_dashboard({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_featured_content_native_dashboard name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_featured_content_native_dashboard ::Google::Cloud::Chronicle::V1::GetFeaturedContentNativeDashboardRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_featured_content_native_dashboard({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_featured_content_native_dashboard(::Google::Cloud::Chronicle::V1::GetFeaturedContentNativeDashboardRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_featured_content_native_dashboard_client_stub.call_count + end + end + end + + def test_list_featured_content_native_dashboards + # Create test objects. + client_result = ::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_featured_content_native_dashboards_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::ServiceStub.stub :transcode_list_featured_content_native_dashboards_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_featured_content_native_dashboards_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_featured_content_native_dashboards({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_featured_content_native_dashboards parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_featured_content_native_dashboards ::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_featured_content_native_dashboards({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_featured_content_native_dashboards(::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_featured_content_native_dashboards_client_stub.call_count + end + end + end + + def test_install_featured_content_native_dashboard + # Create test objects. + client_result = ::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + featured_content_native_dashboard = {} + + install_featured_content_native_dashboard_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::ServiceStub.stub :transcode_install_featured_content_native_dashboard_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, install_featured_content_native_dashboard_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.install_featured_content_native_dashboard({ name: name, featured_content_native_dashboard: featured_content_native_dashboard }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.install_featured_content_native_dashboard name: name, featured_content_native_dashboard: featured_content_native_dashboard do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.install_featured_content_native_dashboard ::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardRequest.new(name: name, featured_content_native_dashboard: featured_content_native_dashboard) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.install_featured_content_native_dashboard({ name: name, featured_content_native_dashboard: featured_content_native_dashboard }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.install_featured_content_native_dashboard(::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardRequest.new(name: name, featured_content_native_dashboard: featured_content_native_dashboard), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, install_featured_content_native_dashboard_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Rest::Client::Configuration, config + end +end diff --git a/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/featured_content_native_dashboard_service_test.rb b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/featured_content_native_dashboard_service_test.rb new file mode 100644 index 000000000000..7c72e8df2cc7 --- /dev/null +++ b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/featured_content_native_dashboard_service_test.rb @@ -0,0 +1,291 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/chronicle/v1/featured_content_native_dashboard_pb" +require "google/cloud/chronicle/v1/featured_content_native_dashboard_service" + +class ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_featured_content_native_dashboard + # Create GRPC objects. + grpc_response = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_featured_content_native_dashboard_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_featured_content_native_dashboard, name + assert_kind_of ::Google::Cloud::Chronicle::V1::GetFeaturedContentNativeDashboardRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_featured_content_native_dashboard_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_featured_content_native_dashboard({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_featured_content_native_dashboard name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_featured_content_native_dashboard ::Google::Cloud::Chronicle::V1::GetFeaturedContentNativeDashboardRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_featured_content_native_dashboard({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_featured_content_native_dashboard(::Google::Cloud::Chronicle::V1::GetFeaturedContentNativeDashboardRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_featured_content_native_dashboard_client_stub.call_rpc_count + end + end + + def test_list_featured_content_native_dashboards + # Create GRPC objects. + grpc_response = ::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_featured_content_native_dashboards_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_featured_content_native_dashboards, name + assert_kind_of ::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_featured_content_native_dashboards_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_featured_content_native_dashboards({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_featured_content_native_dashboards parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_featured_content_native_dashboards ::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_featured_content_native_dashboards({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_featured_content_native_dashboards(::Google::Cloud::Chronicle::V1::ListFeaturedContentNativeDashboardsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_featured_content_native_dashboards_client_stub.call_rpc_count + end + end + + def test_install_featured_content_native_dashboard + # Create GRPC objects. + grpc_response = ::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + featured_content_native_dashboard = {} + + install_featured_content_native_dashboard_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :install_featured_content_native_dashboard, name + assert_kind_of ::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard), request["featured_content_native_dashboard"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, install_featured_content_native_dashboard_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.install_featured_content_native_dashboard({ name: name, featured_content_native_dashboard: featured_content_native_dashboard }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.install_featured_content_native_dashboard name: name, featured_content_native_dashboard: featured_content_native_dashboard do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.install_featured_content_native_dashboard ::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardRequest.new(name: name, featured_content_native_dashboard: featured_content_native_dashboard) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.install_featured_content_native_dashboard({ name: name, featured_content_native_dashboard: featured_content_native_dashboard }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.install_featured_content_native_dashboard(::Google::Cloud::Chronicle::V1::InstallFeaturedContentNativeDashboardRequest.new(name: name, featured_content_native_dashboard: featured_content_native_dashboard), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, install_featured_content_native_dashboard_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboardService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/native_dashboard_service_paths_test.rb b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/native_dashboard_service_paths_test.rb new file mode 100644 index 000000000000..acee3f640c8b --- /dev/null +++ b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/native_dashboard_service_paths_test.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/chronicle/v1/native_dashboard_service" + +class ::Google::Cloud::Chronicle::V1::NativeDashboardService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_dashboard_chart_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.dashboard_chart_path project: "value0", location: "value1", instance: "value2", chart: "value3" + assert_equal "projects/value0/locations/value1/instances/value2/dashboardCharts/value3", path + end + end + + def test_dashboard_query_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.dashboard_query_path project: "value0", location: "value1", instance: "value2", query: "value3" + assert_equal "projects/value0/locations/value1/instances/value2/dashboardQueries/value3", path + end + end + + def test_instance_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.instance_path project: "value0", location: "value1", instance: "value2" + assert_equal "projects/value0/locations/value1/instances/value2", path + end + end + + def test_native_dashboard_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.native_dashboard_path project: "value0", location: "value1", instance: "value2", dashboard: "value3" + assert_equal "projects/value0/locations/value1/instances/value2/nativeDashboards/value3", path + end + end +end diff --git a/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/native_dashboard_service_rest_test.rb b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/native_dashboard_service_rest_test.rb new file mode 100644 index 000000000000..bd590a79cb52 --- /dev/null +++ b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/native_dashboard_service_rest_test.rb @@ -0,0 +1,765 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/chronicle/v1/native_dashboard_pb" +require "google/cloud/chronicle/v1/native_dashboard_service/rest" + + +class ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_native_dashboard + # Create test objects. + client_result = ::Google::Cloud::Chronicle::V1::NativeDashboard.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + native_dashboard = {} + + create_native_dashboard_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::ServiceStub.stub :transcode_create_native_dashboard_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_native_dashboard_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_native_dashboard({ parent: parent, native_dashboard: native_dashboard }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_native_dashboard parent: parent, native_dashboard: native_dashboard do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_native_dashboard ::Google::Cloud::Chronicle::V1::CreateNativeDashboardRequest.new(parent: parent, native_dashboard: native_dashboard) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_native_dashboard({ parent: parent, native_dashboard: native_dashboard }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_native_dashboard(::Google::Cloud::Chronicle::V1::CreateNativeDashboardRequest.new(parent: parent, native_dashboard: native_dashboard), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_native_dashboard_client_stub.call_count + end + end + end + + def test_get_native_dashboard + # Create test objects. + client_result = ::Google::Cloud::Chronicle::V1::NativeDashboard.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + view = :NATIVE_DASHBOARD_VIEW_UNSPECIFIED + + get_native_dashboard_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::ServiceStub.stub :transcode_get_native_dashboard_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_native_dashboard_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_native_dashboard({ name: name, view: view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_native_dashboard name: name, view: view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_native_dashboard ::Google::Cloud::Chronicle::V1::GetNativeDashboardRequest.new(name: name, view: view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_native_dashboard({ name: name, view: view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_native_dashboard(::Google::Cloud::Chronicle::V1::GetNativeDashboardRequest.new(name: name, view: view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_native_dashboard_client_stub.call_count + end + end + end + + def test_list_native_dashboards + # Create test objects. + client_result = ::Google::Cloud::Chronicle::V1::ListNativeDashboardsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + view = :NATIVE_DASHBOARD_VIEW_UNSPECIFIED + + list_native_dashboards_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::ServiceStub.stub :transcode_list_native_dashboards_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_native_dashboards_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_native_dashboards({ parent: parent, page_size: page_size, page_token: page_token, view: view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_native_dashboards parent: parent, page_size: page_size, page_token: page_token, view: view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_native_dashboards ::Google::Cloud::Chronicle::V1::ListNativeDashboardsRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_native_dashboards({ parent: parent, page_size: page_size, page_token: page_token, view: view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_native_dashboards(::Google::Cloud::Chronicle::V1::ListNativeDashboardsRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_native_dashboards_client_stub.call_count + end + end + end + + def test_update_native_dashboard + # Create test objects. + client_result = ::Google::Cloud::Chronicle::V1::NativeDashboard.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + native_dashboard = {} + update_mask = {} + + update_native_dashboard_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::ServiceStub.stub :transcode_update_native_dashboard_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_native_dashboard_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_native_dashboard({ native_dashboard: native_dashboard, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_native_dashboard native_dashboard: native_dashboard, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_native_dashboard ::Google::Cloud::Chronicle::V1::UpdateNativeDashboardRequest.new(native_dashboard: native_dashboard, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_native_dashboard({ native_dashboard: native_dashboard, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_native_dashboard(::Google::Cloud::Chronicle::V1::UpdateNativeDashboardRequest.new(native_dashboard: native_dashboard, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_native_dashboard_client_stub.call_count + end + end + end + + def test_duplicate_native_dashboard + # Create test objects. + client_result = ::Google::Cloud::Chronicle::V1::NativeDashboard.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + native_dashboard = {} + + duplicate_native_dashboard_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::ServiceStub.stub :transcode_duplicate_native_dashboard_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, duplicate_native_dashboard_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.duplicate_native_dashboard({ name: name, native_dashboard: native_dashboard }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.duplicate_native_dashboard name: name, native_dashboard: native_dashboard do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.duplicate_native_dashboard ::Google::Cloud::Chronicle::V1::DuplicateNativeDashboardRequest.new(name: name, native_dashboard: native_dashboard) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.duplicate_native_dashboard({ name: name, native_dashboard: native_dashboard }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.duplicate_native_dashboard(::Google::Cloud::Chronicle::V1::DuplicateNativeDashboardRequest.new(name: name, native_dashboard: native_dashboard), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, duplicate_native_dashboard_client_stub.call_count + end + end + end + + def test_delete_native_dashboard + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_native_dashboard_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::ServiceStub.stub :transcode_delete_native_dashboard_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_native_dashboard_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_native_dashboard({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_native_dashboard name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_native_dashboard ::Google::Cloud::Chronicle::V1::DeleteNativeDashboardRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_native_dashboard({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_native_dashboard(::Google::Cloud::Chronicle::V1::DeleteNativeDashboardRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_native_dashboard_client_stub.call_count + end + end + end + + def test_add_chart + # Create test objects. + client_result = ::Google::Cloud::Chronicle::V1::AddChartResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + dashboard_query = {} + dashboard_chart = {} + chart_layout = {} + + add_chart_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::ServiceStub.stub :transcode_add_chart_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, add_chart_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.add_chart({ name: name, dashboard_query: dashboard_query, dashboard_chart: dashboard_chart, chart_layout: chart_layout }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.add_chart name: name, dashboard_query: dashboard_query, dashboard_chart: dashboard_chart, chart_layout: chart_layout do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.add_chart ::Google::Cloud::Chronicle::V1::AddChartRequest.new(name: name, dashboard_query: dashboard_query, dashboard_chart: dashboard_chart, chart_layout: chart_layout) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.add_chart({ name: name, dashboard_query: dashboard_query, dashboard_chart: dashboard_chart, chart_layout: chart_layout }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.add_chart(::Google::Cloud::Chronicle::V1::AddChartRequest.new(name: name, dashboard_query: dashboard_query, dashboard_chart: dashboard_chart, chart_layout: chart_layout), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, add_chart_client_stub.call_count + end + end + end + + def test_remove_chart + # Create test objects. + client_result = ::Google::Cloud::Chronicle::V1::NativeDashboard.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + dashboard_chart = "hello world" + + remove_chart_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::ServiceStub.stub :transcode_remove_chart_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, remove_chart_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.remove_chart({ name: name, dashboard_chart: dashboard_chart }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.remove_chart name: name, dashboard_chart: dashboard_chart do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.remove_chart ::Google::Cloud::Chronicle::V1::RemoveChartRequest.new(name: name, dashboard_chart: dashboard_chart) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.remove_chart({ name: name, dashboard_chart: dashboard_chart }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.remove_chart(::Google::Cloud::Chronicle::V1::RemoveChartRequest.new(name: name, dashboard_chart: dashboard_chart), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, remove_chart_client_stub.call_count + end + end + end + + def test_edit_chart + # Create test objects. + client_result = ::Google::Cloud::Chronicle::V1::EditChartResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + dashboard_query = {} + dashboard_chart = {} + edit_mask = {} + language_features = [:LANGUAGE_FEATURE_UNSPECIFIED] + + edit_chart_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::ServiceStub.stub :transcode_edit_chart_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, edit_chart_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.edit_chart({ name: name, dashboard_query: dashboard_query, dashboard_chart: dashboard_chart, edit_mask: edit_mask, language_features: language_features }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.edit_chart name: name, dashboard_query: dashboard_query, dashboard_chart: dashboard_chart, edit_mask: edit_mask, language_features: language_features do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.edit_chart ::Google::Cloud::Chronicle::V1::EditChartRequest.new(name: name, dashboard_query: dashboard_query, dashboard_chart: dashboard_chart, edit_mask: edit_mask, language_features: language_features) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.edit_chart({ name: name, dashboard_query: dashboard_query, dashboard_chart: dashboard_chart, edit_mask: edit_mask, language_features: language_features }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.edit_chart(::Google::Cloud::Chronicle::V1::EditChartRequest.new(name: name, dashboard_query: dashboard_query, dashboard_chart: dashboard_chart, edit_mask: edit_mask, language_features: language_features), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, edit_chart_client_stub.call_count + end + end + end + + def test_duplicate_chart + # Create test objects. + client_result = ::Google::Cloud::Chronicle::V1::DuplicateChartResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + dashboard_chart = "hello world" + + duplicate_chart_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::ServiceStub.stub :transcode_duplicate_chart_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, duplicate_chart_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.duplicate_chart({ name: name, dashboard_chart: dashboard_chart }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.duplicate_chart name: name, dashboard_chart: dashboard_chart do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.duplicate_chart ::Google::Cloud::Chronicle::V1::DuplicateChartRequest.new(name: name, dashboard_chart: dashboard_chart) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.duplicate_chart({ name: name, dashboard_chart: dashboard_chart }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.duplicate_chart(::Google::Cloud::Chronicle::V1::DuplicateChartRequest.new(name: name, dashboard_chart: dashboard_chart), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, duplicate_chart_client_stub.call_count + end + end + end + + def test_export_native_dashboards + # Create test objects. + client_result = ::Google::Cloud::Chronicle::V1::ExportNativeDashboardsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + names = ["hello world"] + + export_native_dashboards_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::ServiceStub.stub :transcode_export_native_dashboards_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, export_native_dashboards_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.export_native_dashboards({ parent: parent, names: names }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.export_native_dashboards parent: parent, names: names do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.export_native_dashboards ::Google::Cloud::Chronicle::V1::ExportNativeDashboardsRequest.new(parent: parent, names: names) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.export_native_dashboards({ parent: parent, names: names }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.export_native_dashboards(::Google::Cloud::Chronicle::V1::ExportNativeDashboardsRequest.new(parent: parent, names: names), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, export_native_dashboards_client_stub.call_count + end + end + end + + def test_import_native_dashboards + # Create test objects. + client_result = ::Google::Cloud::Chronicle::V1::ImportNativeDashboardsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + source = {} + + import_native_dashboards_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::ServiceStub.stub :transcode_import_native_dashboards_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_native_dashboards_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_native_dashboards({ parent: parent, source: source }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_native_dashboards parent: parent, source: source do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_native_dashboards ::Google::Cloud::Chronicle::V1::ImportNativeDashboardsRequest.new(parent: parent, source: source) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_native_dashboards({ parent: parent, source: source }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_native_dashboards(::Google::Cloud::Chronicle::V1::ImportNativeDashboardsRequest.new(parent: parent, source: source), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_native_dashboards_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Chronicle::V1::NativeDashboardService::Rest::Client::Configuration, config + end +end diff --git a/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/native_dashboard_service_test.rb b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/native_dashboard_service_test.rb new file mode 100644 index 000000000000..bd48a08485da --- /dev/null +++ b/google-cloud-chronicle-v1/test/google/cloud/chronicle/v1/native_dashboard_service_test.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/chronicle/v1/native_dashboard_pb" +require "google/cloud/chronicle/v1/native_dashboard_service" + +class ::Google::Cloud::Chronicle::V1::NativeDashboardService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_native_dashboard + # Create GRPC objects. + grpc_response = ::Google::Cloud::Chronicle::V1::NativeDashboard.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + native_dashboard = {} + + create_native_dashboard_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_native_dashboard, name + assert_kind_of ::Google::Cloud::Chronicle::V1::CreateNativeDashboardRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Chronicle::V1::NativeDashboard), request["native_dashboard"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_native_dashboard_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_native_dashboard({ parent: parent, native_dashboard: native_dashboard }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_native_dashboard parent: parent, native_dashboard: native_dashboard do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_native_dashboard ::Google::Cloud::Chronicle::V1::CreateNativeDashboardRequest.new(parent: parent, native_dashboard: native_dashboard) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_native_dashboard({ parent: parent, native_dashboard: native_dashboard }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_native_dashboard(::Google::Cloud::Chronicle::V1::CreateNativeDashboardRequest.new(parent: parent, native_dashboard: native_dashboard), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_native_dashboard_client_stub.call_rpc_count + end + end + + def test_get_native_dashboard + # Create GRPC objects. + grpc_response = ::Google::Cloud::Chronicle::V1::NativeDashboard.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + view = :NATIVE_DASHBOARD_VIEW_UNSPECIFIED + + get_native_dashboard_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_native_dashboard, name + assert_kind_of ::Google::Cloud::Chronicle::V1::GetNativeDashboardRequest, request + assert_equal "hello world", request["name"] + assert_equal :NATIVE_DASHBOARD_VIEW_UNSPECIFIED, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_native_dashboard_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_native_dashboard({ name: name, view: view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_native_dashboard name: name, view: view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_native_dashboard ::Google::Cloud::Chronicle::V1::GetNativeDashboardRequest.new(name: name, view: view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_native_dashboard({ name: name, view: view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_native_dashboard(::Google::Cloud::Chronicle::V1::GetNativeDashboardRequest.new(name: name, view: view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_native_dashboard_client_stub.call_rpc_count + end + end + + def test_list_native_dashboards + # Create GRPC objects. + grpc_response = ::Google::Cloud::Chronicle::V1::ListNativeDashboardsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + view = :NATIVE_DASHBOARD_VIEW_UNSPECIFIED + + list_native_dashboards_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_native_dashboards, name + assert_kind_of ::Google::Cloud::Chronicle::V1::ListNativeDashboardsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal :NATIVE_DASHBOARD_VIEW_UNSPECIFIED, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_native_dashboards_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_native_dashboards({ parent: parent, page_size: page_size, page_token: page_token, view: view }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_native_dashboards parent: parent, page_size: page_size, page_token: page_token, view: view do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_native_dashboards ::Google::Cloud::Chronicle::V1::ListNativeDashboardsRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_native_dashboards({ parent: parent, page_size: page_size, page_token: page_token, view: view }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_native_dashboards(::Google::Cloud::Chronicle::V1::ListNativeDashboardsRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_native_dashboards_client_stub.call_rpc_count + end + end + + def test_update_native_dashboard + # Create GRPC objects. + grpc_response = ::Google::Cloud::Chronicle::V1::NativeDashboard.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + native_dashboard = {} + update_mask = {} + + update_native_dashboard_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_native_dashboard, name + assert_kind_of ::Google::Cloud::Chronicle::V1::UpdateNativeDashboardRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Chronicle::V1::NativeDashboard), request["native_dashboard"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_native_dashboard_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_native_dashboard({ native_dashboard: native_dashboard, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_native_dashboard native_dashboard: native_dashboard, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_native_dashboard ::Google::Cloud::Chronicle::V1::UpdateNativeDashboardRequest.new(native_dashboard: native_dashboard, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_native_dashboard({ native_dashboard: native_dashboard, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_native_dashboard(::Google::Cloud::Chronicle::V1::UpdateNativeDashboardRequest.new(native_dashboard: native_dashboard, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_native_dashboard_client_stub.call_rpc_count + end + end + + def test_duplicate_native_dashboard + # Create GRPC objects. + grpc_response = ::Google::Cloud::Chronicle::V1::NativeDashboard.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + native_dashboard = {} + + duplicate_native_dashboard_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :duplicate_native_dashboard, name + assert_kind_of ::Google::Cloud::Chronicle::V1::DuplicateNativeDashboardRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Chronicle::V1::NativeDashboard), request["native_dashboard"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, duplicate_native_dashboard_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.duplicate_native_dashboard({ name: name, native_dashboard: native_dashboard }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.duplicate_native_dashboard name: name, native_dashboard: native_dashboard do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.duplicate_native_dashboard ::Google::Cloud::Chronicle::V1::DuplicateNativeDashboardRequest.new(name: name, native_dashboard: native_dashboard) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.duplicate_native_dashboard({ name: name, native_dashboard: native_dashboard }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.duplicate_native_dashboard(::Google::Cloud::Chronicle::V1::DuplicateNativeDashboardRequest.new(name: name, native_dashboard: native_dashboard), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, duplicate_native_dashboard_client_stub.call_rpc_count + end + end + + def test_delete_native_dashboard + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_native_dashboard_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_native_dashboard, name + assert_kind_of ::Google::Cloud::Chronicle::V1::DeleteNativeDashboardRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_native_dashboard_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_native_dashboard({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_native_dashboard name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_native_dashboard ::Google::Cloud::Chronicle::V1::DeleteNativeDashboardRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_native_dashboard({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_native_dashboard(::Google::Cloud::Chronicle::V1::DeleteNativeDashboardRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_native_dashboard_client_stub.call_rpc_count + end + end + + def test_add_chart + # Create GRPC objects. + grpc_response = ::Google::Cloud::Chronicle::V1::AddChartResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + dashboard_query = {} + dashboard_chart = {} + chart_layout = {} + + add_chart_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :add_chart, name + assert_kind_of ::Google::Cloud::Chronicle::V1::AddChartRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Chronicle::V1::DashboardQuery), request["dashboard_query"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Chronicle::V1::DashboardChart), request["dashboard_chart"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Chronicle::V1::DashboardDefinition::ChartConfig::ChartLayout), request["chart_layout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, add_chart_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.add_chart({ name: name, dashboard_query: dashboard_query, dashboard_chart: dashboard_chart, chart_layout: chart_layout }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.add_chart name: name, dashboard_query: dashboard_query, dashboard_chart: dashboard_chart, chart_layout: chart_layout do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.add_chart ::Google::Cloud::Chronicle::V1::AddChartRequest.new(name: name, dashboard_query: dashboard_query, dashboard_chart: dashboard_chart, chart_layout: chart_layout) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.add_chart({ name: name, dashboard_query: dashboard_query, dashboard_chart: dashboard_chart, chart_layout: chart_layout }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.add_chart(::Google::Cloud::Chronicle::V1::AddChartRequest.new(name: name, dashboard_query: dashboard_query, dashboard_chart: dashboard_chart, chart_layout: chart_layout), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, add_chart_client_stub.call_rpc_count + end + end + + def test_remove_chart + # Create GRPC objects. + grpc_response = ::Google::Cloud::Chronicle::V1::NativeDashboard.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + dashboard_chart = "hello world" + + remove_chart_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :remove_chart, name + assert_kind_of ::Google::Cloud::Chronicle::V1::RemoveChartRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["dashboard_chart"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, remove_chart_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.remove_chart({ name: name, dashboard_chart: dashboard_chart }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.remove_chart name: name, dashboard_chart: dashboard_chart do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.remove_chart ::Google::Cloud::Chronicle::V1::RemoveChartRequest.new(name: name, dashboard_chart: dashboard_chart) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.remove_chart({ name: name, dashboard_chart: dashboard_chart }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.remove_chart(::Google::Cloud::Chronicle::V1::RemoveChartRequest.new(name: name, dashboard_chart: dashboard_chart), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, remove_chart_client_stub.call_rpc_count + end + end + + def test_edit_chart + # Create GRPC objects. + grpc_response = ::Google::Cloud::Chronicle::V1::EditChartResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + dashboard_query = {} + dashboard_chart = {} + edit_mask = {} + language_features = [:LANGUAGE_FEATURE_UNSPECIFIED] + + edit_chart_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :edit_chart, name + assert_kind_of ::Google::Cloud::Chronicle::V1::EditChartRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Chronicle::V1::DashboardQuery), request["dashboard_query"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Chronicle::V1::DashboardChart), request["dashboard_chart"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["edit_mask"] + assert_equal [:LANGUAGE_FEATURE_UNSPECIFIED], request["language_features"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, edit_chart_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.edit_chart({ name: name, dashboard_query: dashboard_query, dashboard_chart: dashboard_chart, edit_mask: edit_mask, language_features: language_features }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.edit_chart name: name, dashboard_query: dashboard_query, dashboard_chart: dashboard_chart, edit_mask: edit_mask, language_features: language_features do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.edit_chart ::Google::Cloud::Chronicle::V1::EditChartRequest.new(name: name, dashboard_query: dashboard_query, dashboard_chart: dashboard_chart, edit_mask: edit_mask, language_features: language_features) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.edit_chart({ name: name, dashboard_query: dashboard_query, dashboard_chart: dashboard_chart, edit_mask: edit_mask, language_features: language_features }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.edit_chart(::Google::Cloud::Chronicle::V1::EditChartRequest.new(name: name, dashboard_query: dashboard_query, dashboard_chart: dashboard_chart, edit_mask: edit_mask, language_features: language_features), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, edit_chart_client_stub.call_rpc_count + end + end + + def test_duplicate_chart + # Create GRPC objects. + grpc_response = ::Google::Cloud::Chronicle::V1::DuplicateChartResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + dashboard_chart = "hello world" + + duplicate_chart_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :duplicate_chart, name + assert_kind_of ::Google::Cloud::Chronicle::V1::DuplicateChartRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["dashboard_chart"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, duplicate_chart_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.duplicate_chart({ name: name, dashboard_chart: dashboard_chart }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.duplicate_chart name: name, dashboard_chart: dashboard_chart do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.duplicate_chart ::Google::Cloud::Chronicle::V1::DuplicateChartRequest.new(name: name, dashboard_chart: dashboard_chart) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.duplicate_chart({ name: name, dashboard_chart: dashboard_chart }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.duplicate_chart(::Google::Cloud::Chronicle::V1::DuplicateChartRequest.new(name: name, dashboard_chart: dashboard_chart), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, duplicate_chart_client_stub.call_rpc_count + end + end + + def test_export_native_dashboards + # Create GRPC objects. + grpc_response = ::Google::Cloud::Chronicle::V1::ExportNativeDashboardsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + names = ["hello world"] + + export_native_dashboards_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :export_native_dashboards, name + assert_kind_of ::Google::Cloud::Chronicle::V1::ExportNativeDashboardsRequest, request + assert_equal "hello world", request["parent"] + assert_equal ["hello world"], request["names"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, export_native_dashboards_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.export_native_dashboards({ parent: parent, names: names }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.export_native_dashboards parent: parent, names: names do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.export_native_dashboards ::Google::Cloud::Chronicle::V1::ExportNativeDashboardsRequest.new(parent: parent, names: names) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.export_native_dashboards({ parent: parent, names: names }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.export_native_dashboards(::Google::Cloud::Chronicle::V1::ExportNativeDashboardsRequest.new(parent: parent, names: names), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, export_native_dashboards_client_stub.call_rpc_count + end + end + + def test_import_native_dashboards + # Create GRPC objects. + grpc_response = ::Google::Cloud::Chronicle::V1::ImportNativeDashboardsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + source = {} + + import_native_dashboards_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_native_dashboards, name + assert_kind_of ::Google::Cloud::Chronicle::V1::ImportNativeDashboardsRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Chronicle::V1::ImportNativeDashboardsInlineSource), request["source"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_native_dashboards_client_stub do + # Create client + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_native_dashboards({ parent: parent, source: source }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.import_native_dashboards parent: parent, source: source do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.import_native_dashboards ::Google::Cloud::Chronicle::V1::ImportNativeDashboardsRequest.new(parent: parent, source: source) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.import_native_dashboards({ parent: parent, source: source }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.import_native_dashboards(::Google::Cloud::Chronicle::V1::ImportNativeDashboardsRequest.new(parent: parent, source: source), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, import_native_dashboards_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Chronicle::V1::NativeDashboardService::Client, client + assert_equal creds, client.configure.credentials + end + end +end