Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.15.0

Adds Push Notification dismissal. Pass a `notification_id` to `notifications.dismiss` to clear a Push Notification you already sent from the Lock Screen and Notification Center. History keeps it. Also adds `metrics.create` to create a Lock Screen Widget metric and set its label and format, such as currency or percent, and `devices.list` to list the iPhones and iPads paired to your account.

## 1.14.0

Adds the ability to replace a Push Notification you already sent with a new one.
Expand Down
5 changes: 5 additions & 0 deletions generated/activitysmith_openapi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
require 'activitysmith_openapi/configuration'

# Models
require 'activitysmith_openapi/models/account_device'
require 'activitysmith_openapi/models/account_device_list_response'
require 'activitysmith_openapi/models/account_device_list_response_meta'
require 'activitysmith_openapi/models/activity_metric'
require 'activitysmith_openapi/models/activity_metric_value'
require 'activitysmith_openapi/models/alert_payload'
Expand Down Expand Up @@ -62,6 +65,7 @@
require 'activitysmith_openapi/models/push_interruption_level'
require 'activitysmith_openapi/models/push_notification_action'
require 'activitysmith_openapi/models/push_notification_action_type'
require 'activitysmith_openapi/models/push_notification_dismiss_response'
require 'activitysmith_openapi/models/push_notification_replace_request'
require 'activitysmith_openapi/models/push_notification_replace_response'
require 'activitysmith_openapi/models/push_notification_request'
Expand All @@ -74,6 +78,7 @@

# APIs
require 'activitysmith_openapi/api/app_icon_badges_api'
require 'activitysmith_openapi/api/devices_api'
require 'activitysmith_openapi/api/live_activities_api'
require 'activitysmith_openapi/api/metrics_api'
require 'activitysmith_openapi/api/push_notifications_api'
Expand Down
100 changes: 100 additions & 0 deletions generated/activitysmith_openapi/api/devices_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
=begin
#ActivitySmith API

#Send push notifications and Live Activities to your own devices via a single API key.

The version of the OpenAPI document: 1.0.0

Generated by: https://openapi-generator.tech
Generator version: 7.7.0

=end

require 'cgi'

module OpenapiClient
class DevicesApi
attr_accessor :api_client

def initialize(api_client = ApiClient.default)
@api_client = api_client
end
# List paired devices
# Lists the iPhones and iPads paired to the account, active devices first. Use it to check that a device is paired before you send, or to find device IDs for Channels. An empty list means no device is paired yet: install the ActivitySmith app from the App Store and sign in. Channel-scoped API keys cannot list devices.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :limit Maximum devices to return, 1 to 100. Defaults to 100. (default to 100)
# @option opts [Integer] :offset Devices to skip. Use meta.next_offset from the previous page. (default to 0)
# @option opts [Boolean] :include_inactive Include devices that can no longer receive deliveries, such as unpaired phones. (default to false)
# @return [AccountDeviceListResponse]
def list_account_devices(opts = {})
data, _status_code, _headers = list_account_devices_with_http_info(opts)
data
end

# List paired devices
# Lists the iPhones and iPads paired to the account, active devices first. Use it to check that a device is paired before you send, or to find device IDs for Channels. An empty list means no device is paired yet: install the ActivitySmith app from the App Store and sign in. Channel-scoped API keys cannot list devices.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :limit Maximum devices to return, 1 to 100. Defaults to 100. (default to 100)
# @option opts [Integer] :offset Devices to skip. Use meta.next_offset from the previous page. (default to 0)
# @option opts [Boolean] :include_inactive Include devices that can no longer receive deliveries, such as unpaired phones. (default to false)
# @return [Array<(AccountDeviceListResponse, Integer, Hash)>] AccountDeviceListResponse data, response status code and response headers
def list_account_devices_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: DevicesApi.list_account_devices ...'
end
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DevicesApi.list_account_devices, must be smaller than or equal to 100.'
end

if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DevicesApi.list_account_devices, must be greater than or equal to 1.'
end

if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling DevicesApi.list_account_devices, must be greater than or equal to 0.'
end

# resource path
local_var_path = '/account/devices'

# query parameters
query_params = opts[:query_params] || {}
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
query_params[:'include_inactive'] = opts[:'include_inactive'] if !opts[:'include_inactive'].nil?

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body]

# return_type
return_type = opts[:debug_return_type] || 'AccountDeviceListResponse'

# auth_names
auth_names = opts[:debug_auth_names] || ['apiKeyAuth']

new_options = opts.merge(
:operation => :"DevicesApi.list_account_devices",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)

