-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
47 lines (39 loc) · 1.18 KB
/
example.py
File metadata and controls
47 lines (39 loc) · 1.18 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
import bookingbug.business
import bookingbug.resource
business_params = dict( {
"address1":"travelBed",
"address2":"Pembroke Road",
"postcode":"BS1 2NN",
"address3":"Bristol",
"address4":"",
"country":"United Kingdom",
"email":"andy@travelbed.com",
"name":"travelBed",
"description":"travelBed B&B",
"template_id":"1",
"id":"1",
"role":"1"
} )
business_config = dict( {
"uri":'http://staging.booking-bug.com/api/company/',
"htuser":"XXX",
"htpass":"XXX",
"debug":None,
} )
create_business_json = bookingbug.business.get_json(business_params)
business_d = bookingbug.business.create( json = create_business_json, config = business_config )
print business_d.contents
resource_params = dict( {
"company_id":business_d.contents['id'],
"name":"Red Room",
"description":"The Red Bedroom"
} )
resource_config = dict( {
"uri":'http://staging.booking-bug.com/api/resource/',
"htuser":"XXX",
"htpass":"XXX",
"debug":None,
} )
create_resource_json = bookingbug.resource.get_json(resource_params)
resource_d = bookingbug.resource.create( json = create_resource_json, config = resource_config )
print resource_d.contents