diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md index 78e6d46..bc60bae 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -32,6 +32,8 @@ All URIs are relative to *https://api.onesignal.com* | [**get_aliases_by_subscription**](DefaultApi.md#get_aliases_by_subscription) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | | | [**get_app**](DefaultApi.md#get_app) | **GET** /apps/{app_id} | View an app | | [**get_apps**](DefaultApi.md#get_apps) | **GET** /apps | View apps | +| [**get_email_provider_metrics**](DefaultApi.md#get_email_provider_metrics) | **GET** /apps/{app_id}/email_analytics/provider_metrics | Get email inbox provider metrics | +| [**get_email_provider_metrics_timeseries**](DefaultApi.md#get_email_provider_metrics_timeseries) | **GET** /apps/{app_id}/email_analytics/provider_metrics_timeseries | Get email inbox provider metrics over time | | [**get_email_reputation**](DefaultApi.md#get_email_reputation) | **GET** /apps/{app_id}/email_analytics/delivery_metrics | Get email reputation statistics | | [**get_notification**](DefaultApi.md#get_notification) | **GET** /notifications/{notification_id} | View notification | | [**get_notification_history**](DefaultApi.md#get_notification_history) | **POST** /notifications/{notification_id}/history | Notification History | @@ -2363,6 +2365,176 @@ This endpoint does not need any parameter. - **Accept**: application/json +## get_email_provider_metrics + +> get_email_provider_metrics(app_id, domain, start, _end) + +Get email inbox provider metrics + +Email delivery, opens, clicks, bounces, failures, and spam complaints broken down by inbox provider (Gmail, Outlook, Yahoo, Apple, and more) to pinpoint where deliverability problems are coming from. Metrics are reported for a single sending domain over the requested time range. `start` must be before `end` and no more than 365 days ago. `providers` is empty when the domain is not found for the app or is not currently active for sending. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_REST_API_KEY' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'YOUR_APP_ID' # String | Your OneSignal App ID in UUID v4 format. +domain = 'mail.example.com' # String | The sending domain to report on. Must be an email domain configured for this app. +start = Time.parse('2026-08-01T00:00Z') # Time | Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). +_end = Time.parse('2026-08-08T00:00Z') # Time | End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). + +begin + # Get email inbox provider metrics + result = api_instance.get_email_provider_metrics(app_id, domain, start, _end) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->get_email_provider_metrics: #{e}" + puts "Status Code: #{e.code}" + # `e.error_messages` flattens any error-envelope shape to an Array; + # the raw body remains on `e.response_body`. + puts "Error Messages: #{e.error_messages}" + puts "Response Body: #{e.response_body}" +end +``` + +#### Using the get_email_provider_metrics_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_email_provider_metrics_with_http_info(app_id, domain, start, _end) + +```ruby +begin + # Get email inbox provider metrics + data, status_code, headers = api_instance.get_email_provider_metrics_with_http_info(app_id, domain, start, _end) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->get_email_provider_metrics_with_http_info: #{e}" + puts "Status Code: #{e.code}" + puts "Response Body: #{e.response_body}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | Your OneSignal App ID in UUID v4 format. | | +| **domain** | **String** | The sending domain to report on. Must be an email domain configured for this app. | | +| **start** | **Time** | Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). | | +| **_end** | **Time** | End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). | | + +### Return type + +[**EmailProviderMetricsResponse**](EmailProviderMetricsResponse.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-ruby-api#configuration) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_email_provider_metrics_timeseries + +> get_email_provider_metrics_timeseries(app_id, domain, start, _end, granularity, opts) + +Get email inbox provider metrics over time + +Email delivery, opens, clicks, bounces, failures, and spam complaints for a sending domain over time, bucketed by hour, day, or month. Use `providers[]` to narrow the totals to specific inbox providers (Gmail, Outlook, Yahoo, Apple, and more) and track how deliverability to them changes. Each event's metrics are totaled across the requested providers, or across all providers when none are given. `start` must be before `end` and no more than 365 days ago, or 60 days ago for `hourly` granularity. `events` is empty when the domain is not found for the app or is not currently active for sending. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_REST_API_KEY' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'YOUR_APP_ID' # String | Your OneSignal App ID in UUID v4 format. +domain = 'mail.example.com' # String | The sending domain to report on. Must be an email domain configured for this app. +start = Time.parse('2026-08-01T00:00Z') # Time | Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). +_end = Time.parse('2026-08-08T00:00Z') # Time | End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). +granularity = 'hourly' # String | The size of each time bucket. Hourly data is only available for the last 60 days. +opts = { + providers: ['gmail'] # Array | Inbox providers to include in the totals. Omit to include all providers. Accepted values: `apple`, `att`, `canadian`, `chinese`, `comcast`, `free_fr`, `french`, `german`, `gmail`, `google_workspace`, `googlers`, `inbox_lv`, `italian`, `japanese`, `outlook_365`, `outlook_eu`, `outlook_us`, `proton`, `rackspace`, `russian`, `uk`, `united_online`, `yahoo_eu`, `yahoo_us`, `other_eu`, `other_us`, and `other`. Example: providers[]=gmail&providers[]=yahoo_us +} + +begin + # Get email inbox provider metrics over time + result = api_instance.get_email_provider_metrics_timeseries(app_id, domain, start, _end, granularity, opts) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->get_email_provider_metrics_timeseries: #{e}" + puts "Status Code: #{e.code}" + # `e.error_messages` flattens any error-envelope shape to an Array; + # the raw body remains on `e.response_body`. + puts "Error Messages: #{e.error_messages}" + puts "Response Body: #{e.response_body}" +end +``` + +#### Using the get_email_provider_metrics_timeseries_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_email_provider_metrics_timeseries_with_http_info(app_id, domain, start, _end, granularity, opts) + +```ruby +begin + # Get email inbox provider metrics over time + data, status_code, headers = api_instance.get_email_provider_metrics_timeseries_with_http_info(app_id, domain, start, _end, granularity, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->get_email_provider_metrics_timeseries_with_http_info: #{e}" + puts "Status Code: #{e.code}" + puts "Response Body: #{e.response_body}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | Your OneSignal App ID in UUID v4 format. | | +| **domain** | **String** | The sending domain to report on. Must be an email domain configured for this app. | | +| **start** | **Time** | Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). | | +| **_end** | **Time** | End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). | | +| **granularity** | **String** | The size of each time bucket. Hourly data is only available for the last 60 days. | | +| **providers** | [**Array<String>**](String.md) | Inbox providers to include in the totals. Omit to include all providers. Accepted values: `apple`, `att`, `canadian`, `chinese`, `comcast`, `free_fr`, `french`, `german`, `gmail`, `google_workspace`, `googlers`, `inbox_lv`, `italian`, `japanese`, `outlook_365`, `outlook_eu`, `outlook_us`, `proton`, `rackspace`, `russian`, `uk`, `united_online`, `yahoo_eu`, `yahoo_us`, `other_eu`, `other_us`, and `other`. Example: providers[]=gmail&providers[]=yahoo_us | [optional] | + +### Return type + +[**EmailProviderMetricsTimeseriesResponse**](EmailProviderMetricsTimeseriesResponse.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-ruby-api#configuration) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + ## get_email_reputation > get_email_reputation(app_id) diff --git a/docs/EmailMetrics.md b/docs/EmailMetrics.md new file mode 100644 index 0000000..938b31b --- /dev/null +++ b/docs/EmailMetrics.md @@ -0,0 +1,34 @@ +# OneSignal::EmailMetrics + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **sent** | **Integer** | The number of emails sent. | [optional] | +| **delivered** | **Integer** | The number of emails successfully delivered. | [optional] | +| **opened** | **Integer** | The total number of email opens, including repeat opens by the same recipient. | [optional] | +| **clicked** | **Integer** | The total number of email link clicks, including repeat clicks by the same recipient. | [optional] | +| **unique_opened** | **Integer** | The number of emails opened at least once. | [optional] | +| **unique_clicked** | **Integer** | The number of emails with at least one link click. | [optional] | +| **failed** | **Integer** | The number of emails that failed to send. | [optional] | +| **bounced** | **Integer** | The number of emails that bounced. | [optional] | +| **complained** | **Integer** | The number of emails that recipients reported as spam. | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::EmailMetrics.new( + sent: 100, + delivered: 95, + opened: 40, + clicked: 10, + unique_opened: 35, + unique_clicked: 8, + failed: 5, + bounced: 3, + complained: 1 +) +``` + diff --git a/docs/EmailProviderMetrics.md b/docs/EmailProviderMetrics.md new file mode 100644 index 0000000..1e3b65c --- /dev/null +++ b/docs/EmailProviderMetrics.md @@ -0,0 +1,20 @@ +# OneSignal::EmailProviderMetrics + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **provider** | **String** | The inbox provider. Known values include `apple`, `att`, `canadian`, `chinese`, `comcast`, `free_fr`, `french`, `german`, `gmail`, `google_workspace`, `googlers`, `inbox_lv`, `italian`, `japanese`, `outlook_365`, `outlook_eu`, `outlook_us`, `proton`, `rackspace`, `russian`, `uk`, `united_online`, `yahoo_eu`, `yahoo_us`, `other_eu`, `other_us`, and `other`. New providers may be added over time. | [optional] | +| **metrics** | [**EmailMetrics**](EmailMetrics.md) | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::EmailProviderMetrics.new( + provider: 'gmail', + metrics: nil +) +``` + diff --git a/docs/EmailProviderMetricsEvent.md b/docs/EmailProviderMetricsEvent.md new file mode 100644 index 0000000..19952c6 --- /dev/null +++ b/docs/EmailProviderMetricsEvent.md @@ -0,0 +1,20 @@ +# OneSignal::EmailProviderMetricsEvent + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **date** | **Time** | The start of the time bucket, aligned to the hour, day, or month in UTC. | [optional] | +| **metrics** | [**EmailMetrics**](EmailMetrics.md) | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::EmailProviderMetricsEvent.new( + date: 2026-08-01T00:00Z, + metrics: nil +) +``` + diff --git a/docs/EmailProviderMetricsResponse.md b/docs/EmailProviderMetricsResponse.md new file mode 100644 index 0000000..78b3d0d --- /dev/null +++ b/docs/EmailProviderMetricsResponse.md @@ -0,0 +1,18 @@ +# OneSignal::EmailProviderMetricsResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **providers** | [**Array<EmailProviderMetrics>**](EmailProviderMetrics.md) | One entry per inbox provider that received email from the domain during the reporting window. Empty when the domain is not found for the app or is not currently active for sending. | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::EmailProviderMetricsResponse.new( + providers: nil +) +``` + diff --git a/docs/EmailProviderMetricsTimeseriesResponse.md b/docs/EmailProviderMetricsTimeseriesResponse.md new file mode 100644 index 0000000..b18719b --- /dev/null +++ b/docs/EmailProviderMetricsTimeseriesResponse.md @@ -0,0 +1,18 @@ +# OneSignal::EmailProviderMetricsTimeseriesResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **events** | [**Array<EmailProviderMetricsEvent>**](EmailProviderMetricsEvent.md) | One entry for every time bucket in the reporting window, oldest first. Buckets with no email activity are included with all metrics set to `0`. Empty when the domain is not found for the app or is not currently active for sending. | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::EmailProviderMetricsTimeseriesResponse.new( + events: nil +) +``` + diff --git a/lib/onesignal.rb b/lib/onesignal.rb index a9fdf3e..9ecac7d 100644 --- a/lib/onesignal.rb +++ b/lib/onesignal.rb @@ -44,6 +44,11 @@ require 'onesignal/models/delivery_data' require 'onesignal/models/duplicate_journey_overrides' require 'onesignal/models/duplicate_journey_request' +require 'onesignal/models/email_metrics' +require 'onesignal/models/email_provider_metrics' +require 'onesignal/models/email_provider_metrics_event' +require 'onesignal/models/email_provider_metrics_response' +require 'onesignal/models/email_provider_metrics_timeseries_response' require 'onesignal/models/email_reputation_response' require 'onesignal/models/email_reputation_window' require 'onesignal/models/email_warm_up' diff --git a/lib/onesignal/api/default_api.rb b/lib/onesignal/api/default_api.rb index 7dbe9ec..9a39338 100644 --- a/lib/onesignal/api/default_api.rb +++ b/lib/onesignal/api/default_api.rb @@ -2023,6 +2023,189 @@ def get_apps_with_http_info(opts = {}) return data, status_code, headers end + # Get email inbox provider metrics + # Email delivery, opens, clicks, bounces, failures, and spam complaints broken down by inbox provider (Gmail, Outlook, Yahoo, Apple, and more) to pinpoint where deliverability problems are coming from. Metrics are reported for a single sending domain over the requested time range. `start` must be before `end` and no more than 365 days ago. `providers` is empty when the domain is not found for the app or is not currently active for sending. + # @param app_id [String] Your OneSignal App ID in UUID v4 format. + # @param domain [String] The sending domain to report on. Must be an email domain configured for this app. + # @param start [Time] Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). + # @param _end [Time] End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). + # @param [Hash] opts the optional parameters + # @return [EmailProviderMetricsResponse] + def get_email_provider_metrics(app_id, domain, start, _end, opts = {}) + data, _status_code, _headers = get_email_provider_metrics_with_http_info(app_id, domain, start, _end, opts) + data + end + + # Get email inbox provider metrics + # Email delivery, opens, clicks, bounces, failures, and spam complaints broken down by inbox provider (Gmail, Outlook, Yahoo, Apple, and more) to pinpoint where deliverability problems are coming from. Metrics are reported for a single sending domain over the requested time range. `start` must be before `end` and no more than 365 days ago. `providers` is empty when the domain is not found for the app or is not currently active for sending. + # @param app_id [String] Your OneSignal App ID in UUID v4 format. + # @param domain [String] The sending domain to report on. Must be an email domain configured for this app. + # @param start [Time] Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). + # @param _end [Time] End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). + # @param [Hash] opts the optional parameters + # @return [Array<(EmailProviderMetricsResponse, Integer, Hash)>] EmailProviderMetricsResponse data, response status code and response headers + def get_email_provider_metrics_with_http_info(app_id, domain, start, _end, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.get_email_provider_metrics ...' + 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_email_provider_metrics" + end + # verify the required parameter 'domain' is set + if @api_client.config.client_side_validation && domain.nil? + fail ArgumentError, "Missing the required parameter 'domain' when calling DefaultApi.get_email_provider_metrics" + end + # verify the required parameter 'start' is set + if @api_client.config.client_side_validation && start.nil? + fail ArgumentError, "Missing the required parameter 'start' when calling DefaultApi.get_email_provider_metrics" + end + # verify the required parameter '_end' is set + if @api_client.config.client_side_validation && _end.nil? + fail ArgumentError, "Missing the required parameter '_end' when calling DefaultApi.get_email_provider_metrics" + end + # resource path + local_var_path = '/apps/{app_id}/email_analytics/provider_metrics'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'domain'] = domain + query_params[:'start'] = start + query_params[:'end'] = _end + + # 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] || 'EmailProviderMetricsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['rest_api_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.get_email_provider_metrics", + :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_email_provider_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get email inbox provider metrics over time + # Email delivery, opens, clicks, bounces, failures, and spam complaints for a sending domain over time, bucketed by hour, day, or month. Use `providers[]` to narrow the totals to specific inbox providers (Gmail, Outlook, Yahoo, Apple, and more) and track how deliverability to them changes. Each event's metrics are totaled across the requested providers, or across all providers when none are given. `start` must be before `end` and no more than 365 days ago, or 60 days ago for `hourly` granularity. `events` is empty when the domain is not found for the app or is not currently active for sending. + # @param app_id [String] Your OneSignal App ID in UUID v4 format. + # @param domain [String] The sending domain to report on. Must be an email domain configured for this app. + # @param start [Time] Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). + # @param _end [Time] End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). + # @param granularity [String] The size of each time bucket. Hourly data is only available for the last 60 days. + # @param [Hash] opts the optional parameters + # @option opts [Array] :providers Inbox providers to include in the totals. Omit to include all providers. Accepted values: `apple`, `att`, `canadian`, `chinese`, `comcast`, `free_fr`, `french`, `german`, `gmail`, `google_workspace`, `googlers`, `inbox_lv`, `italian`, `japanese`, `outlook_365`, `outlook_eu`, `outlook_us`, `proton`, `rackspace`, `russian`, `uk`, `united_online`, `yahoo_eu`, `yahoo_us`, `other_eu`, `other_us`, and `other`. Example: providers[]=gmail&providers[]=yahoo_us + # @return [EmailProviderMetricsTimeseriesResponse] + def get_email_provider_metrics_timeseries(app_id, domain, start, _end, granularity, opts = {}) + data, _status_code, _headers = get_email_provider_metrics_timeseries_with_http_info(app_id, domain, start, _end, granularity, opts) + data + end + + # Get email inbox provider metrics over time + # Email delivery, opens, clicks, bounces, failures, and spam complaints for a sending domain over time, bucketed by hour, day, or month. Use `providers[]` to narrow the totals to specific inbox providers (Gmail, Outlook, Yahoo, Apple, and more) and track how deliverability to them changes. Each event's metrics are totaled across the requested providers, or across all providers when none are given. `start` must be before `end` and no more than 365 days ago, or 60 days ago for `hourly` granularity. `events` is empty when the domain is not found for the app or is not currently active for sending. + # @param app_id [String] Your OneSignal App ID in UUID v4 format. + # @param domain [String] The sending domain to report on. Must be an email domain configured for this app. + # @param start [Time] Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). + # @param _end [Time] End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). + # @param granularity [String] The size of each time bucket. Hourly data is only available for the last 60 days. + # @param [Hash] opts the optional parameters + # @option opts [Array] :providers Inbox providers to include in the totals. Omit to include all providers. Accepted values: `apple`, `att`, `canadian`, `chinese`, `comcast`, `free_fr`, `french`, `german`, `gmail`, `google_workspace`, `googlers`, `inbox_lv`, `italian`, `japanese`, `outlook_365`, `outlook_eu`, `outlook_us`, `proton`, `rackspace`, `russian`, `uk`, `united_online`, `yahoo_eu`, `yahoo_us`, `other_eu`, `other_us`, and `other`. Example: providers[]=gmail&providers[]=yahoo_us + # @return [Array<(EmailProviderMetricsTimeseriesResponse, Integer, Hash)>] EmailProviderMetricsTimeseriesResponse data, response status code and response headers + def get_email_provider_metrics_timeseries_with_http_info(app_id, domain, start, _end, granularity, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.get_email_provider_metrics_timeseries ...' + 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_email_provider_metrics_timeseries" + end + # verify the required parameter 'domain' is set + if @api_client.config.client_side_validation && domain.nil? + fail ArgumentError, "Missing the required parameter 'domain' when calling DefaultApi.get_email_provider_metrics_timeseries" + end + # verify the required parameter 'start' is set + if @api_client.config.client_side_validation && start.nil? + fail ArgumentError, "Missing the required parameter 'start' when calling DefaultApi.get_email_provider_metrics_timeseries" + end + # verify the required parameter '_end' is set + if @api_client.config.client_side_validation && _end.nil? + fail ArgumentError, "Missing the required parameter '_end' when calling DefaultApi.get_email_provider_metrics_timeseries" + end + # verify the required parameter 'granularity' is set + if @api_client.config.client_side_validation && granularity.nil? + fail ArgumentError, "Missing the required parameter 'granularity' when calling DefaultApi.get_email_provider_metrics_timeseries" + end + # verify enum value + allowable_values = ["hourly", "daily", "monthly"] + if @api_client.config.client_side_validation && !allowable_values.include?(granularity) + fail ArgumentError, "invalid value for \"granularity\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/apps/{app_id}/email_analytics/provider_metrics_timeseries'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'domain'] = domain + query_params[:'start'] = start + query_params[:'end'] = _end + query_params[:'granularity'] = granularity + query_params[:'providers[]'] = @api_client.build_collection_param(opts[:'providers'], :multi) if !opts[:'providers'].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] || 'EmailProviderMetricsTimeseriesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['rest_api_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.get_email_provider_metrics_timeseries", + :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_email_provider_metrics_timeseries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get email reputation statistics # The email bounce and spam complaint rates received for the app over the last 24 hours, 7 days, and 30 days. Rates are expressed as fractions of successfully delivered emails (for example, `0.02` means 2%). A window reports `0` for both rates when the app has not successfully delivered any email in that period. # @param app_id [String] Your OneSignal App ID in UUID v4 format. diff --git a/lib/onesignal/api_client.rb b/lib/onesignal/api_client.rb index 5060422..f3df88c 100644 --- a/lib/onesignal/api_client.rb +++ b/lib/onesignal/api_client.rb @@ -96,6 +96,7 @@ def build_request(http_method, path, opts = {}) follow_location = opts[:follow_location] || true update_params_for_auth! header_params, query_params, opts[:auth_names] + query_params = serialize_query_params(query_params) # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 @@ -388,5 +389,27 @@ def build_collection_param(param, collection_format) fail "unknown collection format: #{collection_format.inspect}" end end + + # Serialize query parameter values for the wire. + # Time, DateTime and Date values are sent as ISO 8601 (Time#to_s is not), + # including inside arrays; other values are passed through unchanged. + # @param [Hash] query_params Query parameters + # @return [Hash] Query parameters with serialized values + def serialize_query_params(query_params) + query_params.transform_values { |value| serialize_query_value(value) } + end + + # @param [Object] value Query parameter value + # @return [Object] ISO 8601 string for Time/Date values, the value otherwise + def serialize_query_value(value) + case value + when Array + value.map { |item| serialize_query_value(item) } + when Time, Date + value.iso8601 + else + value + end + end end end diff --git a/lib/onesignal/configuration.rb b/lib/onesignal/configuration.rb index d632f67..d0f5249 100644 --- a/lib/onesignal/configuration.rb +++ b/lib/onesignal/configuration.rb @@ -102,7 +102,9 @@ class Configuration attr_accessor :key_file # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. + # Defaults to :multi, which sends arrays as repeated keys (ids=a&ids=b), matching + # OpenAPI `style: form, explode: true`. nil falls back to Ethon's default + # (ids[0]=a&ids[1]=b). # # @see The params_encoding option of Ethon. Related source code: # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 @@ -128,7 +130,7 @@ def initialize @cert_file = nil @key_file = nil @timeout = 0 - @params_encoding = nil + @params_encoding = :multi @debugging = false @inject_format = false @force_ending_format = false diff --git a/lib/onesignal/models/email_metrics.rb b/lib/onesignal/models/email_metrics.rb new file mode 100644 index 0000000..330859d --- /dev/null +++ b/lib/onesignal/models/email_metrics.rb @@ -0,0 +1,300 @@ +=begin +#OneSignal + +#A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + # Email delivery and engagement counts for the reporting window. + class EmailMetrics + # The number of emails sent. + attr_accessor :sent + + # The number of emails successfully delivered. + attr_accessor :delivered + + # The total number of email opens, including repeat opens by the same recipient. + attr_accessor :opened + + # The total number of email link clicks, including repeat clicks by the same recipient. + attr_accessor :clicked + + # The number of emails opened at least once. + attr_accessor :unique_opened + + # The number of emails with at least one link click. + attr_accessor :unique_clicked + + # The number of emails that failed to send. + attr_accessor :failed + + # The number of emails that bounced. + attr_accessor :bounced + + # The number of emails that recipients reported as spam. + attr_accessor :complained + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'sent' => :'sent', + :'delivered' => :'delivered', + :'opened' => :'opened', + :'clicked' => :'clicked', + :'unique_opened' => :'unique_opened', + :'unique_clicked' => :'unique_clicked', + :'failed' => :'failed', + :'bounced' => :'bounced', + :'complained' => :'complained' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'sent' => :'Integer', + :'delivered' => :'Integer', + :'opened' => :'Integer', + :'clicked' => :'Integer', + :'unique_opened' => :'Integer', + :'unique_clicked' => :'Integer', + :'failed' => :'Integer', + :'bounced' => :'Integer', + :'complained' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::EmailMetrics` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::EmailMetrics`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'sent') + self.sent = attributes[:'sent'] + end + + if attributes.key?(:'delivered') + self.delivered = attributes[:'delivered'] + end + + if attributes.key?(:'opened') + self.opened = attributes[:'opened'] + end + + if attributes.key?(:'clicked') + self.clicked = attributes[:'clicked'] + end + + if attributes.key?(:'unique_opened') + self.unique_opened = attributes[:'unique_opened'] + end + + if attributes.key?(:'unique_clicked') + self.unique_clicked = attributes[:'unique_clicked'] + end + + if attributes.key?(:'failed') + self.failed = attributes[:'failed'] + end + + if attributes.key?(:'bounced') + self.bounced = attributes[:'bounced'] + end + + if attributes.key?(:'complained') + self.complained = attributes[:'complained'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + sent == o.sent && + delivered == o.delivered && + opened == o.opened && + clicked == o.clicked && + unique_opened == o.unique_opened && + unique_clicked == o.unique_clicked && + failed == o.failed && + bounced == o.bounced && + complained == o.complained + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [sent, delivered, opened, clicked, unique_opened, unique_clicked, failed, bounced, complained].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/email_provider_metrics.rb b/lib/onesignal/models/email_provider_metrics.rb new file mode 100644 index 0000000..c77d846 --- /dev/null +++ b/lib/onesignal/models/email_provider_metrics.rb @@ -0,0 +1,229 @@ +=begin +#OneSignal + +#A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + # Email metrics for a single inbox provider. + class EmailProviderMetrics + # The inbox provider. Known values include `apple`, `att`, `canadian`, `chinese`, `comcast`, `free_fr`, `french`, `german`, `gmail`, `google_workspace`, `googlers`, `inbox_lv`, `italian`, `japanese`, `outlook_365`, `outlook_eu`, `outlook_us`, `proton`, `rackspace`, `russian`, `uk`, `united_online`, `yahoo_eu`, `yahoo_us`, `other_eu`, `other_us`, and `other`. New providers may be added over time. + attr_accessor :provider + + attr_accessor :metrics + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'provider' => :'provider', + :'metrics' => :'metrics' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'provider' => :'String', + :'metrics' => :'EmailMetrics' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::EmailProviderMetrics` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::EmailProviderMetrics`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'provider') + self.provider = attributes[:'provider'] + end + + if attributes.key?(:'metrics') + self.metrics = attributes[:'metrics'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + provider == o.provider && + metrics == o.metrics + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [provider, metrics].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/email_provider_metrics_event.rb b/lib/onesignal/models/email_provider_metrics_event.rb new file mode 100644 index 0000000..b5a82e0 --- /dev/null +++ b/lib/onesignal/models/email_provider_metrics_event.rb @@ -0,0 +1,229 @@ +=begin +#OneSignal + +#A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + # Email metrics for a single time bucket, totaled across the requested inbox providers. + class EmailProviderMetricsEvent + # The start of the time bucket, aligned to the hour, day, or month in UTC. + attr_accessor :date + + attr_accessor :metrics + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'date' => :'date', + :'metrics' => :'metrics' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'date' => :'Time', + :'metrics' => :'EmailMetrics' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::EmailProviderMetricsEvent` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::EmailProviderMetricsEvent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'metrics') + self.metrics = attributes[:'metrics'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + date == o.date && + metrics == o.metrics + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [date, metrics].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/email_provider_metrics_response.rb b/lib/onesignal/models/email_provider_metrics_response.rb new file mode 100644 index 0000000..011b085 --- /dev/null +++ b/lib/onesignal/models/email_provider_metrics_response.rb @@ -0,0 +1,222 @@ +=begin +#OneSignal + +#A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + # Email metrics for a sending domain, broken down by inbox provider. + class EmailProviderMetricsResponse + # One entry per inbox provider that received email from the domain during the reporting window. Empty when the domain is not found for the app or is not currently active for sending. + attr_accessor :providers + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'providers' => :'providers' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'providers' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::EmailProviderMetricsResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::EmailProviderMetricsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'providers') + if (value = attributes[:'providers']).is_a?(Array) + self.providers = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + providers == o.providers + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [providers].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/email_provider_metrics_timeseries_response.rb b/lib/onesignal/models/email_provider_metrics_timeseries_response.rb new file mode 100644 index 0000000..211610b --- /dev/null +++ b/lib/onesignal/models/email_provider_metrics_timeseries_response.rb @@ -0,0 +1,222 @@ +=begin +#OneSignal + +#A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + # Email metrics for a sending domain over time. + class EmailProviderMetricsTimeseriesResponse + # One entry for every time bucket in the reporting window, oldest first. Buckets with no email activity are included with all metrics set to `0`. Empty when the domain is not found for the app or is not currently active for sending. + attr_accessor :events + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'events' => :'events' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'events' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::EmailProviderMetricsTimeseriesResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::EmailProviderMetricsTimeseriesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'events') + if (value = attributes[:'events']).is_a?(Array) + self.events = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + events == o.events + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [events].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/spec/api/default_api_spec.rb b/spec/api/default_api_spec.rb index 0460706..0193155 100644 --- a/spec/api/default_api_spec.rb +++ b/spec/api/default_api_spec.rb @@ -390,6 +390,38 @@ end end + # unit tests for get_email_provider_metrics + # Get email inbox provider metrics + # Email delivery, opens, clicks, bounces, failures, and spam complaints broken down by inbox provider (Gmail, Outlook, Yahoo, Apple, and more) to pinpoint where deliverability problems are coming from. Metrics are reported for a single sending domain over the requested time range. `start` must be before `end` and no more than 365 days ago. `providers` is empty when the domain is not found for the app or is not currently active for sending. + # @param app_id Your OneSignal App ID in UUID v4 format. + # @param domain The sending domain to report on. Must be an email domain configured for this app. + # @param start Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). + # @param _end End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). + # @param [Hash] opts the optional parameters + # @return [EmailProviderMetricsResponse] + describe 'get_email_provider_metrics test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_email_provider_metrics_timeseries + # Get email inbox provider metrics over time + # Email delivery, opens, clicks, bounces, failures, and spam complaints for a sending domain over time, bucketed by hour, day, or month. Use `providers[]` to narrow the totals to specific inbox providers (Gmail, Outlook, Yahoo, Apple, and more) and track how deliverability to them changes. Each event's metrics are totaled across the requested providers, or across all providers when none are given. `start` must be before `end` and no more than 365 days ago, or 60 days ago for `hourly` granularity. `events` is empty when the domain is not found for the app or is not currently active for sending. + # @param app_id Your OneSignal App ID in UUID v4 format. + # @param domain The sending domain to report on. Must be an email domain configured for this app. + # @param start Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). + # @param _end End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). + # @param granularity The size of each time bucket. Hourly data is only available for the last 60 days. + # @param [Hash] opts the optional parameters + # @option opts [Array] :providers Inbox providers to include in the totals. Omit to include all providers. Accepted values: `apple`, `att`, `canadian`, `chinese`, `comcast`, `free_fr`, `french`, `german`, `gmail`, `google_workspace`, `googlers`, `inbox_lv`, `italian`, `japanese`, `outlook_365`, `outlook_eu`, `outlook_us`, `proton`, `rackspace`, `russian`, `uk`, `united_online`, `yahoo_eu`, `yahoo_us`, `other_eu`, `other_us`, and `other`. Example: providers[]=gmail&providers[]=yahoo_us + # @return [EmailProviderMetricsTimeseriesResponse] + describe 'get_email_provider_metrics_timeseries test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + # unit tests for get_email_reputation # Get email reputation statistics # The email bounce and spam complaint rates received for the app over the last 24 hours, 7 days, and 30 days. Rates are expressed as fractions of successfully delivered emails (for example, `0.02` means 2%). A window reports `0` for both rates when the app has not successfully delivered any email in that period. diff --git a/spec/api_client_spec.rb b/spec/api_client_spec.rb index a913c00..1b71e83 100644 --- a/spec/api_client_spec.rb +++ b/spec/api_client_spec.rb @@ -54,18 +54,18 @@ let(:config) { OneSignal::Configuration.new } let(:api_client) { OneSignal::ApiClient.new(config) } - it 'defaults to nil' do - expect(OneSignal::Configuration.default.params_encoding).to eq(nil) - expect(config.params_encoding).to eq(nil) + it 'defaults to :multi' do + expect(OneSignal::Configuration.default.params_encoding).to eq(:multi) + expect(config.params_encoding).to eq(:multi) request = api_client.build_request(:get, '/test') - expect(request.options[:params_encoding]).to eq(nil) + expect(request.options[:params_encoding]).to eq(:multi) end it 'can be customized' do - config.params_encoding = :multi + config.params_encoding = nil request = api_client.build_request(:get, '/test') - expect(request.options[:params_encoding]).to eq(:multi) + expect(request.options[:params_encoding]).to eq(nil) end end diff --git a/spec/models/email_metrics_spec.rb b/spec/models/email_metrics_spec.rb new file mode 100644 index 0000000..05c88ed --- /dev/null +++ b/spec/models/email_metrics_spec.rb @@ -0,0 +1,81 @@ +=begin +#OneSignal + +#A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::EmailMetrics +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::EmailMetrics do + let(:instance) { OneSignal::EmailMetrics.new } + + describe 'test an instance of EmailMetrics' do + it 'should create an instance of EmailMetrics' do + expect(instance).to be_instance_of(OneSignal::EmailMetrics) + end + end + describe 'test attribute "sent"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "delivered"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "opened"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "clicked"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "unique_opened"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "unique_clicked"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "failed"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "bounced"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "complained"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/email_provider_metrics_event_spec.rb b/spec/models/email_provider_metrics_event_spec.rb new file mode 100644 index 0000000..62024a3 --- /dev/null +++ b/spec/models/email_provider_metrics_event_spec.rb @@ -0,0 +1,39 @@ +=begin +#OneSignal + +#A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::EmailProviderMetricsEvent +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::EmailProviderMetricsEvent do + let(:instance) { OneSignal::EmailProviderMetricsEvent.new } + + describe 'test an instance of EmailProviderMetricsEvent' do + it 'should create an instance of EmailProviderMetricsEvent' do + expect(instance).to be_instance_of(OneSignal::EmailProviderMetricsEvent) + end + end + describe 'test attribute "date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "metrics"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/email_provider_metrics_response_spec.rb b/spec/models/email_provider_metrics_response_spec.rb new file mode 100644 index 0000000..a5b8598 --- /dev/null +++ b/spec/models/email_provider_metrics_response_spec.rb @@ -0,0 +1,33 @@ +=begin +#OneSignal + +#A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::EmailProviderMetricsResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::EmailProviderMetricsResponse do + let(:instance) { OneSignal::EmailProviderMetricsResponse.new } + + describe 'test an instance of EmailProviderMetricsResponse' do + it 'should create an instance of EmailProviderMetricsResponse' do + expect(instance).to be_instance_of(OneSignal::EmailProviderMetricsResponse) + end + end + describe 'test attribute "providers"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/email_provider_metrics_spec.rb b/spec/models/email_provider_metrics_spec.rb new file mode 100644 index 0000000..b37ac7a --- /dev/null +++ b/spec/models/email_provider_metrics_spec.rb @@ -0,0 +1,39 @@ +=begin +#OneSignal + +#A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::EmailProviderMetrics +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::EmailProviderMetrics do + let(:instance) { OneSignal::EmailProviderMetrics.new } + + describe 'test an instance of EmailProviderMetrics' do + it 'should create an instance of EmailProviderMetrics' do + expect(instance).to be_instance_of(OneSignal::EmailProviderMetrics) + end + end + describe 'test attribute "provider"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "metrics"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/email_provider_metrics_timeseries_response_spec.rb b/spec/models/email_provider_metrics_timeseries_response_spec.rb new file mode 100644 index 0000000..389ca97 --- /dev/null +++ b/spec/models/email_provider_metrics_timeseries_response_spec.rb @@ -0,0 +1,33 @@ +=begin +#OneSignal + +#A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::EmailProviderMetricsTimeseriesResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::EmailProviderMetricsTimeseriesResponse do + let(:instance) { OneSignal::EmailProviderMetricsTimeseriesResponse.new } + + describe 'test an instance of EmailProviderMetricsTimeseriesResponse' do + it 'should create an instance of EmailProviderMetricsTimeseriesResponse' do + expect(instance).to be_instance_of(OneSignal::EmailProviderMetricsTimeseriesResponse) + end + end + describe 'test attribute "events"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end