files.com 1.0.92

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.
Files changed (136) hide show
  1. checksums.yaml +7 -0
  2. data/CONTRIBUTORS +4 -0
  3. data/Gemfile +12 -0
  4. data/Gemfile.lock +82 -0
  5. data/LICENSE +21 -0
  6. data/README.md +119 -0
  7. data/Rakefile +12 -0
  8. data/SECURITY.md +24 -0
  9. data/_VERSION +1 -0
  10. data/bin/files +8 -0
  11. data/bin/files-console +16 -0
  12. data/docs/account_line_item.md +41 -0
  13. data/docs/action.md +37 -0
  14. data/docs/api_key.md +202 -0
  15. data/docs/app.md +59 -0
  16. data/docs/as2_key.md +133 -0
  17. data/docs/auto.md +11 -0
  18. data/docs/automation.md +190 -0
  19. data/docs/behavior.md +208 -0
  20. data/docs/bundle.md +252 -0
  21. data/docs/bundle_download.md +35 -0
  22. data/docs/clickwrap.md +143 -0
  23. data/docs/dns_record.md +35 -0
  24. data/docs/errors.md +17 -0
  25. data/docs/file.md +204 -0
  26. data/docs/file_action.md +126 -0
  27. data/docs/file_comment.md +116 -0
  28. data/docs/file_comment_reaction.md +62 -0
  29. data/docs/file_part_upload.md +37 -0
  30. data/docs/file_utils.md +4 -0
  31. data/docs/folder.md +90 -0
  32. data/docs/group.md +153 -0
  33. data/docs/group_user.md +124 -0
  34. data/docs/history.md +171 -0
  35. data/docs/history_export.md +174 -0
  36. data/docs/image.md +13 -0
  37. data/docs/invoice.md +72 -0
  38. data/docs/invoice_line_item.md +27 -0
  39. data/docs/ip_address.md +55 -0
  40. data/docs/lock.md +98 -0
  41. data/docs/message.md +147 -0
  42. data/docs/message_comment.md +132 -0
  43. data/docs/message_comment_reaction.md +94 -0
  44. data/docs/message_reaction.md +94 -0
  45. data/docs/notification.md +177 -0
  46. data/docs/payment.md +72 -0
  47. data/docs/payment_line_item.md +19 -0
  48. data/docs/permission.md +95 -0
  49. data/docs/preview.md +19 -0
  50. data/docs/project.md +121 -0
  51. data/docs/public_ip_address.md +13 -0
  52. data/docs/public_key.md +133 -0
  53. data/docs/remote_server.md +356 -0
  54. data/docs/request.md +100 -0
  55. data/docs/session.md +78 -0
  56. data/docs/site.md +448 -0
  57. data/docs/sso_strategy.md +114 -0
  58. data/docs/status.md +21 -0
  59. data/docs/style.md +93 -0
  60. data/docs/usage_daily_snapshot.md +45 -0
  61. data/docs/usage_snapshot.md +53 -0
  62. data/docs/user.md +535 -0
  63. data/docs/user_cipher_use.md +41 -0
  64. data/docs/user_request.md +93 -0
  65. data/files.com.gemspec +22 -0
  66. data/lib/files.com.rb +184 -0
  67. data/lib/files.com/api.rb +38 -0
  68. data/lib/files.com/api_client.rb +340 -0
  69. data/lib/files.com/errors.rb +41 -0
  70. data/lib/files.com/list.rb +95 -0
  71. data/lib/files.com/models/account_line_item.rb +82 -0
  72. data/lib/files.com/models/action.rb +77 -0
  73. data/lib/files.com/models/api_key.rb +270 -0
  74. data/lib/files.com/models/app.rb +106 -0
  75. data/lib/files.com/models/as2_key.rb +179 -0
  76. data/lib/files.com/models/auto.rb +17 -0
  77. data/lib/files.com/models/automation.rb +304 -0
  78. data/lib/files.com/models/behavior.rb +266 -0
  79. data/lib/files.com/models/bundle.rb +371 -0
  80. data/lib/files.com/models/bundle_download.rb +49 -0
  81. data/lib/files.com/models/clickwrap.rb +197 -0
  82. data/lib/files.com/models/dir.rb +3 -0
  83. data/lib/files.com/models/dns_record.rb +51 -0
  84. data/lib/files.com/models/errors.rb +22 -0
  85. data/lib/files.com/models/file.rb +968 -0
  86. data/lib/files.com/models/file_action.rb +126 -0
  87. data/lib/files.com/models/file_comment.rb +146 -0
  88. data/lib/files.com/models/file_comment_reaction.rb +100 -0
  89. data/lib/files.com/models/file_part_upload.rb +82 -0
  90. data/lib/files.com/models/file_utils.rb +118 -0
  91. data/lib/files.com/models/folder.rb +357 -0
  92. data/lib/files.com/models/group.rb +208 -0
  93. data/lib/files.com/models/group_user.rb +171 -0
  94. data/lib/files.com/models/history.rb +228 -0
  95. data/lib/files.com/models/history_export.rb +353 -0
  96. data/lib/files.com/models/image.rb +22 -0
  97. data/lib/files.com/models/invoice.rb +117 -0
  98. data/lib/files.com/models/invoice_line_item.rb +57 -0
  99. data/lib/files.com/models/ip_address.rb +66 -0
  100. data/lib/files.com/models/lock.rb +173 -0
  101. data/lib/files.com/models/message.rb +201 -0
  102. data/lib/files.com/models/message_comment.rb +165 -0
  103. data/lib/files.com/models/message_comment_reaction.rb +128 -0
  104. data/lib/files.com/models/message_reaction.rb +128 -0
  105. data/lib/files.com/models/notification.rb +263 -0
  106. data/lib/files.com/models/payment.rb +117 -0
  107. data/lib/files.com/models/payment_line_item.rb +37 -0
  108. data/lib/files.com/models/permission.rb +172 -0
  109. data/lib/files.com/models/preview.rb +37 -0
  110. data/lib/files.com/models/project.rb +140 -0
  111. data/lib/files.com/models/public_ip_address.rb +22 -0
  112. data/lib/files.com/models/public_key.rb +179 -0
  113. data/lib/files.com/models/remote_server.rb +680 -0
  114. data/lib/files.com/models/request.rb +179 -0
  115. data/lib/files.com/models/session.rb +247 -0
  116. data/lib/files.com/models/site.rb +733 -0
  117. data/lib/files.com/models/sso_strategy.rb +227 -0
  118. data/lib/files.com/models/status.rb +37 -0
  119. data/lib/files.com/models/style.rb +131 -0
  120. data/lib/files.com/models/usage_daily_snapshot.rb +66 -0
  121. data/lib/files.com/models/usage_snapshot.rb +96 -0
  122. data/lib/files.com/models/user.rb +876 -0
  123. data/lib/files.com/models/user_cipher_use.rb +63 -0
  124. data/lib/files.com/models/user_request.rb +127 -0
  125. data/lib/files.com/response.rb +25 -0
  126. data/lib/files.com/sizable_io.rb +32 -0
  127. data/lib/files.com/system_profiler.rb +56 -0
  128. data/lib/files.com/util.rb +106 -0
  129. data/lib/files.com/version.rb +5 -0
  130. data/spec/list_spec.rb +214 -0
  131. data/spec/models/file_spec.rb +68 -0
  132. data/spec/models/folder_spec.rb +40 -0
  133. data/spec/spec_helper.rb +36 -0
  134. data/test.sh +8 -0
  135. data/test/test.rb +75 -0
  136. metadata +235 -0
