files.com 1.1.682 → 1.1.684

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.
@@ -15,12 +15,34 @@
15
15
  "retried_at": "2000-01-01T01:00:00Z",
16
16
  "retried_in_run_id": 1,
17
17
  "retry_of_run_id": 1,
18
+ "rerun_of_run_id": 1,
19
+ "rerun_from_node_id": "example",
18
20
  "runtime": 1.0,
19
21
  "status": "success",
20
22
  "successful_operations": 1,
21
23
  "failed_operations": 1,
22
24
  "definition": "example",
23
25
  "node_states": "example",
26
+ "execution_nodes": [
27
+ {
28
+ "node_id": "example",
29
+ "node_type": "example",
30
+ "status": "example",
31
+ "run_stage": "example",
32
+ "reused": true,
33
+ "successful_operations": 1,
34
+ "failed_operations": 1,
35
+ "started_at": "2000-01-01T01:00:00Z",
36
+ "completed_at": "2000-01-01T01:00:00Z",
37
+ "duration_ms": 1,
38
+ "inputs": [
39
+ "example"
40
+ ],
41
+ "outputs": "example",
42
+ "input_items": "example",
43
+ "output_items": "example"
44
+ }
45
+ ],
24
46
  "journal_url": "example",
25
47
  "status_messages_url": "https://www.example.com/log_file.txt"
26
48
  }
@@ -37,12 +59,15 @@
37
59
  * `retried_at` (date-time): If set, this Automation run was retried due to `failure` or `partial_failure`.
38
60
  * `retried_in_run_id` (int64): ID of the run that is or will be retrying this run.
39
61
  * `retry_of_run_id` (int64): ID of the original run that this run is retrying.
62
+ * `rerun_of_run_id` (int64): ID of the run whose persisted node outputs this run reused.
63
+ * `rerun_from_node_id` (string): Node at which this run resumed execution.
40
64
  * `runtime` (double): Automation run runtime.
41
65
  * `status` (string): The status of the AutomationRun. One of `queued`, `running`, `success`, `partial_failure`, `failure`, `skipped`, or `canceled`.
42
66
  * `successful_operations` (int64): Count of successful operations.
43
67
  * `failed_operations` (int64): Count of failed operations.
44
68
  * `definition` (object): Automation definition snapshot pinned by this run. For performance reasons, this is not provided when listing Automation runs.
45
69
  * `node_states` (object): Status and execution stage for each node in this run. For performance reasons, this is not provided when listing Automation runs.
70
+ * `execution_nodes` (array(object)): Execution status, timing, and bounded output summaries for each node. For performance reasons, this is not provided when listing Automation runs.
46
71
  * `journal_url` (string): Link to the run journal artifact.
47
72
  * `status_messages_url` (string): Link to status messages log file.
48
73
 
@@ -81,6 +106,22 @@ Files::AutomationRun.find(id)
81
106
  * `id` (int64): Required - Automation Run ID.
82
107
 
83
108
 
109
+ ---
110
+
111
+ ## Show Automation Run Node
112
+
113
+ ```
114
+ Files::AutomationRun.find_node(id,
115
+ node_id: "node_id"
116
+ )
117
+ ```
118
+
119
+ ### Parameters
120
+
121
+ * `id` (int64): Required - Automation Run ID.
122
+ * `node_id` (string): Required - Node ID from the pinned Automation definition.
123
+
124
+
84
125
  ---
85
126
 
86
127
  ## Cancel Automation Run
@@ -94,6 +135,22 @@ Files::AutomationRun.cancel(id)
94
135
  * `id` (int64): Required - Automation Run ID.
95
136
 
96
137
 
138
+ ---
139
+
140
+ ## Re-run Automation from Node
141
+
142
+ ```
143
+ Files::AutomationRun.rerun(id,
144
+ node_id: "node_id"
145
+ )
146
+ ```
147
+
148
+ ### Parameters
149
+
150
+ * `id` (int64): Required - Automation Run ID.
151
+ * `node_id` (string): Required - Node ID at which execution should resume.
152
+
153
+
97
154
  ---
98
155
 
99
156
  ## Cancel Automation Run
@@ -107,3 +164,21 @@ automation_run.cancel
107
164
  ### Parameters
108
165
 
109
166
  * `id` (int64): Required - Automation Run ID.
167
+
168
+
169
+ ---
170
+
171
+ ## Re-run Automation from Node
172
+
173
+ ```
174
+ automation_run = Files::AutomationRun.find(id)
175
+
176
+ automation_run.rerun(
177
+ node_id: "node_id"
178
+ )
179
+ ```
180
+
181
+ ### Parameters
182
+
183
+ * `id` (int64): Required - Automation Run ID.
184
+ * `node_id` (string): Required - Node ID at which execution should resume.
@@ -135,6 +135,15 @@ module Files
135
135
  @attributes[:import_urls] = value
136
136
  end
137
137
 
138
+ # string - If trigger is `email`, this is the address that triggers the Automation.
139
+ def inbound_email_address
140
+ @attributes[:inbound_email_address]
141
+ end
142
+
143
+ def inbound_email_address=(value)
144
+ @attributes[:inbound_email_address] = value
145
+ end
146
+
138
147
  # boolean - Normally copy and move automations that use globs will implicitly preserve the source folder structure in the destination. If this flag is `true`, the source folder structure will be flattened in the destination. This is useful for copying or moving files from multiple folders into a single destination folder.
