| 1 | package Google::Cloud::Chronicle::V1; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 0 | ▶ | use Google::gRPC::Client; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 7 | use Google::Cloud::REST::Client; | ||
| 8 | use Google::Auth; | ||
| 9 | use Carp qw(croak); | ||
| 10 | |||
| 11 | use Protobuf; | ||
| 12 | use Google::Api::Common; | ||
| 13 | use Google::Cloud::Chronicle::V1::SimulatedData; | ||
| 14 | use Google::Cloud::Chronicle::V1::FeaturedContentMetadata; | ||
| 15 | use Google::Cloud::Chronicle::V1::Event; | ||
| 16 | use Google::Cloud::Chronicle::V1::Instance; | ||
| 17 | use Google::Cloud::Chronicle::V1::DataAccessControl; | ||
| 18 | use Google::Cloud::Chronicle::V1::Entity; | ||
| 19 | use Google::Cloud::Chronicle::V1::BigQueryExport; | ||
| 20 | use Google::Cloud::Chronicle::V1::Rule; | ||
| 21 | use Google::Cloud::Chronicle::V1::FindingsRefinement; | ||
| 22 | use Google::Cloud::Chronicle::V1::DashboardQuery; | ||
| 23 | use Google::Cloud::Chronicle::V1::DataTable; | ||
| 24 | use Google::Cloud::Chronicle::V1::RuleExecutionError; | ||
| 25 | use Google::Cloud::Chronicle::V1::Feed; | ||
| 26 | use Google::Cloud::Chronicle::V1::ReferenceList; | ||
| 27 | use Google::Cloud::Chronicle::V1::Search; | ||
| 28 | use Google::Cloud::Chronicle::V1::DashboardChart; | ||
| 29 | use Google::Cloud::Chronicle::V1::NativeDashboard; | ||
| 30 | use Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard; | ||
| 31 | |||
| 32 | our $VERSION = '0.06'; | ||
| 33 | |||
| 34 | has credentials => ( is => 'ro', required => 0 ); | ||
| 35 | has transport => ( is => 'rw' ); | ||
| 36 | |||
| 37 | sub BUILD { | ||
| 38 | my ($self) = @_; | ||
| 39 | |||
| 40 | my $auth = $self->credentials; | ||
| 41 | if (!defined $auth) { | ||
| 42 | $auth = Google::Auth->default(); | ||
| 43 | } elsif (!eval { $auth->can('get_token') }) { | ||
| 44 | croak 'Invalid credentials object: must implement get_token()'; | ||
| 45 | } | ||
| 46 | my $token = $auth->get_token(); | ||
| 47 | |||
| 48 | my $target = 'chronicle.googleapis.com:443'; | ||
| 49 | my $t = $self->transport || 'grpc'; | ||
| 50 | |||
| 51 | if (ref($t) && eval { $t->can('call') }) { | ||
| 52 | # Already a transport object | ||
| 53 | } elsif (lc($t) eq 'rest') { | ||
| 54 | my $client = Google::Cloud::REST::Client->new( | ||
| 55 | target => $target, | ||
| 56 | auth_token => $token, | ||
| 57 | ); | ||
| 58 | $self->transport($client); | ||
| 59 | } else { | ||
| 60 | my $client = Google::gRPC::Client->new( | ||
| 61 | target => $target, | ||
| 62 | auth_token => $token, | ||
| 63 | ); | ||
| 64 | $self->transport($client); | ||
| 65 | } | ||
| 66 | } | ||
| 67 | |||
| 68 | sub get_big_query_export { | ||
| 69 | my ($self, %params) = @_; | ||
| 70 | |||
| 71 | my $request_class = 'Google::Cloud::Chronicle::V1::BigQueryExport::GetBigQueryExportRequest'; | ||
| 72 | my $request = eval { $request_class->new(\%params) }; | ||
| 73 | my $new_err = $@; | ||
| 74 | if (!$request) { | ||
| 75 | $request = eval { $request_class->new(%params) }; | ||
| 76 | $new_err ||= $@; | ||
| 77 | } | ||
| 78 | if (!$request) { | ||
| 79 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 80 | } | ||
| 81 | |||
| 82 | my $response_class = 'Google::Cloud::Chronicle::V1::BigQueryExport::BigQueryExport'; | ||
| 83 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 84 | return $self->transport->call({ | ||
| 85 | http_method => 'POST', | ||
| 86 | path => '/google.cloud.chronicle.v1.BigQueryExportService/GetBigQueryExport', | ||
| 87 | request => $request, | ||
| 88 | response_class => $response_class, | ||
| 89 | }); | ||
| 90 | } | ||
| 91 | |||
| 92 | my $response = $self->transport->call({ | ||
| 93 | service => 'google.cloud.chronicle.v1.BigQueryExportService', | ||
| 94 | method => 'GetBigQueryExport', | ||
| 95 | request => $request, | ||
| 96 | response_class => $response_class, | ||
| 97 | }); | ||
| 98 | |||
| 99 | return $response; | ||
| 100 | } | ||
| 101 | |||
| 102 | sub provision_big_query_export { | ||
| 103 | my ($self, %params) = @_; | ||
| 104 | |||
| 105 | my $request_class = 'Google::Cloud::Chronicle::V1::BigQueryExport::ProvisionBigQueryExportRequest'; | ||
| 106 | my $request = eval { $request_class->new(\%params) }; | ||
| 107 | my $new_err = $@; | ||
| 108 | if (!$request) { | ||
| 109 | $request = eval { $request_class->new(%params) }; | ||
| 110 | $new_err ||= $@; | ||
| 111 | } | ||
| 112 | if (!$request) { | ||
| 113 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 114 | } | ||
| 115 | |||
| 116 | my $response_class = 'Google::Cloud::Chronicle::V1::BigQueryExport::BigQueryExport'; | ||
| 117 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 118 | return $self->transport->call({ | ||
| 119 | http_method => 'POST', | ||
| 120 | path => '/google.cloud.chronicle.v1.BigQueryExportService/ProvisionBigQueryExport', | ||
| 121 | request => $request, | ||
| 122 | response_class => $response_class, | ||
| 123 | }); | ||
| 124 | } | ||
| 125 | |||
| 126 | my $response = $self->transport->call({ | ||
| 127 | service => 'google.cloud.chronicle.v1.BigQueryExportService', | ||
| 128 | method => 'ProvisionBigQueryExport', | ||
| 129 | request => $request, | ||
| 130 | response_class => $response_class, | ||
| 131 | }); | ||
| 132 | |||
| 133 | return $response; | ||
| 134 | } | ||
| 135 | |||
| 136 | sub get_dashboard_chart { | ||
| 137 | my ($self, %params) = @_; | ||
| 138 | |||
| 139 | my $request_class = 'Google::Cloud::Chronicle::V1::DashboardChart::GetDashboardChartRequest'; | ||
| 140 | my $request = eval { $request_class->new(\%params) }; | ||
| 141 | my $new_err = $@; | ||
| 142 | if (!$request) { | ||
| 143 | $request = eval { $request_class->new(%params) }; | ||
| 144 | $new_err ||= $@; | ||
| 145 | } | ||
| 146 | if (!$request) { | ||
| 147 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 148 | } | ||
| 149 | |||
| 150 | my $response_class = 'Google::Cloud::Chronicle::V1::DashboardChart::DashboardChart'; | ||
| 151 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 152 | return $self->transport->call({ | ||
| 153 | http_method => 'POST', | ||
| 154 | path => '/google.cloud.chronicle.v1.DashboardChartService/GetDashboardChart', | ||
| 155 | request => $request, | ||
| 156 | response_class => $response_class, | ||
| 157 | }); | ||
| 158 | } | ||
| 159 | |||
| 160 | my $response = $self->transport->call({ | ||
| 161 | service => 'google.cloud.chronicle.v1.DashboardChartService', | ||
| 162 | method => 'GetDashboardChart', | ||
| 163 | request => $request, | ||
| 164 | response_class => $response_class, | ||
| 165 | }); | ||
| 166 | |||
| 167 | return $response; | ||
| 168 | } | ||
| 169 | |||
| 170 | sub get_dashboard_query { | ||
| 171 | my ($self, %params) = @_; | ||
| 172 | |||
| 173 | my $request_class = 'Google::Cloud::Chronicle::V1::DashboardQuery::GetDashboardQueryRequest'; | ||
| 174 | my $request = eval { $request_class->new(\%params) }; | ||
| 175 | my $new_err = $@; | ||
| 176 | if (!$request) { | ||
| 177 | $request = eval { $request_class->new(%params) }; | ||
| 178 | $new_err ||= $@; | ||
| 179 | } | ||
| 180 | if (!$request) { | ||
| 181 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 182 | } | ||
| 183 | |||
| 184 | my $response_class = 'Google::Cloud::Chronicle::V1::DashboardQuery::DashboardQuery'; | ||
| 185 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 186 | return $self->transport->call({ | ||
| 187 | http_method => 'POST', | ||
| 188 | path => '/google.cloud.chronicle.v1.DashboardQueryService/GetDashboardQuery', | ||
| 189 | request => $request, | ||
| 190 | response_class => $response_class, | ||
| 191 | }); | ||
| 192 | } | ||
| 193 | |||
| 194 | my $response = $self->transport->call({ | ||
| 195 | service => 'google.cloud.chronicle.v1.DashboardQueryService', | ||
| 196 | method => 'GetDashboardQuery', | ||
| 197 | request => $request, | ||
| 198 | response_class => $response_class, | ||
| 199 | }); | ||
| 200 | |||
| 201 | return $response; | ||
| 202 | } | ||
| 203 | |||
| 204 | sub create_data_access_label { | ||
| 205 | my ($self, %params) = @_; | ||
| 206 | |||
| 207 | my $request_class = 'Google::Cloud::Chronicle::V1::DataAccessControl::CreateDataAccessLabelRequest'; | ||
| 208 | my $request = eval { $request_class->new(\%params) }; | ||
| 209 | my $new_err = $@; | ||
| 210 | if (!$request) { | ||
| 211 | $request = eval { $request_class->new(%params) }; | ||
| 212 | $new_err ||= $@; | ||
| 213 | } | ||
| 214 | if (!$request) { | ||
| 215 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 216 | } | ||
| 217 | |||
| 218 | my $response_class = 'Google::Cloud::Chronicle::V1::DataAccessControl::DataAccessLabel'; | ||
| 219 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 220 | return $self->transport->call({ | ||
| 221 | http_method => 'POST', | ||
| 222 | path => '/google.cloud.chronicle.v1.DataAccessControlService/CreateDataAccessLabel', | ||
| 223 | request => $request, | ||
| 224 | response_class => $response_class, | ||
| 225 | }); | ||
| 226 | } | ||
| 227 | |||
| 228 | my $response = $self->transport->call({ | ||
| 229 | service => 'google.cloud.chronicle.v1.DataAccessControlService', | ||
| 230 | method => 'CreateDataAccessLabel', | ||
| 231 | request => $request, | ||
| 232 | response_class => $response_class, | ||
| 233 | }); | ||
| 234 | |||
| 235 | return $response; | ||
| 236 | } | ||
| 237 | |||
| 238 | sub create_data_table { | ||
| 239 | my ($self, %params) = @_; | ||
| 240 | |||
| 241 | my $request_class = 'Google::Cloud::Chronicle::V1::DataTable::CreateDataTableRequest'; | ||
| 242 | my $request = eval { $request_class->new(\%params) }; | ||
| 243 | my $new_err = $@; | ||
| 244 | if (!$request) { | ||
| 245 | $request = eval { $request_class->new(%params) }; | ||
| 246 | $new_err ||= $@; | ||
| 247 | } | ||
| 248 | if (!$request) { | ||
| 249 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 250 | } | ||
| 251 | |||
| 252 | my $response_class = 'Google::Cloud::Chronicle::V1::DataTable::DataTable'; | ||
| 253 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 254 | return $self->transport->call({ | ||
| 255 | http_method => 'POST', | ||
| 256 | path => '/google.cloud.chronicle.v1.DataTableService/CreateDataTable', | ||
| 257 | request => $request, | ||
| 258 | response_class => $response_class, | ||
| 259 | }); | ||
| 260 | } | ||
| 261 | |||
| 262 | my $response = $self->transport->call({ | ||
| 263 | service => 'google.cloud.chronicle.v1.DataTableService', | ||
| 264 | method => 'CreateDataTable', | ||
| 265 | request => $request, | ||
| 266 | response_class => $response_class, | ||
| 267 | }); | ||
| 268 | |||
| 269 | return $response; | ||
| 270 | } | ||
| 271 | |||
| 272 | sub get_watchlist { | ||
| 273 | my ($self, %params) = @_; | ||
| 274 | |||
| 275 | my $request_class = 'Google::Cloud::Chronicle::V1::Entity::GetWatchlistRequest'; | ||
| 276 | my $request = eval { $request_class->new(\%params) }; | ||
| 277 | my $new_err = $@; | ||
| 278 | if (!$request) { | ||
| 279 | $request = eval { $request_class->new(%params) }; | ||
| 280 | $new_err ||= $@; | ||
| 281 | } | ||
| 282 | if (!$request) { | ||
| 283 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 284 | } | ||
| 285 | |||
| 286 | my $response_class = 'Google::Cloud::Chronicle::V1::Entity::Watchlist'; | ||
| 287 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 288 | return $self->transport->call({ | ||
| 289 | http_method => 'POST', | ||
| 290 | path => '/google.cloud.chronicle.v1.EntityService/GetWatchlist', | ||
| 291 | request => $request, | ||
| 292 | response_class => $response_class, | ||
| 293 | }); | ||
| 294 | } | ||
| 295 | |||
| 296 | my $response = $self->transport->call({ | ||
| 297 | service => 'google.cloud.chronicle.v1.EntityService', | ||
| 298 | method => 'GetWatchlist', | ||
| 299 | request => $request, | ||
| 300 | response_class => $response_class, | ||
| 301 | }); | ||
| 302 | |||
| 303 | return $response; | ||
| 304 | } | ||
| 305 | |||
| 306 | sub get_featured_content_native_dashboard { | ||
| 307 | my ($self, %params) = @_; | ||
| 308 | |||
| 309 | my $request_class = 'Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard::GetFeaturedContentNativeDashboardRequest'; | ||
| 310 | my $request = eval { $request_class->new(\%params) }; | ||
| 311 | my $new_err = $@; | ||
| 312 | if (!$request) { | ||
| 313 | $request = eval { $request_class->new(%params) }; | ||
| 314 | $new_err ||= $@; | ||
| 315 | } | ||
| 316 | if (!$request) { | ||
| 317 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 318 | } | ||
| 319 | |||
| 320 | my $response_class = 'Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard::FeaturedContentNativeDashboard'; | ||
| 321 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 322 | return $self->transport->call({ | ||
| 323 | http_method => 'POST', | ||
| 324 | path => '/google.cloud.chronicle.v1.FeaturedContentNativeDashboardService/GetFeaturedContentNativeDashboard', | ||
| 325 | request => $request, | ||
| 326 | response_class => $response_class, | ||
| 327 | }); | ||
| 328 | } | ||
| 329 | |||
| 330 | my $response = $self->transport->call({ | ||
| 331 | service => 'google.cloud.chronicle.v1.FeaturedContentNativeDashboardService', | ||
| 332 | method => 'GetFeaturedContentNativeDashboard', | ||
| 333 | request => $request, | ||
| 334 | response_class => $response_class, | ||
| 335 | }); | ||
| 336 | |||
| 337 | return $response; | ||
| 338 | } | ||
| 339 | |||
| 340 | sub install_featured_content_native_dashboard { | ||
| 341 | my ($self, %params) = @_; | ||
| 342 | |||
| 343 | my $request_class = 'Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard::InstallFeaturedContentNativeDashboardRequest'; | ||
| 344 | my $request = eval { $request_class->new(\%params) }; | ||
| 345 | my $new_err = $@; | ||
| 346 | if (!$request) { | ||
| 347 | $request = eval { $request_class->new(%params) }; | ||
| 348 | $new_err ||= $@; | ||
| 349 | } | ||
| 350 | if (!$request) { | ||
| 351 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 352 | } | ||
| 353 | |||
| 354 | my $response_class = 'Google::Cloud::Chronicle::V1::FeaturedContentNativeDashboard::InstallFeaturedContentNativeDashboardResponse'; | ||
| 355 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 356 | return $self->transport->call({ | ||
| 357 | http_method => 'POST', | ||
| 358 | path => '/google.cloud.chronicle.v1.FeaturedContentNativeDashboardService/InstallFeaturedContentNativeDashboard', | ||
| 359 | request => $request, | ||
| 360 | response_class => $response_class, | ||
| 361 | }); | ||
| 362 | } | ||
| 363 | |||
| 364 | my $response = $self->transport->call({ | ||
| 365 | service => 'google.cloud.chronicle.v1.FeaturedContentNativeDashboardService', | ||
| 366 | method => 'InstallFeaturedContentNativeDashboard', | ||
| 367 | request => $request, | ||
| 368 | response_class => $response_class, | ||
| 369 | }); | ||
| 370 | |||
| 371 | return $response; | ||
| 372 | } | ||
| 373 | |||
| 374 | sub fetch_service_account_for_customer { | ||
| 375 | my ($self, %params) = @_; | ||
| 376 | |||
| 377 | my $request_class = 'Google::Cloud::Chronicle::V1::Feed::FetchServiceAccountForCustomerRequest'; | ||
| 378 | my $request = eval { $request_class->new(\%params) }; | ||
| 379 | my $new_err = $@; | ||
| 380 | if (!$request) { | ||
| 381 | $request = eval { $request_class->new(%params) }; | ||
| 382 | $new_err ||= $@; | ||
| 383 | } | ||
| 384 | if (!$request) { | ||
| 385 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 386 | } | ||
| 387 | |||
| 388 | my $response_class = 'Google::Cloud::Chronicle::V1::Feed::FeedServiceAccount'; | ||
| 389 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 390 | return $self->transport->call({ | ||
| 391 | http_method => 'POST', | ||
| 392 | path => '/google.cloud.chronicle.v1.FeedsService/FetchServiceAccountForCustomer', | ||
| 393 | request => $request, | ||
| 394 | response_class => $response_class, | ||
| 395 | }); | ||
| 396 | } | ||
| 397 | |||
| 398 | my $response = $self->transport->call({ | ||
| 399 | service => 'google.cloud.chronicle.v1.FeedsService', | ||
| 400 | method => 'FetchServiceAccountForCustomer', | ||
| 401 | request => $request, | ||
| 402 | response_class => $response_class, | ||
| 403 | }); | ||
| 404 | |||
| 405 | return $response; | ||
| 406 | } | ||
| 407 | |||
| 408 | sub get_findings_refinement { | ||
| 409 | my ($self, %params) = @_; | ||
| 410 | |||
| 411 | my $request_class = 'Google::Cloud::Chronicle::V1::FindingsRefinement::GetFindingsRefinementRequest'; | ||
| 412 | my $request = eval { $request_class->new(\%params) }; | ||
| 413 | my $new_err = $@; | ||
| 414 | if (!$request) { | ||
| 415 | $request = eval { $request_class->new(%params) }; | ||
| 416 | $new_err ||= $@; | ||
| 417 | } | ||
| 418 | if (!$request) { | ||
| 419 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 420 | } | ||
| 421 | |||
| 422 | my $response_class = 'Google::Cloud::Chronicle::V1::FindingsRefinement::FindingsRefinement'; | ||
| 423 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 424 | return $self->transport->call({ | ||
| 425 | http_method => 'POST', | ||
| 426 | path => '/google.cloud.chronicle.v1.FindingsRefinementService/GetFindingsRefinement', | ||
| 427 | request => $request, | ||
| 428 | response_class => $response_class, | ||
| 429 | }); | ||
| 430 | } | ||
| 431 | |||
| 432 | my $response = $self->transport->call({ | ||
| 433 | service => 'google.cloud.chronicle.v1.FindingsRefinementService', | ||
| 434 | method => 'GetFindingsRefinement', | ||
| 435 | request => $request, | ||
| 436 | response_class => $response_class, | ||
| 437 | }); | ||
| 438 | |||
| 439 | return $response; | ||
| 440 | } | ||
| 441 | |||
| 442 | sub get_instance { | ||
| 443 | my ($self, %params) = @_; | ||
| 444 | |||
| 445 | my $request_class = 'Google::Cloud::Chronicle::V1::Instance::GetInstanceRequest'; | ||
| 446 | my $request = eval { $request_class->new(\%params) }; | ||
| 447 | my $new_err = $@; | ||
| 448 | if (!$request) { | ||
| 449 | $request = eval { $request_class->new(%params) }; | ||
| 450 | $new_err ||= $@; | ||
| 451 | } | ||
| 452 | if (!$request) { | ||
| 453 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 454 | } | ||
| 455 | |||
| 456 | my $response_class = 'Google::Cloud::Chronicle::V1::Instance::Instance'; | ||
| 457 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 458 | return $self->transport->call({ | ||
| 459 | http_method => 'POST', | ||
| 460 | path => '/google.cloud.chronicle.v1.InstanceService/GetInstance', | ||
| 461 | request => $request, | ||
| 462 | response_class => $response_class, | ||
| 463 | }); | ||
| 464 | } | ||
| 465 | |||
| 466 | my $response = $self->transport->call({ | ||
| 467 | service => 'google.cloud.chronicle.v1.InstanceService', | ||
| 468 | method => 'GetInstance', | ||
| 469 | request => $request, | ||
| 470 | response_class => $response_class, | ||
| 471 | }); | ||
| 472 | |||
| 473 | return $response; | ||
| 474 | } | ||
| 475 | |||
| 476 | sub create_native_dashboard { | ||
| 477 | my ($self, %params) = @_; | ||
| 478 | |||
| 479 | my $request_class = 'Google::Cloud::Chronicle::V1::NativeDashboard::CreateNativeDashboardRequest'; | ||
| 480 | my $request = eval { $request_class->new(\%params) }; | ||
| 481 | my $new_err = $@; | ||
| 482 | if (!$request) { | ||
| 483 | $request = eval { $request_class->new(%params) }; | ||
| 484 | $new_err ||= $@; | ||
| 485 | } | ||
| 486 | if (!$request) { | ||
| 487 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 488 | } | ||
| 489 | |||
| 490 | my $response_class = 'Google::Cloud::Chronicle::V1::NativeDashboard::NativeDashboard'; | ||
| 491 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 492 | return $self->transport->call({ | ||
| 493 | http_method => 'POST', | ||
| 494 | path => '/google.cloud.chronicle.v1.NativeDashboardService/CreateNativeDashboard', | ||
| 495 | request => $request, | ||
| 496 | response_class => $response_class, | ||
| 497 | }); | ||
| 498 | } | ||
| 499 | |||
| 500 | my $response = $self->transport->call({ | ||
| 501 | service => 'google.cloud.chronicle.v1.NativeDashboardService', | ||
| 502 | method => 'CreateNativeDashboard', | ||
| 503 | request => $request, | ||
| 504 | response_class => $response_class, | ||
| 505 | }); | ||
| 506 | |||
| 507 | return $response; | ||
| 508 | } | ||
| 509 | |||
| 510 | sub get_reference_list { | ||
| 511 | my ($self, %params) = @_; | ||
| 512 | |||
| 513 | my $request_class = 'Google::Cloud::Chronicle::V1::ReferenceList::GetReferenceListRequest'; | ||
| 514 | my $request = eval { $request_class->new(\%params) }; | ||
| 515 | my $new_err = $@; | ||
| 516 | if (!$request) { | ||
| 517 | $request = eval { $request_class->new(%params) }; | ||
| 518 | $new_err ||= $@; | ||
| 519 | } | ||
| 520 | if (!$request) { | ||
| 521 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 522 | } | ||
| 523 | |||
| 524 | my $response_class = 'Google::Cloud::Chronicle::V1::ReferenceList::ReferenceList'; | ||
| 525 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 526 | return $self->transport->call({ | ||
| 527 | http_method => 'POST', | ||
| 528 | path => '/google.cloud.chronicle.v1.ReferenceListService/GetReferenceList', | ||
| 529 | request => $request, | ||
| 530 | response_class => $response_class, | ||
| 531 | }); | ||
| 532 | } | ||
| 533 | |||
| 534 | my $response = $self->transport->call({ | ||
| 535 | service => 'google.cloud.chronicle.v1.ReferenceListService', | ||
| 536 | method => 'GetReferenceList', | ||
| 537 | request => $request, | ||
| 538 | response_class => $response_class, | ||
| 539 | }); | ||
| 540 | |||
| 541 | return $response; | ||
| 542 | } | ||
| 543 | |||
| 544 | sub create_rule { | ||
| 545 | my ($self, %params) = @_; | ||
| 546 | |||
| 547 | my $request_class = 'Google::Cloud::Chronicle::V1::Rule::CreateRuleRequest'; | ||
| 548 | my $request = eval { $request_class->new(\%params) }; | ||
| 549 | my $new_err = $@; | ||
| 550 | if (!$request) { | ||
| 551 | $request = eval { $request_class->new(%params) }; | ||
| 552 | $new_err ||= $@; | ||
| 553 | } | ||
| 554 | if (!$request) { | ||
| 555 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 556 | } | ||
| 557 | |||
| 558 | my $response_class = 'Google::Cloud::Chronicle::V1::Rule::Rule'; | ||
| 559 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 560 | return $self->transport->call({ | ||
| 561 | http_method => 'POST', | ||
| 562 | path => '/google.cloud.chronicle.v1.RuleService/CreateRule', | ||
| 563 | request => $request, | ||
| 564 | response_class => $response_class, | ||
| 565 | }); | ||
| 566 | } | ||
| 567 | |||
| 568 | my $response = $self->transport->call({ | ||
| 569 | service => 'google.cloud.chronicle.v1.RuleService', | ||
| 570 | method => 'CreateRule', | ||
| 571 | request => $request, | ||
| 572 | response_class => $response_class, | ||
| 573 | }); | ||
| 574 | |||
| 575 | return $response; | ||
| 576 | } | ||
| 577 | |||
| 578 | sub list_rule_execution_errors { | ||
| 579 | my ($self, %params) = @_; | ||
| 580 | |||
| 581 | my $request_class = 'Google::Cloud::Chronicle::V1::RuleExecutionError::ListRuleExecutionErrorsRequest'; | ||
| 582 | my $request = eval { $request_class->new(\%params) }; | ||
| 583 | my $new_err = $@; | ||
| 584 | if (!$request) { | ||
| 585 | $request = eval { $request_class->new(%params) }; | ||
| 586 | $new_err ||= $@; | ||
| 587 | } | ||
| 588 | if (!$request) { | ||
| 589 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 590 | } | ||
| 591 | |||
| 592 | my $response_class = 'Google::Cloud::Chronicle::V1::RuleExecutionError::ListRuleExecutionErrorsResponse'; | ||
| 593 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 594 | return $self->transport->call({ | ||
| 595 | http_method => 'POST', | ||
| 596 | path => '/google.cloud.chronicle.v1.RuleExecutionErrorService/ListRuleExecutionErrors', | ||
| 597 | request => $request, | ||
| 598 | response_class => $response_class, | ||
| 599 | }); | ||
| 600 | } | ||
| 601 | |||
| 602 | my $response = $self->transport->call({ | ||
| 603 | service => 'google.cloud.chronicle.v1.RuleExecutionErrorService', | ||
| 604 | method => 'ListRuleExecutionErrors', | ||
| 605 | request => $request, | ||
| 606 | response_class => $response_class, | ||
| 607 | }); | ||
| 608 | |||
| 609 | return $response; | ||
| 610 | } | ||
| 611 | |||
| 612 | sub search { | ||
| 613 | my ($self, %params) = @_; | ||
| 614 | |||
| 615 | my $request_class = 'Google::Cloud::Chronicle::V1::Search::SearchRequest'; | ||
| 616 | my $request = eval { $request_class->new(\%params) }; | ||
| 617 | my $new_err = $@; | ||
| 618 | if (!$request) { | ||
| 619 | $request = eval { $request_class->new(%params) }; | ||
| 620 | $new_err ||= $@; | ||
| 621 | } | ||
| 622 | if (!$request) { | ||
| 623 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 624 | } | ||
| 625 | |||
| 626 | my $response_class = 'Google::Longrunning::Operations::Operation'; | ||
| 627 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 628 | return $self->transport->call({ | ||
| 629 | http_method => 'POST', | ||
| 630 | path => '/google.cloud.chronicle.v1.SearchService/Search', | ||
| 631 | request => $request, | ||
| 632 | response_class => $response_class, | ||
| 633 | }); | ||
| 634 | } | ||
| 635 | |||
| 636 | my $response = $self->transport->call({ | ||
| 637 | service => 'google.cloud.chronicle.v1.SearchService', | ||
| 638 | method => 'Search', | ||
| 639 | request => $request, | ||
| 640 | response_class => $response_class, | ||
| 641 | }); | ||
| 642 | |||
| 643 | return $response; | ||
| 644 | } | ||
| 645 | 1; # End of Google::Cloud::Chronicle::V1 | ||
| 646 | |||
| 647 | __END__ | ||