| 1 | # -*- coding: utf-8 -*- | ||||||||||||||||||||||||||||||||||||||||||
| 2 | # vim: ai ts=4 sts=4 et sw=4 | ||||||||||||||||||||||||||||||||||||||||||
| 3 | # Net::BaruwaAPI Perl bindings for the Baruwa REST API | ||||||||||||||||||||||||||||||||||||||||||
| 4 | # Copyright (C) 2015-2016 Andrew Colin Kissa <andrew@topdog.za.net> | ||||||||||||||||||||||||||||||||||||||||||
| 5 | # | ||||||||||||||||||||||||||||||||||||||||||
| 6 | # This Source Code Form is subject to the terms of the Mozilla Public | ||||||||||||||||||||||||||||||||||||||||||
| 7 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||||||||||||||||||||||||||||||||||||||||||
| 8 | # You can obtain one at http://mozilla.org/MPL/2.0/. | ||||||||||||||||||||||||||||||||||||||||||
| 9 | package Net::BaruwaAPI; | ||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | # use utf8; | ||||||||||||||||||||||||||||||||||||||||||
| 12 | 13 | ▶ | use feature 'state'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | 13 | ▶ | use JSON::MaybeXS; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 14 | 13 | ▶ | use HTTP::Request; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 13 | ▶ | use Carp qw/croak/; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | 13 | ▶ | use LWP::UserAgent; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | 13 | ▶ | use Type::Params qw/compile/; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | 13 | ▶ | use Types::Standard qw(Str InstanceOf Object Int Bool Dict Num ArrayRef); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 19 | 13 | ▶ | use Moo; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||
| 21 | 13 | our $VERSION = '0.04'; | |||||||||||||||||||||||||||||||||||||||||
| 22 | 13 | our $AUTHORITY = 'cpan:DATOPDOG'; | |||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||
| 24 | 13 | my $api_path = '/api/v1'; | |||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | 13 | has 'api_url' => (is => 'ro', isa => Str, predicate => 'has_api_url', required => 1); | |||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | 13 | has 'api_token' => (is => 'ro', isa => Str, predicate => 'has_api_token', required => 1); | |||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||
| 30 | has 'ua' => ( | ||||||||||||||||||||||||||||||||||||||||||
| 31 | isa => InstanceOf['LWP::UserAgent'], | ||||||||||||||||||||||||||||||||||||||||||
| 32 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||
| 33 | lazy => 1, | ||||||||||||||||||||||||||||||||||||||||||
| 34 | default => sub { | ||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | ▶ | LWP::UserAgent->new( | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 36 | agent => "BaruwaAPI-Perl", | ||||||||||||||||||||||||||||||||||||||||||
| 37 | cookie_jar => {}, | ||||||||||||||||||||||||||||||||||||||||||
| 38 | keep_alive => 4, | ||||||||||||||||||||||||||||||||||||||||||
| 39 | timeout => 60, | ||||||||||||||||||||||||||||||||||||||||||
| 40 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 41 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 42 | 13 | ); | |||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||
| 44 | has 'json' => ( | ||||||||||||||||||||||||||||||||||||||||||
| 45 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||
| 46 | isa => Object, | ||||||||||||||||||||||||||||||||||||||||||
| 47 | lazy => 1, | ||||||||||||||||||||||||||||||||||||||||||
| 48 | default => sub { | ||||||||||||||||||||||||||||||||||||||||||
| 49 | 0 | ▶ | return JSON::MaybeXS->new( utf8 => 1 ); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||||||||||||
| 51 | 13 | ); | |||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||
| 53 | sub _call { | ||||||||||||||||||||||||||||||||||||||||||
| 54 | 0 | ▶ | my ($self) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_call: not called CC=10 SCAR=47.0
| |||||||||||||||||||||||||||||||||||||||||||
| 55 | 0 | my $request_method = shift @_; | |||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | my $url = shift @_; | |||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | my $data = shift @_; | |||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | my $ua = $self->ua; | |||||||||||||||||||||||||||||||||||||||||
| 60 | 0 | $ua->default_header('Authorization', "Bearer " . $self->api_token); | |||||||||||||||||||||||||||||||||||||||||
| 61 | 0 | $url = $self->api_url . $url; | |||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | 0 | my $req = HTTP::Request->new( $request_method, $url ); | |||||||||||||||||||||||||||||||||||||||||
| 64 | 0 | $req->accept_decodable; | |||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||
| 66 | 0 | ▶ | if ($data) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 67 | 0 | $req->content($data); | |||||||||||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||||||||||||
| 69 | 0 | $req->header( 'Content-Length' => length $req->content ); | |||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | my $res = $ua->request($req); | |||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||
| 73 | 0 | ▶ | if ($res->header('Content-Type') and $res->header('Content-Type') =~ 'application/json') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$res->header("Content-Type") and $res->header("Content-Type") =~ m[application/json]
MC/DC0%0/2
$res->header("Content-Type") and $res->header("Content-Type") =~ m[application/json]
$res->header("Content-Type")
$res->header("Content-Type") =~ m[application/json]
Truth table0%0/3
A and B
A= $res->header("Content-Type")B= $res->header("Content-Type") =~ m[application/json]
| |||||||||||||||||||||||||||||||||||||||||||
| 74 | 0 | my $json = $res->decoded_content; | |||||||||||||||||||||||||||||||||||||||||
| 75 | 0 | $data = eval { $self->json->decode($json) }; | |||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | ▶ | unless ($data) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 77 | 0 | ▶ | die unless $res->is_error; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 78 | 0 | $data = { code => $res->code, message => $res->message }; | |||||||||||||||||||||||||||||||||||||||||
| 79 | } | ||||||||||||||||||||||||||||||||||||||||||
| 80 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | $data = { code => $res->code, message => $res->message }; | |||||||||||||||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | ▶ | if (not $res->is_success and ref $data eq 'HASH' and exists $data->{message}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
not $res->is_success and ref $data eq "HASH" and exists $data->{"message"}
not $res->is_success and ref $data eq "HASH"
MC/DC0%0/3
not $res->is_success and ref $data eq "HASH" and exists $data->{"message"}
not $res->is_success
ref $data eq "HASH"
exists $data->{"message"}
Truth table0%0/4
not(A) and B and C
A= not $res->is_successB= ref $data eq "HASH"C= exists $data->{"message"}
| |||||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | my $message = $data->{message}; | |||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||
| 87 | 0 | ▶ | if (exists $data->{errors}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | $message .= ': '.join(' - ', map { $_->{message} } grep { exists $_->{message} } @{ $data->{errors} }); | |||||||||||||||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | croak $message; | |||||||||||||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||||||||||||
| 92 | 0 | return $data; | |||||||||||||||||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||
| 96 | sub get_users { | ||||||||||||||||||||||||||||||||||||||||||
| 97 | 1 | ▶ | state $check = compile(Object); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_users: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 98 | 1 | my ($self) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 99 | 1 | return $self->_call('GET', "$api_path/users"); | |||||||||||||||||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||
| 102 | sub get_user { | ||||||||||||||||||||||||||||||||||||||||||
| 103 | 1 | ▶ | state $check = compile(Object, Int); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_user: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 104 | 1 | my ($self, $userid) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 105 | 1 | return $self->_call('GET', "$api_path/users/$userid"); | |||||||||||||||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||
| 108 | sub create_user { | ||||||||||||||||||||||||||||||||||||||||||
| 109 | 1 | ▶ | state $check = compile(Object, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_user: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 110 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 111 | username => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 112 | firstname => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 113 | lastname => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 114 | password1 => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 115 | password2 => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 116 | email => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 117 | timezone => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 118 | account_type => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 119 | domains => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 120 | active => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 121 | send_report => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 122 | spam_checks => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 123 | low_score => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 124 | high_score => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 125 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 126 | 1 | my ($self, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 127 | 1 | return $self->_call('POST', "$api_path/users", $data); | |||||||||||||||||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||
| 130 | sub update_user { | ||||||||||||||||||||||||||||||||||||||||||
| 131 | 1 | ▶ | state $check = compile(Object, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
update_user: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 132 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 133 | username => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 134 | firstname => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 135 | lastname => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 136 | email => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 137 | timezone => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 138 | domains => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 139 | active => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 140 | send_report => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 141 | spam_checks => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 142 | low_score => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 143 | high_score => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 144 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 145 | 1 | my ($self, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 146 | # my ($self, $data) = @_; | ||||||||||||||||||||||||||||||||||||||||||
| 147 | 1 | return $self->_call('PUT', "$api_path/users", $data); | |||||||||||||||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||
| 150 | sub delete_user { | ||||||||||||||||||||||||||||||||||||||||||
| 151 | 1 | ▶ | state $check = compile(Object, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
delete_user: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 152 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 153 | username => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 154 | firstname => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 155 | lastname => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 156 | email => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 157 | timezone => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 158 | domains => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 159 | active => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 160 | send_report => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 161 | spam_checks => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 162 | low_score => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 163 | high_score => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 164 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 165 | 1 | my ($self, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 166 | # my ($self, $data) = @_; | ||||||||||||||||||||||||||||||||||||||||||
| 167 | 1 | return $self->_call('DELETE', "$api_path/users", $data); | |||||||||||||||||||||||||||||||||||||||||
| 168 | } | ||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||
| 170 | sub set_user_passwd { | ||||||||||||||||||||||||||||||||||||||||||
| 171 | 1 | ▶ | state $check = compile(Object, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_user_passwd: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 172 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 173 | password1 => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 174 | password2 => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 175 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 176 | 1 | my ($self, $userid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 177 | 1 | return $self->_call('POST', "$api_path/users/chpw/$userid"); | |||||||||||||||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||||||||||||
| 180 | sub get_aliases { | ||||||||||||||||||||||||||||||||||||||||||
| 181 | 1 | ▶ | state $check = compile(Object, Int); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_aliases: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 182 | 1 | my ($self, $addressid) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 183 | 1 | return $self->_call('GET', "$api_path/aliasaddresses/$addressid"); | |||||||||||||||||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||||||||||||
| 186 | sub create_alias { | ||||||||||||||||||||||||||||||||||||||||||
| 187 | 1 | ▶ | state $check = compile(Object, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_alias: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 188 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 189 | address => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 190 | enabled => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 191 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 192 | 1 | my ($self, $userid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 193 | 1 | return $self->_call('POST', "$api_path/aliasaddresses/$userid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 194 | } | ||||||||||||||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||||||||||||||
| 196 | sub update_alias { | ||||||||||||||||||||||||||||||||||||||||||
| 197 | 1 | ▶ | state $check = compile(Object, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
update_alias: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 198 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 199 | address => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 200 | enabled => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 201 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 202 | 1 | my ($self, $addressid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 203 | 1 | return $self->_call('PUT', "$api_path/aliasaddresses/$addressid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 204 | } | ||||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||
| 206 | sub delete_alias { | ||||||||||||||||||||||||||||||||||||||||||
| 207 | 1 | ▶ | state $check = compile(Object, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
delete_alias: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 208 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 209 | address => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 210 | enabled => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 211 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 212 | 1 | my ($self, $addressid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 213 | 1 | return $self->_call('DELETE', "$api_path/aliasaddresses/$addressid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 214 | } | ||||||||||||||||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||||||||||||||||
| 216 | sub get_domains { | ||||||||||||||||||||||||||||||||||||||||||
| 217 | 1 | ▶ | state $check = compile(Object); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_domains: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 218 | 1 | my ($self) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 219 | 1 | return $self->_call('GET', "$api_path/domains"); | |||||||||||||||||||||||||||||||||||||||||
| 220 | } | ||||||||||||||||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||||||||||||||||
| 222 | sub get_domain { | ||||||||||||||||||||||||||||||||||||||||||
| 223 | 1 | ▶ | state $check = compile(Object, Int); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_domain: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 224 | 1 | my ($self, $domainid) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 225 | 1 | return $self->_call('GET', "$api_path/domains/$domainid"); | |||||||||||||||||||||||||||||||||||||||||
| 226 | } | ||||||||||||||||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||||||||||||||||
| 228 | sub get_domain_by_name { | ||||||||||||||||||||||||||||||||||||||||||
| 229 | 1 | ▶ | state $check = compile(Object, Str); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_domain_by_name: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 230 | 1 | my ($self, $domain_name) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 231 | 1 | return $self->_call('GET', "$api_path/domains/byname/$domain_name"); | |||||||||||||||||||||||||||||||||||||||||
| 232 | } | ||||||||||||||||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||||||||||||||||
| 234 | sub create_domain { | ||||||||||||||||||||||||||||||||||||||||||
| 235 | 1 | ▶ | state $check = compile(Object, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_domain: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 236 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 237 | name => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 238 | site_url => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 239 | status => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 240 | smtp_callout => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 241 | ldap_callout => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 242 | virus_checks => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 243 | virus_checks_at_smtp => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 244 | spam_checks => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 245 | spam_actions => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 246 | highspam_actions => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 247 | virus_actions => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 248 | low_score => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 249 | high_score => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 250 | message_size => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 251 | delivery_mode => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 252 | language => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 253 | timezone => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 254 | report_every => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 255 | organizations => Num | ||||||||||||||||||||||||||||||||||||||||||
| 256 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 257 | 1 | my ($self, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 258 | 1 | return $self->_call('POST', "$api_path/domains", $data); | |||||||||||||||||||||||||||||||||||||||||
| 259 | } | ||||||||||||||||||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||||||||||||||||
| 261 | sub update_domain { | ||||||||||||||||||||||||||||||||||||||||||
| 262 | 1 | ▶ | state $check = compile(Object, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
update_domain: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 263 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 264 | name => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 265 | site_url => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 266 | status => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 267 | smtp_callout => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 268 | ldap_callout => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 269 | virus_checks => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 270 | virus_checks_at_smtp => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 271 | spam_checks => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 272 | spam_actions => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 273 | highspam_actions => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 274 | virus_actions => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 275 | low_score => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 276 | high_score => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 277 | message_size => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 278 | delivery_mode => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 279 | language => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 280 | timezone => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 281 | report_every => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 282 | organizations => Num | ||||||||||||||||||||||||||||||||||||||||||
| 283 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 284 | 1 | my ($self, $domainid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 285 | 1 | return $self->_call('PUT', "$api_path/domains/$domainid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 286 | } | ||||||||||||||||||||||||||||||||||||||||||
| 287 | |||||||||||||||||||||||||||||||||||||||||||
| 288 | sub delete_domain { | ||||||||||||||||||||||||||||||||||||||||||
| 289 | 1 | ▶ | state $check = compile(Object, Int); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
delete_domain: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 290 | 1 | my ($self, $domainid) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 291 | 1 | return $self->_call('DELETE', "$api_path/domains/$domainid"); | |||||||||||||||||||||||||||||||||||||||||
| 292 | } | ||||||||||||||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||||||||||||||
| 294 | sub get_domainaliases { | ||||||||||||||||||||||||||||||||||||||||||
| 295 | 1 | ▶ | state $check = compile(Object, Int); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_domainaliases: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 296 | 1 | my ($self, $domainid) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 297 | 1 | return $self->_call('GET', "$api_path/domainaliases/$domainid"); | |||||||||||||||||||||||||||||||||||||||||
| 298 | } | ||||||||||||||||||||||||||||||||||||||||||
| 299 | |||||||||||||||||||||||||||||||||||||||||||
| 300 | sub get_domainalias { | ||||||||||||||||||||||||||||||||||||||||||
| 301 | 1 | ▶ | state $check = compile(Object, Int, Int); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_domainalias: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 302 | 1 | my ($self, $domainid, $aliasid) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 303 | 1 | return $self->_call('GET', "$api_path/domainaliases/$domainid/$aliasid"); | |||||||||||||||||||||||||||||||||||||||||
| 304 | } | ||||||||||||||||||||||||||||||||||||||||||
| 305 | |||||||||||||||||||||||||||||||||||||||||||
| 306 | sub create_domainalias { | ||||||||||||||||||||||||||||||||||||||||||
| 307 | 1 | ▶ | state $check = compile(Object, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_domainalias: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 308 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 309 | name => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 310 | status => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 311 | domain => Int | ||||||||||||||||||||||||||||||||||||||||||
| 312 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 313 | 1 | my ($self, $domainid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 314 | 1 | return $self->_call('POST', "$api_path/domainaliases/$domainid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 315 | } | ||||||||||||||||||||||||||||||||||||||||||
| 316 | |||||||||||||||||||||||||||||||||||||||||||
| 317 | sub update_domainalias { | ||||||||||||||||||||||||||||||||||||||||||
| 318 | 1 | ▶ | state $check = compile(Object, Int, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
update_domainalias: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 319 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 320 | name => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 321 | status => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 322 | domain => Int | ||||||||||||||||||||||||||||||||||||||||||
| 323 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 324 | 1 | my ($self, $domainid, $aliasid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 325 | 1 | return $self->_call('PUT', "$api_path/domainaliases/$domainid/$aliasid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 326 | } | ||||||||||||||||||||||||||||||||||||||||||
| 327 | |||||||||||||||||||||||||||||||||||||||||||
| 328 | sub delete_domainalias { | ||||||||||||||||||||||||||||||||||||||||||
| 329 | 1 | ▶ | state $check = compile(Object, Int, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
delete_domainalias: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 330 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 331 | name => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 332 | status => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 333 | domain => Int | ||||||||||||||||||||||||||||||||||||||||||
| 334 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 335 | 1 | my ($self, $domainid, $aliasid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 336 | 1 | return $self->_call('DELETE', "$api_path/domainaliases/$domainid/$aliasid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 337 | } | ||||||||||||||||||||||||||||||||||||||||||
| 338 | |||||||||||||||||||||||||||||||||||||||||||
| 339 | sub get_deliveryservers { | ||||||||||||||||||||||||||||||||||||||||||
| 340 | 1 | ▶ | state $check = compile(Object, Int); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_deliveryservers: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 341 | 1 | my ($self, $domainid) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 342 | 1 | return $self->_call('GET', "$api_path/deliveryservers/$domainid"); | |||||||||||||||||||||||||||||||||||||||||
| 343 | } | ||||||||||||||||||||||||||||||||||||||||||
| 344 | |||||||||||||||||||||||||||||||||||||||||||
| 345 | sub get_deliveryserver { | ||||||||||||||||||||||||||||||||||||||||||
| 346 | 1 | ▶ | state $check = compile(Object, Int, Int); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_deliveryserver: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 347 | 1 | my ($self, $domainid, $serverid) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 348 | 1 | return $self->_call('GET', "$api_path/deliveryservers/$domainid/$serverid"); | |||||||||||||||||||||||||||||||||||||||||
| 349 | } | ||||||||||||||||||||||||||||||||||||||||||
| 350 | |||||||||||||||||||||||||||||||||||||||||||
| 351 | sub create_deliveryserver { | ||||||||||||||||||||||||||||||||||||||||||
| 352 | 1 | ▶ | state $check = compile(Object, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_deliveryserver: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 353 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 354 | address => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 355 | protocol => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 356 | port => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 357 | enabled => Bool | ||||||||||||||||||||||||||||||||||||||||||
| 358 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 359 | 1 | my ($self, $domainid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 360 | 1 | return $self->_call('POST', "$api_path/deliveryservers/$domainid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 361 | } | ||||||||||||||||||||||||||||||||||||||||||
| 362 | |||||||||||||||||||||||||||||||||||||||||||
| 363 | sub update_deliveryserver { | ||||||||||||||||||||||||||||||||||||||||||
| 364 | 1 | ▶ | state $check = compile(Object, Int, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
update_deliveryserver: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 365 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 366 | address => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 367 | protocol => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 368 | port => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 369 | enabled => Bool | ||||||||||||||||||||||||||||||||||||||||||
| 370 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 371 | 1 | my ($self, $domainid, $serverid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 372 | 1 | return $self->_call('PUT', "$api_path/deliveryservers/$domainid/$serverid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 373 | } | ||||||||||||||||||||||||||||||||||||||||||
| 374 | |||||||||||||||||||||||||||||||||||||||||||
| 375 | sub delete_deliveryserver { | ||||||||||||||||||||||||||||||||||||||||||
| 376 | 1 | ▶ | state $check = compile(Object, Int, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
delete_deliveryserver: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 377 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 378 | address => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 379 | protocol => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 380 | port => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 381 | enabled => Bool | ||||||||||||||||||||||||||||||||||||||||||
| 382 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 383 | 1 | my ($self, $domainid, $serverid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 384 | 1 | return $self->_call('DELETE', "$api_path/deliveryservers/$domainid/$serverid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 385 | } | ||||||||||||||||||||||||||||||||||||||||||
| 386 | |||||||||||||||||||||||||||||||||||||||||||
| 387 | sub get_authservers { | ||||||||||||||||||||||||||||||||||||||||||
| 388 | 1 | ▶ | state $check = compile(Object, Int); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_authservers: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 389 | 1 | my ($self, $domainid) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 390 | 1 | return $self->_call('GET', "$api_path/authservers/$domainid"); | |||||||||||||||||||||||||||||||||||||||||
| 391 | } | ||||||||||||||||||||||||||||||||||||||||||
| 392 | |||||||||||||||||||||||||||||||||||||||||||
| 393 | sub get_authserver { | ||||||||||||||||||||||||||||||||||||||||||
| 394 | 1 | ▶ | state $check = compile(Object, Int, Int); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_authserver: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 395 | 1 | my ($self, $domainid, $serverid) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 396 | 1 | return $self->_call('GET', "$api_path/authservers/$domainid/$serverid"); | |||||||||||||||||||||||||||||||||||||||||
| 397 | } | ||||||||||||||||||||||||||||||||||||||||||
| 398 | |||||||||||||||||||||||||||||||||||||||||||
| 399 | sub create_authserver { | ||||||||||||||||||||||||||||||||||||||||||
| 400 | 1 | ▶ | state $check = compile(Object, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_authserver: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 401 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 402 | address => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 403 | protocol => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 404 | port => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 405 | enabled => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 406 | split_address => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 407 | user_map_template => Str | ||||||||||||||||||||||||||||||||||||||||||
| 408 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 409 | 1 | my ($self, $domainid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 410 | 1 | return $self->_call('POST', "$api_path/authservers/$domainid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 411 | } | ||||||||||||||||||||||||||||||||||||||||||
| 412 | |||||||||||||||||||||||||||||||||||||||||||
| 413 | sub update_authserver { | ||||||||||||||||||||||||||||||||||||||||||
| 414 | 1 | ▶ | state $check = compile(Object, Int, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
update_authserver: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 415 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 416 | address => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 417 | protocol => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 418 | port => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 419 | enabled => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 420 | split_address => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 421 | user_map_template => Str | ||||||||||||||||||||||||||||||||||||||||||
| 422 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 423 | 1 | my ($self, $domainid, $serverid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 424 | 1 | return $self->_call('PUT', "$api_path/authservers/$domainid/$serverid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 425 | } | ||||||||||||||||||||||||||||||||||||||||||
| 426 | |||||||||||||||||||||||||||||||||||||||||||
| 427 | sub delete_authserver { | ||||||||||||||||||||||||||||||||||||||||||
| 428 | 1 | ▶ | state $check = compile(Object, Int, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
delete_authserver: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 429 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 430 | address => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 431 | protocol => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 432 | port => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 433 | enabled => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 434 | split_address => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 435 | user_map_template => Str | ||||||||||||||||||||||||||||||||||||||||||
| 436 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 437 | 1 | my ($self, $domainid, $serverid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 438 | 1 | return $self->_call('DELETE', "$api_path/authservers/$domainid/$serverid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 439 | } | ||||||||||||||||||||||||||||||||||||||||||
| 440 | |||||||||||||||||||||||||||||||||||||||||||
| 441 | sub get_ldapsettings { | ||||||||||||||||||||||||||||||||||||||||||
| 442 | 1 | ▶ | state $check = compile(Object, Int, Int, Int); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_ldapsettings: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 443 | 1 | my ($self, $domainid, $serverid, $settingsid) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 444 | 1 | return $self->_call('GET', "$api_path/ldapsettings/$domainid/$serverid/$settingsid"); | |||||||||||||||||||||||||||||||||||||||||
| 445 | } | ||||||||||||||||||||||||||||||||||||||||||
| 446 | |||||||||||||||||||||||||||||||||||||||||||
| 447 | sub create_ldapsettings { | ||||||||||||||||||||||||||||||||||||||||||
| 448 | 1 | ▶ | state $check = compile(Object, Int, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_ldapsettings: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 449 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 450 | basedn => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 451 | nameattribute => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 452 | emailattribute => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 453 | binddn => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 454 | bindpw => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 455 | usetls => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 456 | search_scope => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 457 | emailsearch_scope => Str | ||||||||||||||||||||||||||||||||||||||||||
| 458 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 459 | 1 | my ($self, $domainid, $serverid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 460 | 1 | return $self->_call('POST', "$api_path/ldapsettings/$domainid/$serverid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 461 | } | ||||||||||||||||||||||||||||||||||||||||||
| 462 | |||||||||||||||||||||||||||||||||||||||||||
| 463 | sub update_ldapsettings { | ||||||||||||||||||||||||||||||||||||||||||
| 464 | 1 | ▶ | state $check = compile(Object, Int, Int, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
update_ldapsettings: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 465 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 466 | basedn => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 467 | nameattribute => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 468 | emailattribute => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 469 | binddn => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 470 | bindpw => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 471 | usetls => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 472 | search_scope => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 473 | emailsearch_scope => Str | ||||||||||||||||||||||||||||||||||||||||||
| 474 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 475 | 1 | my ($self, $domainid, $serverid, $settingsid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 476 | 1 | return $self->_call('PUT', "$api_path/ldapsettings/$domainid/$serverid/$settingsid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 477 | } | ||||||||||||||||||||||||||||||||||||||||||
| 478 | |||||||||||||||||||||||||||||||||||||||||||
| 479 | sub delete_ldapsettings { | ||||||||||||||||||||||||||||||||||||||||||
| 480 | 1 | ▶ | state $check = compile(Object, Int, Int, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
delete_ldapsettings: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 481 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 482 | basedn => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 483 | nameattribute => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 484 | emailattribute => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 485 | binddn => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 486 | bindpw => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 487 | usetls => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 488 | search_scope => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 489 | emailsearch_scope => Str | ||||||||||||||||||||||||||||||||||||||||||
| 490 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 491 | 1 | my ($self, $domainid, $serverid, $settingsid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 492 | 1 | return $self->_call('DELETE', "$api_path/ldapsettings/$domainid/$serverid/$settingsid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 493 | } | ||||||||||||||||||||||||||||||||||||||||||
| 494 | |||||||||||||||||||||||||||||||||||||||||||
| 495 | sub get_radiussettings { | ||||||||||||||||||||||||||||||||||||||||||
| 496 | 1 | ▶ | state $check = compile(Object, Int, Int, Int); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_radiussettings: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 497 | 1 | my ($self, $domainid, $serverid, $settingsid) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 498 | 1 | return $self->_call('GET', "$api_path/radiussettings/$domainid/$serverid/$settingsid"); | |||||||||||||||||||||||||||||||||||||||||
| 499 | } | ||||||||||||||||||||||||||||||||||||||||||
| 500 | |||||||||||||||||||||||||||||||||||||||||||
| 501 | sub create_radiussettings { | ||||||||||||||||||||||||||||||||||||||||||
| 502 | 1 | ▶ | state $check = compile(Object, Int, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_radiussettings: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 503 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 504 | secret => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 505 | timeout => Int | ||||||||||||||||||||||||||||||||||||||||||
| 506 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 507 | 1 | my ($self, $domainid, $serverid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 508 | 1 | return $self->_call('POST', "$api_path/radiussettings/$domainid/$serverid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 509 | } | ||||||||||||||||||||||||||||||||||||||||||
| 510 | |||||||||||||||||||||||||||||||||||||||||||
| 511 | sub update_radiussettings { | ||||||||||||||||||||||||||||||||||||||||||
| 512 | 1 | ▶ | state $check = compile(Object, Int, Int, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
update_radiussettings: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 513 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 514 | secret => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 515 | timeout => Int | ||||||||||||||||||||||||||||||||||||||||||
| 516 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 517 | 1 | my ($self, $domainid, $serverid, $settingsid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 518 | 1 | return $self->_call('PUT', "$api_path/radiussettings/$domainid/$serverid/$settingsid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 519 | } | ||||||||||||||||||||||||||||||||||||||||||
| 520 | |||||||||||||||||||||||||||||||||||||||||||
| 521 | sub delete_radiussettings { | ||||||||||||||||||||||||||||||||||||||||||
| 522 | 1 | ▶ | state $check = compile(Object, Int, Int, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
delete_radiussettings: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 523 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 524 | secret => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 525 | timeout => Int | ||||||||||||||||||||||||||||||||||||||||||
| 526 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 527 | 1 | my ($self, $domainid, $serverid, $settingsid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 528 | 1 | return $self->_call('DELETE', "$api_path/radiussettings/$domainid/$serverid/$settingsid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 529 | } | ||||||||||||||||||||||||||||||||||||||||||
| 530 | |||||||||||||||||||||||||||||||||||||||||||
| 531 | sub get_organizations { | ||||||||||||||||||||||||||||||||||||||||||
| 532 | 1 | ▶ | state $check = compile(Object); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_organizations: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 533 | 1 | my ($self) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 534 | 1 | return $self->_call('GET', "$api_path/organizations"); | |||||||||||||||||||||||||||||||||||||||||
| 535 | } | ||||||||||||||||||||||||||||||||||||||||||
| 536 | |||||||||||||||||||||||||||||||||||||||||||
| 537 | sub get_organization { | ||||||||||||||||||||||||||||||||||||||||||
| 538 | 1 | ▶ | state $check = compile(Object, Int); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_organization: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 539 | 1 | my ($self, $orgid) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 540 | 1 | return $self->_call('GET', "$api_path/organizations/$orgid"); | |||||||||||||||||||||||||||||||||||||||||
| 541 | } | ||||||||||||||||||||||||||||||||||||||||||
| 542 | |||||||||||||||||||||||||||||||||||||||||||
| 543 | sub create_organization { | ||||||||||||||||||||||||||||||||||||||||||
| 544 | 1 | ▶ | state $check = compile(Object, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_organization: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 545 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 546 | name => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 547 | domains => ArrayRef, | ||||||||||||||||||||||||||||||||||||||||||
| 548 | admins => ArrayRef | ||||||||||||||||||||||||||||||||||||||||||
| 549 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 550 | 1 | my ($self, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 551 | 1 | return $self->_call('POST', "$api_path/organizations", $data); | |||||||||||||||||||||||||||||||||||||||||
| 552 | } | ||||||||||||||||||||||||||||||||||||||||||
| 553 | |||||||||||||||||||||||||||||||||||||||||||
| 554 | sub update_organization { | ||||||||||||||||||||||||||||||||||||||||||
| 555 | 1 | ▶ | state $check = compile(Object, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
update_organization: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 556 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 557 | name => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 558 | domains => ArrayRef, | ||||||||||||||||||||||||||||||||||||||||||
| 559 | admins => ArrayRef | ||||||||||||||||||||||||||||||||||||||||||
| 560 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 561 | 1 | my ($self, $orgid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 562 | 1 | return $self->_call('PUT', "$api_path/organizations/$orgid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 563 | } | ||||||||||||||||||||||||||||||||||||||||||
| 564 | |||||||||||||||||||||||||||||||||||||||||||
| 565 | sub delete_organization { | ||||||||||||||||||||||||||||||||||||||||||
| 566 | 1 | ▶ | state $check = compile(Object, Int); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
delete_organization: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 567 | 1 | my ($self, $orgid) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 568 | 1 | return $self->_call('DELETE', "$api_path/organizations/$orgid"); | |||||||||||||||||||||||||||||||||||||||||
| 569 | } | ||||||||||||||||||||||||||||||||||||||||||
| 570 | |||||||||||||||||||||||||||||||||||||||||||
| 571 | sub get_relay { | ||||||||||||||||||||||||||||||||||||||||||
| 572 | 1 | ▶ | state $check = compile(Object, Int); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_relay: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 573 | 1 | my ($self, $relayid) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 574 | 1 | return $self->_call('GET', "$api_path/relays/$relayid"); | |||||||||||||||||||||||||||||||||||||||||
| 575 | } | ||||||||||||||||||||||||||||||||||||||||||
| 576 | |||||||||||||||||||||||||||||||||||||||||||
| 577 | sub create_relay { | ||||||||||||||||||||||||||||||||||||||||||
| 578 | 1 | ▶ | state $check = compile(Object, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_relay: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 579 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 580 | address => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 581 | enabled => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 582 | username => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 583 | password1 => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 584 | password2 => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 585 | description => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 586 | low_score => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 587 | high_score => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 588 | spam_actions => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 589 | highspam_actions => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 590 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 591 | 1 | my ($self, $orgid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 592 | 1 | return $self->_call('POST', "$api_path/relays/$orgid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 593 | } | ||||||||||||||||||||||||||||||||||||||||||
| 594 | |||||||||||||||||||||||||||||||||||||||||||
| 595 | sub update_relay { | ||||||||||||||||||||||||||||||||||||||||||
| 596 | 1 | ▶ | state $check = compile(Object, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
update_relay: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 597 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 598 | address => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 599 | enabled => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 600 | username => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 601 | password1 => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 602 | password2 => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 603 | description => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 604 | low_score => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 605 | high_score => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 606 | spam_actions => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 607 | highspam_actions => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 608 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 609 | 1 | my ($self, $relayid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 610 | 1 | return $self->_call('PUT', "$api_path/relays/$relayid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 611 | } | ||||||||||||||||||||||||||||||||||||||||||
| 612 | |||||||||||||||||||||||||||||||||||||||||||
| 613 | sub delete_relay { | ||||||||||||||||||||||||||||||||||||||||||
| 614 | 1 | ▶ | state $check = compile(Object, Int, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
delete_relay: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 615 | Dict[ | ||||||||||||||||||||||||||||||||||||||||||
| 616 | address => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 617 | enabled => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 618 | username => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 619 | password1 => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 620 | password2 => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 621 | description => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 622 | low_score => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 623 | high_score => Num, | ||||||||||||||||||||||||||||||||||||||||||
| 624 | spam_actions => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 625 | highspam_actions => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 626 | ]); | ||||||||||||||||||||||||||||||||||||||||||
| 627 | 1 | my ($self, $relayid, $data) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 628 | 1 | return $self->_call('DELETE', "$api_path/relays/$relayid", $data); | |||||||||||||||||||||||||||||||||||||||||
| 629 | } | ||||||||||||||||||||||||||||||||||||||||||
| 630 | |||||||||||||||||||||||||||||||||||||||||||
| 631 | sub get_status { | ||||||||||||||||||||||||||||||||||||||||||
| 632 | 1 | ▶ | state $check = compile(Object); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_status: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 633 | 1 | my ($self) = $check->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 634 | 1 | return $self->_call('GET', "$api_path/status"); | |||||||||||||||||||||||||||||||||||||||||
| 635 | } | ||||||||||||||||||||||||||||||||||||||||||
| 636 | |||||||||||||||||||||||||||||||||||||||||||
| 637 | 13 | ▶ | no Moo; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 638 | |||||||||||||||||||||||||||||||||||||||||||
| 639 | 13 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 640 | |||||||||||||||||||||||||||||||||||||||||||
| 641 | __END__ | ||||||||||||||||||||||||||||||||||||||||||