Azure-Storage-Blob-Client
view release on metacpan or search on metacpan
lib/Azure/Storage/Blob/Client/Call.pm view on Meta::CPAN
1234567891011121314package
Azure::Storage::Blob::Client::Call;
use
Moose::Role;
requires
'endpoint'
;
requires
'method'
;
requires
'operation'
;
sub
serialize_uri_parameters {
my
$self
=
shift
;
return
{
map
{
$_
=>
$self
->
$_
}
grep
{
$self
->meta->get_attribute(
$_
)->does(
'URIParameter'
) }
$self
->meta->get_attribute_list()
};
lib/Azure/Storage/Blob/Client/Call/DeleteBlob.pm view on Meta::CPAN
12345678910111213141516use
Moose;
has
operation
=> (
is
=>
'ro'
,
init_arg
=>
undef
,
default
=>
'DeleteBlob'
);
has
endpoint
=> (
is
=>
'ro'
,
init_arg
=>
undef
,
lazy
=> 1,
default
=>
sub
{
my
$self
=
shift
;
return
sprintf
(
$self
->account_name,
$self
->container,
$self
->blob_name,
);
});
has
method
=> (
is
=>
'ro'
,
init_arg
=>
undef
,
default
=>
'DELETE'
);
lib/Azure/Storage/Blob/Client/Call/GetBlobProperties.pm view on Meta::CPAN
123456789101112131415use
Moose;
has
operation
=> (
is
=>
'ro'
,
init_arg
=>
undef
,
default
=>
'GetBlobProperties'
);
has
endpoint
=> (
is
=>
'ro'
,
init_arg
=>
undef
,
lazy
=> 1,
default
=>
sub
{
my
$self
=
shift
;
return
sprintf
(
$self
->account_name,
$self
->container,
$self
->blob_name,
);
});
has
method
=> (
is
=>
'ro'
,
init_arg
=>
undef
,
default
=>
'HEAD'
);
lib/Azure/Storage/Blob/Client/Call/ListBlobs.pm view on Meta::CPAN
123456789101112131415161718use
Moose;
use
XML::LibXML;
has
operation
=> (
is
=>
'ro'
,
init_arg
=>
undef
,
default
=>
'ListBlobs'
);
has
endpoint
=> (
is
=>
'ro'
,
init_arg
=>
undef
,
lazy
=> 1,
default
=>
sub
{
my
$self
=
shift
;
return
sprintf
(
$self
->account_name,
$self
->container,
);
});
has
method
=> (
is
=>
'ro'
,
init_arg
=>
undef
,
default
=>
'GET'
);
with
'https://metacpan.org/pod/Azure::Storage::Blob::Client::Call">Azure::Storage::Blob::Client::Call'
;
lib/Azure/Storage/Blob/Client/Call/PutBlob.pm view on Meta::CPAN
12345678910111213141516use
Moose;
has
operation
=> (
is
=>
'ro'
,
init_arg
=>
undef
,
default
=>
'PutBlob'
);
has
endpoint
=> (
is
=>
'ro'
,
init_arg
=>
undef
,
lazy
=> 1,
default
=>
sub
{
my
$self
=
shift
;
return
sprintf
(
$self
->account_name,
$self
->container,
$self
->blob_name,
);
});
has
method
=> (
is
=>
'ro'
,
init_arg
=>
undef
,
default
=>
'PUT'
);
lib/Azure/Storage/Blob/Client/Caller.pm view on Meta::CPAN
45464748495051525354555657585960616263646566
$call_object
->operation ne
'ListBlobs'
and
$call_object
->operation ne
'PutBlob'
) {
die
'Unimplemented.'
;
}
my
$url_encoded_parameters
= HTTP::Tiny->new->www_form_urlencode(
$call_object
->serialize_uri_parameters(),
);
my
$url
=
$url_encoded_parameters
?
sprintf
(
"%s&%s"
,
$call_object
->endpoint,
$url_encoded_parameters
)
:
$call_object
->endpoint;
my
$body
=
$self
->_build_body_content(
$call_object
);
my
$headers
=
$self
->_build_headers(
$call_object
,
$body
);
my
$request
= HTTP::Request->new(
$call_object
->method,
$url
,
$headers
,
$body
);
$self
->_sign_request(
$request
,
$account_name
,
$account_key
,
$call_object
);
return
$request
;
}
sub
_handle_storage_account_api_exceptions {
t/Azure/Storage/Blob/Client/Call.t view on Meta::CPAN
208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
with
'https://metacpan.org/pod/Azure::Storage::Blob::Client::Call">Azure::Storage::Blob::Client::Call'
;
has
att1
=> (
is
=>
'ro'
,
isa
=>
'Any'
,
required
=> 1);
has
att2
=> (
is
=>
'ro'
,
isa
=>
'Any'
,
required
=> 1);
has
att3
=> (
is
=>
'ro'
,
isa
=>
'Any'
,
required
=> 1);
# required by Call role
sub
operation {}
sub
method {}
sub
endpoint {}
};
with
'https://metacpan.org/pod/Azure::Storage::Blob::Client::Call">Azure::Storage::Blob::Client::Call'
;
has
att1
=> (
is
=>
'ro'
,
isa
=>
'Any'
,
required
=> 1);
has
att2
=> (
is
=>
'ro'
,
isa
=>
'Any'
,
traits
=> [
'URIParameter'
],
required
=> 1);
has
att3
=> (
is
=>
'ro'
,
isa
=>
'Any'
,
traits
=> [
'URIParameter'
],
required
=> 1);
# required by Call role
sub
operation {}
sub
method {}
sub
endpoint {}
};
with
'https://metacpan.org/pod/Azure::Storage::Blob::Client::Call">Azure::Storage::Blob::Client::Call'
;
has
att1
=> (
is
=>
'ro'
,
isa
=>
'Any'
,
required
=> 1);
has
att2
=> (
is
=>
'ro'
,
isa
=>
'Any'
,
traits
=> [
'HeaderParameter'
],
header_name
=>
'h2'
,
required
=> 1);
has
att3
=> (
is
=>
'ro'
,
isa
=>
'Any'
,
traits
=> [
'HeaderParameter'
],
header_name
=>
'h3'
,
required
=> 1);
# required by Call role
sub
operation {}
sub
method {}
sub
endpoint {}
};
with
'https://metacpan.org/pod/Azure::Storage::Blob::Client::Call">Azure::Storage::Blob::Client::Call'
;
has
att1
=> (
is
=>
'ro'
,
isa
=>
'Any'
,
required
=> 1);
has
att2
=> (
is
=>
'ro'
,
isa
=>
'Any'
,
traits
=> [
'BodyParameter'
],
required
=> 1);
has
att3
=> (
is
=>
'ro'
,
isa
=>
'Any'
,
traits
=> [
'BodyParameter'
],
required
=> 1);
# required by Call role
sub
operation {}
sub
method {}
sub
endpoint {}
};
with
'https://metacpan.org/pod/Azure::Storage::Blob::Client::Call">Azure::Storage::Blob::Client::Call'
;
has
att1
=> (
is
=>
'ro'
,
traits
=> [
'URIParameter'
],
required
=> 1);
has
att2
=> (
is
=>
'ro'
,
traits
=> [
'HeaderParameter'
],
header_name
=>
'h2'
,
required
=> 1);
has
att3
=> (
is
=>
'ro'
,
traits
=> [
'BodyParameter'
],
required
=> 1);
has
att4
=> (
is
=>
'ro'
,
traits
=> [
'URIParameter'
,
'HeaderParameter'
,
'BodyParameter'
],
header_name
=>
'h4'
,
required
=> 1);
has
att5
=> (
is
=>
'ro'
,
required
=> 1);
# required by Call role
sub
operation {}
sub
method {}
sub
endpoint {}
};
runtests
unless
caller
;
( run in 0.397 second using v1.01-cache-2.11-cpan-87723dcf8b7 )