| 1 | # | ||||||||||
| 2 | # This file is part of Cloudflare::API. | ||||||||||
| 3 | # | ||||||||||
| 4 | # This software is copyright (c) 2026 by Andrew Speer <andrew.speer@isolutions.com.au>. | ||||||||||
| 5 | # | ||||||||||
| 6 | # This is free software; you can redistribute it and/or modify it under | ||||||||||
| 7 | # the same terms as the Perl 5 programming language system itself. | ||||||||||
| 8 | # | ||||||||||
| 9 | # Full license text is available at: | ||||||||||
| 10 | # | ||||||||||
| 11 | # <http://dev.perl.org/licenses/> | ||||||||||
| 12 | # | ||||||||||
| 13 | package Cloudflare::API::Hyperdrive; | ||||||||||
| 14 | |||||||||||
| 15 | |||||||||||
| 16 | # Compiler Pragma | ||||||||||
| 17 | # | ||||||||||
| 18 | 1 | ▶ | use strict qw(vars); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 19 | 1 | ▶ | use vars qw(@ISA $VERSION); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 20 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 21 | |||||||||||
| 22 | |||||||||||
| 23 | # Cloudflare::API modules and inheritance | ||||||||||
| 24 | # | ||||||||||
| 25 | 1 | ▶ | use Cloudflare::API::Resource; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 26 | 1 | @ISA=qw(Cloudflare::API::Resource); | |||||||||
| 27 | |||||||||||
| 28 | |||||||||||
| 29 | # Version information | ||||||||||
| 30 | # | ||||||||||
| 31 | 1 | $VERSION='1.011'; | |||||||||
| 32 | |||||||||||
| 33 | |||||||||||
| 34 | # All done. Positive return | ||||||||||
| 35 | # | ||||||||||
| 36 | 1 | 1; | |||||||||
| 37 | |||||||||||
| 38 | |||||||||||
| 39 | #============================================================================ | ||||||||||
| 40 | |||||||||||
| 41 | |||||||||||
| 42 | 1 | ▶ | sub list_configs { | ||||||||
|
Subroutine
list_configs: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 43 | |||||||||||
| 44 | 1 | my ($self, %query)=@_; | |||||||||
| 45 | 1 | return $self->collect_list($self->list_configs_page(%query)); | |||||||||
| 46 | |||||||||||
| 47 | } | ||||||||||
| 48 | |||||||||||
| 49 | |||||||||||
| 50 | 1 | ▶ | sub list_configs_page { | ||||||||
|
Subroutine
list_configs_page: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 51 | |||||||||||
| 52 | 1 | my ($self, %query)=@_; | |||||||||
| 53 | 1 | return $self->list_pagination( | |||||||||
| 54 | $self->api()->account_path('hyperdrive', 'configs'), | ||||||||||
| 55 | { mode => 'page' }, \%query); | ||||||||||
| 56 | |||||||||||
| 57 | } | ||||||||||
| 58 | |||||||||||
| 59 | |||||||||||
| 60 | 0 | ▶ | sub list_configs_page_response { | ||||||||
|
Subroutine
list_configs_page_response: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 61 | |||||||||||
| 62 | 0 | my ($self, %query)=@_; | |||||||||
| 63 | 0 | return $self->list_response( | |||||||||
| 64 | $self->api()->account_path('hyperdrive', 'configs'), \%query); | ||||||||||
| 65 | |||||||||||
| 66 | } | ||||||||||
| 67 | |||||||||||
| 68 | |||||||||||
| 69 | 0 | ▶ | sub get_config { | ||||||||
|
Subroutine
get_config: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 70 | |||||||||||
| 71 | 0 | my ($self, $id, %opt)=@_; | |||||||||
| 72 | 0 | return $self->api()->request('GET', | |||||||||
| 73 | $self->api()->account_path('hyperdrive', 'configs', $id), %opt); | ||||||||||
| 74 | |||||||||||
| 75 | } | ||||||||||
| 76 | |||||||||||
| 77 | |||||||||||
| 78 | 1 | ▶ | sub create_config { | ||||||||
|
Subroutine
create_config: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||
| 79 | |||||||||||
| 80 | 1 | my ($self, $body_hr, %opt)=@_; | |||||||||
| 81 | 1 | ▶ | die "config body must be a hash reference\n" unless ref($body_hr) eq 'HASH'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 82 | 1 | return $self->api()->request('POST', | |||||||||
| 83 | $self->api()->account_path('hyperdrive', 'configs'), json => $body_hr, %opt); | ||||||||||
| 84 | |||||||||||
| 85 | } | ||||||||||
| 86 | |||||||||||
| 87 | |||||||||||
| 88 | 0 | ▶ | sub replace_config { | ||||||||
|
Subroutine
replace_config: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 89 | |||||||||||
| 90 | 0 | my ($self, $id, $body_hr, %opt)=@_; | |||||||||
| 91 | 0 | ▶ | die "config body must be a hash reference\n" unless ref($body_hr) eq 'HASH'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 92 | 0 | return $self->api()->request('PUT', | |||||||||
| 93 | $self->api()->account_path('hyperdrive', 'configs', $id), json => $body_hr, %opt); | ||||||||||
| 94 | |||||||||||
| 95 | } | ||||||||||
| 96 | |||||||||||
| 97 | |||||||||||
| 98 | 1 | ▶ | sub update_config { | ||||||||
|
Subroutine
update_config: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||
| 99 | |||||||||||
| 100 | 1 | my ($self, $id, $body_hr, %opt)=@_; | |||||||||
| 101 | 1 | ▶ | die "config body must be a hash reference\n" unless ref($body_hr) eq 'HASH'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 102 | 1 | return $self->api()->request('PATCH', | |||||||||
| 103 | $self->api()->account_path('hyperdrive', 'configs', $id), json => $body_hr, %opt); | ||||||||||
| 104 | |||||||||||
| 105 | } | ||||||||||
| 106 | |||||||||||
| 107 | |||||||||||
| 108 | 1 | ▶ | sub delete_config { | ||||||||
|
Subroutine
delete_config: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 109 | |||||||||||
| 110 | 1 | my ($self, $id, %opt)=@_; | |||||||||
| 111 | 1 | return $self->api()->request('DELETE', | |||||||||
| 112 | $self->api()->account_path('hyperdrive', 'configs', $id), %opt); | ||||||||||
| 113 | |||||||||||
| 114 | } | ||||||||||
| 115 | __END__ | ||||||||||