139
148
  def flatten_destination_structure
140
149
  @attributes[:flatten_destination_structure]
@@ -396,12 +405,27 @@ module Files
396
405
  @attributes[:holiday_region] = value
397
406
  end
398
407
 
399
- # Manually Run Automation
408
+ # Upgrade a legacy Automation to Automation v2
409
+ def upgrade(params = {})
410
+ params ||= {}
411
+ params[:id] = @attributes[:id]
412
+ raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
413
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
414
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
415
+
416
+ Api.send_request("/automations/#{@attributes[:id]}/upgrade", :post, params, @options)
417
+ end
418
+
419
+ # Manually Run Automation. v2 Automations require Site or Workspace Admin permission
420
+ #
421
+ # Parameters:
422
+ # items - array(object) - Initial items for a v2 manual trigger. Each item contains exactly one `file` path or `data` object.
400
423
  def manual_run(params = {})
401
424
  params ||= {}
402
425
  params[:id] = @attributes[:id]
403
426
  raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
404
427
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
428
+ raise InvalidParameterError.new("Bad parameter: items must be an Array") if params[:items] and !params[:items].is_a?(Array)
405
429
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]
406
430
 
407
431
  Api.send_request("/automations/#{@attributes[:id]}/manual_run", :post, params, @options)
@@ -620,11 +644,26 @@ module Files
620
644
  Automation.new(response.data, options)
621
645
  end
622
646
 
623
- # Manually Run Automation
647
+ # Upgrade a legacy Automation to Automation v2
648
+ def self.upgrade(id, params = {}, options = {})
649
+ params ||= {}
650
+ params[:id] = id
651
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
652
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
653
+
654
+ response, options = Api.send_request("/automations/#{params[:id]}/upgrade", :post, params, options)
655
+ Automation.new(response.data, options)
656
+ end
657
+
658
+ # Manually Run Automation. v2 Automations require Site or Workspace Admin permission
659
+ #
660
+ # Parameters:
661
+ # items - array(object) - Initial items for a v2 manual trigger. Each item contains exactly one `file` path or `data` object.
624
662
  def self.manual_run(id, params = {}, options = {})
625
663
  params ||= {}
626
664
  params[:id] = id
627
665
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
666
+ raise InvalidParameterError.new("Bad parameter: items must be an Array") if params[:items] and !params[:items].is_a?(Array)
628
667
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]
629
668
 
630
669
  Api.send_request("/automations/#{params[:id]}/manual_run", :post, params, options)
@@ -23,5 +23,10 @@ module Files
23
23
  def nodes
24
24
  @attributes[:nodes]
25
25
  end
26
+
27
+ # string - Stable public URL for the Automation v2 graph definition JSON Schema.
28
+ def schema_url
29
+ @attributes[:schema_url]
30
+ end
26
31
  end
27
32
  end
@@ -0,0 +1,82 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Files
4
+ class AutomationExecutionNode
5
+ attr_reader :options, :attributes
6
+
7
+ def initialize(attributes = {}, options = {})
8
+ @attributes = attributes || {}
9
+ @options = options || {}
10
+ end
11
+
12
+ # string - Node ID from the pinned Automation definition.
13
+ def node_id
14
+ @attributes[:node_id]
15
+ end
16
+
17
+ # string - Node type.
18
+ def node_type
19
+ @attributes[:node_type]
20
+ end
21
+
22
+ # string - Node status.
23
+ def status
24
+ @attributes[:status]
25
+ end
26
+
27
+ # string - Current node execution stage.
28
+ def run_stage
29
+ @attributes[:run_stage]
30
+ end
31
+
32
+ # boolean - Whether this node reused persisted output from an earlier run.
33
+ def reused
34
+ @attributes[:reused]
35
+ end
36
+
37
+ # int64 - Count of successful operations in this node.
38
+ def successful_operations
39
+ @attributes[:successful_operations]
40
+ end
41
+
42
+ # int64 - Count of failed operations in this node.
43
+ def failed_operations
44
+ @attributes[:failed_operations]
45
+ end
46
+
47
+ # date-time - When this node started.
48
+ def started_at
49
+ @attributes[:started_at]
50
+ end
51
+
52
+ # date-time - When this node completed.
53
+ def completed_at
54
+ @attributes[:completed_at]
55
+ end
56
+
57
+ # int64 - Node runtime in milliseconds.
58
+ def duration_ms
59
+ @attributes[:duration_ms]
60
+ end
61
+
62
+ # array(object) - Ordered inbound edge references.
63
+ def inputs
64
+ @attributes[:inputs]
65
+ end
66
+
67
+ # object - Output counts, item kinds, and typed-error summaries by outlet.
68
+ def outputs
69
+ @attributes[:outputs]
70
+ end
71
+
72
+ # object - Materialized input items currently available, grouped by inlet.
73
+ def input_items
74
+ @attributes[:input_items]
75
+ end
76
+
77
+ # object - Materialized output items grouped by outlet.
78
+ def output_items
79
+ @attributes[:output_items]
80
+ end
81
+ end
82
+ end