| 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::Accounts; | ||
| 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 { |
|
Subroutine
list: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 43 | |||
| 44 | 1 | my ($self, %query)=@_; | |
| 45 | 1 | return $self->collect_list($self->list_page(%query)); | |
| 46 | |||
| 47 | } | ||
| 48 | |||
| 49 | |||
| 50 | 1 | ▶ | sub list_page { |
|
Subroutine
list_page: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 51 | |||
| 52 | 1 | my ($self, %query)=@_; | |
| 53 | 1 | return $self->list_pagination('/accounts', { mode => 'page' }, \%query); | |
| 54 | |||
| 55 | } | ||
| 56 | |||
| 57 | |||
| 58 | 0 | ▶ | sub list_page_response { |
|
Subroutine
list_page_response: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 59 | |||
| 60 | 0 | my ($self, %query)=@_; | |
| 61 | 0 | return $self->list_response('/accounts', \%query); | |
| 62 | |||
| 63 | } | ||
| 64 | |||
| 65 | |||
| 66 | 0 | ▶ | sub get { |
|
Subroutine
get: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 67 | |||
| 68 | |||
| 69 | # Account lookup needs no account ID configured on the client | ||
| 70 | # | ||
| 71 | 0 | my ($self, $account_id, %opt)=@_; | |
| 72 | 0 | return $self->api()->request('GET', '/accounts/'.$self->api()->segment($account_id), | |
| 73 | %opt); | ||
| 74 | |||
| 75 | } | ||
| 76 | __END__ | ||