NAME
AnyEvent::HTTP::Spark - Syncrnous/Asyncrnous HTTP Rest Client for Cisco Spark
SYNOPSIS
use AnyEvent::HTTP::Spark;
my $obj=new AnyEvent::HTTP::Spark(token=>$ENV{SPARK_TOKEN});
DESCRIPTION
Dual Nature Syncrnous/Asyncrnous AnyEvent friendly Spark v1 HTTP Client library.
Moo Roles Used
This class uses the following Moo Roles
HTTP::MultiGet::Role
Log::LogMethods
Data::Result::Moo
AnyEvent::SpakBot::SharedRole
OO Arguments and accessors
Required OO Arguments
token: required for spark authentication
Optional OO Arguments
logger: sets the logging object
agent: AnyEvent::HTTP::MultiGet object
api_url: https://api.ciscospark.com/v1/
# sets the web service the requests point to
OO Web Methods and special Handlers
Each web method has a blocking and a non blocking context.
Any Method with a prefix of que_ can be called in either a blocking or a non blocking context. Most people will use the blocking interface of the client.
Non Blocking context for use with AnyEvent Loops
my $cb=sub {
my ($self,$id,$result,$request,$response)=@_;
if($result) {
print Dumper($result->get_data);
} else {
...
}
};
my $id=$self->que_listPeople($cb,$args);
$self->agent->run_next;
Blocking Context
my $result=$self->listPeople($args);
if($result) {
print Dumper($result->get_data);
} else {
die $result;
}
People
Get Me
Blocking my $result=$self->getMe()
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_getMe($cb)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Get Me Vendor Documentation: https://developer.ciscospark.com/endpoint-people-me-get.html
List People
Blocking my $result=$self->listPeople($hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_listPeople($cb,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
List People Vendor Documentation: https://developer.ciscospark.com/endpoint-people-get.html
Get Person
Blocking my $result=$self->getPerson($personId)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_getPerson($cb,$personId)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$personId)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Get Person Vendor Documentation: https://developer.ciscospark.com/endpoint-people-personId-get.html
Create Person
Blocking my $result=$self->createPerson($hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_createPerson($cb,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Create Person Vendor Documentation: https://developer.ciscospark.com/endpoint-people-post.html
Delete Person
Blocking my $result=$self->deletePerson($personId)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_deletePerson($cb,$personId)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$personId)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Delete Person Vendor Documentation: https://developer.ciscospark.com/endpoint-people-personId-delete.html
Update Person
Blocking my $result=$self->updatePerson($personId,$hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_updatePerson($cb,$personId,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$personId,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Update Person Vendor Documentation: https://developer.ciscospark.com/endpoint-people-personId-put.html
Rooms
List Rooms
Blocking my $result=$self->listRooms($hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_listRooms($cb,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
List Rooms Vendor Documentation: https://developer.ciscospark.com/endpoint-rooms-get.html
Get Room
Blocking my $result=$self->getRoom($roomId)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_getRoom($cb,$roomId)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$roomId)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Get Room Vendor Documentation: https://developer.ciscospark.com/endpoint-rooms-roomId-get.html
Create Room
Blocking my $result=$self->createRoom($hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_createRoom($cb,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Create Room Vendor Documentation: https://developer.ciscospark.com/endpoint-rooms-post.html
Delete Room
Blocking my $result=$self->deleteRoom($roomId)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_deleteRoom($cb,$roomId)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$roomId)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Delete Room Vendor Documentation: https://developer.ciscospark.com/endpoint-rooms-roomId-delete.html
Update Room
Blocking my $result=$self->updateRoom($roomId,$hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_updateRoom($cb,$roomId,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$roomId,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Update Room Vendor Documentation: https://developer.ciscospark.com/endpoint-rooms-roomId-put.html
Memberships
List Memberships
Blocking my $result=$self->listMemberships($hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_listMemberships($cb,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
List Memberships Vendor Documentation: https://developer.ciscospark.com/endpoint-memberships-get.html
Get Membership
Blocking my $result=$self->getMembership($membershipId)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_getMembership($cb,$membershipId)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$membershipId)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Get Membership Vendor Documentation: https://developer.ciscospark.com/endpoint-memberships-membershipId-get.html
Create Membership
Blocking my $result=$self->createMembership($hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_createMembership($cb,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Create Membership Vendor Documentation: https://developer.ciscospark.com/endpoint-memberships-post.html
Delete Membership
Blocking my $result=$self->deleteMembership($membershipId)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_deleteMembership($cb,$membershipId)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$membershipId)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Delete Membership Vendor Documentation: https://developer.ciscospark.com/endpoint-memberships-membershipId-delete.html
Update Membership
Blocking my $result=$self->updateMembership($membershipId,$hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_updateMembership($cb,$membershipId,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$membershipId,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Update Membership Vendor Documentation: https://developer.ciscospark.com/endpoint-memberships-membershipId-put.html
Messages
List Messages
Special Notes on bots for this method, bots can only list messages refering to the bot itself. This means there are 2 manditory arguments when using a bot. If mentionedPeople is not set to the litteral string 'me' a bot will encounter a 403 error.
$hashRef Required options
roomId: the id for the room
mentionedPeople: me
Blocking my $result=$self->listMessages($hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_listMessages($cb,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
List Messages Vendor Documentation: https://developer.ciscospark.com/endpoint-messages-get.html
Get Message
Blocking my $result=$self->getMessage($messageId)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_getMessage($cb,$messageId)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$messageId)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Get Message Vendor Documentation: https://developer.ciscospark.com/endpoint-messages-messageId-get.html
Create Message
Blocking my $result=$self->createMessage($hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_createMessage($cb,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Create Message Vendor Documentation: https://developer.ciscospark.com/endpoint-messages-post.html
Delete Message
Blocking my $result=$self->deleteMessage($messageId)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_deleteMessage($cb,$messageId)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$messageId)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Delete Message Vendor Documentation: https://developer.ciscospark.com/endpoint-messages-messageId-delete.html
Teams
List Teams
Blocking my $result=$self->listTeams($hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_listTeams($cb,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
List Teams Vendor Documentation: https://developer.ciscospark.com/endpoint-teams-get.html
Get Team
Blocking my $result=$self->getTeam($teamId)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_getTeam($cb,$teamId)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$teamId)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Get Team Vendor Documentation: https://developer.ciscospark.com/endpoint-teams-teamId-get.html
Create Team
Blocking my $result=$self->createTeam($hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_createTeam($cb,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Create Team Vendor Documentation: https://developer.ciscospark.com/endpoint-teams-post.html
Delete Team
Blocking my $result=$self->deleteTeam($teamId)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_deleteTeam($cb,$teamId)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$teamId)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Delete Team Vendor Documentation: https://developer.ciscospark.com/endpoint-teams-teamId-delete.html
Update Team
Blocking my $result=$self->updateTeam($teamId,$hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_updateTeam($cb,$teamId,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$teamId,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Update Team Vendor Documentation: https://developer.ciscospark.com/endpoint-teams-teamId-put.html
Team Memberships
List Team Memberships
Blocking my $result=$self->listTeamMemberships($hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_listTeamMemberships($cb,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
List Team Memberships Vendor Documentation: https://developer.ciscospark.com/endpoint-teammemberships-get.html
Get Team Membership
Blocking my $result=$self->getTeamMembership($teamMembershipId)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_getTeamMembership($cb,$teamMembershipId)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$teamMembershipId)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Get Team Membership Vendor Documentation: https://developer.ciscospark.com/endpoint-teammemberships-membershipId-get.html
Create Team Membership
Blocking my $result=$self->createTeamMembership($hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_createTeamMembership($cb,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Create Team Membership Vendor Documentation: https://developer.ciscospark.com/endpoint-teammemberships-post.html
Delete Team Membership
Blocking my $result=$self->deleteTeamMembership($teamMembershipId)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_deleteTeamMembership($cb,$teamMembershipId)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$teamMembershipId)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Delete Team Membership Vendor Documentation: https://developer.ciscospark.com/endpoint-teammemberships-membershipId-delete.html
Update Team Membership
Blocking my $result=$self->updateTeamMembership($teamMembershipId,$hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_updateTeamMembership($cb,$teamMembershipId,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$teamMembershipId,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Update Team Membership Vendor Documentation: https://developer.ciscospark.com/endpoint-teammemberships-membershipId-put.html
Webhooks
List Webhooks
Blocking my $result=$self->listWebhooks($hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_listWebhooks($cb,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
List Webhooks Vendor Documentation: https://developer.ciscospark.com/endpoint-webhooks-get.html
Get Webhook
Blocking my $result=$self->getWebhook($webhookId)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_getWebhook($cb,$webhookId)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$webhookId)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Get Webhook Vendor Documentation: https://developer.ciscospark.com/endpoint-webhooks-webhookId-get.html
Create Webhook
Blocking my $result=$self->createWebhook($hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_createWebhook($cb,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Create Webhook Vendor Documentation: https://developer.ciscospark.com/endpoint-webhooks-post.html
Delete Webhook
Blocking my $result=$self->deleteWebhook($webhookId)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_deleteWebhook($cb,$webhookId)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$webhookId)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Delete Webhook Vendor Documentation: https://developer.ciscospark.com/endpoint-webhooks-webhookId-delete.html
Update Webhook
Blocking my $result=$self->updateWebhook($webhookId,$hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_updateWebhook($cb,$webhookId,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$webhookId,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Update Webhook Vendor Documentation: https://developer.ciscospark.com/endpoint-webhooks-webhookId-put.html
Organizations
List Organizations
Blocking my $result=$self->listOrganizations($hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_listOrganizations($cb,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
List Organizations Vendor Documentation: https://developer.ciscospark.com/endpoint-organizations-get.html
Get Organization
Blocking my $result=$self->getOrganization($organizationId)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_getOrganization($cb,$organizationId)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$organizationId)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Get Organization Vendor Documentation: https://developer.ciscospark.com/endpoint-organizations-orgId-get.html
Licenses
List Licenses
Blocking my $result=$self->listLicenses($hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_listLicenses($cb,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
List Licenses Vendor Documentation: https://developer.ciscospark.com/endpoint-licenses-get.html
Get License
Blocking my $result=$self->getLicense($licenseId)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_getLicense($cb,$licenseId)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$licenseId)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Get License Vendor Documentation: https://developer.ciscospark.com/endpoint-licenses-licenseId-get.html
Roles
List Roles
Blocking my $result=$self->listRoles($hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_listRoles($cb,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
List Roles Vendor Documentation: https://developer.ciscospark.com/endpoint-roles-get.html
Get Role
Blocking my $result=$self->getRole($roleId)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_getRole($cb,$roleId)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$roleId)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Get Role Vendor Documentation: https://developer.ciscospark.com/endpoint-roles-roleId-get.html
Events
List Events
Blocking my $result=$self->listEvents($hashRef)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_listEvents($cb,$hashRef)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$hashRef)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
List Events Vendor Documentation: https://developer.ciscospark.com/endpoint-events-get.html
Get Event
Blocking my $result=$self->getEvent($eventId)
Returns a Data::Result Object, when true it contains the data, when false it contains why it failed.
Non-Blocking my $id=$self->que_getEvent($cb,$eventId)
Example Callback
$cb=sub { my ($self,$id,$result,$request,$response,$eventId)=@_; # 0: $self The current AnyEvent::HTTP::Slack object # 1: $id the id of the http request # 2: Data::Result Object # 3: HTTP::Request Object # 4: HTTP::Result Object };
Get Event Vendor Documentation: https://developer.ciscospark.com/endpoint-events-eventId-get.html
Low Level Request functions
This section documents low level request functions.
$self->handle_paginate($id,$result,$request,$response,$cb)
Internal Method wrapper for parsing pagination headers.
Example:
my $code=sub { my ($self,$id,$result,$request,$response)=@_; $self->handle_paginate($id,$result,$request,$response,$cb); }; return $self->que_get($code,$url,$args);
Pagination information can be found in the following result fields.
cursorPosition: last|next|prev|first pageLink: (undef when cursorPosition eq 'last') Url to the next page
my $result=$self->build_post_json($url,$data);
Returns a Data::Result object; When true it contains an HTTP::Request Object For $url, the body will consist of $data converted to json. When false it contains why it failed.
my $id=$self->queue_builder($cb,$method,$url,$data);
Returns the ID of the object in the request for $method.
my $id=$self->que_post_json($cb,$url,$data);
Queue's a json post and returns the id
my $result=$self->build_put_json($url,$data);
Returns a Data::Result object; When true it contains an HTTP::Request Object For $url, the body will consist of $data converted to json. When false it contains why it failed.
my $id=$self->que_put_json($cb,$url,$data);
Queue's a json put and returns the id
my $result=$self->build_post_form($url,$data);
Returns a Data::Result Object, when true it contains the correctly fromatted HTTP::Request Object, when false it contains why it failed.
my $id=$self->que_post_form($cb,$url,$data);
Queue's a form post and returns the id
my $result=$self->build_get($url,$data);
Returns a Data::Result Object, when true it contains the correctly fromatted HTTP::Request Object, when false it contains why it failed.
my $self->que_getRaw($cb,$raw_url)
Que's a diy get request
my $id=$self->que_get($cb,$url,$data);
Queue's a form post and returns the id
my $result=$self->build_head($url,$data);
Returns a Data::Result Object, when true it contains the correctly fromatted HTTP::Request Object, when false it contains why it failed.
my $id=$self->que_head($cb,$url,$data);
Queue's a form post and returns the id
my $result=$self->build_delete($url,$data);
Returns a Data::Result Object, when true it contains the delete request, when false it contains why it failed.
my $id=$self->que_delete($cb,$url,$data);
Ques a delete to run.
$self->handle_delete($cb,$id,$result,$result)
Internal handler for delete results
AUTHOR
Michael Shipper <AKALINUX@CPAN.ORG>