@@ -0,0 +1,106 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Files
4
+ class App
5
+ attr_reader :options, :attributes
6
+
7
+ def initialize(attributes = {}, options = {})
8
+ @attributes = attributes || {}
9
+ @options = options || {}
10
+ end
11
+
12
+ # string - Name of the App
13
+ def name
14
+ @attributes[:name]
15
+ end
16
+
17
+ # string - Long form description of the App
18
+ def extended_description
19
+ @attributes[:extended_description]
20
+ end
21
+
22
+ # string - Collection of named links to documentation
23
+ def documentation_links
24
+ @attributes[:documentation_links]
25
+ end
26
+
27
+ # string - App icon
28
+ def icon_url
29
+ @attributes[:icon_url]
30
+ end
31
+
32
+ # string - Full size logo for the App
33
+ def logo_url
34
+ @attributes[:logo_url]
35
+ end
36
+
37
+ # string - Logo thumbnail for the App
38
+ def logo_thumbnail_url
39
+ @attributes[:logo_thumbnail_url]
40
+ end
41
+
42
+ # string - Associated SSO Strategy type, if any
43
+ def sso_strategy_type
44
+ @attributes[:sso_strategy_type]
45
+ end
46
+
47
+ # string - Associated Remote Server type, if any
48
+ def remote_server_type
49
+ @attributes[:remote_server_type]
50
+ end
51
+
52
+ # string - Associated Folder Behavior type, if any
53
+ def folder_behavior_type
54
+ @attributes[:folder_behavior_type]
55
+ end
56
+
57
+ # string - Link to external homepage
58
+ def external_homepage_url
59
+ @attributes[:external_homepage_url]
60
+ end
61
+
62
+ # string - The type of the App
63
+ def app_type
64
+ @attributes[:app_type]
65
+ end
66
+
67
+ # boolean - Is featured on the App listing?
68
+ def featured
69
+ @attributes[:featured]
70
+ end
71
+
72
+ # Parameters:
73
+ # page - int64 - Current page number.
74
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
75
+ # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
76
+ # 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.
77
+ # 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 `name` and `app_type`.
78
+ # filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `name` and `app_type`.
79
+ # filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `name` and `app_type`.
80
+ # filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `name` and `app_type`.
81
+ # filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `name` and `app_type`.
82
+ # filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `name` and `app_type`.
83
+ # filter_lteq - object - If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `name` and `app_type`.
84
+ def self.list(params = {}, options = {})
85
+ raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
86
+ raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
87
+ raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
88
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
89
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
90
+ raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params.dig(:filter) and !params.dig(:filter).is_a?(Hash)
91
+ raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params.dig(:filter_gt) and !params.dig(:filter_gt).is_a?(Hash)
92
+ raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params.dig(:filter_gteq) and !params.dig(:filter_gteq).is_a?(Hash)
93
+ raise InvalidParameterError.new("Bad parameter: filter_like must be an Hash") if params.dig(:filter_like) and !params.dig(:filter_like).is_a?(Hash)
94
+ raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params.dig(:filter_lt) and !params.dig(:filter_lt).is_a?(Hash)
95
+ raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params.dig(:filter_lteq) and !params.dig(:filter_lteq).is_a?(Hash)
96
+
97
+ List.new(App, params) do
98
+ Api.send_request("/apps", :get, params, options)
99
+ end
100
+ end
101
+
102
+ def self.all(params = {}, options = {})
103
+ list(params, options)
104
+ end
105
+ end
106
+ end
@@ -0,0 +1,179 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Files
4
+ class As2Key
5
+ attr_reader :options, :attributes
6
+
7
+ def initialize(attributes = {}, options = {})
8
+ @attributes = attributes || {}
9
+ @options = options || {}
10
+ end
11
+
12
+ # int64 - AS2 Key ID
13
+ def id
14
+ @attributes[:id]
15
+ end
16
+
17
+ def id=(value)
18
+ @attributes[:id] = value
19
+ end
20
+
21
+ # string - AS2 Partnership Name
22
+ def as2_partnership_name
23
+ @attributes[:as2_partnership_name]
24
+ end
25
+
26
+ def as2_partnership_name=(value)
27
+ @attributes[:as2_partnership_name] = value
28
+ end
29
+
30
+ # date-time - AS2 Key created at date/time
31
+ def created_at
32
+ @attributes[:created_at]
33
+ end
34
+
35
+ # string - Public key fingerprint
36
+ def fingerprint
37
+ @attributes[:fingerprint]
38
+ end
39
+
40
+ def fingerprint=(value)
41
+ @attributes[:fingerprint] = value
42
+ end
43
+
44
+ # int64 - User ID. Provide a value of `0` to operate the current session's user.
45
+ def user_id
46
+ @attributes[:user_id]
47
+ end
48
+
49
+ def user_id=(value)
50
+ @attributes[:user_id] = value
51
+ end
52
+
53
+ # string - Actual contents of Public key.
54
+ def public_key
55
+ @attributes[:public_key]
56
+ end
57
+
58
+ def public_key=(value)
59
+ @attributes[:public_key] = value
60
+ end
61
+
62
+ # Parameters:
63
+ # as2_partnership_name (required) - string - AS2 Partnership Name
64
+ def update(params = {})
65
+ params ||= {}
66
+ params[:id] = @attributes[:id]
67
+ raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
68
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
69
+ raise InvalidParameterError.new("Bad parameter: as2_partnership_name must be an String") if params.dig(:as2_partnership_name) and !params.dig(:as2_partnership_name).is_a?(String)
70
+ raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
71
+ raise MissingParameterError.new("Parameter missing: as2_partnership_name") unless params.dig(:as2_partnership_name)
72
+
73
+ Api.send_request("/as2_keys/#{@attributes[:id]}", :patch, params, @options)
74
+ end
75
+
76
+ def delete(params = {})
77
+ params ||= {}
78
+ params[:id] = @attributes[:id]
79
+ raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
80
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
81
+ raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
82
+
83
+ Api.send_request("/as2_keys/#{@attributes[:id]}", :delete, params, @options)
84
+ end
85
+
86
+ def destroy(params = {})
87
+ delete(params)
88
+ end
89
+
90
+ def save
91
+ if @attributes[:id]
92
+ update(@attributes)
93
+ else
94
+ new_obj = As2Key.create(@attributes, @options)
95
+ @attributes = new_obj.attributes
96
+ end
97
+ end
98
+
99
+ # Parameters:
100
+ # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
101
+ # page - int64 - Current page number.
102
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
103
+ # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
104
+ def self.list(params = {}, options = {})
105
+ raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
106
+ raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
107
+ raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
108
+ raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
109
+
110
+ response, options = Api.send_request("/as2_keys", :get, params, options)
111
+ response.data.map do |entity_data|
112
+ As2Key.new(entity_data, options)
113
+ end
114
+ end
115
+
116
+ def self.all(params = {}, options = {})
117
+ list(params, options)
118
+ end
119
+
120
+ # Parameters:
121
+ # id (required) - int64 - As2 Key ID.
122
+ def self.find(id, params = {}, options = {})
123
+ params ||= {}
124
+ params[:id] = id
125
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
126
+ raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
127
+
128
+ response, options = Api.send_request("/as2_keys/#{params[:id]}", :get, params, options)
129
+ As2Key.new(response.data, options)
130
+ end
131
+
132
+ def self.get(id, params = {}, options = {})
133
+ find(id, params, options)
134
+ end
135
+
136
+ # Parameters:
137
+ # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
138
+ # as2_partnership_name (required) - string - AS2 Partnership Name
139
+ # public_key (required) - string - Actual contents of Public key.
140
+ def self.create(params = {}, options = {})
141
+ raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
142
+ raise InvalidParameterError.new("Bad parameter: as2_partnership_name must be an String") if params.dig(:as2_partnership_name) and !params.dig(:as2_partnership_name).is_a?(String)
143
+ raise InvalidParameterError.new("Bad parameter: public_key must be an String") if params.dig(:public_key) and !params.dig(:public_key).is_a?(String)
144
+ raise MissingParameterError.new("Parameter missing: as2_partnership_name") unless params.dig(:as2_partnership_name)
145
+ raise MissingParameterError.new("Parameter missing: public_key") unless params.dig(:public_key)
146
+
147
+ response, options = Api.send_request("/as2_keys", :post, params, options)
148
+ As2Key.new(response.data, options)
149
+ end
150
+
151
+ # Parameters:
152
+ # as2_partnership_name (required) - string - AS2 Partnership Name
153
+ def self.update(id, params = {}, options = {})
154
+ params ||= {}
155
+ params[:id] = id
156
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
157
+ raise InvalidParameterError.new("Bad parameter: as2_partnership_name must be an String") if params.dig(:as2_partnership_name) and !params.dig(:as2_partnership_name).is_a?(String)
158
+ raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
159
+ raise MissingParameterError.new("Parameter missing: as2_partnership_name") unless params.dig(:as2_partnership_name)
160
+
161
+ response, options = Api.send_request("/as2_keys/#{params[:id]}", :patch, params, options)
162
+ As2Key.new(response.data, options)
163
+ end
164
+
165
+ def self.delete(id, params = {}, options = {})
166
+ params ||= {}
167
+ params[:id] = id
168
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
169
+ raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
170
+
171
+ response, _options = Api.send_request("/as2_keys/#{params[:id]}", :delete, params, options)
172
+ response.data
173
+ end
174
+
175
+ def self.destroy(id, params = {}, options = {})
176
+ delete(id, params, options)
177
+ end
178
+ end
179
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Files
4
+ class Auto
5
+ attr_reader :options, :attributes
6
+
7
+ def initialize(attributes = {}, options = {})
8
+ @attributes = attributes || {}
9
+ @options = options || {}
10
+ end
11
+
12
+ # object
13
+ def dynamic
14
+ @attributes[:dynamic]
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,304 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Files
4
+ class Automation
5
+ attr_reader :options, :attributes
6
+
7
+ def initialize(attributes = {}, options = {})
8
+ @attributes = attributes || {}
9
+ @options = options || {}
10
+ end
11
+
12
+ # int64 - Automation ID
13
+ def id
14
+ @attributes[:id]
15
+ end
16
+
17
+ def id=(value)
18
+ @attributes[:id] = value
19
+ end
20
+
21
+ # string - Automation type
22
+ def automation
23
+ @attributes[:automation]
24
+ end
25
+
26
+ def automation=(value)
27
+ @attributes[:automation] = value
28
+ end
29
+
30
+ # string - Source Path
31
+ def source
32
+ @attributes[:source]
33
+ end
34
+
35
+ def source=(value)
36
+ @attributes[:source] = value
37
+ end
38
+
39
+ # string - Destination Path
40
+ def destination
41
+ @attributes[:destination]
42
+ end
43
+
44
+ def destination=(value)
45
+ @attributes[:destination] = value
46
+ end
47
+
48
+ # string - If set, this string in the destination path will be replaced with the value in `destination_replace_to`.
49
+ def destination_replace_from
50
+ @attributes[:destination_replace_from]
51
+ end
52
+
53
+ def destination_replace_from=(value)
54
+ @attributes[:destination_replace_from] = value
55
+ end
56
+
57
+ # string - If set, this string will replace the value `destination_replace_from` in the destination filename. You can use special patterns here.
58
+ def destination_replace_to
59
+ @attributes[:destination_replace_to]
60
+ end
61
+
62
+ def destination_replace_to=(value)
63
+ @attributes[:destination_replace_to] = value
64
+ end
65
+
66
+ # string - How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
67
+ def interval
68
+ @attributes[:interval]
69
+ end
70
+
71
+ def interval=(value)
72
+ @attributes[:interval] = value
73
+ end
74
+
75
+ # string - Date this automation will next run.
76
+ def next_process_on
77
+ @attributes[:next_process_on]
78
+ end
79
+
80
+ def next_process_on=(value)
81
+ @attributes[:next_process_on] = value
82
+ end
83
+
84
+ # string - Path on which this Automation runs. Supports globs. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
85
+ def path
86
+ @attributes[:path]
87
+ end
88
+
89
+ def path=(value)
90
+ @attributes[:path] = value
91
+ end
92
+
93
+ # boolean - Does this automation run in real time? This is a read-only property based on automation type.
94
+ def realtime
95
+ @attributes[:realtime]
96
+ end
97
+
98
+ def realtime=(value)
99
+ @attributes[:realtime] = value
100
+ end
101
+
102
+ # int64 - User ID of the Automation's creator.
103
+ def user_id
104
+ @attributes[:user_id]
105
+ end
106
+
107
+ def user_id=(value)
108
+ @attributes[:user_id] = value
109
+ end
110
+
111
+ # array - IDs of Users for the Automation (i.e. who to Request File from)
112
+ def user_ids
113
+ @attributes[:user_ids]
114
+ end
115
+
116
+ def user_ids=(value)
117
+ @attributes[:user_ids] = value
118
+ end
119
+
120
+ # array - IDs of Groups for the Automation (i.e. who to Request File from)
121
+ def group_ids
122
+ @attributes[:group_ids]
123
+ end
124
+
125
+ def group_ids=(value)
126
+ @attributes[:group_ids] = value
127
+ end
128
+
129
+ # Parameters:
130
+ # automation (required) - string - Type of automation. One of: `create_folder`, `request_file`, `request_move`
131
+ # source - string - Source Path
132
+ # destination - string - Destination Path
133
+ # destination_replace_from - string - If set, this string in the destination path will be replaced with the value in `destination_replace_to`.
134
+ # destination_replace_to - string - If set, this string will replace the value `destination_replace_from` in the destination filename. You can use special patterns here.
135
+ # interval - string - How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
136
+ # path - string - Path on which this Automation runs. Supports globs.
137
+ # user_ids - string - A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
138
+ # group_ids - string - A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
139
+ def update(params = {})
140
+ params ||= {}
141
+ params[:id] = @attributes[:id]
142
+ raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
143
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
144
+ raise InvalidParameterError.new("Bad parameter: automation must be an String") if params.dig(:automation) and !params.dig(:automation).is_a?(String)
145
+ raise InvalidParameterError.new("Bad parameter: source must be an String") if params.dig(:source) and !params.dig(:source).is_a?(String)
146
+ raise InvalidParameterError.new("Bad parameter: destination must be an String") if params.dig(:destination) and !params.dig(:destination).is_a?(String)
147
+ raise InvalidParameterError.new("Bad parameter: destination_replace_from must be an String") if params.dig(:destination_replace_from) and !params.dig(:destination_replace_from).is_a?(String)
148
+ raise InvalidParameterError.new("Bad parameter: destination_replace_to must be an String") if params.dig(:destination_replace_to) and !params.dig(:destination_replace_to).is_a?(String)
149
+ raise InvalidParameterError.new("Bad parameter: interval must be an String") if params.dig(:interval) and !params.dig(:interval).is_a?(String)
150
+ raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
151
+ raise InvalidParameterError.new("Bad parameter: user_ids must be an String") if params.dig(:user_ids) and !params.dig(:user_ids).is_a?(String)
152
+ raise InvalidParameterError.new("Bad parameter: group_ids must be an String") if params.dig(:group_ids) and !params.dig(:group_ids).is_a?(String)
153
+ raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
154
+ raise MissingParameterError.new("Parameter missing: automation") unless params.dig(:automation)
155
+
156
+ Api.send_request("/automations/#{@attributes[:id]}", :patch, params, @options)
157
+ end
158
+
159
+ def delete(params = {})
160
+ params ||= {}
161
+ params[:id] = @attributes[:id]
162
+ raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
163
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
164
+ raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
165
+
166
+ Api.send_request("/automations/#{@attributes[:id]}", :delete, params, @options)
167
+ end
168
+
169
+ def destroy(params = {})
170
+ delete(params)
171
+ end
172
+
173
+ def save
174
+ if @attributes[:id]
175
+ update(@attributes)
176
+ else
177
+ new_obj = Automation.create(@attributes, @options)
178
+ @attributes = new_obj.attributes
179
+ end
180
+ end
181
+
182
+ # Parameters:
183
+ # page - int64 - Current page number.
184
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
185
+ # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
186
+ # 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.
187
+ # 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 `automation`.
188
+ # filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `automation`.
189
+ # filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `automation`.
190
+ # filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `automation`.
191
+ # filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `automation`.
192
+ # filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `automation`.
193
+ # filter_lteq - object - If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `automation`.
194
+ # automation - string - DEPRECATED: Type of automation to filter by. Use `filter[automation]` instead.
195
+ def self.list(params = {}, options = {})
196
+ raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
197
+ raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
198
+ raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
199
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
200
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
201
+ raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params.dig(:filter) and !params.dig(:filter).is_a?(Hash)
202
+ raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params.dig(:filter_gt) and !params.dig(:filter_gt).is_a?(Hash)
203
+ raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params.dig(:filter_gteq) and !params.dig(:filter_gteq).is_a?(Hash)
204
+ raise InvalidParameterError.new("Bad parameter: filter_like must be an Hash") if params.dig(:filter_like) and !params.dig(:filter_like).is_a?(Hash)
205
+ raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params.dig(:filter_lt) and !params.dig(:filter_lt).is_a?(Hash)
206
+ raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params.dig(:filter_lteq) and !params.dig(:filter_lteq).is_a?(Hash)
207
+ raise InvalidParameterError.new("Bad parameter: automation must be an String") if params.dig(:automation) and !params.dig(:automation).is_a?(String)
208
+
209
+ List.new(Automation, params) do
210
+ Api.send_request("/automations", :get, params, options)
211
+ end
212
+ end
213
+
214
+ def self.all(params = {}, options = {})
215
+ list(params, options)
216
+ end
217
+
218
+ # Parameters:
219
+ # id (required) - int64 - Automation ID.
220
+ def self.find(id, params = {}, options = {})
221
+ params ||= {}
222
+ params[:id] = id
223
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
224
+ raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
225
+
226
+ response, options = Api.send_request("/automations/#{params[:id]}", :get, params, options)
227
+ Automation.new(response.data, options)
228
+ end
229
+
230
+ def self.get(id, params = {}, options = {})
231
+ find(id, params, options)
232
+ end
233
+
234
+ # Parameters:
235
+ # automation (required) - string - Type of automation. One of: `create_folder`, `request_file`, `request_move`
236
+ # source - string - Source Path
237
+ # destination - string - Destination Path
238
+ # destination_replace_from - string - If set, this string in the destination path will be replaced with the value in `destination_replace_to`.
239
+ # destination_replace_to - string - If set, this string will replace the value `destination_replace_from` in the destination filename. You can use special patterns here.
240
+ # interval - string - How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
241
+ # path - string - Path on which this Automation runs. Supports globs.
242
+ # user_ids - string - A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
243
+ # group_ids - string - A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
244
+ def self.create(params = {}, options = {})
245
+ raise InvalidParameterError.new("Bad parameter: automation must be an String") if params.dig(:automation) and !params.dig(:automation).is_a?(String)
246
+ raise InvalidParameterError.new("Bad parameter: source must be an String") if params.dig(:source) and !params.dig(:source).is_a?(String)
247
+ raise InvalidParameterError.new("Bad parameter: destination must be an String") if params.dig(:destination) and !params.dig(:destination).is_a?(String)
248
+ raise InvalidParameterError.new("Bad parameter: destination_replace_from must be an String") if params.dig(:destination_replace_from) and !params.dig(:destination_replace_from).is_a?(String)
249
+ raise InvalidParameterError.new("Bad parameter: destination_replace_to must be an String") if params.dig(:destination_replace_to) and !params.dig(:destination_replace_to).is_a?(String)
250
+ raise InvalidParameterError.new("Bad parameter: interval must be an String") if params.dig(:interval) and !params.dig(:interval).is_a?(String)
251
+ raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
252
+ raise InvalidParameterError.new("Bad parameter: user_ids must be an String") if params.dig(:user_ids) and !params.dig(:user_ids).is_a?(String)
253
+ raise InvalidParameterError.new("Bad parameter: group_ids must be an String") if params.dig(:group_ids) and !params.dig(:group_ids).is_a?(String)
254
+ raise MissingParameterError.new("Parameter missing: automation") unless params.dig(:automation)
255
+
256
+ response, options = Api.send_request("/automations", :post, params, options)
257
+ Automation.new(response.data, options)
258
+ end
259
+
260
+ # Parameters:
261
+ # automation (required) - string - Type of automation. One of: `create_folder`, `request_file`, `request_move`
262
+ # source - string - Source Path
263
+ # destination - string - Destination Path
264
+ # destination_replace_from - string - If set, this string in the destination path will be replaced with the value in `destination_replace_to`.
265
+ # destination_replace_to - string - If set, this string will replace the value `destination_replace_from` in the destination filename. You can use special patterns here.
266
+ # interval - string - How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
267
+ # path - string - Path on which this Automation runs. Supports globs.
268
+ # user_ids - string - A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
269
+ # group_ids - string - A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
270
+ def self.update(id, params = {}, options = {})
271
+ params ||= {}
272
+ params[:id] = id
273
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
274
+ raise InvalidParameterError.new("Bad parameter: automation must be an String") if params.dig(:automation) and !params.dig(:automation).is_a?(String)
275
+ raise InvalidParameterError.new("Bad parameter: source must be an String") if params.dig(:source) and !params.dig(:source).is_a?(String)
276
+ raise InvalidParameterError.new("Bad parameter: destination must be an String") if params.dig(:destination) and !params.dig(:destination).is_a?(String)
277
+ raise InvalidParameterError.new("Bad parameter: destination_replace_from must be an String") if params.dig(:destination_replace_from) and !params.dig(:destination_replace_from).is_a?(String)
278
+ raise InvalidParameterError.new("Bad parameter: destination_replace_to must be an String") if params.dig(:destination_replace_to) and !params.dig(:destination_replace_to).is_a?(String)
279
+ raise InvalidParameterError.new("Bad parameter: interval must be an String") if params.dig(:interval) and !params.dig(:interval).is_a?(String)
280
+ raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
281
+ raise InvalidParameterError.new("Bad parameter: user_ids must be an String") if params.dig(:user_ids) and !params.dig(:user_ids).is_a?(String)
282
+ raise InvalidParameterError.new("Bad parameter: group_ids must be an String") if params.dig(:group_ids) and !params.dig(:group_ids).is_a?(String)
283
+ raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
284
+ raise MissingParameterError.new("Parameter missing: automation") unless params.dig(:automation)
285
+
286
+ response, options = Api.send_request("/automations/#{params[:id]}", :patch, params, options)
287
+ Automation.new(response.data, options)
288
+ end
289
+
290
+ def self.delete(id, params = {}, options = {})
291
+ params ||= {}
292
+ params[:id] = id
293
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
294
+ raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
295
+
296
+ response, _options = Api.send_request("/automations/#{params[:id]}", :delete, params, options)
297
+ response.data
298
+ end
299
+
300
+ def self.destroy(id, params = {}, options = {})
301
+ delete(id, params, options)
302
+ end
303
+ end
304
+ end