files.com 1.0.309 → 1.0.310

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: f9886b13b98ac876358ccd85138f6c84a1214f97a34e69a6bbf1f7d35c6331d3
4
- data.tar.gz: ebc93bc1fe74de6f75afc8bd33cfc3c81622a72ade67e2e56cdc7456dbbd8178
3
+ metadata.gz: 12c67b7a784af9d5988557e0cd87992d51f7878b93653d12c556001682aba566
4
+ data.tar.gz: 5c858aa53da71dfd469c96a6c083bad88744ca90cced1611901ea51ebcbfeb86
5
5
  SHA512:
6
- metadata.gz: e4cab9cf85e598f96212646f5726b250928351fab4eeb882c248b58b9584369d0589f25f8543659d199cf7ce5065ac6e14e882f4ba47f8280302bd4227c8c474
7
- data.tar.gz: 066f28504469069ac18f54c7f557d2fb40d103e8a7a88de8d9dc122400e2655cf70f0d2f080c25ff284a544f2b43237f2432cc112433dc813c93ccd94b796300
6
+ metadata.gz: 566964e1c18430492ceda2f0a77a97a3ac686bd3cd5b5f5e12f82eb053b916ba2a7b38e3fced42901680e0e3298b72ddf89dcffea0b2fe96c4bbc597b3ea8b0b
7
+ data.tar.gz: 1bbbcdd3f8fc8f1ebd9258d57c080cbee598c96e9f8422183291b94a3862b9f1ccc8bf6f5a3662159136951cc20bb4e71ecfcd0199079da6acde24e532f1270d
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.309
1
+ 1.0.310
@@ -0,0 +1,97 @@
1
+ # BundleNotification
2
+
3
+ ## Example BundleNotification Object
4
+
5
+ ```
6
+ {
7
+ "bundle_id": 1,
8
+ "id": 1,
9
+ "notify_on_registration": true,
10
+ "user_id": 1
11
+ }
12
+ ```
13
+
14
+ * `bundle_id` (int64): Bundle ID to notify on
15
+ * `id` (int64): Bundle Notification ID
16
+ * `notify_on_registration` (boolean): Triggers bundle notification when a registration action occurs for it.
17
+ * `user_id` (int64): The id of the user to notify.
18
+
19
+
20
+ ---
21
+
22
+ ## List Bundle Notifications
23
+
24
+ ```
25
+ Files::BundleNotification.list(
26
+ user_id: 1,
27
+ per_page: 1,
28
+ bundle_id: 1
29
+ )
30
+ ```
31
+
32
+ ### Parameters
33
+
34
+ * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
35
+ * `cursor` (string): Used for pagination. Send a cursor value to resume an existing list from the point at which you left off. Get a cursor from an existing list via either the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header.
36
+ * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
37
+ * `bundle_id` (int64): Bundle ID to notify on
38
+
39
+
40
+ ---
41
+
42
+ ## Show Bundle Notification
43
+
44
+ ```
45
+ Files::BundleNotification.find(id)
46
+ ```
47
+
48
+ ### Parameters
49
+
50
+ * `id` (int64): Required - Bundle Notification ID.
51
+
52
+
53
+ ---
54
+
55
+ ## Create Bundle Notification
56
+
57
+ ```
58
+ Files::BundleNotification.create(
59
+ user_id: 1,
60
+ notify_on_registration: true,
61
+ bundle_id: 1
62
+ )
63
+ ```
64
+
65
+ ### Parameters
66
+
67
+ * `user_id` (int64): Required - The id of the user to notify.
68
+ * `notify_on_registration` (boolean): Triggers bundle notification when a registration action occurs for it.
69
+ * `bundle_id` (int64): Required - Bundle ID to notify on
70
+
71
+
72
+ ---
73
+
74
+ ## Delete Bundle Notification
75
+
76
+ ```
77
+ Files::BundleNotification.delete(id)
78
+ ```
79
+
80
+ ### Parameters
81
+
82
+ * `id` (int64): Required - Bundle Notification ID.
83
+
84
+
85
+ ---
86
+
87
+ ## Delete Bundle Notification
88
+
89
+ ```
90
+ bundle_notification = Files::BundleNotification.list.first
91
+
92
+ bundle_notification.delete
93
+ ```
94
+
95
+ ### Parameters
96
+
97
+ * `id` (int64): Required - Bundle Notification ID.
@@ -0,0 +1,135 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Files
4
+ class BundleNotification
5
+ attr_reader :options, :attributes
6
+
7
+ def initialize(attributes = {}, options = {})
8
+ @attributes = attributes || {}
9
+ @options = options || {}
10
+ end
11
+
12
+ # int64 - Bundle ID to notify on
13
+ def bundle_id
14
+ @attributes[:bundle_id]
15
+ end
16
+
17
+ def bundle_id=(value)
18
+ @attributes[:bundle_id] = value
19
+ end
20
+
21
+ # int64 - Bundle Notification ID
22
+ def id
23
+ @attributes[:id]
24
+ end
25
+
26
+ def id=(value)
27
+ @attributes[:id] = value
28
+ end
29
+
30
+ # boolean - Triggers bundle notification when a registration action occurs for it.
31
+ def notify_on_registration
32
+ @attributes[:notify_on_registration]
33
+ end
34
+
35
+ def notify_on_registration=(value)
36
+ @attributes[:notify_on_registration] = value
37
+ end
38
+
39
+ # int64 - The id of the user to notify.
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
+ def delete(params = {})
49
+ params ||= {}
50
+ params[:id] = @attributes[:id]
51
+ raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
52
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
53
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
54
+
55
+ Api.send_request("/bundle_notifications/#{@attributes[:id]}", :delete, params, @options)
56
+ end
57
+
58
+ def destroy(params = {})
59
+ delete(params)
60
+ end
61
+
62
+ def save
63
+ if @attributes[:id]
64
+ raise NotImplementedError.new("The BundleNotification object doesn't support updates.")
65
+ else
66
+ new_obj = BundleNotification.create(@attributes, @options)
67
+ @attributes = new_obj.attributes
68
+ end
69
+ end
70
+
71
+ # Parameters:
72
+ # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
73
+ # cursor - string - Used for pagination. Send a cursor value to resume an existing list from the point at which you left off. Get a cursor from an existing list via either the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header.
74
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
75
+ # bundle_id - int64 - Bundle ID to notify on
76
+ def self.list(params = {}, options = {})
77
+ raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
78
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
79
+ raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
80
+ raise InvalidParameterError.new("Bad parameter: bundle_id must be an Integer") if params[:bundle_id] and !params[:bundle_id].is_a?(Integer)
81
+
82
+ List.new(BundleNotification, params) do
83
+ Api.send_request("/bundle_notifications", :get, params, options)
84
+ end
85
+ end
86
+
87
+ def self.all(params = {}, options = {})
88
+ list(params, options)
89
+ end
90
+
91
+ # Parameters:
92
+ # id (required) - int64 - Bundle Notification ID.
93
+ def self.find(id, params = {}, options = {})
94
+ params ||= {}
95
+ params[:id] = id
96
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
97
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
98
+
99
+ response, options = Api.send_request("/bundle_notifications/#{params[:id]}", :get, params, options)
100
+ BundleNotification.new(response.data, options)
101
+ end
102
+
103
+ def self.get(id, params = {}, options = {})
104
+ find(id, params, options)
105
+ end
106
+
107
+ # Parameters:
108
+ # user_id (required) - int64 - The id of the user to notify.
109
+ # notify_on_registration - boolean - Triggers bundle notification when a registration action occurs for it.
110
+ # bundle_id (required) - int64 - Bundle ID to notify on
111
+ def self.create(params = {}, options = {})
112
+ raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
113
+ raise InvalidParameterError.new("Bad parameter: bundle_id must be an Integer") if params[:bundle_id] and !params[:bundle_id].is_a?(Integer)
114
+ raise MissingParameterError.new("Parameter missing: user_id") unless params[:user_id]
115
+ raise MissingParameterError.new("Parameter missing: bundle_id") unless params[:bundle_id]
116
+
117
+ response, options = Api.send_request("/bundle_notifications", :post, params, options)
118
+ BundleNotification.new(response.data, options)
119
+ end
120
+
121
+ def self.delete(id, params = {}, options = {})
122
+ params ||= {}
123
+ params[:id] = id
124
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
125
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
126
+
127
+ response, _options = Api.send_request("/bundle_notifications/#{params[:id]}", :delete, params, options)
128
+ response.data
129
+ end
130
+
131
+ def self.destroy(id, params = {}, options = {})
132
+ delete(id, params, options)
133
+ end
134
+ end
135
+ end
data/lib/files.com.rb CHANGED
@@ -49,6 +49,7 @@ require "files.com/models/bandwidth_snapshot"
49
49
  require "files.com/models/behavior"
50
50
  require "files.com/models/bundle"
51
51
  require "files.com/models/bundle_download"
52
+ require "files.com/models/bundle_notification"
52
53
  require "files.com/models/bundle_recipient"
53
54
  require "files.com/models/bundle_registration"
54
55
  require "files.com/models/clickwrap"
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.309
4
+ version: 1.0.310
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-17 00:00:00.000000000 Z
11
+ date: 2022-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -132,6 +132,7 @@ files:
132
132
  - docs/behavior.md
133
133
  - docs/bundle.md
134
134
  - docs/bundle_download.md
135
+ - docs/bundle_notification.md
135
136
  - docs/bundle_recipient.md
136
137
  - docs/bundle_registration.md
137
138
  - docs/clickwrap.md
@@ -215,6 +216,7 @@ files:
215
216
  - lib/files.com/models/behavior.rb
216
217
  - lib/files.com/models/bundle.rb
217
218
  - lib/files.com/models/bundle_download.rb
219
+ - lib/files.com/models/bundle_notification.rb
218
220
  - lib/files.com/models/bundle_recipient.rb
219
221
  - lib/files.com/models/bundle_registration.rb
220
222
  - lib/files.com/models/clickwrap.rb