From edf13a520c642badff02555df02037dd654b29e6 Mon Sep 17 00:00:00 2001 From: activitysmith-bot Date: Tue, 15 Sep 2026 12:49:16 +0000 Subject: [PATCH 01/11] chore: regenerate SDK --- generated/activitysmith_openapi.rb | 9 + .../activitysmith_openapi/api/public_api.rb | 150 +++++++ .../activitysmith_openapi/configuration.rb | 7 + .../app_icon_badge_count_update_error.rb | 386 ++++++++++++++++++ .../app_icon_badge_count_update_response.rb | 44 +- .../models/changelog_entry.rb | 339 +++++++++++++++ .../models/changelog_item.rb | 267 ++++++++++++ .../models/changelog_list_response.rb | 223 ++++++++++ .../models/health_check.rb | 318 +++++++++++++++ .../models/health_response.rb | 271 ++++++++++++ .../models/live_activity_end_request.rb | 64 ++- .../models/live_activity_limit_error.rb | 30 +- .../models/live_activity_start_request.rb | 33 +- .../live_activity_stream_delete_request.rb | 45 +- .../models/live_activity_stream_request.rb | 33 +- .../models/live_activity_update_request.rb | 64 ++- .../models/metadata_value.rb | 106 +++++ .../models/push_notification_action.rb | 2 +- .../models/push_notification_request.rb | 50 ++- ...update_app_icon_badge_count422_response.rb | 105 +++++ generated/openapi-source.json | 6 + 21 files changed, 2525 insertions(+), 27 deletions(-) create mode 100644 generated/activitysmith_openapi/api/public_api.rb create mode 100644 generated/activitysmith_openapi/models/app_icon_badge_count_update_error.rb create mode 100644 generated/activitysmith_openapi/models/changelog_entry.rb create mode 100644 generated/activitysmith_openapi/models/changelog_item.rb create mode 100644 generated/activitysmith_openapi/models/changelog_list_response.rb create mode 100644 generated/activitysmith_openapi/models/health_check.rb create mode 100644 generated/activitysmith_openapi/models/health_response.rb create mode 100644 generated/activitysmith_openapi/models/metadata_value.rb create mode 100644 generated/activitysmith_openapi/models/update_app_icon_badge_count422_response.rb create mode 100644 generated/openapi-source.json diff --git a/generated/activitysmith_openapi.rb b/generated/activitysmith_openapi.rb index 9928336..258e6bd 100644 --- a/generated/activitysmith_openapi.rb +++ b/generated/activitysmith_openapi.rb @@ -20,14 +20,20 @@ require 'activitysmith_openapi/models/activity_metric' require 'activitysmith_openapi/models/activity_metric_value' require 'activitysmith_openapi/models/alert_payload' +require 'activitysmith_openapi/models/app_icon_badge_count_update_error' require 'activitysmith_openapi/models/app_icon_badge_count_update_request' require 'activitysmith_openapi/models/app_icon_badge_count_update_response' require 'activitysmith_openapi/models/bad_request_error' +require 'activitysmith_openapi/models/changelog_entry' +require 'activitysmith_openapi/models/changelog_item' +require 'activitysmith_openapi/models/changelog_list_response' require 'activitysmith_openapi/models/channel_target' require 'activitysmith_openapi/models/content_state_end' require 'activitysmith_openapi/models/content_state_start' require 'activitysmith_openapi/models/content_state_update' require 'activitysmith_openapi/models/forbidden_error' +require 'activitysmith_openapi/models/health_check' +require 'activitysmith_openapi/models/health_response' require 'activitysmith_openapi/models/live_activity_action' require 'activitysmith_openapi/models/live_activity_action_type' require 'activitysmith_openapi/models/live_activity_alert_badge' @@ -45,6 +51,7 @@ require 'activitysmith_openapi/models/live_activity_update_request' require 'activitysmith_openapi/models/live_activity_update_response' require 'activitysmith_openapi/models/live_activity_webhook_method' +require 'activitysmith_openapi/models/metadata_value' require 'activitysmith_openapi/models/metric_error' require 'activitysmith_openapi/models/metric_value_update_request' require 'activitysmith_openapi/models/metric_value_update_request_value' @@ -59,11 +66,13 @@ require 'activitysmith_openapi/models/rate_limit_error' require 'activitysmith_openapi/models/send_push_notification429_response' require 'activitysmith_openapi/models/stream_content_state' +require 'activitysmith_openapi/models/update_app_icon_badge_count422_response' # APIs require 'activitysmith_openapi/api/app_icon_badges_api' require 'activitysmith_openapi/api/live_activities_api' require 'activitysmith_openapi/api/metrics_api' +require 'activitysmith_openapi/api/public_api' require 'activitysmith_openapi/api/push_notifications_api' module OpenapiClient diff --git a/generated/activitysmith_openapi/api/public_api.rb b/generated/activitysmith_openapi/api/public_api.rb new file mode 100644 index 0000000..5a5a57a --- /dev/null +++ b/generated/activitysmith_openapi/api/public_api.rb @@ -0,0 +1,150 @@ +=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 PublicApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Get API Health + # Returns the current availability of the ActivitySmith API and its required services. No authentication is required. + # @param [Hash] opts the optional parameters + # @return [HealthResponse] + def get_api_health(opts = {}) + data, _status_code, _headers = get_api_health_with_http_info(opts) + data + end + + # Get API Health + # Returns the current availability of the ActivitySmith API and its required services. No authentication is required. + # @param [Hash] opts the optional parameters + # @return [Array<(HealthResponse, Integer, Hash)>] HealthResponse data, response status code and response headers + def get_api_health_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PublicApi.get_api_health ...' + end + # resource path + local_var_path = '/health' + + # 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] || 'HealthResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"PublicApi.get_api_health", + :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: PublicApi#get_api_health\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List Public Changelog Entries + # Returns published ActivitySmith app changelog entries. No authentication is required. + # @param [Hash] opts the optional parameters + # @option opts [String] :platform Platform whose published changelog entries should be returned. (default to 'ios') + # @option opts [Integer] :limit Maximum number of entries to return. (default to 10) + # @return [ChangelogListResponse] + def list_public_changelog_entries(opts = {}) + data, _status_code, _headers = list_public_changelog_entries_with_http_info(opts) + data + end + + # List Public Changelog Entries + # Returns published ActivitySmith app changelog entries. No authentication is required. + # @param [Hash] opts the optional parameters + # @option opts [String] :platform Platform whose published changelog entries should be returned. (default to 'ios') + # @option opts [Integer] :limit Maximum number of entries to return. (default to 10) + # @return [Array<(ChangelogListResponse, Integer, Hash)>] ChangelogListResponse data, response status code and response headers + def list_public_changelog_entries_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PublicApi.list_public_changelog_entries ...' + end + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 20 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PublicApi.list_public_changelog_entries, must be smaller than or equal to 20.' + end + + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PublicApi.list_public_changelog_entries, must be greater than or equal to 1.' + end + + # resource path + local_var_path = '/changelog' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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] || 'ChangelogListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"PublicApi.list_public_changelog_entries", + :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: PublicApi#list_public_changelog_entries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/generated/activitysmith_openapi/configuration.rb b/generated/activitysmith_openapi/configuration.rb index da0dc73..4333dc1 100644 --- a/generated/activitysmith_openapi/configuration.rb +++ b/generated/activitysmith_openapi/configuration.rb @@ -252,6 +252,13 @@ def auth_settings key: 'Authorization', value: "Bearer #{access_token_with_refresh}" }, + 'mcpOAuth' => + { + type: 'oauth2', + in: 'header', + key: 'Authorization', + value: "Bearer #{access_token_with_refresh}" + }, } end diff --git a/generated/activitysmith_openapi/models/app_icon_badge_count_update_error.rb b/generated/activitysmith_openapi/models/app_icon_badge_count_update_error.rb new file mode 100644 index 0000000..5cc0896 --- /dev/null +++ b/generated/activitysmith_openapi/models/app_icon_badge_count_update_error.rb @@ -0,0 +1,386 @@ +=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 'date' +require 'time' + +module OpenapiClient + class AppIconBadgeCountUpdateError + attr_accessor :error + + attr_accessor :code + + attr_accessor :message + + attr_accessor :badge + + attr_accessor :devices_targeted + + attr_accessor :devices_updated + + attr_accessor :users_updated + + # Deprecated compatibility alias for devices_updated. + attr_accessor :devices_notified + + attr_accessor :effective_channel_slugs + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'error' => :'error', + :'code' => :'code', + :'message' => :'message', + :'badge' => :'badge', + :'devices_targeted' => :'devices_targeted', + :'devices_updated' => :'devices_updated', + :'users_updated' => :'users_updated', + :'devices_notified' => :'devices_notified', + :'effective_channel_slugs' => :'effective_channel_slugs' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'error' => :'String', + :'code' => :'String', + :'message' => :'String', + :'badge' => :'Integer', + :'devices_targeted' => :'Integer', + :'devices_updated' => :'Integer', + :'users_updated' => :'Integer', + :'devices_notified' => :'Integer', + :'effective_channel_slugs' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::AppIconBadgeCountUpdateError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::AppIconBadgeCountUpdateError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'error') + self.error = attributes[:'error'] + else + self.error = nil + end + + if attributes.key?(:'code') + self.code = attributes[:'code'] + else + self.code = nil + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + else + self.message = nil + end + + if attributes.key?(:'badge') + self.badge = attributes[:'badge'] + else + self.badge = nil + end + + if attributes.key?(:'devices_targeted') + self.devices_targeted = attributes[:'devices_targeted'] + end + + if attributes.key?(:'devices_updated') + self.devices_updated = attributes[:'devices_updated'] + else + self.devices_updated = nil + end + + if attributes.key?(:'users_updated') + self.users_updated = attributes[:'users_updated'] + end + + if attributes.key?(:'devices_notified') + self.devices_notified = attributes[:'devices_notified'] + end + + if attributes.key?(:'effective_channel_slugs') + if (value = attributes[:'effective_channel_slugs']).is_a?(Array) + self.effective_channel_slugs = value + end + 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 + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @error.nil? + invalid_properties.push('invalid value for "error", error cannot be nil.') + end + + if @code.nil? + invalid_properties.push('invalid value for "code", code cannot be nil.') + end + + if @message.nil? + invalid_properties.push('invalid value for "message", message cannot be nil.') + end + + if @badge.nil? + invalid_properties.push('invalid value for "badge", badge cannot be nil.') + end + + if @badge > 2147483647 + invalid_properties.push('invalid value for "badge", must be smaller than or equal to 2147483647.') + end + + if @badge < 0 + invalid_properties.push('invalid value for "badge", must be greater than or equal to 0.') + end + + if @devices_updated.nil? + invalid_properties.push('invalid value for "devices_updated", devices_updated cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @error.nil? + return false if @code.nil? + code_validator = EnumAttributeValidator.new('String', ["badge_device_disconnected", "badge_update_failed"]) + return false unless code_validator.valid?(@code) + return false if @message.nil? + return false if @badge.nil? + return false if @badge > 2147483647 + return false if @badge < 0 + return false if @devices_updated.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] code Object to be assigned + def code=(code) + validator = EnumAttributeValidator.new('String', ["badge_device_disconnected", "badge_update_failed"]) + unless validator.valid?(code) + fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." + end + @code = code + end + + # Custom attribute writer method with validation + # @param [Object] badge Value to be assigned + def badge=(badge) + if badge.nil? + fail ArgumentError, 'badge cannot be nil' + end + + if badge > 2147483647 + fail ArgumentError, 'invalid value for "badge", must be smaller than or equal to 2147483647.' + end + + if badge < 0 + fail ArgumentError, 'invalid value for "badge", must be greater than or equal to 0.' + end + + @badge = badge + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + error == o.error && + code == o.code && + message == o.message && + badge == o.badge && + devices_targeted == o.devices_targeted && + devices_updated == o.devices_updated && + users_updated == o.users_updated && + devices_notified == o.devices_notified && + effective_channel_slugs == o.effective_channel_slugs + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [error, code, message, badge, devices_targeted, devices_updated, users_updated, devices_notified, effective_channel_slugs].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OpenapiClient.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/generated/activitysmith_openapi/models/app_icon_badge_count_update_response.rb b/generated/activitysmith_openapi/models/app_icon_badge_count_update_response.rb index 9faa31c..4482afc 100644 --- a/generated/activitysmith_openapi/models/app_icon_badge_count_update_response.rb +++ b/generated/activitysmith_openapi/models/app_icon_badge_count_update_response.rb @@ -19,8 +19,16 @@ class AppIconBadgeCountUpdateResponse attr_accessor :badge + # Number of devices whose App Icon Badge Count was updated. + attr_accessor :devices_updated + + # Number of account users with at least one updated device. + attr_accessor :users_updated + + # Deprecated compatibility alias for devices_updated. attr_accessor :devices_notified + # Deprecated compatibility alias for users_updated. attr_accessor :users_notified attr_accessor :effective_channel_slugs @@ -32,6 +40,8 @@ def self.attribute_map { :'success' => :'success', :'badge' => :'badge', + :'devices_updated' => :'devices_updated', + :'users_updated' => :'users_updated', :'devices_notified' => :'devices_notified', :'users_notified' => :'users_notified', :'effective_channel_slugs' => :'effective_channel_slugs', @@ -49,6 +59,8 @@ def self.openapi_types { :'success' => :'Boolean', :'badge' => :'Integer', + :'devices_updated' => :'Integer', + :'users_updated' => :'Integer', :'devices_notified' => :'Integer', :'users_notified' => :'Integer', :'effective_channel_slugs' => :'Array', @@ -89,16 +101,24 @@ def initialize(attributes = {}) self.badge = nil end + if attributes.key?(:'devices_updated') + self.devices_updated = attributes[:'devices_updated'] + else + self.devices_updated = nil + end + + if attributes.key?(:'users_updated') + self.users_updated = attributes[:'users_updated'] + else + self.users_updated = nil + end + if attributes.key?(:'devices_notified') self.devices_notified = attributes[:'devices_notified'] - else - self.devices_notified = nil end if attributes.key?(:'users_notified') self.users_notified = attributes[:'users_notified'] - else - self.users_notified = nil end if attributes.key?(:'effective_channel_slugs') @@ -137,12 +157,12 @@ def list_invalid_properties invalid_properties.push('invalid value for "badge", must be greater than or equal to 0.') end - if @devices_notified.nil? - invalid_properties.push('invalid value for "devices_notified", devices_notified cannot be nil.') + if @devices_updated.nil? + invalid_properties.push('invalid value for "devices_updated", devices_updated cannot be nil.') end - if @users_notified.nil? - invalid_properties.push('invalid value for "users_notified", users_notified cannot be nil.') + if @users_updated.nil? + invalid_properties.push('invalid value for "users_updated", users_updated cannot be nil.') end if @effective_channel_slugs.nil? @@ -164,8 +184,8 @@ def valid? return false if @badge.nil? return false if @badge > 2147483647 return false if @badge < 0 - return false if @devices_notified.nil? - return false if @users_notified.nil? + return false if @devices_updated.nil? + return false if @users_updated.nil? return false if @effective_channel_slugs.nil? return false if @timestamp.nil? true @@ -196,6 +216,8 @@ def ==(o) self.class == o.class && success == o.success && badge == o.badge && + devices_updated == o.devices_updated && + users_updated == o.users_updated && devices_notified == o.devices_notified && users_notified == o.users_notified && effective_channel_slugs == o.effective_channel_slugs && @@ -211,7 +233,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [success, badge, devices_notified, users_notified, effective_channel_slugs, timestamp].hash + [success, badge, devices_updated, users_updated, devices_notified, users_notified, effective_channel_slugs, timestamp].hash end # Builds the object from hash diff --git a/generated/activitysmith_openapi/models/changelog_entry.rb b/generated/activitysmith_openapi/models/changelog_entry.rb new file mode 100644 index 0000000..6299ac9 --- /dev/null +++ b/generated/activitysmith_openapi/models/changelog_entry.rb @@ -0,0 +1,339 @@ +=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 'date' +require 'time' + +module OpenapiClient + class ChangelogEntry + attr_accessor :id + + attr_accessor :platform + + attr_accessor :version + + attr_accessor :title + + attr_accessor :subtitle + + attr_accessor :hero_image_url + + attr_accessor :cta_title + + attr_accessor :published_at + + attr_accessor :items + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'platform' => :'platform', + :'version' => :'version', + :'title' => :'title', + :'subtitle' => :'subtitle', + :'hero_image_url' => :'hero_image_url', + :'cta_title' => :'cta_title', + :'published_at' => :'published_at', + :'items' => :'items' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'platform' => :'String', + :'version' => :'String', + :'title' => :'String', + :'subtitle' => :'String', + :'hero_image_url' => :'String', + :'cta_title' => :'String', + :'published_at' => :'Time', + :'items' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'subtitle', + :'hero_image_url', + :'published_at', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::ChangelogEntry` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::ChangelogEntry`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'platform') + self.platform = attributes[:'platform'] + else + self.platform = nil + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + else + self.version = nil + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + else + self.title = nil + end + + if attributes.key?(:'subtitle') + self.subtitle = attributes[:'subtitle'] + else + self.subtitle = nil + end + + if attributes.key?(:'hero_image_url') + self.hero_image_url = attributes[:'hero_image_url'] + else + self.hero_image_url = nil + end + + if attributes.key?(:'cta_title') + self.cta_title = attributes[:'cta_title'] + else + self.cta_title = nil + end + + if attributes.key?(:'published_at') + self.published_at = attributes[:'published_at'] + else + self.published_at = nil + end + + if attributes.key?(:'items') + if (value = attributes[:'items']).is_a?(Array) + self.items = value + end + else + self.items = nil + 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 + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @platform.nil? + invalid_properties.push('invalid value for "platform", platform cannot be nil.') + end + + if @version.nil? + invalid_properties.push('invalid value for "version", version cannot be nil.') + end + + if @title.nil? + invalid_properties.push('invalid value for "title", title cannot be nil.') + end + + if @cta_title.nil? + invalid_properties.push('invalid value for "cta_title", cta_title cannot be nil.') + end + + if @items.nil? + invalid_properties.push('invalid value for "items", items cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @platform.nil? + return false if @version.nil? + return false if @title.nil? + return false if @cta_title.nil? + return false if @items.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + platform == o.platform && + version == o.version && + title == o.title && + subtitle == o.subtitle && + hero_image_url == o.hero_image_url && + cta_title == o.cta_title && + published_at == o.published_at && + items == o.items + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, platform, version, title, subtitle, hero_image_url, cta_title, published_at, items].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OpenapiClient.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/generated/activitysmith_openapi/models/changelog_item.rb b/generated/activitysmith_openapi/models/changelog_item.rb new file mode 100644 index 0000000..4a0553c --- /dev/null +++ b/generated/activitysmith_openapi/models/changelog_item.rb @@ -0,0 +1,267 @@ +=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 'date' +require 'time' + +module OpenapiClient + class ChangelogItem + attr_accessor :icon + + attr_accessor :title + + attr_accessor :body + + attr_accessor :image_url + + attr_accessor :accent_color + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'icon' => :'icon', + :'title' => :'title', + :'body' => :'body', + :'image_url' => :'image_url', + :'accent_color' => :'accent_color' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'icon' => :'String', + :'title' => :'String', + :'body' => :'String', + :'image_url' => :'String', + :'accent_color' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'icon', + :'image_url', + :'accent_color' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::ChangelogItem` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::ChangelogItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'icon') + self.icon = attributes[:'icon'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + else + self.title = nil + end + + if attributes.key?(:'body') + self.body = attributes[:'body'] + else + self.body = nil + end + + if attributes.key?(:'image_url') + self.image_url = attributes[:'image_url'] + end + + if attributes.key?(:'accent_color') + self.accent_color = attributes[:'accent_color'] + 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 + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @title.nil? + invalid_properties.push('invalid value for "title", title cannot be nil.') + end + + if @body.nil? + invalid_properties.push('invalid value for "body", body cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @title.nil? + return false if @body.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + icon == o.icon && + title == o.title && + body == o.body && + image_url == o.image_url && + accent_color == o.accent_color + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [icon, title, body, image_url, accent_color].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OpenapiClient.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/generated/activitysmith_openapi/models/changelog_list_response.rb b/generated/activitysmith_openapi/models/changelog_list_response.rb new file mode 100644 index 0000000..23e18da --- /dev/null +++ b/generated/activitysmith_openapi/models/changelog_list_response.rb @@ -0,0 +1,223 @@ +=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 'date' +require 'time' + +module OpenapiClient + class ChangelogListResponse + attr_accessor :changelogs + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'changelogs' => :'changelogs' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'changelogs' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::ChangelogListResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::ChangelogListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'changelogs') + if (value = attributes[:'changelogs']).is_a?(Array) + self.changelogs = value + end + else + self.changelogs = nil + 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 + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @changelogs.nil? + invalid_properties.push('invalid value for "changelogs", changelogs cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @changelogs.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + changelogs == o.changelogs + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [changelogs].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OpenapiClient.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/generated/activitysmith_openapi/models/health_check.rb b/generated/activitysmith_openapi/models/health_check.rb new file mode 100644 index 0000000..5b4ea32 --- /dev/null +++ b/generated/activitysmith_openapi/models/health_check.rb @@ -0,0 +1,318 @@ +=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 'date' +require 'time' + +module OpenapiClient + class HealthCheck + attr_accessor :name + + attr_accessor :status + + attr_accessor :duration_ms + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'status' => :'status', + :'duration_ms' => :'duration_ms' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'status' => :'String', + :'duration_ms' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::HealthCheck` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::HealthCheck`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + else + self.name = nil + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + else + self.status = nil + end + + if attributes.key?(:'duration_ms') + self.duration_ms = attributes[:'duration_ms'] + else + self.duration_ms = nil + 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 + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @status.nil? + invalid_properties.push('invalid value for "status", status cannot be nil.') + end + + if @duration_ms.nil? + invalid_properties.push('invalid value for "duration_ms", duration_ms cannot be nil.') + end + + if @duration_ms < 0 + invalid_properties.push('invalid value for "duration_ms", must be greater than or equal to 0.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @name.nil? + name_validator = EnumAttributeValidator.new('String', ["database", "redis"]) + return false unless name_validator.valid?(@name) + return false if @status.nil? + status_validator = EnumAttributeValidator.new('String', ["ok", "failed"]) + return false unless status_validator.valid?(@status) + return false if @duration_ms.nil? + return false if @duration_ms < 0 + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] name Object to be assigned + def name=(name) + validator = EnumAttributeValidator.new('String', ["database", "redis"]) + unless validator.valid?(name) + fail ArgumentError, "invalid value for \"name\", must be one of #{validator.allowable_values}." + end + @name = name + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["ok", "failed"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Custom attribute writer method with validation + # @param [Object] duration_ms Value to be assigned + def duration_ms=(duration_ms) + if duration_ms.nil? + fail ArgumentError, 'duration_ms cannot be nil' + end + + if duration_ms < 0 + fail ArgumentError, 'invalid value for "duration_ms", must be greater than or equal to 0.' + end + + @duration_ms = duration_ms + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + status == o.status && + duration_ms == o.duration_ms + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, status, duration_ms].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OpenapiClient.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/generated/activitysmith_openapi/models/health_response.rb b/generated/activitysmith_openapi/models/health_response.rb new file mode 100644 index 0000000..7646cc9 --- /dev/null +++ b/generated/activitysmith_openapi/models/health_response.rb @@ -0,0 +1,271 @@ +=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 'date' +require 'time' + +module OpenapiClient + class HealthResponse + attr_accessor :ok + + attr_accessor :service + + attr_accessor :timestamp + + attr_accessor :checks + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ok' => :'ok', + :'service' => :'service', + :'timestamp' => :'timestamp', + :'checks' => :'checks' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ok' => :'Boolean', + :'service' => :'String', + :'timestamp' => :'Time', + :'checks' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::HealthResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::HealthResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ok') + self.ok = attributes[:'ok'] + else + self.ok = nil + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + else + self.service = nil + end + + if attributes.key?(:'timestamp') + self.timestamp = attributes[:'timestamp'] + else + self.timestamp = nil + end + + if attributes.key?(:'checks') + if (value = attributes[:'checks']).is_a?(Array) + self.checks = value + end + else + self.checks = nil + 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 + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @ok.nil? + invalid_properties.push('invalid value for "ok", ok cannot be nil.') + end + + if @service.nil? + invalid_properties.push('invalid value for "service", service cannot be nil.') + end + + if @timestamp.nil? + invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.') + end + + if @checks.nil? + invalid_properties.push('invalid value for "checks", checks cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @ok.nil? + return false if @service.nil? + return false if @timestamp.nil? + return false if @checks.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ok == o.ok && + service == o.service && + timestamp == o.timestamp && + checks == o.checks + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ok, service, timestamp, checks].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OpenapiClient.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/generated/activitysmith_openapi/models/live_activity_end_request.rb b/generated/activitysmith_openapi/models/live_activity_end_request.rb index 40b43c2..d8877d0 100644 --- a/generated/activitysmith_openapi/models/live_activity_end_request.rb +++ b/generated/activitysmith_openapi/models/live_activity_end_request.rb @@ -16,8 +16,14 @@ module OpenapiClient # End an existing Live Activity by activity_id. class LiveActivityEndRequest + # Additional information shown in notification and Live Activity details in ActivitySmith. Not displayed in the Push Notification or Live Activity on the device. Values must be strings, finite numbers, or booleans. At most 50 entries and 16 KB of serialized UTF-8 JSON. Omit on updates to preserve existing Metadata; send {} to clear it. + attr_accessor :metadata + attr_accessor :activity_id + # Tags for notification history. Omit to keep existing Tags, supply an array to replace them, or send an empty array to clear them. + attr_accessor :tags + attr_accessor :content_state attr_accessor :action @@ -28,7 +34,9 @@ class LiveActivityEndRequest # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'metadata' => :'metadata', :'activity_id' => :'activity_id', + :'tags' => :'tags', :'content_state' => :'content_state', :'action' => :'action', :'secondary_action' => :'secondary_action' @@ -43,7 +51,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'metadata' => :'Hash', :'activity_id' => :'String', + :'tags' => :'Array', :'content_state' => :'ContentStateEnd', :'action' => :'LiveActivityAction', :'secondary_action' => :'LiveActivityAction' @@ -71,12 +81,24 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'metadata') + if (value = attributes[:'metadata']).is_a?(Hash) + self.metadata = value + end + end + if attributes.key?(:'activity_id') self.activity_id = attributes[:'activity_id'] else self.activity_id = nil end + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + if attributes.key?(:'content_state') self.content_state = attributes[:'content_state'] else @@ -97,10 +119,18 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if !@metadata.nil? && @metadata.length > 50 + invalid_properties.push('invalid value for "metadata", number of items must be less than or equal to 50.') + end + if @activity_id.nil? invalid_properties.push('invalid value for "activity_id", activity_id cannot be nil.') end + if !@tags.nil? && @tags.length > 20 + invalid_properties.push('invalid value for "tags", number of items must be less than or equal to 20.') + end + if @content_state.nil? invalid_properties.push('invalid value for "content_state", content_state cannot be nil.') end @@ -112,17 +142,49 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if !@metadata.nil? && @metadata.length > 50 return false if @activity_id.nil? + return false if !@tags.nil? && @tags.length > 20 return false if @content_state.nil? true end + # Custom attribute writer method with validation + # @param [Object] metadata Value to be assigned + def metadata=(metadata) + if metadata.nil? + fail ArgumentError, 'metadata cannot be nil' + end + + if metadata.length > 50 + fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 50.' + end + + @metadata = metadata + end + + # Custom attribute writer method with validation + # @param [Object] tags Value to be assigned + def tags=(tags) + if tags.nil? + fail ArgumentError, 'tags cannot be nil' + end + + if tags.length > 20 + fail ArgumentError, 'invalid value for "tags", number of items must be less than or equal to 20.' + end + + @tags = tags + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && + metadata == o.metadata && activity_id == o.activity_id && + tags == o.tags && content_state == o.content_state && action == o.action && secondary_action == o.secondary_action @@ -137,7 +199,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [activity_id, content_state, action, secondary_action].hash + [metadata, activity_id, tags, content_state, action, secondary_action].hash end # Builds the object from hash diff --git a/generated/activitysmith_openapi/models/live_activity_limit_error.rb b/generated/activitysmith_openapi/models/live_activity_limit_error.rb index c10f24d..52f964c 100644 --- a/generated/activitysmith_openapi/models/live_activity_limit_error.rb +++ b/generated/activitysmith_openapi/models/live_activity_limit_error.rb @@ -21,16 +21,24 @@ class LiveActivityLimitError attr_accessor :limit - # Current number of active Live Activities. + # Highest number of active Live Activities among the targeted devices. attr_accessor :active + # Number of targeted devices that have reached the enforced iOS Live Activity concurrency threshold. Included only when targeted devices have mixed capacity. + attr_accessor :blocked_devices + + # Total number of targeted devices. Included only when targeted devices have mixed capacity. + attr_accessor :targeted_devices + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'error' => :'error', :'message' => :'message', :'limit' => :'limit', - :'active' => :'active' + :'active' => :'active', + :'blocked_devices' => :'blocked_devices', + :'targeted_devices' => :'targeted_devices' } end @@ -45,7 +53,9 @@ def self.openapi_types :'error' => :'String', :'message' => :'String', :'limit' => :'Integer', - :'active' => :'Integer' + :'active' => :'Integer', + :'blocked_devices' => :'Integer', + :'targeted_devices' => :'Integer' } end @@ -93,6 +103,14 @@ def initialize(attributes = {}) else self.active = nil end + + if attributes.key?(:'blocked_devices') + self.blocked_devices = attributes[:'blocked_devices'] + end + + if attributes.key?(:'targeted_devices') + self.targeted_devices = attributes[:'targeted_devices'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -138,7 +156,9 @@ def ==(o) error == o.error && message == o.message && limit == o.limit && - active == o.active + active == o.active && + blocked_devices == o.blocked_devices && + targeted_devices == o.targeted_devices end # @see the `==` method @@ -150,7 +170,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [error, message, limit, active].hash + [error, message, limit, active, blocked_devices, targeted_devices].hash end # Builds the object from hash diff --git a/generated/activitysmith_openapi/models/live_activity_start_request.rb b/generated/activitysmith_openapi/models/live_activity_start_request.rb index 7297a28..135006f 100644 --- a/generated/activitysmith_openapi/models/live_activity_start_request.rb +++ b/generated/activitysmith_openapi/models/live_activity_start_request.rb @@ -16,6 +16,9 @@ module OpenapiClient # Start a new Live Activity. The response includes activity_id for later update and end calls. class LiveActivityStartRequest + # Additional information shown in notification and Live Activity details in ActivitySmith. Not displayed in the Push Notification or Live Activity on the device. Values must be strings, finite numbers, or booleans. At most 50 entries and 16 KB of serialized UTF-8 JSON. Omit on updates to preserve existing Metadata; send {} to clear it. + attr_accessor :metadata + attr_accessor :content_state attr_accessor :action @@ -33,6 +36,7 @@ class LiveActivityStartRequest # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'metadata' => :'metadata', :'content_state' => :'content_state', :'action' => :'action', :'secondary_action' => :'secondary_action', @@ -50,6 +54,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'metadata' => :'Hash', :'content_state' => :'ContentStateStart', :'action' => :'LiveActivityAction', :'secondary_action' => :'LiveActivityAction', @@ -80,6 +85,12 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'metadata') + if (value = attributes[:'metadata']).is_a?(Hash) + self.metadata = value + end + end + if attributes.key?(:'content_state') self.content_state = attributes[:'content_state'] else @@ -114,6 +125,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if !@metadata.nil? && @metadata.length > 50 + invalid_properties.push('invalid value for "metadata", number of items must be less than or equal to 50.') + end + if @content_state.nil? invalid_properties.push('invalid value for "content_state", content_state cannot be nil.') end @@ -125,15 +140,31 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if !@metadata.nil? && @metadata.length > 50 return false if @content_state.nil? true end + # Custom attribute writer method with validation + # @param [Object] metadata Value to be assigned + def metadata=(metadata) + if metadata.nil? + fail ArgumentError, 'metadata cannot be nil' + end + + if metadata.length > 50 + fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 50.' + end + + @metadata = metadata + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && + metadata == o.metadata && content_state == o.content_state && action == o.action && secondary_action == o.secondary_action && @@ -151,7 +182,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [content_state, action, secondary_action, alert, target, tags].hash + [metadata, content_state, action, secondary_action, alert, target, tags].hash end # Builds the object from hash diff --git a/generated/activitysmith_openapi/models/live_activity_stream_delete_request.rb b/generated/activitysmith_openapi/models/live_activity_stream_delete_request.rb index 97f1dd2..0cb5d09 100644 --- a/generated/activitysmith_openapi/models/live_activity_stream_delete_request.rb +++ b/generated/activitysmith_openapi/models/live_activity_stream_delete_request.rb @@ -16,6 +16,12 @@ module OpenapiClient # Optional payload for ending a managed stream. When omitted, ActivitySmith ends the stream using the latest known state when possible. class LiveActivityStreamDeleteRequest + # Additional information shown in notification and Live Activity details in ActivitySmith. Not displayed in the Push Notification or Live Activity on the device. Values must be strings, finite numbers, or booleans. At most 50 entries and 16 KB of serialized UTF-8 JSON. Omit on updates to preserve existing Metadata; send {} to clear it. + attr_accessor :metadata + + # Optional tags to organize and filter notification history. + attr_accessor :tags + attr_accessor :content_state attr_accessor :action @@ -28,6 +34,8 @@ class LiveActivityStreamDeleteRequest # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'metadata' => :'metadata', + :'tags' => :'tags', :'content_state' => :'content_state', :'action' => :'action', :'secondary_action' => :'secondary_action', @@ -43,6 +51,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'metadata' => :'Hash', + :'tags' => :'Array', :'content_state' => :'StreamContentState', :'action' => :'LiveActivityAction', :'secondary_action' => :'LiveActivityAction', @@ -71,6 +81,18 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'metadata') + if (value = attributes[:'metadata']).is_a?(Hash) + self.metadata = value + end + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + if attributes.key?(:'content_state') self.content_state = attributes[:'content_state'] end @@ -93,6 +115,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if !@metadata.nil? && @metadata.length > 50 + invalid_properties.push('invalid value for "metadata", number of items must be less than or equal to 50.') + end + invalid_properties end @@ -100,14 +126,31 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if !@metadata.nil? && @metadata.length > 50 true end + # Custom attribute writer method with validation + # @param [Object] metadata Value to be assigned + def metadata=(metadata) + if metadata.nil? + fail ArgumentError, 'metadata cannot be nil' + end + + if metadata.length > 50 + fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 50.' + end + + @metadata = metadata + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && + metadata == o.metadata && + tags == o.tags && content_state == o.content_state && action == o.action && secondary_action == o.secondary_action && @@ -123,7 +166,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [content_state, action, secondary_action, alert].hash + [metadata, tags, content_state, action, secondary_action, alert].hash end # Builds the object from hash diff --git a/generated/activitysmith_openapi/models/live_activity_stream_request.rb b/generated/activitysmith_openapi/models/live_activity_stream_request.rb index d2581d7..0253e2b 100644 --- a/generated/activitysmith_openapi/models/live_activity_stream_request.rb +++ b/generated/activitysmith_openapi/models/live_activity_stream_request.rb @@ -16,6 +16,9 @@ module OpenapiClient # Send the latest state for a managed Live Activity stream. channels is the streamlined form for stream targeting. target.channels is also accepted for compatibility. If both are provided, they must match. class LiveActivityStreamRequest + # Additional information shown in notification and Live Activity details in ActivitySmith. Not displayed in the Push Notification or Live Activity on the device. Values must be strings, finite numbers, or booleans. At most 50 entries and 16 KB of serialized UTF-8 JSON. Omit on updates to preserve existing Metadata; send {} to clear it. + attr_accessor :metadata + attr_accessor :content_state attr_accessor :action @@ -36,6 +39,7 @@ class LiveActivityStreamRequest # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'metadata' => :'metadata', :'content_state' => :'content_state', :'action' => :'action', :'secondary_action' => :'secondary_action', @@ -54,6 +58,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'metadata' => :'Hash', :'content_state' => :'StreamContentState', :'action' => :'LiveActivityAction', :'secondary_action' => :'LiveActivityAction', @@ -85,6 +90,12 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'metadata') + if (value = attributes[:'metadata']).is_a?(Hash) + self.metadata = value + end + end + if attributes.key?(:'content_state') self.content_state = attributes[:'content_state'] else @@ -125,6 +136,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if !@metadata.nil? && @metadata.length > 50 + invalid_properties.push('invalid value for "metadata", number of items must be less than or equal to 50.') + end + if @content_state.nil? invalid_properties.push('invalid value for "content_state", content_state cannot be nil.') end @@ -140,11 +155,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if !@metadata.nil? && @metadata.length > 50 return false if @content_state.nil? return false if !@channels.nil? && @channels.length < 1 true end + # Custom attribute writer method with validation + # @param [Object] metadata Value to be assigned + def metadata=(metadata) + if metadata.nil? + fail ArgumentError, 'metadata cannot be nil' + end + + if metadata.length > 50 + fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 50.' + end + + @metadata = metadata + end + # Custom attribute writer method with validation # @param [Object] channels Value to be assigned def channels=(channels) @@ -164,6 +194,7 @@ def channels=(channels) def ==(o) return true if self.equal?(o) self.class == o.class && + metadata == o.metadata && content_state == o.content_state && action == o.action && secondary_action == o.secondary_action && @@ -182,7 +213,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [content_state, action, secondary_action, alert, channels, target, tags].hash + [metadata, content_state, action, secondary_action, alert, channels, target, tags].hash end # Builds the object from hash diff --git a/generated/activitysmith_openapi/models/live_activity_update_request.rb b/generated/activitysmith_openapi/models/live_activity_update_request.rb index b952430..ae174e2 100644 --- a/generated/activitysmith_openapi/models/live_activity_update_request.rb +++ b/generated/activitysmith_openapi/models/live_activity_update_request.rb @@ -16,8 +16,14 @@ module OpenapiClient # Update an existing Live Activity by activity_id. class LiveActivityUpdateRequest + # Additional information shown in notification and Live Activity details in ActivitySmith. Not displayed in the Push Notification or Live Activity on the device. Values must be strings, finite numbers, or booleans. At most 50 entries and 16 KB of serialized UTF-8 JSON. Omit on updates to preserve existing Metadata; send {} to clear it. + attr_accessor :metadata + attr_accessor :activity_id + # Tags for notification history. Omit to keep existing Tags, supply an array to replace them, or send an empty array to clear them. + attr_accessor :tags + attr_accessor :content_state attr_accessor :action @@ -28,7 +34,9 @@ class LiveActivityUpdateRequest # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'metadata' => :'metadata', :'activity_id' => :'activity_id', + :'tags' => :'tags', :'content_state' => :'content_state', :'action' => :'action', :'secondary_action' => :'secondary_action' @@ -43,7 +51,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'metadata' => :'Hash', :'activity_id' => :'String', + :'tags' => :'Array', :'content_state' => :'ContentStateUpdate', :'action' => :'LiveActivityAction', :'secondary_action' => :'LiveActivityAction' @@ -71,12 +81,24 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'metadata') + if (value = attributes[:'metadata']).is_a?(Hash) + self.metadata = value + end + end + if attributes.key?(:'activity_id') self.activity_id = attributes[:'activity_id'] else self.activity_id = nil end + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + if attributes.key?(:'content_state') self.content_state = attributes[:'content_state'] else @@ -97,10 +119,18 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if !@metadata.nil? && @metadata.length > 50 + invalid_properties.push('invalid value for "metadata", number of items must be less than or equal to 50.') + end + if @activity_id.nil? invalid_properties.push('invalid value for "activity_id", activity_id cannot be nil.') end + if !@tags.nil? && @tags.length > 20 + invalid_properties.push('invalid value for "tags", number of items must be less than or equal to 20.') + end + if @content_state.nil? invalid_properties.push('invalid value for "content_state", content_state cannot be nil.') end @@ -112,17 +142,49 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if !@metadata.nil? && @metadata.length > 50 return false if @activity_id.nil? + return false if !@tags.nil? && @tags.length > 20 return false if @content_state.nil? true end + # Custom attribute writer method with validation + # @param [Object] metadata Value to be assigned + def metadata=(metadata) + if metadata.nil? + fail ArgumentError, 'metadata cannot be nil' + end + + if metadata.length > 50 + fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 50.' + end + + @metadata = metadata + end + + # Custom attribute writer method with validation + # @param [Object] tags Value to be assigned + def tags=(tags) + if tags.nil? + fail ArgumentError, 'tags cannot be nil' + end + + if tags.length > 20 + fail ArgumentError, 'invalid value for "tags", number of items must be less than or equal to 20.' + end + + @tags = tags + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && + metadata == o.metadata && activity_id == o.activity_id && + tags == o.tags && content_state == o.content_state && action == o.action && secondary_action == o.secondary_action @@ -137,7 +199,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [activity_id, content_state, action, secondary_action].hash + [metadata, activity_id, tags, content_state, action, secondary_action].hash end # Builds the object from hash diff --git a/generated/activitysmith_openapi/models/metadata_value.rb b/generated/activitysmith_openapi/models/metadata_value.rb new file mode 100644 index 0000000..289024c --- /dev/null +++ b/generated/activitysmith_openapi/models/metadata_value.rb @@ -0,0 +1,106 @@ +=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 'date' +require 'time' + +module OpenapiClient + module MetadataValue + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Boolean', + :'Float', + :'String' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = OpenapiClient.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/generated/activitysmith_openapi/models/push_notification_action.rb b/generated/activitysmith_openapi/models/push_notification_action.rb index d29eb66..a3dd68d 100644 --- a/generated/activitysmith_openapi/models/push_notification_action.rb +++ b/generated/activitysmith_openapi/models/push_notification_action.rb @@ -20,7 +20,7 @@ class PushNotificationAction attr_accessor :type - # Action URL. For open_url, use an HTTP or HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend. + # Action URL. For open_url, use HTTP, HTTPS, Shortcuts, or an installed app’s custom URL scheme, such as spotify:// or spotify:track:123. Custom app schemes require iOS 1.13.4 build 2 or later; no web fallback is provided. Internal and executable schemes are blocked. For webhook, use an HTTPS URL called by the ActivitySmith backend. attr_accessor :url # Webhook HTTP method. Used only when type=webhook. diff --git a/generated/activitysmith_openapi/models/push_notification_request.rb b/generated/activitysmith_openapi/models/push_notification_request.rb index cfba9e2..e500e93 100644 --- a/generated/activitysmith_openapi/models/push_notification_request.rb +++ b/generated/activitysmith_openapi/models/push_notification_request.rb @@ -15,6 +15,9 @@ module OpenapiClient class PushNotificationRequest + # Additional information shown in notification and Live Activity details in ActivitySmith. Not displayed in the Push Notification or Live Activity on the device. Values must be strings, finite numbers, or booleans. At most 50 entries and 16 KB of serialized UTF-8 JSON. Omit on updates to preserve existing Metadata; send {} to clear it. + attr_accessor :metadata + attr_accessor :title attr_accessor :message @@ -24,7 +27,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 HTTP URL, HTTPS URL, or shortcuts://run-shortcut?name=... URL opened when the user taps the notification body. Use shortcuts://run-shortcut?name=... to run a specific iPhone Shortcut that already exists on the user's device. Overrides the default tap target from `media` when both are provided. + # Optional HTTP, HTTPS, Shortcuts, or installed app URL opened when the user taps the notification body. Custom schemes such as spotify:// and spotify:track:123 require iOS 1.13.4 build 2 or later and an installed handler; no web fallback is provided. Internal and executable schemes are blocked. Overrides the default tap target from media. attr_accessor :redirection # Optional interactive actions shown when users expand the notification. Cannot be combined with `media`. @@ -44,6 +47,7 @@ class PushNotificationRequest # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'metadata' => :'metadata', :'title' => :'title', :'message' => :'message', :'subtitle' => :'subtitle', @@ -66,6 +70,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'metadata' => :'Hash', :'title' => :'String', :'message' => :'String', :'subtitle' => :'String', @@ -101,6 +106,12 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'metadata') + if (value = attributes[:'metadata']).is_a?(Hash) + self.metadata = value + end + end + if attributes.key?(:'title') self.title = attributes[:'title'] else @@ -157,6 +168,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if !@metadata.nil? && @metadata.length > 50 + invalid_properties.push('invalid value for "metadata", number of items must be less than or equal to 50.') + end + if @title.nil? invalid_properties.push('invalid value for "title", title cannot be nil.') end @@ -166,7 +181,11 @@ def list_invalid_properties invalid_properties.push("invalid value for \"media\", must conform to the pattern #{pattern}.") end - pattern = Regexp.new(/^(http|https|shortcuts):\/\//) + if !@redirection.nil? && @redirection.to_s.length > 2048 + invalid_properties.push('invalid value for "redirection", the character length must be smaller than or equal to 2048.') + end + + pattern = Regexp.new(/^[A-Za-z][A-Za-z0-9+.-]*:/) if !@redirection.nil? && @redirection !~ pattern invalid_properties.push("invalid value for \"redirection\", must conform to the pattern #{pattern}.") end @@ -182,13 +201,29 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if !@metadata.nil? && @metadata.length > 50 return false if @title.nil? return false if !@media.nil? && @media !~ Regexp.new(/^https:\/\//) - return false if !@redirection.nil? && @redirection !~ Regexp.new(/^(http|https|shortcuts):\/\//) + return false if !@redirection.nil? && @redirection.to_s.length > 2048 + return false if !@redirection.nil? && @redirection !~ Regexp.new(/^[A-Za-z][A-Za-z0-9+.-]*:/) return false if !@actions.nil? && @actions.length > 4 true end + # Custom attribute writer method with validation + # @param [Object] metadata Value to be assigned + def metadata=(metadata) + if metadata.nil? + fail ArgumentError, 'metadata cannot be nil' + end + + if metadata.length > 50 + fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 50.' + end + + @metadata = metadata + end + # Custom attribute writer method with validation # @param [Object] media Value to be assigned def media=(media) @@ -211,7 +246,11 @@ def redirection=(redirection) fail ArgumentError, 'redirection cannot be nil' end - pattern = Regexp.new(/^(http|https|shortcuts):\/\//) + if redirection.to_s.length > 2048 + fail ArgumentError, 'invalid value for "redirection", the character length must be smaller than or equal to 2048.' + end + + pattern = Regexp.new(/^[A-Za-z][A-Za-z0-9+.-]*:/) if redirection !~ pattern fail ArgumentError, "invalid value for \"redirection\", must conform to the pattern #{pattern}." end @@ -238,6 +277,7 @@ def actions=(actions) def ==(o) return true if self.equal?(o) self.class == o.class && + metadata == o.metadata && title == o.title && message == o.message && subtitle == o.subtitle && @@ -260,7 +300,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [title, message, subtitle, media, redirection, actions, payload, badge, sound, target, tags].hash + [metadata, title, message, subtitle, media, redirection, actions, payload, badge, sound, target, tags].hash end # Builds the object from hash diff --git a/generated/activitysmith_openapi/models/update_app_icon_badge_count422_response.rb b/generated/activitysmith_openapi/models/update_app_icon_badge_count422_response.rb new file mode 100644 index 0000000..3cba603 --- /dev/null +++ b/generated/activitysmith_openapi/models/update_app_icon_badge_count422_response.rb @@ -0,0 +1,105 @@ +=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 'date' +require 'time' + +module OpenapiClient + module UpdateAppIconBadgeCount422Response + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'AppIconBadgeCountUpdateError', + :'NoRecipientsError' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = OpenapiClient.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/generated/openapi-source.json b/generated/openapi-source.json new file mode 100644 index 0000000..5a616d3 --- /dev/null +++ b/generated/openapi-source.json @@ -0,0 +1,6 @@ +{ + "repository": "ActivitySmithHQ/activitysmith-backend", + "commit": "3cd1df5f1296777bacfad731eac9f91d27d01c6e", + "path": "openapi.json", + "sha256": "e112ddb9a069dc0ad87a123d0be1286ff0a671da505fabfdf4bb94ff6bcb444f" +} From 189cb260c64f9fa0a2548cd50dd90390a8e26d4c Mon Sep 17 00:00:00 2001 From: bardonadam Date: Tue, 15 Sep 2026 19:55:10 +0700 Subject: [PATCH 02/11] feat: prepare ruby SDK metadata and documentation updates Preserve native metadata values and clearing semantics, extend legacy and stream-end history fields, and align the README with the pending SDK documentation. Package versions remain unchanged; release requires separate approval. Verification: local SDK tests passed against the regenerated contract; README code-fence preservation check passed. Initiated-by: user Implemented-by: codex --- CHANGELOG.md | 8 + README.md | 430 ++++++++++++--------------- lib/activitysmith/live_activities.rb | 12 +- test/resources_test.rb | 63 ++++ 4 files changed, 274 insertions(+), 239 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0118f44..c8e3d1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## Unreleased + +- Support Push Notification app deep links and final Tags/Metadata when ending a managed Live Activity stream. + +- Add Metadata to Push Notifications and Live Activity start, update, end, and stream requests, including empty-object clearing. + +- Add Tags replacement and empty-array clearing to legacy Live Activity update and end. + ## 1.10.0 ### New Features diff --git a/README.md b/README.md index f2aefbb..007288d 100644 --- a/README.md +++ b/README.md @@ -1,51 +1,35 @@ # ActivitySmith Ruby SDK -The ActivitySmith Ruby SDK provides convenient access to the ActivitySmith API from Ruby applications. - -## Documentation - -See [API reference](https://activitysmith.com/docs/api-reference/introduction). - -## Table of Contents - -- [Installation](#installation) -- [Setup](#setup) -- [Push Notifications](#push-notifications) - - [Send a Push Notification](#send-a-push-notification) - - [Rich Push Notifications with Media](#rich-push-notifications-with-media) - - [Actionable Push Notifications](#actionable-push-notifications) -- [Live Activities](#live-activities) - - [Start & Update Live Activity](#start--update-live-activity) - - [End Live Activity](#end-live-activity) - - [Live Activity Action](#live-activity-action) - - [Icons and Badges](#icons-and-badges) - - [Live Activity Colors](#live-activity-colors) -- [Widgets](#widgets) -- [App Icon Badge Count](#app-icon-badge-count) -- [Channels](#channels) -- [Tags](#tags) +[Documentation](https://activitysmith.com/docs/sdks/ruby) ## Installation -```sh +Install the ActivitySmith Ruby SDK with RubyGems: + +```bash gem install activitysmith ``` -## Setup +## Quickstart + +1. [Create an API key](https://activitysmith.com/app/keys) +2. Set `ACTIVITYSMITH_API_KEY` or pass it directly to `ActivitySmith::Client`. ```ruby require "activitysmith" -activitysmith = ActivitySmith::Client.new(api_key: ENV.fetch("ACTIVITYSMITH_API_KEY")) +activitysmith = ActivitySmith::Client.new( + api_key: ENV["ACTIVITYSMITH_API_KEY"] +) ``` ## Push Notifications ### Send a Push Notification -

