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: 2 additions & 2 deletions generated/activitysmith_openapi/api/push_notifications_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
# Send a push notification
# Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL (tap) and up to 4 interactive actions (long-press on iOS).
# 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`.
# @param push_notification_request [PushNotificationRequest]
# @param [Hash] opts the optional parameters
# @return [PushNotificationResponse]
Expand All @@ -30,7 +30,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 (tap) and up to 4 interactive actions (long-press on iOS).
# 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`.
# @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 @@ -21,10 +21,13 @@ class PushNotificationRequest

attr_accessor :subtitle

# Optional HTTPS URL opened when user taps the notification body.
# Optional HTTPS URL for an image, audio file, or video that users can preview or play when they expand the notification. If `redirection` is omitted, tapping the notification opens this URL. Cannot be combined with `actions`.
attr_accessor :media

# Optional HTTPS URL opened when user taps the notification body. Overrides the default tap target from `media` when both are provided.
attr_accessor :redirection

# Optional interactive actions shown on iOS long-press.
# Optional interactive actions shown when users expand the notification. Cannot be combined with `media`.
attr_accessor :actions

attr_accessor :payload
Expand All @@ -41,6 +44,7 @@ def self.attribute_map
:'title' => :'title',
:'message' => :'message',
:'subtitle' => :'subtitle',
:'media' => :'media',
:'redirection' => :'redirection',
:'actions' => :'actions',
:'payload' => :'payload',
Expand All @@ -61,6 +65,7 @@ def self.openapi_types
:'title' => :'String',
:'message' => :'String',
:'subtitle' => :'String',
:'media' => :'String',
:'redirection' => :'String',
:'actions' => :'Array<PushNotificationAction>',
:'payload' => :'Hash<String, Object>',
Expand Down Expand Up @@ -105,6 +110,10 @@ def initialize(attributes = {})
self.subtitle = attributes[:'subtitle']
end

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

if attributes.key?(:'redirection')
self.redirection = attributes[:'redirection']
end
Expand Down Expand Up @@ -143,6 +152,11 @@ def list_invalid_properties
invalid_properties.push('invalid value for "title", title cannot be nil.')
end

pattern = Regexp.new(/^https:\/\//)
if !@media.nil? && @media !~ pattern
invalid_properties.push("invalid value for \"media\", must conform to the pattern #{pattern}.")
end

pattern = Regexp.new(/^https:\/\//)
if !@redirection.nil? && @redirection !~ pattern
invalid_properties.push("invalid value for \"redirection\", must conform to the pattern #{pattern}.")
Expand All @@ -160,11 +174,27 @@ def list_invalid_properties
def valid?
warn '[DEPRECATED] the `valid?` method is obsolete'
return false if @title.nil?
return false if !@media.nil? && @media !~ Regexp.new(/^https:\/\//)
return false if !@redirection.nil? && @redirection !~ Regexp.new(/^https:\/\//)
return false if !@actions.nil? && @actions.length > 4
true
end

# Custom attribute writer method with validation
# @param [Object] media Value to be assigned
def media=(media)
if media.nil?
fail ArgumentError, 'media cannot be nil'
end

pattern = Regexp.new(/^https:\/\//)
if media !~ pattern
fail ArgumentError, "invalid value for \"media\", must conform to the pattern #{pattern}."
end

@media = media
end

# Custom attribute writer method with validation
# @param [Object] redirection Value to be assigned
def redirection=(redirection)
Expand Down Expand Up @@ -202,6 +232,7 @@ def ==(o)
title == o.title &&
message == o.message &&
subtitle == o.subtitle &&
media == o.media &&
redirection == o.redirection &&
actions == o.actions &&
payload == o.payload &&
Expand All @@ -219,7 +250,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[title, message, subtitle, redirection, actions, payload, badge, sound, target].hash
[title, message, subtitle, media, redirection, actions, payload, badge, sound, target].hash
end

# Builds the object from hash
Expand Down
Loading