<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
====

Bintray::API - Perl interface to the Bintray API

SYNOPSIS
========

    # Initialize
    my $btray = Bintray::API-&gt;new(
        username =&gt; 'user',
        apikey   =&gt; 'XXXXXXXXXXXXXXXXX',
    );

    # Repository
    my $repo = $btray-&gt;subject()-&gt;repo( name =&gt; 'myrepo' );
    foreach my $pkg ( $repo-&gt;packages() ) {
        print $pkg-&gt;{name} . "\n";
    }

    # Packages and Versions
    my $package = $repo-&gt;package( name =&gt; 'mypackage' );
    my $version = $package-&gt;version( name =&gt; '1.0' );
    my $version_info = $version-&gt;info();

    # Upload and Publish a file
    $version-&gt;upload(
        file      =&gt; '/path/to/local/file',
        repo_path =&gt; 'myfiles/file',
        publish   =&gt; 1,
    );

DESCRIPTION
===========

Bintray is a social platform for community-based software distribution.

This module provides a Perl wrapper to the Bintray REST API.

API Methods
===========

This distribution is structured similar to Bintray Entities.

SUBJECT
-------

A subject is either a user or an organization

    # Initialize a subject
    my $subject = $btray-&gt;subject(

        # Provide an optional _name_
        #   - defaults to the current username
        name =&gt; 'my_company',
    );

    # Subject methods
    my $info       = $subject-&gt;info();          # Get info
    my $followers  = $subject-&gt;followers();     # Get followers
    my $hooks      = $subject-&gt;get_webhooks();  # Get Registered hooks
    my $repos      = $subject-&gt;repos();         # Get user repositories
    my @repo_names = $subject-&gt;repo_names();    # Shortcut to list repo names

REPOSITORY
----------

    # Initialize a Repo
    my $repo = $subject-&gt;repo( name =&gt; 'myrepo' );

    # Repository methods
    my $info          = $repo-&gt;info();           # Repo information
    my $packages      = $repo-&gt;packages();       # Get packages
    my @package_names = $repo-&gt;package_names();  # List of packages
    my $hooks         = $repo-&gt;get_webhooks();   # Hooks listing

    ## Repository Operations

    # Create Package
    $repo-&gt;create_package(
        {
            name     =&gt; 'MyPackage',
            desc     =&gt; 'foo bar',
            labels   =&gt; [qw(foo)],
            licenses =&gt; [ 'GPL-3.0', 'Artistic-License-2.0', ],
        }
    );

    # Delete Package
    $repo-&gt;delete_package( name =&gt; 'MyPackage' );

PACKAGE
-------

    ## Initialize Package
    my $package = $repo-&gt;package( name =&gt; 'MyPackage' );
    my $info = $package-&gt;info();

    ## Package operations

    # Update
    $package-&gt;update( details =&gt; {...} );

    # Versions
    $package-&gt;create_version(
        details =&gt; {
            name          =&gt; '1.0',
            release_notes =&gt; 'foobar',
            release_url   =&gt; 'http://foo/bar'
        }
    );
    $package-&gt;delete_version( name =&gt; '1.0' );

    # Attributes
    $package-&gt;get_attributes();
    $package-&gt;set_attributes(
        attributes =&gt; [
            {
                name   =&gt; 'foo',
                values =&gt; [qw(bar baz)],
                type   =&gt; 'string',
            },
        ],
    );
    $package-&gt;update_attributes( attributes =&gt; [...] );

    # Hooks
    $package-&gt;set_webhook( url =&gt; 'http://....' );
    $package-&gt;delete_webhook();

VERSIONS
--------

    ## Initialize Versions
    my $version = $package-&gt;version( name =&gt; '1.0' );
    my $info = $version-&gt;info();  # Info

    ## Version Operations

    # Upload
    $version-&gt;upload(
        file      =&gt; '/path/to/local/file',
        repo_path =&gt; 'myfiles/file',

        # Optional params
        publish =&gt; 0,  # Publish on upload
        explode =&gt; 0,  # Upload an exploded archive
    );

    # Update details
    $version-&gt;update(
        details =&gt; {
            desc   =&gt; 'version description',
            labels =&gt; [qw(foo bar)],
        },
    );

    # Sign
    $version-&gt;sign( passphrase =&gt; '...' );

    # Publish
    $version-&gt;publish();

    # Discard
    $version-&gt;discard();

    # Attributes
    my $attributes = $version-&gt;get_aatributes();
    $version-&gt;set_attributes( attributes =&gt; [...] );
    $version-&gt;update_attributes( attributes =&gt; [...] );

SEARCH
------

    ## Init Search object
    my $search = $btray-&gt;search();

    # Search Repos
    @results = $search-&gt;repos(
        name =&gt; 'myrepo',     # // either name or desc is required
        desc =&gt; 'maven repo',
    );

    # Search Packages
    @results = $search-&gt;packages(
        name    =&gt; '...',
        desc    =&gt; '...',
        repo    =&gt; '...',
        subject =&gt; '...',     # // User or Org
    );

    # Search files
    @results = $search-&gt;files(
        name =&gt; '...',
        sha1 =&gt; '...',
        repo =&gt; '...',
    );

    # Search Users or Organizations
    @results = $search-&gt;users( name =&gt; '...' );

BUGS AND LIMITATIONS
====================

Please report any bugs or feature requests to
bug-bintray-api@rt.cpan.org, or through the web interface at
http://rt.cpan.org/Public/Dist/Display.html?Name=Bintray-API

AUTHOR
======

Mithun Ayachit mithun@cpan.org

LICENSE AND COPYRIGHT
=====================

Copyright (c) 2013, Mithun Ayachit. All rights reserved.

This module is free software; you can redistribute it and/or modify it
under the same terms as Perl itself. See perlartistic.
</pre></body></html>