Azure-Storage-Blob-Client

 view release on metacpan or  search on metacpan

lib/Azure/Storage/Blob/Client/Call.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use 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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use 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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use Moose;
 
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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use 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

45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
    $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

208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
  use Moose;
  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 {}
};
 
  use Moose;
  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 {}
};
 
  use Moose;
  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 {}
};
 
  use Moose;
  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 {}
};
 
  use Moose;
  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 )