- Push notification example -

+Send an immediate notification for a completed task or event. + +![Push Notification example for a new subscription event](https://cdn.activitysmith.com/features/new-subscription-push-notification.png) ```ruby activitysmith.notifications.send( @@ -58,26 +42,21 @@ activitysmith.notifications.send( ### Rich Push Notifications with Media -

- Rich push notification with image -

+![Rich Push Notification with image](https://cdn.activitysmith.com/features/rich-push-notification-with-image.png) ```ruby activitysmith.notifications.send( { title: "Homepage ready", message: "Your agent finished the redesign.", - media: "https://cdn.example.com/output/homepage-v2.png", - redirection: "https://github.com/acme/web/pull/482" + media: "https://cdn.example.com/output/homepage-v2.png" } ) ``` -Send images, videos, or audio with your push notifications, press and hold to preview media directly from the notification, then tap through to open the linked content. +Attach images, videos, or audio to your Push Notifications. Press and hold the notification to preview the media. -

- Rich push notification with audio -

+![Rich Push Notification with audio](https://cdn.activitysmith.com/features/rich-push-notification-with-audio.png) What will work: @@ -86,24 +65,36 @@ What will work: - direct video file URL: `.mp4`, `.mov`, etc. - URL that responds with a proper media `Content-Type`, even if the path has no extension +`media` cannot be combined with `actions`. + +### Push Notifications with Redirection + +Open a web page, an iPhone Shortcut, or an installed app when someone taps the notification. Set `redirection` to an HTTP, HTTPS, or Shortcuts URL, or an app deep link such as `spotify:track:123`. + +```ruby +activitysmith.notifications.send( + { + title: "Homepage ready", + message: "Your agent finished the redesign.", + redirection: "https://github.com/acme/web/pull/482" + } +) +``` + ### Actionable Push Notifications -

- Actionable push notification example -

+![Actionable Push Notification with redirection and actions](https://cdn.activitysmith.com/features/actionable-push-notifications-2.png) -Push notification `redirection` and `actions` are optional. Use them to open HTTPS URLs, run a specific iPhone Shortcut with `shortcuts://run-shortcut?name=...`, or trigger backend webhook workflows. -Webhooks are executed by the ActivitySmith backend. +For expanded notification actions, `open_url` supports HTTP, HTTPS, Shortcuts, and installed app deep links. Webhooks are executed by the ActivitySmith backend and must use HTTPS. Custom app links require iOS 1.13.4 build 2 or later and an installed app that handles the URL. ```ruby activitysmith.notifications.send( { title: "New subscription 💸", message: "Customer upgraded to Pro plan", - redirection: "https://crm.example.com/customers/cus_9f3a1d", # Optional - actions: [ # Optional (max 4) + actions: [ { - title: "Open CRM Profile", + title: "Open CRM", type: "open_url", url: "https://crm.example.com/customers/cus_9f3a1d" }, @@ -129,14 +120,19 @@ activitysmith.notifications.send( ## Live Activities -There are six types of Live Activities: +Choose the Live Activity type that matches what you want to show: + +- ![Stats Live Activity with six labeled sales metrics](https://cdn.activitysmith.com/features/stats-live-activity.png) **Stats**: Show up to 8 labeled values on your Lock Screen, from revenue and orders to uptime and conversion. -- `stats`: best for showing business numbers side by side, such as revenue, sales, new users, conversion, refunds, or any other value you want visible at a glance -- `metrics`: best for live percentage values that change often, like server CPU, memory usage, disk usage, or error rate -- `segmented_progress`: best for anything that moves through clear stages, like deployments, onboarding flows, backups, ETL pipelines, migrations, and AI agent runs -- `progress`: best for tracking real-time progress with percentage, like tasks, backups, migrations, syncs, or uploads -- `alert`: best for status updates, such as feature adoption, reactivation, onboarding blockers, incidents, escalations, and other operational states -- `timer`: best for countdowns and elapsed runtime, like benchmark runs, uploads, backups, transcodes, and long-running jobs +- ![Metrics Live Activity with CPU and memory values](https://cdn.activitysmith.com/features/metrics-live-activity-start.png) **Metrics**: Track two related values with segmented bars, such as CPU and memory. + +- ![Segmented Progress Live Activity showing a workflow step](https://cdn.activitysmith.com/features/update-live-activity.png) **Segmented Progress**: Show progress through a known set of steps, like build, test, deploy, and verify. + +- ![Progress Live Activity showing percentage completion](https://cdn.activitysmith.com/features/progress-live-activity.png) **Progress**: Show percentage progress for jobs that move continuously toward completion. + +- ![Alert Live Activity showing a customer reactivation update](https://cdn.activitysmith.com/features/alert-live-activity.png) **Alert**: Show status updates with a clear message, badge, and icon. When you add an action button, `color` controls the button tint. + +- ![Timer Live Activity showing a benchmark run countdown](https://cdn.activitysmith.com/features/timer-live-activity.png) **Timer**: Count down from a duration, or count up from 00:00 while a job runs. ### Start & Update Live Activity @@ -144,13 +140,7 @@ Use a stable `stream_key` to identify the metric, job, deployment, or system you #### Stats -

- Stats Live Activity stream example -

+![Stats Live Activity stream example](https://cdn.activitysmith.com/features/stats-live-activity.png) ```ruby activitysmith.live_activities.stream( @@ -175,13 +165,7 @@ activitysmith.live_activities.stream( #### Metrics -

- Metrics Live Activity stream example -

+![Metrics Live Activity stream example](https://cdn.activitysmith.com/features/metrics-live-activity-start.png) ```ruby activitysmith.live_activities.stream( @@ -202,13 +186,7 @@ activitysmith.live_activities.stream( #### Segmented Progress -

- Segmented Progress Live Activity stream example -

+![Segmented Progress Live Activity stream example](https://cdn.activitysmith.com/features/update-live-activity.png) ```ruby activitysmith.live_activities.stream( @@ -227,13 +205,7 @@ activitysmith.live_activities.stream( #### Progress -

- Progress Live Activity stream example -

+![Progress Live Activity stream example](https://cdn.activitysmith.com/features/progress-live-activity.png) ```ruby activitysmith.live_activities.stream( @@ -251,13 +223,7 @@ activitysmith.live_activities.stream( #### Alert -

- Alert Live Activity stream example -

+![Alert Live Activity stream example](https://cdn.activitysmith.com/features/alert-live-activity.png) ```ruby activitysmith.live_activities.stream( @@ -276,13 +242,7 @@ activitysmith.live_activities.stream( #### Timer -

- Timer Live Activity showing a benchmark run countdown -

+![Timer Live Activity stream example](https://cdn.activitysmith.com/features/timer-live-activity.png) ```ruby activitysmith.live_activities.stream( @@ -305,7 +265,7 @@ To start at 00:00 and count up, set `counts_down: false` and leave out `duration ### End Live Activity -Call `end_stream(...)` with the same `stream_key` to dismiss the Live Activity. You can include final values before it is removed. By default, iOS removes the Live Activity after two minutes. Set `auto_dismiss_minutes` to choose a different dismissal time, including `0` for immediate dismissal. +Call `end_stream(...)` with the same `stream_key` to dismiss the Live Activity. You can include final values before it is removed. Set `auto_dismiss_seconds` to dismiss it after a delay in seconds, or `auto_dismiss_minutes` for minutes. Use `0` for immediate dismissal. Seconds take precedence if both are set. ```ruby activitysmith.live_activities.end_stream( @@ -319,28 +279,83 @@ activitysmith.live_activities.end_stream( { label: "CPU", value: 7, unit: "%" }, { label: "MEM", value: 38, unit: "%" } ], - auto_dismiss_minutes: 2 + auto_dismiss_seconds: 30 } } ) ``` +### Icons and Badges + +Add more context to Live Activities with icons and badges. + +#### Icon + +Supported Live Activity types: `stats`, `metrics`, `progress`, `segmented_progress`, `alert`, and `timer`. + +![Metrics Live Activity with an SF Symbol icon on the iPhone Lock Screen](https://cdn.activitysmith.com/features/metrics-live-activity-with-icon.png) + +```ruby +activitysmith.live_activities.stream( + "prod-web-1", + { + content_state: ActivitySmith::LiveActivities.content_state( + title: "Server Health", + subtitle: "prod-web-1", + type: "metrics", + icon: ActivitySmith::LiveActivities.alert_icon("server.rack", color: "blue"), + metrics: [ + { label: "CPU", value: 18, unit: "%" }, + { label: "MEM", value: 42, unit: "%" } + ] + ) + } +) +``` + +The `icon` symbol value is an Apple SF Symbol name. Browse the catalog with one of these tools: + +- [ActivitySmith app](https://apps.apple.com/us/app/activitysmith/id6752254835) - Open Settings -> SF Symbols to browse 45 hand-picked icons ready to use +- [SF Symbols](https://developer.apple.com/sf-symbols/) - Apple's official macOS app +- [Interactful](https://apps.apple.com/app/interactful/id1528095640) - free third-party iOS app listing all SF Symbols under Foundations -> Iconography + +#### Badge + +Badges are supported by `alert`, `progress`, and `segmented_progress` Live Activities. + +![Progress Live Activity with a badge on the iPhone Lock Screen](https://cdn.activitysmith.com/features/progress-live-activity-with-badge.png) + +```ruby +activitysmith.live_activities.stream( + "nightly-database-backup", + { + content_state: ActivitySmith::LiveActivities.content_state( + title: "Nightly Database Backup", + subtitle: "verify restore", + type: "progress", + badge: ActivitySmith::LiveActivities.alert_badge("S3", color: "cyan"), + percentage: 62 + ) + } +) +``` + +### Live Activity Colors + +Choose from these colors for the Live Activity accent, including progress bars and action buttons, or apply them to an individual icon or badge: + +`lime`, `green`, `cyan`, `blue`, `purple`, `magenta`, `red`, `orange`, `yellow`, `gray` + ### Live Activity Action +![Metrics Live Activity with action](https://cdn.activitysmith.com/features/metrics-live-activity-action.png) + Live Activities can include an action button. -- `open_url`: open an HTTPS URL. -- `open_url` with a `shortcuts://` URL: run an Apple Shortcut, for example to open an app. +- `open_url`: open an HTTP or HTTPS URL. +- `open_url` with a `shortcuts://run-shortcut?name=...` URL: run a specific iPhone Shortcut, for example to open an app. - `webhook`: trigger a backend GET/POST workflow. -

- Live Activity with action button -

- #### Open URL action ```ruby @@ -359,7 +374,7 @@ activitysmith.live_activities.stream( action: { title: "Dashboard", type: "open_url", - url: "https://ops.example.com/servers/prod-web-1" + url: "https://status.example.com/servers/prod-web-1" } } ) @@ -369,14 +384,16 @@ activitysmith.live_activities.stream( ```ruby activitysmith.live_activities.stream( - "deploy-payments-api", + "prod-web-1", { content_state: { - title: "Deploying payments-api", - subtitle: "Running database migrations", - type: "segmented_progress", - number_of_steps: 5, - current_step: 3 + title: "Server Health", + subtitle: "prod-web-1", + type: "metrics", + metrics: [ + { label: "CPU", value: 76, unit: "%" }, + { label: "MEM", value: 52, unit: "%" } + ] }, action: { title: "Chat with Jarvis", @@ -416,13 +433,7 @@ activitysmith.live_activities.stream( #### Secondary action -

- Alert Live Activity with primary and secondary action buttons -

+![Alert Live Activity with primary and secondary action buttons](https://cdn.activitysmith.com/features/live-activity-secondary-action.png) Use `secondary_action` when you want a second button beside the primary `action`. @@ -464,90 +475,15 @@ activitysmith.live_activities.stream( ) ``` -### Icons and Badges +## Lock Screen Widgets -Add more context to Live Activities with icons and badges. +![Lock screen widgets](https://cdn.activitysmith.com/features/lock-screen-widgets.png) -#### Icon +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](https://activitysmith.com/app/widgets), then update the metric value using our API, add a widget to your lock screen and it will fetch the latest update automatically. -Supported Live Activity types: `stats`, `metrics`, `progress`, `segmented_progress`, `alert`, and `timer`. +![Create widget metric](https://cdn.activitysmith.com/features/create-widget-metric.png) -

- Metrics Live Activity with an SF Symbol icon on the iPhone Lock Screen -

- -```ruby -activitysmith.live_activities.stream( - "prod-web-1", - { - content_state: ActivitySmith::LiveActivities.content_state( - title: "Server Health", - subtitle: "prod-web-1", - type: "metrics", - icon: ActivitySmith::LiveActivities.alert_icon("server.rack", color: "blue"), - metrics: [ - { label: "CPU", value: 18, unit: "%" }, - { label: "MEM", value: 42, unit: "%" } - ] - ) - } -) -``` - -The `icon` symbol value is an Apple SF Symbol name. Browse the catalog with one of these tools: - -- [ActivitySmith app](https://apps.apple.com/us/app/activitysmith/id6752254835) - Open Settings -> SF Symbols to browse 45 hand-picked icons ready to use -- [SF Symbols](https://developer.apple.com/sf-symbols/) - Apple's official macOS app -- [Interactful](https://apps.apple.com/app/interactful/id1528095640) - free third-party iOS app listing all SF Symbols under Foundations -> Iconography - -#### Badge - -Badges are supported by `alert`, `progress`, and `segmented_progress` Live Activities. - -

- Progress Live Activity with a badge on the iPhone Lock Screen -

- -```ruby -activitysmith.live_activities.stream( - "nightly-database-backup", - { - content_state: ActivitySmith::LiveActivities.content_state( - title: "Nightly Database Backup", - subtitle: "verify restore", - type: "progress", - badge: ActivitySmith::LiveActivities.alert_badge("S3", color: "cyan"), - percentage: 62 - ) - } -) -``` - -### Live Activity Colors - -Choose from these colors for the Live Activity accent, including progress bars and action buttons, or apply them to an individual icon or badge: - -`lime`, `green`, `cyan`, `blue`, `purple`, `magenta`, `red`, `orange`, `yellow`, `gray` - -## Widgets - -

- Lock screen widgets -

- -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. - -

- Create widget metric -

+Use the metric key to update its value. ```ruby activitysmith.metrics.update("deploy.success_rate", 99.9) @@ -561,92 +497,120 @@ activitysmith.metrics.update("prod.status", "healthy") ## App Icon Badge Count -

- ActivitySmith app icon with an App Icon Badge Count -

+![ActivitySmith app icon with an App Icon Badge Count](https://cdn.activitysmith.com/features/badge-count.png) Show the number you care about on your ActivitySmith app icon. Track MRR, a customer count, a stock price, or any other value you want to keep in view. -Set or update the badge value. +### Set or update the badge value ```ruby activitysmith.badge_count(8333) ``` -To clear the badge, set its value to 0. +### Clear the badge + +Pass `0` to clear the badge. ```ruby activitysmith.badge_count(0) ``` -## Channels - -Use `channels` to target specific team members or devices +## Tags -### Push Notifications +Use `tags` to organize and filter your Push Notification and Live Activity history. Tags are created automatically when you first use them. ```ruby activitysmith.notifications.send( { title: "New subscription 💸", message: "Customer upgraded to Pro plan", - channels: ["sales", "customer-success"] + tags: ["user:382", "billing"] } ) ``` -### Live Activities +On Live Activity stream updates and legacy `update` or `end` calls, omit `tags` to keep existing Tags, supply a list to replace them, or pass `tags: []` to clear them. ```ruby -activitysmith.live_activities.start( - { - content_state: { - title: "Nightly Database Backup", - subtitle: "verify restore", - type: "progress", - percentage: 62 - }, - channels: ["sales", "customer-success"] - } +activitysmith.live_activities.update( + activity_id: "YOUR_ACTIVITY_ID", + content_state: { title: "Customer Import", percentage: 60 }, + tags: [] ) ``` -### App Icon Badge Count +`end_stream` also accepts final Tags and Metadata. Omit them to preserve existing values, or supply empty collections to clear them. + +## Metadata + +Metadata adds information to Push Notification and Live Activity details in ActivitySmith. It does not appear in the notification or Live Activity on your device. ```ruby -activitysmith.badge_count(3, channels: ["sales", "customer-success"]) +activitysmith.notifications.send( + title: "New subscription 💸", + metadata: { customer_id: "382", plan: "Pro", amount: 29, trial: false } +) + +activitysmith.live_activities.stream( + "customer-import", + content_state: { title: "Customer Import", type: "progress", percentage: 60 }, + metadata: { job_id: "import-382", records: 1200 } +) ``` -## Tags +Supported on Push Notifications, Live Activity streams (including stream ending), and legacy `start`, `update`, and `end` calls. On updates or end calls, omit `metadata` to keep it, supply an object to replace it, or send `{}` to clear it. -Use `tags` to organize and filter your Push Notification and Live Activity history. Tags are created automatically when you first use them. +Values can be strings, numbers, or booleans. Metadata supports up to 50 entries and 16 KB of JSON, with keys up to 100 characters and strings up to 4,000 characters. Nested objects, arrays, and null values are not supported. + +## Channels + +Use `channels` to target specific team members or devices when sending Push Notifications, Live Activities, or App Icon Badge Count updates. Omit it for account-wide delivery. ```ruby activitysmith.notifications.send( { title: "New subscription 💸", message: "Customer upgraded to Pro plan", - tags: ["user:382", "billing"] + channels: ["sales", "customer-success"] + } +) + +activitysmith.live_activities.stream( + "nightly-backup", + { + channels: ["ios-builds"], + content_state: { + title: "Nightly database backup", + number_of_steps: 3, + current_step: 1, + type: "segmented_progress" + } } ) + +activitysmith.badge_count(3, channels: ["sales", "customer-success"]) ``` ## Error Handling +Handle API errors with `begin/rescue` around SDK calls: + ```ruby begin activitysmith.notifications.send( - { title: "New subscription 💸" } + { title: "Hello" } ) rescue OpenapiClient::ApiError => err puts "Request failed: #{err.code} #{err.message}" end ``` -## Requirements +## Additional Resources + +### [RubyGems Package](https://rubygems.org/gems/activitysmith) -- Ruby 3.0+ +Install the ActivitySmith Ruby SDK from RubyGems -## License +### [Source Code](https://github.com/ActivitySmithHQ/activitysmith-ruby) -MIT +View the Ruby SDK source on GitHub diff --git a/lib/activitysmith/live_activities.rb b/lib/activitysmith/live_activities.rb index 173ca9f..7a81805 100644 --- a/lib/activitysmith/live_activities.rb +++ b/lib/activitysmith/live_activities.rb @@ -47,12 +47,12 @@ def start(request = nil, opts = {}, tags: nil, **request_fields) ) end - def update(request, opts = {}) - @api.update_live_activity(normalize_live_activity_request(request), opts) + def update(request = nil, opts = {}, tags: nil, **request_fields) + @api.update_live_activity(normalize_live_activity_request(with_tags(combine_request(request, request_fields), tags)), opts) end - def end(request, opts = {}) - @api.end_live_activity(normalize_live_activity_request(request), opts) + def end(request = nil, opts = {}, tags: nil, **request_fields) + @api.end_live_activity(normalize_live_activity_request(with_tags(combine_request(request, request_fields), tags)), opts) end def stream(stream_key, request = nil, opts = {}, tags: nil, **request_fields) @@ -65,10 +65,10 @@ def stream(stream_key, request = nil, opts = {}, tags: nil, **request_fields) ) end - def end_stream(stream_key, request = nil, opts = {}) + def end_stream(stream_key, request = nil, opts = {}, tags: nil, **request_fields) @api.end_live_activity_stream( stream_key, - { live_activity_stream_delete_request: normalize_live_activity_request(request) }.merge(opts) + { live_activity_stream_delete_request: normalize_live_activity_request(with_tags(combine_request(request, request_fields), tags)) }.merge(opts) ) end diff --git a/test/resources_test.rb b/test/resources_test.rb index 31f4125..6409987 100644 --- a/test/resources_test.rb +++ b/test/resources_test.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require_relative "test_helper" +require "json" require File.expand_path("../generated/activitysmith_openapi/models/live_activity_action", __dir__) require File.expand_path("../generated/activitysmith_openapi/models/live_activity_action_type", __dir__) require File.expand_path("../generated/activitysmith_openapi/models/push_notification_action", __dir__) @@ -743,3 +744,65 @@ def test_passthrough_methods assert_equal [:ok, 200, {}], live_activities.end_live_activity_with_http_info({ activity_id: "act-1" }) end end + + +require File.expand_path("../generated/activitysmith_openapi/models/live_activity_update_request", __dir__) +require File.expand_path("../generated/activitysmith_openapi/models/live_activity_end_request", __dir__) + +class LegacyTagsTest < Minitest::Test + def test_replacement_clearing_and_omission + [:update, :end].each do |method| + [nil, ["billing"], []].each do |tags| + api = FakeLiveApi.new + resource = ActivitySmith::LiveActivities.new(api) + resource.public_send(method, activity_id: "activity-1", content_state: {title: "Job"}, tags: tags) + request = api.calls.last[1] + assert_equal !tags.nil?, request.key?(:tags) + assert_equal tags, request[:tags] unless tags.nil? + model_class = method == :update ? OpenapiClient::LiveActivityUpdateRequest : OpenapiClient::LiveActivityEndRequest + model = model_class.new(request) + serialized = model.to_hash + assert_equal !tags.nil?, serialized.key?(:tags) + assert_equal tags, serialized[:tags] unless tags.nil? + end + end + end +end + + +class MetadataSerializationTest < Minitest::Test + def test_metadata_keeps_scalar_values_and_empty_objects + [:send, :start, :update, :end, :stream, :end_stream].each do |method| + [nil, {}, {order: "382", ready: false, count: 0, empty: "", ratio: 1.25}].each do |metadata| + api = method == :send ? FakePushApi.new : FakeLiveApi.new + resource = method == :send ? ActivitySmith::Notifications.new(api) : ActivitySmith::LiveActivities.new(api) + fields = method == :send ? {title: "Job"} : {activity_id: "a", content_state: {title: "Job"}} + fields[:metadata] = metadata unless metadata.nil? + [:stream, :end_stream].include?(method) ? resource.public_send(method, "job", **fields) : resource.public_send(method, **fields) + request = api.calls.last[[:stream, :end_stream].include?(method) ? 2 : 1] + request = request[:live_activity_stream_delete_request] if method == :end_stream + serialized = JSON.parse(JSON.generate(request)) + assert_equal !metadata.nil?, serialized.key?("metadata") + assert_equal JSON.parse(JSON.generate(metadata)), serialized["metadata"] unless metadata.nil? + end + end + end +end + +class ExternalPushURLsTest < Minitest::Test + def test_custom_schemes_and_stream_end_tags + ["http://example.com", "https://example.com", "shortcuts://run-shortcut?name=Test", "spotify://", "spotify:track:123"].each do |url| + model = OpenapiClient::PushNotificationRequest.new(title: "Job", redirection: url) + assert model.valid? + assert_equal url, model.to_hash[:redirection] + end + [nil, [], ["finished"]].each do |tags| + api = FakeLiveApi.new + ActivitySmith::LiveActivities.new(api).end_stream("job", tags: tags, metadata: {}) + request = api.calls.last[2][:live_activity_stream_delete_request] + assert_equal !tags.nil?, request.key?(:tags) + assert_equal tags, request[:tags] unless tags.nil? + assert_equal({}, request[:metadata]) + end + end +end From 823a29b90f9df0b73eb02853a642281f3c184fa8 Mon Sep 17 00:00:00 2001 From: bardonadam Date: Tue, 15 Sep 2026 20:12:54 +0700 Subject: [PATCH 03/11] fix: remove internal operations from the generated client Use the generated output from canonical backend 49ad7b083b50f53bc3d81edb77ca6597845160a2. Health checks and app changelog are first-party operations, not part of the developer API. Preserve the existing wrapper and README preparation. Verification: SDK tests passed; generated source scanned for removed operations/models; provenance matches the deployed public contract. Initiated-by: user Implemented-by: codex --- generated/activitysmith_openapi.rb | 6 - .../activitysmith_openapi/api/public_api.rb | 150 -------- .../models/changelog_entry.rb | 339 ------------------ .../models/changelog_item.rb | 267 -------------- .../models/changelog_list_response.rb | 223 ------------ .../models/health_check.rb | 318 ---------------- .../models/health_response.rb | 271 -------------- generated/openapi-source.json | 4 +- 8 files changed, 2 insertions(+), 1576 deletions(-) delete mode 100644 generated/activitysmith_openapi/api/public_api.rb delete mode 100644 generated/activitysmith_openapi/models/changelog_entry.rb delete mode 100644 generated/activitysmith_openapi/models/changelog_item.rb delete mode 100644 generated/activitysmith_openapi/models/changelog_list_response.rb delete mode 100644 generated/activitysmith_openapi/models/health_check.rb delete mode 100644 generated/activitysmith_openapi/models/health_response.rb diff --git a/generated/activitysmith_openapi.rb b/generated/activitysmith_openapi.rb index 258e6bd..87bdaa3 100644 --- a/generated/activitysmith_openapi.rb +++ b/generated/activitysmith_openapi.rb @@ -24,16 +24,11 @@ require 'activitysmith_openapi/models/app_icon_badge_count_update_request' require 'activitysmith_openapi/models/app_icon_badge_count_update_response' require 'activitysmith_openapi/models/bad_request_error' -require 'activitysmith_openapi/models/changelog_entry' -require 'activitysmith_openapi/models/changelog_item' -require 'activitysmith_openapi/models/changelog_list_response' require 'activitysmith_openapi/models/channel_target' require 'activitysmith_openapi/models/content_state_end' require 'activitysmith_openapi/models/content_state_start' require 'activitysmith_openapi/models/content_state_update' require 'activitysmith_openapi/models/forbidden_error' -require 'activitysmith_openapi/models/health_check' -require 'activitysmith_openapi/models/health_response' require 'activitysmith_openapi/models/live_activity_action' require 'activitysmith_openapi/models/live_activity_action_type' require 'activitysmith_openapi/models/live_activity_alert_badge' @@ -72,7 +67,6 @@ require 'activitysmith_openapi/api/app_icon_badges_api' require 'activitysmith_openapi/api/live_activities_api' require 'activitysmith_openapi/api/metrics_api' -require 'activitysmith_openapi/api/public_api' require 'activitysmith_openapi/api/push_notifications_api' module OpenapiClient diff --git a/generated/activitysmith_openapi/api/public_api.rb b/generated/activitysmith_openapi/api/public_api.rb deleted file mode 100644 index 5a5a57a..0000000 --- a/generated/activitysmith_openapi/api/public_api.rb +++ /dev/null @@ -1,150 +0,0 @@ -=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 PublicApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Get API Health - # Returns the current availability of the ActivitySmith API and its required services. No authentication is required. - # @param [Hash] opts the optional parameters - # @return [HealthResponse] - def get_api_health(opts = {}) - data, _status_code, _headers = get_api_health_with_http_info(opts) - data - end - - # Get API Health - # Returns the current availability of the ActivitySmith API and its required services. No authentication is required. - # @param [Hash] opts the optional parameters - # @return [Array<(HealthResponse, Integer, Hash)>] HealthResponse data, response status code and response headers - def get_api_health_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PublicApi.get_api_health ...' - end - # resource path - local_var_path = '/health' - - # 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] || 'HealthResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || [] - - new_options = opts.merge( - :operation => :"PublicApi.get_api_health", - :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: PublicApi#get_api_health\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # List Public Changelog Entries - # Returns published ActivitySmith app changelog entries. No authentication is required. - # @param [Hash] opts the optional parameters - # @option opts [String] :platform Platform whose published changelog entries should be returned. (default to 'ios') - # @option opts [Integer] :limit Maximum number of entries to return. (default to 10) - # @return [ChangelogListResponse] - def list_public_changelog_entries(opts = {}) - data, _status_code, _headers = list_public_changelog_entries_with_http_info(opts) - data - end - - # List Public Changelog Entries - # Returns published ActivitySmith app changelog entries. No authentication is required. - # @param [Hash] opts the optional parameters - # @option opts [String] :platform Platform whose published changelog entries should be returned. (default to 'ios') - # @option opts [Integer] :limit Maximum number of entries to return. (default to 10) - # @return [Array<(ChangelogListResponse, Integer, Hash)>] ChangelogListResponse data, response status code and response headers - def list_public_changelog_entries_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PublicApi.list_public_changelog_entries ...' - end - if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 20 - fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PublicApi.list_public_changelog_entries, must be smaller than or equal to 20.' - end - - if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 - fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PublicApi.list_public_changelog_entries, must be greater than or equal to 1.' - end - - # resource path - local_var_path = '/changelog' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil? - query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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] || 'ChangelogListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || [] - - new_options = opts.merge( - :operation => :"PublicApi.list_public_changelog_entries", - :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: PublicApi#list_public_changelog_entries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/generated/activitysmith_openapi/models/changelog_entry.rb b/generated/activitysmith_openapi/models/changelog_entry.rb deleted file mode 100644 index 6299ac9..0000000 --- a/generated/activitysmith_openapi/models/changelog_entry.rb +++ /dev/null @@ -1,339 +0,0 @@ -=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 'date' -require 'time' - -module OpenapiClient - class ChangelogEntry - attr_accessor :id - - attr_accessor :platform - - attr_accessor :version - - attr_accessor :title - - attr_accessor :subtitle - - attr_accessor :hero_image_url - - attr_accessor :cta_title - - attr_accessor :published_at - - attr_accessor :items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'platform' => :'platform', - :'version' => :'version', - :'title' => :'title', - :'subtitle' => :'subtitle', - :'hero_image_url' => :'hero_image_url', - :'cta_title' => :'cta_title', - :'published_at' => :'published_at', - :'items' => :'items' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'platform' => :'String', - :'version' => :'String', - :'title' => :'String', - :'subtitle' => :'String', - :'hero_image_url' => :'String', - :'cta_title' => :'String', - :'published_at' => :'Time', - :'items' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'subtitle', - :'hero_image_url', - :'published_at', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::ChangelogEntry` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::ChangelogEntry`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - else - self.id = nil - end - - if attributes.key?(:'platform') - self.platform = attributes[:'platform'] - else - self.platform = nil - end - - if attributes.key?(:'version') - self.version = attributes[:'version'] - else - self.version = nil - end - - if attributes.key?(:'title') - self.title = attributes[:'title'] - else - self.title = nil - end - - if attributes.key?(:'subtitle') - self.subtitle = attributes[:'subtitle'] - else - self.subtitle = nil - end - - if attributes.key?(:'hero_image_url') - self.hero_image_url = attributes[:'hero_image_url'] - else - self.hero_image_url = nil - end - - if attributes.key?(:'cta_title') - self.cta_title = attributes[:'cta_title'] - else - self.cta_title = nil - end - - if attributes.key?(:'published_at') - self.published_at = attributes[:'published_at'] - else - self.published_at = nil - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - else - self.items = nil - 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 - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @platform.nil? - invalid_properties.push('invalid value for "platform", platform cannot be nil.') - end - - if @version.nil? - invalid_properties.push('invalid value for "version", version cannot be nil.') - end - - if @title.nil? - invalid_properties.push('invalid value for "title", title cannot be nil.') - end - - if @cta_title.nil? - invalid_properties.push('invalid value for "cta_title", cta_title cannot be nil.') - end - - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @id.nil? - return false if @platform.nil? - return false if @version.nil? - return false if @title.nil? - return false if @cta_title.nil? - return false if @items.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - platform == o.platform && - version == o.version && - title == o.title && - subtitle == o.subtitle && - hero_image_url == o.hero_image_url && - cta_title == o.cta_title && - published_at == o.published_at && - items == o.items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, platform, version, title, subtitle, hero_image_url, cta_title, published_at, items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = OpenapiClient.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/generated/activitysmith_openapi/models/changelog_item.rb b/generated/activitysmith_openapi/models/changelog_item.rb deleted file mode 100644 index 4a0553c..0000000 --- a/generated/activitysmith_openapi/models/changelog_item.rb +++ /dev/null @@ -1,267 +0,0 @@ -=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 'date' -require 'time' - -module OpenapiClient - class ChangelogItem - attr_accessor :icon - - attr_accessor :title - - attr_accessor :body - - attr_accessor :image_url - - attr_accessor :accent_color - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'icon' => :'icon', - :'title' => :'title', - :'body' => :'body', - :'image_url' => :'image_url', - :'accent_color' => :'accent_color' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'icon' => :'String', - :'title' => :'String', - :'body' => :'String', - :'image_url' => :'String', - :'accent_color' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'icon', - :'image_url', - :'accent_color' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::ChangelogItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::ChangelogItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'icon') - self.icon = attributes[:'icon'] - end - - if attributes.key?(:'title') - self.title = attributes[:'title'] - else - self.title = nil - end - - if attributes.key?(:'body') - self.body = attributes[:'body'] - else - self.body = nil - end - - if attributes.key?(:'image_url') - self.image_url = attributes[:'image_url'] - end - - if attributes.key?(:'accent_color') - self.accent_color = attributes[:'accent_color'] - 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 - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if @title.nil? - invalid_properties.push('invalid value for "title", title cannot be nil.') - end - - if @body.nil? - invalid_properties.push('invalid value for "body", body cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @title.nil? - return false if @body.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - icon == o.icon && - title == o.title && - body == o.body && - image_url == o.image_url && - accent_color == o.accent_color - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [icon, title, body, image_url, accent_color].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = OpenapiClient.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/generated/activitysmith_openapi/models/changelog_list_response.rb b/generated/activitysmith_openapi/models/changelog_list_response.rb deleted file mode 100644 index 23e18da..0000000 --- a/generated/activitysmith_openapi/models/changelog_list_response.rb +++ /dev/null @@ -1,223 +0,0 @@ -=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 'date' -require 'time' - -module OpenapiClient - class ChangelogListResponse - attr_accessor :changelogs - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'changelogs' => :'changelogs' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'changelogs' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::ChangelogListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::ChangelogListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'changelogs') - if (value = attributes[:'changelogs']).is_a?(Array) - self.changelogs = value - end - else - self.changelogs = nil - 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 - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if @changelogs.nil? - invalid_properties.push('invalid value for "changelogs", changelogs cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @changelogs.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - changelogs == o.changelogs - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [changelogs].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = OpenapiClient.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/generated/activitysmith_openapi/models/health_check.rb b/generated/activitysmith_openapi/models/health_check.rb deleted file mode 100644 index 5b4ea32..0000000 --- a/generated/activitysmith_openapi/models/health_check.rb +++ /dev/null @@ -1,318 +0,0 @@ -=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 'date' -require 'time' - -module OpenapiClient - class HealthCheck - attr_accessor :name - - attr_accessor :status - - attr_accessor :duration_ms - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'status' => :'status', - :'duration_ms' => :'duration_ms' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'status' => :'String', - :'duration_ms' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::HealthCheck` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::HealthCheck`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - else - self.name = nil - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - else - self.status = nil - end - - if attributes.key?(:'duration_ms') - self.duration_ms = attributes[:'duration_ms'] - else - self.duration_ms = nil - 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 - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @duration_ms.nil? - invalid_properties.push('invalid value for "duration_ms", duration_ms cannot be nil.') - end - - if @duration_ms < 0 - invalid_properties.push('invalid value for "duration_ms", must be greater than or equal to 0.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @name.nil? - name_validator = EnumAttributeValidator.new('String', ["database", "redis"]) - return false unless name_validator.valid?(@name) - return false if @status.nil? - status_validator = EnumAttributeValidator.new('String', ["ok", "failed"]) - return false unless status_validator.valid?(@status) - return false if @duration_ms.nil? - return false if @duration_ms < 0 - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] name Object to be assigned - def name=(name) - validator = EnumAttributeValidator.new('String', ["database", "redis"]) - unless validator.valid?(name) - fail ArgumentError, "invalid value for \"name\", must be one of #{validator.allowable_values}." - end - @name = name - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["ok", "failed"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Custom attribute writer method with validation - # @param [Object] duration_ms Value to be assigned - def duration_ms=(duration_ms) - if duration_ms.nil? - fail ArgumentError, 'duration_ms cannot be nil' - end - - if duration_ms < 0 - fail ArgumentError, 'invalid value for "duration_ms", must be greater than or equal to 0.' - end - - @duration_ms = duration_ms - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - status == o.status && - duration_ms == o.duration_ms - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, status, duration_ms].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = OpenapiClient.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/generated/activitysmith_openapi/models/health_response.rb b/generated/activitysmith_openapi/models/health_response.rb deleted file mode 100644 index 7646cc9..0000000 --- a/generated/activitysmith_openapi/models/health_response.rb +++ /dev/null @@ -1,271 +0,0 @@ -=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 'date' -require 'time' - -module OpenapiClient - class HealthResponse - attr_accessor :ok - - attr_accessor :service - - attr_accessor :timestamp - - attr_accessor :checks - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ok' => :'ok', - :'service' => :'service', - :'timestamp' => :'timestamp', - :'checks' => :'checks' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ok' => :'Boolean', - :'service' => :'String', - :'timestamp' => :'Time', - :'checks' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::HealthResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::HealthResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ok') - self.ok = attributes[:'ok'] - else - self.ok = nil - end - - if attributes.key?(:'service') - self.service = attributes[:'service'] - else - self.service = nil - end - - if attributes.key?(:'timestamp') - self.timestamp = attributes[:'timestamp'] - else - self.timestamp = nil - end - - if attributes.key?(:'checks') - if (value = attributes[:'checks']).is_a?(Array) - self.checks = value - end - else - self.checks = nil - 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 - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if @ok.nil? - invalid_properties.push('invalid value for "ok", ok cannot be nil.') - end - - if @service.nil? - invalid_properties.push('invalid value for "service", service cannot be nil.') - end - - if @timestamp.nil? - invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.') - end - - if @checks.nil? - invalid_properties.push('invalid value for "checks", checks cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @ok.nil? - return false if @service.nil? - return false if @timestamp.nil? - return false if @checks.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ok == o.ok && - service == o.service && - timestamp == o.timestamp && - checks == o.checks - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ok, service, timestamp, checks].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = OpenapiClient.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/generated/openapi-source.json b/generated/openapi-source.json index 5a616d3..dc05717 100644 --- a/generated/openapi-source.json +++ b/generated/openapi-source.json @@ -1,6 +1,6 @@ { "repository": "ActivitySmithHQ/activitysmith-backend", - "commit": "3cd1df5f1296777bacfad731eac9f91d27d01c6e", + "commit": "49ad7b083b50f53bc3d81edb77ca6597845160a2", "path": "openapi.json", - "sha256": "e112ddb9a069dc0ad87a123d0be1286ff0a671da505fabfdf4bb94ff6bcb444f" + "sha256": "b7e33cd485df8ddc5d7fb7b57b61106fd6f8ff3ffa7cc7bef4ac1ccbbb0cede7" } From ccee48d9a171b064507ebd043626d4e9b18f2962 Mon Sep 17 00:00:00 2001 From: bardonadam Date: Tue, 15 Sep 2026 20:42:52 +0700 Subject: [PATCH 04/11] docs: align README link examples with SDK documentation Repeat supported destinations within each relevant section, use iOS Shortcut terminology, and remove app-version notes. Live Activity action support remains unchanged. Verification: README sync check passed; code fences unchanged; Markdown links and whitespace checked. Initiated-by: user Implemented-by: codex --- README.md | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 007288d..e98298c 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,15 @@ What will work: ### Push Notifications with Redirection -Open a web page, an iPhone Shortcut, or an installed app when someone taps the notification. Set `redirection` to an HTTP, HTTPS, or Shortcuts URL, or an app deep link such as `spotify:track:123`. +Open a web page, run an iOS Shortcut, or open an app when someone taps the notification. `redirection` supports: + +- **HTTP/HTTPS:** Web pages, e.g. `https://example.com` +- **Shortcuts:** Run Jarvis with `shortcuts://run-shortcut?name=Jarvis` +- **App deep links:** Installed apps or specific content within them + - **Spotify:** A track, e.g. `spotify:track:6rqhFgbbKwnb9MLmUQDhG6` + - **Termius:** `termius://` to open the app + - **Claude:** `claude://code` to open the Code tab + - **ChatGPT:** `chatgpt://` to open the app ```ruby activitysmith.notifications.send( @@ -85,7 +93,17 @@ activitysmith.notifications.send( ![Actionable Push Notification with redirection and actions](https://cdn.activitysmith.com/features/actionable-push-notifications-2.png) -For expanded notification actions, `open_url` supports HTTP, HTTPS, Shortcuts, and installed app deep links. Webhooks are executed by the ActivitySmith backend and must use HTTPS. Custom app links require iOS 1.13.4 build 2 or later and an installed app that handles the URL. +`open_url` actions open a web page, run an iOS Shortcut, or open an app when someone taps the button. Supported links: + +- **HTTP/HTTPS:** Web pages, e.g. `https://example.com` +- **Shortcuts:** Run Jarvis with `shortcuts://run-shortcut?name=Jarvis` +- **App deep links:** Installed apps or specific content within them + - **Spotify:** A track, e.g. `spotify:track:6rqhFgbbKwnb9MLmUQDhG6` + - **Termius:** `termius://` to open the app + - **Claude:** `claude://code` to open the Code tab + - **ChatGPT:** `chatgpt://` to open the app + +Webhooks are executed by the ActivitySmith backend and must use HTTPS. ```ruby activitysmith.notifications.send( @@ -352,12 +370,16 @@ Choose from these colors for the Live Activity accent, including progress bars a Live Activities can include an action button. -- `open_url`: open an HTTP or HTTPS URL. -- `open_url` with a `shortcuts://run-shortcut?name=...` URL: run a specific iPhone Shortcut, for example to open an app. -- `webhook`: trigger a backend GET/POST workflow. +- `open_url`: Open a web page or run an iOS Shortcut +- `webhook`: Trigger a backend GET/POST workflow #### Open URL action +Open a web page or run an iOS Shortcut when someone taps the button. Supported links: + +- **HTTP/HTTPS:** Web pages, e.g. `https://example.com` +- **Shortcuts:** Run Jarvis with `shortcuts://run-shortcut?name=Jarvis` + ```ruby activitysmith.live_activities.stream( "prod-web-1", From 10b095c71b87dc4e70aea6ee7a822105f8e71fea Mon Sep 17 00:00:00 2001 From: bardonadam Date: Tue, 15 Sep 2026 20:48:07 +0700 Subject: [PATCH 05/11] docs: omit redundant repository resources from SDK READMEs Keep Source Code resources in website docs only. Preserve package links and omit the empty Go resource section. Verification: README converter test and six-repository sync check passed; scoped diffs checked. Initiated-by: user Implemented-by: codex --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index e98298c..40e3c97 100644 --- a/README.md +++ b/README.md @@ -632,7 +632,3 @@ end ### [RubyGems Package](https://rubygems.org/gems/activitysmith) Install the ActivitySmith Ruby SDK from RubyGems - -### [Source Code](https://github.com/ActivitySmithHQ/activitysmith-ruby) - -View the Ruby SDK source on GitHub From d522cbdc0bdaa5fe4ac061b5ad75eee9c32acc7f Mon Sep 17 00:00:00 2001 From: bardonadam Date: Tue, 15 Sep 2026 20:56:20 +0700 Subject: [PATCH 06/11] docs: render Live Activity previews without list bullets Use standalone preview images and captions in SDK READMEs; retain the website grid source. Verification: converter test and six-repository sync check passed; all preview images and code fences preserved. Initiated-by: user Implemented-by: codex --- README.md | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 40e3c97..4bcc432 100644 --- a/README.md +++ b/README.md @@ -140,17 +140,29 @@ activitysmith.notifications.send( Choose the Live Activity type that matches what you want to show: -- ![Stats Live Activity with six labeled sales metrics](https://cdn.activitysmith.com/features/stats-live-activity.png) **Stats**: Show up to 8 labeled values on your Lock Screen, from revenue and orders to uptime and conversion. +![Stats Live Activity with six labeled sales metrics](https://cdn.activitysmith.com/features/stats-live-activity.png) -- ![Metrics Live Activity with CPU and memory values](https://cdn.activitysmith.com/features/metrics-live-activity-start.png) **Metrics**: Track two related values with segmented bars, such as CPU and memory. +**Stats**: Show up to 8 labeled values on your Lock Screen, from revenue and orders to uptime and conversion. -- ![Segmented Progress Live Activity showing a workflow step](https://cdn.activitysmith.com/features/update-live-activity.png) **Segmented Progress**: Show progress through a known set of steps, like build, test, deploy, and verify. +![Metrics Live Activity with CPU and memory values](https://cdn.activitysmith.com/features/metrics-live-activity-start.png) -- ![Progress Live Activity showing percentage completion](https://cdn.activitysmith.com/features/progress-live-activity.png) **Progress**: Show percentage progress for jobs that move continuously toward completion. +**Metrics**: Track two related values with segmented bars, such as CPU and memory. -- ![Alert Live Activity showing a customer reactivation update](https://cdn.activitysmith.com/features/alert-live-activity.png) **Alert**: Show status updates with a clear message, badge, and icon. When you add an action button, `color` controls the button tint. +![Segmented Progress Live Activity showing a workflow step](https://cdn.activitysmith.com/features/update-live-activity.png) -- ![Timer Live Activity showing a benchmark run countdown](https://cdn.activitysmith.com/features/timer-live-activity.png) **Timer**: Count down from a duration, or count up from 00:00 while a job runs. +**Segmented Progress**: Show progress through a known set of steps, like build, test, deploy, and verify. + +![Progress Live Activity showing percentage completion](https://cdn.activitysmith.com/features/progress-live-activity.png) + +**Progress**: Show percentage progress for jobs that move continuously toward completion. + +![Alert Live Activity showing a customer reactivation update](https://cdn.activitysmith.com/features/alert-live-activity.png) + +**Alert**: Show status updates with a clear message, badge, and icon. When you add an action button, `color` controls the button tint. + +![Timer Live Activity showing a benchmark run countdown](https://cdn.activitysmith.com/features/timer-live-activity.png) + +**Timer**: Count down from a duration, or count up from 00:00 while a job runs. ### Start & Update Live Activity From e60093fec24f9fbc3c102c3ad1af92001fdfd2f7 Mon Sep 17 00:00:00 2001 From: bardonadam Date: Tue, 15 Sep 2026 20:58:27 +0700 Subject: [PATCH 07/11] docs: order Metadata before Tags and Channels Match the SDK documentation feature priority. Section content and code examples are unchanged. Verification: section contents compared before and after; README sync and whitespace checks passed. Initiated-by: user Implemented-by: codex --- README.md | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 4bcc432..36e79f9 100644 --- a/README.md +++ b/README.md @@ -549,6 +549,27 @@ Pass `0` to clear the badge. activitysmith.badge_count(0) ``` +## Metadata + +Metadata adds information to Push Notification and Live Activity details in ActivitySmith. It does not appear in the notification or Live Activity on your device. + +```ruby +activitysmith.notifications.send( + title: "New subscription 💸", + metadata: { customer_id: "382", plan: "Pro", amount: 29, trial: false } +) + +activitysmith.live_activities.stream( + "customer-import", + content_state: { title: "Customer Import", type: "progress", percentage: 60 }, + metadata: { job_id: "import-382", records: 1200 } +) +``` + +Supported on Push Notifications, Live Activity streams (including stream ending), and legacy `start`, `update`, and `end` calls. On updates or end calls, omit `metadata` to keep it, supply an object to replace it, or send `{}` to clear it. + +Values can be strings, numbers, or booleans. Metadata supports up to 50 entries and 16 KB of JSON, with keys up to 100 characters and strings up to 4,000 characters. Nested objects, arrays, and null values are not supported. + ## Tags Use `tags` to organize and filter your Push Notification and Live Activity history. Tags are created automatically when you first use them. @@ -575,27 +596,6 @@ activitysmith.live_activities.update( `end_stream` also accepts final Tags and Metadata. Omit them to preserve existing values, or supply empty collections to clear them. -## Metadata - -Metadata adds information to Push Notification and Live Activity details in ActivitySmith. It does not appear in the notification or Live Activity on your device. - -```ruby -activitysmith.notifications.send( - title: "New subscription 💸", - metadata: { customer_id: "382", plan: "Pro", amount: 29, trial: false } -) - -activitysmith.live_activities.stream( - "customer-import", - content_state: { title: "Customer Import", type: "progress", percentage: 60 }, - metadata: { job_id: "import-382", records: 1200 } -) -``` - -Supported on Push Notifications, Live Activity streams (including stream ending), and legacy `start`, `update`, and `end` calls. On updates or end calls, omit `metadata` to keep it, supply an object to replace it, or send `{}` to clear it. - -Values can be strings, numbers, or booleans. Metadata supports up to 50 entries and 16 KB of JSON, with keys up to 100 characters and strings up to 4,000 characters. Nested objects, arrays, and null values are not supported. - ## Channels Use `channels` to target specific team members or devices when sending Push Notifications, Live Activities, or App Icon Badge Count updates. Omit it for account-wide delivery. From 44b58dc54eb9c3809b99203499fe340e08ccf4cb Mon Sep 17 00:00:00 2001 From: bardonadam Date: Tue, 15 Sep 2026 21:01:22 +0700 Subject: [PATCH 08/11] docs: simplify Metadata description Describe metadata as extra information and remove the paragraph about supported operations and replacement behavior, matching the reviewed SDK docs. Verification: README sync check passed; code examples and other sections unchanged. Initiated-by: user Implemented-by: codex --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 36e79f9..4839d63 100644 --- a/README.md +++ b/README.md @@ -551,7 +551,7 @@ activitysmith.badge_count(0) ## Metadata -Metadata adds information to Push Notification and Live Activity details in ActivitySmith. It does not appear in the notification or Live Activity on your device. +Metadata adds extra information to Push Notification and Live Activity details in ActivitySmith. It does not appear in the notification or Live Activity on your device. ```ruby activitysmith.notifications.send( @@ -566,8 +566,6 @@ activitysmith.live_activities.stream( ) ``` -Supported on Push Notifications, Live Activity streams (including stream ending), and legacy `start`, `update`, and `end` calls. On updates or end calls, omit `metadata` to keep it, supply an object to replace it, or send `{}` to clear it. - Values can be strings, numbers, or booleans. Metadata supports up to 50 entries and 16 KB of JSON, with keys up to 100 characters and strings up to 4,000 characters. Nested objects, arrays, and null values are not supported. ## Tags From e130978c6e9a2bc6bf8d1fe84d5af47435007e0c Mon Sep 17 00:00:00 2001 From: bardonadam Date: Tue, 15 Sep 2026 21:02:30 +0700 Subject: [PATCH 09/11] docs: refine Metadata example and remove redundant end-stream note Include the notification message in Metadata examples and remove the final Tags and Metadata paragraph as requested. Verification: README sync and whitespace checks passed; inspected changes limited to the requested example and paragraph. Initiated-by: user Implemented-by: codex --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 4839d63..9d54bf9 100644 --- a/README.md +++ b/README.md @@ -556,6 +556,7 @@ Metadata adds extra information to Push Notification and Live Activity details i ```ruby activitysmith.notifications.send( title: "New subscription 💸", + message: "Customer upgraded to Pro plan", metadata: { customer_id: "382", plan: "Pro", amount: 29, trial: false } ) @@ -592,8 +593,6 @@ activitysmith.live_activities.update( ) ``` -`end_stream` also accepts final Tags and Metadata. Omit them to preserve existing values, or supply empty collections to clear them. - ## Channels Use `channels` to target specific team members or devices when sending Push Notifications, Live Activities, or App Icon Badge Count updates. Omit it for account-wide delivery. From 1d42d3cffe499df23ff09714837ca0d2ed17bff2 Mon Sep 17 00:00:00 2001 From: bardonadam Date: Tue, 15 Sep 2026 21:04:00 +0700 Subject: [PATCH 10/11] docs: format Metadata examples across multiple lines Expand metadata and content-state objects to one field per line for readability. Verification: sync check passed; example tokens and CLI JSON values preserved; Python example syntax checked. Initiated-by: user Implemented-by: codex --- README.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9d54bf9..8adcc76 100644 --- a/README.md +++ b/README.md @@ -557,13 +557,25 @@ Metadata adds extra information to Push Notification and Live Activity details i activitysmith.notifications.send( title: "New subscription 💸", message: "Customer upgraded to Pro plan", - metadata: { customer_id: "382", plan: "Pro", amount: 29, trial: false } + metadata: { + customer_id: "382", + plan: "Pro", + amount: 29, + trial: false, + } ) activitysmith.live_activities.stream( "customer-import", - content_state: { title: "Customer Import", type: "progress", percentage: 60 }, - metadata: { job_id: "import-382", records: 1200 } + content_state: { + title: "Customer Import", + type: "progress", + percentage: 60, + }, + metadata: { + job_id: "import-382", + records: 1200, + } ) ``` From 87dc35d5bc228cc2b0a7aaac8f470cf080ce3e97 Mon Sep 17 00:00:00 2001 From: bardonadam Date: Tue, 15 Sep 2026 21:19:21 +0700 Subject: [PATCH 11/11] chore: prepare SDK 1.11.0 feature release Bump package and SDK identification versions to 1.11.0. Keep the release summary focused on Metadata, Tags, and iOS deep links. Generated package version metadata was regenerated from the unchanged API contract. Verification: package test suite passed; version metadata and scoped diffs checked. No release tags or package publishing. Initiated-by: user Implemented-by: codex --- CHANGELOG.md | 8 ++------ generated/activitysmith_openapi/version.rb | 2 +- lib/activitysmith/version.rb | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8e3d1b..d6bf11e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,6 @@ -## Unreleased +## 1.11.0 -- Support Push Notification app deep links and final Tags/Metadata when ending a managed Live Activity stream. - -- Add Metadata to Push Notifications and Live Activity start, update, end, and stream requests, including empty-object clearing. - -- Add Tags replacement and empty-array clearing to legacy Live Activity update and end. +This version adds support for Metadata and iOS deep links, and expands Tags support when updating or ending Live Activities. ## 1.10.0 diff --git a/generated/activitysmith_openapi/version.rb b/generated/activitysmith_openapi/version.rb index 77eed2b..6a445ea 100644 --- a/generated/activitysmith_openapi/version.rb +++ b/generated/activitysmith_openapi/version.rb @@ -11,5 +11,5 @@ =end module OpenapiClient - VERSION = '1.10.0' + VERSION = '1.11.0' end diff --git a/lib/activitysmith/version.rb b/lib/activitysmith/version.rb index 700e5aa..1937611 100644 --- a/lib/activitysmith/version.rb +++ b/lib/activitysmith/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ActivitySmith - VERSION = "1.10.0" + VERSION = "1.11.0" end