NAME

WWW::Codeguard::Partner - Perl interface to interact with the Codeguard API as a 'partner'.

SYNOPSIS

This module provides you with an perl interface to interact with the Codeguard API and perform the 'partner' level calls.

        use WWW::Codeguard::Partner;

        my $api = WWW::Codeguard::Partner->new(
                $api_url,
                {
                        partner_key => $partner_key,
                        verify_hostname => 1,
                }
        );

        $api->create_user($params_for_create_user);
        $api->list_user($params_for_list_user);
        $api->delete_user($params_for_delete_user);

METHODS

Each of these map to a call on Codeguard's Partner API.

create_user

This allows you to create an account, on to which you can add website/database resources. Params should be a hashref that contains the following attributes:

Required: The request will not succeed without these attributes.

        name
        email

Optional Attributes:

        password
        time_zone
        partner_data - This is a string that can be used to store user-specific information, that the partner may use to identify the user (such as package id, etc)
        plan_id

list_user

This allows you to fetch information for a user. Params should be a hashref that contains the following attributes:

Required:

        user_id

Optional:

        None

delete_user

This method is used to delete existing users that were created using the specified partner_key. Parters can not delete users created by other partners.

Note: Deleting a user resource will also delete all associated Website and Database records.

Params should be a hashref that contains the following attributes:

Required:

        user_id

Optional Attributes:

        None

change_user_plan

This method is used to change an existing user's plan. Params should be a hashref that contains the following attributes:

Required:

        user_id
        plan_id

Optional Attributes

        None

user_quota_report

Required:

        None

Optional:

        None

Returns an array of Users who are using more than their allowed disk quota.

Note: Full User models are not included. Only the Attributes listed below are returned:

  • email - User email address.

  • package - CodeGuard plan ID associated with this user.

  • quota - Allowed quota in bytes.

  • usage - Disk usage in bytes.

  • percent_usage - Percent of quota used. This can be > 100%.

  • signup_date - Date of User account creation.

  • overage_date - Date the user was notified or 'Not yet notified' if a notification has not yet occurred.

Accessors

Basic accessor methods to retrieve the current settings

get_partner_key

Returns the partner_key of the object instance.

AUTHOR

Rishwanth Yeddula, <ryeddula at cpan.org>

BUGS

Please report any bugs or feature requests to bug-www-codeguard at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-Codeguard. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the following perldoc commands.

    perldoc WWW::Codeguard
    perldoc WWW::Codeguard::Partner
    perldoc WWW::Codeguard::User

You can also look for information at:

ACKNOWLEDGMENTS

Thanks to Hostgator.com for funding the development of this module and providing test resources.

LICENSE AND COPYRIGHT

Copyright 2014 Rishwanth Yeddula.

This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:

http://www.perlfoundation.org/artistic_license_2_0

Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.

If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.

This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.

This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed.

Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.