Skip to content

Commit

Permalink
initial half-implemented service
Browse files Browse the repository at this point in the history
  • Loading branch information
cotto committed Jan 21, 2012
0 parents commit d02bd27
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
6 changes: 6 additions & 0 deletions parrotbug_service.info
@@ -0,0 +1,6 @@
name = parrotbug API resource
description = create a ticket on github by proxy
package = Services
core = 6.x
php = 5.x
dependencies[] = services
66 changes: 66 additions & 0 deletions parrotbug_service.module
@@ -0,0 +1,66 @@
<?php

/**
* @file
* Provides a generic but powerful API for web services.
*/

/**
* implementation of hook_services_resources().
*/
function parrotbug_service_services_resources() {
$resources = array();

$resources['parrotbug'] = array(
'create' => array(
'file' => array(
'type' => 'module',
'module' => 'parrotbug_service',
'name' => 'parrotbug_service'
),
'help' => 'Creates a github issue',
'callback' => '_parrotbug_service_create',
'access callback' => '_parrotbug_service_access',
'args' => array(
array(
'name' => 'title',
'type' => 'string',
'source' => array('param' => 'title'),
'optional' => FALSE,
),
array(
'name' => 'body',
'type' => 'string',
'source' => array('param' => 'body'),
'optional' => FALSE,
),
array(
'name' => 'assignee',
'type' => 'string',
'source' => array('param' => 'assignee'),
'optional' => TRUE,
'default value' => '',
),
array(
'name' => 'tags',
'type' => 'array',
'source' => array('param' => 'tags'),
'optional' => TRUE,
'default value' => array(),
),
),
),
);

return $resources;
}

function _parrotbug_service_create($title, $body, $assignee, $labels) {

}

function _parrotbug_service_access() {
global $user;
# XXX: something better
return FALSE;
}

0 comments on commit d02bd27

Please sign in to comment.