files.com 1.0.99 → 1.0.100

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d61d5f715d4e894f0102913b5180614d20c07774fd57df8cb2d93cfa4f83ad9
4
- data.tar.gz: ebde8436aa8818e3332660352998e4bc1ef57564a523a4a1614e8e085b275ae6
3
+ metadata.gz: de1ee65d3dc0f22e11043ad9510774254de6242cfed0379e7889891d7d4e01f7
4
+ data.tar.gz: f84015f3af4655695eaa9707376de457cf54cf79499c73bace3875dbbc355c6c
5
5
  SHA512:
6
- metadata.gz: 175cb4d587cb172d326a5bd3ea213e042dcd023d8816cb91da5f23510abffcd8de34083484e577d6cdef12d6b15b4f935d16c1394a80e76b7411f73ec8cc3426
7
- data.tar.gz: fe5baf51329e93cd9a6edf8e9396f764b2fb90df7781e09326441f67f3f3e2276b6aa0e4ec3ec16a17522c56d0cd4b996c4f71860b8b03e7c73c5e6f840c55e5
6
+ metadata.gz: bb0c1c342f5d9417ef8ecb3124256c9dbd00207002f343db51a96798ce5b6ef074e02f08c86521a678b8e09ac6ddc51cde6985d6f83a1d1cf7414d8819158b1e
7
+ data.tar.gz: 19ec076e011a1d909ef6fd63e36a02063414e39928aff129741be4a972f68df8737990ce07c44952f4e7fedc4a3ea786459c29f025ce5d83ce15ef9558b5508a
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.99
1
+ 1.0.100
@@ -0,0 +1,45 @@
1
+ # BandwidthSnapshot
2
+
3
+ ## Example BandwidthSnapshot Object
4
+
5
+ ```
6
+ {
7
+ "id": 1,
8
+ "bytes_received": 1.0,
9
+ "bytes_sent": 1.0,
10
+ "requests_get": 1.0,
11
+ "requests_put": 1.0,
12
+ "requests_other": 1.0,
13
+ "logged_at": "2000-01-01T01:00:00Z",
14
+ "created_at": "2000-01-01T01:00:00Z",
15
+ "updated_at": "2000-01-01T01:00:00Z"
16
+ }
17
+ ```
18
+
19
+ * `id` (int64): Site bandwidth ID
20
+ * `bytes_received` (double): Site bandwidth report bytes received
21
+ * `bytes_sent` (double): Site bandwidth report bytes sent
22
+ * `requests_get` (double): Site bandwidth report get requests
23
+ * `requests_put` (double): Site bandwidth report put requests
24
+ * `requests_other` (double): Site bandwidth report other requests
25
+ * `logged_at` (date-time): Time the site bandwidth report was logged
26
+ * `created_at` (date-time): Site bandwidth report created at date/time
27
+ * `updated_at` (date-time): The last time this site bandwidth report was updated
28
+
29
+
30
+ ---
31
+
32
+ ## List Bandwidth Snapshots
33
+
34
+ ```
35
+ Files::BandwidthSnapshot.list(
36
+ page: 1,
37
+ per_page: 1
38
+ )
39
+ ```
40
+
41
+ ### Parameters
42
+
43
+ * `page` (int64): Current page number.
44
+ * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
45
+ * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
@@ -33,6 +33,7 @@ require "files.com/models/app"
33
33
  require "files.com/models/as2_key"
34
34
  require "files.com/models/auto"
35
35
  require "files.com/models/automation"
36
+ require "files.com/models/bandwidth_snapshot"
36
37
  require "files.com/models/behavior"
37
38
  require "files.com/models/bundle"
