| 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::MutualAuthenticationApi; | ||
| 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 | # create_mutual_tls_authentication | ||
| 51 | # | ||
| 52 | # Create a Mutual Authentication | ||
| 53 | # | ||
| 54 | # @param MutualAuthentication $mutual_authentication (optional) | ||
| 55 | { | ||
| 56 | my $params = { | ||
| 57 | 'mutual_authentication' => { | ||
| 58 | data_type => 'MutualAuthentication', | ||
| 59 | description => '', | ||
| 60 | required => '0', | ||
| 61 | }, | ||
| 62 | }; | ||
| 63 | __PACKAGE__->method_documentation->{ 'create_mutual_tls_authentication' } = { | ||
| 64 | summary => 'Create a Mutual Authentication', | ||
| 65 | params => $params, | ||
| 66 | returns => 'MutualAuthenticationResponse', | ||
| 67 | }; | ||
| 68 | } | ||
| 69 | # @return MutualAuthenticationResponse | ||
| 70 | # | ||
| 71 | sub create_mutual_tls_authentication { | ||
| 72 | my ($self, %args) = @_; | ||
| 73 | |||
| 74 | # parse inputs | ||
| 75 | my $_resource_path = '/tls/mutual_authentications'; | ||
| 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/vnd.api+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/vnd.api+json'); | ||
| 88 | |||
| 89 | my $_body_data; | ||
| 90 | # body params | ||
| 91 | if ( exists $args{'mutual_authentication'}) { | ||
| 92 | $_body_data = $args{'mutual_authentication'}; | ||
| 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('MutualAuthenticationResponse', $response); | ||
| 106 | return $_response_object; | ||
| 107 | } | ||
| 108 | |||
| 109 | # | ||
| 110 | # delete_mutual_tls | ||
| 111 | # | ||
| 112 | # Delete a Mutual TLS | ||
| 113 | # | ||
| 114 | # @param string $mutual_authentication_id Alphanumeric string identifying a mutual authentication. (required) | ||
| 115 | { | ||
| 116 | my $params = { | ||
| 117 | 'mutual_authentication_id' => { | ||
| 118 | data_type => 'string', | ||
| 119 | description => 'Alphanumeric string identifying a mutual authentication.', | ||
| 120 | required => '1', | ||
| 121 | }, | ||
| 122 | }; | ||
| 123 | __PACKAGE__->method_documentation->{ 'delete_mutual_tls' } = { | ||
| 124 | summary => 'Delete a Mutual TLS', | ||
| 125 | params => $params, | ||
| 126 | returns => undef, | ||
| 127 | }; | ||
| 128 | } | ||
| 129 | # @return void | ||
| 130 | # | ||
| 131 | sub delete_mutual_tls { | ||
| 132 | my ($self, %args) = @_; | ||
| 133 | |||
| 134 | # verify the required parameter 'mutual_authentication_id' is set | ||
| 135 | unless (exists $args{'mutual_authentication_id'}) { | ||
| 136 | croak("Missing the required parameter 'mutual_authentication_id' when calling delete_mutual_tls"); | ||
| 137 | } | ||
| 138 | |||
| 139 | # parse inputs | ||
| 140 | my $_resource_path = '/tls/mutual_authentications/{mutual_authentication_id}'; | ||
| 141 | |||
| 142 | my $_method = 'DELETE'; | ||
| 143 | my $query_params = {}; | ||
| 144 | my $header_params = {}; | ||
| 145 | my $form_params = {}; | ||
| 146 | |||
| 147 | # 'Accept' and 'Content-Type' header | ||
| 148 | my $_header_accept = $self->{api_client}->select_header_accept(); | ||
| 149 | if ($_header_accept) { | ||
| 150 | $header_params->{'Accept'} = $_header_accept; | ||
| 151 | } | ||
| 152 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 153 | |||
| 154 | # path params | ||
| 155 | if ( exists $args{'mutual_authentication_id'}) { | ||
| 156 | my $_base_variable = "{" . "mutual_authentication_id" . "}"; | ||
| 157 | my $_base_value = $self->{api_client}->to_path_value($args{'mutual_authentication_id'}); | ||
| 158 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 159 | } | ||
| 160 | |||
| 161 | my $_body_data; | ||
| 162 | # authentication setting, if any | ||
| 163 | my $auth_settings = [qw(token )]; | ||
| 164 | |||
| 165 | # make the API Call | ||
| 166 | $self->{api_client}->call_api($_resource_path, $_method, | ||
| 167 | $query_params, $form_params, | ||
| 168 | $header_params, $_body_data, $auth_settings); | ||
| 169 | return; | ||
| 170 | } | ||
| 171 | |||
| 172 | # | ||
| 173 | # get_mutual_authentication | ||
| 174 | # | ||
| 175 | # Get a Mutual Authentication | ||
| 176 | # | ||
| 177 | # @param string $mutual_authentication_id Alphanumeric string identifying a mutual authentication. (required) | ||
| 178 | # @param string $include Comma-separated list of related objects to include (optional). Permitted values: `tls_activations`. Including TLS activations will provide you with the TLS domain names that are related to your Mutual TLS authentication. (optional) | ||
| 179 | { | ||
| 180 | my $params = { | ||
| 181 | 'mutual_authentication_id' => { | ||
| 182 | data_type => 'string', | ||
| 183 | description => 'Alphanumeric string identifying a mutual authentication.', | ||
| 184 | required => '1', | ||
| 185 | }, | ||
| 186 | 'include' => { | ||
| 187 | data_type => 'string', | ||
| 188 | description => 'Comma-separated list of related objects to include (optional). Permitted values: `tls_activations`. Including TLS activations will provide you with the TLS domain names that are related to your Mutual TLS authentication. ', | ||
| 189 | required => '0', | ||
| 190 | }, | ||
| 191 | }; | ||
| 192 | __PACKAGE__->method_documentation->{ 'get_mutual_authentication' } = { | ||
| 193 | summary => 'Get a Mutual Authentication', | ||
| 194 | params => $params, | ||
| 195 | returns => 'MutualAuthenticationResponse', | ||
| 196 | }; | ||
| 197 | } | ||
| 198 | # @return MutualAuthenticationResponse | ||
| 199 | # | ||
| 200 | sub get_mutual_authentication { | ||
| 201 | my ($self, %args) = @_; | ||
| 202 | |||
| 203 | # verify the required parameter 'mutual_authentication_id' is set | ||
| 204 | unless (exists $args{'mutual_authentication_id'}) { | ||
| 205 | croak("Missing the required parameter 'mutual_authentication_id' when calling get_mutual_authentication"); | ||
| 206 | } | ||
| 207 | |||
| 208 | # parse inputs | ||
| 209 | my $_resource_path = '/tls/mutual_authentications/{mutual_authentication_id}'; | ||
| 210 | |||
| 211 | my $_method = 'GET'; | ||
| 212 | my $query_params = {}; | ||
| 213 | my $header_params = {}; | ||
| 214 | my $form_params = {}; | ||
| 215 | |||
| 216 | # 'Accept' and 'Content-Type' header | ||
| 217 | my $_header_accept = $self->{api_client}->select_header_accept('application/vnd.api+json'); | ||
| 218 | if ($_header_accept) { | ||
| 219 | $header_params->{'Accept'} = $_header_accept; | ||
| 220 | } | ||
| 221 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 222 | |||
| 223 | # query params | ||
| 224 | if ( exists $args{'include'}) { | ||
| 225 | $query_params->{'include'} = $self->{api_client}->to_query_value($args{'include'}); | ||
| 226 | } | ||
| 227 | |||
| 228 | # path params | ||
| 229 | if ( exists $args{'mutual_authentication_id'}) { | ||
| 230 | my $_base_variable = "{" . "mutual_authentication_id" . "}"; | ||
| 231 | my $_base_value = $self->{api_client}->to_path_value($args{'mutual_authentication_id'}); | ||
| 232 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 233 | } | ||
| 234 | |||
| 235 | my $_body_data; | ||
| 236 | # authentication setting, if any | ||
| 237 | my $auth_settings = [qw(token )]; | ||
| 238 | |||
| 239 | # make the API Call | ||
| 240 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 241 | $query_params, $form_params, | ||
| 242 | $header_params, $_body_data, $auth_settings); | ||
| 243 | if (!$response) { | ||
| 244 | return; | ||
| 245 | } | ||
| 246 | my $_response_object = $self->{api_client}->deserialize('MutualAuthenticationResponse', $response); | ||
| 247 | return $_response_object; | ||
| 248 | } | ||
| 249 | |||
| 250 | # | ||
| 251 | # list_mutual_authentications | ||
| 252 | # | ||
| 253 | # List Mutual Authentications | ||
| 254 | # | ||
| 255 | # @param string $include Comma-separated list of related objects to include (optional). Permitted values: `tls_activations`. Including TLS activations will provide you with the TLS domain names that are related to your Mutual TLS authentication. (optional) | ||
| 256 | # @param int $page[number] Current page. (optional) | ||
| 257 | # @param int $page[size] Number of records per page. (optional, default to 20) | ||
| 258 | { | ||
| 259 | my $params = { | ||
| 260 | 'include' => { | ||
| 261 | data_type => 'string', | ||
| 262 | description => 'Comma-separated list of related objects to include (optional). Permitted values: `tls_activations`. Including TLS activations will provide you with the TLS domain names that are related to your Mutual TLS authentication. ', | ||
| 263 | required => '0', | ||
| 264 | }, | ||
| 265 | 'page[number]' => { | ||
| 266 | data_type => 'int', | ||
| 267 | description => 'Current page.', | ||
| 268 | required => '0', | ||
| 269 | }, | ||
| 270 | 'page[size]' => { | ||
| 271 | data_type => 'int', | ||
| 272 | description => 'Number of records per page.', | ||
| 273 | required => '0', | ||
| 274 | }, | ||
| 275 | }; | ||
| 276 | __PACKAGE__->method_documentation->{ 'list_mutual_authentications' } = { | ||
| 277 | summary => 'List Mutual Authentications', | ||
| 278 | params => $params, | ||
| 279 | returns => 'MutualAuthenticationsResponse', | ||
| 280 | }; | ||
| 281 | } | ||
| 282 | # @return MutualAuthenticationsResponse | ||
| 283 | # | ||
| 284 | sub list_mutual_authentications { | ||
| 285 | my ($self, %args) = @_; | ||
| 286 | |||
| 287 | # parse inputs | ||
| 288 | my $_resource_path = '/tls/mutual_authentications'; | ||
| 289 | |||
| 290 | my $_method = 'GET'; | ||
| 291 | my $query_params = {}; | ||
| 292 | my $header_params = {}; | ||
| 293 | my $form_params = {}; | ||
| 294 | |||
| 295 | # 'Accept' and 'Content-Type' header | ||
| 296 | my $_header_accept = $self->{api_client}->select_header_accept('application/vnd.api+json'); | ||
| 297 | if ($_header_accept) { | ||
| 298 | $header_params->{'Accept'} = $_header_accept; | ||
| 299 | } | ||
| 300 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 301 | |||
| 302 | # query params | ||
| 303 | if ( exists $args{'include'}) { | ||
| 304 | $query_params->{'include'} = $self->{api_client}->to_query_value($args{'include'}); | ||
| 305 | } | ||
| 306 | |||
| 307 | # query params | ||
| 308 | if ( exists $args{'page[number]'}) { | ||
| 309 | $query_params->{'page[number]'} = $self->{api_client}->to_query_value($args{'page[number]'}); | ||
| 310 | } | ||
| 311 | |||
| 312 | # query params | ||
| 313 | if ( exists $args{'page[size]'}) { | ||
| 314 | $query_params->{'page[size]'} = $self->{api_client}->to_query_value($args{'page[size]'}); | ||
| 315 | } | ||
| 316 | |||
| 317 | my $_body_data; | ||
| 318 | # authentication setting, if any | ||
| 319 | my $auth_settings = [qw(token )]; | ||
| 320 | |||
| 321 | # make the API Call | ||
| 322 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 323 | $query_params, $form_params, | ||
| 324 | $header_params, $_body_data, $auth_settings); | ||
| 325 | if (!$response) { | ||
| 326 | return; | ||
| 327 | } | ||
| 328 | my $_response_object = $self->{api_client}->deserialize('MutualAuthenticationsResponse', $response); | ||
| 329 | return $_response_object; | ||
| 330 | } | ||
| 331 | |||
| 332 | # | ||
| 333 | # patch_mutual_authentication | ||
| 334 | # | ||
| 335 | # Update a Mutual Authentication | ||
| 336 | # | ||
| 337 | # @param string $mutual_authentication_id Alphanumeric string identifying a mutual authentication. (required) | ||
| 338 | # @param MutualAuthentication $mutual_authentication (optional) | ||
| 339 | { | ||
| 340 | my $params = { | ||
| 341 | 'mutual_authentication_id' => { | ||
| 342 | data_type => 'string', | ||
| 343 | description => 'Alphanumeric string identifying a mutual authentication.', | ||
| 344 | required => '1', | ||
| 345 | }, | ||
| 346 | 'mutual_authentication' => { | ||
| 347 | data_type => 'MutualAuthentication', | ||
| 348 | description => '', | ||
| 349 | required => '0', | ||
| 350 | }, | ||
| 351 | }; | ||
| 352 | __PACKAGE__->method_documentation->{ 'patch_mutual_authentication' } = { | ||
| 353 | summary => 'Update a Mutual Authentication', | ||
| 354 | params => $params, | ||
| 355 | returns => 'MutualAuthenticationResponse', | ||
| 356 | }; | ||
| 357 | } | ||
| 358 | # @return MutualAuthenticationResponse | ||
| 359 | # | ||
| 360 | sub patch_mutual_authentication { | ||
| 361 | my ($self, %args) = @_; | ||
| 362 | |||
| 363 | # verify the required parameter 'mutual_authentication_id' is set | ||
| 364 | unless (exists $args{'mutual_authentication_id'}) { | ||
| 365 | croak("Missing the required parameter 'mutual_authentication_id' when calling patch_mutual_authentication"); | ||
| 366 | } | ||
| 367 | |||
| 368 | # parse inputs | ||
| 369 | my $_resource_path = '/tls/mutual_authentications/{mutual_authentication_id}'; | ||
| 370 | |||
| 371 | my $_method = 'PATCH'; | ||
| 372 | my $query_params = {}; | ||
| 373 | my $header_params = {}; | ||
| 374 | my $form_params = {}; | ||
| 375 | |||
| 376 | # 'Accept' and 'Content-Type' header | ||
| 377 | my $_header_accept = $self->{api_client}->select_header_accept('application/vnd.api+json'); | ||
| 378 | if ($_header_accept) { | ||
| 379 | $header_params->{'Accept'} = $_header_accept; | ||
| 380 | } | ||
| 381 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/vnd.api+json'); | ||
| 382 | |||
| 383 | # path params | ||
| 384 | if ( exists $args{'mutual_authentication_id'}) { | ||
| 385 | my $_base_variable = "{" . "mutual_authentication_id" . "}"; | ||
| 386 | my $_base_value = $self->{api_client}->to_path_value($args{'mutual_authentication_id'}); | ||
| 387 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 388 | } | ||
| 389 | |||
| 390 | my $_body_data; | ||
| 391 | # body params | ||
| 392 | if ( exists $args{'mutual_authentication'}) { | ||
| 393 | $_body_data = $args{'mutual_authentication'}; | ||
| 394 | } | ||
| 395 | |||
| 396 | # authentication setting, if any | ||
| 397 | my $auth_settings = [qw(token )]; | ||
| 398 | |||
| 399 | # make the API Call | ||
| 400 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 401 | $query_params, $form_params, | ||
| 402 | $header_params, $_body_data, $auth_settings); | ||
| 403 | if (!$response) { | ||
| 404 | return; | ||
| 405 | } | ||
| 406 | my $_response_object = $self->{api_client}->deserialize('MutualAuthenticationResponse', $response); | ||
| 407 | return $_response_object; | ||
| 408 | } | ||
| 409 | |||
| 410 | 1; |