files.com 1.1.718 → 1.1.720

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.
@@ -1,129 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Files
4
- class MessageReaction
5
- attr_reader :options, :attributes
6
-
7
- def initialize(attributes = {}, options = {})
8
- @attributes = attributes || {}
9
- @options = options || {}
10
- end
11
-
12
- # int64 - Reaction ID
13
- def id
14
- @attributes[:id]
15
- end
16
-
17
- def id=(value)
18
- @attributes[:id] = value
19
- end
20
-
21
- # string - Emoji used in the reaction.
22
- def emoji
23
- @attributes[:emoji]
24
- end
25
-
26
- def emoji=(value)
27
- @attributes[:emoji] = value
28
- end
29
-
30
- # int64 - User ID. Provide a value of `0` to operate the current session's user.
31
- def user_id
32
- @attributes[:user_id]
33
- end
34
-
35
- def user_id=(value)
36
- @attributes[:user_id] = value
37
- end
38
-
39
- def delete(params = {})
40
- params ||= {}
41
- params[:id] = @attributes[:id]
42
- raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
43
- raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
44
- raise MissingParameterError.new("Parameter missing: id") unless params[:id]
45
-
46
- Api.send_request("/message_reactions/#{@attributes[:id]}", :delete, params, @options)
47
- end
48
-
49
- def destroy(params = {})
50
- delete(params)
51
- nil
52
- end
53
-
54
- def save
55
- if @attributes[:id]
56
- raise NotImplementedError.new("The MessageReaction object doesn't support updates.")
57
- else
58
- new_obj = MessageReaction.create(@attributes, @options)
59
- end
60
-
61
- @attributes = new_obj.attributes
62
- true
63
- end
64
-
65
- # Parameters:
66
- # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
67
- # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
68
- # per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
69
- # message_id (required) - int64 - Message to return reactions for.
70
- def self.list(params = {}, options = {})
71
- raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
72
- raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
73
- raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
74
- raise InvalidParameterError.new("Bad parameter: message_id must be an Integer") if params[:message_id] and !params[:message_id].is_a?(Integer)
75
- raise MissingParameterError.new("Parameter missing: message_id") unless params[:message_id]
76
-
77
- List.new(MessageReaction, params) do
78
- Api.send_request("/message_reactions", :get, params, options)
79
- end
80
- end
81
-
82
- def self.all(params = {}, options = {})
83
- list(params, options)
84
- end
85
-
86
- # Parameters:
87
- # id (required) - int64 - Message Reaction ID.
88
- def self.find(id, params = {}, options = {})
89
- params ||= {}
90
- params[:id] = id
91
- raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
92
- raise MissingParameterError.new("Parameter missing: id") unless params[:id]
93
-
94
- response, options = Api.send_request("/message_reactions/#{params[:id]}", :get, params, options)
95
- MessageReaction.new(response.data, options)
96
- end
97
-
98
- def self.get(id, params = {}, options = {})
99
- find(id, params, options)
100
- end
101
-
102
- # Parameters:
103
- # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
104
- # emoji (required) - string - Emoji to react with.
105
- def self.create(params = {}, options = {})
106
- raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
107
- raise InvalidParameterError.new("Bad parameter: emoji must be an String") if params[:emoji] and !params[:emoji].is_a?(String)
108
- raise MissingParameterError.new("Parameter missing: emoji") unless params[:emoji]
109
-
110
- response, options = Api.send_request("/message_reactions", :post, params, options)
111
- MessageReaction.new(response.data, options)
112
- end
113
-
114
- def self.delete(id, params = {}, options = {})
115
- params ||= {}
116
- params[:id] = id
117
- raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
118
- raise MissingParameterError.new("Parameter missing: id") unless params[:id]
119
-
120
- Api.send_request("/message_reactions/#{params[:id]}", :delete, params, options)
121
- nil
122
- end
123
-
124
- def self.destroy(id, params = {}, options = {})
125
- delete(id, params, options)
126
- nil
127
- end
128
- end
129
- end
@@ -1,141 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Files
4
- class Project
5
- attr_reader :options, :attributes
6
-
7
- def initialize(attributes = {}, options = {})
8
- @attributes = attributes || {}
9
- @options = options || {}
10
- end
11
-
12
- # int64 - Project ID
13
- def id
14
- @attributes[:id]
15
- end
16
-
17
- def id=(value)
18
- @attributes[:id] = value
19
- end
20
-
21
- # string - Global access settings
22
- def global_access
23
- @attributes[:global_access]
24
- end
25
-
26
- def global_access=(value)
27
- @attributes[:global_access] = value
28
- end
29
-
30
- # Parameters:
31
- # global_access (required) - string - Global permissions. Can be: `none`, `anyone_with_read`, `anyone_with_full`.
32
- def update(params = {})
33
- params ||= {}
34
- params[:id] = @attributes[:id]
35
- raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
36
- raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
37
- raise InvalidParameterError.new("Bad parameter: global_access must be an String") if params[:global_access] and !params[:global_access].is_a?(String)
38
- raise MissingParameterError.new("Parameter missing: id") unless params[:id]
39
- raise MissingParameterError.new("Parameter missing: global_access") unless params[:global_access]
40
-
41
- Api.send_request("/projects/#{@attributes[:id]}", :patch, params, @options)
42
- end
43
-
44
- def delete(params = {})
45
- params ||= {}
46
- params[:id] = @attributes[:id]
47
- raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
48
- raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
49
- raise MissingParameterError.new("Parameter missing: id") unless params[:id]
50
-
51
- Api.send_request("/projects/#{@attributes[:id]}", :delete, params, @options)
52
- end
53
-
54
- def destroy(params = {})
55
- delete(params)
56
- nil
57
- end
58
-
59
- def save
60
- if @attributes[:id]
61
- new_obj = update(@attributes)
62
- else
63
- new_obj = Project.create(@attributes, @options)
64
- end
65
-
66
- @attributes = new_obj.attributes
67
- true
68
- end
69
-
70
- # Parameters:
71
- # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
72
- # per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
73
- def self.list(params = {}, options = {})
74
- raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
75
- raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
76
-
77
- List.new(Project, params) do
78
- Api.send_request("/projects", :get, params, options)
79
- end
80
- end
81
-
82
- def self.all(params = {}, options = {})
83
- list(params, options)
84
- end
85
-
86
- # Parameters:
87
- # id (required) - int64 - Project ID.
88
- def self.find(id, params = {}, options = {})
89
- params ||= {}
90
- params[:id] = id
91
- raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
92
- raise MissingParameterError.new("Parameter missing: id") unless params[:id]
93
-
94
- response, options = Api.send_request("/projects/#{params[:id]}", :get, params, options)
95
- Project.new(response.data, options)
96
- end
97
-
98
- def self.get(id, params = {}, options = {})
99
- find(id, params, options)
100
- end
101
-
102
- # Parameters:
103
- # global_access (required) - string - Global permissions. Can be: `none`, `anyone_with_read`, `anyone_with_full`.
104
- def self.create(params = {}, options = {})
105
- raise InvalidParameterError.new("Bad parameter: global_access must be an String") if params[:global_access] and !params[:global_access].is_a?(String)
106
- raise MissingParameterError.new("Parameter missing: global_access") unless params[:global_access]
107
-
108
- response, options = Api.send_request("/projects", :post, params, options)
109
- Project.new(response.data, options)
110
- end
111
-
112
- # Parameters:
113
- # global_access (required) - string - Global permissions. Can be: `none`, `anyone_with_read`, `anyone_with_full`.
114
- def self.update(id, params = {}, options = {})
115
- params ||= {}
116
- params[:id] = id
117
- raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
118
- raise InvalidParameterError.new("Bad parameter: global_access must be an String") if params[:global_access] and !params[:global_access].is_a?(String)
119
- raise MissingParameterError.new("Parameter missing: id") unless params[:id]
120
- raise MissingParameterError.new("Parameter missing: global_access") unless params[:global_access]
121
-
122
- response, options = Api.send_request("/projects/#{params[:id]}", :patch, params, options)
123
- Project.new(response.data, options)
124
- end
125
-
126
- def self.delete(id, params = {}, options = {})
127
- params ||= {}
128
- params[:id] = id
129
- raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
130
- raise MissingParameterError.new("Parameter missing: id") unless params[:id]
131
-
132
- Api.send_request("/projects/#{params[:id]}", :delete, params, options)
133
- nil
134
- end
135
-
136
- def self.destroy(id, params = {}, options = {})
137
- delete(id, params, options)
138
- nil
139
- end
140
- end
141
- end