activitysmith 1.1.0 → 1.2.0
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 +4 -4
- data/README.md +75 -34
- data/generated/activitysmith_openapi/api/live_activities_api.rb +6 -6
- data/generated/activitysmith_openapi/api/metrics_api.rb +109 -0
- data/generated/activitysmith_openapi/models/content_state_end.rb +3 -3
- data/generated/activitysmith_openapi/models/content_state_start.rb +3 -3
- data/generated/activitysmith_openapi/models/content_state_update.rb +3 -3
- data/generated/activitysmith_openapi/models/metric_error.rb +230 -0
- data/generated/activitysmith_openapi/models/metric_format.rb +43 -0
- data/generated/activitysmith_openapi/models/metric_unit_spacing.rb +40 -0
- data/generated/activitysmith_openapi/models/metric_value_update_request.rb +232 -0
- data/generated/activitysmith_openapi/models/metric_value_update_request_value.rb +105 -0
- data/generated/activitysmith_openapi/models/metric_value_update_response.rb +221 -0
- data/generated/activitysmith_openapi/models/stream_content_state.rb +5 -5
- data/generated/activitysmith_openapi/models/widget_metric.rb +507 -0
- data/generated/activitysmith_openapi/models/widget_metric_latest_value.rb +105 -0
- data/generated/activitysmith_openapi/version.rb +1 -1
- data/generated/activitysmith_openapi.rb +9 -0
- data/lib/activitysmith/client.rb +22 -10
- data/lib/activitysmith/metrics.rb +42 -0
- data/lib/activitysmith/version.rb +1 -1
- data/lib/activitysmith.rb +1 -0
- metadata +12 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7049fc74d1e6413d076f29460c876e25eed8288a443f083d4f67286098efcb72
|
|
4
|
+
data.tar.gz: 6240b7a43f373237b794dcbf04654211b5a1c97f3796b949f16bdf9a8a17d92b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d033284e3d2e932d928096037880a61a34650e233578244cc70819b4d8bf04a019dc67b74c42d693a372978a2bf1e7882bb674aa8c6e4830b722642246dc8fbd
|
|
7
|
+
data.tar.gz: be32ed8bc216d5710ab192b542df9e3f8ac4528e476acdccfb35502997cc561d14a603e839f5529e47b1b32a0273fd46f92ca468f2c1330b9f3acc95f2306ecc
|
data/README.md
CHANGED
|
@@ -6,6 +6,24 @@ The ActivitySmith Ruby SDK provides convenient access to the ActivitySmith API f
|
|
|
6
6
|
|
|
7
7
|
See [API reference](https://activitysmith.com/docs/api-reference/introduction).
|
|
8
8
|
|
|
9
|
+
## Table of Contents
|
|
10
|
+
|
|
11
|
+
- [Installation](#installation)
|
|
12
|
+
- [Setup](#setup)
|
|
13
|
+
- [Push Notifications](#push-notifications)
|
|
14
|
+
- [Send a Push Notification](#send-a-push-notification)
|
|
15
|
+
- [Rich Push Notifications with Media](#rich-push-notifications-with-media)
|
|
16
|
+
- [Actionable Push Notifications](#actionable-push-notifications)
|
|
17
|
+
- [Live Activities](#live-activities)
|
|
18
|
+
- [Simple: Let ActivitySmith manage the Live Activity for you](#simple-let-activitysmith-manage-the-live-activity-for-you)
|
|
19
|
+
- [Advanced: Full lifecycle control](#advanced-full-lifecycle-control)
|
|
20
|
+
- [Metrics Type](#metrics-type)
|
|
21
|
+
- [Segmented Progress Type](#segmented-progress-type)
|
|
22
|
+
- [Progress Type](#progress-type)
|
|
23
|
+
- [Live Activity Action](#live-activity-action)
|
|
24
|
+
- [Channels](#channels)
|
|
25
|
+
- [Widgets](#widgets)
|
|
26
|
+
|
|
9
27
|
## Installation
|
|
10
28
|
|
|
11
29
|
```sh
|
|
@@ -106,29 +124,31 @@ activitysmith.notifications.send(
|
|
|
106
124
|
## Live Activities
|
|
107
125
|
|
|
108
126
|
<p align="center">
|
|
109
|
-
<img src="https://cdn.activitysmith.com/features/metrics-live-activity-action.png" alt="Live
|
|
127
|
+
<img src="https://cdn.activitysmith.com/features/metrics-live-activity-action.png" alt="Metrics Live Activity screenshot" width="680" />
|
|
110
128
|
</p>
|
|
111
129
|
|
|
112
|
-
|
|
130
|
+
There are three types of Live Activities:
|
|
113
131
|
|
|
114
|
-
-
|
|
115
|
-
-
|
|
132
|
+
- `metrics`: best for live operational stats like server CPU and memory, queue depth, or replica lag
|
|
133
|
+
- `segmented_progress`: best for step-based workflows like deployments, backups, and ETL pipelines
|
|
134
|
+
- `progress`: best for continuous jobs like uploads, reindexes, and long-running migrations tracked as a percentage
|
|
116
135
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
136
|
+
When working with Live Activities via our API, you have two approaches tailored
|
|
137
|
+
to different needs. First, the stateless mode is the simplest path - one API
|
|
138
|
+
call can initiate or update an activity, and another ends it - no state
|
|
139
|
+
tracking on your side.
|
|
121
140
|
|
|
122
|
-
|
|
123
|
-
|
|
141
|
+
This is ideal if you want minimal complexity, perfect for automated workflows
|
|
142
|
+
like cron jobs.
|
|
124
143
|
|
|
125
|
-
|
|
144
|
+
In contrast, if you need precise lifecycle control, the classic approach offers
|
|
145
|
+
distinct calls for start, updates, and end, giving you full control over the
|
|
146
|
+
activity's state.
|
|
126
147
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
- `progress`: best for continuous jobs like uploads, reindexes, and long-running migrations tracked as a percentage
|
|
148
|
+
In the following sections, we'll break down how to implement each method so you
|
|
149
|
+
can choose what fits your use case best.
|
|
130
150
|
|
|
131
|
-
###
|
|
151
|
+
### Simple: Let ActivitySmith manage the Live Activity for you
|
|
132
152
|
|
|
133
153
|
Use a stable `stream_key` to identify the system or workflow you are tracking,
|
|
134
154
|
such as a server, deployment, build pipeline, cron job, or charging session.
|
|
@@ -236,11 +256,9 @@ Stream responses include an `operation` field:
|
|
|
236
256
|
- `paused`: the stream is paused, so no Live Activity was started or updated
|
|
237
257
|
- `ended`: returned by `end_stream(...)` after the stream is ended
|
|
238
258
|
|
|
239
|
-
### Advanced:
|
|
240
|
-
|
|
241
|
-
Use these methods when you want to manage the Live Activity lifecycle yourself.
|
|
259
|
+
### Advanced: Full lifecycle control
|
|
242
260
|
|
|
243
|
-
|
|
261
|
+
Use these methods when you want to manage the Live Activity lifecycle yourself:
|
|
244
262
|
|
|
245
263
|
1. Call `activitysmith.live_activities.start(...)`.
|
|
246
264
|
2. Save the returned `activity_id`.
|
|
@@ -325,10 +343,10 @@ activitysmith.live_activities.end(
|
|
|
325
343
|
|
|
326
344
|
### Segmented Progress Type
|
|
327
345
|
|
|
328
|
-
Use `segmented_progress`
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
346
|
+
Use `segmented_progress` for jobs and workflows that move through clear steps or
|
|
347
|
+
phases. It fits jobs like backups, deployments, ETL pipelines, and checklists.
|
|
348
|
+
`number_of_steps` is dynamic, so you can increase or decrease it later if the
|
|
349
|
+
workflow changes.
|
|
332
350
|
|
|
333
351
|
#### Start
|
|
334
352
|
|
|
@@ -462,7 +480,7 @@ activitysmith.live_activities.end(
|
|
|
462
480
|
|
|
463
481
|
### Live Activity Action
|
|
464
482
|
|
|
465
|
-
Just like Actionable Push Notifications, Live Activities can have a button that opens
|
|
483
|
+
Just like Actionable Push Notifications, Live Activities can have a button that opens provided URL in a browser or triggers a webhook. Webhooks are executed by the ActivitySmith backend.
|
|
466
484
|
|
|
467
485
|
<p align="center">
|
|
468
486
|
<img src="https://cdn.activitysmith.com/features/metrics-live-activity-action.png" alt="Metrics Live Activity with action" width="680" />
|
|
@@ -495,26 +513,27 @@ activity_id = start.activity_id
|
|
|
495
513
|
|
|
496
514
|
#### Webhook action
|
|
497
515
|
|
|
516
|
+
<p align="center">
|
|
517
|
+
<img src="https://cdn.activitysmith.com/features/live-activity-with-action.png?v=20260319-1" alt="Live Activity with action" width="680" />
|
|
518
|
+
</p>
|
|
519
|
+
|
|
498
520
|
```ruby
|
|
499
521
|
activitysmith.live_activities.update(
|
|
500
522
|
{
|
|
501
523
|
activity_id: activity_id,
|
|
502
524
|
content_state: {
|
|
503
|
-
title: "
|
|
504
|
-
subtitle: "
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
{ label: "CPU", value: 91, unit: "%" },
|
|
508
|
-
{ label: "MEM", value: 57, unit: "%" }
|
|
509
|
-
]
|
|
525
|
+
title: "Reindexing product search",
|
|
526
|
+
subtitle: "Shard 7 of 12",
|
|
527
|
+
number_of_steps: 12,
|
|
528
|
+
current_step: 7
|
|
510
529
|
},
|
|
511
530
|
action: {
|
|
512
|
-
title: "
|
|
531
|
+
title: "Pause Reindex",
|
|
513
532
|
type: "webhook",
|
|
514
|
-
url: "https://ops.example.com/hooks/
|
|
533
|
+
url: "https://ops.example.com/hooks/search/reindex/pause",
|
|
515
534
|
method: "POST",
|
|
516
535
|
body: {
|
|
517
|
-
|
|
536
|
+
job_id: "reindex-2026-03-19",
|
|
518
537
|
requested_by: "activitysmith-ruby"
|
|
519
538
|
}
|
|
520
539
|
}
|
|
@@ -536,6 +555,28 @@ activitysmith.notifications.send(
|
|
|
536
555
|
)
|
|
537
556
|
```
|
|
538
557
|
|
|
558
|
+
## Widgets
|
|
559
|
+
|
|
560
|
+
<p align="center">
|
|
561
|
+
<img src="https://cdn.activitysmith.com/features/lock-screen-widgets.png" alt="Lock screen widgets" width="680" />
|
|
562
|
+
</p>
|
|
563
|
+
|
|
564
|
+
ActivitySmith lets you display any value on your Lock Screen with widgets - SaaS metrics, revenue, signups, uptime, habits, or anything else you want to track. Create a metric in the web app, then update the metric value using our API, add a widget to your lock screen and it will fetch the latest update automatically.
|
|
565
|
+
|
|
566
|
+
<p align="center">
|
|
567
|
+
<img src="https://cdn.activitysmith.com/features/create-widget-metric.png" alt="Create widget metric" width="680" />
|
|
568
|
+
</p>
|
|
569
|
+
|
|
570
|
+
```ruby
|
|
571
|
+
activitysmith.metrics.update("deploy.success_rate", 99.9)
|
|
572
|
+
```
|
|
573
|
+
|
|
574
|
+
String metric values work too.
|
|
575
|
+
|
|
576
|
+
```ruby
|
|
577
|
+
activitysmith.metrics.update("prod.status", "healthy")
|
|
578
|
+
```
|
|
579
|
+
|
|
539
580
|
## Error Handling
|
|
540
581
|
|
|
541
582
|
```ruby
|
|
@@ -20,7 +20,7 @@ module OpenapiClient
|
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
22
|
# End a Live Activity
|
|
23
|
-
# Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress,
|
|
23
|
+
# Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
|
|
24
24
|
# @param live_activity_end_request [LiveActivityEndRequest]
|
|
25
25
|
# @param [Hash] opts the optional parameters
|
|
26
26
|
# @return [LiveActivityEndResponse]
|
|
@@ -30,7 +30,7 @@ module OpenapiClient
|
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
# End a Live Activity
|
|
33
|
-
# Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress,
|
|
33
|
+
# Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
|
|
34
34
|
# @param live_activity_end_request [LiveActivityEndRequest]
|
|
35
35
|
# @param [Hash] opts the optional parameters
|
|
36
36
|
# @return [Array<(LiveActivityEndResponse, Integer, Hash)>] LiveActivityEndResponse data, response status code and response headers
|
|
@@ -250,7 +250,7 @@ module OpenapiClient
|
|
|
250
250
|
end
|
|
251
251
|
|
|
252
252
|
# Start a Live Activity
|
|
253
|
-
# Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress,
|
|
253
|
+
# Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
254
254
|
# @param live_activity_start_request [LiveActivityStartRequest]
|
|
255
255
|
# @param [Hash] opts the optional parameters
|
|
256
256
|
# @return [LiveActivityStartResponse]
|
|
@@ -260,7 +260,7 @@ module OpenapiClient
|
|
|
260
260
|
end
|
|
261
261
|
|
|
262
262
|
# Start a Live Activity
|
|
263
|
-
# Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress,
|
|
263
|
+
# Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
264
264
|
# @param live_activity_start_request [LiveActivityStartRequest]
|
|
265
265
|
# @param [Hash] opts the optional parameters
|
|
266
266
|
# @return [Array<(LiveActivityStartResponse, Integer, Hash)>] LiveActivityStartResponse data, response status code and response headers
|
|
@@ -318,7 +318,7 @@ module OpenapiClient
|
|
|
318
318
|
end
|
|
319
319
|
|
|
320
320
|
# Update a Live Activity
|
|
321
|
-
# Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress,
|
|
321
|
+
# Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
322
322
|
# @param live_activity_update_request [LiveActivityUpdateRequest]
|
|
323
323
|
# @param [Hash] opts the optional parameters
|
|
324
324
|
# @return [LiveActivityUpdateResponse]
|
|
@@ -328,7 +328,7 @@ module OpenapiClient
|
|
|
328
328
|
end
|
|
329
329
|
|
|
330
330
|
# Update a Live Activity
|
|
331
|
-
# Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress,
|
|
331
|
+
# Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
332
332
|
# @param live_activity_update_request [LiveActivityUpdateRequest]
|
|
333
333
|
# @param [Hash] opts the optional parameters
|
|
334
334
|
# @return [Array<(LiveActivityUpdateResponse, Integer, Hash)>] LiveActivityUpdateResponse data, response status code and response headers
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#ActivitySmith API
|
|
3
|
+
|
|
4
|
+
#Send push notifications and Live Activities to your own devices via a single API key.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.7.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module OpenapiClient
|
|
16
|
+
class MetricsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Update a widget metric value
|
|
23
|
+
# Updates the latest value for a metric configured in ActivitySmith widgets. Create the metric in the web app first, then write values using its key. Numeric metric formats accept finite numbers. String metrics accept non-empty text up to 64 characters.
|
|
24
|
+
# @param key [String] Metric key configured in the web app. Lowercase letters, numbers, dots, underscores, and dashes are allowed.
|
|
25
|
+
# @param metric_value_update_request [MetricValueUpdateRequest]
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @return [MetricValueUpdateResponse]
|
|
28
|
+
def update_metric_value(key, metric_value_update_request, opts = {})
|
|
29
|
+
data, _status_code, _headers = update_metric_value_with_http_info(key, metric_value_update_request, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Update a widget metric value
|
|
34
|
+
# Updates the latest value for a metric configured in ActivitySmith widgets. Create the metric in the web app first, then write values using its key. Numeric metric formats accept finite numbers. String metrics accept non-empty text up to 64 characters.
|
|
35
|
+
# @param key [String] Metric key configured in the web app. Lowercase letters, numbers, dots, underscores, and dashes are allowed.
|
|
36
|
+
# @param metric_value_update_request [MetricValueUpdateRequest]
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @return [Array<(MetricValueUpdateResponse, Integer, Hash)>] MetricValueUpdateResponse data, response status code and response headers
|
|
39
|
+
def update_metric_value_with_http_info(key, metric_value_update_request, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: MetricsApi.update_metric_value ...'
|
|
42
|
+
end
|
|
43
|
+
# verify the required parameter 'key' is set
|
|
44
|
+
if @api_client.config.client_side_validation && key.nil?
|
|
45
|
+
fail ArgumentError, "Missing the required parameter 'key' when calling MetricsApi.update_metric_value"
|
|
46
|
+
end
|
|
47
|
+
if @api_client.config.client_side_validation && key.to_s.length > 64
|
|
48
|
+
fail ArgumentError, 'invalid value for "key" when calling MetricsApi.update_metric_value, the character length must be smaller than or equal to 64.'
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
if @api_client.config.client_side_validation && key.to_s.length < 1
|
|
52
|
+
fail ArgumentError, 'invalid value for "key" when calling MetricsApi.update_metric_value, the character length must be great than or equal to 1.'
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
pattern = Regexp.new(/^[a-z0-9][a-z0-9_.-]{0,63}$/)
|
|
56
|
+
if @api_client.config.client_side_validation && key !~ pattern
|
|
57
|
+
fail ArgumentError, "invalid value for 'key' when calling MetricsApi.update_metric_value, must conform to the pattern #{pattern}."
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# verify the required parameter 'metric_value_update_request' is set
|
|
61
|
+
if @api_client.config.client_side_validation && metric_value_update_request.nil?
|
|
62
|
+
fail ArgumentError, "Missing the required parameter 'metric_value_update_request' when calling MetricsApi.update_metric_value"
|
|
63
|
+
end
|
|
64
|
+
# resource path
|
|
65
|
+
local_var_path = '/metrics/{key}/value'.sub('{' + 'key' + '}', CGI.escape(key.to_s))
|
|
66
|
+
|
|
67
|
+
# query parameters
|
|
68
|
+
query_params = opts[:query_params] || {}
|
|
69
|
+
|
|
70
|
+
# header parameters
|
|
71
|
+
header_params = opts[:header_params] || {}
|
|
72
|
+
# HTTP header 'Accept' (if needed)
|
|
73
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
74
|
+
# HTTP header 'Content-Type'
|
|
75
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
76
|
+
if !content_type.nil?
|
|
77
|
+
header_params['Content-Type'] = content_type
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# form parameters
|
|
81
|
+
form_params = opts[:form_params] || {}
|
|
82
|
+
|
|
83
|
+
# http body (model)
|
|
84
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(metric_value_update_request)
|
|
85
|
+
|
|
86
|
+
# return_type
|
|
87
|
+
return_type = opts[:debug_return_type] || 'MetricValueUpdateResponse'
|
|
88
|
+
|
|
89
|
+
# auth_names
|
|
90
|
+
auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
|
|
91
|
+
|
|
92
|
+
new_options = opts.merge(
|
|
93
|
+
:operation => :"MetricsApi.update_metric_value",
|
|
94
|
+
:header_params => header_params,
|
|
95
|
+
:query_params => query_params,
|
|
96
|
+
:form_params => form_params,
|
|
97
|
+
:body => post_body,
|
|
98
|
+
:auth_names => auth_names,
|
|
99
|
+
:return_type => return_type
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
103
|
+
if @api_client.config.debugging
|
|
104
|
+
@api_client.config.logger.debug "API called: MetricsApi#update_metric_value\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
105
|
+
end
|
|
106
|
+
return data, status_code, headers
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module OpenapiClient
|
|
17
|
-
# End payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics include a non-empty metrics array.
|
|
17
|
+
# End payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics include a non-empty metrics array. Type is optional when ending an existing activity. You can send an updated number_of_steps here if the workflow changed after start.
|
|
18
18
|
class ContentStateEnd
|
|
19
19
|
attr_accessor :title
|
|
20
20
|
|
|
@@ -248,7 +248,7 @@ module OpenapiClient
|
|
|
248
248
|
return false if !@percentage.nil? && @percentage > 100
|
|
249
249
|
return false if !@percentage.nil? && @percentage < 0
|
|
250
250
|
return false if !@metrics.nil? && @metrics.length < 1
|
|
251
|
-
type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics"
|
|
251
|
+
type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics"])
|
|
252
252
|
return false unless type_validator.valid?(@type)
|
|
253
253
|
color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow"])
|
|
254
254
|
return false unless color_validator.valid?(@color)
|
|
@@ -321,7 +321,7 @@ module OpenapiClient
|
|
|
321
321
|
# Custom attribute writer method checking allowed values (enum).
|
|
322
322
|
# @param [Object] type Object to be assigned
|
|
323
323
|
def type=(type)
|
|
324
|
-
validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics"
|
|
324
|
+
validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics"])
|
|
325
325
|
unless validator.valid?(type)
|
|
326
326
|
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
327
327
|
end
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module OpenapiClient
|
|
17
|
-
# Start payload requires title and type. For segmented_progress include number_of_steps and current_step. For progress include percentage or value with upper_limit. For metrics include a non-empty metrics array.
|
|
17
|
+
# Start payload requires title and type. For segmented_progress include number_of_steps and current_step. For progress include percentage or value with upper_limit. For metrics include a non-empty metrics array. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls.
|
|
18
18
|
class ContentStateStart
|
|
19
19
|
attr_accessor :title
|
|
20
20
|
|
|
@@ -239,7 +239,7 @@ module OpenapiClient
|
|
|
239
239
|
return false if !@percentage.nil? && @percentage < 0
|
|
240
240
|
return false if !@metrics.nil? && @metrics.length < 1
|
|
241
241
|
return false if @type.nil?
|
|
242
|
-
type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics"
|
|
242
|
+
type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics"])
|
|
243
243
|
return false unless type_validator.valid?(@type)
|
|
244
244
|
color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow"])
|
|
245
245
|
return false unless color_validator.valid?(@color)
|
|
@@ -311,7 +311,7 @@ module OpenapiClient
|
|
|
311
311
|
# Custom attribute writer method checking allowed values (enum).
|
|
312
312
|
# @param [Object] type Object to be assigned
|
|
313
313
|
def type=(type)
|
|
314
|
-
validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics"
|
|
314
|
+
validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics"])
|
|
315
315
|
unless validator.valid?(type)
|
|
316
316
|
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
317
317
|
end
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module OpenapiClient
|
|
17
|
-
# Update payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics include a non-empty metrics array.
|
|
17
|
+
# Update payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics include a non-empty metrics array. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates.
|
|
18
18
|
class ContentStateUpdate
|
|
19
19
|
attr_accessor :title
|
|
20
20
|
|
|
@@ -233,7 +233,7 @@ module OpenapiClient
|
|
|
233
233
|
return false if !@percentage.nil? && @percentage > 100
|
|
234
234
|
return false if !@percentage.nil? && @percentage < 0
|
|
235
235
|
return false if !@metrics.nil? && @metrics.length < 1
|
|
236
|
-
type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics"
|
|
236
|
+
type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics"])
|
|
237
237
|
return false unless type_validator.valid?(@type)
|
|
238
238
|
color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow"])
|
|
239
239
|
return false unless color_validator.valid?(@color)
|
|
@@ -305,7 +305,7 @@ module OpenapiClient
|
|
|
305
305
|
# Custom attribute writer method checking allowed values (enum).
|
|
306
306
|
# @param [Object] type Object to be assigned
|
|
307
307
|
def type=(type)
|
|
308
|
-
validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics"
|
|
308
|
+
validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics"])
|
|
309
309
|
unless validator.valid?(type)
|
|
310
310
|
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
311
311
|
end
|