coding-chimp/onesignal

View on GitHub
lib/onesignal/api/default_api.rb

Summary

Maintainability
F
1 mo
Test Coverage
=begin
#OneSignal

#A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

The version of the OpenAPI document: 1.2.2
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT

=end

require 'cgi'

module OneSignal
  class DefaultApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # Start Live Activity
    # Starts a Live Activity
    # @param app_id [String] The OneSignal App ID for your app.  Available in Keys & IDs.
    # @param activity_id [String] Live Activity record ID
    # @param begin_live_activity_request [BeginLiveActivityRequest] 
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def begin_live_activity(app_id, activity_id, begin_live_activity_request, opts = {})
      begin_live_activity_with_http_info(app_id, activity_id, begin_live_activity_request, opts)
      nil
    end

    # Start Live Activity
    # Starts a Live Activity
    # @param app_id [String] The OneSignal App ID for your app.  Available in Keys & IDs.
    # @param activity_id [String] Live Activity record ID
    # @param begin_live_activity_request [BeginLiveActivityRequest] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def begin_live_activity_with_http_info(app_id, activity_id, begin_live_activity_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.begin_live_activity ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.begin_live_activity"
      end
      # verify the required parameter 'activity_id' is set
      if @api_client.config.client_side_validation && activity_id.nil?
        fail ArgumentError, "Missing the required parameter 'activity_id' when calling DefaultApi.begin_live_activity"
      end
      # verify the required parameter 'begin_live_activity_request' is set
      if @api_client.config.client_side_validation && begin_live_activity_request.nil?
        fail ArgumentError, "Missing the required parameter 'begin_live_activity_request' when calling DefaultApi.begin_live_activity"
      end
      # resource path
      local_var_path = '/apps/{app_id}/live_activities/{activity_id}/token'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'activity_id' + '}', CGI.escape(activity_id.to_s))

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

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

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

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

      # return_type
      return_type = opts[:debug_return_type]

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

      new_options = opts.merge(
        :operation => :"DefaultApi.begin_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: DefaultApi#begin_live_activity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Stop a scheduled or currently outgoing notification
    # Used to stop a scheduled or currently outgoing notification
    # @param app_id [String] 
    # @param notification_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [CancelNotificationSuccessResponse]
    def cancel_notification(app_id, notification_id, opts = {})
      data, _status_code, _headers = cancel_notification_with_http_info(app_id, notification_id, opts)
      data
    end

    # Stop a scheduled or currently outgoing notification
    # Used to stop a scheduled or currently outgoing notification
    # @param app_id [String] 
    # @param notification_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(CancelNotificationSuccessResponse, Integer, Hash)>] CancelNotificationSuccessResponse data, response status code and response headers
    def cancel_notification_with_http_info(app_id, notification_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.cancel_notification ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.cancel_notification"
      end
      # verify the required parameter 'notification_id' is set
      if @api_client.config.client_side_validation && notification_id.nil?
        fail ArgumentError, "Missing the required parameter 'notification_id' when calling DefaultApi.cancel_notification"
      end
      # resource path
      local_var_path = '/notifications/{notification_id}'.sub('{' + 'notification_id' + '}', CGI.escape(notification_id.to_s))

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

      # 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] || 'CancelNotificationSuccessResponse'

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

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

    # Create an app
    # Creates a new OneSignal app
    # @param app [App] 
    # @param [Hash] opts the optional parameters
    # @return [App]
    def create_app(app, opts = {})
      data, _status_code, _headers = create_app_with_http_info(app, opts)
      data
    end

    # Create an app
    # Creates a new OneSignal app
    # @param app [App] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(App, Integer, Hash)>] App data, response status code and response headers
    def create_app_with_http_info(app, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.create_app ...'
      end
      # verify the required parameter 'app' is set
      if @api_client.config.client_side_validation && app.nil?
        fail ArgumentError, "Missing the required parameter 'app' when calling DefaultApi.create_app"
      end
      # resource path
      local_var_path = '/apps'

      # 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(app)

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

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

      new_options = opts.merge(
        :operation => :"DefaultApi.create_app",
        :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: DefaultApi#create_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Create notification
    # Sends notifications to your users 
    # @param notification [Notification] 
    # @param [Hash] opts the optional parameters
    # @return [CreateNotificationSuccessResponse]
    def create_notification(notification, opts = {})
      data, _status_code, _headers = create_notification_with_http_info(notification, opts)
      data
    end

    # Create notification
    # Sends notifications to your users 
    # @param notification [Notification] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(CreateNotificationSuccessResponse, Integer, Hash)>] CreateNotificationSuccessResponse data, response status code and response headers
    def create_notification_with_http_info(notification, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.create_notification ...'
      end
      # verify the required parameter 'notification' is set
      if @api_client.config.client_side_validation && notification.nil?
        fail ArgumentError, "Missing the required parameter 'notification' when calling DefaultApi.create_notification"
      end
      # resource path
      local_var_path = '/notifications'

      # 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(notification)

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

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

      new_options = opts.merge(
        :operation => :"DefaultApi.create_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: DefaultApi#create_notification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Add a device
    # Register a new device to one of your OneSignal apps &#x1F6A7; Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. &#x1F6A7; iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds. 
    # @param player [Player] 
    # @param [Hash] opts the optional parameters
    # @return [CreatePlayerSuccessResponse]
    def create_player(player, opts = {})
      data, _status_code, _headers = create_player_with_http_info(player, opts)
      data
    end

    # Add a device
    # Register a new device to one of your OneSignal apps &amp;#x1F6A7; Don&#39;t use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won&#39;t work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. &amp;#x1F6A7; iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds. 
    # @param player [Player] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(CreatePlayerSuccessResponse, Integer, Hash)>] CreatePlayerSuccessResponse data, response status code and response headers
    def create_player_with_http_info(player, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.create_player ...'
      end
      # verify the required parameter 'player' is set
      if @api_client.config.client_side_validation && player.nil?
        fail ArgumentError, "Missing the required parameter 'player' when calling DefaultApi.create_player"
      end
      # resource path
      local_var_path = '/players'

      # 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(player)

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

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

      new_options = opts.merge(
        :operation => :"DefaultApi.create_player",
        :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: DefaultApi#create_player\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Create Segments
    # Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit. 
    # @param app_id [String] The OneSignal App ID for your app.  Available in Keys &amp; IDs.
    # @param [Hash] opts the optional parameters
    # @option opts [Segment] :segment 
    # @return [CreateSegmentSuccessResponse]
    def create_segments(app_id, opts = {})
      data, _status_code, _headers = create_segments_with_http_info(app_id, opts)
      data
    end

    # Create Segments
    # Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \&quot;AND\&quot; or \&quot;OR\&quot; operator&#39;s. &amp;#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit. 
    # @param app_id [String] The OneSignal App ID for your app.  Available in Keys &amp; IDs.
    # @param [Hash] opts the optional parameters
    # @option opts [Segment] :segment 
    # @return [Array<(CreateSegmentSuccessResponse, Integer, Hash)>] CreateSegmentSuccessResponse data, response status code and response headers
    def create_segments_with_http_info(app_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.create_segments ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.create_segments"
      end
      # resource path
      local_var_path = '/apps/{app_id}/segments'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))

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

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

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

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

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

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

      new_options = opts.merge(
        :operation => :"DefaultApi.create_segments",
        :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: DefaultApi#create_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User.
    # @param app_id [String] 
    # @param alias_label [String] 
    # @param alias_id [String] 
    # @param create_subscription_request_body [CreateSubscriptionRequestBody] 
    # @param [Hash] opts the optional parameters
    # @return [InlineResponse201]
    def create_subscription(app_id, alias_label, alias_id, create_subscription_request_body, opts = {})
      data, _status_code, _headers = create_subscription_with_http_info(app_id, alias_label, alias_id, create_subscription_request_body, opts)
      data
    end

    # Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User.
    # @param app_id [String] 
    # @param alias_label [String] 
    # @param alias_id [String] 
    # @param create_subscription_request_body [CreateSubscriptionRequestBody] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(InlineResponse201, Integer, Hash)>] InlineResponse201 data, response status code and response headers
    def create_subscription_with_http_info(app_id, alias_label, alias_id, create_subscription_request_body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.create_subscription ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.create_subscription"
      end
      # verify the required parameter 'alias_label' is set
      if @api_client.config.client_side_validation && alias_label.nil?
        fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.create_subscription"
      end
      # verify the required parameter 'alias_id' is set
      if @api_client.config.client_side_validation && alias_id.nil?
        fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.create_subscription"
      end
      # verify the required parameter 'create_subscription_request_body' is set
      if @api_client.config.client_side_validation && create_subscription_request_body.nil?
        fail ArgumentError, "Missing the required parameter 'create_subscription_request_body' when calling DefaultApi.create_subscription"
      end
      # resource path
      local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s))

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

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

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

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

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

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

      new_options = opts.merge(
        :operation => :"DefaultApi.create_subscription",
        :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: DefaultApi#create_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User.
    # @param app_id [String] 
    # @param user [User] 
    # @param [Hash] opts the optional parameters
    # @return [User]
    def create_user(app_id, user, opts = {})
      data, _status_code, _headers = create_user_with_http_info(app_id, user, opts)
      data
    end

    # Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User.
    # @param app_id [String] 
    # @param user [User] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers
    def create_user_with_http_info(app_id, user, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.create_user ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.create_user"
      end
      # verify the required parameter 'user' is set
      if @api_client.config.client_side_validation && user.nil?
        fail ArgumentError, "Missing the required parameter 'user' when calling DefaultApi.create_user"
      end
      # resource path
      local_var_path = '/apps/{app_id}/users'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))

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

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

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

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

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

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

      new_options = opts.merge(
        :operation => :"DefaultApi.create_user",
        :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: DefaultApi#create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Deletes an alias by alias label
    # @param app_id [String] 
    # @param alias_label [String] 
    # @param alias_id [String] 
    # @param alias_label_to_delete [String] 
    # @param [Hash] opts the optional parameters
    # @return [InlineResponse200]
    def delete_alias(app_id, alias_label, alias_id, alias_label_to_delete, opts = {})
      data, _status_code, _headers = delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete, opts)
      data
    end

    # Deletes an alias by alias label
    # @param app_id [String] 
    # @param alias_label [String] 
    # @param alias_id [String] 
    # @param alias_label_to_delete [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers
    def delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.delete_alias ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_alias"
      end
      # verify the required parameter 'alias_label' is set
      if @api_client.config.client_side_validation && alias_label.nil?
        fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.delete_alias"
      end
      # verify the required parameter 'alias_id' is set
      if @api_client.config.client_side_validation && alias_id.nil?
        fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.delete_alias"
      end
      # verify the required parameter 'alias_label_to_delete' is set
      if @api_client.config.client_side_validation && alias_label_to_delete.nil?
        fail ArgumentError, "Missing the required parameter 'alias_label_to_delete' when calling DefaultApi.delete_alias"
      end
      # resource path
      local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s)).sub('{' + 'alias_label_to_delete' + '}', CGI.escape(alias_label_to_delete.to_s))

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

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

      # http body (model)
      post_body = opts[:debug_body]

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

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

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

    # Delete a user record
    # Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. 
    # @param app_id [String] The OneSignal App ID for your app.  Available in Keys &amp; IDs.
    # @param player_id [String] The OneSignal player_id
    # @param [Hash] opts the optional parameters
    # @return [DeletePlayerSuccessResponse]
    def delete_player(app_id, player_id, opts = {})
      data, _status_code, _headers = delete_player_with_http_info(app_id, player_id, opts)
      data
    end

    # Delete a user record
    # Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. 
    # @param app_id [String] The OneSignal App ID for your app.  Available in Keys &amp; IDs.
    # @param player_id [String] The OneSignal player_id
    # @param [Hash] opts the optional parameters
    # @return [Array<(DeletePlayerSuccessResponse, Integer, Hash)>] DeletePlayerSuccessResponse data, response status code and response headers
    def delete_player_with_http_info(app_id, player_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.delete_player ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_player"
      end
      # verify the required parameter 'player_id' is set
      if @api_client.config.client_side_validation && player_id.nil?
        fail ArgumentError, "Missing the required parameter 'player_id' when calling DefaultApi.delete_player"
      end
      # resource path
      local_var_path = '/players/{player_id}'.sub('{' + 'player_id' + '}', CGI.escape(player_id.to_s))

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

      # 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] || 'DeletePlayerSuccessResponse'

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

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

    # Delete Segments
    # Delete segments (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. 
    # @param app_id [String] The OneSignal App ID for your app.  Available in Keys &amp; IDs.
    # @param segment_id [String] The segment_id can be found in the URL of the segment when viewing it in the dashboard.
    # @param [Hash] opts the optional parameters
    # @return [DeleteSegmentSuccessResponse]
    def delete_segments(app_id, segment_id, opts = {})
      data, _status_code, _headers = delete_segments_with_http_info(app_id, segment_id, opts)
      data
    end

    # Delete Segments
    # Delete segments (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. 
    # @param app_id [String] The OneSignal App ID for your app.  Available in Keys &amp; IDs.
    # @param segment_id [String] The segment_id can be found in the URL of the segment when viewing it in the dashboard.
    # @param [Hash] opts the optional parameters
    # @return [Array<(DeleteSegmentSuccessResponse, Integer, Hash)>] DeleteSegmentSuccessResponse data, response status code and response headers
    def delete_segments_with_http_info(app_id, segment_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.delete_segments ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_segments"
      end
      # verify the required parameter 'segment_id' is set
      if @api_client.config.client_side_validation && segment_id.nil?
        fail ArgumentError, "Missing the required parameter 'segment_id' when calling DefaultApi.delete_segments"
      end
      # resource path
      local_var_path = '/apps/{app_id}/segments/{segment_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'segment_id' + '}', CGI.escape(segment_id.to_s))

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

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

      # http body (model)
      post_body = opts[:debug_body]

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

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

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

    # Deletes the Subscription.
    # @param app_id [String] 
    # @param subscription_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def delete_subscription(app_id, subscription_id, opts = {})
      delete_subscription_with_http_info(app_id, subscription_id, opts)
      nil
    end

    # Deletes the Subscription.
    # @param app_id [String] 
    # @param subscription_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def delete_subscription_with_http_info(app_id, subscription_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.delete_subscription ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_subscription"
      end
      # verify the required parameter 'subscription_id' is set
      if @api_client.config.client_side_validation && subscription_id.nil?
        fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.delete_subscription"
      end
      # resource path
      local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s))

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

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type]

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

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

    # Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases
    # @param app_id [String] 
    # @param alias_label [String] 
    # @param alias_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def delete_user(app_id, alias_label, alias_id, opts = {})
      delete_user_with_http_info(app_id, alias_label, alias_id, opts)
      nil
    end

    # Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases
    # @param app_id [String] 
    # @param alias_label [String] 
    # @param alias_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def delete_user_with_http_info(app_id, alias_label, alias_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.delete_user ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_user"
      end
      # verify the required parameter 'alias_label' is set
      if @api_client.config.client_side_validation && alias_label.nil?
        fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.delete_user"
      end
      # verify the required parameter 'alias_id' is set
      if @api_client.config.client_side_validation && alias_id.nil?
        fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.delete_user"
      end
      # resource path
      local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s))

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

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type]

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

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

    # Stop Live Activity
    # Stops a Live Activity
    # @param app_id [String] The OneSignal App ID for your app.  Available in Keys &amp; IDs.
    # @param activity_id [String] Live Activity record ID
    # @param subscription_id [String] Subscription ID
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def end_live_activity(app_id, activity_id, subscription_id, opts = {})
      end_live_activity_with_http_info(app_id, activity_id, subscription_id, opts)
      nil
    end

    # Stop Live Activity
    # Stops a Live Activity
    # @param app_id [String] The OneSignal App ID for your app.  Available in Keys &amp; IDs.
    # @param activity_id [String] Live Activity record ID
    # @param subscription_id [String] Subscription ID
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def end_live_activity_with_http_info(app_id, activity_id, subscription_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.end_live_activity ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.end_live_activity"
      end
      # verify the required parameter 'activity_id' is set
      if @api_client.config.client_side_validation && activity_id.nil?
        fail ArgumentError, "Missing the required parameter 'activity_id' when calling DefaultApi.end_live_activity"
      end
      # verify the required parameter 'subscription_id' is set
      if @api_client.config.client_side_validation && subscription_id.nil?
        fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.end_live_activity"
      end
      # resource path
      local_var_path = '/apps/{app_id}/live_activities/{activity_id}/token/{subscription_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'activity_id' + '}', CGI.escape(activity_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s))

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

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type]

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

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

    # Export CSV of Events
    # Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time.
    # @param notification_id [String] The ID of the notification to export events from.
    # @param app_id [String] The ID of the app that the notification belongs to.
    # @param [Hash] opts the optional parameters
    # @return [ExportEventsSuccessResponse]
    def export_events(notification_id, app_id, opts = {})
      data, _status_code, _headers = export_events_with_http_info(notification_id, app_id, opts)
      data
    end

    # Export CSV of Events
    # Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time.
    # @param notification_id [String] The ID of the notification to export events from.
    # @param app_id [String] The ID of the app that the notification belongs to.
    # @param [Hash] opts the optional parameters
    # @return [Array<(ExportEventsSuccessResponse, Integer, Hash)>] ExportEventsSuccessResponse data, response status code and response headers
    def export_events_with_http_info(notification_id, app_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.export_events ...'
      end
      # verify the required parameter 'notification_id' is set
      if @api_client.config.client_side_validation && notification_id.nil?
        fail ArgumentError, "Missing the required parameter 'notification_id' when calling DefaultApi.export_events"
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.export_events"
      end
      # resource path
      local_var_path = '/notifications/{notification_id}/export_events?app_id={app_id}'.sub('{' + 'notification_id' + '}', CGI.escape(notification_id.to_s))

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

      # 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] || 'ExportEventsSuccessResponse'

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

      new_options = opts.merge(
        :operation => :"DefaultApi.export_events",
        :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: DefaultApi#export_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Export CSV of Players
    # Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses          You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns:   | Field | Details |   | --- | --- |   | id | OneSignal Player Id |   | identifier | Push Token |   | session_count | Number of times they visited the app or site   | language | Device language code |   | timezone | Number of seconds away from UTC. Example: -28800 |   | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. |   | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 |   | device_type | Device Operating System Type |   | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` |   | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. |   | tags | Current OneSignal Data Tags on the device. |   | last_active | Date and time the user last opened the mobile app or visited the site. |   | playtime | Total amount of time in seconds the user had the mobile app open. |   | amount_spent |  Mobile only - amount spent in USD on In-App Purchases. |    | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. |   | invalid_identifier | t = unsubscribed, f = subscibed |   | badge_count | Current number of badges on the device | - Extra Columns:   | Field | Details |   | --- | --- |   | external_user_id | Your User Id set on the device |   | notification_types | Notification types |   | location | Location points (Latitude and Longitude) set on the device. |   | country | Country code |   | rooted | Android device rooted or not |   | ip | IP Address of the device if being tracked. See Handling Personal Data. |   | web_auth | Web Only authorization key. |   | web_p256 | Web Only p256 key. | 
    # @param app_id [String] The app ID that you want to export devices from
    # @param [Hash] opts the optional parameters
    # @option opts [ExportPlayersRequestBody] :export_players_request_body 
    # @return [ExportPlayersSuccessResponse]
    def export_players(app_id, opts = {})
      data, _status_code, _headers = export_players_with_http_info(app_id, opts)
      data
    end

    # Export CSV of Players
    # Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &amp;#x1F6A7; 403 Error Responses          You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &amp;#x1F6A7; Requires Authentication Key Requires your OneSignal App&#39;s REST API Key, available in Keys &amp; IDs. &amp;#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns:   | Field | Details |   | --- | --- |   | id | OneSignal Player Id |   | identifier | Push Token |   | session_count | Number of times they visited the app or site   | language | Device language code |   | timezone | Number of seconds away from UTC. Example: -28800 |   | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. |   | device_os | Device Operating System Version. Example: 80 &#x3D; Chrome 80, 9 &#x3D; Android 9 |   | device_type | Device Operating System Type |   | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have &#x60;Linux armv&#x60; |   | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. |   | tags | Current OneSignal Data Tags on the device. |   | last_active | Date and time the user last opened the mobile app or visited the site. |   | playtime | Total amount of time in seconds the user had the mobile app open. |   | amount_spent |  Mobile only - amount spent in USD on In-App Purchases. |    | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. |   | invalid_identifier | t &#x3D; unsubscribed, f &#x3D; subscibed |   | badge_count | Current number of badges on the device | - Extra Columns:   | Field | Details |   | --- | --- |   | external_user_id | Your User Id set on the device |   | notification_types | Notification types |   | location | Location points (Latitude and Longitude) set on the device. |   | country | Country code |   | rooted | Android device rooted or not |   | ip | IP Address of the device if being tracked. See Handling Personal Data. |   | web_auth | Web Only authorization key. |   | web_p256 | Web Only p256 key. | 
    # @param app_id [String] The app ID that you want to export devices from
    # @param [Hash] opts the optional parameters
    # @option opts [ExportPlayersRequestBody] :export_players_request_body 
    # @return [Array<(ExportPlayersSuccessResponse, Integer, Hash)>] ExportPlayersSuccessResponse data, response status code and response headers
    def export_players_with_http_info(app_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.export_players ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.export_players"
      end
      # resource path
      local_var_path = '/players/csv_export?app_id={app_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))

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

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

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

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

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

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

      new_options = opts.merge(
        :operation => :"DefaultApi.export_players",
        :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: DefaultApi#export_players\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Lists all Aliases for the User identified by :subscription_id.
    # @param app_id [String] 
    # @param subscription_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [UserIdentityResponse]
    def fetch_aliases(app_id, subscription_id, opts = {})
      data, _status_code, _headers = fetch_aliases_with_http_info(app_id, subscription_id, opts)
      data
    end

    # Lists all Aliases for the User identified by :subscription_id.
    # @param app_id [String] 
    # @param subscription_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(UserIdentityResponse, Integer, Hash)>] UserIdentityResponse data, response status code and response headers
    def fetch_aliases_with_http_info(app_id, subscription_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.fetch_aliases ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.fetch_aliases"
      end
      # verify the required parameter 'subscription_id' is set
      if @api_client.config.client_side_validation && subscription_id.nil?
        fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.fetch_aliases"
      end
      # resource path
      local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}/user/identity'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s))

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

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

      # http body (model)
      post_body = opts[:debug_body]

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

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

      new_options = opts.merge(
        :operation => :"DefaultApi.fetch_aliases",
        :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: DefaultApi#fetch_aliases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Returns the User’s properties, Aliases, and Subscriptions.
    # @param app_id [String] 
    # @param alias_label [String] 
    # @param alias_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [User]
    def fetch_user(app_id, alias_label, alias_id, opts = {})
      data, _status_code, _headers = fetch_user_with_http_info(app_id, alias_label, alias_id, opts)
      data
    end

    # Returns the User’s properties, Aliases, and Subscriptions.
    # @param app_id [String] 
    # @param alias_label [String] 
    # @param alias_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers
    def fetch_user_with_http_info(app_id, alias_label, alias_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.fetch_user ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.fetch_user"
      end
      # verify the required parameter 'alias_label' is set
      if @api_client.config.client_side_validation && alias_label.nil?
        fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.fetch_user"
      end
      # verify the required parameter 'alias_id' is set
      if @api_client.config.client_side_validation && alias_id.nil?
        fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.fetch_user"
      end
      # resource path
      local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s))

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

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

      # http body (model)
      post_body = opts[:debug_body]

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

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

      new_options = opts.merge(
        :operation => :"DefaultApi.fetch_user",
        :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: DefaultApi#fetch_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Lists all Aliases for the User identified by (:alias_label, :alias_id).
    # @param app_id [String] 
    # @param alias_label [String] 
    # @param alias_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [InlineResponse200]
    def fetch_user_identity(app_id, alias_label, alias_id, opts = {})
      data, _status_code, _headers = fetch_user_identity_with_http_info(app_id, alias_label, alias_id, opts)
      data
    end

    # Lists all Aliases for the User identified by (:alias_label, :alias_id).
    # @param app_id [String] 
    # @param alias_label [String] 
    # @param alias_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers
    def fetch_user_identity_with_http_info(app_id, alias_label, alias_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.fetch_user_identity ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.fetch_user_identity"
      end
      # verify the required parameter 'alias_label' is set
      if @api_client.config.client_side_validation && alias_label.nil?
        fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.fetch_user_identity"
      end
      # verify the required parameter 'alias_id' is set
      if @api_client.config.client_side_validation && alias_id.nil?
        fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.fetch_user_identity"
      end
      # resource path
      local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s))

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

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

      # http body (model)
      post_body = opts[:debug_body]

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

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

      new_options = opts.merge(
        :operation => :"DefaultApi.fetch_user_identity",
        :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: DefaultApi#fetch_user_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # View an app
    # View the details of a single OneSignal app
    # @param app_id [String] An app id
    # @param [Hash] opts the optional parameters
    # @return [App]
    def get_app(app_id, opts = {})
      data, _status_code, _headers = get_app_with_http_info(app_id, opts)
      data
    end

    # View an app
    # View the details of a single OneSignal app
    # @param app_id [String] An app id
    # @param [Hash] opts the optional parameters
    # @return [Array<(App, Integer, Hash)>] App data, response status code and response headers
    def get_app_with_http_info(app_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.get_app ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_app"
      end
      # resource path
      local_var_path = '/apps/{app_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))

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

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

      # http body (model)
      post_body = opts[:debug_body]

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

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

      new_options = opts.merge(
        :operation => :"DefaultApi.get_app",
        :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: DefaultApi#get_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # View apps
    # View the details of all of your current OneSignal apps
    # @param [Hash] opts the optional parameters
    # @return [Array<App>]
    def get_apps(opts = {})
      data, _status_code, _headers = get_apps_with_http_info(opts)
      data
    end

    # View apps
    # View the details of all of your current OneSignal apps
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<App>, Integer, Hash)>] Array<App> data, response status code and response headers
    def get_apps_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.get_apps ...'
      end
      # resource path
      local_var_path = '/apps'

      # 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] || 'Array<App>'

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

      new_options = opts.merge(
        :operation => :"DefaultApi.get_apps",
        :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: DefaultApi#get_apps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Manifest of In-App Messages the Subscription is eligible to display by the SDK.
    # @param app_id [String] 
    # @param subscription_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [InlineResponse2003]
    def get_eligible_iams(app_id, subscription_id, opts = {})
      data, _status_code, _headers = get_eligible_iams_with_http_info(app_id, subscription_id, opts)
      data
    end

    # Manifest of In-App Messages the Subscription is eligible to display by the SDK.
    # @param app_id [String] 
    # @param subscription_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(InlineResponse2003, Integer, Hash)>] InlineResponse2003 data, response status code and response headers
    def get_eligible_iams_with_http_info(app_id, subscription_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.get_eligible_iams ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_eligible_iams"
      end
      # verify the required parameter 'subscription_id' is set
      if @api_client.config.client_side_validation && subscription_id.nil?
        fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.get_eligible_iams"
      end
      # resource path
      local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}/iams'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s))

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

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

      # http body (model)
      post_body = opts[:debug_body]

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

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

      new_options = opts.merge(
        :operation => :"DefaultApi.get_eligible_iams",
        :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: DefaultApi#get_eligible_iams\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # View notification
    # View the details of a single notification and outcomes associated with it
    # @param app_id [String] 
    # @param notification_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [NotificationWithMeta]
    def get_notification(app_id, notification_id, opts = {})
      data, _status_code, _headers = get_notification_with_http_info(app_id, notification_id, opts)
      data
    end

    # View notification
    # View the details of a single notification and outcomes associated with it
    # @param app_id [String] 
    # @param notification_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(NotificationWithMeta, Integer, Hash)>] NotificationWithMeta data, response status code and response headers
    def get_notification_with_http_info(app_id, notification_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.get_notification ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_notification"
      end
      # verify the required parameter 'notification_id' is set
      if @api_client.config.client_side_validation && notification_id.nil?
        fail ArgumentError, "Missing the required parameter 'notification_id' when calling DefaultApi.get_notification"
      end
      # resource path
      local_var_path = '/notifications/{notification_id}'.sub('{' + 'notification_id' + '}', CGI.escape(notification_id.to_s))

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

      # 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] || 'NotificationWithMeta'

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

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

    # Notification History
    # -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. &#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs.
    # @param notification_id [String] The \&quot;id\&quot; of the message found in the Notification object
    # @param get_notification_request_body [GetNotificationRequestBody] 
    # @param [Hash] opts the optional parameters
    # @return [NotificationHistorySuccessResponse]
    def get_notification_history(notification_id, get_notification_request_body, opts = {})
      data, _status_code, _headers = get_notification_history_with_http_info(notification_id, get_notification_request_body, opts)
      data
    end

    # Notification History
    # -&gt; View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. &amp;#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -&gt; Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \&quot;sent\&quot; events recorded, but will show \&quot;clicked\&quot; events. Requires your OneSignal App&#39;s REST API Key, available in Keys &amp; IDs.
    # @param notification_id [String] The \&quot;id\&quot; of the message found in the Notification object
    # @param get_notification_request_body [GetNotificationRequestBody] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(NotificationHistorySuccessResponse, Integer, Hash)>] NotificationHistorySuccessResponse data, response status code and response headers
    def get_notification_history_with_http_info(notification_id, get_notification_request_body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.get_notification_history ...'
      end
      # verify the required parameter 'notification_id' is set
      if @api_client.config.client_side_validation && notification_id.nil?
        fail ArgumentError, "Missing the required parameter 'notification_id' when calling DefaultApi.get_notification_history"
      end
      # verify the required parameter 'get_notification_request_body' is set
      if @api_client.config.client_side_validation && get_notification_request_body.nil?
        fail ArgumentError, "Missing the required parameter 'get_notification_request_body' when calling DefaultApi.get_notification_history"
      end
      # resource path
      local_var_path = '/notifications/{notification_id}/history'.sub('{' + 'notification_id' + '}', CGI.escape(notification_id.to_s))

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

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

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

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

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

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

      new_options = opts.merge(
        :operation => :"DefaultApi.get_notification_history",
        :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: DefaultApi#get_notification_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # View notifications
    # View the details of multiple notifications
    # @param app_id [String] The app ID that you want to view notifications from
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :limit How many notifications to return.  Max is 50.  Default is 50.
    # @option opts [Integer] :offset Page offset.  Default is 0.  Results are sorted by queued_at in descending order.  queued_at is a representation of the time that the notification was queued at.
    # @option opts [Integer] :kind Kind of notifications returned:   * unset - All notification types (default)   * &#x60;0&#x60; - Dashboard only   * &#x60;1&#x60; - API only   * &#x60;3&#x60; - Automated only 
    # @return [NotificationSlice]
    def get_notifications(app_id, opts = {})
      data, _status_code, _headers = get_notifications_with_http_info(app_id, opts)
      data
    end

    # View notifications
    # View the details of multiple notifications
    # @param app_id [String] The app ID that you want to view notifications from
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :limit How many notifications to return.  Max is 50.  Default is 50.
    # @option opts [Integer] :offset Page offset.  Default is 0.  Results are sorted by queued_at in descending order.  queued_at is a representation of the time that the notification was queued at.
    # @option opts [Integer] :kind Kind of notifications returned:   * unset - All notification types (default)   * &#x60;0&#x60; - Dashboard only   * &#x60;1&#x60; - API only   * &#x60;3&#x60; - Automated only 
    # @return [Array<(NotificationSlice, Integer, Hash)>] NotificationSlice data, response status code and response headers
    def get_notifications_with_http_info(app_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.get_notifications ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_notifications"
      end
      allowable_values = [0, 1, 3]
      if @api_client.config.client_side_validation && opts[:'kind'] && !allowable_values.include?(opts[:'kind'])
        fail ArgumentError, "invalid value for \"kind\", must be one of #{allowable_values}"
      end
      # resource path
      local_var_path = '/notifications'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'app_id'] = app_id
      query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
      query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
      query_params[:'kind'] = opts[:'kind'] if !opts[:'kind'].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] || 'NotificationSlice'

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

      new_options = opts.merge(
        :operation => :"DefaultApi.get_notifications",
        :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: DefaultApi#get_notifications\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # View Outcomes
    # View the details of all the outcomes associated with your app  &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs.  &#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. 
    # @param app_id [String] The OneSignal App ID for your app.  Available in Keys &amp; IDs.
    # @param outcome_names [String] Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \&quot;os\&quot; prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :outcome_names2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]&#x3D;os__click.count&amp;outcome_names[]&#x3D;Sales, Purchase.count where \&quot;Sales, Purchase\&quot; is the custom outcomes with a comma in the name. 
    # @option opts [String] :outcome_time_range Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. 
    # @option opts [String] :outcome_platforms Optional Platform id. Refer device&#39;s platform ids for values. Example: outcome_platform&#x3D;0 for iOS outcome_platform&#x3D;7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. 
    # @option opts [String] :outcome_attribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution&#x3D;direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. 
    # @return [OutcomesData]
    def get_outcomes(app_id, outcome_names, opts = {})
      data, _status_code, _headers = get_outcomes_with_http_info(app_id, outcome_names, opts)
      data
    end

    # View Outcomes
    # View the details of all the outcomes associated with your app  &amp;#x1F6A7; Requires Authentication Key Requires your OneSignal App&#39;s REST API Key, available in Keys &amp; IDs.  &amp;#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. 
    # @param app_id [String] The OneSignal App ID for your app.  Available in Keys &amp; IDs.
    # @param outcome_names [String] Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \&quot;os\&quot; prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :outcome_names2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]&#x3D;os__click.count&amp;outcome_names[]&#x3D;Sales, Purchase.count where \&quot;Sales, Purchase\&quot; is the custom outcomes with a comma in the name. 
    # @option opts [String] :outcome_time_range Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. 
    # @option opts [String] :outcome_platforms Optional Platform id. Refer device&#39;s platform ids for values. Example: outcome_platform&#x3D;0 for iOS outcome_platform&#x3D;7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. 
    # @option opts [String] :outcome_attribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution&#x3D;direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. 
    # @return [Array<(OutcomesData, Integer, Hash)>] OutcomesData data, response status code and response headers
    def get_outcomes_with_http_info(app_id, outcome_names, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.get_outcomes ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_outcomes"
      end
      # verify the required parameter 'outcome_names' is set
      if @api_client.config.client_side_validation && outcome_names.nil?
        fail ArgumentError, "Missing the required parameter 'outcome_names' when calling DefaultApi.get_outcomes"
      end
      # resource path
      local_var_path = '/apps/{app_id}/outcomes'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'outcome_names'] = outcome_names
      query_params[:'outcome_names[]'] = opts[:'outcome_names2'] if !opts[:'outcome_names2'].nil?
      query_params[:'outcome_time_range'] = opts[:'outcome_time_range'] if !opts[:'outcome_time_range'].nil?
      query_params[:'outcome_platforms'] = opts[:'outcome_platforms'] if !opts[:'outcome_platforms'].nil?
      query_params[:'outcome_attribution'] = opts[:'outcome_attribution'] if !opts[:'outcome_attribution'].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] || 'OutcomesData'

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

      new_options = opts.merge(
        :operation => :"DefaultApi.get_outcomes",
        :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: DefaultApi#get_outcomes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # View device
    # View the details of an existing device in one of your OneSignal apps
    # @param app_id [String] Your app_id for this device
    # @param player_id [String] Player&#39;s OneSignal ID
    # @param [Hash] opts the optional parameters
    # @option opts [String] :email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11).
    # @return [Player]
    def get_player(app_id, player_id, opts = {})
      data, _status_code, _headers = get_player_with_http_info(app_id, player_id, opts)
      data
    end

    # View device
    # View the details of an existing device in one of your OneSignal apps
    # @param app_id [String] Your app_id for this device
    # @param player_id [String] Player&#39;s OneSignal ID
    # @param [Hash] opts the optional parameters
    # @option opts [String] :email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11).
    # @return [Array<(Player, Integer, Hash)>] Player data, response status code and response headers
    def get_player_with_http_info(app_id, player_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.get_player ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_player"
      end
      # verify the required parameter 'player_id' is set
      if @api_client.config.client_side_validation && player_id.nil?
        fail ArgumentError, "Missing the required parameter 'player_id' when calling DefaultApi.get_player"
      end
      # resource path
      local_var_path = '/players/{player_id}'.sub('{' + 'player_id' + '}', CGI.escape(player_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'app_id'] = app_id
      query_params[:'email_auth_hash'] = opts[:'email_auth_hash'] if !opts[:'email_auth_hash'].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] || 'Player'

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

      new_options = opts.merge(
        :operation => :"DefaultApi.get_player",
        :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: DefaultApi#get_player\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # View devices
    # View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. 
    # @param app_id [String] The app ID that you want to view players from
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :limit How many devices to return. Max is 300. Default is 300
    # @option opts [Integer] :offset Result offset. Default is 0. Results are sorted by id;
    # @return [PlayerSlice]
    def get_players(app_id, opts = {})
      data, _status_code, _headers = get_players_with_http_info(app_id, opts)
      data
    end

    # View devices
    # View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. 
    # @param app_id [String] The app ID that you want to view players from
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :limit How many devices to return. Max is 300. Default is 300
    # @option opts [Integer] :offset Result offset. Default is 0. Results are sorted by id;
    # @return [Array<(PlayerSlice, Integer, Hash)>] PlayerSlice data, response status code and response headers
    def get_players_with_http_info(app_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.get_players ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_players"
      end
      # resource path
      local_var_path = '/players'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'app_id'] = app_id
      query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
      query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].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] || 'PlayerSlice'

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

      new_options = opts.merge(
        :operation => :"DefaultApi.get_players",
        :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: DefaultApi#get_players\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id).
    # @param app_id [String] 
    # @param alias_label [String] 
    # @param alias_id [String] 
    # @param user_identity_request_body [UserIdentityRequestBody] 
    # @param [Hash] opts the optional parameters
    # @return [InlineResponse200]
    def identify_user_by_alias(app_id, alias_label, alias_id, user_identity_request_body, opts = {})
      data, _status_code, _headers = identify_user_by_alias_with_http_info(app_id, alias_label, alias_id, user_identity_request_body, opts)
      data
    end

    # Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id).
    # @param app_id [String] 
    # @param alias_label [String] 
    # @param alias_id [String] 
    # @param user_identity_request_body [UserIdentityRequestBody] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers
    def identify_user_by_alias_with_http_info(app_id, alias_label, alias_id, user_identity_request_body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.identify_user_by_alias ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.identify_user_by_alias"
      end
      # verify the required parameter 'alias_label' is set
      if @api_client.config.client_side_validation && alias_label.nil?
        fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.identify_user_by_alias"
      end
      # verify the required parameter 'alias_id' is set
      if @api_client.config.client_side_validation && alias_id.nil?
        fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.identify_user_by_alias"
      end
      # verify the required parameter 'user_identity_request_body' is set
      if @api_client.config.client_side_validation && user_identity_request_body.nil?
        fail ArgumentError, "Missing the required parameter 'user_identity_request_body' when calling DefaultApi.identify_user_by_alias"
      end
      # resource path
      local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s))

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

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

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

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

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

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

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

    # Upserts one or more Aliases for the User identified by :subscription_id.
    # @param app_id [String] 
    # @param subscription_id [String] 
    # @param user_identity_request_body [UserIdentityRequestBody] 
    # @param [Hash] opts the optional parameters
    # @return [UserIdentityResponse]
    def identify_user_by_subscription_id(app_id, subscription_id, user_identity_request_body, opts = {})
      data, _status_code, _headers = identify_user_by_subscription_id_with_http_info(app_id, subscription_id, user_identity_request_body, opts)
      data
    end

    # Upserts one or more Aliases for the User identified by :subscription_id.
    # @param app_id [String] 
    # @param subscription_id [String] 
    # @param user_identity_request_body [UserIdentityRequestBody] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(UserIdentityResponse, Integer, Hash)>] UserIdentityResponse data, response status code and response headers
    def identify_user_by_subscription_id_with_http_info(app_id, subscription_id, user_identity_request_body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.identify_user_by_subscription_id ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.identify_user_by_subscription_id"
      end
      # verify the required parameter 'subscription_id' is set
      if @api_client.config.client_side_validation && subscription_id.nil?
        fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.identify_user_by_subscription_id"
      end
      # verify the required parameter 'user_identity_request_body' is set
      if @api_client.config.client_side_validation && user_identity_request_body.nil?
        fail ArgumentError, "Missing the required parameter 'user_identity_request_body' when calling DefaultApi.identify_user_by_subscription_id"
      end
      # resource path
      local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}/user/identity'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s))

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

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

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

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

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

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

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

    # Transfers this Subscription to the User identified by the identity in the payload.
    # @param app_id [String] 
    # @param subscription_id [String] 
    # @param transfer_subscription_request_body [TransferSubscriptionRequestBody] 
    # @param [Hash] opts the optional parameters
    # @return [UserIdentityResponse]
    def transfer_subscription(app_id, subscription_id, transfer_subscription_request_body, opts = {})
      data, _status_code, _headers = transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body, opts)
      data
    end

    # Transfers this Subscription to the User identified by the identity in the payload.
    # @param app_id [String] 
    # @param subscription_id [String] 
    # @param transfer_subscription_request_body [TransferSubscriptionRequestBody] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(UserIdentityResponse, Integer, Hash)>] UserIdentityResponse data, response status code and response headers
    def transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.transfer_subscription ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.transfer_subscription"
      end
      # verify the required parameter 'subscription_id' is set
      if @api_client.config.client_side_validation && subscription_id.nil?
        fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.transfer_subscription"
      end
      # verify the required parameter 'transfer_subscription_request_body' is set
      if @api_client.config.client_side_validation && transfer_subscription_request_body.nil?
        fail ArgumentError, "Missing the required parameter 'transfer_subscription_request_body' when calling DefaultApi.transfer_subscription"
      end
      # resource path
      local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}/owner'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s))

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

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

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

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

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

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

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

    # Update an app
    # Updates the name or configuration settings of an existing OneSignal app
    # @param app_id [String] An app id
    # @param app [App] 
    # @param [Hash] opts the optional parameters
    # @return [App]
    def update_app(app_id, app, opts = {})
      data, _status_code, _headers = update_app_with_http_info(app_id, app, opts)
      data
    end

    # Update an app
    # Updates the name or configuration settings of an existing OneSignal app
    # @param app_id [String] An app id
    # @param app [App] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(App, Integer, Hash)>] App data, response status code and response headers
    def update_app_with_http_info(app_id, app, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.update_app ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.update_app"
      end
      # verify the required parameter 'app' is set
      if @api_client.config.client_side_validation && app.nil?
        fail ArgumentError, "Missing the required parameter 'app' when calling DefaultApi.update_app"
      end
      # resource path
      local_var_path = '/apps/{app_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))

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

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

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

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

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

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

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

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

    # Update a Live Activity via Push
    # Updates a specified live activity.
    # @param app_id [String] The OneSignal App ID for your app.  Available in Keys &amp; IDs.
    # @param activity_id [String] Live Activity record ID
    # @param update_live_activity_request [UpdateLiveActivityRequest] 
    # @param [Hash] opts the optional parameters
    # @return [UpdateLiveActivitySuccessResponse]
    def update_live_activity(app_id, activity_id, update_live_activity_request, opts = {})
      data, _status_code, _headers = update_live_activity_with_http_info(app_id, activity_id, update_live_activity_request, opts)
      data
    end

    # Update a Live Activity via Push
    # Updates a specified live activity.
    # @param app_id [String] The OneSignal App ID for your app.  Available in Keys &amp; IDs.
    # @param activity_id [String] Live Activity record ID
    # @param update_live_activity_request [UpdateLiveActivityRequest] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(UpdateLiveActivitySuccessResponse, Integer, Hash)>] UpdateLiveActivitySuccessResponse data, response status code and response headers
    def update_live_activity_with_http_info(app_id, activity_id, update_live_activity_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.update_live_activity ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.update_live_activity"
      end
      # verify the required parameter 'activity_id' is set
      if @api_client.config.client_side_validation && activity_id.nil?
        fail ArgumentError, "Missing the required parameter 'activity_id' when calling DefaultApi.update_live_activity"
      end
      # verify the required parameter 'update_live_activity_request' is set
      if @api_client.config.client_side_validation && update_live_activity_request.nil?
        fail ArgumentError, "Missing the required parameter 'update_live_activity_request' when calling DefaultApi.update_live_activity"
      end
      # resource path
      local_var_path = '/apps/{app_id}/live_activities/{activity_id}/notifications'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'activity_id' + '}', CGI.escape(activity_id.to_s))

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

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

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

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

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

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

      new_options = opts.merge(
        :operation => :"DefaultApi.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: DefaultApi#update_live_activity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Edit device
    # Update an existing device in one of your OneSignal apps
    # @param player_id [String] Player&#39;s OneSignal ID
    # @param player [Player] 
    # @param [Hash] opts the optional parameters
    # @return [UpdatePlayerSuccessResponse]
    def update_player(player_id, player, opts = {})
      data, _status_code, _headers = update_player_with_http_info(player_id, player, opts)
      data
    end

    # Edit device
    # Update an existing device in one of your OneSignal apps
    # @param player_id [String] Player&#39;s OneSignal ID
    # @param player [Player] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(UpdatePlayerSuccessResponse, Integer, Hash)>] UpdatePlayerSuccessResponse data, response status code and response headers
    def update_player_with_http_info(player_id, player, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.update_player ...'
      end
      # verify the required parameter 'player_id' is set
      if @api_client.config.client_side_validation && player_id.nil?
        fail ArgumentError, "Missing the required parameter 'player_id' when calling DefaultApi.update_player"
      end
      # verify the required parameter 'player' is set
      if @api_client.config.client_side_validation && player.nil?
        fail ArgumentError, "Missing the required parameter 'player' when calling DefaultApi.update_player"
      end
      # resource path
      local_var_path = '/players/{player_id}'.sub('{' + 'player_id' + '}', CGI.escape(player_id.to_s))

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

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

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

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

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

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

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

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

    # Edit tags with external user id
    # Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. &#128216; Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": {    \"rank\": \"\",    \"category\": \"\",    \"class\": \"my_new_value\" } 
    # @param app_id [String] The OneSignal App ID the user record is found under.
    # @param external_user_id [String] The External User ID mapped to teh device record in OneSignal.  Must be actively set on the device to be updated.
    # @param [Hash] opts the optional parameters
    # @option opts [UpdatePlayerTagsRequestBody] :update_player_tags_request_body 
    # @return [UpdatePlayerTagsSuccessResponse]
    def update_player_tags(app_id, external_user_id, opts = {})
      data, _status_code, _headers = update_player_tags_with_http_info(app_id, external_user_id, opts)
      data
    end

    # Edit tags with external user id
    # Update an existing device&#39;s tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\&quot;key\&quot;, \&quot;value1\&quot;) then update the tag value to \&quot;value2\&quot; with this API endpoint. You will not be able to set the value back to \&quot;value1\&quot; through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device&#39;s tags. This is only applicable on the Android Mobile App SDKs. &amp;#128216; Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \&quot;tags\&quot;: {    \&quot;rank\&quot;: \&quot;\&quot;,    \&quot;category\&quot;: \&quot;\&quot;,    \&quot;class\&quot;: \&quot;my_new_value\&quot; } 
    # @param app_id [String] The OneSignal App ID the user record is found under.
    # @param external_user_id [String] The External User ID mapped to teh device record in OneSignal.  Must be actively set on the device to be updated.
    # @param [Hash] opts the optional parameters
    # @option opts [UpdatePlayerTagsRequestBody] :update_player_tags_request_body 
    # @return [Array<(UpdatePlayerTagsSuccessResponse, Integer, Hash)>] UpdatePlayerTagsSuccessResponse data, response status code and response headers
    def update_player_tags_with_http_info(app_id, external_user_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.update_player_tags ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.update_player_tags"
      end
      # verify the required parameter 'external_user_id' is set
      if @api_client.config.client_side_validation && external_user_id.nil?
        fail ArgumentError, "Missing the required parameter 'external_user_id' when calling DefaultApi.update_player_tags"
      end
      # resource path
      local_var_path = '/apps/{app_id}/users/{external_user_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'external_user_id' + '}', CGI.escape(external_user_id.to_s))

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

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

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

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

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

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

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

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

    # Updates an existing Subscription’s properties.
    # @param app_id [String] 
    # @param subscription_id [String] 
    # @param update_subscription_request_body [UpdateSubscriptionRequestBody] 
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def update_subscription(app_id, subscription_id, update_subscription_request_body, opts = {})
      update_subscription_with_http_info(app_id, subscription_id, update_subscription_request_body, opts)
      nil
    end

    # Updates an existing Subscription’s properties.
    # @param app_id [String] 
    # @param subscription_id [String] 
    # @param update_subscription_request_body [UpdateSubscriptionRequestBody] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def update_subscription_with_http_info(app_id, subscription_id, update_subscription_request_body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.update_subscription ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.update_subscription"
      end
      # verify the required parameter 'subscription_id' is set
      if @api_client.config.client_side_validation && subscription_id.nil?
        fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.update_subscription"
      end
      # verify the required parameter 'update_subscription_request_body' is set
      if @api_client.config.client_side_validation && update_subscription_request_body.nil?
        fail ArgumentError, "Missing the required parameter 'update_subscription_request_body' when calling DefaultApi.update_subscription"
      end
      # resource path
      local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s))

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

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

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

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

      # return_type
      return_type = opts[:debug_return_type]

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

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

    # Updates an existing User’s properties.
    # @param app_id [String] 
    # @param alias_label [String] 
    # @param alias_id [String] 
    # @param update_user_request [UpdateUserRequest] 
    # @param [Hash] opts the optional parameters
    # @return [InlineResponse202]
    def update_user(app_id, alias_label, alias_id, update_user_request, opts = {})
      data, _status_code, _headers = update_user_with_http_info(app_id, alias_label, alias_id, update_user_request, opts)
      data
    end

    # Updates an existing User’s properties.
    # @param app_id [String] 
    # @param alias_label [String] 
    # @param alias_id [String] 
    # @param update_user_request [UpdateUserRequest] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(InlineResponse202, Integer, Hash)>] InlineResponse202 data, response status code and response headers
    def update_user_with_http_info(app_id, alias_label, alias_id, update_user_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.update_user ...'
      end
      # verify the required parameter 'app_id' is set
      if @api_client.config.client_side_validation && app_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.update_user"
      end
      # verify the required parameter 'alias_label' is set
      if @api_client.config.client_side_validation && alias_label.nil?
        fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.update_user"
      end
      # verify the required parameter 'alias_id' is set
      if @api_client.config.client_side_validation && alias_id.nil?
        fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.update_user"
      end
      # verify the required parameter 'update_user_request' is set
      if @api_client.config.client_side_validation && update_user_request.nil?
        fail ArgumentError, "Missing the required parameter 'update_user_request' when calling DefaultApi.update_user"
      end
      # resource path
      local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s))

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

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

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

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

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

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

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