files.com 1.0.341 → 1.0.342
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/_VERSION +1 -1
- data/docs/snapshot.md +17 -0
- data/lib/files.com/models/snapshot.rb +54 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7458797b6e16bae6a2cc875ce51e4260071662654c0409f1c4c6a2e52a13c6e
|
4
|
+
data.tar.gz: cd8927cc6fd7e377d235023f9619ddebd85c799cac5456349f168b2290eff83f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5cf369b8c58189785b6cad2660067ca1a558cdf29468558e6ab790639511568ea1b292c8a6a958ae3f4453251737e77f1c60920722868ef26902d9048ceb548
|
7
|
+
data.tar.gz: 1e2e6db344b59a26fdbda10284151f02e9e9ba275c561b100b5136a02561bd87cdabf21c93586e5bab375edfe2a3219136a9527156227787178240dc39ac7dd5
|
data/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.342
|
data/docs/snapshot.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
# Snapshot
|
2
2
|
|
3
|
+
## Example Snapshot Object
|
4
|
+
|
5
|
+
```
|
6
|
+
{
|
7
|
+
"expires_at": "2000-01-01T01:00:00Z",
|
8
|
+
"finalized_at": "2000-01-01T01:00:00Z",
|
9
|
+
"name": "My Snapshot",
|
10
|
+
"user_id": 1,
|
11
|
+
"bundle_id": 1
|
12
|
+
}
|
13
|
+
```
|
14
|
+
|
15
|
+
* `expires_at` (date-time): When the snapshot expires.
|
16
|
+
* `finalized_at` (date-time): When the snapshot was finalized.
|
17
|
+
* `name` (string): A name for the snapshot.
|
18
|
+
* `user_id` (int64): The user that created this snapshot, if applicable.
|
19
|
+
* `bundle_id` (int64): The bundle using this snapshot, if applicable.
|
3
20
|
* `id` (int64): Snapshot ID.
|
4
21
|
|
5
22
|
|
@@ -9,6 +9,51 @@ module Files
|
|
9
9
|
@options = options || {}
|
10
10
|
end
|
11
11
|
|
12
|
+
# date-time - When the snapshot expires.
|
13
|
+
def expires_at
|
14
|
+
@attributes[:expires_at]
|
15
|
+
end
|
16
|
+
|
17
|
+
def expires_at=(value)
|
18
|
+
@attributes[:expires_at] = value
|
19
|
+
end
|
20
|
+
|
21
|
+
# date-time - When the snapshot was finalized.
|
22
|
+
def finalized_at
|
23
|
+
@attributes[:finalized_at]
|
24
|
+
end
|
25
|
+
|
26
|
+
def finalized_at=(value)
|
27
|
+
@attributes[:finalized_at] = value
|
28
|
+
end
|
29
|
+
|
30
|
+
# string - A name for the snapshot.
|
31
|
+
def name
|
32
|
+
@attributes[:name]
|
33
|
+
end
|
34
|
+
|
35
|
+
def name=(value)
|
36
|
+
@attributes[:name] = value
|
37
|
+
end
|
38
|
+
|
39
|
+
# int64 - The user that created this snapshot, if applicable.
|
40
|
+
def user_id
|
41
|
+
@attributes[:user_id]
|
42
|
+
end
|
43
|
+
|
44
|
+
def user_id=(value)
|
45
|
+
@attributes[:user_id] = value
|
46
|
+
end
|
47
|
+
|
48
|
+
# int64 - The bundle using this snapshot, if applicable.
|
49
|
+
def bundle_id
|
50
|
+
@attributes[:bundle_id]
|
51
|
+
end
|
52
|
+
|
53
|
+
def bundle_id=(value)
|
54
|
+
@attributes[:bundle_id] = value
|
55
|
+
end
|
56
|
+
|
12
57
|
# int64 - Snapshot ID.
|
13
58
|
def id
|
14
59
|
@attributes[:id]
|
@@ -58,8 +103,9 @@ module Files
|
|
58
103
|
raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
|
59
104
|
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
|
60
105
|
|
61
|
-
|
62
|
-
|
106
|
+
List.new(Snapshot, params) do
|
107
|
+
Api.send_request("/snapshots", :get, params, options)
|
108
|
+
end
|
63
109
|
end
|
64
110
|
|
65
111
|
def self.all(params = {}, options = {})
|
@@ -74,8 +120,8 @@ module Files
|
|
74
120
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
75
121
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
76
122
|
|
77
|
-
response,
|
78
|
-
response.data
|
123
|
+
response, options = Api.send_request("/snapshots/#{params[:id]}", :get, params, options)
|
124
|
+
Snapshot.new(response.data, options)
|
79
125
|
end
|
80
126
|
|
81
127
|
def self.get(id, params = {}, options = {})
|
@@ -83,8 +129,8 @@ module Files
|
|
83
129
|
end
|
84
130
|
|
85
131
|
def self.create(params = {}, options = {})
|
86
|
-
response,
|
87
|
-
response.data
|
132
|
+
response, options = Api.send_request("/snapshots", :post, params, options)
|
133
|
+
Snapshot.new(response.data, options)
|
88
134
|
end
|
89
135
|
|
90
136
|
def self.update(id, params = {}, options = {})
|
@@ -93,8 +139,8 @@ module Files
|
|
93
139
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
94
140
|
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
95
141
|
|
96
|
-
response,
|
97
|
-
response.data
|
142
|
+
response, options = Api.send_request("/snapshots/#{params[:id]}", :patch, params, options)
|
143
|
+
Snapshot.new(response.data, options)
|
98
144
|
end
|
99
145
|
|
100
146
|
def self.delete(id, params = {}, options = {})
|