38
39
  require "files.com/models/bundle_download"
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Files
4
+ class BandwidthSnapshot
5
+ attr_reader :options, :attributes
6
+
7
+ def initialize(attributes = {}, options = {})
8
+ @attributes = attributes || {}
9
+ @options = options || {}
10
+ end
11
+
12
+ # int64 - Site bandwidth ID
13
+ def id
14
+ @attributes[:id]
15
+ end
16
+
17
+ # double - Site bandwidth report bytes received
18
+ def bytes_received
19
+ @attributes[:bytes_received]
20
+ end
21
+
22
+ # double - Site bandwidth report bytes sent
23
+ def bytes_sent
24
+ @attributes[:bytes_sent]
25
+ end
26
+
27
+ # double - Site bandwidth report get requests
28
+ def requests_get
29
+ @attributes[:requests_get]
30
+ end
31
+
32
+ # double - Site bandwidth report put requests
33
+ def requests_put
34
+ @attributes[:requests_put]
35
+ end
36
+
37
+ # double - Site bandwidth report other requests
38
+ def requests_other
39
+ @attributes[:requests_other]
40
+ end
41
+
42
+ # date-time - Time the site bandwidth report was logged
43
+ def logged_at
44
+ @attributes[:logged_at]
45
+ end
46
+
47
+ # date-time - Site bandwidth report created at date/time
48
+ def created_at
49
+ @attributes[:created_at]
50
+ end
51
+
52
+ # date-time - The last time this site bandwidth report was updated
53
+ def updated_at
54
+ @attributes[:updated_at]
55
+ end
56
+
57
+ # Parameters:
58
+ # page - int64 - Current page number.
59
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
60
+ # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
61
+ def self.list(params = {}, options = {})
62
+ raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
63
+ 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
+ raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
65
+
66
+ response, options = Api.send_request("/bandwidth_snapshots", :get, params, options)
67
+ response.data.map do |entity_data|
68
+ BandwidthSnapshot.new(entity_data, options)
69
+ end
70
+ end
71
+
72
+ def self.all(params = {}, options = {})
73
+ list(params, options)
74
+ end
75
+ end
76
+ end
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
  require "tempfile"
3
3
 
4
4
  RSpec.describe Files::File, :with_test_folder do
5
- describe "#read" do
5
+ xdescribe "#read" do
6
6
  before do
7
7
  Files::File.open(test_folder.join("[[strange stuff]]#yes.text").to_s, 'w', options) do |f|
8
8
  f.write("contents")
@@ -15,7 +15,7 @@ RSpec.describe Files::File, :with_test_folder do
15
15
  end
16
16
  end
17
17
 
18
- describe "#read_io" do
18
+ xdescribe "#read_io" do
19
19
  before do
20
20
  Files::File.open(test_folder.join("read.txt").to_s, 'w', options) do |f|
21
21
  f.write("contents")
@@ -30,7 +30,7 @@ RSpec.describe Files::File, :with_test_folder do
30
30
  end
31
31
  end
32
32
 
33
- describe "#write" do
33
+ xdescribe "#write" do
34
34
  it "can take string" do
35
35
  Files::File.open(test_folder.join("write-as-string.txt").to_s, 'w', options) do |f|
36
36
  f.write("I am a string")
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe Files::Folder, :with_test_folder do
4
- describe "#list_for" do
4
+ xdescribe "#list_for" do
5
5
  before do
6
6
  Files::File.open(test_folder.join("example.txt").to_s, 'w', options) do |f|
7
7
  f.write("my text")
@@ -22,7 +22,7 @@ RSpec.describe Files::Folder, :with_test_folder do
22
22
  end
23
23
  end
24
24
 
25
- describe "#delete" do
25
+ xdescribe "#delete" do
26
26
  it "deletes a folder" do
27
27
  Files::Folder.mkdir(test_folder.join("my-new-folder").to_s, {}, options)
28
28
  Files::Folder.delete(test_folder.join("my-new-folder").to_s, {}, options)
@@ -31,7 +31,7 @@ RSpec.describe Files::Folder, :with_test_folder do
31
31
  end
32
32
  end
33
33
 
34
- describe "mkdir" do
34
+ xdescribe "mkdir" do
35
35
  it "makes a new folder" do
36
36
  Files::Folder.mkdir(test_folder.join("my-new-folder").to_s, {}, options)
37
37
  expect(Files::Folder.exist?(test_folder.join("my-new-folder").to_s, options)).to eq(true)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: files.com
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.99
4
+ version: 1.0.100
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com
@@ -92,6 +92,7 @@ files:
92
92
  - docs/as2_key.md
93
93
  - docs/auto.md
94
94
  - docs/automation.md
95
+ - docs/bandwidth_snapshot.md
95
96
  - docs/behavior.md
96
97
  - docs/bundle.md
97
98
  - docs/bundle_download.md
@@ -153,6 +154,7 @@ files:
153
154
  - lib/files.com/models/as2_key.rb
154
155
  - lib/files.com/models/auto.rb
155
156
  - lib/files.com/models/automation.rb
157
+ - lib/files.com/models/bandwidth_snapshot.rb
156
158
  - lib/files.com/models/behavior.rb
157
159
  - lib/files.com/models/bundle.rb
158
160
  - lib/files.com/models/bundle_download.rb