NAME

WebService::VaultPress::Partner::Request::GoldenTicket - The VaultPress Partner API Client Golden Ticket Request Object

VERSION

version 0.01.00

SYNOPSIS

#!/usr/bin/perl
use warnings;
use strict;
use Carp;
use WebService::VaultPress::Partner;

my $VP = WebService::VaultPress::Partner->new(
    key => 'Your Key Goes Here',
);

sub handle_error {
    my ( $res ) = @_;
    croak "Failed during " . $res->api_call . " with error: " . $res->error
        unless $res->is_success;
}

# How many people signed up.
my $result = $VP->GetUsage; 

handle_error($result);

printf( "%7s => %5d\n", $_, $result->$_ ) for qw/ unused basic premium /;


# Print A Nice History Listing
printf( "\033[1m| %-20s | %-20s | %-30s | %-19s | %-19s | %-7s |\n\033[0m", 
    "First Name", "Last Name", "Email Address", "Created", "Redeemed", "Type");

my @results = $VP->GetHistory; 

handle_error( $results[0] );

for my $obj ( $VP->GetHistory ) {
    printf( "| %-20s | %-20s | %-30s | %-19s | %-19s | %-7s |\n", $obj->fname, 
        $obj->lname, $obj->email, $obj->created, $obj->redeemed, $obj->type );
}


# Give Alan Shore a 'Golden Ticket' to VaultPress

my $ticket = $VP->CreateGoldenTicket(
    fname => 'Alan',
    lname => 'Shore',
    email => 'alan.shore@gmail.com',
); 

handle_error( $ticket );

print "You can sign up for your VaultPress account <a href=\"" 
    . $ticket->ticket ."\">Here!</a>\n";

DESCRIPTION

This document outlines the methods available through the WebService::VaultPress::Partner::Request::GoldenTicket class. You should not instantiate an object of this class yourself when using WebService::VaultPress::Partner, it is created by the arguments to ->CreateGoldenTicket. Its primary purpose is to use Moose's type and error systems to throw errors when required parameters are not passed to ->CreateGoldenTicket

WebService::VaultPress::Partner is a set of Perl modules which provides a simple and consistent Client API to the VaultPress Partner API. The main focus of the library is to provide classes and functions that allow you to quickly access VaultPress from Perl applications.

The modules consist of the WebService::VaultPress::Partner module itself as well as a handful of WebService::VaultPress::Partner::Request modules as well as a response object, WebService::VaultPress::Partner::Response, that provides consistent error and success methods.

METHODS

api
Set By

WebService::VaultPress::Partner->CreateGoldenTicket( key => value, … )

Required

This key is not required.

Default Value

Unless explicitly set the value for this method is "https://partner-api.vaultpress.com/gtm/1.0/"

Value Description

This method provides WebService::VaultPress::Partner with the URL which will be used for the API call.

email
Set By

WebService::VaultPress::Partner->CreateGoldenTicket( key => value, … )

Required

This key is required.

Default Value

There is no default value associated with this method, it must be explicitly set.

Value Description

This method provides WebService::VaultPress::Partner with the email address of the user on whose behalf the Golden Ticket is being requested.

fname
Set By

WebService::VaultPress::Partner->CreateGoldenTicket( key => value, … )

Required

This key is required.

Default Value

There is no default value associated with this method, it must be explicitly set.

Value Description

This method provides WebService::VaultPress::Partner with the first name of the user on whose behalf the Golden Ticket is being requested.call.

lname
Set By

WebService::VaultPress::Partner->CreateGoldenTicket( key => value, … )

Required

This key is required.

Default Value

There is no default value associated with this method, it must be explicitly set.

Value Description

This method provides WebService::VaultPress::Partner with the last name of the user on whose behalf the Golden Ticket is being requested.

SEE ALSO

WebService::VaultPress::Partner VaultPress::Partner::Response VaultPress::Partner::Request::History WebService::VaultPress::Partner::Usage

AUTHOR

SymKat <symkat@symkat.com>

COPYRIGHT AND LICENSE

This is free software licensed under a BSD-Style License. Please see the LICENSE file included in this package for more detailed information.

AVAILABILITY

The latest version of this software is available through GitHub at https://github.com/mediatemple/webservice/vaultpress-partner/

1 POD Error

The following errors were encountered while parsing the POD:

Around line 128:

Non-ASCII character seen before =encoding in '…'. Assuming UTF-8