NAME

WWW::Giraffi::API::Media - Giraffi API Media Method Access Module

VERSION

0.13_04

SYNOPSIS

use strict;
use warnings;
use WWW::Giraffi::API;

my $apikey = "ilovenirvana_ilovekurtcobain";
my $g = WWW::Giraffi::API->new(apikey => $apikey);
# get all media data
my $arrayref = $g->media->all;
foreach $ref(@{$arrayref}) {
    ## anything to do...
}

DESCRIPTION

WWW::Giraffi::API::Media is Giraffi API Media Method Access Module

METHOD

all

Get All Media Setting

Example:

$ create media object
my $media = $g->media;
my $arrayref = $media->all;

Return Array Reference:

[
  {
    'medium' => {
         'options' => {
              'address' => 'me@domain'
         },
        'mediumtype' => 'email',
        'name' => 'Alert Email',
        'user_id' => 1639,
        'id' => 556
     }
  }
]

Get Media Setting

Example:

my $conditions = { 'name' => 'Alert Email' };
my $arrayref = $media->search($conditions);

Return Array Reference:

# only conditions match
[
  {
    'medium' => {
         'options' => {
              'address' => 'me@domain'
         },
        'mediumtype' => 'email',
        'name' => 'Alert Email',
        'user_id' => 1639,
        'id' => 556
     }
  }
]

find

Get One Media Setting

Example:

my $media_id = 1;
my $ref = $media->find($media_id);

Return Reference:

{
  'medium' => {
       'options' => {
            'address' => 'me@domain'
       },
      'mediumtype' => 'email',
      'name' => 'Alert Email',
      'user_id' => 1639,
      'id' => 556
   }
}

find_oauth

todo

find_oauth_callback

todo

create

Post Media Setting

Example:

my $conditions = {
      options => {
            address => 'me@domain'
      },
      mediumtype => 'email',
      name => 'Alert Email',
   };
$media->create($conditions);

update

Update Media Setting

Example:

my $media_id = 1;
my $conditions = {
      options => {
            address => 'you@domain'
      },
      mediumtype => 'email',
      name => 'Emergency Email',
   };
$media->update($media_id, $conditions);

destroy

Delete Media Setting

Example:

my $media_id = 1;
$media->delete($media_id);

AUTHOR

Akira Horimoto <emperor@gmail.com>

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.