Skip to content

Commit 38e0c3a

Browse files
authored
Merge pull request #191 from BookingSync/living-rooms
Add living_rooms endpoint
2 parents 3a8bc2e + 1717e8c commit 38e0c3a

File tree

6 files changed

+150
-0
lines changed

6 files changed

+150
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"living_rooms": [
3+
{
4+
"bunk_beds_count": 0,
5+
"double_beds_count": 1,
6+
"kingsize_beds_count": 0,
7+
"queensize_beds_count": 0,
8+
"single_beds_count": 2,
9+
"sofa_beds_count": 1
10+
}
11+
]
12+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"links": {
3+
"living_rooms.rental": "https://www.bookingsync.com/api/v3/rentals/{living_rooms.rental}"
4+
},
5+
"living_rooms": [
6+
{
7+
"links": {
8+
"rental": 1
9+
},
10+
"id": 1,
11+
"bunk_beds_count": 0,
12+
"double_beds_count": 1,
13+
"kingsize_beds_count": 0,
14+
"queensize_beds_count": 0,
15+
"single_beds_count": 2,
16+
"sofa_beds_count": 1,
17+
"created_at": "CREATED_AT",
18+
"updated_at": "UPDATED_AT"
19+
}
20+
]
21+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"living_rooms": [
3+
{
4+
"bunk_beds_count": 0,
5+
"double_beds_count": 1,
6+
"kingsize_beds_count": 0,
7+
"queensize_beds_count": 0,
8+
"single_beds_count": 2,
9+
"sofa_beds_count": 1
10+
}
11+
]
12+
}

content/reference/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 2016-11-25
4+
5+
* [api improvement] Add `living_rooms` endpoint.
6+
37
## 2016-11-16
48

59
* [api improvement] Update `nightly_rate_maps` endpoint with partial update information.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# LivingRooms
2+
3+
1. TOC
4+
{:toc}
5+
6+
### Parameters
7+
<ul class="nav nav-pills" role="tablist">
8+
<li class="disabled"><a>OAuth Scopes:</a></li>
9+
<li class="active"><a href="#public" role="tab" data-toggle="pill">public</a></li>
10+
<li><a href="#rentals_write" role="tab" data-toggle="pill">rentals_write</a></li>
11+
</ul>
12+
<div class="tab-content" markdown="1">
13+
<div class="tab-pane active" id="public" markdown="1">
14+
Name | Type | Read/Write | Description
15+
--------------------|---------|------------|------------
16+
id | Integer | Read | LivingRoom's id.
17+
--------------------|---------|------------|------------
18+
bunk_beds_count | Integer | Read | LivingRoom's number of bunk beds.
19+
double_beds_count | Integer | Read | LivingRoom's number of double beds.
20+
kingsize_beds_count | Integer | Read | LivingRoom's number of kingsize beds.
21+
queensize_beds_count| Integer | Read | LivingRoom's number of queensize beds.
22+
single_beds_count | Integer | Read | LivingRoom's number of single beds.
23+
sofa_beds_count | Integer | Read | LivingRoom's number of sofa beds.
24+
--------------------|---------|------------|------------
25+
created_at | [Time](/reference/enums#formats) | Read | LivingRoom's create time.
26+
updated_at | [Time](/reference/enums#formats) | Read | LivingRoom's update time.
27+
{: class="table table-bordered"}
28+
</div>
29+
<div class="tab-pane" id="rentals_write" markdown="1">
30+
Name | Type | Read/Write | Description
31+
--------------------|---------|------------|------------
32+
id | Integer | Read | LivingRoom's id.
33+
--------------------|---------|------------|------------
34+
bunk_beds_count | Integer | Read/Write | LivingRoom's number of bunk beds.
35+
double_beds_count | Integer | Read/Write | LivingRoom's number of double beds.
36+
kingsize_beds_count | Integer | Read/Write | LivingRoom's number of kingsize beds.
37+
queensize_beds_count| Integer | Read/Write | LivingRoom's number of queensize beds.
38+
single_beds_count | Integer | Read/Write | LivingRoom's number of single beds.
39+
sofa_beds_count | Integer | Read/Write | LivingRoom's number of sofa beds.
40+
--------------------|---------|------------|------------
41+
created_at | [Time](/reference/enums#formats) | Read | LivingRoom's create time.
42+
updated_at | [Time](/reference/enums#formats) | Read | LivingRoom's update time.
43+
{: class="table table-bordered"}
44+
</div>
45+
</div>
46+
47+
## List living_rooms
48+
49+
List all living_rooms for given account.
50+
51+
~~~
52+
GET /living_rooms
53+
~~~
54+
55+
<%= render 'json_response', endpoint: "living_rooms",
56+
scopes: [{ public: "public-rentals_write" }] %>
57+
58+
## Get a single living_room
59+
60+
Returns a single living_room identified by ID.
61+
62+
~~~
63+
GET /living_rooms/:living_room_id
64+
~~~
65+
66+
<%= render 'json_response', endpoint: "living_rooms",
67+
scopes: [{ public: "public-rentals_write" }] %>
68+
69+
## Create a new living_room
70+
71+
Creates a living_room for given rental.
72+
73+
~~~
74+
POST /rentals/:rental_id/living_rooms
75+
~~~
76+
77+
<%= render 'json_response', endpoint: "living_rooms", request: "create",
78+
scopes: [{ rentals_write: "public-rentals_write" }] %>
79+
80+
## Update a living_room
81+
82+
Returns an updated living_room identified by ID.
83+
84+
~~~
85+
PUT /living_rooms/:living_room_id
86+
~~~
87+
88+
<%= render 'json_response', endpoint: "living_rooms", request: "update",
89+
scopes: [{ rentals_write: "public-rentals_write" }] %>
90+
91+
## Destroy a living_room
92+
93+
Required OAuth scope: `:rentals_write`
94+
95+
Returns an empty response with '204 No Content' status code on success.
96+
97+
~~~~~~
98+
DELETE /living_rooms/:living_room_id
99+
~~~~~~

layouts/reference.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ <h3 class="panel-title">Endpoints</h3>
5656
class: "list-group-item") %>
5757
<%= link_to_with_current("Inquiries", "/reference/endpoints/inquiries/",
5858
class: "list-group-item") %>
59+
<%= link_to_with_current("Living Rooms", "/reference/endpoints/living_rooms/",
60+
class: "list-group-item") %>
5961
<%= link_to_with_current("Nightly Rate Maps", "/reference/endpoints/nightly_rate_maps/",
6062
class: "list-group-item") %>
6163
<%= link_to_with_current("Payments", "/reference/endpoints/payments/",

0 commit comments

Comments
 (0)