| 1 | =begin comment | ||
| 2 | |||
| 3 | Fastly API | ||
| 4 | |||
| 5 | Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) | ||
| 6 | |||
| 7 | The version of the API Spec document: 1.0.0 | ||
| 8 | Contact: oss@fastly.com | ||
| 9 | |||
| 10 | =end comment | ||
| 11 | |||
| 12 | =cut | ||
| 13 | |||
| 14 | # | ||
| 15 | # NOTE: This class is auto generated. | ||
| 16 | # Do not edit the class manually. | ||
| 17 | # | ||
| 18 | package WebService::Fastly::ClientSideProtectionApi; | ||
| 19 | |||
| 20 | require 5.6.0; | ||
| 21 | use strict; | ||
| 22 | use warnings; | ||
| 23 | use utf8; | ||
| 24 | use Exporter; | ||
| 25 | use Carp qw( croak ); | ||
| 26 | use Log::Any qw($log); | ||
| 27 | |||
| 28 | use WebService::Fastly::ApiClient; | ||
| 29 | |||
| 30 | use base "Class::Data::Inheritable"; | ||
| 31 | |||
| 32 | __PACKAGE__->mk_classdata('method_documentation' => {}); | ||
| 33 | |||
| 34 | sub new { | ||
| 35 | my $class = shift; | ||
| 36 | my $api_client; | ||
| 37 | |||
| 38 | if ($_[0] && ref $_[0] && ref $_[0] eq 'WebService::Fastly::ApiClient' ) { | ||
| 39 | $api_client = $_[0]; | ||
| 40 | } else { | ||
| 41 | $api_client = WebService::Fastly::ApiClient->new(@_); | ||
| 42 | } | ||
| 43 | |||
| 44 | bless { api_client => $api_client }, $class; | ||
| 45 | |||
| 46 | } | ||
| 47 | |||
| 48 | |||
| 49 | # | ||
| 50 | # csp_create_page | ||
| 51 | # | ||
| 52 | # Create page | ||
| 53 | # | ||
| 54 | # @param PageCreate $page_create (optional) | ||
| 55 | { | ||
| 56 | my $params = { | ||
| 57 | 'page_create' => { | ||
| 58 | data_type => 'PageCreate', | ||
| 59 | description => '', | ||
| 60 | required => '0', | ||
| 61 | }, | ||
| 62 | }; | ||
| 63 | __PACKAGE__->method_documentation->{ 'csp_create_page' } = { | ||
| 64 | summary => 'Create page', | ||
| 65 | params => $params, | ||
| 66 | returns => 'Page', | ||
| 67 | }; | ||
| 68 | } | ||
| 69 | # @return Page | ||
| 70 | # | ||
| 71 | sub csp_create_page { | ||
| 72 | my ($self, %args) = @_; | ||
| 73 | |||
| 74 | # parse inputs | ||
| 75 | my $_resource_path = '/client-side-protection/v1/pages'; | ||
| 76 | |||
| 77 | my $_method = 'POST'; | ||
| 78 | my $query_params = {}; | ||
| 79 | my $header_params = {}; | ||
| 80 | my $form_params = {}; | ||
| 81 | |||
| 82 | # 'Accept' and 'Content-Type' header | ||
| 83 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 84 | if ($_header_accept) { | ||
| 85 | $header_params->{'Accept'} = $_header_accept; | ||
| 86 | } | ||
| 87 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); | ||
| 88 | |||
| 89 | my $_body_data; | ||
| 90 | # body params | ||
| 91 | if ( exists $args{'page_create'}) { | ||
| 92 | $_body_data = $args{'page_create'}; | ||
| 93 | } | ||
| 94 | |||
| 95 | # authentication setting, if any | ||
| 96 | my $auth_settings = [qw(token )]; | ||
| 97 | |||
| 98 | # make the API Call | ||
| 99 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 100 | $query_params, $form_params, | ||
| 101 | $header_params, $_body_data, $auth_settings); | ||
| 102 | if (!$response) { | ||
| 103 | return; | ||
| 104 | } | ||
| 105 | my $_response_object = $self->{api_client}->deserialize('Page', $response); | ||
| 106 | return $_response_object; | ||
| 107 | } | ||
| 108 | |||
| 109 | # | ||
| 110 | # csp_create_policy | ||
| 111 | # | ||
| 112 | # Create policy | ||
| 113 | # | ||
| 114 | # @param string $page_id Page identifier (required) | ||
| 115 | # @param PolicyCreate $policy_create (optional) | ||
| 116 | { | ||
| 117 | my $params = { | ||
| 118 | 'page_id' => { | ||
| 119 | data_type => 'string', | ||
| 120 | description => 'Page identifier', | ||
| 121 | required => '1', | ||
| 122 | }, | ||
| 123 | 'policy_create' => { | ||
| 124 | data_type => 'PolicyCreate', | ||
| 125 | description => '', | ||
| 126 | required => '0', | ||
| 127 | }, | ||
| 128 | }; | ||
| 129 | __PACKAGE__->method_documentation->{ 'csp_create_policy' } = { | ||
| 130 | summary => 'Create policy', | ||
| 131 | params => $params, | ||
| 132 | returns => 'Policy', | ||
| 133 | }; | ||
| 134 | } | ||
| 135 | # @return Policy | ||
| 136 | # | ||
| 137 | sub csp_create_policy { | ||
| 138 | my ($self, %args) = @_; | ||
| 139 | |||
| 140 | # verify the required parameter 'page_id' is set | ||
| 141 | unless (exists $args{'page_id'}) { | ||
| 142 | croak("Missing the required parameter 'page_id' when calling csp_create_policy"); | ||
| 143 | } | ||
| 144 | |||
| 145 | # parse inputs | ||
| 146 | my $_resource_path = '/client-side-protection/v1/pages/{page_id}/policies'; | ||
| 147 | |||
| 148 | my $_method = 'POST'; | ||
| 149 | my $query_params = {}; | ||
| 150 | my $header_params = {}; | ||
| 151 | my $form_params = {}; | ||
| 152 | |||
| 153 | # 'Accept' and 'Content-Type' header | ||
| 154 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 155 | if ($_header_accept) { | ||
| 156 | $header_params->{'Accept'} = $_header_accept; | ||
| 157 | } | ||
| 158 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); | ||
| 159 | |||
| 160 | # path params | ||
| 161 | if ( exists $args{'page_id'}) { | ||
| 162 | my $_base_variable = "{" . "page_id" . "}"; | ||
| 163 | my $_base_value = $self->{api_client}->to_path_value($args{'page_id'}); | ||
| 164 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 165 | } | ||
| 166 | |||
| 167 | my $_body_data; | ||
| 168 | # body params | ||
| 169 | if ( exists $args{'policy_create'}) { | ||
| 170 | $_body_data = $args{'policy_create'}; | ||
| 171 | } | ||
| 172 | |||
| 173 | # authentication setting, if any | ||
| 174 | my $auth_settings = [qw(token )]; | ||
| 175 | |||
| 176 | # make the API Call | ||
| 177 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 178 | $query_params, $form_params, | ||
| 179 | $header_params, $_body_data, $auth_settings); | ||
| 180 | if (!$response) { | ||
| 181 | return; | ||
| 182 | } | ||
| 183 | my $_response_object = $self->{api_client}->deserialize('Policy', $response); | ||
| 184 | return $_response_object; | ||
| 185 | } | ||
| 186 | |||
| 187 | # | ||
| 188 | # csp_create_website | ||
| 189 | # | ||
| 190 | # Create website | ||
| 191 | # | ||
| 192 | # @param WebsiteCreate $website_create (optional) | ||
| 193 | { | ||
| 194 | my $params = { | ||
| 195 | 'website_create' => { | ||
| 196 | data_type => 'WebsiteCreate', | ||
| 197 | description => '', | ||
| 198 | required => '0', | ||
| 199 | }, | ||
| 200 | }; | ||
| 201 | __PACKAGE__->method_documentation->{ 'csp_create_website' } = { | ||
| 202 | summary => 'Create website', | ||
| 203 | params => $params, | ||
| 204 | returns => 'Website', | ||
| 205 | }; | ||
| 206 | } | ||
| 207 | # @return Website | ||
| 208 | # | ||
| 209 | sub csp_create_website { | ||
| 210 | my ($self, %args) = @_; | ||
| 211 | |||
| 212 | # parse inputs | ||
| 213 | my $_resource_path = '/client-side-protection/v1/websites'; | ||
| 214 | |||
| 215 | my $_method = 'POST'; | ||
| 216 | my $query_params = {}; | ||
| 217 | my $header_params = {}; | ||
| 218 | my $form_params = {}; | ||
| 219 | |||
| 220 | # 'Accept' and 'Content-Type' header | ||
| 221 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 222 | if ($_header_accept) { | ||
| 223 | $header_params->{'Accept'} = $_header_accept; | ||
| 224 | } | ||
| 225 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); | ||
| 226 | |||
| 227 | my $_body_data; | ||
| 228 | # body params | ||
| 229 | if ( exists $args{'website_create'}) { | ||
| 230 | $_body_data = $args{'website_create'}; | ||
| 231 | } | ||
| 232 | |||
| 233 | # authentication setting, if any | ||
| 234 | my $auth_settings = [qw(token )]; | ||
| 235 | |||
| 236 | # make the API Call | ||
| 237 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 238 | $query_params, $form_params, | ||
| 239 | $header_params, $_body_data, $auth_settings); | ||
| 240 | if (!$response) { | ||
| 241 | return; | ||
| 242 | } | ||
| 243 | my $_response_object = $self->{api_client}->deserialize('Website', $response); | ||
| 244 | return $_response_object; | ||
| 245 | } | ||
| 246 | |||
| 247 | # | ||
| 248 | # csp_delete_page | ||
| 249 | # | ||
| 250 | # Delete page | ||
| 251 | # | ||
| 252 | # @param string $page_id Page identifier (required) | ||
| 253 | { | ||
| 254 | my $params = { | ||
| 255 | 'page_id' => { | ||
| 256 | data_type => 'string', | ||
| 257 | description => 'Page identifier', | ||
| 258 | required => '1', | ||
| 259 | }, | ||
| 260 | }; | ||
| 261 | __PACKAGE__->method_documentation->{ 'csp_delete_page' } = { | ||
| 262 | summary => 'Delete page', | ||
| 263 | params => $params, | ||
| 264 | returns => undef, | ||
| 265 | }; | ||
| 266 | } | ||
| 267 | # @return void | ||
| 268 | # | ||
| 269 | sub csp_delete_page { | ||
| 270 | my ($self, %args) = @_; | ||
| 271 | |||
| 272 | # verify the required parameter 'page_id' is set | ||
| 273 | unless (exists $args{'page_id'}) { | ||
| 274 | croak("Missing the required parameter 'page_id' when calling csp_delete_page"); | ||
| 275 | } | ||
| 276 | |||
| 277 | # parse inputs | ||
| 278 | my $_resource_path = '/client-side-protection/v1/pages/{page_id}'; | ||
| 279 | |||
| 280 | my $_method = 'DELETE'; | ||
| 281 | my $query_params = {}; | ||
| 282 | my $header_params = {}; | ||
| 283 | my $form_params = {}; | ||
| 284 | |||
| 285 | # 'Accept' and 'Content-Type' header | ||
| 286 | my $_header_accept = $self->{api_client}->select_header_accept('application/problem+json'); | ||
| 287 | if ($_header_accept) { | ||
| 288 | $header_params->{'Accept'} = $_header_accept; | ||
| 289 | } | ||
| 290 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 291 | |||
| 292 | # path params | ||
| 293 | if ( exists $args{'page_id'}) { | ||
| 294 | my $_base_variable = "{" . "page_id" . "}"; | ||
| 295 | my $_base_value = $self->{api_client}->to_path_value($args{'page_id'}); | ||
| 296 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 297 | } | ||
| 298 | |||
| 299 | my $_body_data; | ||
| 300 | # authentication setting, if any | ||
| 301 | my $auth_settings = [qw(token )]; | ||
| 302 | |||
| 303 | # make the API Call | ||
| 304 | $self->{api_client}->call_api($_resource_path, $_method, | ||
| 305 | $query_params, $form_params, | ||
| 306 | $header_params, $_body_data, $auth_settings); | ||
| 307 | return; | ||
| 308 | } | ||
| 309 | |||
| 310 | # | ||
| 311 | # csp_delete_website | ||
| 312 | # | ||
| 313 | # Delete website | ||
| 314 | # | ||
| 315 | # @param string $website_id Website identifier (required) | ||
| 316 | { | ||
| 317 | my $params = { | ||
| 318 | 'website_id' => { | ||
| 319 | data_type => 'string', | ||
| 320 | description => 'Website identifier', | ||
| 321 | required => '1', | ||
| 322 | }, | ||
| 323 | }; | ||
| 324 | __PACKAGE__->method_documentation->{ 'csp_delete_website' } = { | ||
| 325 | summary => 'Delete website', | ||
| 326 | params => $params, | ||
| 327 | returns => undef, | ||
| 328 | }; | ||
| 329 | } | ||
| 330 | # @return void | ||
| 331 | # | ||
| 332 | sub csp_delete_website { | ||
| 333 | my ($self, %args) = @_; | ||
| 334 | |||
| 335 | # verify the required parameter 'website_id' is set | ||
| 336 | unless (exists $args{'website_id'}) { | ||
| 337 | croak("Missing the required parameter 'website_id' when calling csp_delete_website"); | ||
| 338 | } | ||
| 339 | |||
| 340 | # parse inputs | ||
| 341 | my $_resource_path = '/client-side-protection/v1/websites/{website_id}'; | ||
| 342 | |||
| 343 | my $_method = 'DELETE'; | ||
| 344 | my $query_params = {}; | ||
| 345 | my $header_params = {}; | ||
| 346 | my $form_params = {}; | ||
| 347 | |||
| 348 | # 'Accept' and 'Content-Type' header | ||
| 349 | my $_header_accept = $self->{api_client}->select_header_accept('application/problem+json'); | ||
| 350 | if ($_header_accept) { | ||
| 351 | $header_params->{'Accept'} = $_header_accept; | ||
| 352 | } | ||
| 353 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 354 | |||
| 355 | # path params | ||
| 356 | if ( exists $args{'website_id'}) { | ||
| 357 | my $_base_variable = "{" . "website_id" . "}"; | ||
| 358 | my $_base_value = $self->{api_client}->to_path_value($args{'website_id'}); | ||
| 359 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 360 | } | ||
| 361 | |||
| 362 | my $_body_data; | ||
| 363 | # authentication setting, if any | ||
| 364 | my $auth_settings = [qw(token )]; | ||
| 365 | |||
| 366 | # make the API Call | ||
| 367 | $self->{api_client}->call_api($_resource_path, $_method, | ||
| 368 | $query_params, $form_params, | ||
| 369 | $header_params, $_body_data, $auth_settings); | ||
| 370 | return; | ||
| 371 | } | ||
| 372 | |||
| 373 | # | ||
| 374 | # csp_get_page | ||
| 375 | # | ||
| 376 | # Get page | ||
| 377 | # | ||
| 378 | # @param string $page_id Page identifier (required) | ||
| 379 | { | ||
| 380 | my $params = { | ||
| 381 | 'page_id' => { | ||
| 382 | data_type => 'string', | ||
| 383 | description => 'Page identifier', | ||
| 384 | required => '1', | ||
| 385 | }, | ||
| 386 | }; | ||
| 387 | __PACKAGE__->method_documentation->{ 'csp_get_page' } = { | ||
| 388 | summary => 'Get page', | ||
| 389 | params => $params, | ||
| 390 | returns => 'Page', | ||
| 391 | }; | ||
| 392 | } | ||
| 393 | # @return Page | ||
| 394 | # | ||
| 395 | sub csp_get_page { | ||
| 396 | my ($self, %args) = @_; | ||
| 397 | |||
| 398 | # verify the required parameter 'page_id' is set | ||
| 399 | unless (exists $args{'page_id'}) { | ||
| 400 | croak("Missing the required parameter 'page_id' when calling csp_get_page"); | ||
| 401 | } | ||
| 402 | |||
| 403 | # parse inputs | ||
| 404 | my $_resource_path = '/client-side-protection/v1/pages/{page_id}'; | ||
| 405 | |||
| 406 | my $_method = 'GET'; | ||
| 407 | my $query_params = {}; | ||
| 408 | my $header_params = {}; | ||
| 409 | my $form_params = {}; | ||
| 410 | |||
| 411 | # 'Accept' and 'Content-Type' header | ||
| 412 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 413 | if ($_header_accept) { | ||
| 414 | $header_params->{'Accept'} = $_header_accept; | ||
| 415 | } | ||
| 416 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 417 | |||
| 418 | # path params | ||
| 419 | if ( exists $args{'page_id'}) { | ||
| 420 | my $_base_variable = "{" . "page_id" . "}"; | ||
| 421 | my $_base_value = $self->{api_client}->to_path_value($args{'page_id'}); | ||
| 422 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 423 | } | ||
| 424 | |||
| 425 | my $_body_data; | ||
| 426 | # authentication setting, if any | ||
| 427 | my $auth_settings = [qw(token )]; | ||
| 428 | |||
| 429 | # make the API Call | ||
| 430 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 431 | $query_params, $form_params, | ||
| 432 | $header_params, $_body_data, $auth_settings); | ||
| 433 | if (!$response) { | ||
| 434 | return; | ||
| 435 | } | ||
| 436 | my $_response_object = $self->{api_client}->deserialize('Page', $response); | ||
| 437 | return $_response_object; | ||
| 438 | } | ||
| 439 | |||
| 440 | # | ||
| 441 | # csp_get_policy | ||
| 442 | # | ||
| 443 | # Get policy | ||
| 444 | # | ||
| 445 | # @param string $page_id Page identifier (required) | ||
| 446 | # @param string $policy_id Policy identifier (required) | ||
| 447 | { | ||
| 448 | my $params = { | ||
| 449 | 'page_id' => { | ||
| 450 | data_type => 'string', | ||
| 451 | description => 'Page identifier', | ||
| 452 | required => '1', | ||
| 453 | }, | ||
| 454 | 'policy_id' => { | ||
| 455 | data_type => 'string', | ||
| 456 | description => 'Policy identifier', | ||
| 457 | required => '1', | ||
| 458 | }, | ||
| 459 | }; | ||
| 460 | __PACKAGE__->method_documentation->{ 'csp_get_policy' } = { | ||
| 461 | summary => 'Get policy', | ||
| 462 | params => $params, | ||
| 463 | returns => 'Policy', | ||
| 464 | }; | ||
| 465 | } | ||
| 466 | # @return Policy | ||
| 467 | # | ||
| 468 | sub csp_get_policy { | ||
| 469 | my ($self, %args) = @_; | ||
| 470 | |||
| 471 | # verify the required parameter 'page_id' is set | ||
| 472 | unless (exists $args{'page_id'}) { | ||
| 473 | croak("Missing the required parameter 'page_id' when calling csp_get_policy"); | ||
| 474 | } | ||
| 475 | |||
| 476 | # verify the required parameter 'policy_id' is set | ||
| 477 | unless (exists $args{'policy_id'}) { | ||
| 478 | croak("Missing the required parameter 'policy_id' when calling csp_get_policy"); | ||
| 479 | } | ||
| 480 | |||
| 481 | # parse inputs | ||
| 482 | my $_resource_path = '/client-side-protection/v1/pages/{page_id}/policies/{policy_id}'; | ||
| 483 | |||
| 484 | my $_method = 'GET'; | ||
| 485 | my $query_params = {}; | ||
| 486 | my $header_params = {}; | ||
| 487 | my $form_params = {}; | ||
| 488 | |||
| 489 | # 'Accept' and 'Content-Type' header | ||
| 490 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 491 | if ($_header_accept) { | ||
| 492 | $header_params->{'Accept'} = $_header_accept; | ||
| 493 | } | ||
| 494 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 495 | |||
| 496 | # path params | ||
| 497 | if ( exists $args{'page_id'}) { | ||
| 498 | my $_base_variable = "{" . "page_id" . "}"; | ||
| 499 | my $_base_value = $self->{api_client}->to_path_value($args{'page_id'}); | ||
| 500 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 501 | } | ||
| 502 | |||
| 503 | # path params | ||
| 504 | if ( exists $args{'policy_id'}) { | ||
| 505 | my $_base_variable = "{" . "policy_id" . "}"; | ||
| 506 | my $_base_value = $self->{api_client}->to_path_value($args{'policy_id'}); | ||
| 507 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 508 | } | ||
| 509 | |||
| 510 | my $_body_data; | ||
| 511 | # authentication setting, if any | ||
| 512 | my $auth_settings = [qw(token )]; | ||
| 513 | |||
| 514 | # make the API Call | ||
| 515 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 516 | $query_params, $form_params, | ||
| 517 | $header_params, $_body_data, $auth_settings); | ||
| 518 | if (!$response) { | ||
| 519 | return; | ||
| 520 | } | ||
| 521 | my $_response_object = $self->{api_client}->deserialize('Policy', $response); | ||
| 522 | return $_response_object; | ||
| 523 | } | ||
| 524 | |||
| 525 | # | ||
| 526 | # csp_get_script | ||
| 527 | # | ||
| 528 | # Get script | ||
| 529 | # | ||
| 530 | # @param string $page_id Page identifier (required) | ||
| 531 | # @param string $script_id Script identifier (required) | ||
| 532 | { | ||
| 533 | my $params = { | ||
| 534 | 'page_id' => { | ||
| 535 | data_type => 'string', | ||
| 536 | description => 'Page identifier', | ||
| 537 | required => '1', | ||
| 538 | }, | ||
| 539 | 'script_id' => { | ||
| 540 | data_type => 'string', | ||
| 541 | description => 'Script identifier', | ||
| 542 | required => '1', | ||
| 543 | }, | ||
| 544 | }; | ||
| 545 | __PACKAGE__->method_documentation->{ 'csp_get_script' } = { | ||
| 546 | summary => 'Get script', | ||
| 547 | params => $params, | ||
| 548 | returns => 'Script', | ||
| 549 | }; | ||
| 550 | } | ||
| 551 | # @return Script | ||
| 552 | # | ||
| 553 | sub csp_get_script { | ||
| 554 | my ($self, %args) = @_; | ||
| 555 | |||
| 556 | # verify the required parameter 'page_id' is set | ||
| 557 | unless (exists $args{'page_id'}) { | ||
| 558 | croak("Missing the required parameter 'page_id' when calling csp_get_script"); | ||
| 559 | } | ||
| 560 | |||
| 561 | # verify the required parameter 'script_id' is set | ||
| 562 | unless (exists $args{'script_id'}) { | ||
| 563 | croak("Missing the required parameter 'script_id' when calling csp_get_script"); | ||
| 564 | } | ||
| 565 | |||
| 566 | # parse inputs | ||
| 567 | my $_resource_path = '/client-side-protection/v1/pages/{page_id}/scripts/{script_id}'; | ||
| 568 | |||
| 569 | my $_method = 'GET'; | ||
| 570 | my $query_params = {}; | ||
| 571 | my $header_params = {}; | ||
| 572 | my $form_params = {}; | ||
| 573 | |||
| 574 | # 'Accept' and 'Content-Type' header | ||
| 575 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 576 | if ($_header_accept) { | ||
| 577 | $header_params->{'Accept'} = $_header_accept; | ||
| 578 | } | ||
| 579 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 580 | |||
| 581 | # path params | ||
| 582 | if ( exists $args{'page_id'}) { | ||
| 583 | my $_base_variable = "{" . "page_id" . "}"; | ||
| 584 | my $_base_value = $self->{api_client}->to_path_value($args{'page_id'}); | ||
| 585 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 586 | } | ||
| 587 | |||
| 588 | # path params | ||
| 589 | if ( exists $args{'script_id'}) { | ||
| 590 | my $_base_variable = "{" . "script_id" . "}"; | ||
| 591 | my $_base_value = $self->{api_client}->to_path_value($args{'script_id'}); | ||
| 592 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 593 | } | ||
| 594 | |||
| 595 | my $_body_data; | ||
| 596 | # authentication setting, if any | ||
| 597 | my $auth_settings = [qw(token )]; | ||
| 598 | |||
| 599 | # make the API Call | ||
| 600 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 601 | $query_params, $form_params, | ||
| 602 | $header_params, $_body_data, $auth_settings); | ||
| 603 | if (!$response) { | ||
| 604 | return; | ||
| 605 | } | ||
| 606 | my $_response_object = $self->{api_client}->deserialize('Script', $response); | ||
| 607 | return $_response_object; | ||
| 608 | } | ||
| 609 | |||
| 610 | # | ||
| 611 | # csp_get_website | ||
| 612 | # | ||
| 613 | # Get website | ||
| 614 | # | ||
| 615 | # @param string $website_id Website identifier (required) | ||
| 616 | { | ||
| 617 | my $params = { | ||
| 618 | 'website_id' => { | ||
| 619 | data_type => 'string', | ||
| 620 | description => 'Website identifier', | ||
| 621 | required => '1', | ||
| 622 | }, | ||
| 623 | }; | ||
| 624 | __PACKAGE__->method_documentation->{ 'csp_get_website' } = { | ||
| 625 | summary => 'Get website', | ||
| 626 | params => $params, | ||
| 627 | returns => 'Website', | ||
| 628 | }; | ||
| 629 | } | ||
| 630 | # @return Website | ||
| 631 | # | ||
| 632 | sub csp_get_website { | ||
| 633 | my ($self, %args) = @_; | ||
| 634 | |||
| 635 | # verify the required parameter 'website_id' is set | ||
| 636 | unless (exists $args{'website_id'}) { | ||
| 637 | croak("Missing the required parameter 'website_id' when calling csp_get_website"); | ||
| 638 | } | ||
| 639 | |||
| 640 | # parse inputs | ||
| 641 | my $_resource_path = '/client-side-protection/v1/websites/{website_id}'; | ||
| 642 | |||
| 643 | my $_method = 'GET'; | ||
| 644 | my $query_params = {}; | ||
| 645 | my $header_params = {}; | ||
| 646 | my $form_params = {}; | ||
| 647 | |||
| 648 | # 'Accept' and 'Content-Type' header | ||
| 649 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 650 | if ($_header_accept) { | ||
| 651 | $header_params->{'Accept'} = $_header_accept; | ||
| 652 | } | ||
| 653 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 654 | |||
| 655 | # path params | ||
| 656 | if ( exists $args{'website_id'}) { | ||
| 657 | my $_base_variable = "{" . "website_id" . "}"; | ||
| 658 | my $_base_value = $self->{api_client}->to_path_value($args{'website_id'}); | ||
| 659 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 660 | } | ||
| 661 | |||
| 662 | my $_body_data; | ||
| 663 | # authentication setting, if any | ||
| 664 | my $auth_settings = [qw(token )]; | ||
| 665 | |||
| 666 | # make the API Call | ||
| 667 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 668 | $query_params, $form_params, | ||
| 669 | $header_params, $_body_data, $auth_settings); | ||
| 670 | if (!$response) { | ||
| 671 | return; | ||
| 672 | } | ||
| 673 | my $_response_object = $self->{api_client}->deserialize('Website', $response); | ||
| 674 | return $_response_object; | ||
| 675 | } | ||
| 676 | |||
| 677 | # | ||
| 678 | # csp_list_header_events | ||
| 679 | # | ||
| 680 | # List header events | ||
| 681 | # | ||
| 682 | # @param string $page_id Page identifier (required) | ||
| 683 | # @param int $limit Limit how many results are returned. (optional, default to 100) | ||
| 684 | # @param int $page Page number of the collection to request. (optional, default to 0) | ||
| 685 | { | ||
| 686 | my $params = { | ||
| 687 | 'page_id' => { | ||
| 688 | data_type => 'string', | ||
| 689 | description => 'Page identifier', | ||
| 690 | required => '1', | ||
| 691 | }, | ||
| 692 | 'limit' => { | ||
| 693 | data_type => 'int', | ||
| 694 | description => 'Limit how many results are returned.', | ||
| 695 | required => '0', | ||
| 696 | }, | ||
| 697 | 'page' => { | ||
| 698 | data_type => 'int', | ||
| 699 | description => 'Page number of the collection to request.', | ||
| 700 | required => '0', | ||
| 701 | }, | ||
| 702 | }; | ||
| 703 | __PACKAGE__->method_documentation->{ 'csp_list_header_events' } = { | ||
| 704 | summary => 'List header events', | ||
| 705 | params => $params, | ||
| 706 | returns => 'InlineResponse20011', | ||
| 707 | }; | ||
| 708 | } | ||
| 709 | # @return InlineResponse20011 | ||
| 710 | # | ||
| 711 | sub csp_list_header_events { | ||
| 712 | my ($self, %args) = @_; | ||
| 713 | |||
| 714 | # verify the required parameter 'page_id' is set | ||
| 715 | unless (exists $args{'page_id'}) { | ||
| 716 | croak("Missing the required parameter 'page_id' when calling csp_list_header_events"); | ||
| 717 | } | ||
| 718 | |||
| 719 | # parse inputs | ||
| 720 | my $_resource_path = '/client-side-protection/v1/pages/{page_id}/events'; | ||
| 721 | |||
| 722 | my $_method = 'GET'; | ||
| 723 | my $query_params = {}; | ||
| 724 | my $header_params = {}; | ||
| 725 | my $form_params = {}; | ||
| 726 | |||
| 727 | # 'Accept' and 'Content-Type' header | ||
| 728 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 729 | if ($_header_accept) { | ||
| 730 | $header_params->{'Accept'} = $_header_accept; | ||
| 731 | } | ||
| 732 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 733 | |||
| 734 | # query params | ||
| 735 | if ( exists $args{'limit'}) { | ||
| 736 | $query_params->{'limit'} = $self->{api_client}->to_query_value($args{'limit'}); | ||
| 737 | } | ||
| 738 | |||
| 739 | # query params | ||
| 740 | if ( exists $args{'page'}) { | ||
| 741 | $query_params->{'page'} = $self->{api_client}->to_query_value($args{'page'}); | ||
| 742 | } | ||
| 743 | |||
| 744 | # path params | ||
| 745 | if ( exists $args{'page_id'}) { | ||
| 746 | my $_base_variable = "{" . "page_id" . "}"; | ||
| 747 | my $_base_value = $self->{api_client}->to_path_value($args{'page_id'}); | ||
| 748 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 749 | } | ||
| 750 | |||
| 751 | my $_body_data; | ||
| 752 | # authentication setting, if any | ||
| 753 | my $auth_settings = [qw(token )]; | ||
| 754 | |||
| 755 | # make the API Call | ||
| 756 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 757 | $query_params, $form_params, | ||
| 758 | $header_params, $_body_data, $auth_settings); | ||
| 759 | if (!$response) { | ||
| 760 | return; | ||
| 761 | } | ||
| 762 | my $_response_object = $self->{api_client}->deserialize('InlineResponse20011', $response); | ||
| 763 | return $_response_object; | ||
| 764 | } | ||
| 765 | |||
| 766 | # | ||
| 767 | # csp_list_headers | ||
| 768 | # | ||
| 769 | # List security headers | ||
| 770 | # | ||
| 771 | # @param string $page_id Page identifier (required) | ||
| 772 | # @param int $limit Limit how many results are returned. (optional, default to 100) | ||
| 773 | # @param int $page Page number of the collection to request. (optional, default to 0) | ||
| 774 | { | ||
| 775 | my $params = { | ||
| 776 | 'page_id' => { | ||
| 777 | data_type => 'string', | ||
| 778 | description => 'Page identifier', | ||
| 779 | required => '1', | ||
| 780 | }, | ||
| 781 | 'limit' => { | ||
| 782 | data_type => 'int', | ||
| 783 | description => 'Limit how many results are returned.', | ||
| 784 | required => '0', | ||
| 785 | }, | ||
| 786 | 'page' => { | ||
| 787 | data_type => 'int', | ||
| 788 | description => 'Page number of the collection to request.', | ||
| 789 | required => '0', | ||
| 790 | }, | ||
| 791 | }; | ||
| 792 | __PACKAGE__->method_documentation->{ 'csp_list_headers' } = { | ||
| 793 | summary => 'List security headers', | ||
| 794 | params => $params, | ||
| 795 | returns => 'InlineResponse20010', | ||
| 796 | }; | ||
| 797 | } | ||
| 798 | # @return InlineResponse20010 | ||
| 799 | # | ||
| 800 | sub csp_list_headers { | ||
| 801 | my ($self, %args) = @_; | ||
| 802 | |||
| 803 | # verify the required parameter 'page_id' is set | ||
| 804 | unless (exists $args{'page_id'}) { | ||
| 805 | croak("Missing the required parameter 'page_id' when calling csp_list_headers"); | ||
| 806 | } | ||
| 807 | |||
| 808 | # parse inputs | ||
| 809 | my $_resource_path = '/client-side-protection/v1/pages/{page_id}/headers'; | ||
| 810 | |||
| 811 | my $_method = 'GET'; | ||
| 812 | my $query_params = {}; | ||
| 813 | my $header_params = {}; | ||
| 814 | my $form_params = {}; | ||
| 815 | |||
| 816 | # 'Accept' and 'Content-Type' header | ||
| 817 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 818 | if ($_header_accept) { | ||
| 819 | $header_params->{'Accept'} = $_header_accept; | ||
| 820 | } | ||
| 821 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 822 | |||
| 823 | # query params | ||
| 824 | if ( exists $args{'limit'}) { | ||
| 825 | $query_params->{'limit'} = $self->{api_client}->to_query_value($args{'limit'}); | ||
| 826 | } | ||
| 827 | |||
| 828 | # query params | ||
| 829 | if ( exists $args{'page'}) { | ||
| 830 | $query_params->{'page'} = $self->{api_client}->to_query_value($args{'page'}); | ||
| 831 | } | ||
| 832 | |||
| 833 | # path params | ||
| 834 | if ( exists $args{'page_id'}) { | ||
| 835 | my $_base_variable = "{" . "page_id" . "}"; | ||
| 836 | my $_base_value = $self->{api_client}->to_path_value($args{'page_id'}); | ||
| 837 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 838 | } | ||
| 839 | |||
| 840 | my $_body_data; | ||
| 841 | # authentication setting, if any | ||
| 842 | my $auth_settings = [qw(token )]; | ||
| 843 | |||
| 844 | # make the API Call | ||
| 845 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 846 | $query_params, $form_params, | ||
| 847 | $header_params, $_body_data, $auth_settings); | ||
| 848 | if (!$response) { | ||
| 849 | return; | ||
| 850 | } | ||
| 851 | my $_response_object = $self->{api_client}->deserialize('InlineResponse20010', $response); | ||
| 852 | return $_response_object; | ||
| 853 | } | ||
| 854 | |||
| 855 | # | ||
| 856 | # csp_list_pages | ||
| 857 | # | ||
| 858 | # List pages | ||
| 859 | # | ||
| 860 | # @param string $website_id Filter pages by website ID (optional) | ||
| 861 | # @param int $limit Limit how many results are returned. (optional, default to 100) | ||
| 862 | # @param int $page Page number of the collection to request. (optional, default to 0) | ||
| 863 | { | ||
| 864 | my $params = { | ||
| 865 | 'website_id' => { | ||
| 866 | data_type => 'string', | ||
| 867 | description => 'Filter pages by website ID', | ||
| 868 | required => '0', | ||
| 869 | }, | ||
| 870 | 'limit' => { | ||
| 871 | data_type => 'int', | ||
| 872 | description => 'Limit how many results are returned.', | ||
| 873 | required => '0', | ||
| 874 | }, | ||
| 875 | 'page' => { | ||
| 876 | data_type => 'int', | ||
| 877 | description => 'Page number of the collection to request.', | ||
| 878 | required => '0', | ||
| 879 | }, | ||
| 880 | }; | ||
| 881 | __PACKAGE__->method_documentation->{ 'csp_list_pages' } = { | ||
| 882 | summary => 'List pages', | ||
| 883 | params => $params, | ||
| 884 | returns => 'InlineResponse2006', | ||
| 885 | }; | ||
| 886 | } | ||
| 887 | # @return InlineResponse2006 | ||
| 888 | # | ||
| 889 | sub csp_list_pages { | ||
| 890 | my ($self, %args) = @_; | ||
| 891 | |||
| 892 | # parse inputs | ||
| 893 | my $_resource_path = '/client-side-protection/v1/pages'; | ||
| 894 | |||
| 895 | my $_method = 'GET'; | ||
| 896 | my $query_params = {}; | ||
| 897 | my $header_params = {}; | ||
| 898 | my $form_params = {}; | ||
| 899 | |||
| 900 | # 'Accept' and 'Content-Type' header | ||
| 901 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 902 | if ($_header_accept) { | ||
| 903 | $header_params->{'Accept'} = $_header_accept; | ||
| 904 | } | ||
| 905 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 906 | |||
| 907 | # query params | ||
| 908 | if ( exists $args{'website_id'}) { | ||
| 909 | $query_params->{'website_id'} = $self->{api_client}->to_query_value($args{'website_id'}); | ||
| 910 | } | ||
| 911 | |||
| 912 | # query params | ||
| 913 | if ( exists $args{'limit'}) { | ||
| 914 | $query_params->{'limit'} = $self->{api_client}->to_query_value($args{'limit'}); | ||
| 915 | } | ||
| 916 | |||
| 917 | # query params | ||
| 918 | if ( exists $args{'page'}) { | ||
| 919 | $query_params->{'page'} = $self->{api_client}->to_query_value($args{'page'}); | ||
| 920 | } | ||
| 921 | |||
| 922 | my $_body_data; | ||
| 923 | # authentication setting, if any | ||
| 924 | my $auth_settings = [qw(token )]; | ||
| 925 | |||
| 926 | # make the API Call | ||
| 927 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 928 | $query_params, $form_params, | ||
| 929 | $header_params, $_body_data, $auth_settings); | ||
| 930 | if (!$response) { | ||
| 931 | return; | ||
| 932 | } | ||
| 933 | my $_response_object = $self->{api_client}->deserialize('InlineResponse2006', $response); | ||
| 934 | return $_response_object; | ||
| 935 | } | ||
| 936 | |||
| 937 | # | ||
| 938 | # csp_list_policies | ||
| 939 | # | ||
| 940 | # List policies | ||
| 941 | # | ||
| 942 | # @param string $page_id Page identifier (required) | ||
| 943 | # @param int $limit Limit how many results are returned. (optional, default to 100) | ||
| 944 | # @param int $page Page number of the collection to request. (optional, default to 0) | ||
| 945 | { | ||
| 946 | my $params = { | ||
| 947 | 'page_id' => { | ||
| 948 | data_type => 'string', | ||
| 949 | description => 'Page identifier', | ||
| 950 | required => '1', | ||
| 951 | }, | ||
| 952 | 'limit' => { | ||
| 953 | data_type => 'int', | ||
| 954 | description => 'Limit how many results are returned.', | ||
| 955 | required => '0', | ||
| 956 | }, | ||
| 957 | 'page' => { | ||
| 958 | data_type => 'int', | ||
| 959 | description => 'Page number of the collection to request.', | ||
| 960 | required => '0', | ||
| 961 | }, | ||
| 962 | }; | ||
| 963 | __PACKAGE__->method_documentation->{ 'csp_list_policies' } = { | ||
| 964 | summary => 'List policies', | ||
| 965 | params => $params, | ||
| 966 | returns => 'InlineResponse2008', | ||
| 967 | }; | ||
| 968 | } | ||
| 969 | # @return InlineResponse2008 | ||
| 970 | # | ||
| 971 | sub csp_list_policies { | ||
| 972 | my ($self, %args) = @_; | ||
| 973 | |||
| 974 | # verify the required parameter 'page_id' is set | ||
| 975 | unless (exists $args{'page_id'}) { | ||
| 976 | croak("Missing the required parameter 'page_id' when calling csp_list_policies"); | ||
| 977 | } | ||
| 978 | |||
| 979 | # parse inputs | ||
| 980 | my $_resource_path = '/client-side-protection/v1/pages/{page_id}/policies'; | ||
| 981 | |||
| 982 | my $_method = 'GET'; | ||
| 983 | my $query_params = {}; | ||
| 984 | my $header_params = {}; | ||
| 985 | my $form_params = {}; | ||
| 986 | |||
| 987 | # 'Accept' and 'Content-Type' header | ||
| 988 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 989 | if ($_header_accept) { | ||
| 990 | $header_params->{'Accept'} = $_header_accept; | ||
| 991 | } | ||
| 992 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 993 | |||
| 994 | # query params | ||
| 995 | if ( exists $args{'limit'}) { | ||
| 996 | $query_params->{'limit'} = $self->{api_client}->to_query_value($args{'limit'}); | ||
| 997 | } | ||
| 998 | |||
| 999 | # query params | ||
| 1000 | if ( exists $args{'page'}) { | ||
| 1001 | $query_params->{'page'} = $self->{api_client}->to_query_value($args{'page'}); | ||
| 1002 | } | ||
| 1003 | |||
| 1004 | # path params | ||
| 1005 | if ( exists $args{'page_id'}) { | ||
| 1006 | my $_base_variable = "{" . "page_id" . "}"; | ||
| 1007 | my $_base_value = $self->{api_client}->to_path_value($args{'page_id'}); | ||
| 1008 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 1009 | } | ||
| 1010 | |||
| 1011 | my $_body_data; | ||
| 1012 | # authentication setting, if any | ||
| 1013 | my $auth_settings = [qw(token )]; | ||
| 1014 | |||
| 1015 | # make the API Call | ||
| 1016 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 1017 | $query_params, $form_params, | ||
| 1018 | $header_params, $_body_data, $auth_settings); | ||
| 1019 | if (!$response) { | ||
| 1020 | return; | ||
| 1021 | } | ||
| 1022 | my $_response_object = $self->{api_client}->deserialize('InlineResponse2008', $response); | ||
| 1023 | return $_response_object; | ||
| 1024 | } | ||
| 1025 | |||
| 1026 | # | ||
| 1027 | # csp_list_policy_reports | ||
| 1028 | # | ||
| 1029 | # List policy reports | ||
| 1030 | # | ||
| 1031 | # @param string $page_id Page identifier (required) | ||
| 1032 | # @param string $policy_id Policy identifier (required) | ||
| 1033 | # @param int $limit Limit how many results are returned. (optional, default to 100) | ||
| 1034 | # @param int $page Page number of the collection to request. (optional, default to 0) | ||
| 1035 | { | ||
| 1036 | my $params = { | ||
| 1037 | 'page_id' => { | ||
| 1038 | data_type => 'string', | ||
| 1039 | description => 'Page identifier', | ||
| 1040 | required => '1', | ||
| 1041 | }, | ||
| 1042 | 'policy_id' => { | ||
| 1043 | data_type => 'string', | ||
| 1044 | description => 'Policy identifier', | ||
| 1045 | required => '1', | ||
| 1046 | }, | ||
| 1047 | 'limit' => { | ||
| 1048 | data_type => 'int', | ||
| 1049 | description => 'Limit how many results are returned.', | ||
| 1050 | required => '0', | ||
| 1051 | }, | ||
| 1052 | 'page' => { | ||
| 1053 | data_type => 'int', | ||
| 1054 | description => 'Page number of the collection to request.', | ||
| 1055 | required => '0', | ||
| 1056 | }, | ||
| 1057 | }; | ||
| 1058 | __PACKAGE__->method_documentation->{ 'csp_list_policy_reports' } = { | ||
| 1059 | summary => 'List policy reports', | ||
| 1060 | params => $params, | ||
| 1061 | returns => 'InlineResponse2009', | ||
| 1062 | }; | ||
| 1063 | } | ||
| 1064 | # @return InlineResponse2009 | ||
| 1065 | # | ||
| 1066 | sub csp_list_policy_reports { | ||
| 1067 | my ($self, %args) = @_; | ||
| 1068 | |||
| 1069 | # verify the required parameter 'page_id' is set | ||
| 1070 | unless (exists $args{'page_id'}) { | ||
| 1071 | croak("Missing the required parameter 'page_id' when calling csp_list_policy_reports"); | ||
| 1072 | } | ||
| 1073 | |||
| 1074 | # verify the required parameter 'policy_id' is set | ||
| 1075 | unless (exists $args{'policy_id'}) { | ||
| 1076 | croak("Missing the required parameter 'policy_id' when calling csp_list_policy_reports"); | ||
| 1077 | } | ||
| 1078 | |||
| 1079 | # parse inputs | ||
| 1080 | my $_resource_path = '/client-side-protection/v1/pages/{page_id}/policies/{policy_id}/reports'; | ||
| 1081 | |||
| 1082 | my $_method = 'GET'; | ||
| 1083 | my $query_params = {}; | ||
| 1084 | my $header_params = {}; | ||
| 1085 | my $form_params = {}; | ||
| 1086 | |||
| 1087 | # 'Accept' and 'Content-Type' header | ||
| 1088 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 1089 | if ($_header_accept) { | ||
| 1090 | $header_params->{'Accept'} = $_header_accept; | ||
| 1091 | } | ||
| 1092 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 1093 | |||
| 1094 | # query params | ||
| 1095 | if ( exists $args{'limit'}) { | ||
| 1096 | $query_params->{'limit'} = $self->{api_client}->to_query_value($args{'limit'}); | ||
| 1097 | } | ||
| 1098 | |||
| 1099 | # query params | ||
| 1100 | if ( exists $args{'page'}) { | ||
| 1101 | $query_params->{'page'} = $self->{api_client}->to_query_value($args{'page'}); | ||
| 1102 | } | ||
| 1103 | |||
| 1104 | # path params | ||
| 1105 | if ( exists $args{'page_id'}) { | ||
| 1106 | my $_base_variable = "{" . "page_id" . "}"; | ||
| 1107 | my $_base_value = $self->{api_client}->to_path_value($args{'page_id'}); | ||
| 1108 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 1109 | } | ||
| 1110 | |||
| 1111 | # path params | ||
| 1112 | if ( exists $args{'policy_id'}) { | ||
| 1113 | my $_base_variable = "{" . "policy_id" . "}"; | ||
| 1114 | my $_base_value = $self->{api_client}->to_path_value($args{'policy_id'}); | ||
| 1115 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 1116 | } | ||
| 1117 | |||
| 1118 | my $_body_data; | ||
| 1119 | # authentication setting, if any | ||
| 1120 | my $auth_settings = [qw(token )]; | ||
| 1121 | |||
| 1122 | # make the API Call | ||
| 1123 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 1124 | $query_params, $form_params, | ||
| 1125 | $header_params, $_body_data, $auth_settings); | ||
| 1126 | if (!$response) { | ||
| 1127 | return; | ||
| 1128 | } | ||
| 1129 | my $_response_object = $self->{api_client}->deserialize('InlineResponse2009', $response); | ||
| 1130 | return $_response_object; | ||
| 1131 | } | ||
| 1132 | |||
| 1133 | # | ||
| 1134 | # csp_list_scripts | ||
| 1135 | # | ||
| 1136 | # List scripts | ||
| 1137 | # | ||
| 1138 | # @param string $page_id Page identifier (required) | ||
| 1139 | # @param int $limit Limit how many results are returned. (optional, default to 100) | ||
| 1140 | # @param int $page Page number of the collection to request. (optional, default to 0) | ||
| 1141 | { | ||
| 1142 | my $params = { | ||
| 1143 | 'page_id' => { | ||
| 1144 | data_type => 'string', | ||
| 1145 | description => 'Page identifier', | ||
| 1146 | required => '1', | ||
| 1147 | }, | ||
| 1148 | 'limit' => { | ||
| 1149 | data_type => 'int', | ||
| 1150 | description => 'Limit how many results are returned.', | ||
| 1151 | required => '0', | ||
| 1152 | }, | ||
| 1153 | 'page' => { | ||
| 1154 | data_type => 'int', | ||
| 1155 | description => 'Page number of the collection to request.', | ||
| 1156 | required => '0', | ||
| 1157 | }, | ||
| 1158 | }; | ||
| 1159 | __PACKAGE__->method_documentation->{ 'csp_list_scripts' } = { | ||
| 1160 | summary => 'List scripts', | ||
| 1161 | params => $params, | ||
| 1162 | returns => 'InlineResponse2007', | ||
| 1163 | }; | ||
| 1164 | } | ||
| 1165 | # @return InlineResponse2007 | ||
| 1166 | # | ||
| 1167 | sub csp_list_scripts { | ||
| 1168 | my ($self, %args) = @_; | ||
| 1169 | |||
| 1170 | # verify the required parameter 'page_id' is set | ||
| 1171 | unless (exists $args{'page_id'}) { | ||
| 1172 | croak("Missing the required parameter 'page_id' when calling csp_list_scripts"); | ||
| 1173 | } | ||
| 1174 | |||
| 1175 | # parse inputs | ||
| 1176 | my $_resource_path = '/client-side-protection/v1/pages/{page_id}/scripts'; | ||
| 1177 | |||
| 1178 | my $_method = 'GET'; | ||
| 1179 | my $query_params = {}; | ||
| 1180 | my $header_params = {}; | ||
| 1181 | my $form_params = {}; | ||
| 1182 | |||
| 1183 | # 'Accept' and 'Content-Type' header | ||
| 1184 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 1185 | if ($_header_accept) { | ||
| 1186 | $header_params->{'Accept'} = $_header_accept; | ||
| 1187 | } | ||
| 1188 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 1189 | |||
| 1190 | # query params | ||
| 1191 | if ( exists $args{'limit'}) { | ||
| 1192 | $query_params->{'limit'} = $self->{api_client}->to_query_value($args{'limit'}); | ||
| 1193 | } | ||
| 1194 | |||
| 1195 | # query params | ||
| 1196 | if ( exists $args{'page'}) { | ||
| 1197 | $query_params->{'page'} = $self->{api_client}->to_query_value($args{'page'}); | ||
| 1198 | } | ||
| 1199 | |||
| 1200 | # path params | ||
| 1201 | if ( exists $args{'page_id'}) { | ||
| 1202 | my $_base_variable = "{" . "page_id" . "}"; | ||
| 1203 | my $_base_value = $self->{api_client}->to_path_value($args{'page_id'}); | ||
| 1204 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 1205 | } | ||
| 1206 | |||
| 1207 | my $_body_data; | ||
| 1208 | # authentication setting, if any | ||
| 1209 | my $auth_settings = [qw(token )]; | ||
| 1210 | |||
| 1211 | # make the API Call | ||
| 1212 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 1213 | $query_params, $form_params, | ||
| 1214 | $header_params, $_body_data, $auth_settings); | ||
| 1215 | if (!$response) { | ||
| 1216 | return; | ||
| 1217 | } | ||
| 1218 | my $_response_object = $self->{api_client}->deserialize('InlineResponse2007', $response); | ||
| 1219 | return $_response_object; | ||
| 1220 | } | ||
| 1221 | |||
| 1222 | # | ||
| 1223 | # csp_list_websites | ||
| 1224 | # | ||
| 1225 | # List websites | ||
| 1226 | # | ||
| 1227 | # @param int $limit Limit how many results are returned. (optional, default to 100) | ||
| 1228 | # @param int $page Page number of the collection to request. (optional, default to 0) | ||
| 1229 | { | ||
| 1230 | my $params = { | ||
| 1231 | 'limit' => { | ||
| 1232 | data_type => 'int', | ||
| 1233 | description => 'Limit how many results are returned.', | ||
| 1234 | required => '0', | ||
| 1235 | }, | ||
| 1236 | 'page' => { | ||
| 1237 | data_type => 'int', | ||
| 1238 | description => 'Page number of the collection to request.', | ||
| 1239 | required => '0', | ||
| 1240 | }, | ||
| 1241 | }; | ||
| 1242 | __PACKAGE__->method_documentation->{ 'csp_list_websites' } = { | ||
| 1243 | summary => 'List websites', | ||
| 1244 | params => $params, | ||
| 1245 | returns => 'InlineResponse2005', | ||
| 1246 | }; | ||
| 1247 | } | ||
| 1248 | # @return InlineResponse2005 | ||
| 1249 | # | ||
| 1250 | sub csp_list_websites { | ||
| 1251 | my ($self, %args) = @_; | ||
| 1252 | |||
| 1253 | # parse inputs | ||
| 1254 | my $_resource_path = '/client-side-protection/v1/websites'; | ||
| 1255 | |||
| 1256 | my $_method = 'GET'; | ||
| 1257 | my $query_params = {}; | ||
| 1258 | my $header_params = {}; | ||
| 1259 | my $form_params = {}; | ||
| 1260 | |||
| 1261 | # 'Accept' and 'Content-Type' header | ||
| 1262 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 1263 | if ($_header_accept) { | ||
| 1264 | $header_params->{'Accept'} = $_header_accept; | ||
| 1265 | } | ||
| 1266 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 1267 | |||
| 1268 | # query params | ||
| 1269 | if ( exists $args{'limit'}) { | ||
| 1270 | $query_params->{'limit'} = $self->{api_client}->to_query_value($args{'limit'}); | ||
| 1271 | } | ||
| 1272 | |||
| 1273 | # query params | ||
| 1274 | if ( exists $args{'page'}) { | ||
| 1275 | $query_params->{'page'} = $self->{api_client}->to_query_value($args{'page'}); | ||
| 1276 | } | ||
| 1277 | |||
| 1278 | my $_body_data; | ||
| 1279 | # authentication setting, if any | ||
| 1280 | my $auth_settings = [qw(token )]; | ||
| 1281 | |||
| 1282 | # make the API Call | ||
| 1283 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 1284 | $query_params, $form_params, | ||
| 1285 | $header_params, $_body_data, $auth_settings); | ||
| 1286 | if (!$response) { | ||
| 1287 | return; | ||
| 1288 | } | ||
| 1289 | my $_response_object = $self->{api_client}->deserialize('InlineResponse2005', $response); | ||
| 1290 | return $_response_object; | ||
| 1291 | } | ||
| 1292 | |||
| 1293 | # | ||
| 1294 | # csp_update_page | ||
| 1295 | # | ||
| 1296 | # Update page | ||
| 1297 | # | ||
| 1298 | # @param string $page_id Page identifier (required) | ||
| 1299 | # @param PageUpdate $page_update (optional) | ||
| 1300 | { | ||
| 1301 | my $params = { | ||
| 1302 | 'page_id' => { | ||
| 1303 | data_type => 'string', | ||
| 1304 | description => 'Page identifier', | ||
| 1305 | required => '1', | ||
| 1306 | }, | ||
| 1307 | 'page_update' => { | ||
| 1308 | data_type => 'PageUpdate', | ||
| 1309 | description => '', | ||
| 1310 | required => '0', | ||
| 1311 | }, | ||
| 1312 | }; | ||
| 1313 | __PACKAGE__->method_documentation->{ 'csp_update_page' } = { | ||
| 1314 | summary => 'Update page', | ||
| 1315 | params => $params, | ||
| 1316 | returns => 'Page', | ||
| 1317 | }; | ||
| 1318 | } | ||
| 1319 | # @return Page | ||
| 1320 | # | ||
| 1321 | sub csp_update_page { | ||
| 1322 | my ($self, %args) = @_; | ||
| 1323 | |||
| 1324 | # verify the required parameter 'page_id' is set | ||
| 1325 | unless (exists $args{'page_id'}) { | ||
| 1326 | croak("Missing the required parameter 'page_id' when calling csp_update_page"); | ||
| 1327 | } | ||
| 1328 | |||
| 1329 | # parse inputs | ||
| 1330 | my $_resource_path = '/client-side-protection/v1/pages/{page_id}'; | ||
| 1331 | |||
| 1332 | my $_method = 'PATCH'; | ||
| 1333 | my $query_params = {}; | ||
| 1334 | my $header_params = {}; | ||
| 1335 | my $form_params = {}; | ||
| 1336 | |||
| 1337 | # 'Accept' and 'Content-Type' header | ||
| 1338 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 1339 | if ($_header_accept) { | ||
| 1340 | $header_params->{'Accept'} = $_header_accept; | ||
| 1341 | } | ||
| 1342 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); | ||
| 1343 | |||
| 1344 | # path params | ||
| 1345 | if ( exists $args{'page_id'}) { | ||
| 1346 | my $_base_variable = "{" . "page_id" . "}"; | ||
| 1347 | my $_base_value = $self->{api_client}->to_path_value($args{'page_id'}); | ||
| 1348 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 1349 | } | ||
| 1350 | |||
| 1351 | my $_body_data; | ||
| 1352 | # body params | ||
| 1353 | if ( exists $args{'page_update'}) { | ||
| 1354 | $_body_data = $args{'page_update'}; | ||
| 1355 | } | ||
| 1356 | |||
| 1357 | # authentication setting, if any | ||
| 1358 | my $auth_settings = [qw(token )]; | ||
| 1359 | |||
| 1360 | # make the API Call | ||
| 1361 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 1362 | $query_params, $form_params, | ||
| 1363 | $header_params, $_body_data, $auth_settings); | ||
| 1364 | if (!$response) { | ||
| 1365 | return; | ||
| 1366 | } | ||
| 1367 | my $_response_object = $self->{api_client}->deserialize('Page', $response); | ||
| 1368 | return $_response_object; | ||
| 1369 | } | ||
| 1370 | |||
| 1371 | # | ||
| 1372 | # csp_update_policy | ||
| 1373 | # | ||
| 1374 | # Update policy | ||
| 1375 | # | ||
| 1376 | # @param string $page_id Page identifier (required) | ||
| 1377 | # @param string $policy_id Policy identifier (required) | ||
| 1378 | # @param PolicyUpdate $policy_update (optional) | ||
| 1379 | { | ||
| 1380 | my $params = { | ||
| 1381 | 'page_id' => { | ||
| 1382 | data_type => 'string', | ||
| 1383 | description => 'Page identifier', | ||
| 1384 | required => '1', | ||
| 1385 | }, | ||
| 1386 | 'policy_id' => { | ||
| 1387 | data_type => 'string', | ||
| 1388 | description => 'Policy identifier', | ||
| 1389 | required => '1', | ||
| 1390 | }, | ||
| 1391 | 'policy_update' => { | ||
| 1392 | data_type => 'PolicyUpdate', | ||
| 1393 | description => '', | ||
| 1394 | required => '0', | ||
| 1395 | }, | ||
| 1396 | }; | ||
| 1397 | __PACKAGE__->method_documentation->{ 'csp_update_policy' } = { | ||
| 1398 | summary => 'Update policy', | ||
| 1399 | params => $params, | ||
| 1400 | returns => 'Policy', | ||
| 1401 | }; | ||
| 1402 | } | ||
| 1403 | # @return Policy | ||
| 1404 | # | ||
| 1405 | sub csp_update_policy { | ||
| 1406 | my ($self, %args) = @_; | ||
| 1407 | |||
| 1408 | # verify the required parameter 'page_id' is set | ||
| 1409 | unless (exists $args{'page_id'}) { | ||
| 1410 | croak("Missing the required parameter 'page_id' when calling csp_update_policy"); | ||
| 1411 | } | ||
| 1412 | |||
| 1413 | # verify the required parameter 'policy_id' is set | ||
| 1414 | unless (exists $args{'policy_id'}) { | ||
| 1415 | croak("Missing the required parameter 'policy_id' when calling csp_update_policy"); | ||
| 1416 | } | ||
| 1417 | |||
| 1418 | # parse inputs | ||
| 1419 | my $_resource_path = '/client-side-protection/v1/pages/{page_id}/policies/{policy_id}'; | ||
| 1420 | |||
| 1421 | my $_method = 'PATCH'; | ||
| 1422 | my $query_params = {}; | ||
| 1423 | my $header_params = {}; | ||
| 1424 | my $form_params = {}; | ||
| 1425 | |||
| 1426 | # 'Accept' and 'Content-Type' header | ||
| 1427 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 1428 | if ($_header_accept) { | ||
| 1429 | $header_params->{'Accept'} = $_header_accept; | ||
| 1430 | } | ||
| 1431 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); | ||
| 1432 | |||
| 1433 | # path params | ||
| 1434 | if ( exists $args{'page_id'}) { | ||
| 1435 | my $_base_variable = "{" . "page_id" . "}"; | ||
| 1436 | my $_base_value = $self->{api_client}->to_path_value($args{'page_id'}); | ||
| 1437 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 1438 | } | ||
| 1439 | |||
| 1440 | # path params | ||
| 1441 | if ( exists $args{'policy_id'}) { | ||
| 1442 | my $_base_variable = "{" . "policy_id" . "}"; | ||
| 1443 | my $_base_value = $self->{api_client}->to_path_value($args{'policy_id'}); | ||
| 1444 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 1445 | } | ||
| 1446 | |||
| 1447 | my $_body_data; | ||
| 1448 | # body params | ||
| 1449 | if ( exists $args{'policy_update'}) { | ||
| 1450 | $_body_data = $args{'policy_update'}; | ||
| 1451 | } | ||
| 1452 | |||
| 1453 | # authentication setting, if any | ||
| 1454 | my $auth_settings = [qw(token )]; | ||
| 1455 | |||
| 1456 | # make the API Call | ||
| 1457 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 1458 | $query_params, $form_params, | ||
| 1459 | $header_params, $_body_data, $auth_settings); | ||
| 1460 | if (!$response) { | ||
| 1461 | return; | ||
| 1462 | } | ||
| 1463 | my $_response_object = $self->{api_client}->deserialize('Policy', $response); | ||
| 1464 | return $_response_object; | ||
| 1465 | } | ||
| 1466 | |||
| 1467 | # | ||
| 1468 | # csp_update_script | ||
| 1469 | # | ||
| 1470 | # Update script | ||
| 1471 | # | ||
| 1472 | # @param string $page_id Page identifier (required) | ||
| 1473 | # @param string $script_id Script identifier (required) | ||
| 1474 | # @param ScriptUpdate $script_update (optional) | ||
| 1475 | { | ||
| 1476 | my $params = { | ||
| 1477 | 'page_id' => { | ||
| 1478 | data_type => 'string', | ||
| 1479 | description => 'Page identifier', | ||
| 1480 | required => '1', | ||
| 1481 | }, | ||
| 1482 | 'script_id' => { | ||
| 1483 | data_type => 'string', | ||
| 1484 | description => 'Script identifier', | ||
| 1485 | required => '1', | ||
| 1486 | }, | ||
| 1487 | 'script_update' => { | ||
| 1488 | data_type => 'ScriptUpdate', | ||
| 1489 | description => '', | ||
| 1490 | required => '0', | ||
| 1491 | }, | ||
| 1492 | }; | ||
| 1493 | __PACKAGE__->method_documentation->{ 'csp_update_script' } = { | ||
| 1494 | summary => 'Update script', | ||
| 1495 | params => $params, | ||
| 1496 | returns => 'Script', | ||
| 1497 | }; | ||
| 1498 | } | ||
| 1499 | # @return Script | ||
| 1500 | # | ||
| 1501 | sub csp_update_script { | ||
| 1502 | my ($self, %args) = @_; | ||
| 1503 | |||
| 1504 | # verify the required parameter 'page_id' is set | ||
| 1505 | unless (exists $args{'page_id'}) { | ||
| 1506 | croak("Missing the required parameter 'page_id' when calling csp_update_script"); | ||
| 1507 | } | ||
| 1508 | |||
| 1509 | # verify the required parameter 'script_id' is set | ||
| 1510 | unless (exists $args{'script_id'}) { | ||
| 1511 | croak("Missing the required parameter 'script_id' when calling csp_update_script"); | ||
| 1512 | } | ||
| 1513 | |||
| 1514 | # parse inputs | ||
| 1515 | my $_resource_path = '/client-side-protection/v1/pages/{page_id}/scripts/{script_id}'; | ||
| 1516 | |||
| 1517 | my $_method = 'PATCH'; | ||
| 1518 | my $query_params = {}; | ||
| 1519 | my $header_params = {}; | ||
| 1520 | my $form_params = {}; | ||
| 1521 | |||
| 1522 | # 'Accept' and 'Content-Type' header | ||
| 1523 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 1524 | if ($_header_accept) { | ||
| 1525 | $header_params->{'Accept'} = $_header_accept; | ||
| 1526 | } | ||
| 1527 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); | ||
| 1528 | |||
| 1529 | # path params | ||
| 1530 | if ( exists $args{'page_id'}) { | ||
| 1531 | my $_base_variable = "{" . "page_id" . "}"; | ||
| 1532 | my $_base_value = $self->{api_client}->to_path_value($args{'page_id'}); | ||
| 1533 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 1534 | } | ||
| 1535 | |||
| 1536 | # path params | ||
| 1537 | if ( exists $args{'script_id'}) { | ||
| 1538 | my $_base_variable = "{" . "script_id" . "}"; | ||
| 1539 | my $_base_value = $self->{api_client}->to_path_value($args{'script_id'}); | ||
| 1540 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 1541 | } | ||
| 1542 | |||
| 1543 | my $_body_data; | ||
| 1544 | # body params | ||
| 1545 | if ( exists $args{'script_update'}) { | ||
| 1546 | $_body_data = $args{'script_update'}; | ||
| 1547 | } | ||
| 1548 | |||
| 1549 | # authentication setting, if any | ||
| 1550 | my $auth_settings = [qw(token )]; | ||
| 1551 | |||
| 1552 | # make the API Call | ||
| 1553 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 1554 | $query_params, $form_params, | ||
| 1555 | $header_params, $_body_data, $auth_settings); | ||
| 1556 | if (!$response) { | ||
| 1557 | return; | ||
| 1558 | } | ||
| 1559 | my $_response_object = $self->{api_client}->deserialize('Script', $response); | ||
| 1560 | return $_response_object; | ||
| 1561 | } | ||
| 1562 | |||
| 1563 | # | ||
| 1564 | # csp_update_website | ||
| 1565 | # | ||
| 1566 | # Update website | ||
| 1567 | # | ||
| 1568 | # @param string $website_id Website identifier (required) | ||
| 1569 | # @param WebsiteUpdate $website_update (optional) | ||
| 1570 | { | ||
| 1571 | my $params = { | ||
| 1572 | 'website_id' => { | ||
| 1573 | data_type => 'string', | ||
| 1574 | description => 'Website identifier', | ||
| 1575 | required => '1', | ||
| 1576 | }, | ||
| 1577 | 'website_update' => { | ||
| 1578 | data_type => 'WebsiteUpdate', | ||
| 1579 | description => '', | ||
| 1580 | required => '0', | ||
| 1581 | }, | ||
| 1582 | }; | ||
| 1583 | __PACKAGE__->method_documentation->{ 'csp_update_website' } = { | ||
| 1584 | summary => 'Update website', | ||
| 1585 | params => $params, | ||
| 1586 | returns => 'Website', | ||
| 1587 | }; | ||
| 1588 | } | ||
| 1589 | # @return Website | ||
| 1590 | # | ||
| 1591 | sub csp_update_website { | ||
| 1592 | my ($self, %args) = @_; | ||
| 1593 | |||
| 1594 | # verify the required parameter 'website_id' is set | ||
| 1595 | unless (exists $args{'website_id'}) { | ||
| 1596 | croak("Missing the required parameter 'website_id' when calling csp_update_website"); | ||
| 1597 | } | ||
| 1598 | |||
| 1599 | # parse inputs | ||
| 1600 | my $_resource_path = '/client-side-protection/v1/websites/{website_id}'; | ||
| 1601 | |||
| 1602 | my $_method = 'PATCH'; | ||
| 1603 | my $query_params = {}; | ||
| 1604 | my $header_params = {}; | ||
| 1605 | my $form_params = {}; | ||
| 1606 | |||
| 1607 | # 'Accept' and 'Content-Type' header | ||
| 1608 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 1609 | if ($_header_accept) { | ||
| 1610 | $header_params->{'Accept'} = $_header_accept; | ||
| 1611 | } | ||
| 1612 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); | ||
| 1613 | |||
| 1614 | # path params | ||
| 1615 | if ( exists $args{'website_id'}) { | ||
| 1616 | my $_base_variable = "{" . "website_id" . "}"; | ||
| 1617 | my $_base_value = $self->{api_client}->to_path_value($args{'website_id'}); | ||
| 1618 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 1619 | } | ||
| 1620 | |||
| 1621 | my $_body_data; | ||
| 1622 | # body params | ||
| 1623 | if ( exists $args{'website_update'}) { | ||
| 1624 | $_body_data = $args{'website_update'}; | ||
| 1625 | } | ||
| 1626 | |||
| 1627 | # authentication setting, if any | ||
| 1628 | my $auth_settings = [qw(token )]; | ||
| 1629 | |||
| 1630 | # make the API Call | ||
| 1631 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 1632 | $query_params, $form_params, | ||
| 1633 | $header_params, $_body_data, $auth_settings); | ||
| 1634 | if (!$response) { | ||
| 1635 | return; | ||
| 1636 | } | ||
| 1637 | my $_response_object = $self->{api_client}->deserialize('Website', $response); | ||
| 1638 | return $_response_object; | ||
| 1639 | } | ||
| 1640 | |||
| 1641 | 1; |