/lib/Net/Bitbucket.pm
Perl | 47 lines | 33 code | 13 blank | 1 comment | 2 complexity | 39181caea734f69d5a64d99e557856a1 MD5 | raw file
- # ABSTRACT: Interface to Bitbucket's API
- use strict;
- use warnings;
- package Net::Bitbucket;
- use base qw(
- Net::Bitbucket::Internal
- Net::Bitbucket::Changeset
- Net::Bitbucket::Email
- Net::Bitbucket::Event
- Net::Bitbucket::Follower
- Net::Bitbucket::Group
- Net::Bitbucket::Invite
- );
- use LWP::UserAgent;
- sub new {
- my ( $self, $args ) = @_;
- $self = {};
- my $api_version = '1.0';
- my $api_url = "https://api.bitbucket.org/$api_version";
- my $ua = LWP::UserAgent->new();
- $ua->agent( __PACKAGE__ . '/' . __PACKAGE__->VERSION );
- if ( exists $args->{'username'} && exists $args->{'password' } ) {
- $self->{'username'} = $args->{'username'};
- $self->{'password'} = $args->{'password'};
- }
- $self->{'api_url'} = $api_url;
- $self->{'ua'} = $ua;
- return bless $self, __PACKAGE__;
- }
- sub http_status {
- my $self = shift;
- return $self->{'_http_status'};
- }
- 1;