Skip to content
Closed
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
2 changes: 2 additions & 0 deletions generated/activitysmith_openapi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
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_replace_request'
require 'activitysmith_openapi/models/push_notification_replace_response'
require 'activitysmith_openapi/models/push_notification_request'
require 'activitysmith_openapi/models/push_notification_response'
require 'activitysmith_openapi/models/push_notification_webhook_method'
Expand Down
82 changes: 80 additions & 2 deletions generated/activitysmith_openapi/api/push_notifications_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,86 @@ class PushNotificationsApi
def initialize(api_client = ApiClient.default)
@api_client = api_client
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 `notification_id` returned when the Push Notification was sent.
# @param push_notification_replace_request [PushNotificationReplaceRequest]
# @param [Hash] opts the optional parameters
# @return [PushNotificationReplaceResponse]
def replace_push_notification(notification_id, push_notification_replace_request, opts = {})
data, _status_code, _headers = replace_push_notification_with_http_info(notification_id, push_notification_replace_request, opts)
data
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 `notification_id` returned when the Push Notification was sent.
# @param push_notification_replace_request [PushNotificationReplaceRequest]
# @param [Hash] opts the optional parameters
# @return [Array<(PushNotificationReplaceResponse, Integer, Hash)>] PushNotificationReplaceResponse data, response status code and response headers
def replace_push_notification_with_http_info(notification_id, push_notification_replace_request, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: PushNotificationsApi.replace_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.replace_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.replace_push_notification, the character length must be great than or equal to 1.'
end

# verify the required parameter 'push_notification_replace_request' is set
if @api_client.config.client_side_validation && push_notification_replace_request.nil?
fail ArgumentError, "Missing the required parameter 'push_notification_replace_request' when calling PushNotificationsApi.replace_push_notification"
end
# resource path
local_var_path = '/push-notification/{notification_id}'.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'])
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

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

# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(push_notification_replace_request)

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

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

new_options = opts.merge(
:operation => :"PushNotificationsApi.replace_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(:PUT, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: PushNotificationsApi#replace_push_notification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end

# Send a push notification
# Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional `icon` shows a custom image, such as a service logo or avatar, next to a smaller app icon. Optional `interruption_level` sets how urgently iOS presents the notification. Optional tags to organize and filter notification history.
# Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional `icon` shows a custom image, such as a logo or avatar, next to a smaller app icon. Optional `interruption_level` sets how urgently iOS presents the notification. Optional tags to organize and filter notification history.
# @param push_notification_request [PushNotificationRequest]
# @param [Hash] opts the optional parameters
# @return [PushNotificationResponse]
Expand All @@ -30,7 +108,7 @@ def send_push_notification(push_notification_request, opts = {})
end

# Send a push notification
# Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. &#x60;media&#x60; cannot be combined with &#x60;actions&#x60;. Optional &#x60;icon&#x60; shows a custom image, such as a service logo or avatar, next to a smaller app icon. Optional &#x60;interruption_level&#x60; sets how urgently iOS presents the notification. Optional tags to organize and filter notification history.
# Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. &#x60;media&#x60; cannot be combined with &#x60;actions&#x60;. Optional &#x60;icon&#x60; shows a custom image, such as a logo or avatar, next to a smaller app icon. Optional &#x60;interruption_level&#x60; sets how urgently iOS presents the notification. Optional tags to organize and filter notification history.
# @param push_notification_request [PushNotificationRequest]
# @param [Hash] opts the optional parameters
# @return [Array<(PushNotificationResponse, Integer, Hash)>] PushNotificationResponse data, response status code and response headers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ class AppIconBadgeCountUpdateResponse

attr_accessor :timestamp

# Number of device tokens targeted.
attr_accessor :devices_targeted

# Number of device tokens deactivated because APNs reported them unregistered.
attr_accessor :devices_deactivated

# Number of targeted device tokens APNs reported as unregistered.
attr_accessor :devices_unregistered

# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
Expand All @@ -45,7 +54,10 @@ def self.attribute_map
:'devices_notified' => :'devices_notified',
:'users_notified' => :'users_notified',
:'effective_channel_slugs' => :'effective_channel_slugs',
:'timestamp' => :'timestamp'
:'timestamp' => :'timestamp',
:'devices_targeted' => :'devices_targeted',
:'devices_deactivated' => :'devices_deactivated',
:'devices_unregistered' => :'devices_unregistered'
}
end

Expand All @@ -64,7 +76,10 @@ def self.openapi_types
:'devices_notified' => :'Integer',
:'users_notified' => :'Integer',
:'effective_channel_slugs' => :'Array<String>',
:'timestamp' => :'Time'
:'timestamp' => :'Time',
:'devices_targeted' => :'Integer',
:'devices_deactivated' => :'Integer',
:'devices_unregistered' => :'Integer'
}
end

Expand Down Expand Up @@ -134,6 +149,18 @@ def initialize(attributes = {})
else
self.timestamp = nil
end

if attributes.key?(:'devices_targeted')
self.devices_targeted = attributes[:'devices_targeted']
end

if attributes.key?(:'devices_deactivated')
self.devices_deactivated = attributes[:'devices_deactivated']
end

if attributes.key?(:'devices_unregistered')
self.devices_unregistered = attributes[:'devices_unregistered']
end
end

# Show invalid properties with the reasons. Usually used together with valid?
Expand Down Expand Up @@ -221,7 +248,10 @@ def ==(o)
devices_notified == o.devices_notified &&
users_notified == o.users_notified &&
effective_channel_slugs == o.effective_channel_slugs &&
timestamp == o.timestamp
timestamp == o.timestamp &&
devices_targeted == o.devices_targeted &&
devices_deactivated == o.devices_deactivated &&
devices_unregistered == o.devices_unregistered
end

