From 238d73cb5de3f9f9d83a3f47354341e3a701d768 Mon Sep 17 00:00:00 2001 From: OneSignal Date: Wed, 1 Oct 2025 21:06:17 +0000 Subject: [PATCH] feat: add v5.3.0-beta1 package updates --- README.md | 38 +- docs/ApiKeyToken.md | 28 + docs/ApiKeyTokensListResponse.md | 18 + docs/CopyTemplateRequest.md | 18 + docs/CreateApiKeyRequest.md | 22 + docs/CreateApiKeyResponse.md | 20 + docs/CreateTemplateRequest.md | 32 + docs/CustomEvent.md | 26 + docs/CustomEventsRequest.md | 18 + docs/DefaultApi.md | 1242 +++++++++++++++-- docs/StartLiveActivityRequest.md | 48 + docs/StartLiveActivitySuccessResponse.md | 18 + docs/TemplateResource.md | 28 + docs/TemplatesListResponse.md | 18 + docs/UpdateApiKeyRequest.md | 22 + docs/UpdateTemplateRequest.md | 30 + lib/onesignal.rb | 16 +- lib/onesignal/api/default_api.rb | 1044 +++++++++++++- lib/onesignal/api_client.rb | 4 +- lib/onesignal/api_error.rb | 2 +- lib/onesignal/configuration.rb | 2 +- lib/onesignal/models/api_key_token.rb | 300 ++++ .../models/api_key_tokens_list_response.rb | 221 +++ lib/onesignal/models/app.rb | 2 +- lib/onesignal/models/basic_notification.rb | 2 +- .../models/basic_notification_all_of.rb | 2 +- ...cation_all_of_android_background_layout.rb | 2 +- lib/onesignal/models/button.rb | 2 +- lib/onesignal/models/copy_template_request.rb | 225 +++ .../models/create_api_key_request.rb | 273 ++++ .../models/create_api_key_response.rb | 228 +++ .../create_notification_success_response.rb | 2 +- .../create_segment_conflict_response.rb | 2 +- .../models/create_segment_success_response.rb | 2 +- .../models/create_template_request.rb | 307 ++++ .../models/create_user_conflict_response.rb | 2 +- ...ate_user_conflict_response_errors_inner.rb | 2 +- ...ser_conflict_response_errors_items_meta.rb | 2 +- lib/onesignal/models/custom_event.rb | 269 ++++ lib/onesignal/models/custom_events_request.rb | 226 +++ lib/onesignal/models/delivery_data.rb | 2 +- .../models/export_events_success_response.rb | 2 +- .../export_subscriptions_request_body.rb | 2 +- .../export_subscriptions_success_response.rb | 2 +- lib/onesignal/models/filter.rb | 2 +- lib/onesignal/models/filter_expression.rb | 2 +- lib/onesignal/models/generic_error.rb | 2 +- .../models/generic_success_bool_response.rb | 2 +- .../get_notification_history_request_body.rb | 2 +- .../models/get_segments_success_response.rb | 2 +- lib/onesignal/models/language_string_map.rb | 2 +- lib/onesignal/models/notification.rb | 2 +- lib/onesignal/models/notification_all_of.rb | 2 +- .../notification_history_success_response.rb | 2 +- lib/onesignal/models/notification_slice.rb | 2 +- lib/onesignal/models/notification_target.rb | 2 +- .../models/notification_with_meta.rb | 2 +- .../models/notification_with_meta_all_of.rb | 2 +- lib/onesignal/models/operator.rb | 2 +- lib/onesignal/models/outcome_data.rb | 2 +- lib/onesignal/models/outcomes_data.rb | 2 +- .../models/platform_delivery_data.rb | 2 +- .../platform_delivery_data_email_all_of.rb | 2 +- .../platform_delivery_data_sms_all_of.rb | 2 +- lib/onesignal/models/properties_body.rb | 2 +- lib/onesignal/models/properties_deltas.rb | 2 +- lib/onesignal/models/properties_object.rb | 2 +- lib/onesignal/models/purchase.rb | 2 +- lib/onesignal/models/rate_limit_error.rb | 2 +- lib/onesignal/models/segment.rb | 2 +- lib/onesignal/models/segment_data.rb | 2 +- .../models/segment_notification_target.rb | 2 +- .../models/start_live_activity_request.rb | 454 ++++++ .../start_live_activity_success_response.rb | 219 +++ lib/onesignal/models/subscription.rb | 2 +- lib/onesignal/models/subscription_body.rb | 2 +- .../subscription_notification_target.rb | 2 +- lib/onesignal/models/template_resource.rb | 302 ++++ .../models/templates_list_response.rb | 221 +++ .../transfer_subscription_request_body.rb | 2 +- .../models/update_api_key_request.rb | 273 ++++ .../models/update_live_activity_request.rb | 2 +- .../update_live_activity_success_response.rb | 2 +- .../models/update_template_request.rb | 282 ++++ lib/onesignal/models/update_user_request.rb | 2 +- lib/onesignal/models/user.rb | 2 +- lib/onesignal/models/user_identity_body.rb | 2 +- lib/onesignal/models/web_button.rb | 2 +- lib/onesignal/version.rb | 4 +- onesignal.gemspec | 2 +- spec/api/default_api_spec.rb | 190 ++- spec/api_client_spec.rb | 2 +- spec/configuration_spec.rb | 2 +- spec/models/api_key_token_spec.rb | 68 + .../api_key_tokens_list_response_spec.rb | 34 + spec/models/app_spec.rb | 2 +- ...n_all_of_android_background_layout_spec.rb | 2 +- spec/models/basic_notification_all_of_spec.rb | 2 +- spec/models/basic_notification_spec.rb | 2 +- spec/models/button_spec.rb | 2 +- spec/models/copy_template_request_spec.rb | 34 + spec/models/create_api_key_request_spec.rb | 50 + spec/models/create_api_key_response_spec.rb | 40 + ...eate_notification_success_response_spec.rb | 2 +- .../create_segment_conflict_response_spec.rb | 2 +- .../create_segment_success_response_spec.rb | 2 +- spec/models/create_template_request_spec.rb | 76 + ...ser_conflict_response_errors_inner_spec.rb | 2 +- ...onflict_response_errors_items_meta_spec.rb | 2 +- .../create_user_conflict_response_spec.rb | 2 +- spec/models/custom_event_spec.rb | 58 + spec/models/custom_events_request_spec.rb | 34 + spec/models/delivery_data_spec.rb | 2 +- .../export_events_success_response_spec.rb | 2 +- .../export_subscriptions_request_body_spec.rb | 2 +- ...ort_subscriptions_success_response_spec.rb | 2 +- spec/models/filter_expression_spec.rb | 2 +- spec/models/filter_spec.rb | 2 +- spec/models/generic_error_spec.rb | 2 +- .../generic_success_bool_response_spec.rb | 2 +- ..._notification_history_request_body_spec.rb | 2 +- .../get_segments_success_response_spec.rb | 2 +- spec/models/language_string_map_spec.rb | 2 +- spec/models/notification_all_of_spec.rb | 2 +- ...ification_history_success_response_spec.rb | 2 +- spec/models/notification_slice_spec.rb | 2 +- spec/models/notification_spec.rb | 2 +- spec/models/notification_target_spec.rb | 2 +- .../notification_with_meta_all_of_spec.rb | 2 +- spec/models/notification_with_meta_spec.rb | 2 +- spec/models/operator_spec.rb | 2 +- spec/models/outcome_data_spec.rb | 2 +- spec/models/outcomes_data_spec.rb | 2 +- ...latform_delivery_data_email_all_of_spec.rb | 2 +- .../platform_delivery_data_sms_all_of_spec.rb | 2 +- spec/models/platform_delivery_data_spec.rb | 2 +- spec/models/properties_body_spec.rb | 2 +- spec/models/properties_deltas_spec.rb | 2 +- spec/models/properties_object_spec.rb | 2 +- spec/models/purchase_spec.rb | 2 +- spec/models/rate_limit_error_spec.rb | 2 +- spec/models/segment_data_spec.rb | 2 +- .../segment_notification_target_spec.rb | 2 +- spec/models/segment_spec.rb | 2 +- .../start_live_activity_request_spec.rb | 128 ++ ...art_live_activity_success_response_spec.rb | 34 + spec/models/subscription_body_spec.rb | 2 +- .../subscription_notification_target_spec.rb | 2 +- spec/models/subscription_spec.rb | 2 +- spec/models/template_resource_spec.rb | 68 + spec/models/templates_list_response_spec.rb | 34 + ...transfer_subscription_request_body_spec.rb | 2 +- spec/models/update_api_key_request_spec.rb | 50 + .../update_live_activity_request_spec.rb | 2 +- ...ate_live_activity_success_response_spec.rb | 2 +- spec/models/update_template_request_spec.rb | 70 + spec/models/update_user_request_spec.rb | 2 +- spec/models/user_identity_body_spec.rb | 2 +- spec/models/user_spec.rb | 2 +- spec/models/web_button_spec.rb | 2 +- spec/spec_helper.rb | 2 +- 161 files changed, 7452 insertions(+), 234 deletions(-) create mode 100644 docs/ApiKeyToken.md create mode 100644 docs/ApiKeyTokensListResponse.md create mode 100644 docs/CopyTemplateRequest.md create mode 100644 docs/CreateApiKeyRequest.md create mode 100644 docs/CreateApiKeyResponse.md create mode 100644 docs/CreateTemplateRequest.md create mode 100644 docs/CustomEvent.md create mode 100644 docs/CustomEventsRequest.md create mode 100644 docs/StartLiveActivityRequest.md create mode 100644 docs/StartLiveActivitySuccessResponse.md create mode 100644 docs/TemplateResource.md create mode 100644 docs/TemplatesListResponse.md create mode 100644 docs/UpdateApiKeyRequest.md create mode 100644 docs/UpdateTemplateRequest.md create mode 100644 lib/onesignal/models/api_key_token.rb create mode 100644 lib/onesignal/models/api_key_tokens_list_response.rb create mode 100644 lib/onesignal/models/copy_template_request.rb create mode 100644 lib/onesignal/models/create_api_key_request.rb create mode 100644 lib/onesignal/models/create_api_key_response.rb create mode 100644 lib/onesignal/models/create_template_request.rb create mode 100644 lib/onesignal/models/custom_event.rb create mode 100644 lib/onesignal/models/custom_events_request.rb create mode 100644 lib/onesignal/models/start_live_activity_request.rb create mode 100644 lib/onesignal/models/start_live_activity_success_response.rb create mode 100644 lib/onesignal/models/template_resource.rb create mode 100644 lib/onesignal/models/templates_list_response.rb create mode 100644 lib/onesignal/models/update_api_key_request.rb create mode 100644 lib/onesignal/models/update_template_request.rb create mode 100644 spec/models/api_key_token_spec.rb create mode 100644 spec/models/api_key_tokens_list_response_spec.rb create mode 100644 spec/models/copy_template_request_spec.rb create mode 100644 spec/models/create_api_key_request_spec.rb create mode 100644 spec/models/create_api_key_response_spec.rb create mode 100644 spec/models/create_template_request_spec.rb create mode 100644 spec/models/custom_event_spec.rb create mode 100644 spec/models/custom_events_request_spec.rb create mode 100644 spec/models/start_live_activity_request_spec.rb create mode 100644 spec/models/start_live_activity_success_response_spec.rb create mode 100644 spec/models/template_resource_spec.rb create mode 100644 spec/models/templates_list_response_spec.rb create mode 100644 spec/models/update_api_key_request_spec.rb create mode 100644 spec/models/update_template_request_spec.rb diff --git a/README.md b/README.md index 2a1ae81..72cd466 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ A powerful way to send personalized messages at scale and build effective custom This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 5.2.1 -- Package version: 5.2.1-beta1 +- API version: 5.3.0 +- Package version: 5.3.0-beta1 - Build package: org.openapitools.codegen.languages.RubyClientCodegen For more information, please visit [https://onesignal.com](https://onesignal.com) @@ -24,16 +24,16 @@ gem build onesignal.gemspec Then either install the gem locally: ```shell -gem install ./onesignal-5.2.1-beta1.gem +gem install ./onesignal-5.3.0-beta1.gem ``` -(for development, run `gem install --dev ./onesignal-5.2.1-beta1.gem` to install the development dependencies) +(for development, run `gem install --dev ./onesignal-5.3.0-beta1.gem` to install the development dependencies) or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). Finally add this to the Gemfile: - gem 'onesignal', '~> 5.2.1-beta1' + gem 'onesignal', '~> 5.3.0-beta1' ### Install from Git @@ -86,16 +86,22 @@ All URIs are relative to *https://api.onesignal.com* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *OneSignal::DefaultApi* | [**cancel_notification**](docs/DefaultApi.md#cancel_notification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification +*OneSignal::DefaultApi* | [**copy_template_to_app**](docs/DefaultApi.md#copy_template_to_app) | **POST** /templates/{template_id}/copy_to_app | Copy template to another app *OneSignal::DefaultApi* | [**create_alias**](docs/DefaultApi.md#create_alias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | *OneSignal::DefaultApi* | [**create_alias_by_subscription**](docs/DefaultApi.md#create_alias_by_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | +*OneSignal::DefaultApi* | [**create_api_key**](docs/DefaultApi.md#create_api_key) | **POST** /apps/{app_id}/auth/tokens | Create API key *OneSignal::DefaultApi* | [**create_app**](docs/DefaultApi.md#create_app) | **POST** /apps | Create an app +*OneSignal::DefaultApi* | [**create_custom_events**](docs/DefaultApi.md#create_custom_events) | **POST** /apps/{app_id}/integrations/custom_events | Create custom events *OneSignal::DefaultApi* | [**create_notification**](docs/DefaultApi.md#create_notification) | **POST** /notifications | Create notification *OneSignal::DefaultApi* | [**create_segment**](docs/DefaultApi.md#create_segment) | **POST** /apps/{app_id}/segments | Create Segment *OneSignal::DefaultApi* | [**create_subscription**](docs/DefaultApi.md#create_subscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | +*OneSignal::DefaultApi* | [**create_template**](docs/DefaultApi.md#create_template) | **POST** /templates | Create template *OneSignal::DefaultApi* | [**create_user**](docs/DefaultApi.md#create_user) | **POST** /apps/{app_id}/users | *OneSignal::DefaultApi* | [**delete_alias**](docs/DefaultApi.md#delete_alias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | +*OneSignal::DefaultApi* | [**delete_api_key**](docs/DefaultApi.md#delete_api_key) | **DELETE** /apps/{app_id}/auth/tokens/{token_id} | Delete API key *OneSignal::DefaultApi* | [**delete_segment**](docs/DefaultApi.md#delete_segment) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segment *OneSignal::DefaultApi* | [**delete_subscription**](docs/DefaultApi.md#delete_subscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | +*OneSignal::DefaultApi* | [**delete_template**](docs/DefaultApi.md#delete_template) | **DELETE** /templates/{template_id} | Delete template *OneSignal::DefaultApi* | [**delete_user**](docs/DefaultApi.md#delete_user) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | *OneSignal::DefaultApi* | [**export_events**](docs/DefaultApi.md#export_events) | **POST** /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events *OneSignal::DefaultApi* | [**export_subscriptions**](docs/DefaultApi.md#export_subscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions @@ -109,27 +115,43 @@ Class | Method | HTTP request | Description *OneSignal::DefaultApi* | [**get_outcomes**](docs/DefaultApi.md#get_outcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes *OneSignal::DefaultApi* | [**get_segments**](docs/DefaultApi.md#get_segments) | **GET** /apps/{app_id}/segments | Get Segments *OneSignal::DefaultApi* | [**get_user**](docs/DefaultApi.md#get_user) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | +*OneSignal::DefaultApi* | [**rotate_api_key**](docs/DefaultApi.md#rotate_api_key) | **POST** /apps/{app_id}/auth/tokens/{token_id}/rotate | Rotate API key +*OneSignal::DefaultApi* | [**start_live_activity**](docs/DefaultApi.md#start_live_activity) | **POST** /apps/{app_id}/activities/activity/{activity_type} | Start Live Activity *OneSignal::DefaultApi* | [**transfer_subscription**](docs/DefaultApi.md#transfer_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | *OneSignal::DefaultApi* | [**unsubscribe_email_with_token**](docs/DefaultApi.md#unsubscribe_email_with_token) | **POST** /apps/{app_id}/notifications/{notification_id}/unsubscribe | Unsubscribe with token +*OneSignal::DefaultApi* | [**update_api_key**](docs/DefaultApi.md#update_api_key) | **PATCH** /apps/{app_id}/auth/tokens/{token_id} | Update API key *OneSignal::DefaultApi* | [**update_app**](docs/DefaultApi.md#update_app) | **PUT** /apps/{app_id} | Update an app *OneSignal::DefaultApi* | [**update_live_activity**](docs/DefaultApi.md#update_live_activity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push *OneSignal::DefaultApi* | [**update_subscription**](docs/DefaultApi.md#update_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | +*OneSignal::DefaultApi* | [**update_subscription_by_token**](docs/DefaultApi.md#update_subscription_by_token) | **PATCH** /apps/{app_id}/subscriptions_by_token/{token_type}/{token} | Update subscription by token +*OneSignal::DefaultApi* | [**update_template**](docs/DefaultApi.md#update_template) | **PATCH** /templates/{template_id} | Update template *OneSignal::DefaultApi* | [**update_user**](docs/DefaultApi.md#update_user) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} | +*OneSignal::DefaultApi* | [**view_api_keys**](docs/DefaultApi.md#view_api_keys) | **GET** /apps/{app_id}/auth/tokens | View API keys +*OneSignal::DefaultApi* | [**view_template**](docs/DefaultApi.md#view_template) | **GET** /templates/{template_id} | View template +*OneSignal::DefaultApi* | [**view_templates**](docs/DefaultApi.md#view_templates) | **GET** /templates | View templates ## Documentation for Models + - [OneSignal::ApiKeyToken](docs/ApiKeyToken.md) + - [OneSignal::ApiKeyTokensListResponse](docs/ApiKeyTokensListResponse.md) - [OneSignal::App](docs/App.md) - [OneSignal::BasicNotification](docs/BasicNotification.md) - [OneSignal::BasicNotificationAllOf](docs/BasicNotificationAllOf.md) - [OneSignal::BasicNotificationAllOfAndroidBackgroundLayout](docs/BasicNotificationAllOfAndroidBackgroundLayout.md) - [OneSignal::Button](docs/Button.md) + - [OneSignal::CopyTemplateRequest](docs/CopyTemplateRequest.md) + - [OneSignal::CreateApiKeyRequest](docs/CreateApiKeyRequest.md) + - [OneSignal::CreateApiKeyResponse](docs/CreateApiKeyResponse.md) - [OneSignal::CreateNotificationSuccessResponse](docs/CreateNotificationSuccessResponse.md) - [OneSignal::CreateSegmentConflictResponse](docs/CreateSegmentConflictResponse.md) - [OneSignal::CreateSegmentSuccessResponse](docs/CreateSegmentSuccessResponse.md) + - [OneSignal::CreateTemplateRequest](docs/CreateTemplateRequest.md) - [OneSignal::CreateUserConflictResponse](docs/CreateUserConflictResponse.md) - [OneSignal::CreateUserConflictResponseErrorsInner](docs/CreateUserConflictResponseErrorsInner.md) - [OneSignal::CreateUserConflictResponseErrorsItemsMeta](docs/CreateUserConflictResponseErrorsItemsMeta.md) + - [OneSignal::CustomEvent](docs/CustomEvent.md) + - [OneSignal::CustomEventsRequest](docs/CustomEventsRequest.md) - [OneSignal::DeliveryData](docs/DeliveryData.md) - [OneSignal::ExportEventsSuccessResponse](docs/ExportEventsSuccessResponse.md) - [OneSignal::ExportSubscriptionsRequestBody](docs/ExportSubscriptionsRequestBody.md) @@ -162,12 +184,18 @@ Class | Method | HTTP request | Description - [OneSignal::Segment](docs/Segment.md) - [OneSignal::SegmentData](docs/SegmentData.md) - [OneSignal::SegmentNotificationTarget](docs/SegmentNotificationTarget.md) + - [OneSignal::StartLiveActivityRequest](docs/StartLiveActivityRequest.md) + - [OneSignal::StartLiveActivitySuccessResponse](docs/StartLiveActivitySuccessResponse.md) - [OneSignal::Subscription](docs/Subscription.md) - [OneSignal::SubscriptionBody](docs/SubscriptionBody.md) - [OneSignal::SubscriptionNotificationTarget](docs/SubscriptionNotificationTarget.md) + - [OneSignal::TemplateResource](docs/TemplateResource.md) + - [OneSignal::TemplatesListResponse](docs/TemplatesListResponse.md) - [OneSignal::TransferSubscriptionRequestBody](docs/TransferSubscriptionRequestBody.md) + - [OneSignal::UpdateApiKeyRequest](docs/UpdateApiKeyRequest.md) - [OneSignal::UpdateLiveActivityRequest](docs/UpdateLiveActivityRequest.md) - [OneSignal::UpdateLiveActivitySuccessResponse](docs/UpdateLiveActivitySuccessResponse.md) + - [OneSignal::UpdateTemplateRequest](docs/UpdateTemplateRequest.md) - [OneSignal::UpdateUserRequest](docs/UpdateUserRequest.md) - [OneSignal::User](docs/User.md) - [OneSignal::UserIdentityBody](docs/UserIdentityBody.md) diff --git a/docs/ApiKeyToken.md b/docs/ApiKeyToken.md new file mode 100644 index 0000000..d5423f8 --- /dev/null +++ b/docs/ApiKeyToken.md @@ -0,0 +1,28 @@ +# OneSignal::ApiKeyToken + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **token_id** | **String** | | [optional] | +| **updated_at** | **String** | | [optional] | +| **created_at** | **String** | | [optional] | +| **name** | **String** | | [optional] | +| **ip_allowlist_mode** | **String** | | [optional] | +| **ip_allowlist** | **Array<String>** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::ApiKeyToken.new( + token_id: null, + updated_at: null, + created_at: null, + name: null, + ip_allowlist_mode: null, + ip_allowlist: null +) +``` + diff --git a/docs/ApiKeyTokensListResponse.md b/docs/ApiKeyTokensListResponse.md new file mode 100644 index 0000000..d8e446b --- /dev/null +++ b/docs/ApiKeyTokensListResponse.md @@ -0,0 +1,18 @@ +# OneSignal::ApiKeyTokensListResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **tokens** | [**Array<ApiKeyToken>**](ApiKeyToken.md) | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::ApiKeyTokensListResponse.new( + tokens: null +) +``` + diff --git a/docs/CopyTemplateRequest.md b/docs/CopyTemplateRequest.md new file mode 100644 index 0000000..90d0a53 --- /dev/null +++ b/docs/CopyTemplateRequest.md @@ -0,0 +1,18 @@ +# OneSignal::CopyTemplateRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **target_app_id** | **String** | Destination OneSignal App ID in UUID v4 format. | | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::CopyTemplateRequest.new( + target_app_id: null +) +``` + diff --git a/docs/CreateApiKeyRequest.md b/docs/CreateApiKeyRequest.md new file mode 100644 index 0000000..99eb9e4 --- /dev/null +++ b/docs/CreateApiKeyRequest.md @@ -0,0 +1,22 @@ +# OneSignal::CreateApiKeyRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | | [optional] | +| **ip_allowlist_mode** | **String** | | [optional] | +| **ip_allowlist** | **Array<String>** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::CreateApiKeyRequest.new( + name: null, + ip_allowlist_mode: null, + ip_allowlist: null +) +``` + diff --git a/docs/CreateApiKeyResponse.md b/docs/CreateApiKeyResponse.md new file mode 100644 index 0000000..daaca8f --- /dev/null +++ b/docs/CreateApiKeyResponse.md @@ -0,0 +1,20 @@ +# OneSignal::CreateApiKeyResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **token_id** | **String** | | [optional] | +| **formatted_token** | **String** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::CreateApiKeyResponse.new( + token_id: null, + formatted_token: null +) +``` + diff --git a/docs/CreateTemplateRequest.md b/docs/CreateTemplateRequest.md new file mode 100644 index 0000000..b7f3cf6 --- /dev/null +++ b/docs/CreateTemplateRequest.md @@ -0,0 +1,32 @@ +# OneSignal::CreateTemplateRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | Your OneSignal App ID in UUID v4 format. | | +| **name** | **String** | Name of the template. | | +| **contents** | [**LanguageStringMap**](LanguageStringMap.md) | | | +| **is_email** | **Boolean** | Set true for an Email template. | [optional] | +| **email_subject** | **String** | Subject of the email. | [optional] | +| **email_body** | **String** | Body of the email (HTML supported). | [optional] | +| **is_sms** | **Boolean** | Set true for an SMS template. | [optional] | +| **dynamic_content** | **String** | JSON string for dynamic content personalization. | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::CreateTemplateRequest.new( + app_id: null, + name: null, + contents: null, + is_email: null, + email_subject: null, + email_body: null, + is_sms: null, + dynamic_content: null +) +``` + diff --git a/docs/CustomEvent.md b/docs/CustomEvent.md new file mode 100644 index 0000000..c779a45 --- /dev/null +++ b/docs/CustomEvent.md @@ -0,0 +1,26 @@ +# OneSignal::CustomEvent + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | The identifier or name of the event. Maximum 128 characters. | | +| **external_id** | **String** | The external ID of the user targeted for the event. Either the user's External ID or OneSignal ID is required. | [optional] | +| **onesignal_id** | **String** | The OneSignal ID of the user targeted for the event. Either the user's External ID or OneSignal ID is required. | [optional] | +| **timestamp** | **Time** | Time the event occurred as an ISO8601 formatted string. Defaults to now if not included or past date provided. | [optional] | +| **payload** | **Hash<String, Object>** | Properties or data related to the event, like {\"geography\": \"USA\"} | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::CustomEvent.new( + name: null, + external_id: null, + onesignal_id: null, + timestamp: null, + payload: null +) +``` + diff --git a/docs/CustomEventsRequest.md b/docs/CustomEventsRequest.md new file mode 100644 index 0000000..611a505 --- /dev/null +++ b/docs/CustomEventsRequest.md @@ -0,0 +1,18 @@ +# OneSignal::CustomEventsRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **events** | [**Array<CustomEvent>**](CustomEvent.md) | | | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::CustomEventsRequest.new( + events: null +) +``` + diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md index e3eba13..dab6c25 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -5,16 +5,22 @@ All URIs are relative to *https://api.onesignal.com* | Method | HTTP request | Description | | ------ | ------------ | ----------- | | [**cancel_notification**](DefaultApi.md#cancel_notification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification | +| [**copy_template_to_app**](DefaultApi.md#copy_template_to_app) | **POST** /templates/{template_id}/copy_to_app | Copy template to another app | | [**create_alias**](DefaultApi.md#create_alias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | | | [**create_alias_by_subscription**](DefaultApi.md#create_alias_by_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | | +| [**create_api_key**](DefaultApi.md#create_api_key) | **POST** /apps/{app_id}/auth/tokens | Create API key | | [**create_app**](DefaultApi.md#create_app) | **POST** /apps | Create an app | +| [**create_custom_events**](DefaultApi.md#create_custom_events) | **POST** /apps/{app_id}/integrations/custom_events | Create custom events | | [**create_notification**](DefaultApi.md#create_notification) | **POST** /notifications | Create notification | | [**create_segment**](DefaultApi.md#create_segment) | **POST** /apps/{app_id}/segments | Create Segment | | [**create_subscription**](DefaultApi.md#create_subscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | | +| [**create_template**](DefaultApi.md#create_template) | **POST** /templates | Create template | | [**create_user**](DefaultApi.md#create_user) | **POST** /apps/{app_id}/users | | | [**delete_alias**](DefaultApi.md#delete_alias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | | +| [**delete_api_key**](DefaultApi.md#delete_api_key) | **DELETE** /apps/{app_id}/auth/tokens/{token_id} | Delete API key | | [**delete_segment**](DefaultApi.md#delete_segment) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segment | | [**delete_subscription**](DefaultApi.md#delete_subscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | | +| [**delete_template**](DefaultApi.md#delete_template) | **DELETE** /templates/{template_id} | Delete template | | [**delete_user**](DefaultApi.md#delete_user) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | | | [**export_events**](DefaultApi.md#export_events) | **POST** /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events | | [**export_subscriptions**](DefaultApi.md#export_subscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions | @@ -28,12 +34,20 @@ All URIs are relative to *https://api.onesignal.com* | [**get_outcomes**](DefaultApi.md#get_outcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes | | [**get_segments**](DefaultApi.md#get_segments) | **GET** /apps/{app_id}/segments | Get Segments | | [**get_user**](DefaultApi.md#get_user) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | | +| [**rotate_api_key**](DefaultApi.md#rotate_api_key) | **POST** /apps/{app_id}/auth/tokens/{token_id}/rotate | Rotate API key | +| [**start_live_activity**](DefaultApi.md#start_live_activity) | **POST** /apps/{app_id}/activities/activity/{activity_type} | Start Live Activity | | [**transfer_subscription**](DefaultApi.md#transfer_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | | | [**unsubscribe_email_with_token**](DefaultApi.md#unsubscribe_email_with_token) | **POST** /apps/{app_id}/notifications/{notification_id}/unsubscribe | Unsubscribe with token | +| [**update_api_key**](DefaultApi.md#update_api_key) | **PATCH** /apps/{app_id}/auth/tokens/{token_id} | Update API key | | [**update_app**](DefaultApi.md#update_app) | **PUT** /apps/{app_id} | Update an app | | [**update_live_activity**](DefaultApi.md#update_live_activity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push | | [**update_subscription**](DefaultApi.md#update_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | | +| [**update_subscription_by_token**](DefaultApi.md#update_subscription_by_token) | **PATCH** /apps/{app_id}/subscriptions_by_token/{token_type}/{token} | Update subscription by token | +| [**update_template**](DefaultApi.md#update_template) | **PATCH** /templates/{template_id} | Update template | | [**update_user**](DefaultApi.md#update_user) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} | | +| [**view_api_keys**](DefaultApi.md#view_api_keys) | **GET** /apps/{app_id}/auth/tokens | View API keys | +| [**view_template**](DefaultApi.md#view_template) | **GET** /templates/{template_id} | View template | +| [**view_templates**](DefaultApi.md#view_templates) | **GET** /templates | View templates | ## cancel_notification @@ -107,6 +121,79 @@ end - **Accept**: application/json +## copy_template_to_app + +> copy_template_to_app(template_id, app_id, copy_template_request) + +Copy template to another app + +Copy a template to a destination app. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: organization_api_key + config.organization_api_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +template_id = 'template_id_example' # String | +app_id = 'app_id_example' # String | +copy_template_request = OneSignal::CopyTemplateRequest.new({target_app_id: 'target_app_id_example'}) # CopyTemplateRequest | + +begin + # Copy template to another app + result = api_instance.copy_template_to_app(template_id, app_id, copy_template_request) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->copy_template_to_app: #{e}" +end +``` + +#### Using the copy_template_to_app_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> copy_template_to_app_with_http_info(template_id, app_id, copy_template_request) + +```ruby +begin + # Copy template to another app + data, status_code, headers = api_instance.copy_template_to_app_with_http_info(template_id, app_id, copy_template_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->copy_template_to_app_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **template_id** | **String** | | | +| **app_id** | **String** | | | +| **copy_template_request** | [**CopyTemplateRequest**](CopyTemplateRequest.md) | | | + +### Return type + +[**TemplateResource**](TemplateResource.md) + +### Authorization + +[organization_api_key](../README.md#organization_api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + ## create_alias > create_alias(app_id, alias_label, alias_id, user_identity_body) @@ -255,6 +342,77 @@ end - **Accept**: application/json +## create_api_key + +> create_api_key(app_id, create_api_key_request) + +Create API key + +Use this API to create a new App API Key (also called a Rich Authentication Token) for a specific OneSignal app. These keys are used to authenticate API requests at the app level and offer enhanced security features, including optional IP allowlisting. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: organization_api_key + config.organization_api_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | +create_api_key_request = OneSignal::CreateApiKeyRequest.new # CreateApiKeyRequest | + +begin + # Create API key + result = api_instance.create_api_key(app_id, create_api_key_request) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->create_api_key: #{e}" +end +``` + +#### Using the create_api_key_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_api_key_with_http_info(app_id, create_api_key_request) + +```ruby +begin + # Create API key + data, status_code, headers = api_instance.create_api_key_with_http_info(app_id, create_api_key_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->create_api_key_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | | | +| **create_api_key_request** | [**CreateApiKeyRequest**](CreateApiKeyRequest.md) | | | + +### Return type + +[**CreateApiKeyResponse**](CreateApiKeyResponse.md) + +### Authorization + +[organization_api_key](../README.md#organization_api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + ## create_app > create_app(app) @@ -324,6 +482,77 @@ end - **Accept**: application/json +## create_custom_events + +> Object create_custom_events(app_id, custom_events_request) + +Create custom events + +The Custom Events API allows you to record user events. Custom events can represent any action users take in your application, such as completing a purchase, viewing content, or achieving milestones. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | Your OneSignal App ID in UUID v4 format. +custom_events_request = OneSignal::CustomEventsRequest.new({events: [OneSignal::CustomEvent.new({name: 'name_example'})]}) # CustomEventsRequest | + +begin + # Create custom events + result = api_instance.create_custom_events(app_id, custom_events_request) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->create_custom_events: #{e}" +end +``` + +#### Using the create_custom_events_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> create_custom_events_with_http_info(app_id, custom_events_request) + +```ruby +begin + # Create custom events + data, status_code, headers = api_instance.create_custom_events_with_http_info(app_id, custom_events_request) + p status_code # => 2xx + p headers # => { ... } + p data # => Object +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->create_custom_events_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | Your OneSignal App ID in UUID v4 format. | | +| **custom_events_request** | [**CustomEventsRequest**](CustomEventsRequest.md) | | | + +### Return type + +**Object** + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + ## create_notification > create_notification(notification) @@ -541,6 +770,75 @@ end - **Accept**: application/json +## create_template + +> create_template(create_template_request) + +Create template + +Create reusable message templates for push, email, and SMS channels. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +create_template_request = OneSignal::CreateTemplateRequest.new({app_id: 'app_id_example', name: 'name_example', contents: OneSignal::LanguageStringMap.new}) # CreateTemplateRequest | + +begin + # Create template + result = api_instance.create_template(create_template_request) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->create_template: #{e}" +end +``` + +#### Using the create_template_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_template_with_http_info(create_template_request) + +```ruby +begin + # Create template + data, status_code, headers = api_instance.create_template_with_http_info(create_template_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->create_template_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **create_template_request** | [**CreateTemplateRequest**](CreateTemplateRequest.md) | | | + +### Return type + +[**TemplateResource**](TemplateResource.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + ## create_user > create_user(app_id, user) @@ -687,13 +985,13 @@ end - **Accept**: application/json -## delete_segment +## delete_api_key -> delete_segment(app_id, segment_id) +> Object delete_api_key(app_id, token_id) -Delete Segment +Delete API key -Delete a segment (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. +Delete a specific Rich Authentication Token (App API Key) for a OneSignal app. Requires your Organization API Key and the token’s unique ID, not the token value itself. ### Examples @@ -701,39 +999,39 @@ Delete a segment (not user devices) - Required: OneSignal Paid Plan You can dele require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: rest_api_key - config.rest_api_key = 'YOUR_BEARER_TOKEN' + # Configure Bearer authorization: organization_api_key + config.organization_api_key = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. -segment_id = 'segment_id_example' # String | The segment_id can be found in the URL of the segment when viewing it in the dashboard. +app_id = 'app_id_example' # String | +token_id = 'token_id_example' # String | begin - # Delete Segment - result = api_instance.delete_segment(app_id, segment_id) + # Delete API key + result = api_instance.delete_api_key(app_id, token_id) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->delete_segment: #{e}" + puts "Error when calling DefaultApi->delete_api_key: #{e}" end ``` -#### Using the delete_segment_with_http_info variant +#### Using the delete_api_key_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> delete_segment_with_http_info(app_id, segment_id) +> delete_api_key_with_http_info(app_id, token_id) ```ruby begin - # Delete Segment - data, status_code, headers = api_instance.delete_segment_with_http_info(app_id, segment_id) + # Delete API key + data, status_code, headers = api_instance.delete_api_key_with_http_info(app_id, token_id) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => Object rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->delete_segment_with_http_info: #{e}" + puts "Error when calling DefaultApi->delete_api_key_with_http_info: #{e}" end ``` @@ -741,16 +1039,16 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | | -| **segment_id** | **String** | The segment_id can be found in the URL of the segment when viewing it in the dashboard. | | +| **app_id** | **String** | | | +| **token_id** | **String** | | | ### Return type -[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md) +**Object** ### Authorization -[rest_api_key](../README.md#rest_api_key) +[organization_api_key](../README.md#organization_api_key) ### HTTP request headers @@ -758,13 +1056,13 @@ end - **Accept**: application/json -## delete_subscription - -> delete_subscription(app_id, subscription_id) +## delete_segment +> delete_segment(app_id, segment_id) +Delete Segment -Deletes the Subscription. +Delete a segment (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. ### Examples @@ -778,12 +1076,83 @@ OneSignal.configure do |config| end api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | -subscription_id = 'subscription_id_example' # String | +app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. +segment_id = 'segment_id_example' # String | The segment_id can be found in the URL of the segment when viewing it in the dashboard. begin - - api_instance.delete_subscription(app_id, subscription_id) + # Delete Segment + result = api_instance.delete_segment(app_id, segment_id) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->delete_segment: #{e}" +end +``` + +#### Using the delete_segment_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> delete_segment_with_http_info(app_id, segment_id) + +```ruby +begin + # Delete Segment + data, status_code, headers = api_instance.delete_segment_with_http_info(app_id, segment_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->delete_segment_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | | +| **segment_id** | **String** | The segment_id can be found in the URL of the segment when viewing it in the dashboard. | | + +### Return type + +[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_subscription + +> delete_subscription(app_id, subscription_id) + + + +Deletes the Subscription. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | +subscription_id = 'subscription_id_example' # String | + +begin + + api_instance.delete_subscription(app_id, subscription_id) rescue OneSignal::ApiError => e puts "Error when calling DefaultApi->delete_subscription: #{e}" end @@ -828,6 +1197,77 @@ nil (empty response body) - **Accept**: application/json +## delete_template + +> delete_template(template_id, app_id) + +Delete template + +Delete a template by id. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +template_id = 'template_id_example' # String | +app_id = 'app_id_example' # String | + +begin + # Delete template + result = api_instance.delete_template(template_id, app_id) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->delete_template: #{e}" +end +``` + +#### Using the delete_template_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> delete_template_with_http_info(template_id, app_id) + +```ruby +begin + # Delete template + data, status_code, headers = api_instance.delete_template_with_http_info(template_id, app_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->delete_template_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **template_id** | **String** | | | +| **app_id** | **String** | | | + +### Return type + +[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + ## delete_user > delete_user(app_id, alias_label, alias_id) @@ -1771,13 +2211,13 @@ end - **Accept**: application/json -## transfer_subscription - -> transfer_subscription(app_id, subscription_id, transfer_subscription_request_body) +## rotate_api_key +> rotate_api_key(app_id, token_id) +Rotate API key -Transfers this Subscription to the User identified by the identity in the payload. +Rotate a Rich Authentication Token (App API Key) for a OneSignal app. Rotating a key revokes the current token and generates a new one under the same configuration—ideal when a token is lost or compromised but you don’t want to recreate and reconfigure it from scratch. ### Examples @@ -1785,40 +2225,39 @@ Transfers this Subscription to the User identified by the identity in the payloa require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: rest_api_key - config.rest_api_key = 'YOUR_BEARER_TOKEN' + # Configure Bearer authorization: organization_api_key + config.organization_api_key = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new app_id = 'app_id_example' # String | -subscription_id = 'subscription_id_example' # String | -transfer_subscription_request_body = OneSignal::TransferSubscriptionRequestBody.new # TransferSubscriptionRequestBody | +token_id = 'token_id_example' # String | begin - - result = api_instance.transfer_subscription(app_id, subscription_id, transfer_subscription_request_body) + # Rotate API key + result = api_instance.rotate_api_key(app_id, token_id) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->transfer_subscription: #{e}" + puts "Error when calling DefaultApi->rotate_api_key: #{e}" end ``` -#### Using the transfer_subscription_with_http_info variant +#### Using the rotate_api_key_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body) +> , Integer, Hash)> rotate_api_key_with_http_info(app_id, token_id) ```ruby begin - - data, status_code, headers = api_instance.transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body) + # Rotate API key + data, status_code, headers = api_instance.rotate_api_key_with_http_info(app_id, token_id) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->transfer_subscription_with_http_info: #{e}" + puts "Error when calling DefaultApi->rotate_api_key_with_http_info: #{e}" end ``` @@ -1827,30 +2266,29 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **app_id** | **String** | | | -| **subscription_id** | **String** | | | -| **transfer_subscription_request_body** | [**TransferSubscriptionRequestBody**](TransferSubscriptionRequestBody.md) | | | +| **token_id** | **String** | | | ### Return type -[**UserIdentityBody**](UserIdentityBody.md) +[**CreateApiKeyResponse**](CreateApiKeyResponse.md) ### Authorization -[rest_api_key](../README.md#rest_api_key) +[organization_api_key](../README.md#organization_api_key) ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not defined - **Accept**: application/json -## unsubscribe_email_with_token +## start_live_activity -> unsubscribe_email_with_token(app_id, notification_id, token) +> start_live_activity(app_id, activity_type, start_live_activity_request) -Unsubscribe with token +Start Live Activity -Unsubscribe an email with a token when using your own custom email unsubscribe landing page +Remotely start a Live Activity on iOS devices via OneSignal’s REST API. ### Examples @@ -1864,34 +2302,34 @@ OneSignal.configure do |config| end api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. -notification_id = 'notification_id_example' # String | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. -token = 'token_example' # String | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. +app_id = 'app_id_example' # String | Your OneSignal App ID in UUID v4 format. +activity_type = 'activity_type_example' # String | The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. +start_live_activity_request = OneSignal::StartLiveActivityRequest.new({name: 'name_example', event: 'start', activity_id: 'activity_id_example', event_attributes: 3.56, event_updates: 3.56, contents: OneSignal::LanguageStringMap.new, headings: OneSignal::LanguageStringMap.new}) # StartLiveActivityRequest | begin - # Unsubscribe with token - result = api_instance.unsubscribe_email_with_token(app_id, notification_id, token) + # Start Live Activity + result = api_instance.start_live_activity(app_id, activity_type, start_live_activity_request) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->unsubscribe_email_with_token: #{e}" + puts "Error when calling DefaultApi->start_live_activity: #{e}" end ``` -#### Using the unsubscribe_email_with_token_with_http_info variant +#### Using the start_live_activity_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> unsubscribe_email_with_token_with_http_info(app_id, notification_id, token) +> , Integer, Hash)> start_live_activity_with_http_info(app_id, activity_type, start_live_activity_request) ```ruby begin - # Unsubscribe with token - data, status_code, headers = api_instance.unsubscribe_email_with_token_with_http_info(app_id, notification_id, token) + # Start Live Activity + data, status_code, headers = api_instance.start_live_activity_with_http_info(app_id, activity_type, start_live_activity_request) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->unsubscribe_email_with_token_with_http_info: #{e}" + puts "Error when calling DefaultApi->start_live_activity_with_http_info: #{e}" end ``` @@ -1899,13 +2337,13 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | | -| **notification_id** | **String** | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. | | -| **token** | **String** | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. | | +| **app_id** | **String** | Your OneSignal App ID in UUID v4 format. | | +| **activity_type** | **String** | The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. | | +| **start_live_activity_request** | [**StartLiveActivityRequest**](StartLiveActivityRequest.md) | | | ### Return type -[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md) +[**StartLiveActivitySuccessResponse**](StartLiveActivitySuccessResponse.md) ### Authorization @@ -1913,17 +2351,17 @@ end ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json -## update_app +## transfer_subscription -> update_app(app_id, app) +> transfer_subscription(app_id, subscription_id, transfer_subscription_request_body) -Update an app -Updates the name or configuration settings of an existing OneSignal app + +Transfers this Subscription to the User identified by the identity in the payload. ### Examples @@ -1931,39 +2369,40 @@ Updates the name or configuration settings of an existing OneSignal app require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: organization_api_key - config.organization_api_key = 'YOUR_BEARER_TOKEN' + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | An app id -app = OneSignal::App.new # App | +app_id = 'app_id_example' # String | +subscription_id = 'subscription_id_example' # String | +transfer_subscription_request_body = OneSignal::TransferSubscriptionRequestBody.new # TransferSubscriptionRequestBody | begin - # Update an app - result = api_instance.update_app(app_id, app) + + result = api_instance.transfer_subscription(app_id, subscription_id, transfer_subscription_request_body) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->update_app: #{e}" + puts "Error when calling DefaultApi->transfer_subscription: #{e}" end ``` -#### Using the update_app_with_http_info variant +#### Using the transfer_subscription_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> update_app_with_http_info(app_id, app) +> , Integer, Hash)> transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body) ```ruby begin - # Update an app - data, status_code, headers = api_instance.update_app_with_http_info(app_id, app) + + data, status_code, headers = api_instance.transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->update_app_with_http_info: #{e}" + puts "Error when calling DefaultApi->transfer_subscription_with_http_info: #{e}" end ``` @@ -1971,16 +2410,17 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **app_id** | **String** | An app id | | -| **app** | [**App**](App.md) | | | +| **app_id** | **String** | | | +| **subscription_id** | **String** | | | +| **transfer_subscription_request_body** | [**TransferSubscriptionRequestBody**](TransferSubscriptionRequestBody.md) | | | ### Return type -[**App**](App.md) +[**UserIdentityBody**](UserIdentityBody.md) ### Authorization -[organization_api_key](../README.md#organization_api_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -1988,13 +2428,13 @@ end - **Accept**: application/json -## update_live_activity +## unsubscribe_email_with_token -> update_live_activity(app_id, activity_id, update_live_activity_request) +> unsubscribe_email_with_token(app_id, notification_id, token) -Update a Live Activity via Push +Unsubscribe with token -Updates a specified live activity. +Unsubscribe an email with a token when using your own custom email unsubscribe landing page ### Examples @@ -2009,33 +2449,33 @@ end api_instance = OneSignal::DefaultApi.new app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. -activity_id = 'activity_id_example' # String | Live Activity record ID -update_live_activity_request = OneSignal::UpdateLiveActivityRequest.new({name: 'name_example', event: 'update', event_updates: 3.56}) # UpdateLiveActivityRequest | +notification_id = 'notification_id_example' # String | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. +token = 'token_example' # String | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. begin - # Update a Live Activity via Push - result = api_instance.update_live_activity(app_id, activity_id, update_live_activity_request) + # Unsubscribe with token + result = api_instance.unsubscribe_email_with_token(app_id, notification_id, token) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->update_live_activity: #{e}" + puts "Error when calling DefaultApi->unsubscribe_email_with_token: #{e}" end ``` -#### Using the update_live_activity_with_http_info variant +#### Using the unsubscribe_email_with_token_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> update_live_activity_with_http_info(app_id, activity_id, update_live_activity_request) +> , Integer, Hash)> unsubscribe_email_with_token_with_http_info(app_id, notification_id, token) ```ruby begin - # Update a Live Activity via Push - data, status_code, headers = api_instance.update_live_activity_with_http_info(app_id, activity_id, update_live_activity_request) + # Unsubscribe with token + data, status_code, headers = api_instance.unsubscribe_email_with_token_with_http_info(app_id, notification_id, token) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->update_live_activity_with_http_info: #{e}" + puts "Error when calling DefaultApi->unsubscribe_email_with_token_with_http_info: #{e}" end ``` @@ -2044,8 +2484,225 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | | -| **activity_id** | **String** | Live Activity record ID | | -| **update_live_activity_request** | [**UpdateLiveActivityRequest**](UpdateLiveActivityRequest.md) | | | +| **notification_id** | **String** | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. | | +| **token** | **String** | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. | | + +### Return type + +[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update_api_key + +> Object update_api_key(app_id, token_id, update_api_key_request) + +Update API key + +Update a Rich Authentication Token (App API Key) for a OneSignal app. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: organization_api_key + config.organization_api_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | +token_id = 'token_id_example' # String | +update_api_key_request = OneSignal::UpdateApiKeyRequest.new # UpdateApiKeyRequest | + +begin + # Update API key + result = api_instance.update_api_key(app_id, token_id, update_api_key_request) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->update_api_key: #{e}" +end +``` + +#### Using the update_api_key_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> update_api_key_with_http_info(app_id, token_id, update_api_key_request) + +```ruby +begin + # Update API key + data, status_code, headers = api_instance.update_api_key_with_http_info(app_id, token_id, update_api_key_request) + p status_code # => 2xx + p headers # => { ... } + p data # => Object +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->update_api_key_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | | | +| **token_id** | **String** | | | +| **update_api_key_request** | [**UpdateApiKeyRequest**](UpdateApiKeyRequest.md) | | | + +### Return type + +**Object** + +### Authorization + +[organization_api_key](../README.md#organization_api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_app + +> update_app(app_id, app) + +Update an app + +Updates the name or configuration settings of an existing OneSignal app + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: organization_api_key + config.organization_api_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | An app id +app = OneSignal::App.new # App | + +begin + # Update an app + result = api_instance.update_app(app_id, app) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->update_app: #{e}" +end +``` + +#### Using the update_app_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_app_with_http_info(app_id, app) + +```ruby +begin + # Update an app + data, status_code, headers = api_instance.update_app_with_http_info(app_id, app) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->update_app_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | An app id | | +| **app** | [**App**](App.md) | | | + +### Return type + +[**App**](App.md) + +### Authorization + +[organization_api_key](../README.md#organization_api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_live_activity + +> update_live_activity(app_id, activity_id, update_live_activity_request) + +Update a Live Activity via Push + +Updates a specified live activity. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. +activity_id = 'activity_id_example' # String | Live Activity record ID +update_live_activity_request = OneSignal::UpdateLiveActivityRequest.new({name: 'name_example', event: 'update', event_updates: 3.56}) # UpdateLiveActivityRequest | + +begin + # Update a Live Activity via Push + result = api_instance.update_live_activity(app_id, activity_id, update_live_activity_request) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->update_live_activity: #{e}" +end +``` + +#### Using the update_live_activity_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_live_activity_with_http_info(app_id, activity_id, update_live_activity_request) + +```ruby +begin + # Update a Live Activity via Push + data, status_code, headers = api_instance.update_live_activity_with_http_info(app_id, activity_id, update_live_activity_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->update_live_activity_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | | +| **activity_id** | **String** | Live Activity record ID | | +| **update_live_activity_request** | [**UpdateLiveActivityRequest**](UpdateLiveActivityRequest.md) | | | ### Return type @@ -2133,6 +2790,154 @@ nil (empty response body) - **Accept**: application/json +## update_subscription_by_token + +> Object update_subscription_by_token(app_id, token_type, token, subscription_body) + +Update subscription by token + +Update properties on an existing OneSignal subscription using its token. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | Your OneSignal App ID in UUID v4 format. +token_type = 'token_type_example' # String | The type of token to use when looking up the subscription. See Subscription Types. +token = 'token_example' # String | The value of the token to lookup by (e.g., email address, phone number). +subscription_body = OneSignal::SubscriptionBody.new # SubscriptionBody | + +begin + # Update subscription by token + result = api_instance.update_subscription_by_token(app_id, token_type, token, subscription_body) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->update_subscription_by_token: #{e}" +end +``` + +#### Using the update_subscription_by_token_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> update_subscription_by_token_with_http_info(app_id, token_type, token, subscription_body) + +```ruby +begin + # Update subscription by token + data, status_code, headers = api_instance.update_subscription_by_token_with_http_info(app_id, token_type, token, subscription_body) + p status_code # => 2xx + p headers # => { ... } + p data # => Object +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->update_subscription_by_token_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | Your OneSignal App ID in UUID v4 format. | | +| **token_type** | **String** | The type of token to use when looking up the subscription. See Subscription Types. | | +| **token** | **String** | The value of the token to lookup by (e.g., email address, phone number). | | +| **subscription_body** | [**SubscriptionBody**](SubscriptionBody.md) | | | + +### Return type + +**Object** + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_template + +> update_template(template_id, app_id, update_template_request) + +Update template + +Update an existing template. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +template_id = 'template_id_example' # String | +app_id = 'app_id_example' # String | +update_template_request = OneSignal::UpdateTemplateRequest.new # UpdateTemplateRequest | + +begin + # Update template + result = api_instance.update_template(template_id, app_id, update_template_request) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->update_template: #{e}" +end +``` + +#### Using the update_template_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_template_with_http_info(template_id, app_id, update_template_request) + +```ruby +begin + # Update template + data, status_code, headers = api_instance.update_template_with_http_info(template_id, app_id, update_template_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->update_template_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **template_id** | **String** | | | +| **app_id** | **String** | | | +| **update_template_request** | [**UpdateTemplateRequest**](UpdateTemplateRequest.md) | | | + +### Return type + +[**TemplateResource**](TemplateResource.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + ## update_user > update_user(app_id, alias_label, alias_id, update_user_request) @@ -2207,3 +3012,220 @@ end - **Content-Type**: application/json - **Accept**: application/json + +## view_api_keys + +> view_api_keys(app_id) + +View API keys + +View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: organization_api_key + config.organization_api_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | + +begin + # View API keys + result = api_instance.view_api_keys(app_id) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->view_api_keys: #{e}" +end +``` + +#### Using the view_api_keys_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> view_api_keys_with_http_info(app_id) + +```ruby +begin + # View API keys + data, status_code, headers = api_instance.view_api_keys_with_http_info(app_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->view_api_keys_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | | | + +### Return type + +[**ApiKeyTokensListResponse**](ApiKeyTokensListResponse.md) + +### Authorization + +[organization_api_key](../README.md#organization_api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## view_template + +> view_template(template_id, app_id) + +View template + +Fetch a single template by id. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +template_id = 'template_id_example' # String | +app_id = 'app_id_example' # String | + +begin + # View template + result = api_instance.view_template(template_id, app_id) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->view_template: #{e}" +end +``` + +#### Using the view_template_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> view_template_with_http_info(template_id, app_id) + +```ruby +begin + # View template + data, status_code, headers = api_instance.view_template_with_http_info(template_id, app_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->view_template_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **template_id** | **String** | | | +| **app_id** | **String** | | | + +### Return type + +[**TemplateResource**](TemplateResource.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## view_templates + +> view_templates(app_id, opts) + +View templates + +List templates for an app. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | Your OneSignal App ID in UUID v4 format. +opts = { + limit: 56, # Integer | Maximum number of templates. Default and max is 50. + offset: 56, # Integer | Pagination offset. + channel: 'push' # String | Filter by delivery channel. +} + +begin + # View templates + result = api_instance.view_templates(app_id, opts) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->view_templates: #{e}" +end +``` + +#### Using the view_templates_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> view_templates_with_http_info(app_id, opts) + +```ruby +begin + # View templates + data, status_code, headers = api_instance.view_templates_with_http_info(app_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->view_templates_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | Your OneSignal App ID in UUID v4 format. | | +| **limit** | **Integer** | Maximum number of templates. Default and max is 50. | [optional][default to 50] | +| **offset** | **Integer** | Pagination offset. | [optional][default to 0] | +| **channel** | **String** | Filter by delivery channel. | [optional] | + +### Return type + +[**TemplatesListResponse**](TemplatesListResponse.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/docs/StartLiveActivityRequest.md b/docs/StartLiveActivityRequest.md new file mode 100644 index 0000000..df13c4c --- /dev/null +++ b/docs/StartLiveActivityRequest.md @@ -0,0 +1,48 @@ +# OneSignal::StartLiveActivityRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | An internal name to assist with your campaign organization. This does not get displayed in the message itself. | | +| **event** | **String** | | [default to 'start'] | +| **activity_id** | **String** | Set a unique activity_id to track and manage the Live Activity. | | +| **event_attributes** | **Object** | Default/static data to initialize the Live Activity upon start. | | +| **event_updates** | **Object** | Dynamic content used to update the running Live Activity at start. Must match the ContentState interface defined in your app. | | +| **contents** | [**LanguageStringMap**](LanguageStringMap.md) | | | +| **headings** | [**LanguageStringMap**](LanguageStringMap.md) | | | +| **stale_date** | **Integer** | Accepts Unix timestamp in seconds. When time reaches the configured stale date, the system considers the Live Activity out of date, and the ActivityState of the Live Activity changes to ActivityState.stale. | [optional] | +| **priority** | **Integer** | Delivery priority through the push provider (APNs). Pass 10 for higher priority notifications, or 5 for lower priority notifications. Lower priority notifications are sent based on the power considerations of the end user's device. If not set, defaults to 10. | [optional] | +| **ios_relevance_score** | **Float** | iOS 15+. A score to indicate how a notification should be displayed when grouped. Use a float between 0-1. | [optional] | +| **idempotency_key** | **String** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] | +| **include_aliases** | **Hash<String, Array<String>>** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] | +| **include_subscription_ids** | **Array<String>** | Specific subscription ids to target. Not compatible with other targeting parameters. | [optional] | +| **included_segments** | **Array<String>** | Segment names to include. Only compatible with excluded_segments. | [optional] | +| **excluded_segments** | **Array<String>** | Segment names to exclude. Only compatible with included_segments. | [optional] | +| **filters** | [**Array<FilterExpression>**](FilterExpression.md) | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::StartLiveActivityRequest.new( + name: null, + event: null, + activity_id: null, + event_attributes: null, + event_updates: null, + contents: null, + headings: null, + stale_date: null, + priority: null, + ios_relevance_score: null, + idempotency_key: null, + include_aliases: null, + include_subscription_ids: null, + included_segments: null, + excluded_segments: null, + filters: null +) +``` + diff --git a/docs/StartLiveActivitySuccessResponse.md b/docs/StartLiveActivitySuccessResponse.md new file mode 100644 index 0000000..85f5aff --- /dev/null +++ b/docs/StartLiveActivitySuccessResponse.md @@ -0,0 +1,18 @@ +# OneSignal::StartLiveActivitySuccessResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **notification_id** | **String** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::StartLiveActivitySuccessResponse.new( + notification_id: null +) +``` + diff --git a/docs/TemplateResource.md b/docs/TemplateResource.md new file mode 100644 index 0000000..02d71d6 --- /dev/null +++ b/docs/TemplateResource.md @@ -0,0 +1,28 @@ +# OneSignal::TemplateResource + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | | [optional] | +| **name** | **String** | | [optional] | +| **created_at** | **Time** | | [optional] | +| **updated_at** | **Time** | | [optional] | +| **channel** | **String** | | [optional] | +| **content** | **Hash<String, Object>** | Rendered content and channel/platform flags for the template. | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::TemplateResource.new( + id: null, + name: null, + created_at: null, + updated_at: null, + channel: null, + content: null +) +``` + diff --git a/docs/TemplatesListResponse.md b/docs/TemplatesListResponse.md new file mode 100644 index 0000000..9b4394a --- /dev/null +++ b/docs/TemplatesListResponse.md @@ -0,0 +1,18 @@ +# OneSignal::TemplatesListResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **templates** | [**Array<TemplateResource>**](TemplateResource.md) | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::TemplatesListResponse.new( + templates: null +) +``` + diff --git a/docs/UpdateApiKeyRequest.md b/docs/UpdateApiKeyRequest.md new file mode 100644 index 0000000..d20efba --- /dev/null +++ b/docs/UpdateApiKeyRequest.md @@ -0,0 +1,22 @@ +# OneSignal::UpdateApiKeyRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | | [optional] | +| **ip_allowlist_mode** | **String** | | [optional] | +| **ip_allowlist** | **Array<String>** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::UpdateApiKeyRequest.new( + name: null, + ip_allowlist_mode: null, + ip_allowlist: null +) +``` + diff --git a/docs/UpdateTemplateRequest.md b/docs/UpdateTemplateRequest.md new file mode 100644 index 0000000..ba3331f --- /dev/null +++ b/docs/UpdateTemplateRequest.md @@ -0,0 +1,30 @@ +# OneSignal::UpdateTemplateRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Updated name of the template. | [optional] | +| **contents** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +| **is_email** | **Boolean** | Set true for an Email template. | [optional] | +| **email_subject** | **String** | Subject of the email. | [optional] | +| **email_body** | **String** | Body of the email (HTML supported). | [optional] | +| **is_sms** | **Boolean** | Set true for an SMS template. | [optional] | +| **dynamic_content** | **String** | JSON string for dynamic content personalization. | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::UpdateTemplateRequest.new( + name: null, + contents: null, + is_email: null, + email_subject: null, + email_body: null, + is_sms: null, + dynamic_content: null +) +``` + diff --git a/lib/onesignal.rb b/lib/onesignal.rb index 204ee1c..1fd4022 100644 --- a/lib/onesignal.rb +++ b/lib/onesignal.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -17,17 +17,25 @@ require 'onesignal/configuration' # Models +require 'onesignal/models/api_key_token' +require 'onesignal/models/api_key_tokens_list_response' require 'onesignal/models/app' require 'onesignal/models/basic_notification' require 'onesignal/models/basic_notification_all_of' require 'onesignal/models/basic_notification_all_of_android_background_layout' require 'onesignal/models/button' +require 'onesignal/models/copy_template_request' +require 'onesignal/models/create_api_key_request' +require 'onesignal/models/create_api_key_response' require 'onesignal/models/create_notification_success_response' require 'onesignal/models/create_segment_conflict_response' require 'onesignal/models/create_segment_success_response' +require 'onesignal/models/create_template_request' require 'onesignal/models/create_user_conflict_response' require 'onesignal/models/create_user_conflict_response_errors_inner' require 'onesignal/models/create_user_conflict_response_errors_items_meta' +require 'onesignal/models/custom_event' +require 'onesignal/models/custom_events_request' require 'onesignal/models/delivery_data' require 'onesignal/models/export_events_success_response' require 'onesignal/models/export_subscriptions_request_body' @@ -60,12 +68,18 @@ require 'onesignal/models/segment' require 'onesignal/models/segment_data' require 'onesignal/models/segment_notification_target' +require 'onesignal/models/start_live_activity_request' +require 'onesignal/models/start_live_activity_success_response' require 'onesignal/models/subscription' require 'onesignal/models/subscription_body' require 'onesignal/models/subscription_notification_target' +require 'onesignal/models/template_resource' +require 'onesignal/models/templates_list_response' require 'onesignal/models/transfer_subscription_request_body' +require 'onesignal/models/update_api_key_request' require 'onesignal/models/update_live_activity_request' require 'onesignal/models/update_live_activity_success_response' +require 'onesignal/models/update_template_request' require 'onesignal/models/update_user_request' require 'onesignal/models/user' require 'onesignal/models/user_identity_body' diff --git a/lib/onesignal/api/default_api.rb b/lib/onesignal/api/default_api.rb index 8ef9797..d093610 100644 --- a/lib/onesignal/api/default_api.rb +++ b/lib/onesignal/api/default_api.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -89,6 +89,87 @@ def cancel_notification_with_http_info(app_id, notification_id, opts = {}) return data, status_code, headers end + # Copy template to another app + # Copy a template to a destination app. + # @param template_id [String] + # @param app_id [String] + # @param copy_template_request [CopyTemplateRequest] + # @param [Hash] opts the optional parameters + # @return [TemplateResource] + def copy_template_to_app(template_id, app_id, copy_template_request, opts = {}) + data, _status_code, _headers = copy_template_to_app_with_http_info(template_id, app_id, copy_template_request, opts) + data + end + + # Copy template to another app + # Copy a template to a destination app. + # @param template_id [String] + # @param app_id [String] + # @param copy_template_request [CopyTemplateRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(TemplateResource, Integer, Hash)>] TemplateResource data, response status code and response headers + def copy_template_to_app_with_http_info(template_id, app_id, copy_template_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.copy_template_to_app ...' + end + # verify the required parameter 'template_id' is set + if @api_client.config.client_side_validation && template_id.nil? + fail ArgumentError, "Missing the required parameter 'template_id' when calling DefaultApi.copy_template_to_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.copy_template_to_app" + end + # verify the required parameter 'copy_template_request' is set + if @api_client.config.client_side_validation && copy_template_request.nil? + fail ArgumentError, "Missing the required parameter 'copy_template_request' when calling DefaultApi.copy_template_to_app" + end + # resource path + local_var_path = '/templates/{template_id}/copy_to_app'.sub('{' + 'template_id' + '}', CGI.escape(template_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']) + # 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(copy_template_request) + + # return_type + return_type = opts[:debug_return_type] || 'TemplateResource' + + # auth_names + auth_names = opts[:debug_auth_names] || ['organization_api_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.copy_template_to_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#copy_template_to_app\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] @@ -251,6 +332,80 @@ def create_alias_by_subscription_with_http_info(app_id, subscription_id, user_id return data, status_code, headers end + # Create API key + # Use this API to create a new App API Key (also called a Rich Authentication Token) for a specific OneSignal app. These keys are used to authenticate API requests at the app level and offer enhanced security features, including optional IP allowlisting. + # @param app_id [String] + # @param create_api_key_request [CreateApiKeyRequest] + # @param [Hash] opts the optional parameters + # @return [CreateApiKeyResponse] + def create_api_key(app_id, create_api_key_request, opts = {}) + data, _status_code, _headers = create_api_key_with_http_info(app_id, create_api_key_request, opts) + data + end + + # Create API key + # Use this API to create a new App API Key (also called a Rich Authentication Token) for a specific OneSignal app. These keys are used to authenticate API requests at the app level and offer enhanced security features, including optional IP allowlisting. + # @param app_id [String] + # @param create_api_key_request [CreateApiKeyRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(CreateApiKeyResponse, Integer, Hash)>] CreateApiKeyResponse data, response status code and response headers + def create_api_key_with_http_info(app_id, create_api_key_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.create_api_key ...' + 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_api_key" + end + # verify the required parameter 'create_api_key_request' is set + if @api_client.config.client_side_validation && create_api_key_request.nil? + fail ArgumentError, "Missing the required parameter 'create_api_key_request' when calling DefaultApi.create_api_key" + end + # resource path + local_var_path = '/apps/{app_id}/auth/tokens'.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(create_api_key_request) + + # return_type + return_type = opts[:debug_return_type] || 'CreateApiKeyResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['organization_api_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.create_api_key", + :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_api_key\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] @@ -319,6 +474,80 @@ def create_app_with_http_info(app, opts = {}) return data, status_code, headers end + # Create custom events + # The Custom Events API allows you to record user events. Custom events can represent any action users take in your application, such as completing a purchase, viewing content, or achieving milestones. + # @param app_id [String] Your OneSignal App ID in UUID v4 format. + # @param custom_events_request [CustomEventsRequest] + # @param [Hash] opts the optional parameters + # @return [Object] + def create_custom_events(app_id, custom_events_request, opts = {}) + data, _status_code, _headers = create_custom_events_with_http_info(app_id, custom_events_request, opts) + data + end + + # Create custom events + # The Custom Events API allows you to record user events. Custom events can represent any action users take in your application, such as completing a purchase, viewing content, or achieving milestones. + # @param app_id [String] Your OneSignal App ID in UUID v4 format. + # @param custom_events_request [CustomEventsRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers + def create_custom_events_with_http_info(app_id, custom_events_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.create_custom_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.create_custom_events" + end + # verify the required parameter 'custom_events_request' is set + if @api_client.config.client_side_validation && custom_events_request.nil? + fail ArgumentError, "Missing the required parameter 'custom_events_request' when calling DefaultApi.create_custom_events" + end + # resource path + local_var_path = '/apps/{app_id}/integrations/custom_events'.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(custom_events_request) + + # return_type + return_type = opts[:debug_return_type] || 'Object' + + # auth_names + auth_names = opts[:debug_auth_names] || ['rest_api_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.create_custom_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#create_custom_events\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] @@ -541,6 +770,74 @@ def create_subscription_with_http_info(app_id, alias_label, alias_id, subscripti return data, status_code, headers end + # Create template + # Create reusable message templates for push, email, and SMS channels. + # @param create_template_request [CreateTemplateRequest] + # @param [Hash] opts the optional parameters + # @return [TemplateResource] + def create_template(create_template_request, opts = {}) + data, _status_code, _headers = create_template_with_http_info(create_template_request, opts) + data + end + + # Create template + # Create reusable message templates for push, email, and SMS channels. + # @param create_template_request [CreateTemplateRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(TemplateResource, Integer, Hash)>] TemplateResource data, response status code and response headers + def create_template_with_http_info(create_template_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.create_template ...' + end + # verify the required parameter 'create_template_request' is set + if @api_client.config.client_side_validation && create_template_request.nil? + fail ArgumentError, "Missing the required parameter 'create_template_request' when calling DefaultApi.create_template" + end + # resource path + local_var_path = '/templates' + + # 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_template_request) + + # return_type + return_type = opts[:debug_return_type] || 'TemplateResource' + + # auth_names + auth_names = opts[:debug_auth_names] || ['rest_api_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.create_template", + :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_template\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] @@ -692,6 +989,75 @@ def delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_de return data, status_code, headers end + # Delete API key + # Delete a specific Rich Authentication Token (App API Key) for a OneSignal app. Requires your Organization API Key and the token’s unique ID, not the token value itself. + # @param app_id [String] + # @param token_id [String] + # @param [Hash] opts the optional parameters + # @return [Object] + def delete_api_key(app_id, token_id, opts = {}) + data, _status_code, _headers = delete_api_key_with_http_info(app_id, token_id, opts) + data + end + + # Delete API key + # Delete a specific Rich Authentication Token (App API Key) for a OneSignal app. Requires your Organization API Key and the token’s unique ID, not the token value itself. + # @param app_id [String] + # @param token_id [String] + # @param [Hash] opts the optional parameters + # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers + def delete_api_key_with_http_info(app_id, token_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.delete_api_key ...' + 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_api_key" + end + # verify the required parameter 'token_id' is set + if @api_client.config.client_side_validation && token_id.nil? + fail ArgumentError, "Missing the required parameter 'token_id' when calling DefaultApi.delete_api_key" + end + # resource path + local_var_path = '/apps/{app_id}/auth/tokens/{token_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'token_id' + '}', CGI.escape(token_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] || 'Object' + + # auth_names + auth_names = opts[:debug_auth_names] || ['organization_api_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.delete_api_key", + :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_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete Segment # Delete a segment (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 & IDs. @@ -828,6 +1194,76 @@ def delete_subscription_with_http_info(app_id, subscription_id, opts = {}) return data, status_code, headers end + # Delete template + # Delete a template by id. + # @param template_id [String] + # @param app_id [String] + # @param [Hash] opts the optional parameters + # @return [GenericSuccessBoolResponse] + def delete_template(template_id, app_id, opts = {}) + data, _status_code, _headers = delete_template_with_http_info(template_id, app_id, opts) + data + end + + # Delete template + # Delete a template by id. + # @param template_id [String] + # @param app_id [String] + # @param [Hash] opts the optional parameters + # @return [Array<(GenericSuccessBoolResponse, Integer, Hash)>] GenericSuccessBoolResponse data, response status code and response headers + def delete_template_with_http_info(template_id, app_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.delete_template ...' + end + # verify the required parameter 'template_id' is set + if @api_client.config.client_side_validation && template_id.nil? + fail ArgumentError, "Missing the required parameter 'template_id' when calling DefaultApi.delete_template" + 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_template" + end + # resource path + local_var_path = '/templates/{template_id}'.sub('{' + 'template_id' + '}', CGI.escape(template_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] || 'GenericSuccessBoolResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['rest_api_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.delete_template", + :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_template\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] @@ -1746,6 +2182,155 @@ def get_user_with_http_info(app_id, alias_label, alias_id, opts = {}) return data, status_code, headers end + # Rotate API key + # Rotate a Rich Authentication Token (App API Key) for a OneSignal app. Rotating a key revokes the current token and generates a new one under the same configuration—ideal when a token is lost or compromised but you don’t want to recreate and reconfigure it from scratch. + # @param app_id [String] + # @param token_id [String] + # @param [Hash] opts the optional parameters + # @return [CreateApiKeyResponse] + def rotate_api_key(app_id, token_id, opts = {}) + data, _status_code, _headers = rotate_api_key_with_http_info(app_id, token_id, opts) + data + end + + # Rotate API key + # Rotate a Rich Authentication Token (App API Key) for a OneSignal app. Rotating a key revokes the current token and generates a new one under the same configuration—ideal when a token is lost or compromised but you don’t want to recreate and reconfigure it from scratch. + # @param app_id [String] + # @param token_id [String] + # @param [Hash] opts the optional parameters + # @return [Array<(CreateApiKeyResponse, Integer, Hash)>] CreateApiKeyResponse data, response status code and response headers + def rotate_api_key_with_http_info(app_id, token_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.rotate_api_key ...' + 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.rotate_api_key" + end + # verify the required parameter 'token_id' is set + if @api_client.config.client_side_validation && token_id.nil? + fail ArgumentError, "Missing the required parameter 'token_id' when calling DefaultApi.rotate_api_key" + end + # resource path + local_var_path = '/apps/{app_id}/auth/tokens/{token_id}/rotate'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'token_id' + '}', CGI.escape(token_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] || 'CreateApiKeyResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['organization_api_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.rotate_api_key", + :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#rotate_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Start Live Activity + # Remotely start a Live Activity on iOS devices via OneSignal’s REST API. + # @param app_id [String] Your OneSignal App ID in UUID v4 format. + # @param activity_type [String] The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. + # @param start_live_activity_request [StartLiveActivityRequest] + # @param [Hash] opts the optional parameters + # @return [StartLiveActivitySuccessResponse] + def start_live_activity(app_id, activity_type, start_live_activity_request, opts = {}) + data, _status_code, _headers = start_live_activity_with_http_info(app_id, activity_type, start_live_activity_request, opts) + data + end + + # Start Live Activity + # Remotely start a Live Activity on iOS devices via OneSignal’s REST API. + # @param app_id [String] Your OneSignal App ID in UUID v4 format. + # @param activity_type [String] The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. + # @param start_live_activity_request [StartLiveActivityRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(StartLiveActivitySuccessResponse, Integer, Hash)>] StartLiveActivitySuccessResponse data, response status code and response headers + def start_live_activity_with_http_info(app_id, activity_type, start_live_activity_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.start_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.start_live_activity" + end + # verify the required parameter 'activity_type' is set + if @api_client.config.client_side_validation && activity_type.nil? + fail ArgumentError, "Missing the required parameter 'activity_type' when calling DefaultApi.start_live_activity" + end + # verify the required parameter 'start_live_activity_request' is set + if @api_client.config.client_side_validation && start_live_activity_request.nil? + fail ArgumentError, "Missing the required parameter 'start_live_activity_request' when calling DefaultApi.start_live_activity" + end + # resource path + local_var_path = '/apps/{app_id}/activities/activity/{activity_type}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'activity_type' + '}', CGI.escape(activity_type.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(start_live_activity_request) + + # return_type + return_type = opts[:debug_return_type] || 'StartLiveActivitySuccessResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['rest_api_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.start_live_activity", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#start_live_activity\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] @@ -1900,6 +2485,86 @@ def unsubscribe_email_with_token_with_http_info(app_id, notification_id, token, return data, status_code, headers end + # Update API key + # Update a Rich Authentication Token (App API Key) for a OneSignal app. + # @param app_id [String] + # @param token_id [String] + # @param update_api_key_request [UpdateApiKeyRequest] + # @param [Hash] opts the optional parameters + # @return [Object] + def update_api_key(app_id, token_id, update_api_key_request, opts = {}) + data, _status_code, _headers = update_api_key_with_http_info(app_id, token_id, update_api_key_request, opts) + data + end + + # Update API key + # Update a Rich Authentication Token (App API Key) for a OneSignal app. + # @param app_id [String] + # @param token_id [String] + # @param update_api_key_request [UpdateApiKeyRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers + def update_api_key_with_http_info(app_id, token_id, update_api_key_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.update_api_key ...' + 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_api_key" + end + # verify the required parameter 'token_id' is set + if @api_client.config.client_side_validation && token_id.nil? + fail ArgumentError, "Missing the required parameter 'token_id' when calling DefaultApi.update_api_key" + end + # verify the required parameter 'update_api_key_request' is set + if @api_client.config.client_side_validation && update_api_key_request.nil? + fail ArgumentError, "Missing the required parameter 'update_api_key_request' when calling DefaultApi.update_api_key" + end + # resource path + local_var_path = '/apps/{app_id}/auth/tokens/{token_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'token_id' + '}', CGI.escape(token_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_api_key_request) + + # return_type + return_type = opts[:debug_return_type] || 'Object' + + # auth_names + auth_names = opts[:debug_auth_names] || ['organization_api_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.update_api_key", + :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_api_key\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 @@ -2132,6 +2797,173 @@ def update_subscription_with_http_info(app_id, subscription_id, subscription_bod return data, status_code, headers end + # Update subscription by token + # Update properties on an existing OneSignal subscription using its token. + # @param app_id [String] Your OneSignal App ID in UUID v4 format. + # @param token_type [String] The type of token to use when looking up the subscription. See Subscription Types. + # @param token [String] The value of the token to lookup by (e.g., email address, phone number). + # @param subscription_body [SubscriptionBody] + # @param [Hash] opts the optional parameters + # @return [Object] + def update_subscription_by_token(app_id, token_type, token, subscription_body, opts = {}) + data, _status_code, _headers = update_subscription_by_token_with_http_info(app_id, token_type, token, subscription_body, opts) + data + end + + # Update subscription by token + # Update properties on an existing OneSignal subscription using its token. + # @param app_id [String] Your OneSignal App ID in UUID v4 format. + # @param token_type [String] The type of token to use when looking up the subscription. See Subscription Types. + # @param token [String] The value of the token to lookup by (e.g., email address, phone number). + # @param subscription_body [SubscriptionBody] + # @param [Hash] opts the optional parameters + # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers + def update_subscription_by_token_with_http_info(app_id, token_type, token, subscription_body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.update_subscription_by_token ...' + 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_by_token" + end + # verify the required parameter 'token_type' is set + if @api_client.config.client_side_validation && token_type.nil? + fail ArgumentError, "Missing the required parameter 'token_type' when calling DefaultApi.update_subscription_by_token" + end + # verify the required parameter 'token' is set + if @api_client.config.client_side_validation && token.nil? + fail ArgumentError, "Missing the required parameter 'token' when calling DefaultApi.update_subscription_by_token" + end + # verify the required parameter 'subscription_body' is set + if @api_client.config.client_side_validation && subscription_body.nil? + fail ArgumentError, "Missing the required parameter 'subscription_body' when calling DefaultApi.update_subscription_by_token" + end + # resource path + local_var_path = '/apps/{app_id}/subscriptions_by_token/{token_type}/{token}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'token_type' + '}', CGI.escape(token_type.to_s)).sub('{' + 'token' + '}', CGI.escape(token.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(subscription_body) + + # return_type + return_type = opts[:debug_return_type] || 'Object' + + # auth_names + auth_names = opts[:debug_auth_names] || ['rest_api_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.update_subscription_by_token", + :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_by_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update template + # Update an existing template. + # @param template_id [String] + # @param app_id [String] + # @param update_template_request [UpdateTemplateRequest] + # @param [Hash] opts the optional parameters + # @return [TemplateResource] + def update_template(template_id, app_id, update_template_request, opts = {}) + data, _status_code, _headers = update_template_with_http_info(template_id, app_id, update_template_request, opts) + data + end + + # Update template + # Update an existing template. + # @param template_id [String] + # @param app_id [String] + # @param update_template_request [UpdateTemplateRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(TemplateResource, Integer, Hash)>] TemplateResource data, response status code and response headers + def update_template_with_http_info(template_id, app_id, update_template_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.update_template ...' + end + # verify the required parameter 'template_id' is set + if @api_client.config.client_side_validation && template_id.nil? + fail ArgumentError, "Missing the required parameter 'template_id' when calling DefaultApi.update_template" + 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_template" + end + # verify the required parameter 'update_template_request' is set + if @api_client.config.client_side_validation && update_template_request.nil? + fail ArgumentError, "Missing the required parameter 'update_template_request' when calling DefaultApi.update_template" + end + # resource path + local_var_path = '/templates/{template_id}'.sub('{' + 'template_id' + '}', CGI.escape(template_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']) + # 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_template_request) + + # return_type + return_type = opts[:debug_return_type] || 'TemplateResource' + + # auth_names + auth_names = opts[:debug_auth_names] || ['rest_api_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.update_template", + :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_template\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] @@ -2215,5 +3047,215 @@ def update_user_with_http_info(app_id, alias_label, alias_id, update_user_reques end return data, status_code, headers end + + # View API keys + # View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app. + # @param app_id [String] + # @param [Hash] opts the optional parameters + # @return [ApiKeyTokensListResponse] + def view_api_keys(app_id, opts = {}) + data, _status_code, _headers = view_api_keys_with_http_info(app_id, opts) + data + end + + # View API keys + # View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app. + # @param app_id [String] + # @param [Hash] opts the optional parameters + # @return [Array<(ApiKeyTokensListResponse, Integer, Hash)>] ApiKeyTokensListResponse data, response status code and response headers + def view_api_keys_with_http_info(app_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.view_api_keys ...' + 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.view_api_keys" + end + # resource path + local_var_path = '/apps/{app_id}/auth/tokens'.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] || 'ApiKeyTokensListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['organization_api_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.view_api_keys", + :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#view_api_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # View template + # Fetch a single template by id. + # @param template_id [String] + # @param app_id [String] + # @param [Hash] opts the optional parameters + # @return [TemplateResource] + def view_template(template_id, app_id, opts = {}) + data, _status_code, _headers = view_template_with_http_info(template_id, app_id, opts) + data + end + + # View template + # Fetch a single template by id. + # @param template_id [String] + # @param app_id [String] + # @param [Hash] opts the optional parameters + # @return [Array<(TemplateResource, Integer, Hash)>] TemplateResource data, response status code and response headers + def view_template_with_http_info(template_id, app_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.view_template ...' + end + # verify the required parameter 'template_id' is set + if @api_client.config.client_side_validation && template_id.nil? + fail ArgumentError, "Missing the required parameter 'template_id' when calling DefaultApi.view_template" + 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.view_template" + end + # resource path + local_var_path = '/templates/{template_id}'.sub('{' + 'template_id' + '}', CGI.escape(template_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] || 'TemplateResource' + + # auth_names + auth_names = opts[:debug_auth_names] || ['rest_api_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.view_template", + :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#view_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # View templates + # List templates for an app. + # @param app_id [String] Your OneSignal App ID in UUID v4 format. + # @param [Hash] opts the optional parameters + # @option opts [Integer] :limit Maximum number of templates. Default and max is 50. (default to 50) + # @option opts [Integer] :offset Pagination offset. (default to 0) + # @option opts [String] :channel Filter by delivery channel. + # @return [TemplatesListResponse] + def view_templates(app_id, opts = {}) + data, _status_code, _headers = view_templates_with_http_info(app_id, opts) + data + end + + # View templates + # List templates for an app. + # @param app_id [String] Your OneSignal App ID in UUID v4 format. + # @param [Hash] opts the optional parameters + # @option opts [Integer] :limit Maximum number of templates. Default and max is 50. (default to 50) + # @option opts [Integer] :offset Pagination offset. (default to 0) + # @option opts [String] :channel Filter by delivery channel. + # @return [Array<(TemplatesListResponse, Integer, Hash)>] TemplatesListResponse data, response status code and response headers + def view_templates_with_http_info(app_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.view_templates ...' + 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.view_templates" + end + allowable_values = ["push", "email", "sms"] + if @api_client.config.client_side_validation && opts[:'channel'] && !allowable_values.include?(opts[:'channel']) + fail ArgumentError, "invalid value for \"channel\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/templates' + + # 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[:'channel'] = opts[:'channel'] if !opts[:'channel'].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] || 'TemplatesListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['rest_api_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.view_templates", + :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#view_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/onesignal/api_client.rb b/lib/onesignal/api_client.rb index f7ad252..01418e2 100644 --- a/lib/onesignal/api_client.rb +++ b/lib/onesignal/api_client.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -90,7 +90,7 @@ def build_request(http_method, path, opts = {}) url = build_request_url(path, opts) http_method = http_method.to_sym.downcase - opts[:header_params]['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-ruby, version=5.2.1-beta1' + opts[:header_params]['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-ruby, version=5.3.0-beta1' header_params = @default_headers.merge(opts[:header_params] || {}) query_params = opts[:query_params] || {} form_params = opts[:form_params] || {} diff --git a/lib/onesignal/api_error.rb b/lib/onesignal/api_error.rb index 1344112..28a9d4e 100644 --- a/lib/onesignal/api_error.rb +++ b/lib/onesignal/api_error.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/configuration.rb b/lib/onesignal/configuration.rb index bce8f5c..1ffb201 100644 --- a/lib/onesignal/configuration.rb +++ b/lib/onesignal/configuration.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/api_key_token.rb b/lib/onesignal/models/api_key_token.rb new file mode 100644 index 0000000..a0cac13 --- /dev/null +++ b/lib/onesignal/models/api_key_token.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 + +The version of the OpenAPI document: 5.3.0 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class ApiKeyToken + attr_accessor :token_id + + attr_accessor :updated_at + + attr_accessor :created_at + + attr_accessor :name + + attr_accessor :ip_allowlist_mode + + attr_accessor :ip_allowlist + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'token_id' => :'token_id', + :'updated_at' => :'updated_at', + :'created_at' => :'created_at', + :'name' => :'name', + :'ip_allowlist_mode' => :'ip_allowlist_mode', + :'ip_allowlist' => :'ip_allowlist' + } + 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 + { + :'token_id' => :'String', + :'updated_at' => :'String', + :'created_at' => :'String', + :'name' => :'String', + :'ip_allowlist_mode' => :'String', + :'ip_allowlist' => :'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::ApiKeyToken` 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::ApiKeyToken`. 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?(:'token_id') + self.token_id = attributes[:'token_id'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'ip_allowlist_mode') + self.ip_allowlist_mode = attributes[:'ip_allowlist_mode'] + end + + if attributes.key?(:'ip_allowlist') + if (value = attributes[:'ip_allowlist']).is_a?(Array) + self.ip_allowlist = 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? + ip_allowlist_mode_validator = EnumAttributeValidator.new('String', ["disabled", "explicit"]) + return false unless ip_allowlist_mode_validator.valid?(@ip_allowlist_mode) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] ip_allowlist_mode Object to be assigned + def ip_allowlist_mode=(ip_allowlist_mode) + validator = EnumAttributeValidator.new('String', ["disabled", "explicit"]) + unless validator.valid?(ip_allowlist_mode) + fail ArgumentError, "invalid value for \"ip_allowlist_mode\", must be one of #{validator.allowable_values}." + end + @ip_allowlist_mode = ip_allowlist_mode + 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 && + token_id == o.token_id && + updated_at == o.updated_at && + created_at == o.created_at && + name == o.name && + ip_allowlist_mode == o.ip_allowlist_mode && + ip_allowlist == o.ip_allowlist + 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 + [token_id, updated_at, created_at, name, ip_allowlist_mode, ip_allowlist].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/api_key_tokens_list_response.rb b/lib/onesignal/models/api_key_tokens_list_response.rb new file mode 100644 index 0000000..37060b4 --- /dev/null +++ b/lib/onesignal/models/api_key_tokens_list_response.rb @@ -0,0 +1,221 @@ +=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: 5.3.0 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class ApiKeyTokensListResponse + attr_accessor :tokens + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'tokens' => :'tokens' + } + 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 + { + :'tokens' => :'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::ApiKeyTokensListResponse` 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::ApiKeyTokensListResponse`. 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?(:'tokens') + if (value = attributes[:'tokens']).is_a?(Array) + self.tokens = 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 && + tokens == o.tokens + 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 + [tokens].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/app.rb b/lib/onesignal/models/app.rb index 5956f1e..535fdc6 100644 --- a/lib/onesignal/models/app.rb +++ b/lib/onesignal/models/app.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/basic_notification.rb b/lib/onesignal/models/basic_notification.rb index aee195f..b942f3b 100644 --- a/lib/onesignal/models/basic_notification.rb +++ b/lib/onesignal/models/basic_notification.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/basic_notification_all_of.rb b/lib/onesignal/models/basic_notification_all_of.rb index 992ea1a..496a61f 100644 --- a/lib/onesignal/models/basic_notification_all_of.rb +++ b/lib/onesignal/models/basic_notification_all_of.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/basic_notification_all_of_android_background_layout.rb b/lib/onesignal/models/basic_notification_all_of_android_background_layout.rb index 716056c..ec57c06 100644 --- a/lib/onesignal/models/basic_notification_all_of_android_background_layout.rb +++ b/lib/onesignal/models/basic_notification_all_of_android_background_layout.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/button.rb b/lib/onesignal/models/button.rb index 3a52734..4922ee7 100644 --- a/lib/onesignal/models/button.rb +++ b/lib/onesignal/models/button.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/copy_template_request.rb b/lib/onesignal/models/copy_template_request.rb new file mode 100644 index 0000000..9a608c1 --- /dev/null +++ b/lib/onesignal/models/copy_template_request.rb @@ -0,0 +1,225 @@ +=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: 5.3.0 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class CopyTemplateRequest + # Destination OneSignal App ID in UUID v4 format. + attr_accessor :target_app_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'target_app_id' => :'target_app_id' + } + 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 + { + :'target_app_id' => :'String' + } + 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::CopyTemplateRequest` 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::CopyTemplateRequest`. 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?(:'target_app_id') + self.target_app_id = attributes[:'target_app_id'] + 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 + if @target_app_id.nil? + invalid_properties.push('invalid value for "target_app_id", target_app_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @target_app_id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + target_app_id == o.target_app_id + 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 + [target_app_id].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/create_api_key_request.rb b/lib/onesignal/models/create_api_key_request.rb new file mode 100644 index 0000000..5f9348b --- /dev/null +++ b/lib/onesignal/models/create_api_key_request.rb @@ -0,0 +1,273 @@ +=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: 5.3.0 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class CreateApiKeyRequest + attr_accessor :name + + attr_accessor :ip_allowlist_mode + + attr_accessor :ip_allowlist + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'ip_allowlist_mode' => :'ip_allowlist_mode', + :'ip_allowlist' => :'ip_allowlist' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'ip_allowlist_mode' => :'String', + :'ip_allowlist' => :'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::CreateApiKeyRequest` 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::CreateApiKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'ip_allowlist_mode') + self.ip_allowlist_mode = attributes[:'ip_allowlist_mode'] + end + + if attributes.key?(:'ip_allowlist') + if (value = attributes[:'ip_allowlist']).is_a?(Array) + self.ip_allowlist = 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? + ip_allowlist_mode_validator = EnumAttributeValidator.new('String', ["disabled", "explicit"]) + return false unless ip_allowlist_mode_validator.valid?(@ip_allowlist_mode) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] ip_allowlist_mode Object to be assigned + def ip_allowlist_mode=(ip_allowlist_mode) + validator = EnumAttributeValidator.new('String', ["disabled", "explicit"]) + unless validator.valid?(ip_allowlist_mode) + fail ArgumentError, "invalid value for \"ip_allowlist_mode\", must be one of #{validator.allowable_values}." + end + @ip_allowlist_mode = ip_allowlist_mode + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + ip_allowlist_mode == o.ip_allowlist_mode && + ip_allowlist == o.ip_allowlist + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, ip_allowlist_mode, ip_allowlist].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/create_api_key_response.rb b/lib/onesignal/models/create_api_key_response.rb new file mode 100644 index 0000000..f02100f --- /dev/null +++ b/lib/onesignal/models/create_api_key_response.rb @@ -0,0 +1,228 @@ +=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: 5.3.0 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class CreateApiKeyResponse + attr_accessor :token_id + + attr_accessor :formatted_token + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'token_id' => :'token_id', + :'formatted_token' => :'formatted_token' + } + 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 + { + :'token_id' => :'String', + :'formatted_token' => :'String' + } + 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::CreateApiKeyResponse` 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::CreateApiKeyResponse`. 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?(:'token_id') + self.token_id = attributes[:'token_id'] + end + + if attributes.key?(:'formatted_token') + self.formatted_token = attributes[:'formatted_token'] + 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 && + token_id == o.token_id && + formatted_token == o.formatted_token + 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 + [token_id, formatted_token].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/create_notification_success_response.rb b/lib/onesignal/models/create_notification_success_response.rb index bb2848f..f8788e1 100644 --- a/lib/onesignal/models/create_notification_success_response.rb +++ b/lib/onesignal/models/create_notification_success_response.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/create_segment_conflict_response.rb b/lib/onesignal/models/create_segment_conflict_response.rb index d257426..ce2a77b 100644 --- a/lib/onesignal/models/create_segment_conflict_response.rb +++ b/lib/onesignal/models/create_segment_conflict_response.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/create_segment_success_response.rb b/lib/onesignal/models/create_segment_success_response.rb index bd38140..80d8cc5 100644 --- a/lib/onesignal/models/create_segment_success_response.rb +++ b/lib/onesignal/models/create_segment_success_response.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/create_template_request.rb b/lib/onesignal/models/create_template_request.rb new file mode 100644 index 0000000..e6d41aa --- /dev/null +++ b/lib/onesignal/models/create_template_request.rb @@ -0,0 +1,307 @@ +=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: 5.3.0 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class CreateTemplateRequest + # Your OneSignal App ID in UUID v4 format. + attr_accessor :app_id + + # Name of the template. + attr_accessor :name + + attr_accessor :contents + + # Set true for an Email template. + attr_accessor :is_email + + # Subject of the email. + attr_accessor :email_subject + + # Body of the email (HTML supported). + attr_accessor :email_body + + # Set true for an SMS template. + attr_accessor :is_sms + + # JSON string for dynamic content personalization. + attr_accessor :dynamic_content + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'app_id' => :'app_id', + :'name' => :'name', + :'contents' => :'contents', + :'is_email' => :'isEmail', + :'email_subject' => :'email_subject', + :'email_body' => :'email_body', + :'is_sms' => :'isSMS', + :'dynamic_content' => :'dynamic_content' + } + 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 + { + :'app_id' => :'String', + :'name' => :'String', + :'contents' => :'LanguageStringMap', + :'is_email' => :'Boolean', + :'email_subject' => :'String', + :'email_body' => :'String', + :'is_sms' => :'Boolean', + :'dynamic_content' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'email_subject', + :'email_body', + :'dynamic_content' + ]) + 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::CreateTemplateRequest` 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::CreateTemplateRequest`. 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?(:'app_id') + self.app_id = attributes[:'app_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'contents') + self.contents = attributes[:'contents'] + end + + if attributes.key?(:'is_email') + self.is_email = attributes[:'is_email'] + end + + if attributes.key?(:'email_subject') + self.email_subject = attributes[:'email_subject'] + end + + if attributes.key?(:'email_body') + self.email_body = attributes[:'email_body'] + end + + if attributes.key?(:'is_sms') + self.is_sms = attributes[:'is_sms'] + end + + if attributes.key?(:'dynamic_content') + self.dynamic_content = attributes[:'dynamic_content'] + 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 + if @app_id.nil? + invalid_properties.push('invalid value for "app_id", app_id cannot be nil.') + end + + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @contents.nil? + invalid_properties.push('invalid value for "contents", contents cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @app_id.nil? + return false if @name.nil? + return false if @contents.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + app_id == o.app_id && + name == o.name && + contents == o.contents && + is_email == o.is_email && + email_subject == o.email_subject && + email_body == o.email_body && + is_sms == o.is_sms && + dynamic_content == o.dynamic_content + 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 + [app_id, name, contents, is_email, email_subject, email_body, is_sms, dynamic_content].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/create_user_conflict_response.rb b/lib/onesignal/models/create_user_conflict_response.rb index 45fc2da..95eb91a 100644 --- a/lib/onesignal/models/create_user_conflict_response.rb +++ b/lib/onesignal/models/create_user_conflict_response.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/create_user_conflict_response_errors_inner.rb b/lib/onesignal/models/create_user_conflict_response_errors_inner.rb index 2ec6f5a..9d02315 100644 --- a/lib/onesignal/models/create_user_conflict_response_errors_inner.rb +++ b/lib/onesignal/models/create_user_conflict_response_errors_inner.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/create_user_conflict_response_errors_items_meta.rb b/lib/onesignal/models/create_user_conflict_response_errors_items_meta.rb index fcc8d62..71d5d16 100644 --- a/lib/onesignal/models/create_user_conflict_response_errors_items_meta.rb +++ b/lib/onesignal/models/create_user_conflict_response_errors_items_meta.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/custom_event.rb b/lib/onesignal/models/custom_event.rb new file mode 100644 index 0000000..f82e8f8 --- /dev/null +++ b/lib/onesignal/models/custom_event.rb @@ -0,0 +1,269 @@ +=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: 5.3.0 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class CustomEvent + # The identifier or name of the event. Maximum 128 characters. + attr_accessor :name + + # The external ID of the user targeted for the event. Either the user's External ID or OneSignal ID is required. + attr_accessor :external_id + + # The OneSignal ID of the user targeted for the event. Either the user's External ID or OneSignal ID is required. + attr_accessor :onesignal_id + + # Time the event occurred as an ISO8601 formatted string. Defaults to now if not included or past date provided. + attr_accessor :timestamp + + # Properties or data related to the event, like {\"geography\": \"USA\"} + attr_accessor :payload + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'external_id' => :'external_id', + :'onesignal_id' => :'onesignal_id', + :'timestamp' => :'timestamp', + :'payload' => :'payload' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'external_id' => :'String', + :'onesignal_id' => :'String', + :'timestamp' => :'Time', + :'payload' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'external_id', + :'onesignal_id', + ]) + 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::CustomEvent` 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::CustomEvent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'external_id') + self.external_id = attributes[:'external_id'] + end + + if attributes.key?(:'onesignal_id') + self.onesignal_id = attributes[:'onesignal_id'] + end + + if attributes.key?(:'timestamp') + self.timestamp = attributes[:'timestamp'] + end + + if attributes.key?(:'payload') + if (value = attributes[:'payload']).is_a?(Hash) + self.payload = 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 + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + external_id == o.external_id && + onesignal_id == o.onesignal_id && + timestamp == o.timestamp && + payload == o.payload + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, external_id, onesignal_id, timestamp, payload].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/custom_events_request.rb b/lib/onesignal/models/custom_events_request.rb new file mode 100644 index 0000000..c397016 --- /dev/null +++ b/lib/onesignal/models/custom_events_request.rb @@ -0,0 +1,226 @@ +=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: 5.3.0 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class CustomEventsRequest + 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::CustomEventsRequest` 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::CustomEventsRequest`. 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 + if @events.nil? + invalid_properties.push('invalid value for "events", events cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @events.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + 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/lib/onesignal/models/delivery_data.rb b/lib/onesignal/models/delivery_data.rb index ef93b8a..83e33ab 100644 --- a/lib/onesignal/models/delivery_data.rb +++ b/lib/onesignal/models/delivery_data.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/export_events_success_response.rb b/lib/onesignal/models/export_events_success_response.rb index 5c186b8..7d0c48d 100644 --- a/lib/onesignal/models/export_events_success_response.rb +++ b/lib/onesignal/models/export_events_success_response.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/export_subscriptions_request_body.rb b/lib/onesignal/models/export_subscriptions_request_body.rb index 99a4f09..6fa8d22 100644 --- a/lib/onesignal/models/export_subscriptions_request_body.rb +++ b/lib/onesignal/models/export_subscriptions_request_body.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/export_subscriptions_success_response.rb b/lib/onesignal/models/export_subscriptions_success_response.rb index 9438a4c..d8d70af 100644 --- a/lib/onesignal/models/export_subscriptions_success_response.rb +++ b/lib/onesignal/models/export_subscriptions_success_response.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/filter.rb b/lib/onesignal/models/filter.rb index 9382a90..efd5118 100644 --- a/lib/onesignal/models/filter.rb +++ b/lib/onesignal/models/filter.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/filter_expression.rb b/lib/onesignal/models/filter_expression.rb index 4a1c276..bc074ed 100644 --- a/lib/onesignal/models/filter_expression.rb +++ b/lib/onesignal/models/filter_expression.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/generic_error.rb b/lib/onesignal/models/generic_error.rb index e9e3881..cb84d7b 100644 --- a/lib/onesignal/models/generic_error.rb +++ b/lib/onesignal/models/generic_error.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/generic_success_bool_response.rb b/lib/onesignal/models/generic_success_bool_response.rb index cba3dd8..94275a8 100644 --- a/lib/onesignal/models/generic_success_bool_response.rb +++ b/lib/onesignal/models/generic_success_bool_response.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/get_notification_history_request_body.rb b/lib/onesignal/models/get_notification_history_request_body.rb index 0f05f4a..50fa91f 100644 --- a/lib/onesignal/models/get_notification_history_request_body.rb +++ b/lib/onesignal/models/get_notification_history_request_body.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/get_segments_success_response.rb b/lib/onesignal/models/get_segments_success_response.rb index af68cf0..ca5b588 100644 --- a/lib/onesignal/models/get_segments_success_response.rb +++ b/lib/onesignal/models/get_segments_success_response.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/language_string_map.rb b/lib/onesignal/models/language_string_map.rb index f1336fc..cfdbc89 100644 --- a/lib/onesignal/models/language_string_map.rb +++ b/lib/onesignal/models/language_string_map.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/notification.rb b/lib/onesignal/models/notification.rb index 46f0a95..085c844 100644 --- a/lib/onesignal/models/notification.rb +++ b/lib/onesignal/models/notification.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/notification_all_of.rb b/lib/onesignal/models/notification_all_of.rb index 5cbfee6..e8ea095 100644 --- a/lib/onesignal/models/notification_all_of.rb +++ b/lib/onesignal/models/notification_all_of.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/notification_history_success_response.rb b/lib/onesignal/models/notification_history_success_response.rb index 0b57545..604348e 100644 --- a/lib/onesignal/models/notification_history_success_response.rb +++ b/lib/onesignal/models/notification_history_success_response.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/notification_slice.rb b/lib/onesignal/models/notification_slice.rb index a3e5603..385a398 100644 --- a/lib/onesignal/models/notification_slice.rb +++ b/lib/onesignal/models/notification_slice.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/notification_target.rb b/lib/onesignal/models/notification_target.rb index feaf3d9..8b92c86 100644 --- a/lib/onesignal/models/notification_target.rb +++ b/lib/onesignal/models/notification_target.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/notification_with_meta.rb b/lib/onesignal/models/notification_with_meta.rb index 235dab0..ffc8182 100644 --- a/lib/onesignal/models/notification_with_meta.rb +++ b/lib/onesignal/models/notification_with_meta.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/notification_with_meta_all_of.rb b/lib/onesignal/models/notification_with_meta_all_of.rb index 9a3679d..4c6ab56 100644 --- a/lib/onesignal/models/notification_with_meta_all_of.rb +++ b/lib/onesignal/models/notification_with_meta_all_of.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/operator.rb b/lib/onesignal/models/operator.rb index c73d31f..6490191 100644 --- a/lib/onesignal/models/operator.rb +++ b/lib/onesignal/models/operator.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/outcome_data.rb b/lib/onesignal/models/outcome_data.rb index 18f112a..ffca74f 100644 --- a/lib/onesignal/models/outcome_data.rb +++ b/lib/onesignal/models/outcome_data.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/outcomes_data.rb b/lib/onesignal/models/outcomes_data.rb index 80ac1c8..fbf46f5 100644 --- a/lib/onesignal/models/outcomes_data.rb +++ b/lib/onesignal/models/outcomes_data.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/platform_delivery_data.rb b/lib/onesignal/models/platform_delivery_data.rb index d824f52..af7ece0 100644 --- a/lib/onesignal/models/platform_delivery_data.rb +++ b/lib/onesignal/models/platform_delivery_data.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/platform_delivery_data_email_all_of.rb b/lib/onesignal/models/platform_delivery_data_email_all_of.rb index 2816213..ec35599 100644 --- a/lib/onesignal/models/platform_delivery_data_email_all_of.rb +++ b/lib/onesignal/models/platform_delivery_data_email_all_of.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/platform_delivery_data_sms_all_of.rb b/lib/onesignal/models/platform_delivery_data_sms_all_of.rb index 4c0b203..86324c7 100644 --- a/lib/onesignal/models/platform_delivery_data_sms_all_of.rb +++ b/lib/onesignal/models/platform_delivery_data_sms_all_of.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/properties_body.rb b/lib/onesignal/models/properties_body.rb index 55ac427..ea3e3ae 100644 --- a/lib/onesignal/models/properties_body.rb +++ b/lib/onesignal/models/properties_body.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/properties_deltas.rb b/lib/onesignal/models/properties_deltas.rb index 8066671..16619b7 100644 --- a/lib/onesignal/models/properties_deltas.rb +++ b/lib/onesignal/models/properties_deltas.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/properties_object.rb b/lib/onesignal/models/properties_object.rb index 1674f45..124c7d9 100644 --- a/lib/onesignal/models/properties_object.rb +++ b/lib/onesignal/models/properties_object.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/purchase.rb b/lib/onesignal/models/purchase.rb index 5fa8b04..055b748 100644 --- a/lib/onesignal/models/purchase.rb +++ b/lib/onesignal/models/purchase.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/rate_limit_error.rb b/lib/onesignal/models/rate_limit_error.rb index 8a1b3e9..1375bc5 100644 --- a/lib/onesignal/models/rate_limit_error.rb +++ b/lib/onesignal/models/rate_limit_error.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/segment.rb b/lib/onesignal/models/segment.rb index 7c0bee5..11662e8 100644 --- a/lib/onesignal/models/segment.rb +++ b/lib/onesignal/models/segment.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/segment_data.rb b/lib/onesignal/models/segment_data.rb index 389dcec..d1f695a 100644 --- a/lib/onesignal/models/segment_data.rb +++ b/lib/onesignal/models/segment_data.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/segment_notification_target.rb b/lib/onesignal/models/segment_notification_target.rb index 3598f06..9488781 100644 --- a/lib/onesignal/models/segment_notification_target.rb +++ b/lib/onesignal/models/segment_notification_target.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/start_live_activity_request.rb b/lib/onesignal/models/start_live_activity_request.rb new file mode 100644 index 0000000..59b7286 --- /dev/null +++ b/lib/onesignal/models/start_live_activity_request.rb @@ -0,0 +1,454 @@ +=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: 5.3.0 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class StartLiveActivityRequest + # An internal name to assist with your campaign organization. This does not get displayed in the message itself. + attr_accessor :name + + attr_accessor :event + + # Set a unique activity_id to track and manage the Live Activity. + attr_accessor :activity_id + + # Default/static data to initialize the Live Activity upon start. + attr_accessor :event_attributes + + # Dynamic content used to update the running Live Activity at start. Must match the ContentState interface defined in your app. + attr_accessor :event_updates + + attr_accessor :contents + + attr_accessor :headings + + # Accepts Unix timestamp in seconds. When time reaches the configured stale date, the system considers the Live Activity out of date, and the ActivityState of the Live Activity changes to ActivityState.stale. + attr_accessor :stale_date + + # Delivery priority through the push provider (APNs). Pass 10 for higher priority notifications, or 5 for lower priority notifications. Lower priority notifications are sent based on the power considerations of the end user's device. If not set, defaults to 10. + attr_accessor :priority + + # iOS 15+. A score to indicate how a notification should be displayed when grouped. Use a float between 0-1. + attr_accessor :ios_relevance_score + + # Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true + attr_accessor :idempotency_key + + # Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. + attr_accessor :include_aliases + + # Specific subscription ids to target. Not compatible with other targeting parameters. + attr_accessor :include_subscription_ids + + # Segment names to include. Only compatible with excluded_segments. + attr_accessor :included_segments + + # Segment names to exclude. Only compatible with included_segments. + attr_accessor :excluded_segments + + attr_accessor :filters + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'event' => :'event', + :'activity_id' => :'activity_id', + :'event_attributes' => :'event_attributes', + :'event_updates' => :'event_updates', + :'contents' => :'contents', + :'headings' => :'headings', + :'stale_date' => :'stale_date', + :'priority' => :'priority', + :'ios_relevance_score' => :'ios_relevance_score', + :'idempotency_key' => :'idempotency_key', + :'include_aliases' => :'include_aliases', + :'include_subscription_ids' => :'include_subscription_ids', + :'included_segments' => :'included_segments', + :'excluded_segments' => :'excluded_segments', + :'filters' => :'filters' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'event' => :'String', + :'activity_id' => :'String', + :'event_attributes' => :'Object', + :'event_updates' => :'Object', + :'contents' => :'LanguageStringMap', + :'headings' => :'LanguageStringMap', + :'stale_date' => :'Integer', + :'priority' => :'Integer', + :'ios_relevance_score' => :'Float', + :'idempotency_key' => :'String', + :'include_aliases' => :'Hash>', + :'include_subscription_ids' => :'Array', + :'included_segments' => :'Array', + :'excluded_segments' => :'Array', + :'filters' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'ios_relevance_score', + :'idempotency_key', + :'include_aliases', + :'include_subscription_ids', + :'included_segments', + :'excluded_segments', + :'filters' + ]) + 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::StartLiveActivityRequest` 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::StartLiveActivityRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'event') + self.event = attributes[:'event'] + else + self.event = 'start' + end + + if attributes.key?(:'activity_id') + self.activity_id = attributes[:'activity_id'] + end + + if attributes.key?(:'event_attributes') + self.event_attributes = attributes[:'event_attributes'] + end + + if attributes.key?(:'event_updates') + self.event_updates = attributes[:'event_updates'] + end + + if attributes.key?(:'contents') + self.contents = attributes[:'contents'] + end + + if attributes.key?(:'headings') + self.headings = attributes[:'headings'] + end + + if attributes.key?(:'stale_date') + self.stale_date = attributes[:'stale_date'] + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + + if attributes.key?(:'ios_relevance_score') + self.ios_relevance_score = attributes[:'ios_relevance_score'] + end + + if attributes.key?(:'idempotency_key') + self.idempotency_key = attributes[:'idempotency_key'] + end + + if attributes.key?(:'include_aliases') + if (value = attributes[:'include_aliases']).is_a?(Hash) + self.include_aliases = value + end + end + + if attributes.key?(:'include_subscription_ids') + if (value = attributes[:'include_subscription_ids']).is_a?(Array) + self.include_subscription_ids = value + end + end + + if attributes.key?(:'included_segments') + if (value = attributes[:'included_segments']).is_a?(Array) + self.included_segments = value + end + end + + if attributes.key?(:'excluded_segments') + if (value = attributes[:'excluded_segments']).is_a?(Array) + self.excluded_segments = value + end + end + + if attributes.key?(:'filters') + if (value = attributes[:'filters']).is_a?(Array) + self.filters = 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 + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @event.nil? + invalid_properties.push('invalid value for "event", event cannot be nil.') + end + + if @activity_id.nil? + invalid_properties.push('invalid value for "activity_id", activity_id cannot be nil.') + end + + if @event_attributes.nil? + invalid_properties.push('invalid value for "event_attributes", event_attributes cannot be nil.') + end + + if @event_updates.nil? + invalid_properties.push('invalid value for "event_updates", event_updates cannot be nil.') + end + + if @contents.nil? + invalid_properties.push('invalid value for "contents", contents cannot be nil.') + end + + if @headings.nil? + invalid_properties.push('invalid value for "headings", headings cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + return false if @event.nil? + event_validator = EnumAttributeValidator.new('String', ["start"]) + return false unless event_validator.valid?(@event) + return false if @activity_id.nil? + return false if @event_attributes.nil? + return false if @event_updates.nil? + return false if @contents.nil? + return false if @headings.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] event Object to be assigned + def event=(event) + validator = EnumAttributeValidator.new('String', ["start"]) + unless validator.valid?(event) + fail ArgumentError, "invalid value for \"event\", must be one of #{validator.allowable_values}." + end + @event = event + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + event == o.event && + activity_id == o.activity_id && + event_attributes == o.event_attributes && + event_updates == o.event_updates && + contents == o.contents && + headings == o.headings && + stale_date == o.stale_date && + priority == o.priority && + ios_relevance_score == o.ios_relevance_score && + idempotency_key == o.idempotency_key && + include_aliases == o.include_aliases && + include_subscription_ids == o.include_subscription_ids && + included_segments == o.included_segments && + excluded_segments == o.excluded_segments && + filters == o.filters + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, event, activity_id, event_attributes, event_updates, contents, headings, stale_date, priority, ios_relevance_score, idempotency_key, include_aliases, include_subscription_ids, included_segments, excluded_segments, filters].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/start_live_activity_success_response.rb b/lib/onesignal/models/start_live_activity_success_response.rb new file mode 100644 index 0000000..bf7fbb6 --- /dev/null +++ b/lib/onesignal/models/start_live_activity_success_response.rb @@ -0,0 +1,219 @@ +=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: 5.3.0 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class StartLiveActivitySuccessResponse + attr_accessor :notification_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'notification_id' => :'notification_id' + } + 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 + { + :'notification_id' => :'String' + } + 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::StartLiveActivitySuccessResponse` 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::StartLiveActivitySuccessResponse`. 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?(:'notification_id') + self.notification_id = attributes[:'notification_id'] + 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 && + notification_id == o.notification_id + 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 + [notification_id].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/subscription.rb b/lib/onesignal/models/subscription.rb index edc9cf0..9b232d9 100644 --- a/lib/onesignal/models/subscription.rb +++ b/lib/onesignal/models/subscription.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/subscription_body.rb b/lib/onesignal/models/subscription_body.rb index 8846c8f..7d0f605 100644 --- a/lib/onesignal/models/subscription_body.rb +++ b/lib/onesignal/models/subscription_body.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/subscription_notification_target.rb b/lib/onesignal/models/subscription_notification_target.rb index 08a1d5d..999b55d 100644 --- a/lib/onesignal/models/subscription_notification_target.rb +++ b/lib/onesignal/models/subscription_notification_target.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/template_resource.rb b/lib/onesignal/models/template_resource.rb new file mode 100644 index 0000000..aeae361 --- /dev/null +++ b/lib/onesignal/models/template_resource.rb @@ -0,0 +1,302 @@ +=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: 5.3.0 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class TemplateResource + attr_accessor :id + + attr_accessor :name + + attr_accessor :created_at + + attr_accessor :updated_at + + attr_accessor :channel + + # Rendered content and channel/platform flags for the template. + attr_accessor :content + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name', + :'created_at' => :'created_at', + :'updated_at' => :'updated_at', + :'channel' => :'channel', + :'content' => :'content' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String', + :'created_at' => :'Time', + :'updated_at' => :'Time', + :'channel' => :'String', + :'content' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'channel', + ]) + 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::TemplateResource` 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::TemplateResource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'channel') + self.channel = attributes[:'channel'] + end + + if attributes.key?(:'content') + if (value = attributes[:'content']).is_a?(Hash) + self.content = 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? + channel_validator = EnumAttributeValidator.new('String', ["push", "email", "sms"]) + return false unless channel_validator.valid?(@channel) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] channel Object to be assigned + def channel=(channel) + validator = EnumAttributeValidator.new('String', ["push", "email", "sms"]) + unless validator.valid?(channel) + fail ArgumentError, "invalid value for \"channel\", must be one of #{validator.allowable_values}." + end + @channel = channel + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name && + created_at == o.created_at && + updated_at == o.updated_at && + channel == o.channel && + content == o.content + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, name, created_at, updated_at, channel, content].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/templates_list_response.rb b/lib/onesignal/models/templates_list_response.rb new file mode 100644 index 0000000..f7fc26b --- /dev/null +++ b/lib/onesignal/models/templates_list_response.rb @@ -0,0 +1,221 @@ +=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: 5.3.0 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class TemplatesListResponse + attr_accessor :templates + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'templates' => :'templates' + } + 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 + { + :'templates' => :'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::TemplatesListResponse` 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::TemplatesListResponse`. 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?(:'templates') + if (value = attributes[:'templates']).is_a?(Array) + self.templates = 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 && + templates == o.templates + 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 + [templates].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/transfer_subscription_request_body.rb b/lib/onesignal/models/transfer_subscription_request_body.rb index 7ebda2c..f7d80d9 100644 --- a/lib/onesignal/models/transfer_subscription_request_body.rb +++ b/lib/onesignal/models/transfer_subscription_request_body.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/update_api_key_request.rb b/lib/onesignal/models/update_api_key_request.rb new file mode 100644 index 0000000..8993d8a --- /dev/null +++ b/lib/onesignal/models/update_api_key_request.rb @@ -0,0 +1,273 @@ +=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: 5.3.0 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class UpdateApiKeyRequest + attr_accessor :name + + attr_accessor :ip_allowlist_mode + + attr_accessor :ip_allowlist + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'ip_allowlist_mode' => :'ip_allowlist_mode', + :'ip_allowlist' => :'ip_allowlist' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'ip_allowlist_mode' => :'String', + :'ip_allowlist' => :'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::UpdateApiKeyRequest` 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::UpdateApiKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'ip_allowlist_mode') + self.ip_allowlist_mode = attributes[:'ip_allowlist_mode'] + end + + if attributes.key?(:'ip_allowlist') + if (value = attributes[:'ip_allowlist']).is_a?(Array) + self.ip_allowlist = 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? + ip_allowlist_mode_validator = EnumAttributeValidator.new('String', ["disabled", "explicit"]) + return false unless ip_allowlist_mode_validator.valid?(@ip_allowlist_mode) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] ip_allowlist_mode Object to be assigned + def ip_allowlist_mode=(ip_allowlist_mode) + validator = EnumAttributeValidator.new('String', ["disabled", "explicit"]) + unless validator.valid?(ip_allowlist_mode) + fail ArgumentError, "invalid value for \"ip_allowlist_mode\", must be one of #{validator.allowable_values}." + end + @ip_allowlist_mode = ip_allowlist_mode + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + ip_allowlist_mode == o.ip_allowlist_mode && + ip_allowlist == o.ip_allowlist + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, ip_allowlist_mode, ip_allowlist].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/update_live_activity_request.rb b/lib/onesignal/models/update_live_activity_request.rb index 78aa748..97160d2 100644 --- a/lib/onesignal/models/update_live_activity_request.rb +++ b/lib/onesignal/models/update_live_activity_request.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/update_live_activity_success_response.rb b/lib/onesignal/models/update_live_activity_success_response.rb index 5440a07..331913e 100644 --- a/lib/onesignal/models/update_live_activity_success_response.rb +++ b/lib/onesignal/models/update_live_activity_success_response.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/update_template_request.rb b/lib/onesignal/models/update_template_request.rb new file mode 100644 index 0000000..9301d43 --- /dev/null +++ b/lib/onesignal/models/update_template_request.rb @@ -0,0 +1,282 @@ +=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: 5.3.0 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class UpdateTemplateRequest + # Updated name of the template. + attr_accessor :name + + attr_accessor :contents + + # Set true for an Email template. + attr_accessor :is_email + + # Subject of the email. + attr_accessor :email_subject + + # Body of the email (HTML supported). + attr_accessor :email_body + + # Set true for an SMS template. + attr_accessor :is_sms + + # JSON string for dynamic content personalization. + attr_accessor :dynamic_content + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'contents' => :'contents', + :'is_email' => :'isEmail', + :'email_subject' => :'email_subject', + :'email_body' => :'email_body', + :'is_sms' => :'isSMS', + :'dynamic_content' => :'dynamic_content' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'contents' => :'LanguageStringMap', + :'is_email' => :'Boolean', + :'email_subject' => :'String', + :'email_body' => :'String', + :'is_sms' => :'Boolean', + :'dynamic_content' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'email_subject', + :'email_body', + :'dynamic_content' + ]) + 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::UpdateTemplateRequest` 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::UpdateTemplateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'contents') + self.contents = attributes[:'contents'] + end + + if attributes.key?(:'is_email') + self.is_email = attributes[:'is_email'] + end + + if attributes.key?(:'email_subject') + self.email_subject = attributes[:'email_subject'] + end + + if attributes.key?(:'email_body') + self.email_body = attributes[:'email_body'] + end + + if attributes.key?(:'is_sms') + self.is_sms = attributes[:'is_sms'] + end + + if attributes.key?(:'dynamic_content') + self.dynamic_content = attributes[:'dynamic_content'] + 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 && + name == o.name && + contents == o.contents && + is_email == o.is_email && + email_subject == o.email_subject && + email_body == o.email_body && + is_sms == o.is_sms && + dynamic_content == o.dynamic_content + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, contents, is_email, email_subject, email_body, is_sms, dynamic_content].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/update_user_request.rb b/lib/onesignal/models/update_user_request.rb index d53e70f..522ff80 100644 --- a/lib/onesignal/models/update_user_request.rb +++ b/lib/onesignal/models/update_user_request.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/user.rb b/lib/onesignal/models/user.rb index a96c2ee..b3130f2 100644 --- a/lib/onesignal/models/user.rb +++ b/lib/onesignal/models/user.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/user_identity_body.rb b/lib/onesignal/models/user_identity_body.rb index 6e31aa9..3a01437 100644 --- a/lib/onesignal/models/user_identity_body.rb +++ b/lib/onesignal/models/user_identity_body.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/web_button.rb b/lib/onesignal/models/web_button.rb index 82a1a31..d724fa5 100644 --- a/lib/onesignal/models/web_button.rb +++ b/lib/onesignal/models/web_button.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/version.rb b/lib/onesignal/version.rb index f210c5e..e1dd97e 100644 --- a/lib/onesignal/version.rb +++ b/lib/onesignal/version.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -11,5 +11,5 @@ =end module OneSignal - VERSION = '5.2.1-beta1' + VERSION = '5.3.0-beta1' end diff --git a/onesignal.gemspec b/onesignal.gemspec index c7c2289..0686bfa 100644 --- a/onesignal.gemspec +++ b/onesignal.gemspec @@ -5,7 +5,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/api/default_api_spec.rb b/spec/api/default_api_spec.rb index 2b22f42..6c4f7f5 100644 --- a/spec/api/default_api_spec.rb +++ b/spec/api/default_api_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -45,6 +45,20 @@ end end + # unit tests for copy_template_to_app + # Copy template to another app + # Copy a template to a destination app. + # @param template_id + # @param app_id + # @param copy_template_request + # @param [Hash] opts the optional parameters + # @return [TemplateResource] + describe 'copy_template_to_app 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 create_alias # Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). # @param app_id @@ -72,6 +86,19 @@ end end + # unit tests for create_api_key + # Create API key + # Use this API to create a new App API Key (also called a Rich Authentication Token) for a specific OneSignal app. These keys are used to authenticate API requests at the app level and offer enhanced security features, including optional IP allowlisting. + # @param app_id + # @param create_api_key_request + # @param [Hash] opts the optional parameters + # @return [CreateApiKeyResponse] + describe 'create_api_key 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 create_app # Create an app # Creates a new OneSignal app @@ -84,6 +111,19 @@ end end + # unit tests for create_custom_events + # Create custom events + # The Custom Events API allows you to record user events. Custom events can represent any action users take in your application, such as completing a purchase, viewing content, or achieving milestones. + # @param app_id Your OneSignal App ID in UUID v4 format. + # @param custom_events_request + # @param [Hash] opts the optional parameters + # @return [Object] + describe 'create_custom_events 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 create_notification # Create notification # Sends notifications to your users @@ -123,6 +163,18 @@ end end + # unit tests for create_template + # Create template + # Create reusable message templates for push, email, and SMS channels. + # @param create_template_request + # @param [Hash] opts the optional parameters + # @return [TemplateResource] + describe 'create_template 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 create_user # 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 @@ -149,6 +201,19 @@ end end + # unit tests for delete_api_key + # Delete API key + # Delete a specific Rich Authentication Token (App API Key) for a OneSignal app. Requires your Organization API Key and the token’s unique ID, not the token value itself. + # @param app_id + # @param token_id + # @param [Hash] opts the optional parameters + # @return [Object] + describe 'delete_api_key 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 delete_segment # Delete Segment # Delete a segment (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. @@ -174,6 +239,19 @@ end end + # unit tests for delete_template + # Delete template + # Delete a template by id. + # @param template_id + # @param app_id + # @param [Hash] opts the optional parameters + # @return [GenericSuccessBoolResponse] + describe 'delete_template 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 delete_user # Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases # @param app_id @@ -346,6 +424,33 @@ end end + # unit tests for rotate_api_key + # Rotate API key + # Rotate a Rich Authentication Token (App API Key) for a OneSignal app. Rotating a key revokes the current token and generates a new one under the same configuration—ideal when a token is lost or compromised but you don’t want to recreate and reconfigure it from scratch. + # @param app_id + # @param token_id + # @param [Hash] opts the optional parameters + # @return [CreateApiKeyResponse] + describe 'rotate_api_key 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 start_live_activity + # Start Live Activity + # Remotely start a Live Activity on iOS devices via OneSignal’s REST API. + # @param app_id Your OneSignal App ID in UUID v4 format. + # @param activity_type The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. + # @param start_live_activity_request + # @param [Hash] opts the optional parameters + # @return [StartLiveActivitySuccessResponse] + describe 'start_live_activity 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 transfer_subscription # Transfers this Subscription to the User identified by the identity in the payload. # @param app_id @@ -373,6 +478,20 @@ end end + # unit tests for update_api_key + # Update API key + # Update a Rich Authentication Token (App API Key) for a OneSignal app. + # @param app_id + # @param token_id + # @param update_api_key_request + # @param [Hash] opts the optional parameters + # @return [Object] + describe 'update_api_key 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 update_app # Update an app # Updates the name or configuration settings of an existing OneSignal app @@ -413,6 +532,35 @@ end end + # unit tests for update_subscription_by_token + # Update subscription by token + # Update properties on an existing OneSignal subscription using its token. + # @param app_id Your OneSignal App ID in UUID v4 format. + # @param token_type The type of token to use when looking up the subscription. See Subscription Types. + # @param token The value of the token to lookup by (e.g., email address, phone number). + # @param subscription_body + # @param [Hash] opts the optional parameters + # @return [Object] + describe 'update_subscription_by_token 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 update_template + # Update template + # Update an existing template. + # @param template_id + # @param app_id + # @param update_template_request + # @param [Hash] opts the optional parameters + # @return [TemplateResource] + describe 'update_template 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 update_user # Updates an existing User’s properties. # @param app_id @@ -427,4 +575,44 @@ end end + # unit tests for view_api_keys + # View API keys + # View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app. + # @param app_id + # @param [Hash] opts the optional parameters + # @return [ApiKeyTokensListResponse] + describe 'view_api_keys 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 view_template + # View template + # Fetch a single template by id. + # @param template_id + # @param app_id + # @param [Hash] opts the optional parameters + # @return [TemplateResource] + describe 'view_template 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 view_templates + # View templates + # List templates for an app. + # @param app_id Your OneSignal App ID in UUID v4 format. + # @param [Hash] opts the optional parameters + # @option opts [Integer] :limit Maximum number of templates. Default and max is 50. + # @option opts [Integer] :offset Pagination offset. + # @option opts [String] :channel Filter by delivery channel. + # @return [TemplatesListResponse] + describe 'view_templates test' 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/api_client_spec.rb b/spec/api_client_spec.rb index bcd711c..d350ef1 100644 --- a/spec/api_client_spec.rb +++ b/spec/api_client_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/configuration_spec.rb b/spec/configuration_spec.rb index aaff9bc..762a1e8 100644 --- a/spec/configuration_spec.rb +++ b/spec/configuration_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/api_key_token_spec.rb b/spec/models/api_key_token_spec.rb new file mode 100644 index 0000000..5fafca5 --- /dev/null +++ b/spec/models/api_key_token_spec.rb @@ -0,0 +1,68 @@ +=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: 5.3.0 +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::ApiKeyToken +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::ApiKeyToken do + let(:instance) { OneSignal::ApiKeyToken.new } + + describe 'test an instance of ApiKeyToken' do + it 'should create an instance of ApiKeyToken' do + expect(instance).to be_instance_of(OneSignal::ApiKeyToken) + end + end + describe 'test attribute "token_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_at"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "created_at"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "ip_allowlist_mode"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["disabled", "explicit"]) + # validator.allowable_values.each do |value| + # expect { instance.ip_allowlist_mode = value }.not_to raise_error + # end + end + end + + describe 'test attribute "ip_allowlist"' 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/api_key_tokens_list_response_spec.rb b/spec/models/api_key_tokens_list_response_spec.rb new file mode 100644 index 0000000..b8492f1 --- /dev/null +++ b/spec/models/api_key_tokens_list_response_spec.rb @@ -0,0 +1,34 @@ +=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: 5.3.0 +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::ApiKeyTokensListResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::ApiKeyTokensListResponse do + let(:instance) { OneSignal::ApiKeyTokensListResponse.new } + + describe 'test an instance of ApiKeyTokensListResponse' do + it 'should create an instance of ApiKeyTokensListResponse' do + expect(instance).to be_instance_of(OneSignal::ApiKeyTokensListResponse) + end + end + describe 'test attribute "tokens"' 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/app_spec.rb b/spec/models/app_spec.rb index f2042d4..2f705ce 100644 --- a/spec/models/app_spec.rb +++ b/spec/models/app_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/basic_notification_all_of_android_background_layout_spec.rb b/spec/models/basic_notification_all_of_android_background_layout_spec.rb index 7d5d46b..593e113 100644 --- a/spec/models/basic_notification_all_of_android_background_layout_spec.rb +++ b/spec/models/basic_notification_all_of_android_background_layout_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/basic_notification_all_of_spec.rb b/spec/models/basic_notification_all_of_spec.rb index 708f5d3..2f0f21b 100644 --- a/spec/models/basic_notification_all_of_spec.rb +++ b/spec/models/basic_notification_all_of_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/basic_notification_spec.rb b/spec/models/basic_notification_spec.rb index cb2861c..9909591 100644 --- a/spec/models/basic_notification_spec.rb +++ b/spec/models/basic_notification_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/button_spec.rb b/spec/models/button_spec.rb index 618982c..3dcbf93 100644 --- a/spec/models/button_spec.rb +++ b/spec/models/button_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/copy_template_request_spec.rb b/spec/models/copy_template_request_spec.rb new file mode 100644 index 0000000..ee15e25 --- /dev/null +++ b/spec/models/copy_template_request_spec.rb @@ -0,0 +1,34 @@ +=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: 5.3.0 +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::CopyTemplateRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::CopyTemplateRequest do + let(:instance) { OneSignal::CopyTemplateRequest.new } + + describe 'test an instance of CopyTemplateRequest' do + it 'should create an instance of CopyTemplateRequest' do + expect(instance).to be_instance_of(OneSignal::CopyTemplateRequest) + end + end + describe 'test attribute "target_app_id"' 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/create_api_key_request_spec.rb b/spec/models/create_api_key_request_spec.rb new file mode 100644 index 0000000..c1b20e5 --- /dev/null +++ b/spec/models/create_api_key_request_spec.rb @@ -0,0 +1,50 @@ +=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: 5.3.0 +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::CreateApiKeyRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::CreateApiKeyRequest do + let(:instance) { OneSignal::CreateApiKeyRequest.new } + + describe 'test an instance of CreateApiKeyRequest' do + it 'should create an instance of CreateApiKeyRequest' do + expect(instance).to be_instance_of(OneSignal::CreateApiKeyRequest) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "ip_allowlist_mode"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["disabled", "explicit"]) + # validator.allowable_values.each do |value| + # expect { instance.ip_allowlist_mode = value }.not_to raise_error + # end + end + end + + describe 'test attribute "ip_allowlist"' 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/create_api_key_response_spec.rb b/spec/models/create_api_key_response_spec.rb new file mode 100644 index 0000000..57e778f --- /dev/null +++ b/spec/models/create_api_key_response_spec.rb @@ -0,0 +1,40 @@ +=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: 5.3.0 +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::CreateApiKeyResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::CreateApiKeyResponse do + let(:instance) { OneSignal::CreateApiKeyResponse.new } + + describe 'test an instance of CreateApiKeyResponse' do + it 'should create an instance of CreateApiKeyResponse' do + expect(instance).to be_instance_of(OneSignal::CreateApiKeyResponse) + end + end + describe 'test attribute "token_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "formatted_token"' 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/create_notification_success_response_spec.rb b/spec/models/create_notification_success_response_spec.rb index 799557c..4838e9a 100644 --- a/spec/models/create_notification_success_response_spec.rb +++ b/spec/models/create_notification_success_response_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/create_segment_conflict_response_spec.rb b/spec/models/create_segment_conflict_response_spec.rb index 7919370..1b8dcfc 100644 --- a/spec/models/create_segment_conflict_response_spec.rb +++ b/spec/models/create_segment_conflict_response_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/create_segment_success_response_spec.rb b/spec/models/create_segment_success_response_spec.rb index 537a8a6..5c72b51 100644 --- a/spec/models/create_segment_success_response_spec.rb +++ b/spec/models/create_segment_success_response_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/create_template_request_spec.rb b/spec/models/create_template_request_spec.rb new file mode 100644 index 0000000..1a1b192 --- /dev/null +++ b/spec/models/create_template_request_spec.rb @@ -0,0 +1,76 @@ +=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: 5.3.0 +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::CreateTemplateRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::CreateTemplateRequest do + let(:instance) { OneSignal::CreateTemplateRequest.new } + + describe 'test an instance of CreateTemplateRequest' do + it 'should create an instance of CreateTemplateRequest' do + expect(instance).to be_instance_of(OneSignal::CreateTemplateRequest) + end + end + describe 'test attribute "app_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "contents"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_email"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "email_subject"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "email_body"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_sms"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "dynamic_content"' 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/create_user_conflict_response_errors_inner_spec.rb b/spec/models/create_user_conflict_response_errors_inner_spec.rb index 9104700..bbcb27c 100644 --- a/spec/models/create_user_conflict_response_errors_inner_spec.rb +++ b/spec/models/create_user_conflict_response_errors_inner_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/create_user_conflict_response_errors_items_meta_spec.rb b/spec/models/create_user_conflict_response_errors_items_meta_spec.rb index a7d4157..15acebc 100644 --- a/spec/models/create_user_conflict_response_errors_items_meta_spec.rb +++ b/spec/models/create_user_conflict_response_errors_items_meta_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/create_user_conflict_response_spec.rb b/spec/models/create_user_conflict_response_spec.rb index aa27d73..d037a6f 100644 --- a/spec/models/create_user_conflict_response_spec.rb +++ b/spec/models/create_user_conflict_response_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/custom_event_spec.rb b/spec/models/custom_event_spec.rb new file mode 100644 index 0000000..cc7d0c8 --- /dev/null +++ b/spec/models/custom_event_spec.rb @@ -0,0 +1,58 @@ +=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: 5.3.0 +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::CustomEvent +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::CustomEvent do + let(:instance) { OneSignal::CustomEvent.new } + + describe 'test an instance of CustomEvent' do + it 'should create an instance of CustomEvent' do + expect(instance).to be_instance_of(OneSignal::CustomEvent) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "external_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "onesignal_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "timestamp"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "payload"' 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/custom_events_request_spec.rb b/spec/models/custom_events_request_spec.rb new file mode 100644 index 0000000..5798e0c --- /dev/null +++ b/spec/models/custom_events_request_spec.rb @@ -0,0 +1,34 @@ +=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: 5.3.0 +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::CustomEventsRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::CustomEventsRequest do + let(:instance) { OneSignal::CustomEventsRequest.new } + + describe 'test an instance of CustomEventsRequest' do + it 'should create an instance of CustomEventsRequest' do + expect(instance).to be_instance_of(OneSignal::CustomEventsRequest) + 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 diff --git a/spec/models/delivery_data_spec.rb b/spec/models/delivery_data_spec.rb index 6f98665..3555e10 100644 --- a/spec/models/delivery_data_spec.rb +++ b/spec/models/delivery_data_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/export_events_success_response_spec.rb b/spec/models/export_events_success_response_spec.rb index 4c3b260..1181c25 100644 --- a/spec/models/export_events_success_response_spec.rb +++ b/spec/models/export_events_success_response_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/export_subscriptions_request_body_spec.rb b/spec/models/export_subscriptions_request_body_spec.rb index 655d057..008dcf2 100644 --- a/spec/models/export_subscriptions_request_body_spec.rb +++ b/spec/models/export_subscriptions_request_body_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/export_subscriptions_success_response_spec.rb b/spec/models/export_subscriptions_success_response_spec.rb index 9bd8abc..47a7985 100644 --- a/spec/models/export_subscriptions_success_response_spec.rb +++ b/spec/models/export_subscriptions_success_response_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/filter_expression_spec.rb b/spec/models/filter_expression_spec.rb index 40d5d88..77a724d 100644 --- a/spec/models/filter_expression_spec.rb +++ b/spec/models/filter_expression_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/filter_spec.rb b/spec/models/filter_spec.rb index 03a4273..559903e 100644 --- a/spec/models/filter_spec.rb +++ b/spec/models/filter_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/generic_error_spec.rb b/spec/models/generic_error_spec.rb index e94e85a..7f4d811 100644 --- a/spec/models/generic_error_spec.rb +++ b/spec/models/generic_error_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/generic_success_bool_response_spec.rb b/spec/models/generic_success_bool_response_spec.rb index daaeab1..9def342 100644 --- a/spec/models/generic_success_bool_response_spec.rb +++ b/spec/models/generic_success_bool_response_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/get_notification_history_request_body_spec.rb b/spec/models/get_notification_history_request_body_spec.rb index 76a1554..401729f 100644 --- a/spec/models/get_notification_history_request_body_spec.rb +++ b/spec/models/get_notification_history_request_body_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/get_segments_success_response_spec.rb b/spec/models/get_segments_success_response_spec.rb index e55f150..675cc6f 100644 --- a/spec/models/get_segments_success_response_spec.rb +++ b/spec/models/get_segments_success_response_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/language_string_map_spec.rb b/spec/models/language_string_map_spec.rb index 7c180a3..6e59b54 100644 --- a/spec/models/language_string_map_spec.rb +++ b/spec/models/language_string_map_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/notification_all_of_spec.rb b/spec/models/notification_all_of_spec.rb index 611935b..3df06f1 100644 --- a/spec/models/notification_all_of_spec.rb +++ b/spec/models/notification_all_of_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/notification_history_success_response_spec.rb b/spec/models/notification_history_success_response_spec.rb index 101ea99..d9260b6 100644 --- a/spec/models/notification_history_success_response_spec.rb +++ b/spec/models/notification_history_success_response_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/notification_slice_spec.rb b/spec/models/notification_slice_spec.rb index 22142dd..1aef5f1 100644 --- a/spec/models/notification_slice_spec.rb +++ b/spec/models/notification_slice_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/notification_spec.rb b/spec/models/notification_spec.rb index 38cbb06..b4d7617 100644 --- a/spec/models/notification_spec.rb +++ b/spec/models/notification_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/notification_target_spec.rb b/spec/models/notification_target_spec.rb index b61e9c9..d11f0a1 100644 --- a/spec/models/notification_target_spec.rb +++ b/spec/models/notification_target_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/notification_with_meta_all_of_spec.rb b/spec/models/notification_with_meta_all_of_spec.rb index 7e7358b..0dc6b45 100644 --- a/spec/models/notification_with_meta_all_of_spec.rb +++ b/spec/models/notification_with_meta_all_of_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/notification_with_meta_spec.rb b/spec/models/notification_with_meta_spec.rb index 76b374b..86cddd7 100644 --- a/spec/models/notification_with_meta_spec.rb +++ b/spec/models/notification_with_meta_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/operator_spec.rb b/spec/models/operator_spec.rb index d546ed8..847bb6d 100644 --- a/spec/models/operator_spec.rb +++ b/spec/models/operator_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/outcome_data_spec.rb b/spec/models/outcome_data_spec.rb index a7e723e..2a26b41 100644 --- a/spec/models/outcome_data_spec.rb +++ b/spec/models/outcome_data_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/outcomes_data_spec.rb b/spec/models/outcomes_data_spec.rb index 6f68264..5ef12ec 100644 --- a/spec/models/outcomes_data_spec.rb +++ b/spec/models/outcomes_data_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/platform_delivery_data_email_all_of_spec.rb b/spec/models/platform_delivery_data_email_all_of_spec.rb index 05a1c32..e084d02 100644 --- a/spec/models/platform_delivery_data_email_all_of_spec.rb +++ b/spec/models/platform_delivery_data_email_all_of_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/platform_delivery_data_sms_all_of_spec.rb b/spec/models/platform_delivery_data_sms_all_of_spec.rb index 08638b9..a1c9fcf 100644 --- a/spec/models/platform_delivery_data_sms_all_of_spec.rb +++ b/spec/models/platform_delivery_data_sms_all_of_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/platform_delivery_data_spec.rb b/spec/models/platform_delivery_data_spec.rb index cc414ff..27433bd 100644 --- a/spec/models/platform_delivery_data_spec.rb +++ b/spec/models/platform_delivery_data_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/properties_body_spec.rb b/spec/models/properties_body_spec.rb index 508cde6..a121235 100644 --- a/spec/models/properties_body_spec.rb +++ b/spec/models/properties_body_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/properties_deltas_spec.rb b/spec/models/properties_deltas_spec.rb index 36b819c..7550cd1 100644 --- a/spec/models/properties_deltas_spec.rb +++ b/spec/models/properties_deltas_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/properties_object_spec.rb b/spec/models/properties_object_spec.rb index 2fbc40c..1b2fb59 100644 --- a/spec/models/properties_object_spec.rb +++ b/spec/models/properties_object_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/purchase_spec.rb b/spec/models/purchase_spec.rb index a41b36c..da47e59 100644 --- a/spec/models/purchase_spec.rb +++ b/spec/models/purchase_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/rate_limit_error_spec.rb b/spec/models/rate_limit_error_spec.rb index b82cbbf..6d963a3 100644 --- a/spec/models/rate_limit_error_spec.rb +++ b/spec/models/rate_limit_error_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/segment_data_spec.rb b/spec/models/segment_data_spec.rb index 5528811..234cfd0 100644 --- a/spec/models/segment_data_spec.rb +++ b/spec/models/segment_data_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/segment_notification_target_spec.rb b/spec/models/segment_notification_target_spec.rb index a9c7084..a31e608 100644 --- a/spec/models/segment_notification_target_spec.rb +++ b/spec/models/segment_notification_target_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/segment_spec.rb b/spec/models/segment_spec.rb index d9618f3..6292ea9 100644 --- a/spec/models/segment_spec.rb +++ b/spec/models/segment_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/start_live_activity_request_spec.rb b/spec/models/start_live_activity_request_spec.rb new file mode 100644 index 0000000..c2b9260 --- /dev/null +++ b/spec/models/start_live_activity_request_spec.rb @@ -0,0 +1,128 @@ +=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: 5.3.0 +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::StartLiveActivityRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::StartLiveActivityRequest do + let(:instance) { OneSignal::StartLiveActivityRequest.new } + + describe 'test an instance of StartLiveActivityRequest' do + it 'should create an instance of StartLiveActivityRequest' do + expect(instance).to be_instance_of(OneSignal::StartLiveActivityRequest) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["start"]) + # validator.allowable_values.each do |value| + # expect { instance.event = value }.not_to raise_error + # end + end + end + + describe 'test attribute "activity_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_attributes"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_updates"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "contents"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "headings"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "stale_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 "priority"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "ios_relevance_score"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "idempotency_key"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "include_aliases"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "include_subscription_ids"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "included_segments"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "excluded_segments"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "filters"' 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/start_live_activity_success_response_spec.rb b/spec/models/start_live_activity_success_response_spec.rb new file mode 100644 index 0000000..130917c --- /dev/null +++ b/spec/models/start_live_activity_success_response_spec.rb @@ -0,0 +1,34 @@ +=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: 5.3.0 +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::StartLiveActivitySuccessResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::StartLiveActivitySuccessResponse do + let(:instance) { OneSignal::StartLiveActivitySuccessResponse.new } + + describe 'test an instance of StartLiveActivitySuccessResponse' do + it 'should create an instance of StartLiveActivitySuccessResponse' do + expect(instance).to be_instance_of(OneSignal::StartLiveActivitySuccessResponse) + end + end + describe 'test attribute "notification_id"' 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/subscription_body_spec.rb b/spec/models/subscription_body_spec.rb index 1287046..2df9914 100644 --- a/spec/models/subscription_body_spec.rb +++ b/spec/models/subscription_body_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/subscription_notification_target_spec.rb b/spec/models/subscription_notification_target_spec.rb index 546dc99..b9cdc65 100644 --- a/spec/models/subscription_notification_target_spec.rb +++ b/spec/models/subscription_notification_target_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/subscription_spec.rb b/spec/models/subscription_spec.rb index ee119c8..fcf6da1 100644 --- a/spec/models/subscription_spec.rb +++ b/spec/models/subscription_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/template_resource_spec.rb b/spec/models/template_resource_spec.rb new file mode 100644 index 0000000..7c0fc61 --- /dev/null +++ b/spec/models/template_resource_spec.rb @@ -0,0 +1,68 @@ +=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: 5.3.0 +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::TemplateResource +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::TemplateResource do + let(:instance) { OneSignal::TemplateResource.new } + + describe 'test an instance of TemplateResource' do + it 'should create an instance of TemplateResource' do + expect(instance).to be_instance_of(OneSignal::TemplateResource) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "created_at"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_at"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "channel"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["push", "email", "sms"]) + # validator.allowable_values.each do |value| + # expect { instance.channel = value }.not_to raise_error + # end + end + end + + describe 'test attribute "content"' 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/templates_list_response_spec.rb b/spec/models/templates_list_response_spec.rb new file mode 100644 index 0000000..b76f666 --- /dev/null +++ b/spec/models/templates_list_response_spec.rb @@ -0,0 +1,34 @@ +=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: 5.3.0 +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::TemplatesListResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::TemplatesListResponse do + let(:instance) { OneSignal::TemplatesListResponse.new } + + describe 'test an instance of TemplatesListResponse' do + it 'should create an instance of TemplatesListResponse' do + expect(instance).to be_instance_of(OneSignal::TemplatesListResponse) + end + end + describe 'test attribute "templates"' 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/transfer_subscription_request_body_spec.rb b/spec/models/transfer_subscription_request_body_spec.rb index 702b8e6..c28deb8 100644 --- a/spec/models/transfer_subscription_request_body_spec.rb +++ b/spec/models/transfer_subscription_request_body_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/update_api_key_request_spec.rb b/spec/models/update_api_key_request_spec.rb new file mode 100644 index 0000000..a4d8fc3 --- /dev/null +++ b/spec/models/update_api_key_request_spec.rb @@ -0,0 +1,50 @@ +=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: 5.3.0 +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::UpdateApiKeyRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::UpdateApiKeyRequest do + let(:instance) { OneSignal::UpdateApiKeyRequest.new } + + describe 'test an instance of UpdateApiKeyRequest' do + it 'should create an instance of UpdateApiKeyRequest' do + expect(instance).to be_instance_of(OneSignal::UpdateApiKeyRequest) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "ip_allowlist_mode"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["disabled", "explicit"]) + # validator.allowable_values.each do |value| + # expect { instance.ip_allowlist_mode = value }.not_to raise_error + # end + end + end + + describe 'test attribute "ip_allowlist"' 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/update_live_activity_request_spec.rb b/spec/models/update_live_activity_request_spec.rb index 03a0d54..ad464ff 100644 --- a/spec/models/update_live_activity_request_spec.rb +++ b/spec/models/update_live_activity_request_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/update_live_activity_success_response_spec.rb b/spec/models/update_live_activity_success_response_spec.rb index f69b06c..efdd47e 100644 --- a/spec/models/update_live_activity_success_response_spec.rb +++ b/spec/models/update_live_activity_success_response_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/update_template_request_spec.rb b/spec/models/update_template_request_spec.rb new file mode 100644 index 0000000..a86ed5f --- /dev/null +++ b/spec/models/update_template_request_spec.rb @@ -0,0 +1,70 @@ +=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: 5.3.0 +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::UpdateTemplateRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::UpdateTemplateRequest do + let(:instance) { OneSignal::UpdateTemplateRequest.new } + + describe 'test an instance of UpdateTemplateRequest' do + it 'should create an instance of UpdateTemplateRequest' do + expect(instance).to be_instance_of(OneSignal::UpdateTemplateRequest) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "contents"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_email"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "email_subject"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "email_body"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_sms"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "dynamic_content"' 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/update_user_request_spec.rb b/spec/models/update_user_request_spec.rb index 812ef5b..508244f 100644 --- a/spec/models/update_user_request_spec.rb +++ b/spec/models/update_user_request_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/user_identity_body_spec.rb b/spec/models/user_identity_body_spec.rb index b4ca399..697973f 100644 --- a/spec/models/user_identity_body_spec.rb +++ b/spec/models/user_identity_body_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 9d37626..d7afab4 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/web_button_spec.rb b/spec/models/web_button_spec.rb index a577b2e..498e072 100644 --- a/spec/models/web_button_spec.rb +++ b/spec/models/web_button_spec.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a8f0eef..424c226 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,7 +3,7 @@ #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: 5.2.1 +The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT