Skip to content

Commit d519c30

Browse files
author
Andrei Birjukov
committed
Sync TTL related changes to snippets
1 parent 7ab284e commit d519c30

File tree

88 files changed

+521
-44
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+521
-44
lines changed

sync/rest/documents/create-document/create-document.3.x.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ service.documents
99
.create({
1010
uniqueName: 'MyFirstDocument',
1111
data: { firstName: 'Alice' },
12+
ttl: 1814400 // expires in 21 days
1213
})
1314
.then(response => {
1415
console.log(response);

sync/rest/documents/create-document/create-document.5.x.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ public static void Main(string[] args)
2525

2626
var doc = DocumentResource.Create(serviceSid,
2727
"MyFirstDocument",
28-
data);
28+
data,
29+
1814400); // expires in 21 days
2930

3031
Console.WriteLine(doc.Sid);
3132
}

sync/rest/documents/create-document/create-document.5.x.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
->documents->create(
2727
array(
2828
'uniqueName' => "MyFirstDocument",
29-
'data' => $data
29+
'data' => $data,
30+
'ttl' => 1814400 // expires in 21 days
3031
)
3132
);
3233

sync/rest/documents/create-document/create-document.5.x.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
# Create the Document, data can be any JSON
2121
response = service.documents.create(
2222
unique_name: 'MyFirstDocument',
23-
data: "{#{data.join(',')}}"
23+
data: "{#{data.join(',')}}",
24+
ttl: 1814400 # expires in 21 days
2425
)
2526

2627
puts response

sync/rest/documents/create-document/create-document.6.x.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
document = client.sync \
1919
.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
2020
.documents \
21-
.create(unique_name="MyFirstDocument", data=data)
21+
.create(unique_name="MyFirstDocument",
22+
data=data,
23+
ttl=1814400) # expires in 21 days
2224

2325
print(document.sid)

sync/rest/documents/create-document/create-document.7.x.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public static void main(String[] args) {
2828
.creator("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
2929
.setUniqueName("MyFirstDocument")
3030
.setData(data)
31+
.setTtl(1814400) // expires in 21 days
3132
.create();
3233

3334
System.out.println(document.getSid());
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
curl -X POST https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Documents \
22
-d 'UniqueName=MyFirstDocument' \
3-
-d 'Data={"firstName":"Alice"}' \
3+
-d 'Data={"firstName":"Alice"}' \
4+
-d 'Ttl=1814400'
45
-u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'

sync/rest/documents/create-document/output/create-document.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
66
"date_created": "2016-07-07T20:53:38Z",
77
"date_updated": "2016-07-07T20:53:38Z",
8+
"date_expires": "2016-07-28T20:53:38Z",
89
"sid": "ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
910
"service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
1011
"data": {

sync/rest/documents/list-documents/output/list-documents.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"created_by": "system",
77
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
88
"date_created": "2016-07-07T20:53:38Z",
9-
"date_updated": null,
9+
"date_updated": "2016-07-07T20:53:38Z",
10+
"date_expires": null,
1011
"sid": "ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
1112
"service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
1213
"data": {

sync/rest/documents/retrieve-document/output/retrieve-document.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
66
"date_created": "2016-07-07T20:53:38Z",
77
"date_updated": "2016-07-07T20:53:38Z",
8+
"date_expires": null,
89
"sid": "ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
910
"service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
1011
"data": {

0 commit comments

Comments
 (0)