files.com 1.0.103 → 1.0.104

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f919d05ae57ba64da53d365f1113ae7201112f868d1efc2b589441aef6ab641
4
- data.tar.gz: c8ba72453ec961faac523f28353a2a740502c7e68204e5e36a53012bdb671520
3
+ metadata.gz: 5f77fd18dc9c28e0fab729624b8b155a7bf6f4046c90f7404abfdcb96602d7da
4
+ data.tar.gz: a8b9c317b029edc78dccce648554398e6dd86e622c948c2574b393a43230dc8a
5
5
  SHA512:
6
- metadata.gz: 4caf847e2199a84755cf407af3baaaed160378d7c2b0024a0b0f1b87610c835cc16f015be5b700dc08cd55a1bd72b0c548116ba8bcb485b0cb4b8fa76bd6db43
7
- data.tar.gz: dc807e6052c1b8dacbbea536de7bff4ac1f2e4dc6768e6dc5f40cdf90f1e034b3d56c90ff983e3a0a06228f8bc3201d55e573f49b04d2381474b81f480e6f177
6
+ metadata.gz: dd72ee23eb04a85b17580d3202dc5354e228295ae490963b11d7a17540066667b5cf53227ecaa99ee8109911eddc411dcd31ef86ca0f4f78b9aa531aa80ca04c
7
+ data.tar.gz: c0042be73f96c5b7c2e495d1422c0602158ac973c8c9bd134b4d7acf42f532f903a9ac28643383efc075bbdf4b6472600b453fb0bc19b7b378c4b226aee0e76c
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.103
1
+ 1.0.104
@@ -43,3 +43,11 @@ Files::BandwidthSnapshot.list(
43
43
  * `page` (int64): Current page number.
44
44
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
45
45
  * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
46
+ * `cursor` (string): Send cursor to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header.
47
+ * `sort_by` (object): If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `site_id` and `logged_at`.
48
+ * `filter` (object): If set, return records where the specifiied field is equal to the supplied value. Valid fields are `logged_at`.
49
+ * `filter_gt` (object): If set, return records where the specifiied field is greater than the supplied value. Valid fields are `logged_at`.
50
+ * `filter_gteq` (object): If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `logged_at`.
51
+ * `filter_like` (object): If set, return records where the specifiied field is equal to the supplied value. Valid fields are `logged_at`.
52
+ * `filter_lt` (object): If set, return records where the specifiied field is less than the supplied value. Valid fields are `logged_at`.
53
+ * `filter_lteq` (object): If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `logged_at`.
@@ -12,6 +12,7 @@
12
12
  "headers": "",
13
13
  "http_method": "POST",
14
14
  "next_partsize": "",
15
+ "parallel_parts": true,
15
16
  "parameters": "",
16
17
  "part_number": "",
17
18
  "partsize": "",
@@ -29,6 +30,7 @@
29
30
  * `headers` (object): Additional upload headers
30
31
  * `http_method` (string): Upload method, usually POST
31
32
  * `next_partsize` (string): Currently unused
33
+ * `parallel_parts` (boolean): If true, parts may be uploaded in parallel
32
34
  * `parameters` (string): Additional upload parameters
33
35
  * `part_number` (string): Currently unused
34
36
  * `partsize` (string): Currently unused
@@ -145,11 +145,12 @@ module Files
145
145
  end
146
146
  end
147
147
 
148
- def stream_download(uri, io)
148
+ def stream_download(uri, io, range)
149
149
  if conn.adapter == Faraday::Adapter::NetHttp
150
150
  uri = URI(uri)
151
151
  Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
152
152
  request = Net::HTTP::Get.new uri
153
+ request["RANGE"] = "bytes=#{range[0]}-#{range[1]}" if range
153
154
  http.request request do |response|
154
155
  io.fulfill_content_length(response.content_length) if io.respond_to?(:fulfill_content_length)
155
156
  response.read_body do |chunk|
@@ -58,14 +58,29 @@ module Files
58
58
  # page - int64 - Current page number.
59
59
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
60
60
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
61
+ # cursor - string - Send cursor to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header.
62
+ # sort_by - object - If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `site_id` and `logged_at`.
63
+ # filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `logged_at`.
64
+ # filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `logged_at`.
65
+ # filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `logged_at`.
66
+ # filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `logged_at`.
67
+ # filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `logged_at`.
68
+ # filter_lteq - object - If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `logged_at`.
61
69
  def self.list(params = {}, options = {})
62
70
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
63
71
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
64
72
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
73
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
74
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
75
+ raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params.dig(:filter) and !params.dig(:filter).is_a?(Hash)
76
+ raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params.dig(:filter_gt) and !params.dig(:filter_gt).is_a?(Hash)
77
+ raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params.dig(:filter_gteq) and !params.dig(:filter_gteq).is_a?(Hash)
78
+ raise InvalidParameterError.new("Bad parameter: filter_like must be an Hash") if params.dig(:filter_like) and !params.dig(:filter_like).is_a?(Hash)
79
+ raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params.dig(:filter_lt) and !params.dig(:filter_lt).is_a?(Hash)
80
+ raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params.dig(:filter_lteq) and !params.dig(:filter_lteq).is_a?(Hash)
65
81
 
66
- response, options = Api.send_request("/bandwidth_snapshots", :get, params, options)
67
- response.data.map do |entity_data|
68
- BandwidthSnapshot.new(entity_data, options)
82
+ List.new(BandwidthSnapshot, params) do
83
+ Api.send_request("/bandwidth_snapshots", :get, params, options)
69
84
  end
70
85
  end
71
86
 
@@ -305,8 +305,8 @@ module Files
305
305
  end
306
306
  end
307
307
 
308
- def download_content(io)
309
- Files::ApiClient.download_client.stream_download(download_uri_with_load, io)
308
+ def download_content(io, range: [])
309
+ Files::ApiClient.download_client.stream_download(download_uri_with_load, io, range)
310
310
  end
311
311
 
312
312
  def each(*args, &block)
@@ -388,11 +388,11 @@ module Files
388
388
  read_io.gets *args
389
389
  end
390
390
 
391
- def read_io
391
+ def read_io(**options)
392
392
  @read_io ||= begin
393
393
  r, w = SizableIO.pipe
394
394
  Thread.new do
395
- download_content(w)
395
+ download_content(w, **options)
396
396
  ensure
397
397
  w.close
398
398
  end
@@ -49,6 +49,11 @@ module Files
49
49
  @attributes[:next_partsize]
50
50
  end
51
51
 
52
+ # boolean - If true, parts may be uploaded in parallel
53
+ def parallel_parts
54
+ @attributes[:parallel_parts]
55
+ end
56
+
52
57
  # string - Additional upload parameters
53
58
  def parameters
54
59
  @attributes[:parameters]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: files.com
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.103
4
+ version: 1.0.104
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-10 00:00:00.000000000 Z
11
+ date: 2020-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable