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
21 changes: 1 addition & 20 deletions generated/activitysmith_openapi/models/live_activity_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class LiveActivityAction

attr_accessor :type

# Action URL. For open_url, use an HTTPS or shortcuts:// URL. For webhook, use an HTTPS URL called by the ActivitySmith backend.
# Action URL. For open_url, use an HTTPS URL or a shortcuts:// URL that runs an Apple Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend.
attr_accessor :url

# Webhook HTTP method. Used only when type=webhook.
Expand Down Expand Up @@ -95,7 +95,6 @@ def initialize(attributes = {})
else
self.url = nil
end
validate_action_url!

if attributes.key?(:'method')
self.method = attributes[:'method']
Expand All @@ -110,16 +109,6 @@ def initialize(attributes = {})
end
end

def validate_action_url!
return if @url.nil? || @type.nil?
if @type == LiveActivityActionType::OPEN_URL && @url !~ /\A(https|shortcuts):\/\//
fail ArgumentError, 'invalid value for "url", open_url must use https or shortcuts.'
end
if @type == LiveActivityActionType::WEBHOOK && @url !~ /\Ahttps:\/\//
fail ArgumentError, 'invalid value for "url", webhook must use https.'
end
end

# Show invalid properties with the reasons. Usually used together with valid?
# @return Array for valid properties with the reasons
def list_invalid_properties
Expand All @@ -136,12 +125,6 @@ def list_invalid_properties
if @url.nil?
invalid_properties.push('invalid value for "url", url cannot be nil.')
end
if !@url.nil? && @type == LiveActivityActionType::OPEN_URL && @url !~ /\A(https|shortcuts):\/\//
invalid_properties.push('invalid value for "url", open_url must use https or shortcuts.')
end
if !@url.nil? && @type == LiveActivityActionType::WEBHOOK && @url !~ /\Ahttps:\/\//
invalid_properties.push('invalid value for "url", webhook must use https.')
end

invalid_properties
end
Expand All @@ -153,8 +136,6 @@ def valid?
return false if @title.nil?
return false if @type.nil?
return false if @url.nil?
return false if !@url.nil? && @type == LiveActivityActionType::OPEN_URL && @url !~ /\A(https|shortcuts):\/\//
return false if !@url.nil? && @type == LiveActivityActionType::WEBHOOK && @url !~ /\Ahttps:\/\//
true
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class PushNotificationAction

attr_accessor :type

# Action URL. For open_url, use an HTTPS or shortcuts:// URL. For webhook, use an HTTPS URL called by the ActivitySmith backend.
# Action URL. For open_url, use an HTTPS URL or a shortcuts:// URL that runs an Apple Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend.
attr_accessor :url

# Webhook HTTP method. Used only when type=webhook.
Expand Down Expand Up @@ -94,7 +94,6 @@ def initialize(attributes = {})
else
self.url = nil
end
validate_action_url!

if attributes.key?(:'method')
self.method = attributes[:'method']
Expand All @@ -109,16 +108,6 @@ def initialize(attributes = {})
end
end

def validate_action_url!
return if @url.nil? || @type.nil?
if @type == PushNotificationActionType::OPEN_URL && @url !~ /\A(https|shortcuts):\/\//
fail ArgumentError, 'invalid value for "url", open_url must use https or shortcuts.'
end
if @type == PushNotificationActionType::WEBHOOK && @url !~ /\Ahttps:\/\//
fail ArgumentError, 'invalid value for "url", webhook must use https.'
end
end

# Show invalid properties with the reasons. Usually used together with valid?
# @return Array for valid properties with the reasons
def list_invalid_properties
Expand All @@ -135,12 +124,6 @@ def list_invalid_properties
if @url.nil?
invalid_properties.push('invalid value for "url", url cannot be nil.')
end
if !@url.nil? && @type == PushNotificationActionType::OPEN_URL && @url !~ /\A(https|shortcuts):\/\//
invalid_properties.push('invalid value for "url", open_url must use https or shortcuts.')
end
if !@url.nil? && @type == PushNotificationActionType::WEBHOOK && @url !~ /\Ahttps:\/\//
invalid_properties.push('invalid value for "url", webhook must use https.')
end

invalid_properties
end
Expand All @@ -152,8 +135,6 @@ def valid?
return false if @title.nil?
return false if @type.nil?
return false if @url.nil?
return false if !@url.nil? && @type == PushNotificationActionType::OPEN_URL && @url !~ /\A(https|shortcuts):\/\//
return false if !@url.nil? && @type == PushNotificationActionType::WEBHOOK && @url !~ /\Ahttps:\/\//
true
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PushNotificationRequest
# 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 or shortcuts:// URL opened when user taps the notification body. Overrides the default tap target from `media` when both are provided.
# Optional HTTPS URL or shortcuts:// URL opened when the user taps the notification body. Use shortcuts:// to run an Apple Shortcut. Overrides the default tap target from `media` when both are provided.
attr_accessor :redirection

# Optional interactive actions shown when users expand the notification. Cannot be combined with `media`.
Expand Down
Loading