# @see the `==` method
Expand All @@ -233,7 +263,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[success, badge, devices_updated, users_updated, devices_notified, users_notified, effective_channel_slugs, timestamp].hash
[success, badge, devices_updated, users_updated, devices_notified, users_notified, effective_channel_slugs, timestamp, devices_targeted, devices_deactivated, devices_unregistered].hash
end

# Builds the object from hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,35 @@ class LiveActivityEndResponse

attr_accessor :timestamp

# True when the Live Activity had already ended and the request had no effect.
attr_accessor :ignored

attr_accessor :message

attr_accessor :end_reason

# True when the Live Activity was marked complete without a confirmed APNs end delivery.
attr_accessor :forced_completion

attr_accessor :warning

# Per-device delivery errors when some devices could not be reached.
attr_accessor :errors

# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'success' => :'success',
:'activity_id' => :'activity_id',
:'devices_queued' => :'devices_queued',
:'devices_notified' => :'devices_notified',
:'timestamp' => :'timestamp'
:'timestamp' => :'timestamp',
:'ignored' => :'ignored',
:'message' => :'message',
:'end_reason' => :'end_reason',
:'forced_completion' => :'forced_completion',
:'warning' => :'warning',
:'errors' => :'errors'
}
end

Expand All @@ -49,13 +70,20 @@ def self.openapi_types
:'activity_id' => :'String',
:'devices_queued' => :'Integer',
:'devices_notified' => :'Integer',
:'timestamp' => :'Time'
:'timestamp' => :'Time',
:'ignored' => :'Boolean',
:'message' => :'String',
:'end_reason' => :'String',
:'forced_completion' => :'Boolean',
:'warning' => :'String',
:'errors' => :'Array<String>'
}
end

# List of attributes with nullable: true
def self.openapi_nullable
Set.new([
:'end_reason',
])
end

Expand Down Expand Up @@ -99,6 +127,32 @@ def initialize(attributes = {})
else
self.timestamp = nil
end

if attributes.key?(:'ignored')
self.ignored = attributes[:'ignored']
end

if attributes.key?(:'message')
self.message = attributes[:'message']
end

if attributes.key?(:'end_reason')
self.end_reason = attributes[:'end_reason']
end

if attributes.key?(:'forced_completion')
self.forced_completion = attributes[:'forced_completion']
end

if attributes.key?(:'warning')
self.warning = attributes[:'warning']
end

if attributes.key?(:'errors')
if (value = attributes[:'errors']).is_a?(Array)
self.errors = value
end
end
end

# Show invalid properties with the reasons. Usually used together with valid?
Expand Down Expand Up @@ -140,7 +194,13 @@ def ==(o)
activity_id == o.activity_id &&
devices_queued == o.devices_queued &&
devices_notified == o.devices_notified &&
timestamp == o.timestamp
timestamp == o.timestamp &&
ignored == o.ignored &&
message == o.message &&
end_reason == o.end_reason &&
forced_completion == o.forced_completion &&
warning == o.warning &&
errors == o.errors
end

# @see the `==` method
Expand All @@ -152,7 +212,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[success, activity_id, devices_queued, devices_notified, timestamp].hash
[success, activity_id, devices_queued, devices_notified, timestamp, ignored, message, end_reason, forced_completion, warning, errors].hash
end

# Builds the object from hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ class LiveActivityStartResponse

attr_accessor :timestamp

# Present when starting this Live Activity ended an older one to stay within the device limit.
attr_accessor :ended_activity_id

attr_accessor :message

# Per-device delivery errors when some devices could not be reached.
attr_accessor :errors

# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
Expand All @@ -40,7 +48,10 @@ def self.attribute_map
:'activity_id' => :'activity_id',
:'effective_channel_slugs' => :'effective_channel_slugs',
:'tags' => :'tags',
:'timestamp' => :'timestamp'
:'timestamp' => :'timestamp',
:'ended_activity_id' => :'ended_activity_id',
:'message' => :'message',
:'errors' => :'errors'
}
end

Expand All @@ -58,7 +69,10 @@ def self.openapi_types
:'activity_id' => :'String',
:'effective_channel_slugs' => :'Array<String>',
:'tags' => :'Array<String>',
:'timestamp' => :'Time'
:'timestamp' => :'Time',
:'ended_activity_id' => :'String',
:'message' => :'String',
:'errors' => :'Array<String>'
}
end

Expand Down Expand Up @@ -120,6 +134,20 @@ def initialize(attributes = {})
else
self.timestamp = nil
end

if attributes.key?(:'ended_activity_id')
self.ended_activity_id = attributes[:'ended_activity_id']
end

if attributes.key?(:'message')
self.message = attributes[:'message']
end

if attributes.key?(:'errors')
if (value = attributes[:'errors']).is_a?(Array)
self.errors = value
end
end
end

# Show invalid properties with the reasons. Usually used together with valid?
Expand Down Expand Up @@ -163,7 +191,10 @@ def ==(o)
activity_id == o.activity_id &&
effective_channel_slugs == o.effective_channel_slugs &&
tags == o.tags &&
timestamp == o.timestamp
timestamp == o.timestamp &&
ended_activity_id == o.ended_activity_id &&
message == o.message &&
errors == o.errors
end

# @see the `==` method
Expand All @@ -175,7 +206,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[success, devices_notified, users_notified, activity_id, effective_channel_slugs, tags, timestamp].hash
[success, devices_notified, users_notified, activity_id, effective_channel_slugs, tags, timestamp, ended_activity_id, message, errors].hash
end

# Builds the object from hash
Expand Down
Loading
Loading