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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions generated/activitysmith_openapi.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
=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

# Common files
require 'activitysmith_openapi/api_client'
require 'activitysmith_openapi/api_error'
require 'activitysmith_openapi/version'
require 'activitysmith_openapi/configuration'

# Models
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/live_activity_end_request'
require 'activitysmith_openapi/models/live_activity_end_response'
require 'activitysmith_openapi/models/live_activity_limit_error'
require 'activitysmith_openapi/models/live_activity_start_request'
require 'activitysmith_openapi/models/live_activity_start_response'
require 'activitysmith_openapi/models/live_activity_update_request'
require 'activitysmith_openapi/models/live_activity_update_response'
require 'activitysmith_openapi/models/push_notification_request'
require 'activitysmith_openapi/models/push_notification_response'
require 'activitysmith_openapi/models/rate_limit_error'
require 'activitysmith_openapi/models/send_push_notification429_response'

# APIs
require 'activitysmith_openapi/api/live_activities_api'
require 'activitysmith_openapi/api/push_notifications_api'

module OpenapiClient
class << self
# Customize default settings for the SDK using block.
# OpenapiClient.configure do |config|
# config.username = "xxx"
# config.password = "xxx"
# end
# If no block given, return the default Configuration object.
def configure
if block_given?
yield(Configuration.default)
else
Configuration.default
end
end
end
end
226 changes: 226 additions & 0 deletions generated/activitysmith_openapi/api/live_activities_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
=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 LiveActivitiesApi
attr_accessor :api_client

def initialize(api_client = ApiClient.default)
@api_client = api_client
end
# End a Live Activity
# Ends a Live Activity and archives its lifecycle.
# @param live_activity_end_request [LiveActivityEndRequest]
# @param [Hash] opts the optional parameters
# @return [LiveActivityEndResponse]
def end_live_activity(live_activity_end_request, opts = {})
data, _status_code, _headers = end_live_activity_with_http_info(live_activity_end_request, opts)
data
end

# End a Live Activity
# Ends a Live Activity and archives its lifecycle.
# @param live_activity_end_request [LiveActivityEndRequest]
# @param [Hash] opts the optional parameters
# @return [Array<(LiveActivityEndResponse, Integer, Hash)>] LiveActivityEndResponse data, response status code and response headers
def end_live_activity_with_http_info(live_activity_end_request, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: LiveActivitiesApi.end_live_activity ...'
end
# verify the required parameter 'live_activity_end_request' is set
if @api_client.config.client_side_validation && live_activity_end_request.nil?
fail ArgumentError, "Missing the required parameter 'live_activity_end_request' when calling LiveActivitiesApi.end_live_activity"
end
# resource path
local_var_path = '/live-activity/end'

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

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

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

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

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

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

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

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

# Start a Live Activity
# Starts a Live Activity on all registered devices and returns an activity_id.
# @param live_activity_start_request [LiveActivityStartRequest]
# @param [Hash] opts the optional parameters
# @return [LiveActivityStartResponse]
def start_live_activity(live_activity_start_request, opts = {})
data, _status_code, _headers = start_live_activity_with_http_info(live_activity_start_request, opts)
data
end

# Start a Live Activity
# Starts a Live Activity on all registered devices and returns an activity_id.
# @param live_activity_start_request [LiveActivityStartRequest]
# @param [Hash] opts the optional parameters
# @return [Array<(LiveActivityStartResponse, Integer, Hash)>] LiveActivityStartResponse data, response status code and response headers
def start_live_activity_with_http_info(live_activity_start_request, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: LiveActivitiesApi.start_live_activity ...'
end
# verify the required parameter 'live_activity_start_request' is set
if @api_client.config.client_side_validation && live_activity_start_request.nil?
fail ArgumentError, "Missing the required parameter 'live_activity_start_request' when calling LiveActivitiesApi.start_live_activity"
end
# resource path
local_var_path = '/live-activity/start'

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

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

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

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

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

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

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

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

# Update a Live Activity
# Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued.
# @param live_activity_update_request [LiveActivityUpdateRequest]
# @param [Hash] opts the optional parameters
# @return [LiveActivityUpdateResponse]
def update_live_activity(live_activity_update_request, opts = {})
data, _status_code, _headers = update_live_activity_with_http_info(live_activity_update_request, opts)
data
end

# Update a Live Activity
# Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued.
# @param live_activity_update_request [LiveActivityUpdateRequest]
# @param [Hash] opts the optional parameters
# @return [Array<(LiveActivityUpdateResponse, Integer, Hash)>] LiveActivityUpdateResponse data, response status code and response headers
def update_live_activity_with_http_info(live_activity_update_request, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: LiveActivitiesApi.update_live_activity ...'
end
# verify the required parameter 'live_activity_update_request' is set
if @api_client.config.client_side_validation && live_activity_update_request.nil?
fail ArgumentError, "Missing the required parameter 'live_activity_update_request' when calling LiveActivitiesApi.update_live_activity"
end
# resource path
local_var_path = '/live-activity/update'

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

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

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

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

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

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

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

data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: LiveActivitiesApi#update_live_activity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
end
end
90 changes: 90 additions & 0 deletions generated/activitysmith_openapi/api/push_notifications_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
=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 PushNotificationsApi
attr_accessor :api_client

def initialize(api_client = ApiClient.default)
@api_client = api_client
end
# Send a push notification
# Sends a push notification to every paired device in your account.
# @param push_notification_request [PushNotificationRequest]
# @param [Hash] opts the optional parameters
# @return [PushNotificationResponse]
def send_push_notification(push_notification_request, opts = {})
data, _status_code, _headers = send_push_notification_with_http_info(push_notification_request, opts)
data
end

# Send a push notification
# Sends a push notification to every paired device in your account.
# @param push_notification_request [PushNotificationRequest]
# @param [Hash] opts the optional parameters
# @return [Array<(PushNotificationResponse, Integer, Hash)>] PushNotificationResponse data, response status code and response headers
def send_push_notification_with_http_info(push_notification_request, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: PushNotificationsApi.send_push_notification ...'
end
# verify the required parameter 'push_notification_request' is set
if @api_client.config.client_side_validation && push_notification_request.nil?
fail ArgumentError, "Missing the required parameter 'push_notification_request' when calling PushNotificationsApi.send_push_notification"
end
# resource path
local_var_path = '/push-notification'

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

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

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

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

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

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

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

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