data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: DevicesApi#list_account_devices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
end
end
4 changes: 2 additions & 2 deletions generated/activitysmith_openapi/api/live_activities_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def initialize(api_client = ApiClient.default)
@api_client = api_client
end
# End a Live Activity (legacy manual lifecycle)
# Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities.
# Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Ending a Live Activity that already ended returns 200 with ignored: true and sends nothing to devices, so retries are safe.
# @param live_activity_end_request [LiveActivityEndRequest]
# @param [Hash] opts the optional parameters
# @return [LiveActivityEndResponse]
Expand All @@ -30,7 +30,7 @@ def end_live_activity(live_activity_end_request, opts = {})
end

# End a Live Activity (legacy manual lifecycle)
# Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities.
# Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Ending a Live Activity that already ended returns 200 with ignored: true and sends nothing to devices, so retries are safe.
# @param live_activity_end_request [LiveActivityEndRequest]
# @param [Hash] opts the optional parameters
# @return [Array<(LiveActivityEndResponse, Integer, Hash)>] LiveActivityEndResponse data, response status code and response headers
Expand Down
67 changes: 67 additions & 0 deletions generated/activitysmith_openapi/api/push_notifications_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,73 @@ class PushNotificationsApi
def initialize(api_client = ApiClient.default)
@api_client = api_client
end
# Dismiss a push notification
# Clears a Push Notification you already sent from the Lock Screen and Notification Center on every device it was sent to, using the `notification_id` from the send response. Notification history keeps it. Devices clear the notification in the background, which can take a moment or wait until the ActivitySmith app next opens. A successful response means the dismissal was recorded, not that every device has cleared it yet. Devices running an ActivitySmith app version before 1.17.0 show a silent notification titled \"Push Notification dismissed\" in its place until the user clears it. Calling this again for the same notification returns the same response and sends nothing. A dismissed notification cannot be replaced.
# @param notification_id [String] The &#x60;notification_id&#x60; returned when the Push Notification was sent.
# @param [Hash] opts the optional parameters
# @return [PushNotificationDismissResponse]
def dismiss_push_notification(notification_id, opts = {})
data, _status_code, _headers = dismiss_push_notification_with_http_info(notification_id, opts)
data
end

# Dismiss a push notification
# Clears a Push Notification you already sent from the Lock Screen and Notification Center on every device it was sent to, using the &#x60;notification_id&#x60; from the send response. Notification history keeps it. Devices clear the notification in the background, which can take a moment or wait until the ActivitySmith app next opens. A successful response means the dismissal was recorded, not that every device has cleared it yet. Devices running an ActivitySmith app version before 1.17.0 show a silent notification titled \&quot;Push Notification dismissed\&quot; in its place until the user clears it. Calling this again for the same notification returns the same response and sends nothing. A dismissed notification cannot be replaced.
# @param notification_id [String] The &#x60;notification_id&#x60; returned when the Push Notification was sent.
# @param [Hash] opts the optional parameters
# @return [Array<(PushNotificationDismissResponse, Integer, Hash)>] PushNotificationDismissResponse data, response status code and response headers
def dismiss_push_notification_with_http_info(notification_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: PushNotificationsApi.dismiss_push_notification ...'
end
# verify the required parameter 'notification_id' is set
if @api_client.config.client_side_validation && notification_id.nil?
fail ArgumentError, "Missing the required parameter 'notification_id' when calling PushNotificationsApi.dismiss_push_notification"
end
if @api_client.config.client_side_validation && notification_id.to_s.length < 1
fail ArgumentError, 'invalid value for "notification_id" when calling PushNotificationsApi.dismiss_push_notification, the character length must be great than or equal to 1.'
end

# resource path
local_var_path = '/push-notification/{notification_id}/dismiss'.sub('{' + 'notification_id' + '}', CGI.escape(notification_id.to_s))

# query parameters
query_params = opts[:query_params] || {}

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body]

# return_type
return_type = opts[:debug_return_type] || 'PushNotificationDismissResponse'

# auth_names
auth_names = opts[:debug_auth_names] || ['apiKeyAuth']

new_options = opts.merge(
:operation => :"PushNotificationsApi.dismiss_push_notification",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)

data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: PushNotificationsApi#dismiss_push_notification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end

# Replace a push notification
# Replaces a Push Notification you already sent, using the `notification_id` from the send response. The replacement takes the original's place on the Lock Screen and in Notification Center instead of appearing as a second notification. It is delivered silently, with no sound or screen wake, to the same recipients as the original. Notification history is updated in place.
# @param notification_id [String] The &#x60;notification_id&#x60; returned when the Push Notification was sent.
Expand Down
Loading
Loading