-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbat_api.services.inc
More file actions
106 lines (102 loc) · 2.3 KB
/
bat_api.services.inc
File metadata and controls
106 lines (102 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
/**
* Implements hook_default_services_endpoint().
*/
function bat_api_default_services_endpoint() {
$export = array();
$endpoint = new stdClass();
$endpoint->disabled = FALSE; /* Edit this to true to make a default endpoint disabled initially */
$endpoint->api_version = 3;
$endpoint->name = 'bat_api';
$endpoint->server = 'rest_server';
$endpoint->path = 'bat/v1';
$endpoint->authentication = array(
'services' => 'services',
);
$endpoint->server_settings = array(
'formatters' => array(
'json' => TRUE,
'bencode' => FALSE,
'jsonp' => FALSE,
'php' => FALSE,
'xml' => FALSE,
'yaml' => FALSE,
),
'parsers' => array(
'application/json' => TRUE,
'application/vnd.php.serialized' => TRUE,
'application/x-www-form-urlencoded' => TRUE,
'application/x-yaml' => TRUE,
'application/xml' => TRUE,
'multipart/form-data' => TRUE,
'text/xml' => TRUE,
),
);
$endpoint->resources = array(
'units' => array(
'operations' => array(
'index' => array(
'enabled' => '1',
),
'update' => array(
'enabled' => '1',
),
),
'actions' => array(
'add' => array(
'enabled' => '1',
),
),
),
'availability' => array(
'operations' => array(
'index' => array(
'enabled' => '1',
),
'update' => array(
'enabled' => '1',
),
),
),
'pricing' => array(
'operations' => array(
'index' => array(
'enabled' => '1',
),
'update' => array(
'enabled' => '1',
),
),
),
'booking' => array(
'operations' => array(
'index' => array(
'enabled' => '1',
),
),
'actions' => array(
'add' => array(
'enabled' => '1',
),
),
),
'user' => array(
'actions' => array(
'login' => array(
'enabled' => '1',
),
'logout' => array(
'enabled' => '1',
'settings' => array(
'services' => array(
'resource_api_version' => '1.0',
),
),
),
),
),
);
$endpoint->debug = 0;
$export['bat_api'] = $endpoint;
return $export;
}