diff --git a/README.md b/README.md index bf108c4..0e89d1b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ > **Building with an AI agent or LLM?** See [AGENTS.md](https://github.com/OneSignal/onesignal-java-api/blob/main/AGENTS.md) for an agent-oriented integration guide — authentication, calling conventions, idempotent retries, and the full API reference. OneSignal -- API version: 5.11.2 +- API version: 5.12.0 A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com @@ -21,14 +21,14 @@ Building the API client library requires: com.onesignal onesignal-java-client - 5.11.2 + 5.12.0 ``` ### Gradle ```groovy -implementation "com.onesignal:onesignal-java-client:5.11.2" +implementation "com.onesignal:onesignal-java-client:5.12.0" ``` ## Configuration diff --git a/api/openapi.yaml b/api/openapi.yaml index 66dc8ea..b4b0c1e 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -8,7 +8,7 @@ info: customer engagement strategies. Learn more at onesignal.com termsOfService: https://onesignal.com/tos title: OneSignal - version: 5.11.2 + version: 5.12.0 servers: - url: https://api.onesignal.com paths: @@ -2854,43 +2854,25 @@ paths: summary: Create custom events x-content-type: application/json x-accepts: application/json - /organizations/{organization_id}/audit_logs: + /apps/{app_id}/journeys: get: - description: "Retrieve a paginated, time-scoped list of audit log events for\ - \ an organization. Requires an Enterprise plan with the audit logs entitlement\ - \ enabled." - operationId: list_audit_logs + description: The Journeys API is in beta. Endpoints and response fields can + still change. Retrieve a paginated list of journeys for an app. Returns a + summary representation of each journey; use View journey for the full configuration. + Uses forward-only cursor-based pagination. + operationId: view_journeys parameters: - - description: The UUID of the organization to retrieve audit logs for. Must - match the authenticated Organization API Key. + - description: Your OneSignal App ID in UUID v4 format. explode: false in: path - name: organization_id + name: app_id required: true schema: - example: YOUR_ORG_ID + example: YOUR_APP_ID type: string style: simple - - description: Start of the time range in ISO 8601 format (e.g. 2026-02-01T00:00:00Z). - Required unless cursor is provided. Must be within the last 90 days. - explode: true - in: query - name: start_time - required: false - schema: - type: string - style: form - - description: End of the time range in ISO 8601 format. Defaults to the current - time. Must be after start_time. - explode: true - in: query - name: end_time - required: false - schema: - type: string - style: form - - description: "Pagination cursor returned in a previous response as next_cursor.\ - \ When provided, start_time and end_time are ignored." + - description: Opaque pagination token from a previous response's next_cursor. + Omit for the first page. explode: true in: query name: cursor @@ -2898,117 +2880,151 @@ paths: schema: type: string style: form - - description: "Maximum number of events to return per page. Minimum 1, maximum\ - \ 100. Values outside this range are clamped automatically by the server." + - description: "Maximum journeys to return per page. Minimum 1, maximum 50." explode: true in: query name: limit required: false schema: + default: 50 + example: 50 + maximum: 50 + minimum: 1 type: integer style: form - - description: Filter events by app UUID. Accepts up to 10 values. Org-level - events are always included. - explode: true - in: query - name: app_ids - required: false - schema: - items: - type: string - maxItems: 10 - type: array - style: form - - description: "Filter by action type (e.g. notification.sent, segment.created).\ - \ Accepts up to 20 values." - explode: true - in: query - name: actions - required: false - schema: - items: - type: string - maxItems: 20 - type: array - style: form - - description: Filter by actor UUID (the user or service that performed the - action). Accepts up to 10 values. - explode: true - in: query - name: actor_ids - required: false - schema: - items: - type: string - maxItems: 10 - type: array - style: form - - description: Filter by actor email address. Accepts up to 10 values. - explode: true - in: query - name: actor_emails - required: false - schema: - items: - type: string - maxItems: 10 - type: array - style: form - - description: "Filter by the type of resource the action was performed on (e.g.\ - \ notification, segment, journey). Accepts up to 10 values." - explode: true - in: query - name: target_types - required: false - schema: - items: - type: string - maxItems: 10 - type: array - style: form - - description: Filter by the UUID of the resource the action was performed on. - Accepts up to 10 values. - explode: true - in: query - name: target_ids - required: false - schema: - items: - type: string - maxItems: 10 - type: array - style: form - - description: Filter by the IP address the action originated from. Accepts - up to 10 values. - explode: true - in: query - name: ip_addresses - required: false + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/JourneyListResponse' + description: OK + default: + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Unexpected error + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Forbidden + "429": + content: + application/json: + schema: + $ref: '#/components/schemas/RateLimitError' + description: Rate Limit Exceeded + security: + - rest_api_key: [] + summary: View journeys + x-accepts: application/json + post: + description: The Journeys API is in beta. Endpoints and response fields can + still change. Create a new journey with an audience and a node graph. Journeys + are always created in the draft state. The authenticated App API key must + have permission to create journeys. + operationId: create_journey + parameters: + - description: Your OneSignal App ID in UUID v4 format. + explode: false + in: path + name: app_id + required: true schema: - items: - type: string - maxItems: 10 - type: array - style: form + example: YOUR_APP_ID + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateJourneyRequest' + required: true responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/Journey' + description: Created default: content: application/json: schema: $ref: '#/components/schemas/GenericError' description: Unexpected error + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Forbidden + "429": + content: + application/json: + schema: + $ref: '#/components/schemas/RateLimitError' + description: Rate Limit Exceeded + security: + - rest_api_key: [] + summary: Create journey + x-content-type: application/json + x-accepts: application/json + /apps/{app_id}/journeys/{journey_id}: + delete: + description: "The Journeys API is in beta. Endpoints and response fields can\ + \ still change. Permanently delete a journey by its UUID. Returns { \"success\"\ + : true } on success. The authenticated App API key must have permission to\ + \ delete journeys. Deleting a journey stops any in-flight users and cannot\ + \ be undone. Archive a running journey instead if you need to keep its data." + operationId: delete_journey + parameters: + - description: Your OneSignal App ID in UUID v4 format. + explode: false + in: path + name: app_id + required: true + schema: + example: YOUR_APP_ID + type: string + style: simple + - description: UUID of the journey to delete. + explode: false + in: path + name: journey_id + required: true + schema: + example: YOUR_JOURNEY_ID + type: string + style: simple + responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ListAuditLogsSuccessResponse' + $ref: '#/components/schemas/GenericSuccessBoolResponse' description: OK - "400": + default: content: application/json: schema: $ref: '#/components/schemas/GenericError' - description: Bad Request + description: Unexpected error "403": content: application/json: @@ -3028,46 +3044,516 @@ paths: $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - organization_api_key: [] - summary: List audit logs + - rest_api_key: [] + summary: Delete journey x-accepts: application/json -components: - requestBodies: - get_notification_history_request_body: - content: - application/json: - schema: - $ref: '#/components/schemas/get_notification_history_request_body' - required: true - export_subscriptions_request_body: - content: - application/json: - schema: - $ref: '#/components/schemas/export_subscriptions_request_body' - schemas: - App: - example: - apns_key_id: apns_key_id - apns_team_id: apns_team_id - apns_p12: apns_p12 - safari_site_origin: safari_site_origin - apns_p12_password: apns_p12_password - created_at: 2000-01-23T04:56:07.000+00:00 - safari_icon_64_64: safari_icon_64_64 - chrome_web_sub_domain: chrome_web_sub_domain - gcm_key: gcm_key - apns_bundle_id: apns_bundle_id - chrome_key: chrome_key - safari_push_id: safari_push_id - updated_at: 2000-01-23T04:56:07.000+00:00 - apns_certificates: apns_certificates - safari_apns_p12: safari_apns_p12 - safari_icon_128_128: safari_icon_128_128 - id: id - android_gcm_sender_id: android_gcm_sender_id - safari_icon_32_32: safari_icon_32_32 - additional_data_is_root_payload: true - apns_env: sandbox + get: + description: "The Journeys API is in beta. Endpoints and response fields can\ + \ still change. Retrieve the full configuration of a single journey by its\ + \ UUID, including its audience and node graph." + operationId: view_journey + parameters: + - description: Your OneSignal App ID in UUID v4 format. + explode: false + in: path + name: app_id + required: true + schema: + example: YOUR_APP_ID + type: string + style: simple + - description: UUID of the journey to retrieve. + explode: false + in: path + name: journey_id + required: true + schema: + example: YOUR_JOURNEY_ID + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Journey' + description: OK + default: + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Unexpected error + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found + "429": + content: + application/json: + schema: + $ref: '#/components/schemas/RateLimitError' + description: Rate Limit Exceeded + security: + - rest_api_key: [] + summary: View journey + x-accepts: application/json + patch: + description: "The Journeys API is in beta. Endpoints and response fields can\ + \ still change. Apply a partial update to a journey using JSON Merge Patch\ + \ (RFC 7396). Send only the fields you want to change; omitted fields are\ + \ left unchanged. A null value clears a nullable field, and arrays such as\ + \ nodes are replaced wholesale. Set state to active to activate a draft journey." + operationId: update_journey + parameters: + - description: Your OneSignal App ID in UUID v4 format. + explode: false + in: path + name: app_id + required: true + schema: + example: YOUR_APP_ID + type: string + style: simple + - description: UUID of the journey to update. + explode: false + in: path + name: journey_id + required: true + schema: + example: YOUR_JOURNEY_ID + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateJourneyRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Journey' + description: OK + default: + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Unexpected error + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Conflict + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Unprocessable Entity + "429": + content: + application/json: + schema: + $ref: '#/components/schemas/RateLimitError' + description: Rate Limit Exceeded + security: + - rest_api_key: [] + summary: Update journey + x-content-type: application/json + x-accepts: application/json + /apps/{app_id}/journeys/{journey_id}/stats: + get: + description: "The Journeys API is in beta. Endpoints and response fields can\ + \ still change. Retrieve performance stats for a single journey: journey-level\ + \ entry and exit counts, per-node counts keyed by node id, per-branch counts\ + \ keyed by branch id, and channel delivery stats for message-sending nodes.\ + \ The response carries no definition detail, so join it by id against the\ + \ journey from View journey." + operationId: view_journey_stats + parameters: + - description: Your OneSignal App ID in UUID v4 format. + explode: false + in: path + name: app_id + required: true + schema: + example: YOUR_APP_ID + type: string + style: simple + - description: UUID of the journey to retrieve stats for. + explode: false + in: path + name: journey_id + required: true + schema: + example: YOUR_JOURNEY_ID + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/JourneyStats' + description: OK + default: + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Unexpected error + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found + "429": + content: + application/json: + schema: + $ref: '#/components/schemas/RateLimitError' + description: Rate Limit Exceeded + security: + - rest_api_key: [] + summary: View journey stats + x-accepts: application/json + /apps/{app_id}/journeys/{journey_id}/nodes/{node_id}: + patch: + description: "The Journeys API is in beta. Endpoints and response fields can\ + \ still change. Apply a partial update to a single node, located by its server-assigned\ + \ id, using JSON Merge Patch (RFC 7396). Send only the node fields you want\ + \ to change; the rest of the node and the rest of the journey graph are left\ + \ untouched. Returns the full updated journey." + operationId: update_journey_node + parameters: + - description: Your OneSignal App ID in UUID v4 format. + explode: false + in: path + name: app_id + required: true + schema: + example: YOUR_APP_ID + type: string + style: simple + - description: UUID of the journey that owns the node. + explode: false + in: path + name: journey_id + required: true + schema: + example: YOUR_JOURNEY_ID + type: string + style: simple + - description: "Server-assigned UUID of the node to update, from a prior View\ + \ journey fetch." + explode: false + in: path + name: node_id + required: true + schema: + example: YOUR_NODE_ID + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateJourneyNodeRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Journey' + description: OK + default: + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Unexpected error + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Conflict + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Unprocessable Entity + "429": + content: + application/json: + schema: + $ref: '#/components/schemas/RateLimitError' + description: Rate Limit Exceeded + security: + - rest_api_key: [] + summary: Update journey node + x-content-type: application/json + x-accepts: application/json + /organizations/{organization_id}/audit_logs: + get: + description: "Retrieve a paginated, time-scoped list of audit log events for\ + \ an organization. Requires an Enterprise plan with the audit logs entitlement\ + \ enabled." + operationId: list_audit_logs + parameters: + - description: The UUID of the organization to retrieve audit logs for. Must + match the authenticated Organization API Key. + explode: false + in: path + name: organization_id + required: true + schema: + example: YOUR_ORG_ID + type: string + style: simple + - description: Start of the time range in ISO 8601 format (e.g. 2026-02-01T00:00:00Z). + Required unless cursor is provided. Must be within the last 90 days. + explode: true + in: query + name: start_time + required: false + schema: + type: string + style: form + - description: End of the time range in ISO 8601 format. Defaults to the current + time. Must be after start_time. + explode: true + in: query + name: end_time + required: false + schema: + type: string + style: form + - description: "Pagination cursor returned in a previous response as next_cursor.\ + \ When provided, start_time and end_time are ignored." + explode: true + in: query + name: cursor + required: false + schema: + type: string + style: form + - description: "Maximum number of events to return per page. Minimum 1, maximum\ + \ 100. Values outside this range are clamped automatically by the server." + explode: true + in: query + name: limit + required: false + schema: + type: integer + style: form + - description: Filter events by app UUID. Accepts up to 10 values. Org-level + events are always included. + explode: true + in: query + name: app_ids + required: false + schema: + items: + type: string + maxItems: 10 + type: array + style: form + - description: "Filter by action type (e.g. notification.sent, segment.created).\ + \ Accepts up to 20 values." + explode: true + in: query + name: actions + required: false + schema: + items: + type: string + maxItems: 20 + type: array + style: form + - description: Filter by actor UUID (the user or service that performed the + action). Accepts up to 10 values. + explode: true + in: query + name: actor_ids + required: false + schema: + items: + type: string + maxItems: 10 + type: array + style: form + - description: Filter by actor email address. Accepts up to 10 values. + explode: true + in: query + name: actor_emails + required: false + schema: + items: + type: string + maxItems: 10 + type: array + style: form + - description: "Filter by the type of resource the action was performed on (e.g.\ + \ notification, segment, journey). Accepts up to 10 values." + explode: true + in: query + name: target_types + required: false + schema: + items: + type: string + maxItems: 10 + type: array + style: form + - description: Filter by the UUID of the resource the action was performed on. + Accepts up to 10 values. + explode: true + in: query + name: target_ids + required: false + schema: + items: + type: string + maxItems: 10 + type: array + style: form + - description: Filter by the IP address the action originated from. Accepts + up to 10 values. + explode: true + in: query + name: ip_addresses + required: false + schema: + items: + type: string + maxItems: 10 + type: array + style: form + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Unexpected error + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ListAuditLogsSuccessResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found + "429": + content: + application/json: + schema: + $ref: '#/components/schemas/RateLimitError' + description: Rate Limit Exceeded + security: + - organization_api_key: [] + summary: List audit logs + x-accepts: application/json +components: + requestBodies: + get_notification_history_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/get_notification_history_request_body' + required: true + export_subscriptions_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/export_subscriptions_request_body' + schemas: + App: + example: + apns_key_id: apns_key_id + apns_team_id: apns_team_id + apns_p12: apns_p12 + safari_site_origin: safari_site_origin + apns_p12_password: apns_p12_password + created_at: 2000-01-23T04:56:07.000+00:00 + safari_icon_64_64: safari_icon_64_64 + chrome_web_sub_domain: chrome_web_sub_domain + gcm_key: gcm_key + apns_bundle_id: apns_bundle_id + chrome_key: chrome_key + safari_push_id: safari_push_id + updated_at: 2000-01-23T04:56:07.000+00:00 + apns_certificates: apns_certificates + safari_apns_p12: safari_apns_p12 + safari_icon_128_128: safari_icon_128_128 + id: id + android_gcm_sender_id: android_gcm_sender_id + safari_icon_32_32: safari_icon_32_32 + additional_data_is_root_payload: true + apns_env: sandbox players: 0 messageable_players: 6 apns_p8: apns_p8 @@ -3083,920 +3569,1866 @@ components: safari_icon_256_256: safari_icon_256_256 properties: id: - readOnly: true + readOnly: true + type: string + name: + description: "The name of your app, as displayed on your apps list on the\ + \ dashboard. This can be renamed." + type: string + players: + readOnly: true + type: integer + messageable_players: + readOnly: true + type: integer + updated_at: + format: date-time + readOnly: true + type: string + created_at: + format: date-time + readOnly: true + type: string + android_gcm_sender_id: + description: "Android: Your Google Project number. Also known as Sender\ + \ ID." + type: string + writeOnly: true + gcm_key: + description: "Android: Your Google Push Messaging Auth Key" + nullable: true + type: string + chrome_web_origin: + description: "Chrome (All Browsers except Safari) (Recommended): The URL\ + \ to your website. This field is required if you wish to enable web push\ + \ and specify other web push parameters." + nullable: true + type: string + chrome_key: + description: Not for web push. Your Google Push Messaging Auth Key if you + use Chrome Apps / Extensions. + nullable: true + type: string + chrome_web_default_notification_icon: + description: "Chrome (All Browsers except Safari): Your default notification\ + \ icon. Should be 256x256 pixels, min 80x80." + nullable: true + type: string + chrome_web_sub_domain: + description: "Chrome (All Browsers except Safari): A subdomain of your choice\ + \ in order to support Web Push on non-HTTPS websites. This field must\ + \ be set in order for the chrome_web_gcm_sender_id property to be processed." + nullable: true + type: string + apns_env: + description: "iOS: Either sandbox or production" + enum: + - sandbox + - production + nullable: true + type: string + apns_p12: + description: "iOS: Your apple push notification p12 certificate file, converted\ + \ to a string and Base64 encoded." + type: string + writeOnly: true + apns_p12_password: + description: "iOS: Required if using p12 certificate. Password for the\ + \ apns_p12 file." + type: string + writeOnly: true + apns_certificates: + nullable: true + readOnly: true + type: string + safari_apns_certificates: + readOnly: true + type: string + safari_apns_p12: + description: "Safari: Your apple push notification p12 certificate file\ + \ for Safari Push Notifications, converted to a string and Base64 encoded." + type: string + writeOnly: true + safari_apns_p12_password: + description: "Safari: Password for safari_apns_p12 file" + type: string + writeOnly: true + apns_key_id: + description: "iOS: Required if using p8. Unique identifier for the p8 authentication\ + \ key." + nullable: true + type: string + apns_team_id: + description: "iOS: Required if using p8. Team ID generated by Apple for\ + \ your developer account." + nullable: true + type: string + apns_bundle_id: + description: "iOS: Required if using p8. Bundle ID for your app in the Apple\ + \ ecosystem." + nullable: true + type: string + apns_p8: + description: "iOS: Required if using p8. Base64 encoded p8 key" + nullable: true + type: string + safari_site_origin: + description: "Safari (Recommended): The hostname to your website including\ + \ http(s)://" + nullable: true + type: string + safari_push_id: + nullable: true + readOnly: true + type: string + safari_icon_16_16: + readOnly: true + type: string + safari_icon_32_32: + readOnly: true + type: string + safari_icon_64_64: + readOnly: true + type: string + safari_icon_128_128: + readOnly: true + type: string + safari_icon_256_256: + description: "Safari: A url for a 256x256 png notification icon. This is\ + \ the only Safari icon URL you need to provide." + type: string + site_name: + description: "All Browsers (Recommended): The Site Name. Requires both chrome_web_origin\ + \ and safari_site_origin to be set to add or update it." + nullable: true + type: string + basic_auth_key: + nullable: true + readOnly: true + type: string + organization_id: + description: The Id of the Organization you would like to add this app to. + type: string + writeOnly: true + additional_data_is_root_payload: + description: "iOS: Notification data (additional data) values will be added\ + \ to the root of the apns payload when sent to the device. Ignore if\ + \ you're not using any other plugins, or not using OneSignal SDK methods\ + \ to read the payload." + type: boolean + writeOnly: true + type: object + Apps: + items: + $ref: '#/components/schemas/App' + type: array + SegmentNotificationTarget: + properties: + included_segments: + description: "The segment names you want to target. Users in these segments\ + \ will receive a notification. This targeting parameter is only compatible\ + \ with excluded_segments.\nExample: [\"Active Users\", \"Inactive Users\"\ + ]\n" + items: + type: string + type: array + excluded_segments: + description: "Segment that will be excluded when sending. Users in these\ + \ segments will not receive a notification, even if they were included\ + \ in included_segments. This targeting parameter is only compatible with\ + \ included_segments.\nExample: [\"Active Users\", \"Inactive Users\"]\n" + items: + type: string + type: array + type: object + SubscriptionNotificationTarget: + properties: + include_subscription_ids: + description: "Specific subscription ids to send your notification to. _Does\ + \ not require API Auth Key._\nNot compatible with any other targeting\ + \ parameters.\nExample: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"]\nLimit\ + \ of 2,000 entries per REST API call\n" + items: + type: string + nullable: true + type: array + include_email_tokens: + deprecated: true + description: "Deprecated alias for `email_to`. Target specific email addresses.\ + \ If an email does not correspond to an existing user, a new user will\ + \ be created. Example: nick@catfac.ts. Limit of 2,000 entries per REST\ + \ API call. Prefer `email_to` in new integrations.\n" + items: + type: string + type: array + email_to: + description: "Recommended for Sending Emails - Target specific email addresses.\ + \ If an email does not correspond to an existing user, a new user will\ + \ be created. Example: nick@catfac.ts. Limit of 2,000 entries per REST\ + \ API call. Supersedes the deprecated `include_email_tokens` field.\n" + items: + type: string + type: array + include_phone_numbers: + description: "Recommended for Sending SMS - Target specific phone numbers.\ + \ The phone number should be in the E.164 format. Phone number should\ + \ be an existing subscriber on OneSignal. Refer our docs to learn how\ + \ to add phone numbers to OneSignal.\nExample phone number: +1999999999\n\ + Limit of 2,000 entries per REST API call\n" + items: + type: string + type: array + include_ios_tokens: + description: "Not Recommended: Please consider using include_subscription_ids\ + \ or include_aliases instead.\nTarget using iOS device tokens.\nWarning:\ + \ Only works with Production tokens.\nAll non-alphanumeric characters\ + \ must be removed from each token. If a token does not correspond to an\ + \ existing user, a new user will be created.\nExample: ce777617da7f548fe7a9ab6febb56cf39fba6d38203...\n\ + Limit of 2,000 entries per REST API call\n" + items: + type: string + type: array + include_wp_wns_uris: + description: "Not Recommended: Please consider using include_subscription_ids\ + \ or include_aliases instead.\nTarget using Windows URIs. If a token does\ + \ not correspond to an existing user, a new user will be created.\nExample:\ + \ http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-...\nLimit of 2,000 entries\ + \ per REST API call\n" + items: + type: string + type: array + include_amazon_reg_ids: + description: "Not Recommended: Please consider using include_subscription_ids\ + \ or include_aliases instead.\nTarget using Amazon ADM registration IDs.\ + \ If a token does not correspond to an existing user, a new user will\ + \ be created.\nExample: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV...\n\ + Limit of 2,000 entries per REST API call\n" + items: + type: string + type: array + include_chrome_reg_ids: + description: "Not Recommended: Please consider using include_subscription_ids\ + \ or include_aliases instead.\nTarget using Chrome App registration IDs.\ + \ If a token does not correspond to an existing user, a new user will\ + \ be created.\nExample: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_...\nLimit\ + \ of 2,000 entries per REST API call\n" + items: + type: string + type: array + include_chrome_web_reg_ids: + description: "Not Recommended: Please consider using include_subscription_ids\ + \ or include_aliases instead.\nTarget using Chrome Web Push registration\ + \ IDs. If a token does not correspond to an existing user, a new user\ + \ will be created.\nExample: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_...\n\ + Limit of 2,000 entries per REST API call\n" + items: + type: string + type: array + include_android_reg_ids: + description: "Not Recommended: Please consider using include_subscription_ids\ + \ or include_aliases instead.\nTarget using Android device registration\ + \ IDs. If a token does not correspond to an existing user, a new user\ + \ will be created.\nExample: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_...\n\ + Limit of 2,000 entries per REST API call\n" + items: + type: string + type: array + include_aliases: + additionalProperties: + items: + type: string + type: array + description: "Target specific users by aliases assigned via API. An alias\ + \ can be an external_id, onesignal_id, or a custom alias.\nAccepts an\ + \ object where keys are alias labels and values are arrays of alias IDs\ + \ to include\nExample usage: { \"external_id\": [\"exId1\", \"extId2\"\ + ], \"internal_label\": [\"id1\", \"id2\"] }\nKeys must match API spellings\ + \ exactly (for example the label for External ID is the string `external_id`;\ + \ arbitrary keys such as camelCase variants are not aliases and may yield\ + \ no recipients).\nNot compatible with any other targeting parameters.\n\ + REQUIRED: REST API Key Authentication\nLimit of 2,000 entries per REST\ + \ API call\nNote: 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." + nullable: true + type: object + target_channel: + enum: + - push + - email + - sms + type: string + type: object + NotificationTarget: + anyOf: + - $ref: '#/components/schemas/SegmentNotificationTarget' + - $ref: '#/components/schemas/SubscriptionNotificationTarget' + BasicNotification: + allOf: + - $ref: '#/components/schemas/NotificationTarget' + - $ref: '#/components/schemas/BasicNotification_allOf' + - required: + - app_id + Notification: + allOf: + - $ref: '#/components/schemas/BasicNotification' + - $ref: '#/components/schemas/Notification_allOf' + NotificationWithMeta: + allOf: + - $ref: '#/components/schemas/BasicNotification' + - $ref: '#/components/schemas/DeliveryData' + - $ref: '#/components/schemas/OutcomesData' + - $ref: '#/components/schemas/NotificationWithMeta_allOf' + Button: + properties: + id: type: string - name: - description: "The name of your app, as displayed on your apps list on the\ - \ dashboard. This can be renamed." + text: type: string - players: - readOnly: true - type: integer - messageable_players: - readOnly: true - type: integer - updated_at: - format: date-time - readOnly: true + icon: type: string - created_at: - format: date-time - readOnly: true + required: + - id + type: object + WebButton: + properties: + id: type: string - android_gcm_sender_id: - description: "Android: Your Google Project number. Also known as Sender\ - \ ID." + text: type: string - writeOnly: true - gcm_key: - description: "Android: Your Google Push Messaging Auth Key" - nullable: true + icon: + type: string + url: + type: string + required: + - id + type: object + LanguageStringMap: + example: + de: de + hi: hi + fi: fi + ru: ru + pt: pt + bg: bg + lt: lt + hr: hr + lv: lv + fr: fr + hu: hu + bs: bs + zh-Hans: zh-Hans + zh-Hant: zh-Hant + ka: ka + uk: uk + sk: sk + id: id + ca: ca + sr: sr + sv: sv + ko: ko + ms: ms + el: el + en: en + it: it + zh: zh + es: es + et: et + cs: cs + ar: ar + pa: pa + vi: vi + nb: nb + th: th + ja: ja + fa: fa + pl: pl + da: da + he: he + ro: ro + nl: nl + tr: tr + properties: + en: + description: Text in English. Will be used as a fallback + type: string + ar: + description: Text in Arabic. + type: string + bs: + description: Text in Bosnian. + type: string + bg: + description: Text in Bulgarian. + type: string + ca: + description: Text in Catalan. + type: string + zh-Hans: + description: Text in Chinese (Simplified). + type: string + zh-Hant: + description: Text in Chinese (Traditional). + type: string + zh: + description: Alias for zh-Hans. + type: string + hr: + description: Text in Croatian. + type: string + cs: + description: Text in Czech. + type: string + da: + description: Text in Danish. + type: string + nl: + description: Text in Dutch. + type: string + et: + description: Text in Estonian. + type: string + fi: + description: Text in Finnish. + type: string + fr: + description: Text in French. + type: string + ka: + description: Text in Georgian. + type: string + de: + description: Text in German. + type: string + el: + description: Text in Greek. + type: string + hi: + description: Text in Hindi. + type: string + he: + description: Text in Hebrew. + type: string + hu: + description: Text in Hungarian. + type: string + id: + description: Text in Indonesian. + type: string + it: + description: Text in Italian. + type: string + ja: + description: Text in Japanese. + type: string + ko: + description: Text in Korean. + type: string + lv: + description: Text in Latvian. + type: string + lt: + description: Text in Lithuanian. + type: string + ms: + description: Text in Malay. + type: string + nb: + description: Text in Norwegian. + type: string + pl: + description: Text in Polish. + type: string + fa: + description: Text in Persian. + type: string + pt: + description: Text in Portugese. + type: string + pa: + description: Text in Punjabi. + type: string + ro: + description: Text in Romanian. + type: string + ru: + description: Text in Russian. + type: string + sr: + description: Text in Serbian. + type: string + sk: + description: Text in Slovak. + type: string + es: + description: Text in Spanish. + type: string + sv: + description: Text in Swedish. + type: string + th: + description: Text in Thai. + type: string + tr: + description: Text in Turkish. + type: string + uk: + description: Text in Ukrainian. + type: string + vi: + description: Text in Vietnamese. + type: string + type: object + NotificationSlice: + example: + offset: 6 + time_offset: time_offset + total_count: 0 + limit: 1 + next_time_offset: next_time_offset + notifications: + - null + - null + properties: + total_count: + type: integer + offset: + type: integer + limit: + type: integer + time_offset: + description: "The time_offset cursor specified in the request, if any." type: string - chrome_web_origin: - description: "Chrome (All Browsers except Safari) (Recommended): The URL\ - \ to your website. This field is required if you wish to enable web push\ - \ and specify other web push parameters." - nullable: true + next_time_offset: + description: An opaque Base64 cursor token representing the next page of + messages to fetch. Present when time_offset was provided in the request. Pass + this value as time_offset on the next request to continue paginating. type: string - chrome_key: - description: Not for web push. Your Google Push Messaging Auth Key if you - use Chrome Apps / Extensions. + notifications: + items: + $ref: '#/components/schemas/NotificationWithMeta' + type: array + type: object + PlatformDeliveryData: + description: Hash of delivery statistics broken out by target device platform. + properties: + edge_web_push: + $ref: '#/components/schemas/DeliveryData' + chrome_web_push: + $ref: '#/components/schemas/DeliveryData' + firefox_web_push: + $ref: '#/components/schemas/DeliveryData' + safari_web_push: + $ref: '#/components/schemas/DeliveryData' + android: + $ref: '#/components/schemas/DeliveryData' + ios: + $ref: '#/components/schemas/DeliveryData' + sms: + allOf: + - $ref: '#/components/schemas/DeliveryData' + - $ref: '#/components/schemas/PlatformDeliveryData_sms_allOf' + email: + allOf: + - $ref: '#/components/schemas/DeliveryData' + - $ref: '#/components/schemas/PlatformDeliveryData_email_allOf' + type: object + DeliveryData: + properties: + successful: + description: "Number of messages delivered to push servers, mobile carriers,\ + \ or email service providers." nullable: true - type: string - chrome_web_default_notification_icon: - description: "Chrome (All Browsers except Safari): Your default notification\ - \ icon. Should be 256x256 pixels, min 80x80." + type: integer + failed: + description: Number of messages sent to unsubscribed devices. nullable: true - type: string - chrome_web_sub_domain: - description: "Chrome (All Browsers except Safari): A subdomain of your choice\ - \ in order to support Web Push on non-HTTPS websites. This field must\ - \ be set in order for the chrome_web_gcm_sender_id property to be processed." + type: integer + errored: + description: Number of errors reported. nullable: true - type: string - apns_env: - description: "iOS: Either sandbox or production" - enum: - - sandbox - - production + type: integer + converted: + description: Number of messages that were clicked. nullable: true - type: string - apns_p12: - description: "iOS: Your apple push notification p12 certificate file, converted\ - \ to a string and Base64 encoded." - type: string - writeOnly: true - apns_p12_password: - description: "iOS: Required if using p12 certificate. Password for the\ - \ apns_p12 file." - type: string - writeOnly: true - apns_certificates: + type: integer + received: + description: Number of devices that received the message. nullable: true - readOnly: true + type: integer + type: object + Purchase: + example: + amount: "0.99" + iso: USD + count: 2 + sku: com.example.coins100 + properties: + sku: + description: The unique identifier of the purchased item. + example: com.example.coins100 type: string - safari_apns_certificates: - readOnly: true + amount: + description: "The amount, in USD, spent purchasing the item." + example: "0.99" type: string - safari_apns_p12: - description: "Safari: Your apple push notification p12 certificate file\ - \ for Safari Push Notifications, converted to a string and Base64 encoded." + iso: + description: The 3-letter ISO 4217 currency code. Required for correct storage + and conversion of amount. + example: USD type: string - writeOnly: true - safari_apns_p12_password: - description: "Safari: Password for safari_apns_p12 file" + count: + type: integer + required: + - amount + - iso + - sku + type: object + OutcomeData: + example: + aggregation: sum + id: id + value: 0 + properties: + id: type: string - writeOnly: true - apns_key_id: - description: "iOS: Required if using p8. Unique identifier for the p8 authentication\ - \ key." - nullable: true + value: + type: integer + aggregation: + enum: + - sum + - count type: string - apns_team_id: - description: "iOS: Required if using p8. Team ID generated by Apple for\ - \ your developer account." - nullable: true + required: + - aggregation + - id + - value + type: object + OutcomesData: + example: + outcomes: + - aggregation: sum + id: id + value: 0 + - aggregation: sum + id: id + value: 0 + properties: + outcomes: + items: + $ref: '#/components/schemas/OutcomeData' + type: array + type: object + Filter: + properties: + field: + description: Required. Name of the field to use as the first operand in + the filter expression. + example: tag type: string - apns_bundle_id: - description: "iOS: Required if using p8. Bundle ID for your app in the Apple\ - \ ecosystem." - nullable: true + key: + description: "If `field` is `tag`, this field is *required* to specify `key`\ + \ inside the tags." + example: level type: string - apns_p8: - description: "iOS: Required if using p8. Base64 encoded p8 key" - nullable: true + value: + description: "Constant value to use as the second operand in the filter\ + \ expression. This value is *required* when the relation operator is a\ + \ binary operator. For `in_array` and `not_in_array` relations, provide\ + \ a comma-separated list of up to 20 values." + example: "10" type: string - safari_site_origin: - description: "Safari (Recommended): The hostname to your website including\ - \ http(s)://" - nullable: true + hours_ago: + description: "If `field` is session-related, this is *required* to specify\ + \ the number of hours before or after the user's session." + example: "24" type: string - safari_push_id: - nullable: true - readOnly: true + radius: + description: "If `field` is `location`, this will specify the radius in\ + \ meters from a provided location point. Use with `lat` and `long`." + type: number + lat: + description: "If `field` is `location`, this is *required* to specify the\ + \ user's latitude." + type: number + long: + description: "If `field` is `location`, this is *required* to specify the\ + \ user's longitude." + type: number + relation: + description: Required. Operator of a filter expression. + enum: + - '>' + - < + - = + - '!=' + - exists + - not_exists + - time_elapsed_gt + - time_elapsed_lt + - in_array + - not_in_array type: string - safari_icon_16_16: - readOnly: true + type: object + Operator: + properties: + operator: + description: "Strictly, this must be either `\"OR\"`, or `\"AND\"`. It\ + \ can be used to compose Filters as part of a Filters object." + enum: + - OR + - AND type: string - safari_icon_32_32: - readOnly: true + type: object + FilterExpression: + oneOf: + - $ref: '#/components/schemas/Filter' + - $ref: '#/components/schemas/Operator' + Segment: + example: + name: Inactive 30 days + id: d5d4d1a8-1c9e-42fb-b3f2-56d3a5a9a8b7 + filters: + - null + - null + properties: + id: + description: "UUID of the segment. If left empty, it will be assigned automaticaly." + example: d5d4d1a8-1c9e-42fb-b3f2-56d3a5a9a8b7 type: string - safari_icon_64_64: - readOnly: true + name: + description: Name of the segment. You'll see this name on the Web UI. + example: Inactive 30 days type: string - safari_icon_128_128: - readOnly: true + filters: + description: "Filter or operators the segment will have. For a list of\ + \ available filters with details, please see Send to Users Based on Filters." + items: + $ref: '#/components/schemas/FilterExpression' + type: array + required: + - filters + - name + type: object + SegmentData: + example: + is_active: true + updated_at: updated_at + read_only: true + name: name + created_at: created_at + id: id + app_id: app_id + properties: + id: + description: The segment ID type: string - safari_icon_256_256: - description: "Safari: A url for a 256x256 png notification icon. This is\ - \ the only Safari icon URL you need to provide." + name: + description: The segment name type: string - site_name: - description: "All Browsers (Recommended): The Site Name. Requires both chrome_web_origin\ - \ and safari_site_origin to be set to add or update it." - nullable: true + created_at: + description: Date segment created type: string - basic_auth_key: - nullable: true - readOnly: true + updated_at: + description: Date segment last updated type: string - organization_id: - description: The Id of the Organization you would like to add this app to. + app_id: + description: The app id type: string - writeOnly: true - additional_data_is_root_payload: - description: "iOS: Notification data (additional data) values will be added\ - \ to the root of the apns payload when sent to the device. Ignore if\ - \ you're not using any other plugins, or not using OneSignal SDK methods\ - \ to read the payload." + read_only: + description: Is the segment read only? + type: boolean + is_active: + description: Is the segment active? type: boolean - writeOnly: true type: object - Apps: - items: - $ref: '#/components/schemas/App' - type: array - SegmentNotificationTarget: + GetSegmentsSuccessResponse: + example: + offset: 6 + total_count: 0 + limit: 1 + segments: + - is_active: true + updated_at: updated_at + read_only: true + name: name + created_at: created_at + id: id + app_id: app_id + - is_active: true + updated_at: updated_at + read_only: true + name: name + created_at: created_at + id: id + app_id: app_id properties: - included_segments: - description: "The segment names you want to target. Users in these segments\ - \ will receive a notification. This targeting parameter is only compatible\ - \ with excluded_segments.\nExample: [\"Active Users\", \"Inactive Users\"\ - ]\n" - items: - type: string - type: array - excluded_segments: - description: "Segment that will be excluded when sending. Users in these\ - \ segments will not receive a notification, even if they were included\ - \ in included_segments. This targeting parameter is only compatible with\ - \ included_segments.\nExample: [\"Active Users\", \"Inactive Users\"]\n" + total_count: + description: The number of Segments in the response. + type: integer + offset: + description: Set with the offset query parameter. Default 0. + type: integer + limit: + description: Maximum number of Segments returned. Default 300. + type: integer + segments: + description: An array containing the Segment information. items: - type: string + $ref: '#/components/schemas/SegmentData' type: array type: object - SubscriptionNotificationTarget: + SegmentDetails: + description: Segment details. Only included when the include-segment-detail + query parameter is set to true. + example: + name: name + description: description + created_at: 6 + id: id + source: default + filters: + - null + - null properties: - include_subscription_ids: - description: "Specific subscription ids to send your notification to. _Does\ - \ not require API Auth Key._\nNot compatible with any other targeting\ - \ parameters.\nExample: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"]\nLimit\ - \ of 2,000 entries per REST API call\n" - items: - type: string + id: + description: The unique identifier for the segment (UUID v4). + type: string + name: + description: The segment name. + type: string + description: + description: Human-readable description for the segment. `null` when unset. + Maximum 255 characters. nullable: true - type: array - include_email_tokens: - deprecated: true - description: "Deprecated alias for `email_to`. Target specific email addresses.\ - \ If an email does not correspond to an existing user, a new user will\ - \ be created. Example: nick@catfac.ts. Limit of 2,000 entries per REST\ - \ API call. Prefer `email_to` in new integrations.\n" - items: - type: string - type: array - email_to: - description: "Recommended for Sending Emails - Target specific email addresses.\ - \ If an email does not correspond to an existing user, a new user will\ - \ be created. Example: nick@catfac.ts. Limit of 2,000 entries per REST\ - \ API call. Supersedes the deprecated `include_email_tokens` field.\n" - items: - type: string - type: array - include_phone_numbers: - description: "Recommended for Sending SMS - Target specific phone numbers.\ - \ The phone number should be in the E.164 format. Phone number should\ - \ be an existing subscriber on OneSignal. Refer our docs to learn how\ - \ to add phone numbers to OneSignal.\nExample phone number: +1999999999\n\ - Limit of 2,000 entries per REST API call\n" - items: - type: string - type: array - include_ios_tokens: - description: "Not Recommended: Please consider using include_subscription_ids\ - \ or include_aliases instead.\nTarget using iOS device tokens.\nWarning:\ - \ Only works with Production tokens.\nAll non-alphanumeric characters\ - \ must be removed from each token. If a token does not correspond to an\ - \ existing user, a new user will be created.\nExample: ce777617da7f548fe7a9ab6febb56cf39fba6d38203...\n\ - Limit of 2,000 entries per REST API call\n" - items: - type: string - type: array - include_wp_wns_uris: - description: "Not Recommended: Please consider using include_subscription_ids\ - \ or include_aliases instead.\nTarget using Windows URIs. If a token does\ - \ not correspond to an existing user, a new user will be created.\nExample:\ - \ http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-...\nLimit of 2,000 entries\ - \ per REST API call\n" - items: - type: string - type: array - include_amazon_reg_ids: - description: "Not Recommended: Please consider using include_subscription_ids\ - \ or include_aliases instead.\nTarget using Amazon ADM registration IDs.\ - \ If a token does not correspond to an existing user, a new user will\ - \ be created.\nExample: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV...\n\ - Limit of 2,000 entries per REST API call\n" - items: - type: string - type: array - include_chrome_reg_ids: - description: "Not Recommended: Please consider using include_subscription_ids\ - \ or include_aliases instead.\nTarget using Chrome App registration IDs.\ - \ If a token does not correspond to an existing user, a new user will\ - \ be created.\nExample: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_...\nLimit\ - \ of 2,000 entries per REST API call\n" - items: - type: string - type: array - include_chrome_web_reg_ids: - description: "Not Recommended: Please consider using include_subscription_ids\ - \ or include_aliases instead.\nTarget using Chrome Web Push registration\ - \ IDs. If a token does not correspond to an existing user, a new user\ - \ will be created.\nExample: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_...\n\ - Limit of 2,000 entries per REST API call\n" + type: string + created_at: + description: Unix timestamp when the segment was created. + type: integer + source: + description: The source of the segment. + enum: + - default + - custom + - quickstart + type: string + filters: + description: "Array of filter and operator objects defining the segment\ + \ criteria. Uses the same format as the Create Segment API, so filters\ + \ can be directly used to recreate or update the segment." items: - type: string + $ref: '#/components/schemas/FilterExpression' type: array - include_android_reg_ids: - description: "Not Recommended: Please consider using include_subscription_ids\ - \ or include_aliases instead.\nTarget using Android device registration\ - \ IDs. If a token does not correspond to an existing user, a new user\ - \ will be created.\nExample: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_...\n\ - Limit of 2,000 entries per REST API call\n" + type: object + GetSegmentSuccessResponse: + example: + payload: + name: name + description: description + created_at: 6 + id: id + source: default + filters: + - null + - null + subscriber_count: 0 + properties: + subscriber_count: + description: The number of subscribers matching this segment. + type: integer + payload: + $ref: '#/components/schemas/SegmentDetails' + type: object + UpdateSegmentRequest: + example: + name: name + description: description + filters: + - null + - null + properties: + name: + description: Required. The segment name. Maximum 128 characters. + maxLength: 128 + type: string + description: + description: Optional human-readable description for the segment. Maximum + 255 characters. Pass an empty string to clear; omit to leave unchanged. + maxLength: 255 + type: string + filters: + description: "Optional. When provided, replaces all existing filters. Filters\ + \ define the segment based on user properties like tags, activity, or\ + \ location using flexible AND/OR logic. Limited to 200 total entries,\ + \ including fields and OR operators." items: - type: string + $ref: '#/components/schemas/FilterExpression' type: array - include_aliases: - additionalProperties: - items: - type: string - type: array - description: "Target specific users by aliases assigned via API. An alias\ - \ can be an external_id, onesignal_id, or a custom alias.\nAccepts an\ - \ object where keys are alias labels and values are arrays of alias IDs\ - \ to include\nExample usage: { \"external_id\": [\"exId1\", \"extId2\"\ - ], \"internal_label\": [\"id1\", \"id2\"] }\nKeys must match API spellings\ - \ exactly (for example the label for External ID is the string `external_id`;\ - \ arbitrary keys such as camelCase variants are not aliases and may yield\ - \ no recipients).\nNot compatible with any other targeting parameters.\n\ - REQUIRED: REST API Key Authentication\nLimit of 2,000 entries per REST\ - \ API call\nNote: 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." - nullable: true - type: object - target_channel: - enum: - - push - - email - - sms - type: string + required: + - name type: object - NotificationTarget: - anyOf: - - $ref: '#/components/schemas/SegmentNotificationTarget' - - $ref: '#/components/schemas/SubscriptionNotificationTarget' - BasicNotification: - allOf: - - $ref: '#/components/schemas/NotificationTarget' - - $ref: '#/components/schemas/BasicNotification_allOf' - - required: - - app_id - Notification: - allOf: - - $ref: '#/components/schemas/BasicNotification' - - $ref: '#/components/schemas/Notification_allOf' - NotificationWithMeta: - allOf: - - $ref: '#/components/schemas/BasicNotification' - - $ref: '#/components/schemas/DeliveryData' - - $ref: '#/components/schemas/OutcomesData' - - $ref: '#/components/schemas/NotificationWithMeta_allOf' - Button: + UpdateSegmentSuccessResponse: + example: + success: true + id: id properties: + success: + description: "true if the segment was updated successfully, false otherwise." + type: boolean id: + description: UUID of the updated segment. type: string - text: + type: object + UpdateLiveActivityRequest: + example: + event_updates: "{}" + stale_date: 0 + contents: + de: de + hi: hi + fi: fi + ru: ru + pt: pt + bg: bg + lt: lt + hr: hr + lv: lv + fr: fr + hu: hu + bs: bs + zh-Hans: zh-Hans + zh-Hant: zh-Hant + ka: ka + uk: uk + sk: sk + id: id + ca: ca + sr: sr + sv: sv + ko: ko + ms: ms + el: el + en: en + it: it + zh: zh + es: es + et: et + cs: cs + ar: ar + pa: pa + vi: vi + nb: nb + th: th + ja: ja + fa: fa + pl: pl + da: da + he: he + ro: ro + nl: nl + tr: tr + sound: sound + name: name + headings: + de: de + hi: hi + fi: fi + ru: ru + pt: pt + bg: bg + lt: lt + hr: hr + lv: lv + fr: fr + hu: hu + bs: bs + zh-Hans: zh-Hans + zh-Hant: zh-Hant + ka: ka + uk: uk + sk: sk + id: id + ca: ca + sr: sr + sv: sv + ko: ko + ms: ms + el: el + en: en + it: it + zh: zh + es: es + et: et + cs: cs + ar: ar + pa: pa + vi: vi + nb: nb + th: th + ja: ja + fa: fa + pl: pl + da: da + he: he + ro: ro + nl: nl + tr: tr + dismissal_date: 6 + event: update + priority: 1 + properties: + name: + description: An internal name to assist with your campaign organization. + This does not get displayed in the message itself. type: string - icon: + event: + enum: + - update + - end + type: string + event_updates: + description: This must match the ContentState interface you have defined + within your Live Activity in your app. + type: object + contents: + $ref: '#/components/schemas/LanguageStringMap' + headings: + $ref: '#/components/schemas/LanguageStringMap' + sound: + description: Sound file that is included in your app to play instead of + the default device notification sound. Omit to disable vibration and sound + for the notification. type: string + stale_date: + description: "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." + type: integer + dismissal_date: + description: Accepts Unix timestamp in seconds; only allowed if event is + "end" + type: integer + priority: + description: "Delivery priority through the 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. Some providers\ + \ (APNs) allow for a limited budget of high priority notifications per\ + \ hour, and if that budget is exceeded, the provider may throttle notification\ + \ delivery." + type: integer required: - - id + - event + - event_updates + - name type: object - WebButton: + IdentityObject: + additionalProperties: + type: string + example: + external_id: YOUR_USER_EXTERNAL_ID + type: object + PropertiesObject: + example: + country: US + purchases: + - amount: "0.99" + iso: USD + count: 2 + sku: com.example.coins100 + - amount: "0.99" + iso: USD + count: 2 + sku: com.example.coins100 + ip: 203.0.113.10 + timezone_id: America/Los_Angeles + language: en + first_active: 1 + last_active: 5 + lat: 0.8008281904610115 + long: 6.027456183070403 + tags: + level: "10" + vip: "true" + amount_spent: 5.637376656633329 properties: - id: + tags: + additionalProperties: true + example: + level: "10" + vip: "true" + type: object + language: + example: en type: string - text: + timezone_id: + example: America/Los_Angeles type: string - icon: + lat: + type: number + long: + type: number + country: + example: US type: string - url: + first_active: + type: integer + last_active: + type: integer + amount_spent: + type: number + purchases: + items: + $ref: '#/components/schemas/Purchase' + type: array + ip: + example: 203.0.113.10 type: string - required: - - id type: object - LanguageStringMap: + PropertiesDeltas: example: - de: de - hi: hi - fi: fi - ru: ru - pt: pt - bg: bg - lt: lt - hr: hr - lv: lv - fr: fr - hu: hu - bs: bs - zh-Hans: zh-Hans - zh-Hant: zh-Hant - ka: ka - uk: uk - sk: sk - id: id - ca: ca - sr: sr - sv: sv - ko: ko - ms: ms - el: el - en: en - it: it - zh: zh - es: es - et: et - cs: cs - ar: ar - pa: pa - vi: vi - nb: nb - th: th - ja: ja - fa: fa - pl: pl - da: da - he: he - ro: ro - nl: nl - tr: tr + purchases: + - amount: "0.99" + iso: USD + count: 2 + sku: com.example.coins100 + - amount: "0.99" + iso: USD + count: 2 + sku: com.example.coins100 + session_count: 6 + session_time: 0 + properties: + session_time: + type: integer + session_count: + type: integer + purchases: + items: + $ref: '#/components/schemas/Purchase' + type: array + type: object + Subscription: + example: + notification_types: 1 + device_model: "iPhone14,2" + app_version: 1.0.0 + web_p256: BM5-r8DauQXOb2E-3PgLPjSvjT0Ao9v5oJhw8bZ0cW7Vh6BbmPYcqbbCEJ1P2sK0hZ7HxSh9zGyU5pQk1jJmZ8A + net_type: 9 + type: iOSPush + device_os: "17.1" + enabled: true + session_time: 60 + test_type: 7 + token: d5d4d1a8-1c9e-42fb-b3f2-56d3a5a9a8b7 + carrier: Verizon + session_count: 1 + web_auth: 5DUmpGmLuTxWCLj5lJpwLQ + rooted: true + id: e4e87830-b954-4363-b7bc-1f01dbaee5c8 + sdk: 5.2.0 properties: - en: - description: Text in English. Will be used as a fallback - type: string - ar: - description: Text in Arabic. - type: string - bs: - description: Text in Bosnian. - type: string - bg: - description: Text in Bulgarian. - type: string - ca: - description: Text in Catalan. - type: string - zh-Hans: - description: Text in Chinese (Simplified). - type: string - zh-Hant: - description: Text in Chinese (Traditional). - type: string - zh: - description: Alias for zh-Hans. - type: string - hr: - description: Text in Croatian. - type: string - cs: - description: Text in Czech. - type: string - da: - description: Text in Danish. - type: string - nl: - description: Text in Dutch. - type: string - et: - description: Text in Estonian. - type: string - fi: - description: Text in Finnish. - type: string - fr: - description: Text in French. - type: string - ka: - description: Text in Georgian. - type: string - de: - description: Text in German. - type: string - el: - description: Text in Greek. - type: string - hi: - description: Text in Hindi. - type: string - he: - description: Text in Hebrew. - type: string - hu: - description: Text in Hungarian. - type: string id: - description: Text in Indonesian. - type: string - it: - description: Text in Italian. - type: string - ja: - description: Text in Japanese. - type: string - ko: - description: Text in Korean. - type: string - lv: - description: Text in Latvian. - type: string - lt: - description: Text in Lithuanian. - type: string - ms: - description: Text in Malay. - type: string - nb: - description: Text in Norwegian. - type: string - pl: - description: Text in Polish. - type: string - fa: - description: Text in Persian. - type: string - pt: - description: Text in Portugese. - type: string - pa: - description: Text in Punjabi. - type: string - ro: - description: Text in Romanian. + example: e4e87830-b954-4363-b7bc-1f01dbaee5c8 type: string - ru: - description: Text in Russian. + type: + enum: + - iOSPush + - AndroidPush + - FireOSPush + - ChromeExtensionPush + - ChromePush + - WindowsPush + - SafariLegacyPush + - FirefoxPush + - macOSPush + - HuaweiPush + - SafariPush + - Email + - SMS type: string - sr: - description: Text in Serbian. + token: + example: d5d4d1a8-1c9e-42fb-b3f2-56d3a5a9a8b7 type: string - sk: - description: Text in Slovak. + enabled: + example: true + type: boolean + notification_types: + example: 1 + type: integer + session_time: + example: 60 + type: integer + session_count: + example: 1 + type: integer + sdk: + example: 5.2.0 type: string - es: - description: Text in Spanish. + device_model: + example: "iPhone14,2" type: string - sv: - description: Text in Swedish. + device_os: + example: "17.1" type: string - th: - description: Text in Thai. + rooted: + type: boolean + test_type: + type: integer + app_version: + example: 1.0.0 type: string - tr: - description: Text in Turkish. + net_type: + type: integer + carrier: + example: Verizon type: string - uk: - description: Text in Ukrainian. + web_auth: + example: 5DUmpGmLuTxWCLj5lJpwLQ type: string - vi: - description: Text in Vietnamese. + web_p256: + example: BM5-r8DauQXOb2E-3PgLPjSvjT0Ao9v5oJhw8bZ0cW7Vh6BbmPYcqbbCEJ1P2sK0hZ7HxSh9zGyU5pQk1jJmZ8A type: string type: object - NotificationSlice: + User: example: - offset: 6 - time_offset: time_offset - total_count: 0 - limit: 1 - next_time_offset: next_time_offset - notifications: - - null - - null + subscriptions: + - notification_types: 1 + device_model: "iPhone14,2" + app_version: 1.0.0 + web_p256: BM5-r8DauQXOb2E-3PgLPjSvjT0Ao9v5oJhw8bZ0cW7Vh6BbmPYcqbbCEJ1P2sK0hZ7HxSh9zGyU5pQk1jJmZ8A + net_type: 9 + type: iOSPush + device_os: "17.1" + enabled: true + session_time: 60 + test_type: 7 + token: d5d4d1a8-1c9e-42fb-b3f2-56d3a5a9a8b7 + carrier: Verizon + session_count: 1 + web_auth: 5DUmpGmLuTxWCLj5lJpwLQ + rooted: true + id: e4e87830-b954-4363-b7bc-1f01dbaee5c8 + sdk: 5.2.0 + - notification_types: 1 + device_model: "iPhone14,2" + app_version: 1.0.0 + web_p256: BM5-r8DauQXOb2E-3PgLPjSvjT0Ao9v5oJhw8bZ0cW7Vh6BbmPYcqbbCEJ1P2sK0hZ7HxSh9zGyU5pQk1jJmZ8A + net_type: 9 + type: iOSPush + device_os: "17.1" + enabled: true + session_time: 60 + test_type: 7 + token: d5d4d1a8-1c9e-42fb-b3f2-56d3a5a9a8b7 + carrier: Verizon + session_count: 1 + web_auth: 5DUmpGmLuTxWCLj5lJpwLQ + rooted: true + id: e4e87830-b954-4363-b7bc-1f01dbaee5c8 + sdk: 5.2.0 + identity: + external_id: YOUR_USER_EXTERNAL_ID + properties: + country: US + purchases: + - amount: "0.99" + iso: USD + count: 2 + sku: com.example.coins100 + - amount: "0.99" + iso: USD + count: 2 + sku: com.example.coins100 + ip: 203.0.113.10 + timezone_id: America/Los_Angeles + language: en + first_active: 1 + last_active: 5 + lat: 0.8008281904610115 + long: 6.027456183070403 + tags: + level: "10" + vip: "true" + amount_spent: 5.637376656633329 properties: - total_count: - type: integer - offset: - type: integer - limit: - type: integer - time_offset: - description: "The time_offset cursor specified in the request, if any." - type: string - next_time_offset: - description: An opaque Base64 cursor token representing the next page of - messages to fetch. Present when time_offset was provided in the request. Pass - this value as time_offset on the next request to continue paginating. - type: string - notifications: + properties: + $ref: '#/components/schemas/PropertiesObject' + identity: + additionalProperties: + type: string + example: + external_id: YOUR_USER_EXTERNAL_ID + type: object + subscriptions: items: - $ref: '#/components/schemas/NotificationWithMeta' + $ref: '#/components/schemas/Subscription' type: array type: object - PlatformDeliveryData: - description: Hash of delivery statistics broken out by target device platform. + UpdateUserRequest: + example: + refresh_device_metadata: false + deltas: + purchases: + - amount: "0.99" + iso: USD + count: 2 + sku: com.example.coins100 + - amount: "0.99" + iso: USD + count: 2 + sku: com.example.coins100 + session_count: 6 + session_time: 0 + properties: + country: US + purchases: + - amount: "0.99" + iso: USD + count: 2 + sku: com.example.coins100 + - amount: "0.99" + iso: USD + count: 2 + sku: com.example.coins100 + ip: 203.0.113.10 + timezone_id: America/Los_Angeles + language: en + first_active: 1 + last_active: 5 + lat: 0.8008281904610115 + long: 6.027456183070403 + tags: + level: "10" + vip: "true" + amount_spent: 5.637376656633329 properties: - edge_web_push: - $ref: '#/components/schemas/DeliveryData' - chrome_web_push: - $ref: '#/components/schemas/DeliveryData' - firefox_web_push: - $ref: '#/components/schemas/DeliveryData' - safari_web_push: - $ref: '#/components/schemas/DeliveryData' - android: - $ref: '#/components/schemas/DeliveryData' - ios: - $ref: '#/components/schemas/DeliveryData' - sms: - allOf: - - $ref: '#/components/schemas/DeliveryData' - - $ref: '#/components/schemas/PlatformDeliveryData_sms_allOf' - email: - allOf: - - $ref: '#/components/schemas/DeliveryData' - - $ref: '#/components/schemas/PlatformDeliveryData_email_allOf' + properties: + $ref: '#/components/schemas/PropertiesObject' + refresh_device_metadata: + default: false + type: boolean + deltas: + $ref: '#/components/schemas/PropertiesDeltas' type: object - DeliveryData: + CreateNotificationSuccessResponse: + example: + external_id: external_id + id: id + errors: "" properties: - successful: - description: "Number of messages delivered to push servers, mobile carriers,\ - \ or email service providers." - nullable: true - type: integer - failed: - description: Number of messages sent to unsubscribed devices. - nullable: true - type: integer - errored: - description: Number of errors reported. - nullable: true - type: integer - converted: - description: Number of messages that were clicked. - nullable: true - type: integer - received: - description: Number of devices that received the message. + id: + description: "Notification identifier when the request created a notification.\ + \ An empty string means no notification was created; read `errors` for\ + \ details (HTTP may still be 200). All OneSignal server SDKs expose message-sent\ + \ / message-not-sent narrowing helpers (named idiomatically per language\ + \ — e.g. `isMessageSent`, `is_message_sent`, `message_sent?`); prefer\ + \ them over comparing `id` directly." + type: string + external_id: + description: Optional correlation / idempotency-related value from the API + response. This is not the end-user External ID used for targeting recipients + (that lives under `include_aliases.external_id`). nullable: true - type: integer + type: string + errors: + description: "Polymorphic field: may be an array of human-readable strings\ + \ and/or an object (for example with `invalid_aliases`, `invalid_external_user_ids`,\ + \ or `invalid_player_ids`) depending on the API response; HTTP may still\ + \ be 200 with partial success. Typed SDKs model this loosely so both shapes\ + \ deserialize." type: object - Purchase: + GenericSuccessBoolResponse: example: - amount: "0.99" - iso: USD - count: 2 - sku: com.example.coins100 + success: true + properties: + success: + type: boolean + type: object + NotificationHistorySuccessResponse: + example: + success: true + destination_url: destination_url properties: - sku: - description: The unique identifier of the purchased item. - example: com.example.coins100 - type: string - amount: - description: "The amount, in USD, spent purchasing the item." - example: "0.99" - type: string - iso: - description: The 3-letter ISO 4217 currency code. Required for correct storage - and conversion of amount. - example: USD + success: + type: boolean + destination_url: type: string - count: - type: integer - required: - - amount - - iso - - sku type: object - OutcomeData: + CreateSegmentSuccessResponse: example: - aggregation: sum + success: true id: id - value: 0 properties: + success: + type: boolean id: + description: UUID of created segment type: string - value: - type: integer - aggregation: - enum: - - sum - - count - type: string - required: - - aggregation - - id - - value type: object - OutcomesData: - example: - outcomes: - - aggregation: sum - id: id - value: 0 - - aggregation: sum - id: id - value: 0 + CreateSegmentConflictResponse: properties: - outcomes: + success: + type: boolean + errors: items: - $ref: '#/components/schemas/OutcomeData' + type: string type: array type: object - Filter: + ExportSubscriptionsSuccessResponse: + example: + csv_file_url: csv_file_url properties: - field: - description: Required. Name of the field to use as the first operand in - the filter expression. - example: tag - type: string - key: - description: "If `field` is `tag`, this field is *required* to specify `key`\ - \ inside the tags." - example: level - type: string - value: - description: "Constant value to use as the second operand in the filter\ - \ expression. This value is *required* when the relation operator is a\ - \ binary operator. For `in_array` and `not_in_array` relations, provide\ - \ a comma-separated list of up to 20 values." - example: "10" - type: string - hours_ago: - description: "If `field` is session-related, this is *required* to specify\ - \ the number of hours before or after the user's session." - example: "24" - type: string - radius: - description: "If `field` is `location`, this will specify the radius in\ - \ meters from a provided location point. Use with `lat` and `long`." - type: number - lat: - description: "If `field` is `location`, this is *required* to specify the\ - \ user's latitude." - type: number - long: - description: "If `field` is `location`, this is *required* to specify the\ - \ user's longitude." - type: number - relation: - description: Required. Operator of a filter expression. - enum: - - '>' - - < - - = - - '!=' - - exists - - not_exists - - time_elapsed_gt - - time_elapsed_lt - - in_array - - not_in_array + csv_file_url: type: string type: object - Operator: + UpdateLiveActivitySuccessResponse: + example: + id: id properties: - operator: - description: "Strictly, this must be either `\"OR\"`, or `\"AND\"`. It\ - \ can be used to compose Filters as part of a Filters object." - enum: - - OR - - AND + id: type: string type: object - FilterExpression: - oneOf: - - $ref: '#/components/schemas/Filter' - - $ref: '#/components/schemas/Operator' - Segment: + StartLiveActivityRequest: example: - name: Inactive 30 days - id: d5d4d1a8-1c9e-42fb-b3f2-56d3a5a9a8b7 + excluded_segments: + - excluded_segments + - excluded_segments + stale_date: 0 + included_segments: + - included_segments + - included_segments filters: - null - null + priority: 6 + include_aliases: + key: + - include_aliases + - include_aliases + ios_relevance_score: 1.4658129805029452 + event_updates: "{}" + contents: + de: de + hi: hi + fi: fi + ru: ru + pt: pt + bg: bg + lt: lt + hr: hr + lv: lv + fr: fr + hu: hu + bs: bs + zh-Hans: zh-Hans + zh-Hant: zh-Hant + ka: ka + uk: uk + sk: sk + id: id + ca: ca + sr: sr + sv: sv + ko: ko + ms: ms + el: el + en: en + it: it + zh: zh + es: es + et: et + cs: cs + ar: ar + pa: pa + vi: vi + nb: nb + th: th + ja: ja + fa: fa + pl: pl + da: da + he: he + ro: ro + nl: nl + tr: tr + name: name + activity_id: activity_id + headings: + de: de + hi: hi + fi: fi + ru: ru + pt: pt + bg: bg + lt: lt + hr: hr + lv: lv + fr: fr + hu: hu + bs: bs + zh-Hans: zh-Hans + zh-Hant: zh-Hant + ka: ka + uk: uk + sk: sk + id: id + ca: ca + sr: sr + sv: sv + ko: ko + ms: ms + el: el + en: en + it: it + zh: zh + es: es + et: et + cs: cs + ar: ar + pa: pa + vi: vi + nb: nb + th: th + ja: ja + fa: fa + pl: pl + da: da + he: he + ro: ro + nl: nl + tr: tr + idempotency_key: idempotency_key + event_attributes: "{}" + include_subscription_ids: + - include_subscription_ids + - include_subscription_ids + event: start properties: - id: - description: "UUID of the segment. If left empty, it will be assigned automaticaly." - example: d5d4d1a8-1c9e-42fb-b3f2-56d3a5a9a8b7 - type: string name: - description: Name of the segment. You'll see this name on the Web UI. - example: Inactive 30 days + description: An internal name to assist with your campaign organization. + This does not get displayed in the message itself. + type: string + event: + default: start + enum: + - start + type: string + activity_id: + description: Set a unique activity_id to track and manage the Live Activity. + type: string + event_attributes: + description: Default/static data to initialize the Live Activity upon start. + type: object + event_updates: + description: Dynamic content used to update the running Live Activity at + start. Must match the ContentState interface defined in your app. + type: object + contents: + $ref: '#/components/schemas/LanguageStringMap' + headings: + $ref: '#/components/schemas/LanguageStringMap' + stale_date: + description: "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." + type: integer + priority: + description: "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." + type: integer + ios_relevance_score: + description: iOS 15+. A score to indicate how a notification should be displayed + when grouped. Use a float between 0-1. + nullable: true + type: number + idempotency_key: + description: "Correlation and idempotency key.\nA 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.\nThis 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.\n See Idempotent Notification Requests for more details\nwriteOnly:\ + \ true\n" + nullable: true type: string + include_aliases: + additionalProperties: + items: + type: string + type: array + description: "Target specific users by aliases assigned via API. An alias\ + \ can be an external_id, onesignal_id, or a custom alias.\nAccepts an\ + \ object where keys are alias labels and values are arrays of alias IDs\ + \ to include\nExample usage: { \"external_id\": [\"exId1\", \"extId2\"\ + ], \"internal_label\": [\"id1\", \"id2\"] }\nKeys must match API spellings\ + \ exactly (for example the label for External ID is the string `external_id`;\ + \ arbitrary keys such as camelCase variants are not aliases and may yield\ + \ no recipients).\nNot compatible with any other targeting parameters.\n\ + REQUIRED: REST API Key Authentication\nLimit of 2,000 entries per REST\ + \ API call\nNote: 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." + nullable: true + type: object + include_subscription_ids: + description: Specific subscription ids to target. Not compatible with other + targeting parameters. + items: + type: string + nullable: true + type: array + included_segments: + description: Segment names to include. Only compatible with excluded_segments. + items: + type: string + nullable: true + type: array + excluded_segments: + description: Segment names to exclude. Only compatible with included_segments. + items: + type: string + nullable: true + type: array filters: - description: "Filter or operators the segment will have. For a list of\ - \ available filters with details, please see Send to Users Based on Filters." items: $ref: '#/components/schemas/FilterExpression' + nullable: true type: array required: - - filters + - activity_id + - contents + - event + - event_attributes + - event_updates + - headings - name type: object - SegmentData: + StartLiveActivitySuccessResponse: example: - is_active: true - updated_at: updated_at - read_only: true + notification_id: notification_id + properties: + notification_id: + type: string + type: object + IncludeAliases: + additionalProperties: + items: + type: string + type: array + description: "Target specific users by aliases assigned via API. An alias can\ + \ be an external_id, onesignal_id, or a custom alias.\nAccepts an object where\ + \ keys are alias labels and values are arrays of alias IDs to include\nExample\ + \ usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"\ + id1\", \"id2\"] }\nKeys must match API spellings exactly (for example the\ + \ label for External ID is the string `external_id`; arbitrary keys such as\ + \ camelCase variants are not aliases and may yield no recipients).\nNot compatible\ + \ with any other targeting parameters.\nREQUIRED: REST API Key Authentication\n\ + Limit of 2,000 entries per REST API call\nNote: 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." + nullable: true + type: object + CreateTemplateRequest: + example: + isSMS: true + email_body: email_body + contents: + de: de + hi: hi + fi: fi + ru: ru + pt: pt + bg: bg + lt: lt + hr: hr + lv: lv + fr: fr + hu: hu + bs: bs + zh-Hans: zh-Hans + zh-Hant: zh-Hant + ka: ka + uk: uk + sk: sk + id: id + ca: ca + sr: sr + sv: sv + ko: ko + ms: ms + el: el + en: en + it: it + zh: zh + es: es + et: et + cs: cs + ar: ar + pa: pa + vi: vi + nb: nb + th: th + ja: ja + fa: fa + pl: pl + da: da + he: he + ro: ro + nl: nl + tr: tr + subtitle: + de: de + hi: hi + fi: fi + ru: ru + pt: pt + bg: bg + lt: lt + hr: hr + lv: lv + fr: fr + hu: hu + bs: bs + zh-Hans: zh-Hans + zh-Hant: zh-Hant + ka: ka + uk: uk + sk: sk + id: id + ca: ca + sr: sr + sv: sv + ko: ko + ms: ms + el: el + en: en + it: it + zh: zh + es: es + et: et + cs: cs + ar: ar + pa: pa + vi: vi + nb: nb + th: th + ja: ja + fa: fa + pl: pl + da: da + he: he + ro: ro + nl: nl + tr: tr name: name - created_at: created_at - id: id + isEmail: true + email_bcc: + - email_bcc + - email_bcc + - email_bcc + - email_bcc + - email_bcc + headings: + de: de + hi: hi + fi: fi + ru: ru + pt: pt + bg: bg + lt: lt + hr: hr + lv: lv + fr: fr + hu: hu + bs: bs + zh-Hans: zh-Hans + zh-Hant: zh-Hant + ka: ka + uk: uk + sk: sk + id: id + ca: ca + sr: sr + sv: sv + ko: ko + ms: ms + el: el + en: en + it: it + zh: zh + es: es + et: et + cs: cs + ar: ar + pa: pa + vi: vi + nb: nb + th: th + ja: ja + fa: fa + pl: pl + da: da + he: he + ro: ro + nl: nl + tr: tr + dynamic_content: dynamic_content app_id: app_id + email_subject: email_subject properties: - id: - description: The segment ID - type: string - name: - description: The segment name - type: string - created_at: - description: Date segment created - type: string - updated_at: - description: Date segment last updated - type: string app_id: - description: The app id - type: string - read_only: - description: Is the segment read only? - type: boolean - is_active: - description: Is the segment active? - type: boolean - type: object - GetSegmentsSuccessResponse: - example: - offset: 6 - total_count: 0 - limit: 1 - segments: - - is_active: true - updated_at: updated_at - read_only: true - name: name - created_at: created_at - id: id - app_id: app_id - - is_active: true - updated_at: updated_at - read_only: true - name: name - created_at: created_at - id: id - app_id: app_id - properties: - total_count: - description: The number of Segments in the response. - type: integer - offset: - description: Set with the offset query parameter. Default 0. - type: integer - limit: - description: Maximum number of Segments returned. Default 300. - type: integer - segments: - description: An array containing the Segment information. - items: - $ref: '#/components/schemas/SegmentData' - type: array - type: object - SegmentDetails: - description: Segment details. Only included when the include-segment-detail - query parameter is set to true. - example: - name: name - description: description - created_at: 6 - id: id - source: default - filters: - - null - - null - properties: - id: - description: The unique identifier for the segment (UUID v4). + description: Your OneSignal App ID in UUID v4 format. type: string name: - description: The segment name. + description: Name of the template. type: string - description: - description: Human-readable description for the segment. `null` when unset. - Maximum 255 characters. + contents: + $ref: '#/components/schemas/LanguageStringMap' + headings: + $ref: '#/components/schemas/LanguageStringMap' + subtitle: + $ref: '#/components/schemas/LanguageStringMap' + isEmail: + description: Set true for an Email template. + type: boolean + email_subject: + description: Subject of the email. nullable: true type: string - created_at: - description: Unix timestamp when the segment was created. - type: integer - source: - description: The source of the segment. - enum: - - default - - custom - - quickstart + email_body: + description: Body of the email (HTML supported). + nullable: true type: string - filters: - description: "Array of filter and operator objects defining the segment\ - \ criteria. Uses the same format as the Create Segment API, so filters\ - \ can be directly used to recreate or update the segment." + email_bcc: + description: BCC recipients for the email template. Maximum 5 addresses. + Only supported when the email service provider is OneSignal Email. items: - $ref: '#/components/schemas/FilterExpression' + type: string + maxItems: 5 + nullable: true type: array - type: object - GetSegmentSuccessResponse: - example: - payload: - name: name - description: description - created_at: 6 - id: id - source: default - filters: - - null - - null - subscriber_count: 0 - properties: - subscriber_count: - description: The number of subscribers matching this segment. - type: integer - payload: - $ref: '#/components/schemas/SegmentDetails' - type: object - UpdateSegmentRequest: - example: - name: name - description: description - filters: - - null - - null - properties: - name: - description: Required. The segment name. Maximum 128 characters. - maxLength: 128 - type: string - description: - description: Optional human-readable description for the segment. Maximum - 255 characters. Pass an empty string to clear; omit to leave unchanged. - maxLength: 255 + isSMS: + description: Set true for an SMS template. + type: boolean + dynamic_content: + description: JSON string for dynamic content personalization. + nullable: true type: string - filters: - description: "Optional. When provided, replaces all existing filters. Filters\ - \ define the segment based on user properties like tags, activity, or\ - \ location using flexible AND/OR logic. Limited to 200 total entries,\ - \ including fields and OR operators." - items: - $ref: '#/components/schemas/FilterExpression' - type: array required: + - app_id + - contents - name type: object - UpdateSegmentSuccessResponse: - example: - success: true - id: id - properties: - success: - description: "true if the segment was updated successfully, false otherwise." - type: boolean - id: - description: UUID of the updated segment. - type: string - type: object - UpdateLiveActivityRequest: + UpdateTemplateRequest: example: - event_updates: "{}" - stale_date: 0 + isSMS: true + email_body: email_body contents: de: de hi: hi @@ -4041,8 +5473,58 @@ components: ro: ro nl: nl tr: tr - sound: sound + subtitle: + de: de + hi: hi + fi: fi + ru: ru + pt: pt + bg: bg + lt: lt + hr: hr + lv: lv + fr: fr + hu: hu + bs: bs + zh-Hans: zh-Hans + zh-Hant: zh-Hant + ka: ka + uk: uk + sk: sk + id: id + ca: ca + sr: sr + sv: sv + ko: ko + ms: ms + el: el + en: en + it: it + zh: zh + es: es + et: et + cs: cs + ar: ar + pa: pa + vi: vi + nb: nb + th: th + ja: ja + fa: fa + pl: pl + da: da + he: he + ro: ro + nl: nl + tr: tr name: name + isEmail: true + email_bcc: + - email_bcc + - email_bcc + - email_bcc + - email_bcc + - email_bcc headings: de: de hi: hi @@ -4087,262 +5569,135 @@ components: ro: ro nl: nl tr: tr - dismissal_date: 6 - event: update - priority: 1 + dynamic_content: dynamic_content + email_subject: email_subject properties: name: - description: An internal name to assist with your campaign organization. - This does not get displayed in the message itself. - type: string - event: - enum: - - update - - end - type: string - event_updates: - description: This must match the ContentState interface you have defined - within your Live Activity in your app. - type: object + description: Updated name of the template. + type: string contents: $ref: '#/components/schemas/LanguageStringMap' headings: $ref: '#/components/schemas/LanguageStringMap' - sound: - description: Sound file that is included in your app to play instead of - the default device notification sound. Omit to disable vibration and sound - for the notification. + subtitle: + $ref: '#/components/schemas/LanguageStringMap' + isEmail: + description: Set true for an Email template. + type: boolean + email_subject: + description: Subject of the email. + nullable: true + type: string + email_body: + description: Body of the email (HTML supported). + nullable: true + type: string + email_bcc: + description: BCC recipients for the email template. Maximum 5 addresses. + Only supported when the email service provider is OneSignal Email. + items: + type: string + maxItems: 5 + nullable: true + type: array + isSMS: + description: Set true for an SMS template. + type: boolean + dynamic_content: + description: JSON string for dynamic content personalization. + nullable: true type: string - stale_date: - description: "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." - type: integer - dismissal_date: - description: Accepts Unix timestamp in seconds; only allowed if event is - "end" - type: integer - priority: - description: "Delivery priority through the 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. Some providers\ - \ (APNs) allow for a limited budget of high priority notifications per\ - \ hour, and if that budget is exceeded, the provider may throttle notification\ - \ delivery." - type: integer - required: - - event - - event_updates - - name - type: object - IdentityObject: - additionalProperties: - type: string - example: - external_id: YOUR_USER_EXTERNAL_ID type: object - PropertiesObject: + TemplateResource: example: - country: US - purchases: - - amount: "0.99" - iso: USD - count: 2 - sku: com.example.coins100 - - amount: "0.99" - iso: USD - count: 2 - sku: com.example.coins100 - ip: 203.0.113.10 - timezone_id: America/Los_Angeles - language: en - first_active: 1 - last_active: 5 - lat: 0.8008281904610115 - long: 6.027456183070403 - tags: - level: "10" - vip: "true" - amount_spent: 5.637376656633329 + updated_at: 2000-01-23T04:56:07.000+00:00 + name: name + channel: push + created_at: 2000-01-23T04:56:07.000+00:00 + id: id + content: + key: "" properties: - tags: - additionalProperties: true - example: - level: "10" - vip: "true" - type: object - language: - example: en + id: type: string - timezone_id: - example: America/Los_Angeles + name: type: string - lat: - type: number - long: - type: number - country: - example: US + created_at: + format: date-time type: string - first_active: - type: integer - last_active: - type: integer - amount_spent: - type: number - purchases: - items: - $ref: '#/components/schemas/Purchase' - type: array - ip: - example: 203.0.113.10 + updated_at: + format: date-time + type: string + channel: + enum: + - push + - email + - sms + nullable: true type: string + content: + additionalProperties: true + description: Rendered content and channel/platform flags for the template. + type: object type: object - PropertiesDeltas: + TemplatesListResponse: example: - purchases: - - amount: "0.99" - iso: USD - count: 2 - sku: com.example.coins100 - - amount: "0.99" - iso: USD - count: 2 - sku: com.example.coins100 - session_count: 6 - session_time: 0 + templates: + - updated_at: 2000-01-23T04:56:07.000+00:00 + name: name + channel: push + created_at: 2000-01-23T04:56:07.000+00:00 + id: id + content: + key: "" + - updated_at: 2000-01-23T04:56:07.000+00:00 + name: name + channel: push + created_at: 2000-01-23T04:56:07.000+00:00 + id: id + content: + key: "" properties: - session_time: - type: integer - session_count: - type: integer - purchases: + templates: items: - $ref: '#/components/schemas/Purchase' + $ref: '#/components/schemas/TemplateResource' type: array type: object - Subscription: + CopyTemplateRequest: example: - notification_types: 1 - device_model: "iPhone14,2" - app_version: 1.0.0 - web_p256: BM5-r8DauQXOb2E-3PgLPjSvjT0Ao9v5oJhw8bZ0cW7Vh6BbmPYcqbbCEJ1P2sK0hZ7HxSh9zGyU5pQk1jJmZ8A - net_type: 9 - type: iOSPush - device_os: "17.1" - enabled: true - session_time: 60 - test_type: 7 - token: d5d4d1a8-1c9e-42fb-b3f2-56d3a5a9a8b7 - carrier: Verizon - session_count: 1 - web_auth: 5DUmpGmLuTxWCLj5lJpwLQ - rooted: true - id: e4e87830-b954-4363-b7bc-1f01dbaee5c8 - sdk: 5.2.0 + target_app_id: target_app_id properties: - id: - example: e4e87830-b954-4363-b7bc-1f01dbaee5c8 - type: string - type: - enum: - - iOSPush - - AndroidPush - - FireOSPush - - ChromeExtensionPush - - ChromePush - - WindowsPush - - SafariLegacyPush - - FirefoxPush - - macOSPush - - HuaweiPush - - SafariPush - - Email - - SMS - type: string - token: - example: d5d4d1a8-1c9e-42fb-b3f2-56d3a5a9a8b7 - type: string - enabled: - example: true - type: boolean - notification_types: - example: 1 - type: integer - session_time: - example: 60 - type: integer - session_count: - example: 1 - type: integer - sdk: - example: 5.2.0 - type: string - device_model: - example: "iPhone14,2" - type: string - device_os: - example: "17.1" - type: string - rooted: - type: boolean - test_type: - type: integer - app_version: - example: 1.0.0 - type: string - net_type: - type: integer - carrier: - example: Verizon - type: string - web_auth: - example: 5DUmpGmLuTxWCLj5lJpwLQ + target_app_id: + description: Destination OneSignal App ID in UUID v4 format. type: string - web_p256: - example: BM5-r8DauQXOb2E-3PgLPjSvjT0Ao9v5oJhw8bZ0cW7Vh6BbmPYcqbbCEJ1P2sK0hZ7HxSh9zGyU5pQk1jJmZ8A + required: + - target_app_id + type: object + CreateUserConflictResponse: + properties: + errors: + items: + $ref: '#/components/schemas/CreateUserConflictResponse_errors_inner' + type: array + type: object + GenericError: + properties: + errors: {} + success: + type: boolean + reference: {} + type: object + RateLimitError: + properties: + errors: + items: + type: string + type: array + limit: type: string type: object - User: + PropertiesBody: example: - subscriptions: - - notification_types: 1 - device_model: "iPhone14,2" - app_version: 1.0.0 - web_p256: BM5-r8DauQXOb2E-3PgLPjSvjT0Ao9v5oJhw8bZ0cW7Vh6BbmPYcqbbCEJ1P2sK0hZ7HxSh9zGyU5pQk1jJmZ8A - net_type: 9 - type: iOSPush - device_os: "17.1" - enabled: true - session_time: 60 - test_type: 7 - token: d5d4d1a8-1c9e-42fb-b3f2-56d3a5a9a8b7 - carrier: Verizon - session_count: 1 - web_auth: 5DUmpGmLuTxWCLj5lJpwLQ - rooted: true - id: e4e87830-b954-4363-b7bc-1f01dbaee5c8 - sdk: 5.2.0 - - notification_types: 1 - device_model: "iPhone14,2" - app_version: 1.0.0 - web_p256: BM5-r8DauQXOb2E-3PgLPjSvjT0Ao9v5oJhw8bZ0cW7Vh6BbmPYcqbbCEJ1P2sK0hZ7HxSh9zGyU5pQk1jJmZ8A - net_type: 9 - type: iOSPush - device_os: "17.1" - enabled: true - session_time: 60 - test_type: 7 - token: d5d4d1a8-1c9e-42fb-b3f2-56d3a5a9a8b7 - carrier: Verizon - session_count: 1 - web_auth: 5DUmpGmLuTxWCLj5lJpwLQ - rooted: true - id: e4e87830-b954-4363-b7bc-1f01dbaee5c8 - sdk: 5.2.0 - identity: - external_id: YOUR_USER_EXTERNAL_ID properties: country: US purchases: @@ -4368,1302 +5723,2261 @@ components: properties: properties: $ref: '#/components/schemas/PropertiesObject' + type: object + SubscriptionBody: + example: + subscription: + notification_types: 1 + device_model: "iPhone14,2" + app_version: 1.0.0 + web_p256: BM5-r8DauQXOb2E-3PgLPjSvjT0Ao9v5oJhw8bZ0cW7Vh6BbmPYcqbbCEJ1P2sK0hZ7HxSh9zGyU5pQk1jJmZ8A + net_type: 9 + type: iOSPush + device_os: "17.1" + enabled: true + session_time: 60 + test_type: 7 + token: d5d4d1a8-1c9e-42fb-b3f2-56d3a5a9a8b7 + carrier: Verizon + session_count: 1 + web_auth: 5DUmpGmLuTxWCLj5lJpwLQ + rooted: true + id: e4e87830-b954-4363-b7bc-1f01dbaee5c8 + sdk: 5.2.0 + properties: + subscription: + $ref: '#/components/schemas/Subscription' + type: object + TransferSubscriptionRequestBody: + example: + identity: + key: identity + properties: + identity: + additionalProperties: + type: string + maxProperties: 1 + minProperties: 1 + type: object + type: object + UserIdentityBody: + example: + identity: + external_id: YOUR_USER_EXTERNAL_ID + properties: identity: additionalProperties: type: string example: external_id: YOUR_USER_EXTERNAL_ID type: object - subscriptions: - items: - $ref: '#/components/schemas/Subscription' - type: array type: object - UpdateUserRequest: + ExportEventsSuccessResponse: example: - refresh_device_metadata: false - deltas: - purchases: - - amount: "0.99" - iso: USD - count: 2 - sku: com.example.coins100 - - amount: "0.99" - iso: USD - count: 2 - sku: com.example.coins100 - session_count: 6 - session_time: 0 - properties: - country: US - purchases: - - amount: "0.99" - iso: USD - count: 2 - sku: com.example.coins100 - - amount: "0.99" - iso: USD - count: 2 - sku: com.example.coins100 - ip: 203.0.113.10 - timezone_id: America/Los_Angeles - language: en - first_active: 1 - last_active: 5 - lat: 0.8008281904610115 - long: 6.027456183070403 - tags: - level: "10" - vip: "true" - amount_spent: 5.637376656633329 + csv_file_url: csv_file_url properties: - properties: - $ref: '#/components/schemas/PropertiesObject' - refresh_device_metadata: - default: false - type: boolean - deltas: - $ref: '#/components/schemas/PropertiesDeltas' + csv_file_url: + type: string type: object - CreateNotificationSuccessResponse: + CustomEvent: example: + onesignal_id: onesignal_id + payload: + key: "" + name: name external_id: external_id - id: id - errors: "" + timestamp: 2000-01-23T04:56:07.000+00:00 properties: - id: - description: "Notification identifier when the request created a notification.\ - \ An empty string means no notification was created; read `errors` for\ - \ details (HTTP may still be 200). All OneSignal server SDKs expose message-sent\ - \ / message-not-sent narrowing helpers (named idiomatically per language\ - \ — e.g. `isMessageSent`, `is_message_sent`, `message_sent?`); prefer\ - \ them over comparing `id` directly." + name: + description: The identifier or name of the event. Maximum 128 characters. type: string external_id: - description: Optional correlation / idempotency-related value from the API - response. This is not the end-user External ID used for targeting recipients - (that lives under `include_aliases.external_id`). + description: The external ID of the user targeted for the event. Either + the user's External ID or OneSignal ID is required. nullable: true type: string - errors: - description: "Polymorphic field: may be an array of human-readable strings\ - \ and/or an object (for example with `invalid_aliases`, `invalid_external_user_ids`,\ - \ or `invalid_player_ids`) depending on the API response; HTTP may still\ - \ be 200 with partial success. Typed SDKs model this loosely so both shapes\ - \ deserialize." + onesignal_id: + description: The OneSignal ID of the user targeted for the event. Either + the user's External ID or OneSignal ID is required. + nullable: true + type: string + timestamp: + description: Time the event occurred as an ISO8601 formatted string. Defaults + to now if not included or past date provided. + format: date-time + type: string + payload: + additionalProperties: true + description: "Properties or data related to the event, like {\"geography\"\ + : \"USA\"}" + type: object + required: + - name type: object - GenericSuccessBoolResponse: + CustomEventsRequest: example: - success: true + events: + - onesignal_id: onesignal_id + payload: + key: "" + name: name + external_id: external_id + timestamp: 2000-01-23T04:56:07.000+00:00 + - onesignal_id: onesignal_id + payload: + key: "" + name: name + external_id: external_id + timestamp: 2000-01-23T04:56:07.000+00:00 properties: - success: - type: boolean + events: + items: + $ref: '#/components/schemas/CustomEvent' + type: array + required: + - events type: object - NotificationHistorySuccessResponse: - example: - success: true - destination_url: destination_url - properties: - success: - type: boolean - destination_url: - type: string + CustomEventsResponse: type: object - CreateSegmentSuccessResponse: + ApiKeyToken: example: - success: true - id: id + token_id: token_id + updated_at: updated_at + name: name + created_at: created_at + ip_allowlist_mode: disabled + ip_allowlist: + - ip_allowlist + - ip_allowlist properties: - success: - type: boolean - id: - description: UUID of created segment + token_id: + type: string + updated_at: + type: string + created_at: + type: string + name: type: string - type: object - CreateSegmentConflictResponse: - properties: - success: - type: boolean - errors: + ip_allowlist_mode: + enum: + - disabled + - explicit + type: string + ip_allowlist: items: type: string type: array type: object - ExportSubscriptionsSuccessResponse: - example: - csv_file_url: csv_file_url - properties: - csv_file_url: - type: string - type: object - UpdateLiveActivitySuccessResponse: + ApiKeyTokensListResponse: example: - id: id + tokens: + - token_id: token_id + updated_at: updated_at + name: name + created_at: created_at + ip_allowlist_mode: disabled + ip_allowlist: + - ip_allowlist + - ip_allowlist + - token_id: token_id + updated_at: updated_at + name: name + created_at: created_at + ip_allowlist_mode: disabled + ip_allowlist: + - ip_allowlist + - ip_allowlist properties: - id: - type: string + tokens: + items: + $ref: '#/components/schemas/ApiKeyToken' + type: array type: object - StartLiveActivityRequest: + CreateApiKeyRequest: example: - excluded_segments: - - excluded_segments - - excluded_segments - stale_date: 0 - included_segments: - - included_segments - - included_segments - filters: - - null - - null - priority: 6 - include_aliases: - key: - - include_aliases - - include_aliases - ios_relevance_score: 1.4658129805029452 - event_updates: "{}" - contents: - de: de - hi: hi - fi: fi - ru: ru - pt: pt - bg: bg - lt: lt - hr: hr - lv: lv - fr: fr - hu: hu - bs: bs - zh-Hans: zh-Hans - zh-Hant: zh-Hant - ka: ka - uk: uk - sk: sk - id: id - ca: ca - sr: sr - sv: sv - ko: ko - ms: ms - el: el - en: en - it: it - zh: zh - es: es - et: et - cs: cs - ar: ar - pa: pa - vi: vi - nb: nb - th: th - ja: ja - fa: fa - pl: pl - da: da - he: he - ro: ro - nl: nl - tr: tr name: name - activity_id: activity_id - headings: - de: de - hi: hi - fi: fi - ru: ru - pt: pt - bg: bg - lt: lt - hr: hr - lv: lv - fr: fr - hu: hu - bs: bs - zh-Hans: zh-Hans - zh-Hant: zh-Hant - ka: ka - uk: uk - sk: sk - id: id - ca: ca - sr: sr - sv: sv - ko: ko - ms: ms - el: el - en: en - it: it - zh: zh - es: es - et: et - cs: cs - ar: ar - pa: pa - vi: vi - nb: nb - th: th - ja: ja - fa: fa - pl: pl - da: da - he: he - ro: ro - nl: nl - tr: tr - idempotency_key: idempotency_key - event_attributes: "{}" - include_subscription_ids: - - include_subscription_ids - - include_subscription_ids - event: start + ip_allowlist_mode: disabled + ip_allowlist: + - ip_allowlist + - ip_allowlist properties: name: - description: An internal name to assist with your campaign organization. - This does not get displayed in the message itself. type: string - event: - default: start + ip_allowlist_mode: enum: - - start - type: string - activity_id: - description: Set a unique activity_id to track and manage the Live Activity. - type: string - event_attributes: - description: Default/static data to initialize the Live Activity upon start. - type: object - event_updates: - description: Dynamic content used to update the running Live Activity at - start. Must match the ContentState interface defined in your app. - type: object - contents: - $ref: '#/components/schemas/LanguageStringMap' - headings: - $ref: '#/components/schemas/LanguageStringMap' - stale_date: - description: "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." - type: integer - priority: - description: "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." - type: integer - ios_relevance_score: - description: iOS 15+. A score to indicate how a notification should be displayed - when grouped. Use a float between 0-1. - nullable: true - type: number - idempotency_key: - description: "Correlation and idempotency key.\nA 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.\nThis 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.\n See Idempotent Notification Requests for more details\nwriteOnly:\ - \ true\n" - nullable: true + - disabled + - explicit type: string - include_aliases: - additionalProperties: - items: - type: string - type: array - description: "Target specific users by aliases assigned via API. An alias\ - \ can be an external_id, onesignal_id, or a custom alias.\nAccepts an\ - \ object where keys are alias labels and values are arrays of alias IDs\ - \ to include\nExample usage: { \"external_id\": [\"exId1\", \"extId2\"\ - ], \"internal_label\": [\"id1\", \"id2\"] }\nKeys must match API spellings\ - \ exactly (for example the label for External ID is the string `external_id`;\ - \ arbitrary keys such as camelCase variants are not aliases and may yield\ - \ no recipients).\nNot compatible with any other targeting parameters.\n\ - REQUIRED: REST API Key Authentication\nLimit of 2,000 entries per REST\ - \ API call\nNote: 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." - nullable: true - type: object - include_subscription_ids: - description: Specific subscription ids to target. Not compatible with other - targeting parameters. - items: - type: string - nullable: true - type: array - included_segments: - description: Segment names to include. Only compatible with excluded_segments. + ip_allowlist: items: type: string - nullable: true type: array - excluded_segments: - description: Segment names to exclude. Only compatible with included_segments. + type: object + CreateApiKeyResponse: + example: + token_id: token_id + formatted_token: formatted_token + properties: + token_id: + type: string + formatted_token: + type: string + type: object + UpdateApiKeyRequest: + example: + name: name + ip_allowlist_mode: disabled + ip_allowlist: + - ip_allowlist + - ip_allowlist + properties: + name: + type: string + ip_allowlist_mode: + enum: + - disabled + - explicit + type: string + ip_allowlist: items: type: string - nullable: true - type: array - filters: - items: - $ref: '#/components/schemas/FilterExpression' - nullable: true type: array - required: - - activity_id - - contents - - event - - event_attributes - - event_updates - - headings - - name type: object - StartLiveActivitySuccessResponse: + AuditLogActor: + description: The user or service that performed the action. Absent if the actor + is unknown. example: - notification_id: notification_id + metadata: "{}" + name: name + id: id + type: type + email: email properties: - notification_id: + email: + description: Email address of the actor. Absent if unavailable. type: string - type: object - IncludeAliases: - additionalProperties: - items: + id: + description: UUID of the actor. + type: string + metadata: + description: Additional actor-specific data. + type: object + name: + description: Display name of the actor. Absent if unavailable. + type: string + type: + description: "Actor type (e.g. member, api_key, system)." type: string - type: array - description: "Target specific users by aliases assigned via API. An alias can\ - \ be an external_id, onesignal_id, or a custom alias.\nAccepts an object where\ - \ keys are alias labels and values are arrays of alias IDs to include\nExample\ - \ usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"\ - id1\", \"id2\"] }\nKeys must match API spellings exactly (for example the\ - \ label for External ID is the string `external_id`; arbitrary keys such as\ - \ camelCase variants are not aliases and may yield no recipients).\nNot compatible\ - \ with any other targeting parameters.\nREQUIRED: REST API Key Authentication\n\ - Limit of 2,000 entries per REST API call\nNote: 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." - nullable: true type: object - CreateTemplateRequest: + AuditLogTarget: + description: A resource the action was performed on. example: - isSMS: true - email_body: email_body - contents: - de: de - hi: hi - fi: fi - ru: ru - pt: pt - bg: bg - lt: lt - hr: hr - lv: lv - fr: fr - hu: hu - bs: bs - zh-Hans: zh-Hans - zh-Hant: zh-Hant - ka: ka - uk: uk - sk: sk - id: id - ca: ca - sr: sr - sv: sv - ko: ko - ms: ms - el: el - en: en - it: it - zh: zh - es: es - et: et - cs: cs - ar: ar - pa: pa - vi: vi - nb: nb - th: th - ja: ja - fa: fa - pl: pl - da: da - he: he - ro: ro - nl: nl - tr: tr - subtitle: - de: de - hi: hi - fi: fi - ru: ru - pt: pt - bg: bg - lt: lt - hr: hr - lv: lv - fr: fr - hu: hu - bs: bs - zh-Hans: zh-Hans - zh-Hant: zh-Hant - ka: ka - uk: uk - sk: sk - id: id - ca: ca - sr: sr - sv: sv - ko: ko - ms: ms - el: el - en: en - it: it - zh: zh - es: es - et: et - cs: cs - ar: ar - pa: pa - vi: vi - nb: nb - th: th - ja: ja - fa: fa - pl: pl - da: da - he: he - ro: ro - nl: nl - tr: tr + metadata: "{}" name: name - isEmail: true - email_bcc: - - email_bcc - - email_bcc - - email_bcc - - email_bcc - - email_bcc - headings: - de: de - hi: hi - fi: fi - ru: ru - pt: pt - bg: bg - lt: lt - hr: hr - lv: lv - fr: fr - hu: hu - bs: bs - zh-Hans: zh-Hans - zh-Hant: zh-Hant - ka: ka - uk: uk - sk: sk - id: id - ca: ca - sr: sr - sv: sv - ko: ko - ms: ms - el: el - en: en - it: it - zh: zh - es: es - et: et - cs: cs - ar: ar - pa: pa - vi: vi - nb: nb - th: th - ja: ja - fa: fa - pl: pl - da: da - he: he - ro: ro - nl: nl - tr: tr - dynamic_content: dynamic_content + id: id + type: type + properties: + id: + description: UUID of the resource. + type: string + metadata: + description: Additional resource-specific data. + type: object + name: + description: Display name of the resource. Absent if unavailable. + type: string + type: + description: "Resource type (e.g. notification, segment, journey, app)." + type: string + type: object + AuditLogContext: + description: Request context at the time of the event. Absent if context was + not captured. + example: + country: country + metadata: "{}" + ip: ip + user_agent: user_agent + properties: + country: + description: Country code derived from the request IP. + type: string + ip: + description: IP address the request originated from. + type: string + metadata: + description: Additional context-specific data. + type: object + user_agent: + description: User agent of the client that made the request. + type: string + type: object + AuditLogEvent: + example: + actor: + metadata: "{}" + name: name + id: id + type: type + email: email + occurred_at: occurred_at + metadata: "{}" + organization_id: organization_id + context: + country: country + metadata: "{}" + ip: ip + user_agent: user_agent + action: action + id: id app_id: app_id - email_subject: email_subject + targets: + - metadata: "{}" + name: name + id: id + type: type + - metadata: "{}" + name: name + id: id + type: type + version: 0 properties: + action: + description: "The action that was performed (e.g. notification.sent, segment.created,\ + \ member.invited)." + type: string + actor: + $ref: '#/components/schemas/AuditLogActor' app_id: - description: Your OneSignal App ID in UUID v4 format. + description: UUID of the app the event is associated with. Absent for org-level + events. type: string - name: - description: Name of the template. + context: + $ref: '#/components/schemas/AuditLogContext' + id: + description: UUID of the audit log event. type: string - contents: - $ref: '#/components/schemas/LanguageStringMap' - headings: - $ref: '#/components/schemas/LanguageStringMap' - subtitle: - $ref: '#/components/schemas/LanguageStringMap' - isEmail: - description: Set true for an Email template. - type: boolean - email_subject: - description: Subject of the email. - nullable: true + metadata: + description: Additional event-specific data that does not fit into the standard + fields. + type: object + occurred_at: + description: RFC 3339 timestamp of when the event occurred (e.g. 2026-02-18T12:34:56Z). type: string - email_body: - description: Body of the email (HTML supported). - nullable: true + organization_id: + description: UUID of the organization the event belongs to. type: string - email_bcc: - description: BCC recipients for the email template. Maximum 5 addresses. - Only supported when the email service provider is OneSignal Email. + targets: + description: The resources the action was performed on. May be empty for + org-level events. items: - type: string - maxItems: 5 - nullable: true + $ref: '#/components/schemas/AuditLogTarget' type: array - isSMS: - description: Set true for an SMS template. - type: boolean - dynamic_content: - description: JSON string for dynamic content personalization. - nullable: true - type: string - required: - - app_id - - contents - - name + version: + description: Schema version of the event payload. + type: integer type: object - UpdateTemplateRequest: + ListAuditLogsSuccessResponse: example: - isSMS: true - email_body: email_body - contents: - de: de - hi: hi - fi: fi - ru: ru - pt: pt - bg: bg - lt: lt - hr: hr - lv: lv - fr: fr - hu: hu - bs: bs - zh-Hans: zh-Hans - zh-Hant: zh-Hant - ka: ka - uk: uk - sk: sk - id: id - ca: ca - sr: sr - sv: sv - ko: ko - ms: ms - el: el - en: en - it: it - zh: zh - es: es - et: et - cs: cs - ar: ar - pa: pa - vi: vi - nb: nb - th: th - ja: ja - fa: fa - pl: pl - da: da - he: he - ro: ro - nl: nl - tr: tr - subtitle: - de: de - hi: hi - fi: fi - ru: ru - pt: pt - bg: bg - lt: lt - hr: hr - lv: lv - fr: fr - hu: hu - bs: bs - zh-Hans: zh-Hans - zh-Hant: zh-Hant - ka: ka - uk: uk - sk: sk - id: id - ca: ca - sr: sr - sv: sv - ko: ko - ms: ms - el: el - en: en - it: it - zh: zh - es: es - et: et - cs: cs - ar: ar - pa: pa - vi: vi - nb: nb - th: th - ja: ja - fa: fa - pl: pl - da: da - he: he - ro: ro - nl: nl - tr: tr - name: name - isEmail: true - email_bcc: - - email_bcc - - email_bcc - - email_bcc - - email_bcc - - email_bcc - headings: - de: de - hi: hi - fi: fi - ru: ru - pt: pt - bg: bg - lt: lt - hr: hr - lv: lv - fr: fr - hu: hu - bs: bs - zh-Hans: zh-Hans - zh-Hant: zh-Hant - ka: ka - uk: uk - sk: sk + next_cursor: next_cursor + has_more: true + audit_logs: + - actor: + metadata: "{}" + name: name + id: id + type: type + email: email + occurred_at: occurred_at + metadata: "{}" + organization_id: organization_id + context: + country: country + metadata: "{}" + ip: ip + user_agent: user_agent + action: action id: id - ca: ca - sr: sr - sv: sv - ko: ko - ms: ms - el: el - en: en - it: it - zh: zh - es: es - et: et - cs: cs - ar: ar - pa: pa - vi: vi - nb: nb - th: th - ja: ja - fa: fa - pl: pl - da: da - he: he - ro: ro - nl: nl - tr: tr - dynamic_content: dynamic_content - email_subject: email_subject + app_id: app_id + targets: + - metadata: "{}" + name: name + id: id + type: type + - metadata: "{}" + name: name + id: id + type: type + version: 0 + - actor: + metadata: "{}" + name: name + id: id + type: type + email: email + occurred_at: occurred_at + metadata: "{}" + organization_id: organization_id + context: + country: country + metadata: "{}" + ip: ip + user_agent: user_agent + action: action + id: id + app_id: app_id + targets: + - metadata: "{}" + name: name + id: id + type: type + - metadata: "{}" + name: name + id: id + type: type + version: 0 properties: - name: - description: Updated name of the template. - type: string - contents: - $ref: '#/components/schemas/LanguageStringMap' - headings: - $ref: '#/components/schemas/LanguageStringMap' - subtitle: - $ref: '#/components/schemas/LanguageStringMap' - isEmail: - description: Set true for an Email template. - type: boolean - email_subject: - description: Subject of the email. - nullable: true - type: string - email_body: - description: Body of the email (HTML supported). - nullable: true - type: string - email_bcc: - description: BCC recipients for the email template. Maximum 5 addresses. - Only supported when the email service provider is OneSignal Email. + audit_logs: + description: "Array of audit log events, ordered by occurred_at ascending." items: - type: string - maxItems: 5 - nullable: true + $ref: '#/components/schemas/AuditLogEvent' type: array - isSMS: - description: Set true for an SMS template. + has_more: + description: True if additional events exist beyond this page. Use next_cursor + to fetch the next page. type: boolean - dynamic_content: - description: JSON string for dynamic content personalization. - nullable: true + next_cursor: + description: Opaque cursor to pass as cursor in the next request. Only present + when has_more is true. type: string type: object - TemplateResource: + JourneySchedule: + description: Optional future start and/or stop time. null means no scheduled + activation. example: - updated_at: 2000-01-23T04:56:07.000+00:00 - name: name - channel: push - created_at: 2000-01-23T04:56:07.000+00:00 - id: id - content: - key: "" + start_at: start_at + error: error + stop_at: stop_at + nullable: true properties: - id: - type: string - name: - type: string - created_at: - format: date-time + start_at: + description: ISO 8601 start time. Use UTC (Z or +00:00). Must be at least + 5 minutes in the future. + nullable: true type: string - updated_at: - format: date-time + stop_at: + description: ISO 8601 stop time. Use UTC (Z or +00:00). Must be in the future + and later than start_at. + nullable: true type: string - channel: - enum: - - push - - email - - sms + error: + description: Read-only. Present when a scheduling error occurred. nullable: true type: string - content: - additionalProperties: true - description: Rendered content and channel/platform flags for the template. - type: object type: object - TemplatesListResponse: + JourneyReentryRules: + description: Controls whether and how soon a user can re-enter the journey. + null means re-entry is not allowed. example: - templates: - - updated_at: 2000-01-23T04:56:07.000+00:00 - name: name - channel: push - created_at: 2000-01-23T04:56:07.000+00:00 - id: id - content: - key: "" - - updated_at: 2000-01-23T04:56:07.000+00:00 - name: name - channel: push - created_at: 2000-01-23T04:56:07.000+00:00 - id: id - content: - key: "" + duration_seconds: 600 + nullable: true properties: - templates: - items: - $ref: '#/components/schemas/TemplateResource' - type: array + duration_seconds: + description: Minimum seconds before a user can re-enter. Must be at least + 600 (10 minutes). + minimum: 600 + nullable: true + type: integer type: object - CopyTemplateRequest: + JourneyEventAttribute: example: - target_app_id: target_app_id + value: value + key: key + operator: equal properties: - target_app_id: - description: Destination OneSignal App ID in UUID v4 format. + key: + description: Event attribute key. + type: string + operator: + description: Comparison operator. + enum: + - equal + - not_equal + - less + - less_or_equal + - greater_or_equal + - greater + - is + - is_not + - exists + - not_exists + - before + - after + type: string + value: + description: Value to compare against. Not required for exists and not_exists. type: string required: - - target_app_id + - key + - operator type: object - CreateUserConflictResponse: + JourneyEventTriggerAttributes: + description: "Event attribute matchers, as a list of condition groups. Send\ + \ a single group whose conditions are AND'd together. More than one group\ + \ is rejected." + items: + items: + $ref: '#/components/schemas/JourneyEventAttribute' + type: array + type: array + JourneyAudience: + description: The journey entry audience. The kind field selects which other + fields apply. + example: + future_additions_only: true + kind: segment + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids + name: name + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal properties: - errors: + kind: + description: Audience kind. Selects which other fields apply. + enum: + - segment + - event_trigger + type: string + included_segment_ids: + description: "segment audiences: Segment UUIDs whose users enter the journey." items: - $ref: '#/components/schemas/CreateUserConflictResponse_errors_inner' + type: string type: array - type: object - GenericError: - properties: - errors: {} - success: - type: boolean - reference: {} - type: object - RateLimitError: - properties: - errors: + excluded_segment_ids: + description: "segment audiences: Segment UUIDs whose users are excluded." items: type: string type: array - limit: + future_additions_only: + description: "segment audiences: when true, only users who newly match the\ + \ segment after activation enter the journey. Defaults to false." + nullable: true + type: boolean + name: + description: "event_trigger audiences: event name that triggers entry, up\ + \ to 255 characters." type: string + attributes: + description: "Event attribute matchers, as a list of condition groups. Send\ + \ a single group whose conditions are AND'd together. More than one group\ + \ is rejected." + items: + items: + $ref: '#/components/schemas/JourneyEventAttribute' + type: array + type: array + required: + - kind type: object - PropertiesBody: - example: - properties: - country: US - purchases: - - amount: "0.99" - iso: USD - count: 2 - sku: com.example.coins100 - - amount: "0.99" - iso: USD - count: 2 - sku: com.example.coins100 - ip: 203.0.113.10 - timezone_id: America/Los_Angeles - language: en - first_active: 1 - last_active: 5 - lat: 0.8008281904610115 - long: 6.027456183070403 - tags: - level: "10" - vip: "true" - amount_spent: 5.637376656633329 - properties: - properties: - $ref: '#/components/schemas/PropertiesObject' - type: object - SubscriptionBody: - example: - subscription: - notification_types: 1 - device_model: "iPhone14,2" - app_version: 1.0.0 - web_p256: BM5-r8DauQXOb2E-3PgLPjSvjT0Ao9v5oJhw8bZ0cW7Vh6BbmPYcqbbCEJ1P2sK0hZ7HxSh9zGyU5pQk1jJmZ8A - net_type: 9 - type: iOSPush - device_os: "17.1" - enabled: true - session_time: 60 - test_type: 7 - token: d5d4d1a8-1c9e-42fb-b3f2-56d3a5a9a8b7 - carrier: Verizon - session_count: 1 - web_auth: 5DUmpGmLuTxWCLj5lJpwLQ - rooted: true - id: e4e87830-b954-4363-b7bc-1f01dbaee5c8 - sdk: 5.2.0 - properties: - subscription: - $ref: '#/components/schemas/Subscription' - type: object - TransferSubscriptionRequestBody: + JourneyEarlyExit: + description: Conditions that remove a user from the journey before it completes. + At least one rule must be set under rules. Send null to remove early exit + entirely. example: - identity: - key: identity + rules: + on_segment: + included_segment_ids: + - included_segment_ids + - included_segment_ids + on_event: + name: name + when_not_in_audience: true + on_session: true + tag_on_early_exit: + key: tag_on_early_exit + nullable: true properties: - identity: + rules: + $ref: '#/components/schemas/JourneyEarlyExit_rules' + tag_on_early_exit: additionalProperties: type: string - maxProperties: 1 - minProperties: 1 + description: Tag key-value pairs applied when a user exits early. type: object type: object - UserIdentityBody: - example: - identity: - external_id: YOUR_USER_EXTERNAL_ID + JourneyTimePoint: properties: - identity: - additionalProperties: - type: string - example: - external_id: YOUR_USER_EXTERNAL_ID - type: object + hour: + description: "Hour of day, 0-23." + maximum: 23 + minimum: 0 + type: integer + minute: + description: "Minute of hour, 0-59. Defaults to 0." + maximum: 59 + minimum: 0 + type: integer type: object - ExportEventsSuccessResponse: + JourneyTimeWindow: + description: A wall-clock window. Each window must span at least 15 minutes. example: - csv_file_url: csv_file_url + start: "" + end: "" + day_of_week: 4 properties: - csv_file_url: - type: string + start: + allOf: + - $ref: '#/components/schemas/JourneyTimePoint' + description: When the window opens. + end: + allOf: + - $ref: '#/components/schemas/JourneyTimePoint' + description: When the window closes. + day_of_week: + description: "Day of week, 1 = Monday. Omit to apply the window to every\ + \ day." + maximum: 7 + minimum: 1 + type: integer type: object - CustomEvent: - example: - onesignal_id: onesignal_id - payload: - key: "" + JourneyCondition: + description: A branch condition. The kind field selects which other fields apply. + example: + kind: segment_membership + entry_event_match_attributes: + - "{}" + - "{}" + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids name: name - external_id: external_id - timestamp: 2000-01-23T04:56:07.000+00:00 + action: received + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + sending_node_id: sending_node_id + client_node_id: client_node_id properties: - name: - description: The identifier or name of the event. Maximum 128 characters. + kind: + description: Condition kind. Selects which other fields apply. + enum: + - segment_membership + - on_notification_action + - event_trigger type: string - external_id: - description: The external ID of the user targeted for the event. Either - the user's External ID or OneSignal ID is required. - nullable: true + included_segment_ids: + description: "segment_membership conditions: Segment UUIDs the user must\ + \ belong to." + items: + type: string + type: array + excluded_segment_ids: + description: "segment_membership conditions: Segment UUIDs the user must\ + \ not belong to." + items: + type: string + type: array + action: + description: "on_notification_action conditions: the notification action\ + \ to branch on. Which actions apply depends on the sending node's channel." + enum: + - received + - clicked + - opened type: string - onesignal_id: - description: The OneSignal ID of the user targeted for the event. Either - the user's External ID or OneSignal ID is required. - nullable: true + sending_node_id: + description: "on_notification_action conditions: id of the sending node\ + \ this action refers to. Returned on reads; accepted on write." type: string - timestamp: - description: Time the event occurred as an ISO8601 formatted string. Defaults - to now if not included or past date provided. - format: date-time + client_node_id: + description: "on_notification_action conditions: write-only alternative\ + \ to sending_node_id. References the sending node by its client_node_id." type: string - payload: - additionalProperties: true - description: "Properties or data related to the event, like {\"geography\"\ - : \"USA\"}" - type: object - required: - - name - type: object - CustomEventsRequest: - example: - events: - - onesignal_id: onesignal_id - payload: - key: "" - name: name - external_id: external_id - timestamp: 2000-01-23T04:56:07.000+00:00 - - onesignal_id: onesignal_id - payload: - key: "" - name: name - external_id: external_id - timestamp: 2000-01-23T04:56:07.000+00:00 - properties: - events: + name: + description: "event_trigger conditions: event name, up to 255 characters." + type: string + attributes: + description: "Event attribute matchers, as a list of condition groups. Send\ + \ a single group whose conditions are AND'd together. More than one group\ + \ is rejected." items: - $ref: '#/components/schemas/CustomEvent' + items: + $ref: '#/components/schemas/JourneyEventAttribute' + type: array + type: array + entry_event_match_attributes: + description: "event_trigger conditions: match incoming event properties\ + \ against the journey's entry event. Only valid on event-triggered journeys." + items: + type: object + nullable: true type: array required: - - events + - kind type: object - CustomEventsResponse: + JourneyWaitUntilExpiration: + description: Optional expiration timer. null waits indefinitely. + example: + duration_seconds: 17789868 + exits: true + nullable: true + properties: + duration_seconds: + description: "Seconds to wait before the timer fires. Minimum 60, maximum\ + \ 31556952 (1 year)." + maximum: 31556952 + minimum: 60 + nullable: true + type: integer + exits: + description: "When true, the user exits the journey when the timer fires;\ + \ when false, the user continues to convergence." + nullable: true + type: boolean type: object - ApiKeyToken: + JourneyNode: + description: "A journey node. The kind field selects which other fields apply.\ + \ Branching nodes (split_range, yes_no, wait_until) nest their sub-graphs\ + \ inline via branches[].nodes." example: - token_id: token_id - updated_at: updated_at - name: name - created_at: created_at - ip_allowlist_mode: disabled - ip_allowlist: - - ip_allowlist - - ip_allowlist + annotation: annotation + duration_seconds: 2527224 + relative_to: schedule_in_timezone + assignments: + key: assignments + kind: wait + windows: + - start: "" + end: "" + day_of_week: 4 + - start: "" + end: "" + day_of_week: 4 + time_zone: time_zone + use_user_time_zone: true + branches: + - condition: + kind: segment_membership + entry_event_match_attributes: + - "{}" + - "{}" + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids + name: name + action: received + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + sending_node_id: sending_node_id + client_node_id: client_node_id + nodes: + - null + - null + weight: 5.962133916683182 + id: id + - condition: + kind: segment_membership + entry_event_match_attributes: + - "{}" + - "{}" + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids + name: name + action: received + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + sending_node_id: sending_node_id + client_node_id: client_node_id + nodes: + - null + - null + weight: 5.962133916683182 + id: id + client_node_id: client_node_id + iam_id: iam_id + randomize_on_entry: true + webhook_id: webhook_id + template_id: template_id + expiration: + duration_seconds: 17789868 + exits: true + id: id + user_ttl_seconds: 1 properties: - token_id: + id: + description: Server-assigned node UUID. Returned on reads. Required on update + to keep an existing node. Rejected on create with a 400 validation error. type: string - updated_at: + kind: + description: Node kind. Selects which other fields apply. + enum: + - wait + - time_window + - send_push + - send_email + - send_sms + - send_iam + - send_webhook + - tag + - split_range + - yes_no + - wait_until + type: string + client_node_id: + description: "Optional client-assigned identifier, unique within the journey.\ + \ Use it to reference this node from elsewhere in the same request. Persisted\ + \ and returned on reads." + type: string + annotation: + description: "Optional free-text label, up to 255 characters. Stored and\ + \ returned as-is with no effect on journey behavior." + type: string + duration_seconds: + description: "wait nodes: seconds to hold the user. Minimum 60, maximum\ + \ 31556952 (1 year)." + maximum: 31556952 + minimum: 60 + nullable: true + type: integer + relative_to: + description: "time_window nodes: schedule_in_timezone uses the configured\ + \ windows; last_active_time holds relative to the user's last active time." + enum: + - schedule_in_timezone + - last_active_time type: string - created_at: + windows: + description: "time_window nodes: one or more time windows. A window with\ + \ no day_of_week applies to every day. Required when relative_to is schedule_in_timezone;\ + \ omit when it is last_active_time." + items: + $ref: '#/components/schemas/JourneyTimeWindow' + type: array + time_zone: + description: "time_window nodes: IANA timezone identifier used when the\ + \ user's timezone is unavailable." type: string - name: + use_user_time_zone: + description: "time_window nodes: when true, uses the user's timezone if\ + \ available." + nullable: true + type: boolean + template_id: + description: "send_push, send_email, and send_sms nodes: UUID of the template\ + \ to send." type: string - ip_allowlist_mode: - enum: - - disabled - - explicit + iam_id: + description: "send_iam nodes: UUID of the in-app message to send." type: string - ip_allowlist: - items: + user_ttl_seconds: + description: "send_iam nodes: optional time-to-live for the in-app message,\ + \ in seconds." + minimum: 1 + nullable: true + type: integer + webhook_id: + description: "send_webhook nodes: UUID of the webhook to send." + type: string + assignments: + additionalProperties: type: string + description: "tag nodes: tag key-value pairs to assign. An empty string\ + \ value removes the tag. Keys are limited to 255 characters and values\ + \ to 1024." + type: object + randomize_on_entry: + description: "split_range nodes: when true, assigns each user to a branch\ + \ at random on entry. Defaults to false." + nullable: true + type: boolean + branches: + description: "Branching nodes: nested branches. split_range requires 2-20\ + \ weighted branches that sum to 100. yes_no requires exactly 2 branches.\ + \ wait_until requires 1-10 condition branches." + items: + $ref: '#/components/schemas/JourneyBranch' type: array + expiration: + $ref: '#/components/schemas/JourneyWaitUntilExpiration' + required: + - kind type: object - ApiKeyTokensListResponse: + JourneyBranch: example: - tokens: - - token_id: token_id - updated_at: updated_at - name: name - created_at: created_at - ip_allowlist_mode: disabled - ip_allowlist: - - ip_allowlist - - ip_allowlist - - token_id: token_id - updated_at: updated_at + condition: + kind: segment_membership + entry_event_match_attributes: + - "{}" + - "{}" + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids name: name - created_at: created_at - ip_allowlist_mode: disabled - ip_allowlist: - - ip_allowlist - - ip_allowlist + action: received + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + sending_node_id: sending_node_id + client_node_id: client_node_id + nodes: + - null + - null + weight: 5.962133916683182 + id: id properties: - tokens: + id: + description: Server-assigned branch identifier. Read-only on create; echo + it on update to keep the branch. + type: string + condition: + $ref: '#/components/schemas/JourneyCondition' + weight: + description: Branch weight for split_range nodes. Weights across a node's + branches must sum to 100. + type: number + nodes: + description: "Nodes run when this branch is taken, before flow converges\ + \ to the next sibling node." items: - $ref: '#/components/schemas/ApiKeyToken' + $ref: '#/components/schemas/JourneyNode' type: array type: object - CreateApiKeyRequest: + Journey: + description: "Full journey representation returned by the detail, create, and\ + \ update endpoints." example: + audience: + future_additions_only: true + kind: segment + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids + name: name + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + archived_at: archived_at + description: description + created_at: created_at + early_exit: + rules: + on_segment: + included_segment_ids: + - included_segment_ids + - included_segment_ids + on_event: + name: name + when_not_in_audience: true + on_session: true + tag_on_early_exit: + key: tag_on_early_exit + created_source: created_source + schedule: + start_at: start_at + error: error + stop_at: stop_at + concurrency_key: concurrency_key + nodes: + - annotation: annotation + duration_seconds: 2527224 + relative_to: schedule_in_timezone + assignments: + key: assignments + kind: wait + windows: + - start: "" + end: "" + day_of_week: 4 + - start: "" + end: "" + day_of_week: 4 + time_zone: time_zone + use_user_time_zone: true + branches: + - condition: + kind: segment_membership + entry_event_match_attributes: + - "{}" + - "{}" + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids + name: name + action: received + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + sending_node_id: sending_node_id + client_node_id: client_node_id + nodes: + - null + - null + weight: 5.962133916683182 + id: id + - condition: + kind: segment_membership + entry_event_match_attributes: + - "{}" + - "{}" + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids + name: name + action: received + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + sending_node_id: sending_node_id + client_node_id: client_node_id + nodes: + - null + - null + weight: 5.962133916683182 + id: id + client_node_id: client_node_id + iam_id: iam_id + randomize_on_entry: true + webhook_id: webhook_id + template_id: template_id + expiration: + duration_seconds: 17789868 + exits: true + id: id + user_ttl_seconds: 1 + - annotation: annotation + duration_seconds: 2527224 + relative_to: schedule_in_timezone + assignments: + key: assignments + kind: wait + windows: + - start: "" + end: "" + day_of_week: 4 + - start: "" + end: "" + day_of_week: 4 + time_zone: time_zone + use_user_time_zone: true + branches: + - condition: + kind: segment_membership + entry_event_match_attributes: + - "{}" + - "{}" + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids + name: name + action: received + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + sending_node_id: sending_node_id + client_node_id: client_node_id + nodes: + - null + - null + weight: 5.962133916683182 + id: id + - condition: + kind: segment_membership + entry_event_match_attributes: + - "{}" + - "{}" + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids + name: name + action: received + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + sending_node_id: sending_node_id + client_node_id: client_node_id + nodes: + - null + - null + weight: 5.962133916683182 + id: id + client_node_id: client_node_id + iam_id: iam_id + randomize_on_entry: true + webhook_id: webhook_id + template_id: template_id + expiration: + duration_seconds: 17789868 + exits: true + id: id + user_ttl_seconds: 1 + updated_at: updated_at name: name - ip_allowlist_mode: disabled - ip_allowlist: - - ip_allowlist - - ip_allowlist + started_at: started_at + id: id + state: draft + reentry_rules: + duration_seconds: 600 + app_id: app_id properties: + id: + description: Journey UUID. Read-only. + type: string + app_id: + description: UUID of the app the journey belongs to. Read-only. + type: string name: + description: "Journey name, up to 300 characters." type: string - ip_allowlist_mode: + description: + description: "Journey description, up to 1024 characters. Defaults to an\ + \ empty string." + nullable: true + type: string + state: + description: Journey state. New journeys are created as draft. processing + is transient while activation is in progress. archived is a journey that + has been stopped. Change it through the state field on Update journey. enum: - - disabled - - explicit + - draft + - scheduled + - processing + - active + - archived type: string - ip_allowlist: + created_at: + description: ISO 8601 creation time. Read-only. + type: string + updated_at: + description: ISO 8601 last-update time. Read-only. + type: string + started_at: + description: "ISO 8601 time the journey was activated, or null. Read-only.\ + \ May stay null briefly after you set state to active: activation is enqueued,\ + \ and started_at populates once the journey finishes processing." + nullable: true + type: string + archived_at: + description: "ISO 8601 time the journey was archived, or null. Read-only." + nullable: true + type: string + created_source: + description: "Origin of the journey, for example public_api or dashboard.\ + \ Read-only." + nullable: true + type: string + audience: + $ref: '#/components/schemas/JourneyAudience' + early_exit: + $ref: '#/components/schemas/JourneyEarlyExit' + reentry_rules: + $ref: '#/components/schemas/JourneyReentryRules' + schedule: + $ref: '#/components/schemas/JourneySchedule' + nodes: + description: Ordered list of journey nodes. items: - type: string + $ref: '#/components/schemas/JourneyNode' type: array - type: object - CreateApiKeyResponse: - example: - token_id: token_id - formatted_token: formatted_token - properties: - token_id: - type: string - formatted_token: + concurrency_key: + description: Opaque optimistic-concurrency token. Read-only. Pass it back + on update to guard against overwriting a concurrent change (409). Send + it back exactly as read; do not construct or parse it. type: string type: object - UpdateApiKeyRequest: + JourneyListAudience: + description: Entry audience reduced to its kind. Use View journey for the full + audience configuration. example: - name: name - ip_allowlist_mode: disabled - ip_allowlist: - - ip_allowlist - - ip_allowlist + kind: segment properties: - name: - type: string - ip_allowlist_mode: + kind: + description: Audience kind. enum: - - disabled - - explicit + - segment + - event_trigger type: string - ip_allowlist: - items: - type: string - type: array type: object - AuditLogActor: - description: The user or service that performed the action. Absent if the actor - is unknown. + JourneyListItem: + description: "Summary journey representation returned by the list endpoint.\ + \ Excludes description, nodes, early-exit configuration, and concurrency_key." example: - metadata: "{}" + schedule: + start_at: start_at + error: error + stop_at: stop_at + audience: + kind: segment + updated_at: updated_at + archived_at: archived_at name: name + created_at: created_at + started_at: started_at + created_source: created_source id: id - type: type - email: email + state: draft + reentry_rules: + duration_seconds: 600 + app_id: app_id properties: - email: - description: Email address of the actor. Absent if unavailable. - type: string id: - description: UUID of the actor. + description: Journey UUID. Read-only. + type: string + app_id: + description: UUID of the app the journey belongs to. Read-only. type: string - metadata: - description: Additional actor-specific data. - type: object name: - description: Display name of the actor. Absent if unavailable. + description: "Journey name, up to 300 characters." type: string - type: - description: "Actor type (e.g. member, api_key, system)." + state: + description: Journey state. New journeys are created as draft. processing + is transient while activation is in progress. archived is a journey that + has been stopped. Change it through the state field on Update journey. + enum: + - draft + - scheduled + - processing + - active + - archived + type: string + created_at: + description: ISO 8601 creation time. Read-only. + type: string + updated_at: + description: ISO 8601 last-update time. Read-only. + type: string + started_at: + description: "ISO 8601 time the journey was activated, or null. Read-only." + nullable: true + type: string + archived_at: + description: "ISO 8601 time the journey was archived, or null. Read-only." + nullable: true + type: string + created_source: + description: "Origin of the journey, for example public_api or dashboard.\ + \ Read-only." + nullable: true + type: string + schedule: + $ref: '#/components/schemas/JourneySchedule' + audience: + $ref: '#/components/schemas/JourneyListAudience' + reentry_rules: + $ref: '#/components/schemas/JourneyReentryRules' + type: object + JourneyListResponse: + example: + journeys: + - schedule: + start_at: start_at + error: error + stop_at: stop_at + audience: + kind: segment + updated_at: updated_at + archived_at: archived_at + name: name + created_at: created_at + started_at: started_at + created_source: created_source + id: id + state: draft + reentry_rules: + duration_seconds: 600 + app_id: app_id + - schedule: + start_at: start_at + error: error + stop_at: stop_at + audience: + kind: segment + updated_at: updated_at + archived_at: archived_at + name: name + created_at: created_at + started_at: started_at + created_source: created_source + id: id + state: draft + reentry_rules: + duration_seconds: 600 + app_id: app_id + next_cursor: next_cursor + has_more: true + properties: + journeys: + description: "Journeys ordered by creation time, newest first." + items: + $ref: '#/components/schemas/JourneyListItem' + type: array + has_more: + description: true if more journeys exist beyond this page. + type: boolean + next_cursor: + description: Cursor for the next page. Present only when has_more is true. type: string type: object - AuditLogTarget: - description: A resource the action was performed on. + CreateJourneyRequest: + description: Writable fields for Create journey. Journeys are always created + in the draft state. Server-controlled fields such as state or id are rejected. example: - metadata: "{}" + schedule: + start_at: start_at + error: error + stop_at: stop_at + audience: + future_additions_only: true + kind: segment + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids + name: name + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + nodes: + - annotation: annotation + duration_seconds: 2527224 + relative_to: schedule_in_timezone + assignments: + key: assignments + kind: wait + windows: + - start: "" + end: "" + day_of_week: 4 + - start: "" + end: "" + day_of_week: 4 + time_zone: time_zone + use_user_time_zone: true + branches: + - condition: + kind: segment_membership + entry_event_match_attributes: + - "{}" + - "{}" + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids + name: name + action: received + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + sending_node_id: sending_node_id + client_node_id: client_node_id + nodes: + - null + - null + weight: 5.962133916683182 + id: id + - condition: + kind: segment_membership + entry_event_match_attributes: + - "{}" + - "{}" + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids + name: name + action: received + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + sending_node_id: sending_node_id + client_node_id: client_node_id + nodes: + - null + - null + weight: 5.962133916683182 + id: id + client_node_id: client_node_id + iam_id: iam_id + randomize_on_entry: true + webhook_id: webhook_id + template_id: template_id + expiration: + duration_seconds: 17789868 + exits: true + id: id + user_ttl_seconds: 1 + - annotation: annotation + duration_seconds: 2527224 + relative_to: schedule_in_timezone + assignments: + key: assignments + kind: wait + windows: + - start: "" + end: "" + day_of_week: 4 + - start: "" + end: "" + day_of_week: 4 + time_zone: time_zone + use_user_time_zone: true + branches: + - condition: + kind: segment_membership + entry_event_match_attributes: + - "{}" + - "{}" + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids + name: name + action: received + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + sending_node_id: sending_node_id + client_node_id: client_node_id + nodes: + - null + - null + weight: 5.962133916683182 + id: id + - condition: + kind: segment_membership + entry_event_match_attributes: + - "{}" + - "{}" + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids + name: name + action: received + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + sending_node_id: sending_node_id + client_node_id: client_node_id + nodes: + - null + - null + weight: 5.962133916683182 + id: id + client_node_id: client_node_id + iam_id: iam_id + randomize_on_entry: true + webhook_id: webhook_id + template_id: template_id + expiration: + duration_seconds: 17789868 + exits: true + id: id + user_ttl_seconds: 1 name: name - id: id - type: type + description: description + early_exit: + rules: + on_segment: + included_segment_ids: + - included_segment_ids + - included_segment_ids + on_event: + name: name + when_not_in_audience: true + on_session: true + tag_on_early_exit: + key: tag_on_early_exit + reentry_rules: + duration_seconds: 600 properties: - id: - description: UUID of the resource. - type: string - metadata: - description: Additional resource-specific data. - type: object name: - description: Display name of the resource. Absent if unavailable. - type: string - type: - description: "Resource type (e.g. notification, segment, journey, app)." + description: "Journey name, up to 300 characters." type: string + description: + description: "Optional journey description, up to 1024 characters." + nullable: true + type: string + audience: + $ref: '#/components/schemas/JourneyAudience' + early_exit: + $ref: '#/components/schemas/JourneyEarlyExit' + reentry_rules: + $ref: '#/components/schemas/JourneyReentryRules' + schedule: + $ref: '#/components/schemas/JourneySchedule' + nodes: + description: Ordered list of journey nodes. Server-assigned id fields are + rejected on create. + items: + $ref: '#/components/schemas/JourneyNode' + type: array + required: + - name type: object - AuditLogContext: - description: Request context at the time of the event. Absent if context was - not captured. + UpdateJourneyRequest: + description: Partial update applied with JSON Merge Patch (RFC 7396). Send only + the fields you want to change. A null value clears a nullable field. Arrays + such as nodes are replaced wholesale. example: - country: country - metadata: "{}" - ip: ip - user_agent: user_agent + schedule: + start_at: start_at + error: error + stop_at: stop_at + audience: + future_additions_only: true + kind: segment + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids + name: name + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + concurrency_key: concurrency_key + nodes: + - annotation: annotation + duration_seconds: 2527224 + relative_to: schedule_in_timezone + assignments: + key: assignments + kind: wait + windows: + - start: "" + end: "" + day_of_week: 4 + - start: "" + end: "" + day_of_week: 4 + time_zone: time_zone + use_user_time_zone: true + branches: + - condition: + kind: segment_membership + entry_event_match_attributes: + - "{}" + - "{}" + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids + name: name + action: received + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + sending_node_id: sending_node_id + client_node_id: client_node_id + nodes: + - null + - null + weight: 5.962133916683182 + id: id + - condition: + kind: segment_membership + entry_event_match_attributes: + - "{}" + - "{}" + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids + name: name + action: received + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + sending_node_id: sending_node_id + client_node_id: client_node_id + nodes: + - null + - null + weight: 5.962133916683182 + id: id + client_node_id: client_node_id + iam_id: iam_id + randomize_on_entry: true + webhook_id: webhook_id + template_id: template_id + expiration: + duration_seconds: 17789868 + exits: true + id: id + user_ttl_seconds: 1 + - annotation: annotation + duration_seconds: 2527224 + relative_to: schedule_in_timezone + assignments: + key: assignments + kind: wait + windows: + - start: "" + end: "" + day_of_week: 4 + - start: "" + end: "" + day_of_week: 4 + time_zone: time_zone + use_user_time_zone: true + branches: + - condition: + kind: segment_membership + entry_event_match_attributes: + - "{}" + - "{}" + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids + name: name + action: received + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + sending_node_id: sending_node_id + client_node_id: client_node_id + nodes: + - null + - null + weight: 5.962133916683182 + id: id + - condition: + kind: segment_membership + entry_event_match_attributes: + - "{}" + - "{}" + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids + name: name + action: received + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + sending_node_id: sending_node_id + client_node_id: client_node_id + nodes: + - null + - null + weight: 5.962133916683182 + id: id + client_node_id: client_node_id + iam_id: iam_id + randomize_on_entry: true + webhook_id: webhook_id + template_id: template_id + expiration: + duration_seconds: 17789868 + exits: true + id: id + user_ttl_seconds: 1 + name: name + description: description + early_exit: + rules: + on_segment: + included_segment_ids: + - included_segment_ids + - included_segment_ids + on_event: + name: name + when_not_in_audience: true + on_session: true + tag_on_early_exit: + key: tag_on_early_exit + reentry_rules: + duration_seconds: 600 + state: draft properties: - country: - description: Country code derived from the request IP. + name: + description: Journey name. type: string - ip: - description: IP address the request originated from. + description: + description: Journey description. Send null to clear it. + nullable: true + type: string + audience: + $ref: '#/components/schemas/JourneyAudience' + early_exit: + $ref: '#/components/schemas/JourneyEarlyExit' + reentry_rules: + $ref: '#/components/schemas/JourneyReentryRules' + schedule: + $ref: '#/components/schemas/JourneySchedule' + nodes: + description: "Full ordered list of nodes, which replaces the existing graph\ + \ wholesale. Preserve each node's server-assigned id from a prior fetch\ + \ to keep in-flight users on that node; omit id to add a new node." + items: + $ref: '#/components/schemas/JourneyNode' + type: array + state: + description: "Target state. Set active to activate a draft journey, or scheduled\ + \ together with a future schedule.start_at to activate it later. Set archived\ + \ to stop a running journey; archiving is permanent. Only scheduled and\ + \ processing journeys can return to draft." + enum: + - draft + - scheduled + - active + - archived type: string - metadata: - description: Additional context-specific data. - type: object - user_agent: - description: User agent of the client that made the request. + concurrency_key: + description: Optional optimistic-concurrency token. Pass the concurrency_key + from a prior fetch to reject the update with 409 if the journey changed. + Omit to skip the check. + nullable: true type: string type: object - AuditLogEvent: + UpdateJourneyNodeRequest: + description: "Node fields to change, merged onto the current node. Send only\ + \ the fields you want to change. The node's kind and id cannot be changed.\ + \ Send null to clear a nullable field. Which other fields apply depends on\ + \ the node's kind, matching JourneyNode." example: - actor: - metadata: "{}" - name: name - id: id - type: type - email: email - occurred_at: occurred_at - metadata: "{}" - organization_id: organization_id - context: - country: country - metadata: "{}" - ip: ip - user_agent: user_agent - action: action - id: id - app_id: app_id - targets: - - metadata: "{}" - name: name + annotation: annotation + duration_seconds: 2527224 + relative_to: schedule_in_timezone + assignments: + key: assignments + windows: + - start: "" + end: "" + day_of_week: 4 + - start: "" + end: "" + day_of_week: 4 + time_zone: time_zone + use_user_time_zone: true + branches: + - condition: + kind: segment_membership + entry_event_match_attributes: + - "{}" + - "{}" + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids + name: name + action: received + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + sending_node_id: sending_node_id + client_node_id: client_node_id + nodes: + - null + - null + weight: 5.962133916683182 id: id - type: type - - metadata: "{}" - name: name + - condition: + kind: segment_membership + entry_event_match_attributes: + - "{}" + - "{}" + included_segment_ids: + - included_segment_ids + - included_segment_ids + excluded_segment_ids: + - excluded_segment_ids + - excluded_segment_ids + name: name + action: received + attributes: + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + - - value: value + key: key + operator: equal + - value: value + key: key + operator: equal + sending_node_id: sending_node_id + client_node_id: client_node_id + nodes: + - null + - null + weight: 5.962133916683182 id: id - type: type - version: 0 + client_node_id: client_node_id + concurrency_key: concurrency_key + iam_id: iam_id + randomize_on_entry: true + webhook_id: webhook_id + template_id: template_id + expiration: + duration_seconds: 17789868 + exits: true + user_ttl_seconds: 1 properties: - action: - description: "The action that was performed (e.g. notification.sent, segment.created,\ - \ member.invited)." + client_node_id: + description: "Optional client-assigned identifier, unique within the journey.\ + \ Use it to reference this node from elsewhere in the same request. Persisted\ + \ and returned on reads." type: string - actor: - $ref: '#/components/schemas/AuditLogActor' - app_id: - description: UUID of the app the event is associated with. Absent for org-level - events. + annotation: + description: "Optional free-text label, up to 255 characters. Stored and\ + \ returned as-is with no effect on journey behavior." type: string - context: - $ref: '#/components/schemas/AuditLogContext' - id: - description: UUID of the audit log event. + duration_seconds: + description: "wait nodes: seconds to hold the user. Minimum 60, maximum\ + \ 31556952 (1 year)." + maximum: 31556952 + minimum: 60 + nullable: true + type: integer + relative_to: + description: "time_window nodes: schedule_in_timezone uses the configured\ + \ windows; last_active_time holds relative to the user's last active time." + enum: + - schedule_in_timezone + - last_active_time type: string - metadata: - description: Additional event-specific data that does not fit into the standard - fields. - type: object - occurred_at: - description: RFC 3339 timestamp of when the event occurred (e.g. 2026-02-18T12:34:56Z). + windows: + description: "time_window nodes: one or more time windows. A window with\ + \ no day_of_week applies to every day. Required when relative_to is schedule_in_timezone;\ + \ omit when it is last_active_time." + items: + $ref: '#/components/schemas/JourneyTimeWindow' + type: array + time_zone: + description: "time_window nodes: IANA timezone identifier used when the\ + \ user's timezone is unavailable." type: string - organization_id: - description: UUID of the organization the event belongs to. + use_user_time_zone: + description: "time_window nodes: when true, uses the user's timezone if\ + \ available." + nullable: true + type: boolean + template_id: + description: "send_push, send_email, and send_sms nodes: UUID of the template\ + \ to send." type: string - targets: - description: The resources the action was performed on. May be empty for - org-level events. + iam_id: + description: "send_iam nodes: UUID of the in-app message to send." + type: string + user_ttl_seconds: + description: "send_iam nodes: optional time-to-live for the in-app message,\ + \ in seconds." + minimum: 1 + nullable: true + type: integer + webhook_id: + description: "send_webhook nodes: UUID of the webhook to send." + type: string + assignments: + additionalProperties: + type: string + description: "tag nodes: tag key-value pairs to assign. An empty string\ + \ value removes the tag. Keys are limited to 255 characters and values\ + \ to 1024." + type: object + randomize_on_entry: + description: "split_range nodes: when true, assigns each user to a branch\ + \ at random on entry. Defaults to false." + nullable: true + type: boolean + branches: + description: "Branching nodes: nested branches. split_range requires 2-20\ + \ weighted branches that sum to 100. yes_no requires exactly 2 branches.\ + \ wait_until requires 1-10 condition branches." items: - $ref: '#/components/schemas/AuditLogTarget' + $ref: '#/components/schemas/JourneyBranch' type: array - version: - description: Schema version of the event payload. + expiration: + $ref: '#/components/schemas/JourneyWaitUntilExpiration' + concurrency_key: + description: Optional optimistic-concurrency token. Pass the concurrency_key + from a prior fetch to reject the update with 409 if the journey changed. + Omit to skip the check. It is not merged onto the node. + nullable: true + type: string + type: object + JourneyMessageStats: + description: "Delivery stats for a message-sending node. Present only on send_push,\ + \ send_email, send_sms, send_iam, and send_webhook nodes. The keys inside\ + \ totals depend on the node's channel." + example: + totals: + key: 7.061401241503109 + properties: + totals: + additionalProperties: + type: number + description: "All-time totals for this node, keyed by channel-specific stat\ + \ name." + type: object + type: object + JourneyNodeStats: + description: Stats for a single node. Keyed in the response by the node's server-assigned + id. + example: + waiting: 5 + kind: wait + exited_early: 2 + message_stats: + totals: + key: 7.061401241503109 + completed: 5 + properties: + kind: + description: "Node kind, repeated here so stats can be read without joining\ + \ against the journey definition." + enum: + - wait + - time_window + - send_push + - send_email + - send_sms + - send_iam + - send_webhook + - tag + - split_range + - yes_no + - wait_until + type: string + waiting: + description: Users currently held at this node. + type: integer + completed: + description: Users who advanced past this node normally. type: integer + exited_early: + description: Users who left the journey from this node through an early + exit rule. + type: integer + message_stats: + $ref: '#/components/schemas/JourneyMessageStats' type: object - ListAuditLogsSuccessResponse: + JourneyBranchStats: + description: Stats for a single branch of a branching node. Keyed in the response + by the branch's server-assigned id. example: - next_cursor: next_cursor - has_more: true - audit_logs: - - actor: - metadata: "{}" - name: name - id: id - type: type - email: email - occurred_at: occurred_at - metadata: "{}" - organization_id: organization_id - context: - country: country - metadata: "{}" - ip: ip - user_agent: user_agent - action: action - id: id - app_id: app_id - targets: - - metadata: "{}" - name: name - id: id - type: type - - metadata: "{}" - name: name - id: id - type: type - version: 0 - - actor: - metadata: "{}" - name: name - id: id - type: type - email: email - occurred_at: occurred_at - metadata: "{}" - organization_id: organization_id - context: - country: country - metadata: "{}" - ip: ip - user_agent: user_agent - action: action - id: id - app_id: app_id - targets: - - metadata: "{}" - name: name - id: id - type: type - - metadata: "{}" - name: name - id: id - type: type - version: 0 + completed: 9 properties: - audit_logs: - description: "Array of audit log events, ordered by occurred_at ascending." - items: - $ref: '#/components/schemas/AuditLogEvent' - type: array - has_more: - description: True if additional events exist beyond this page. Use next_cursor - to fetch the next page. - type: boolean - next_cursor: - description: Opaque cursor to pass as cursor in the next request. Only present - when has_more is true. + completed: + description: Users who took this branch. + type: integer + type: object + JourneyStats: + description: "Journey-level counts plus flat, id-keyed maps of node and branch\ + \ stats. Contains no definition detail; join it by id against the journey\ + \ from View journey." + example: + nodes: + key: + waiting: 5 + kind: wait + exited_early: 2 + message_stats: + totals: + key: 7.061401241503109 + completed: 5 + started: 0 + exited_early: 1 + id: id + completed: 6 + branches: + key: + completed: 9 + properties: + id: + description: UUID of the journey these stats belong to. type: string + started: + description: Users who entered the journey. + type: integer + completed: + description: Users who reached the end of the journey normally. + type: integer + exited_early: + description: Users who left the journey through an early exit rule. + type: integer + nodes: + additionalProperties: + $ref: '#/components/schemas/JourneyNodeStats' + description: "Node stats keyed by node id. Includes every node in the graph,\ + \ at any nesting depth." + type: object + branches: + additionalProperties: + $ref: '#/components/schemas/JourneyBranchStats' + description: Branch stats keyed by branch id. Empty for a journey with no + branching nodes. + type: object type: object get_notification_history_request_body: properties: @@ -6701,6 +9015,55 @@ components: meta: $ref: '#/components/schemas/CreateUserConflictResponse_errorsItems_meta' type: object + JourneyEarlyExit_rules_on_segment: + example: + included_segment_ids: + - included_segment_ids + - included_segment_ids + nullable: true + properties: + included_segment_ids: + description: Exit when the user enters any of these segments. + items: + type: string + type: array + type: object + JourneyEarlyExit_rules_on_event: + example: + name: name + nullable: true + properties: + name: + description: Exit when this event occurs. Up to 255 characters. + type: string + required: + - name + type: object + JourneyEarlyExit_rules: + example: + on_segment: + included_segment_ids: + - included_segment_ids + - included_segment_ids + on_event: + name: name + when_not_in_audience: true + on_session: true + properties: + on_segment: + $ref: '#/components/schemas/JourneyEarlyExit_rules_on_segment' + when_not_in_audience: + description: Exit when the user no longer matches the journey audience. + Defaults to false. + nullable: true + type: boolean + on_session: + description: Exit on a new session start. Defaults to false. + nullable: true + type: boolean + on_event: + $ref: '#/components/schemas/JourneyEarlyExit_rules_on_event' + type: object securitySchemes: rest_api_key: scheme: bearer diff --git a/build.gradle b/build.gradle index 3f3701b..bfca9a5 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'com.diffplug.spotless' apply plugin: 'com.vanniktech.maven.publish' group = 'com.onesignal' -version = '5.11.2' +version = '5.12.0' buildscript { repositories { diff --git a/build.sbt b/build.sbt index e05229a..c1ab245 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "com.onesignal", name := "onesignal-java-client", - version := "5.11.2", + version := "5.12.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), javacOptions in compile ++= Seq("-Xlint:deprecation"), diff --git a/docs/CreateJourneyRequest.md b/docs/CreateJourneyRequest.md new file mode 100644 index 0000000..7e59ec8 --- /dev/null +++ b/docs/CreateJourneyRequest.md @@ -0,0 +1,20 @@ + + +# CreateJourneyRequest + +Writable fields for Create journey. Journeys are always created in the draft state. Server-controlled fields such as state or id are rejected. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Journey name, up to 300 characters. | | +|**description** | **String** | Optional journey description, up to 1024 characters. | [optional] | +|**audience** | [**JourneyAudience**](JourneyAudience.md) | | [optional] | +|**earlyExit** | [**JourneyEarlyExit**](JourneyEarlyExit.md) | | [optional] | +|**reentryRules** | [**JourneyReentryRules**](JourneyReentryRules.md) | | [optional] | +|**schedule** | [**JourneySchedule**](JourneySchedule.md) | | [optional] | +|**nodes** | [**List<JourneyNode>**](JourneyNode.md) | Ordered list of journey nodes. Server-assigned id fields are rejected on create. | [optional] | + + + diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md index 16a017e..13000b6 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -11,6 +11,7 @@ All URIs are relative to *https://api.onesignal.com* | [**createApiKey**](DefaultApi.md#createApiKey) | **POST** /apps/{app_id}/auth/tokens | Create API key | | [**createApp**](DefaultApi.md#createApp) | **POST** /apps | Create an app | | [**createCustomEvents**](DefaultApi.md#createCustomEvents) | **POST** /apps/{app_id}/custom_events | Create custom events | +| [**createJourney**](DefaultApi.md#createJourney) | **POST** /apps/{app_id}/journeys | Create journey | | [**createNotification**](DefaultApi.md#createNotification) | **POST** /notifications | Create notification | | [**createSegment**](DefaultApi.md#createSegment) | **POST** /apps/{app_id}/segments | Create Segment | | [**createSubscription**](DefaultApi.md#createSubscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | | @@ -18,6 +19,7 @@ All URIs are relative to *https://api.onesignal.com* | [**createUser**](DefaultApi.md#createUser) | **POST** /apps/{app_id}/users | | | [**deleteAlias**](DefaultApi.md#deleteAlias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | | | [**deleteApiKey**](DefaultApi.md#deleteApiKey) | **DELETE** /apps/{app_id}/auth/tokens/{token_id} | Delete API key | +| [**deleteJourney**](DefaultApi.md#deleteJourney) | **DELETE** /apps/{app_id}/journeys/{journey_id} | Delete journey | | [**deleteSegment**](DefaultApi.md#deleteSegment) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segment | | [**deleteSubscription**](DefaultApi.md#deleteSubscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | | | [**deleteTemplate**](DefaultApi.md#deleteTemplate) | **DELETE** /templates/{template_id} | Delete template | @@ -42,6 +44,8 @@ All URIs are relative to *https://api.onesignal.com* | [**unsubscribeEmailWithToken**](DefaultApi.md#unsubscribeEmailWithToken) | **POST** /apps/{app_id}/notifications/{notification_id}/unsubscribe | Unsubscribe with token | | [**updateApiKey**](DefaultApi.md#updateApiKey) | **PATCH** /apps/{app_id}/auth/tokens/{token_id} | Update API key | | [**updateApp**](DefaultApi.md#updateApp) | **PUT** /apps/{app_id} | Update an app | +| [**updateJourney**](DefaultApi.md#updateJourney) | **PATCH** /apps/{app_id}/journeys/{journey_id} | Update journey | +| [**updateJourneyNode**](DefaultApi.md#updateJourneyNode) | **PATCH** /apps/{app_id}/journeys/{journey_id}/nodes/{node_id} | Update journey node | | [**updateLiveActivity**](DefaultApi.md#updateLiveActivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push | | [**updateSegment**](DefaultApi.md#updateSegment) | **PATCH** /apps/{app_id}/segments/{segment_id} | Update Segment | | [**updateSubscription**](DefaultApi.md#updateSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | | @@ -49,6 +53,9 @@ All URIs are relative to *https://api.onesignal.com* | [**updateTemplate**](DefaultApi.md#updateTemplate) | **PATCH** /templates/{template_id} | Update template | | [**updateUser**](DefaultApi.md#updateUser) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} | | | [**viewApiKeys**](DefaultApi.md#viewApiKeys) | **GET** /apps/{app_id}/auth/tokens | View API keys | +| [**viewJourney**](DefaultApi.md#viewJourney) | **GET** /apps/{app_id}/journeys/{journey_id} | View journey | +| [**viewJourneyStats**](DefaultApi.md#viewJourneyStats) | **GET** /apps/{app_id}/journeys/{journey_id}/stats | View journey stats | +| [**viewJourneys**](DefaultApi.md#viewJourneys) | **GET** /apps/{app_id}/journeys | View journeys | | [**viewTemplate**](DefaultApi.md#viewTemplate) | **GET** /templates/{template_id} | View template | | [**viewTemplates**](DefaultApi.md#viewTemplates) | **GET** /templates | View templates | @@ -624,6 +631,82 @@ public class Example { | **429** | Rate Limit Exceeded | - | | **0** | Unexpected error | - | + +# **createJourney** +> Journey createJourney(appId, createJourneyRequest) + +Create journey + +The Journeys API is in beta. Endpoints and response fields can still change. Create a new journey with an audience and a node graph. Journeys are always created in the draft state. The authenticated App API key must have permission to create journeys. + +### Example +```java +// Import classes: +import com.onesignal.client.ApiClient; +import com.onesignal.client.ApiException; +import com.onesignal.client.Configuration; +import com.onesignal.client.auth.*; +import com.onesignal.client.model.*; +import com.onesignal.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.onesignal.com"); + + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("YOUR_REST_API_KEY"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "YOUR_APP_ID"; // String | Your OneSignal App ID in UUID v4 format. + CreateJourneyRequest createJourneyRequest = new CreateJourneyRequest(); // CreateJourneyRequest | + try { + Journey result = apiInstance.createJourney(appId, createJourneyRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#createJourney"); + System.err.println("Status code: " + e.getCode()); + // getErrorMessages() flattens any error-envelope shape to a List; + // the raw body remains on getResponseBody(). + System.err.println("Error messages: " + e.getErrorMessages()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| Your OneSignal App ID in UUID v4 format. | | +| **createJourneyRequest** | [**CreateJourneyRequest**](CreateJourneyRequest.md)| | | + +### Return type + +[**Journey**](Journey.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-java-api#configuration) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Created | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **429** | Rate Limit Exceeded | - | +| **0** | Unexpected error | - | + # **createNotification** > CreateNotificationSuccessResponse createNotification(notification) @@ -1266,6 +1349,82 @@ public class Example { | **400** | Bad Request | - | | **0** | Unexpected error | - | + +# **deleteJourney** +> GenericSuccessBoolResponse deleteJourney(appId, journeyId) + +Delete journey + +The Journeys API is in beta. Endpoints and response fields can still change. Permanently delete a journey by its UUID. Returns { \"success\": true } on success. The authenticated App API key must have permission to delete journeys. Deleting a journey stops any in-flight users and cannot be undone. Archive a running journey instead if you need to keep its data. + +### Example +```java +// Import classes: +import com.onesignal.client.ApiClient; +import com.onesignal.client.ApiException; +import com.onesignal.client.Configuration; +import com.onesignal.client.auth.*; +import com.onesignal.client.model.*; +import com.onesignal.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.onesignal.com"); + + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("YOUR_REST_API_KEY"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "YOUR_APP_ID"; // String | Your OneSignal App ID in UUID v4 format. + String journeyId = "YOUR_JOURNEY_ID"; // String | UUID of the journey to delete. + try { + GenericSuccessBoolResponse result = apiInstance.deleteJourney(appId, journeyId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deleteJourney"); + System.err.println("Status code: " + e.getCode()); + // getErrorMessages() flattens any error-envelope shape to a List; + // the raw body remains on getResponseBody(). + System.err.println("Error messages: " + e.getErrorMessages()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| Your OneSignal App ID in UUID v4 format. | | +| **journeyId** | **String**| UUID of the journey to delete. | | + +### Return type + +[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-java-api#configuration) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **429** | Rate Limit Exceeded | - | +| **0** | Unexpected error | - | + # **deleteSegment** > GenericSuccessBoolResponse deleteSegment(appId, segmentId) @@ -3121,6 +3280,170 @@ public class Example { | **429** | Rate Limit Exceeded | - | | **0** | Unexpected error | - | + +# **updateJourney** +> Journey updateJourney(appId, journeyId, updateJourneyRequest) + +Update journey + +The Journeys API is in beta. Endpoints and response fields can still change. Apply a partial update to a journey using JSON Merge Patch (RFC 7396). Send only the fields you want to change; omitted fields are left unchanged. A null value clears a nullable field, and arrays such as nodes are replaced wholesale. Set state to active to activate a draft journey. + +### Example +```java +// Import classes: +import com.onesignal.client.ApiClient; +import com.onesignal.client.ApiException; +import com.onesignal.client.Configuration; +import com.onesignal.client.auth.*; +import com.onesignal.client.model.*; +import com.onesignal.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.onesignal.com"); + + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("YOUR_REST_API_KEY"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "YOUR_APP_ID"; // String | Your OneSignal App ID in UUID v4 format. + String journeyId = "YOUR_JOURNEY_ID"; // String | UUID of the journey to update. + UpdateJourneyRequest updateJourneyRequest = new UpdateJourneyRequest(); // UpdateJourneyRequest | + try { + Journey result = apiInstance.updateJourney(appId, journeyId, updateJourneyRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#updateJourney"); + System.err.println("Status code: " + e.getCode()); + // getErrorMessages() flattens any error-envelope shape to a List; + // the raw body remains on getResponseBody(). + System.err.println("Error messages: " + e.getErrorMessages()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| Your OneSignal App ID in UUID v4 format. | | +| **journeyId** | **String**| UUID of the journey to update. | | +| **updateJourneyRequest** | [**UpdateJourneyRequest**](UpdateJourneyRequest.md)| | | + +### Return type + +[**Journey**](Journey.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-java-api#configuration) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **409** | Conflict | - | +| **422** | Unprocessable Entity | - | +| **429** | Rate Limit Exceeded | - | +| **0** | Unexpected error | - | + + +# **updateJourneyNode** +> Journey updateJourneyNode(appId, journeyId, nodeId, updateJourneyNodeRequest) + +Update journey node + +The Journeys API is in beta. Endpoints and response fields can still change. Apply a partial update to a single node, located by its server-assigned id, using JSON Merge Patch (RFC 7396). Send only the node fields you want to change; the rest of the node and the rest of the journey graph are left untouched. Returns the full updated journey. + +### Example +```java +// Import classes: +import com.onesignal.client.ApiClient; +import com.onesignal.client.ApiException; +import com.onesignal.client.Configuration; +import com.onesignal.client.auth.*; +import com.onesignal.client.model.*; +import com.onesignal.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.onesignal.com"); + + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("YOUR_REST_API_KEY"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "YOUR_APP_ID"; // String | Your OneSignal App ID in UUID v4 format. + String journeyId = "YOUR_JOURNEY_ID"; // String | UUID of the journey that owns the node. + String nodeId = "YOUR_NODE_ID"; // String | Server-assigned UUID of the node to update, from a prior View journey fetch. + UpdateJourneyNodeRequest updateJourneyNodeRequest = new UpdateJourneyNodeRequest(); // UpdateJourneyNodeRequest | + try { + Journey result = apiInstance.updateJourneyNode(appId, journeyId, nodeId, updateJourneyNodeRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#updateJourneyNode"); + System.err.println("Status code: " + e.getCode()); + // getErrorMessages() flattens any error-envelope shape to a List; + // the raw body remains on getResponseBody(). + System.err.println("Error messages: " + e.getErrorMessages()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| Your OneSignal App ID in UUID v4 format. | | +| **journeyId** | **String**| UUID of the journey that owns the node. | | +| **nodeId** | **String**| Server-assigned UUID of the node to update, from a prior View journey fetch. | | +| **updateJourneyNodeRequest** | [**UpdateJourneyNodeRequest**](UpdateJourneyNodeRequest.md)| | | + +### Return type + +[**Journey**](Journey.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-java-api#configuration) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **409** | Conflict | - | +| **422** | Unprocessable Entity | - | +| **429** | Rate Limit Exceeded | - | +| **0** | Unexpected error | - | + # **updateLiveActivity** > UpdateLiveActivitySuccessResponse updateLiveActivity(appId, activityId, updateLiveActivityRequest) @@ -3662,6 +3985,234 @@ public class Example { | **400** | Bad Request | - | | **0** | Unexpected error | - | + +# **viewJourney** +> Journey viewJourney(appId, journeyId) + +View journey + +The Journeys API is in beta. Endpoints and response fields can still change. Retrieve the full configuration of a single journey by its UUID, including its audience and node graph. + +### Example +```java +// Import classes: +import com.onesignal.client.ApiClient; +import com.onesignal.client.ApiException; +import com.onesignal.client.Configuration; +import com.onesignal.client.auth.*; +import com.onesignal.client.model.*; +import com.onesignal.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.onesignal.com"); + + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("YOUR_REST_API_KEY"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "YOUR_APP_ID"; // String | Your OneSignal App ID in UUID v4 format. + String journeyId = "YOUR_JOURNEY_ID"; // String | UUID of the journey to retrieve. + try { + Journey result = apiInstance.viewJourney(appId, journeyId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#viewJourney"); + System.err.println("Status code: " + e.getCode()); + // getErrorMessages() flattens any error-envelope shape to a List; + // the raw body remains on getResponseBody(). + System.err.println("Error messages: " + e.getErrorMessages()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| Your OneSignal App ID in UUID v4 format. | | +| **journeyId** | **String**| UUID of the journey to retrieve. | | + +### Return type + +[**Journey**](Journey.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-java-api#configuration) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Not Found | - | +| **429** | Rate Limit Exceeded | - | +| **0** | Unexpected error | - | + + +# **viewJourneyStats** +> JourneyStats viewJourneyStats(appId, journeyId) + +View journey stats + +The Journeys API is in beta. Endpoints and response fields can still change. Retrieve performance stats for a single journey: journey-level entry and exit counts, per-node counts keyed by node id, per-branch counts keyed by branch id, and channel delivery stats for message-sending nodes. The response carries no definition detail, so join it by id against the journey from View journey. + +### Example +```java +// Import classes: +import com.onesignal.client.ApiClient; +import com.onesignal.client.ApiException; +import com.onesignal.client.Configuration; +import com.onesignal.client.auth.*; +import com.onesignal.client.model.*; +import com.onesignal.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.onesignal.com"); + + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("YOUR_REST_API_KEY"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "YOUR_APP_ID"; // String | Your OneSignal App ID in UUID v4 format. + String journeyId = "YOUR_JOURNEY_ID"; // String | UUID of the journey to retrieve stats for. + try { + JourneyStats result = apiInstance.viewJourneyStats(appId, journeyId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#viewJourneyStats"); + System.err.println("Status code: " + e.getCode()); + // getErrorMessages() flattens any error-envelope shape to a List; + // the raw body remains on getResponseBody(). + System.err.println("Error messages: " + e.getErrorMessages()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| Your OneSignal App ID in UUID v4 format. | | +| **journeyId** | **String**| UUID of the journey to retrieve stats for. | | + +### Return type + +[**JourneyStats**](JourneyStats.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-java-api#configuration) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Not Found | - | +| **429** | Rate Limit Exceeded | - | +| **0** | Unexpected error | - | + + +# **viewJourneys** +> JourneyListResponse viewJourneys(appId, cursor, limit) + +View journeys + +The Journeys API is in beta. Endpoints and response fields can still change. Retrieve a paginated list of journeys for an app. Returns a summary representation of each journey; use View journey for the full configuration. Uses forward-only cursor-based pagination. + +### Example +```java +// Import classes: +import com.onesignal.client.ApiClient; +import com.onesignal.client.ApiException; +import com.onesignal.client.Configuration; +import com.onesignal.client.auth.*; +import com.onesignal.client.model.*; +import com.onesignal.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.onesignal.com"); + + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("YOUR_REST_API_KEY"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "YOUR_APP_ID"; // String | Your OneSignal App ID in UUID v4 format. + String cursor = "cursor_example"; // String | Opaque pagination token from a previous response's next_cursor. Omit for the first page. + Integer limit = 50; // Integer | Maximum journeys to return per page. Minimum 1, maximum 50. + try { + JourneyListResponse result = apiInstance.viewJourneys(appId, cursor, limit); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#viewJourneys"); + System.err.println("Status code: " + e.getCode()); + // getErrorMessages() flattens any error-envelope shape to a List; + // the raw body remains on getResponseBody(). + System.err.println("Error messages: " + e.getErrorMessages()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| Your OneSignal App ID in UUID v4 format. | | +| **cursor** | **String**| Opaque pagination token from a previous response's next_cursor. Omit for the first page. | [optional] | +| **limit** | **Integer**| Maximum journeys to return per page. Minimum 1, maximum 50. | [optional] [default to 50] | + +### Return type + +[**JourneyListResponse**](JourneyListResponse.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-java-api#configuration) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **429** | Rate Limit Exceeded | - | +| **0** | Unexpected error | - | + # **viewTemplate** > TemplateResource viewTemplate(templateId, appId) diff --git a/docs/Journey.md b/docs/Journey.md new file mode 100644 index 0000000..e4f96ee --- /dev/null +++ b/docs/Journey.md @@ -0,0 +1,41 @@ + + +# Journey + +Full journey representation returned by the detail, create, and update endpoints. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | Journey UUID. Read-only. | [optional] | +|**appId** | **String** | UUID of the app the journey belongs to. Read-only. | [optional] | +|**name** | **String** | Journey name, up to 300 characters. | [optional] | +|**description** | **String** | Journey description, up to 1024 characters. Defaults to an empty string. | [optional] | +|**state** | [**StateEnum**](#StateEnum) | Journey state. New journeys are created as draft. processing is transient while activation is in progress. archived is a journey that has been stopped. Change it through the state field on Update journey. | [optional] | +|**createdAt** | **String** | ISO 8601 creation time. Read-only. | [optional] | +|**updatedAt** | **String** | ISO 8601 last-update time. Read-only. | [optional] | +|**startedAt** | **String** | ISO 8601 time the journey was activated, or null. Read-only. May stay null briefly after you set state to active: activation is enqueued, and started_at populates once the journey finishes processing. | [optional] | +|**archivedAt** | **String** | ISO 8601 time the journey was archived, or null. Read-only. | [optional] | +|**createdSource** | **String** | Origin of the journey, for example public_api or dashboard. Read-only. | [optional] | +|**audience** | [**JourneyAudience**](JourneyAudience.md) | | [optional] | +|**earlyExit** | [**JourneyEarlyExit**](JourneyEarlyExit.md) | | [optional] | +|**reentryRules** | [**JourneyReentryRules**](JourneyReentryRules.md) | | [optional] | +|**schedule** | [**JourneySchedule**](JourneySchedule.md) | | [optional] | +|**nodes** | [**List<JourneyNode>**](JourneyNode.md) | Ordered list of journey nodes. | [optional] | +|**concurrencyKey** | **String** | Opaque optimistic-concurrency token. Read-only. Pass it back on update to guard against overwriting a concurrent change (409). Send it back exactly as read; do not construct or parse it. | [optional] | + + + +## Enum: StateEnum + +| Name | Value | +|---- | -----| +| DRAFT | "draft" | +| SCHEDULED | "scheduled" | +| PROCESSING | "processing" | +| ACTIVE | "active" | +| ARCHIVED | "archived" | + + + diff --git a/docs/JourneyAudience.md b/docs/JourneyAudience.md new file mode 100644 index 0000000..8899f99 --- /dev/null +++ b/docs/JourneyAudience.md @@ -0,0 +1,28 @@ + + +# JourneyAudience + +The journey entry audience. The kind field selects which other fields apply. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**kind** | [**KindEnum**](#KindEnum) | Audience kind. Selects which other fields apply. | | +|**includedSegmentIds** | **List<String>** | segment audiences: Segment UUIDs whose users enter the journey. | [optional] | +|**excludedSegmentIds** | **List<String>** | segment audiences: Segment UUIDs whose users are excluded. | [optional] | +|**futureAdditionsOnly** | **Boolean** | segment audiences: when true, only users who newly match the segment after activation enter the journey. Defaults to false. | [optional] | +|**name** | **String** | event_trigger audiences: event name that triggers entry, up to 255 characters. | [optional] | +|**attributes** | **List<List<JourneyEventAttribute>>** | Event attribute matchers, as a list of condition groups. Send a single group whose conditions are AND'd together. More than one group is rejected. | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| SEGMENT | "segment" | +| EVENT_TRIGGER | "event_trigger" | + + + diff --git a/docs/JourneyBranch.md b/docs/JourneyBranch.md new file mode 100644 index 0000000..1c27a32 --- /dev/null +++ b/docs/JourneyBranch.md @@ -0,0 +1,16 @@ + + +# JourneyBranch + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | Server-assigned branch identifier. Read-only on create; echo it on update to keep the branch. | [optional] | +|**condition** | [**JourneyCondition**](JourneyCondition.md) | | [optional] | +|**weight** | **BigDecimal** | Branch weight for split_range nodes. Weights across a node's branches must sum to 100. | [optional] | +|**nodes** | [**List<JourneyNode>**](JourneyNode.md) | Nodes run when this branch is taken, before flow converges to the next sibling node. | [optional] | + + + diff --git a/docs/JourneyBranchStats.md b/docs/JourneyBranchStats.md new file mode 100644 index 0000000..a818759 --- /dev/null +++ b/docs/JourneyBranchStats.md @@ -0,0 +1,14 @@ + + +# JourneyBranchStats + +Stats for a single branch of a branching node. Keyed in the response by the branch's server-assigned id. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**completed** | **Integer** | Users who took this branch. | [optional] | + + + diff --git a/docs/JourneyCondition.md b/docs/JourneyCondition.md new file mode 100644 index 0000000..1a81ac1 --- /dev/null +++ b/docs/JourneyCondition.md @@ -0,0 +1,42 @@ + + +# JourneyCondition + +A branch condition. The kind field selects which other fields apply. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**kind** | [**KindEnum**](#KindEnum) | Condition kind. Selects which other fields apply. | | +|**includedSegmentIds** | **List<String>** | segment_membership conditions: Segment UUIDs the user must belong to. | [optional] | +|**excludedSegmentIds** | **List<String>** | segment_membership conditions: Segment UUIDs the user must not belong to. | [optional] | +|**action** | [**ActionEnum**](#ActionEnum) | on_notification_action conditions: the notification action to branch on. Which actions apply depends on the sending node's channel. | [optional] | +|**sendingNodeId** | **String** | on_notification_action conditions: id of the sending node this action refers to. Returned on reads; accepted on write. | [optional] | +|**clientNodeId** | **String** | on_notification_action conditions: write-only alternative to sending_node_id. References the sending node by its client_node_id. | [optional] | +|**name** | **String** | event_trigger conditions: event name, up to 255 characters. | [optional] | +|**attributes** | **List<List<JourneyEventAttribute>>** | Event attribute matchers, as a list of condition groups. Send a single group whose conditions are AND'd together. More than one group is rejected. | [optional] | +|**entryEventMatchAttributes** | **List<Object>** | event_trigger conditions: match incoming event properties against the journey's entry event. Only valid on event-triggered journeys. | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| SEGMENT_MEMBERSHIP | "segment_membership" | +| ON_NOTIFICATION_ACTION | "on_notification_action" | +| EVENT_TRIGGER | "event_trigger" | + + + +## Enum: ActionEnum + +| Name | Value | +|---- | -----| +| RECEIVED | "received" | +| CLICKED | "clicked" | +| OPENED | "opened" | + + + diff --git a/docs/JourneyEarlyExit.md b/docs/JourneyEarlyExit.md new file mode 100644 index 0000000..0840006 --- /dev/null +++ b/docs/JourneyEarlyExit.md @@ -0,0 +1,15 @@ + + +# JourneyEarlyExit + +Conditions that remove a user from the journey before it completes. At least one rule must be set under rules. Send null to remove early exit entirely. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**rules** | [**JourneyEarlyExitRules**](JourneyEarlyExitRules.md) | | [optional] | +|**tagOnEarlyExit** | **Map<String, String>** | Tag key-value pairs applied when a user exits early. | [optional] | + + + diff --git a/docs/JourneyEarlyExitRules.md b/docs/JourneyEarlyExitRules.md new file mode 100644 index 0000000..d91c234 --- /dev/null +++ b/docs/JourneyEarlyExitRules.md @@ -0,0 +1,16 @@ + + +# JourneyEarlyExitRules + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**onSegment** | [**JourneyEarlyExitRulesOnSegment**](JourneyEarlyExitRulesOnSegment.md) | | [optional] | +|**whenNotInAudience** | **Boolean** | Exit when the user no longer matches the journey audience. Defaults to false. | [optional] | +|**onSession** | **Boolean** | Exit on a new session start. Defaults to false. | [optional] | +|**onEvent** | [**JourneyEarlyExitRulesOnEvent**](JourneyEarlyExitRulesOnEvent.md) | | [optional] | + + + diff --git a/docs/JourneyEarlyExitRulesOnEvent.md b/docs/JourneyEarlyExitRulesOnEvent.md new file mode 100644 index 0000000..472e167 --- /dev/null +++ b/docs/JourneyEarlyExitRulesOnEvent.md @@ -0,0 +1,13 @@ + + +# JourneyEarlyExitRulesOnEvent + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Exit when this event occurs. Up to 255 characters. | | + + + diff --git a/docs/JourneyEarlyExitRulesOnSegment.md b/docs/JourneyEarlyExitRulesOnSegment.md new file mode 100644 index 0000000..e97e764 --- /dev/null +++ b/docs/JourneyEarlyExitRulesOnSegment.md @@ -0,0 +1,13 @@ + + +# JourneyEarlyExitRulesOnSegment + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**includedSegmentIds** | **List<String>** | Exit when the user enters any of these segments. | [optional] | + + + diff --git a/docs/JourneyEventAttribute.md b/docs/JourneyEventAttribute.md new file mode 100644 index 0000000..adb85fa --- /dev/null +++ b/docs/JourneyEventAttribute.md @@ -0,0 +1,34 @@ + + +# JourneyEventAttribute + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**key** | **String** | Event attribute key. | | +|**operator** | [**OperatorEnum**](#OperatorEnum) | Comparison operator. | | +|**value** | **String** | Value to compare against. Not required for exists and not_exists. | [optional] | + + + +## Enum: OperatorEnum + +| Name | Value | +|---- | -----| +| EQUAL | "equal" | +| NOT_EQUAL | "not_equal" | +| LESS | "less" | +| LESS_OR_EQUAL | "less_or_equal" | +| GREATER_OR_EQUAL | "greater_or_equal" | +| GREATER | "greater" | +| IS | "is" | +| IS_NOT | "is_not" | +| EXISTS | "exists" | +| NOT_EXISTS | "not_exists" | +| BEFORE | "before" | +| AFTER | "after" | + + + diff --git a/docs/JourneyListAudience.md b/docs/JourneyListAudience.md new file mode 100644 index 0000000..4494e9e --- /dev/null +++ b/docs/JourneyListAudience.md @@ -0,0 +1,23 @@ + + +# JourneyListAudience + +Entry audience reduced to its kind. Use View journey for the full audience configuration. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**kind** | [**KindEnum**](#KindEnum) | Audience kind. | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| SEGMENT | "segment" | +| EVENT_TRIGGER | "event_trigger" | + + + diff --git a/docs/JourneyListItem.md b/docs/JourneyListItem.md new file mode 100644 index 0000000..20f7acd --- /dev/null +++ b/docs/JourneyListItem.md @@ -0,0 +1,37 @@ + + +# JourneyListItem + +Summary journey representation returned by the list endpoint. Excludes description, nodes, early-exit configuration, and concurrency_key. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | Journey UUID. Read-only. | [optional] | +|**appId** | **String** | UUID of the app the journey belongs to. Read-only. | [optional] | +|**name** | **String** | Journey name, up to 300 characters. | [optional] | +|**state** | [**StateEnum**](#StateEnum) | Journey state. New journeys are created as draft. processing is transient while activation is in progress. archived is a journey that has been stopped. Change it through the state field on Update journey. | [optional] | +|**createdAt** | **String** | ISO 8601 creation time. Read-only. | [optional] | +|**updatedAt** | **String** | ISO 8601 last-update time. Read-only. | [optional] | +|**startedAt** | **String** | ISO 8601 time the journey was activated, or null. Read-only. | [optional] | +|**archivedAt** | **String** | ISO 8601 time the journey was archived, or null. Read-only. | [optional] | +|**createdSource** | **String** | Origin of the journey, for example public_api or dashboard. Read-only. | [optional] | +|**schedule** | [**JourneySchedule**](JourneySchedule.md) | | [optional] | +|**audience** | [**JourneyListAudience**](JourneyListAudience.md) | | [optional] | +|**reentryRules** | [**JourneyReentryRules**](JourneyReentryRules.md) | | [optional] | + + + +## Enum: StateEnum + +| Name | Value | +|---- | -----| +| DRAFT | "draft" | +| SCHEDULED | "scheduled" | +| PROCESSING | "processing" | +| ACTIVE | "active" | +| ARCHIVED | "archived" | + + + diff --git a/docs/JourneyListResponse.md b/docs/JourneyListResponse.md new file mode 100644 index 0000000..edf059b --- /dev/null +++ b/docs/JourneyListResponse.md @@ -0,0 +1,15 @@ + + +# JourneyListResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**journeys** | [**List<JourneyListItem>**](JourneyListItem.md) | Journeys ordered by creation time, newest first. | [optional] | +|**hasMore** | **Boolean** | true if more journeys exist beyond this page. | [optional] | +|**nextCursor** | **String** | Cursor for the next page. Present only when has_more is true. | [optional] | + + + diff --git a/docs/JourneyMessageStats.md b/docs/JourneyMessageStats.md new file mode 100644 index 0000000..67bb6b1 --- /dev/null +++ b/docs/JourneyMessageStats.md @@ -0,0 +1,14 @@ + + +# JourneyMessageStats + +Delivery stats for a message-sending node. Present only on send_push, send_email, send_sms, send_iam, and send_webhook nodes. The keys inside totals depend on the node's channel. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**totals** | **Map<String, BigDecimal>** | All-time totals for this node, keyed by channel-specific stat name. | [optional] | + + + diff --git a/docs/JourneyNode.md b/docs/JourneyNode.md new file mode 100644 index 0000000..2e2deb9 --- /dev/null +++ b/docs/JourneyNode.md @@ -0,0 +1,57 @@ + + +# JourneyNode + +A journey node. The kind field selects which other fields apply. Branching nodes (split_range, yes_no, wait_until) nest their sub-graphs inline via branches[].nodes. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | Server-assigned node UUID. Returned on reads. Required on update to keep an existing node. Rejected on create with a 400 validation error. | [optional] | +|**kind** | [**KindEnum**](#KindEnum) | Node kind. Selects which other fields apply. | | +|**clientNodeId** | **String** | Optional client-assigned identifier, unique within the journey. Use it to reference this node from elsewhere in the same request. Persisted and returned on reads. | [optional] | +|**annotation** | **String** | Optional free-text label, up to 255 characters. Stored and returned as-is with no effect on journey behavior. | [optional] | +|**durationSeconds** | **Integer** | wait nodes: seconds to hold the user. Minimum 60, maximum 31556952 (1 year). | [optional] | +|**relativeTo** | [**RelativeToEnum**](#RelativeToEnum) | time_window nodes: schedule_in_timezone uses the configured windows; last_active_time holds relative to the user's last active time. | [optional] | +|**windows** | [**List<JourneyTimeWindow>**](JourneyTimeWindow.md) | time_window nodes: one or more time windows. A window with no day_of_week applies to every day. Required when relative_to is schedule_in_timezone; omit when it is last_active_time. | [optional] | +|**timeZone** | **String** | time_window nodes: IANA timezone identifier used when the user's timezone is unavailable. | [optional] | +|**useUserTimeZone** | **Boolean** | time_window nodes: when true, uses the user's timezone if available. | [optional] | +|**templateId** | **String** | send_push, send_email, and send_sms nodes: UUID of the template to send. | [optional] | +|**iamId** | **String** | send_iam nodes: UUID of the in-app message to send. | [optional] | +|**userTtlSeconds** | **Integer** | send_iam nodes: optional time-to-live for the in-app message, in seconds. | [optional] | +|**webhookId** | **String** | send_webhook nodes: UUID of the webhook to send. | [optional] | +|**assignments** | **Map<String, String>** | tag nodes: tag key-value pairs to assign. An empty string value removes the tag. Keys are limited to 255 characters and values to 1024. | [optional] | +|**randomizeOnEntry** | **Boolean** | split_range nodes: when true, assigns each user to a branch at random on entry. Defaults to false. | [optional] | +|**branches** | [**List<JourneyBranch>**](JourneyBranch.md) | Branching nodes: nested branches. split_range requires 2-20 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-10 condition branches. | [optional] | +|**expiration** | [**JourneyWaitUntilExpiration**](JourneyWaitUntilExpiration.md) | | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| WAIT | "wait" | +| TIME_WINDOW | "time_window" | +| SEND_PUSH | "send_push" | +| SEND_EMAIL | "send_email" | +| SEND_SMS | "send_sms" | +| SEND_IAM | "send_iam" | +| SEND_WEBHOOK | "send_webhook" | +| TAG | "tag" | +| SPLIT_RANGE | "split_range" | +| YES_NO | "yes_no" | +| WAIT_UNTIL | "wait_until" | + + + +## Enum: RelativeToEnum + +| Name | Value | +|---- | -----| +| SCHEDULE_IN_TIMEZONE | "schedule_in_timezone" | +| LAST_ACTIVE_TIME | "last_active_time" | + + + diff --git a/docs/JourneyNodeStats.md b/docs/JourneyNodeStats.md new file mode 100644 index 0000000..db3343a --- /dev/null +++ b/docs/JourneyNodeStats.md @@ -0,0 +1,36 @@ + + +# JourneyNodeStats + +Stats for a single node. Keyed in the response by the node's server-assigned id. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**kind** | [**KindEnum**](#KindEnum) | Node kind, repeated here so stats can be read without joining against the journey definition. | [optional] | +|**waiting** | **Integer** | Users currently held at this node. | [optional] | +|**completed** | **Integer** | Users who advanced past this node normally. | [optional] | +|**exitedEarly** | **Integer** | Users who left the journey from this node through an early exit rule. | [optional] | +|**messageStats** | [**JourneyMessageStats**](JourneyMessageStats.md) | | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| WAIT | "wait" | +| TIME_WINDOW | "time_window" | +| SEND_PUSH | "send_push" | +| SEND_EMAIL | "send_email" | +| SEND_SMS | "send_sms" | +| SEND_IAM | "send_iam" | +| SEND_WEBHOOK | "send_webhook" | +| TAG | "tag" | +| SPLIT_RANGE | "split_range" | +| YES_NO | "yes_no" | +| WAIT_UNTIL | "wait_until" | + + + diff --git a/docs/JourneyReentryRules.md b/docs/JourneyReentryRules.md new file mode 100644 index 0000000..d7a0e6b --- /dev/null +++ b/docs/JourneyReentryRules.md @@ -0,0 +1,14 @@ + + +# JourneyReentryRules + +Controls whether and how soon a user can re-enter the journey. null means re-entry is not allowed. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**durationSeconds** | **Integer** | Minimum seconds before a user can re-enter. Must be at least 600 (10 minutes). | [optional] | + + + diff --git a/docs/JourneySchedule.md b/docs/JourneySchedule.md new file mode 100644 index 0000000..2af6b8f --- /dev/null +++ b/docs/JourneySchedule.md @@ -0,0 +1,16 @@ + + +# JourneySchedule + +Optional future start and/or stop time. null means no scheduled activation. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**startAt** | **String** | ISO 8601 start time. Use UTC (Z or +00:00). Must be at least 5 minutes in the future. | [optional] | +|**stopAt** | **String** | ISO 8601 stop time. Use UTC (Z or +00:00). Must be in the future and later than start_at. | [optional] | +|**error** | **String** | Read-only. Present when a scheduling error occurred. | [optional] | + + + diff --git a/docs/JourneyStats.md b/docs/JourneyStats.md new file mode 100644 index 0000000..92e3236 --- /dev/null +++ b/docs/JourneyStats.md @@ -0,0 +1,19 @@ + + +# JourneyStats + +Journey-level counts plus flat, id-keyed maps of node and branch stats. Contains no definition detail; join it by id against the journey from View journey. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | UUID of the journey these stats belong to. | [optional] | +|**started** | **Integer** | Users who entered the journey. | [optional] | +|**completed** | **Integer** | Users who reached the end of the journey normally. | [optional] | +|**exitedEarly** | **Integer** | Users who left the journey through an early exit rule. | [optional] | +|**nodes** | [**Map<String, JourneyNodeStats>**](JourneyNodeStats.md) | Node stats keyed by node id. Includes every node in the graph, at any nesting depth. | [optional] | +|**branches** | [**Map<String, JourneyBranchStats>**](JourneyBranchStats.md) | Branch stats keyed by branch id. Empty for a journey with no branching nodes. | [optional] | + + + diff --git a/docs/JourneyTimePoint.md b/docs/JourneyTimePoint.md new file mode 100644 index 0000000..66cd881 --- /dev/null +++ b/docs/JourneyTimePoint.md @@ -0,0 +1,14 @@ + + +# JourneyTimePoint + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**hour** | **Integer** | Hour of day, 0-23. | [optional] | +|**minute** | **Integer** | Minute of hour, 0-59. Defaults to 0. | [optional] | + + + diff --git a/docs/JourneyTimeWindow.md b/docs/JourneyTimeWindow.md new file mode 100644 index 0000000..831d648 --- /dev/null +++ b/docs/JourneyTimeWindow.md @@ -0,0 +1,16 @@ + + +# JourneyTimeWindow + +A wall-clock window. Each window must span at least 15 minutes. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**start** | [**JourneyTimePoint**](JourneyTimePoint.md) | When the window opens. | [optional] | +|**end** | [**JourneyTimePoint**](JourneyTimePoint.md) | When the window closes. | [optional] | +|**dayOfWeek** | **Integer** | Day of week, 1 = Monday. Omit to apply the window to every day. | [optional] | + + + diff --git a/docs/JourneyWaitUntilExpiration.md b/docs/JourneyWaitUntilExpiration.md new file mode 100644 index 0000000..da02f08 --- /dev/null +++ b/docs/JourneyWaitUntilExpiration.md @@ -0,0 +1,15 @@ + + +# JourneyWaitUntilExpiration + +Optional expiration timer. null waits indefinitely. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**durationSeconds** | **Integer** | Seconds to wait before the timer fires. Minimum 60, maximum 31556952 (1 year). | [optional] | +|**exits** | **Boolean** | When true, the user exits the journey when the timer fires; when false, the user continues to convergence. | [optional] | + + + diff --git a/docs/UpdateJourneyNodeRequest.md b/docs/UpdateJourneyNodeRequest.md new file mode 100644 index 0000000..44864eb --- /dev/null +++ b/docs/UpdateJourneyNodeRequest.md @@ -0,0 +1,38 @@ + + +# UpdateJourneyNodeRequest + +Node fields to change, merged onto the current node. Send only the fields you want to change. The node's kind and id cannot be changed. Send null to clear a nullable field. Which other fields apply depends on the node's kind, matching JourneyNode. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**clientNodeId** | **String** | Optional client-assigned identifier, unique within the journey. Use it to reference this node from elsewhere in the same request. Persisted and returned on reads. | [optional] | +|**annotation** | **String** | Optional free-text label, up to 255 characters. Stored and returned as-is with no effect on journey behavior. | [optional] | +|**durationSeconds** | **Integer** | wait nodes: seconds to hold the user. Minimum 60, maximum 31556952 (1 year). | [optional] | +|**relativeTo** | [**RelativeToEnum**](#RelativeToEnum) | time_window nodes: schedule_in_timezone uses the configured windows; last_active_time holds relative to the user's last active time. | [optional] | +|**windows** | [**List<JourneyTimeWindow>**](JourneyTimeWindow.md) | time_window nodes: one or more time windows. A window with no day_of_week applies to every day. Required when relative_to is schedule_in_timezone; omit when it is last_active_time. | [optional] | +|**timeZone** | **String** | time_window nodes: IANA timezone identifier used when the user's timezone is unavailable. | [optional] | +|**useUserTimeZone** | **Boolean** | time_window nodes: when true, uses the user's timezone if available. | [optional] | +|**templateId** | **String** | send_push, send_email, and send_sms nodes: UUID of the template to send. | [optional] | +|**iamId** | **String** | send_iam nodes: UUID of the in-app message to send. | [optional] | +|**userTtlSeconds** | **Integer** | send_iam nodes: optional time-to-live for the in-app message, in seconds. | [optional] | +|**webhookId** | **String** | send_webhook nodes: UUID of the webhook to send. | [optional] | +|**assignments** | **Map<String, String>** | tag nodes: tag key-value pairs to assign. An empty string value removes the tag. Keys are limited to 255 characters and values to 1024. | [optional] | +|**randomizeOnEntry** | **Boolean** | split_range nodes: when true, assigns each user to a branch at random on entry. Defaults to false. | [optional] | +|**branches** | [**List<JourneyBranch>**](JourneyBranch.md) | Branching nodes: nested branches. split_range requires 2-20 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-10 condition branches. | [optional] | +|**expiration** | [**JourneyWaitUntilExpiration**](JourneyWaitUntilExpiration.md) | | [optional] | +|**concurrencyKey** | **String** | Optional optimistic-concurrency token. Pass the concurrency_key from a prior fetch to reject the update with 409 if the journey changed. Omit to skip the check. It is not merged onto the node. | [optional] | + + + +## Enum: RelativeToEnum + +| Name | Value | +|---- | -----| +| SCHEDULE_IN_TIMEZONE | "schedule_in_timezone" | +| LAST_ACTIVE_TIME | "last_active_time" | + + + diff --git a/docs/UpdateJourneyRequest.md b/docs/UpdateJourneyRequest.md new file mode 100644 index 0000000..e0b9b65 --- /dev/null +++ b/docs/UpdateJourneyRequest.md @@ -0,0 +1,33 @@ + + +# UpdateJourneyRequest + +Partial update applied with JSON Merge Patch (RFC 7396). Send only the fields you want to change. A null value clears a nullable field. Arrays such as nodes are replaced wholesale. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Journey name. | [optional] | +|**description** | **String** | Journey description. Send null to clear it. | [optional] | +|**audience** | [**JourneyAudience**](JourneyAudience.md) | | [optional] | +|**earlyExit** | [**JourneyEarlyExit**](JourneyEarlyExit.md) | | [optional] | +|**reentryRules** | [**JourneyReentryRules**](JourneyReentryRules.md) | | [optional] | +|**schedule** | [**JourneySchedule**](JourneySchedule.md) | | [optional] | +|**nodes** | [**List<JourneyNode>**](JourneyNode.md) | Full ordered list of nodes, which replaces the existing graph wholesale. Preserve each node's server-assigned id from a prior fetch to keep in-flight users on that node; omit id to add a new node. | [optional] | +|**state** | [**StateEnum**](#StateEnum) | Target state. Set active to activate a draft journey, or scheduled together with a future schedule.start_at to activate it later. Set archived to stop a running journey; archiving is permanent. Only scheduled and processing journeys can return to draft. | [optional] | +|**concurrencyKey** | **String** | Optional optimistic-concurrency token. Pass the concurrency_key from a prior fetch to reject the update with 409 if the journey changed. Omit to skip the check. | [optional] | + + + +## Enum: StateEnum + +| Name | Value | +|---- | -----| +| DRAFT | "draft" | +| SCHEDULED | "scheduled" | +| ACTIVE | "active" | +| ARCHIVED | "archived" | + + + diff --git a/pom.xml b/pom.xml index 6ee4f28..69acb94 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ onesignal-java-client jar onesignal-java-client - 5.11.2 + 5.12.0 https://github.com/OneSignal/onesignal-java-api OneSignal Java API Client diff --git a/src/main/java/com/onesignal/client/ApiClient.java b/src/main/java/com/onesignal/client/ApiClient.java index 326c9ea..255b0fe 100644 --- a/src/main/java/com/onesignal/client/ApiClient.java +++ b/src/main/java/com/onesignal/client/ApiClient.java @@ -132,7 +132,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/5.11.2/java"); + setUserAgent("OpenAPI-Generator/5.12.0/java"); authentications = new HashMap(); } diff --git a/src/main/java/com/onesignal/client/JSON.java b/src/main/java/com/onesignal/client/JSON.java index 0178969..002b2d1 100644 --- a/src/main/java/com/onesignal/client/JSON.java +++ b/src/main/java/com/onesignal/client/JSON.java @@ -106,6 +106,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri .registerTypeAdapterFactory(new com.onesignal.client.model.CopyTemplateRequest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.CreateApiKeyRequest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.CreateApiKeyResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.CreateJourneyRequest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.CreateNotificationSuccessResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.CreateSegmentConflictResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.CreateSegmentSuccessResponse.CustomTypeAdapterFactory()) @@ -126,6 +127,28 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri .registerTypeAdapterFactory(new com.onesignal.client.model.GetNotificationHistoryRequestBody.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.GetSegmentSuccessResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.GetSegmentsSuccessResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.Journey.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.JourneyAudience.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.JourneyBranch.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.JourneyBranchStats.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.JourneyCondition.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.JourneyEarlyExit.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.JourneyEarlyExitRules.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.JourneyEarlyExitRulesOnEvent.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.JourneyEarlyExitRulesOnSegment.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.JourneyEventAttribute.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.JourneyListAudience.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.JourneyListItem.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.JourneyListResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.JourneyMessageStats.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.JourneyNode.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.JourneyNodeStats.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.JourneyReentryRules.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.JourneySchedule.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.JourneyStats.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.JourneyTimePoint.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.JourneyTimeWindow.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.JourneyWaitUntilExpiration.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.LanguageStringMap.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.ListAuditLogsSuccessResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.Notification.CustomTypeAdapterFactory()) @@ -159,6 +182,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri .registerTypeAdapterFactory(new com.onesignal.client.model.TemplatesListResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.TransferSubscriptionRequestBody.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateApiKeyRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateJourneyNodeRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateJourneyRequest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateLiveActivityRequest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateLiveActivitySuccessResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateSegmentRequest.CustomTypeAdapterFactory()) diff --git a/src/main/java/com/onesignal/client/api/DefaultApi.java b/src/main/java/com/onesignal/client/api/DefaultApi.java index 160d3f3..7b65887 100644 --- a/src/main/java/com/onesignal/client/api/DefaultApi.java +++ b/src/main/java/com/onesignal/client/api/DefaultApi.java @@ -31,6 +31,7 @@ import com.onesignal.client.model.CopyTemplateRequest; import com.onesignal.client.model.CreateApiKeyRequest; import com.onesignal.client.model.CreateApiKeyResponse; +import com.onesignal.client.model.CreateJourneyRequest; import com.onesignal.client.model.CreateNotificationSuccessResponse; import com.onesignal.client.model.CreateSegmentConflictResponse; import com.onesignal.client.model.CreateSegmentSuccessResponse; @@ -45,6 +46,9 @@ import com.onesignal.client.model.GetNotificationHistoryRequestBody; import com.onesignal.client.model.GetSegmentSuccessResponse; import com.onesignal.client.model.GetSegmentsSuccessResponse; +import com.onesignal.client.model.Journey; +import com.onesignal.client.model.JourneyListResponse; +import com.onesignal.client.model.JourneyStats; import com.onesignal.client.model.ListAuditLogsSuccessResponse; import com.onesignal.client.model.Notification; import com.onesignal.client.model.NotificationHistorySuccessResponse; @@ -61,6 +65,8 @@ import com.onesignal.client.model.TemplatesListResponse; import com.onesignal.client.model.TransferSubscriptionRequestBody; import com.onesignal.client.model.UpdateApiKeyRequest; +import com.onesignal.client.model.UpdateJourneyNodeRequest; +import com.onesignal.client.model.UpdateJourneyRequest; import com.onesignal.client.model.UpdateLiveActivityRequest; import com.onesignal.client.model.UpdateLiveActivitySuccessResponse; import com.onesignal.client.model.UpdateSegmentRequest; @@ -158,7 +164,7 @@ public okhttp3.Call cancelNotificationCall(String appId, String notificationId, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -316,7 +322,7 @@ public okhttp3.Call copyTemplateToAppCall(String templateId, String appId, CopyT Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -482,7 +488,7 @@ public okhttp3.Call createAliasCall(String appId, String aliasLabel, String alia Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -659,7 +665,7 @@ public okhttp3.Call createAliasBySubscriptionCall(String appId, String subscript Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -823,7 +829,7 @@ public okhttp3.Call createApiKeyCall(String appId, CreateApiKeyRequest createApi Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -969,7 +975,7 @@ public okhttp3.Call createAppCall(App app, final ApiCallback _callback) throws A Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -1113,7 +1119,7 @@ public okhttp3.Call createCustomEventsCall(String appId, CustomEventsRequest cus Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -1224,6 +1230,161 @@ public okhttp3.Call createCustomEventsAsync(String appId, CustomEventsRequest cu localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for createJourney + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param createJourneyRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 Created -
400 Bad Request -
403 Forbidden -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public okhttp3.Call createJourneyCall(String appId, CreateJourneyRequest createJourneyRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createJourneyRequest; + + // create path and map variables + String localVarPath = "/apps/{app_id}/journeys" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + // Adds client sdk version header + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createJourneyValidateBeforeCall(String appId, CreateJourneyRequest createJourneyRequest, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling createJourney(Async)"); + } + + // verify the required parameter 'createJourneyRequest' is set + if (createJourneyRequest == null) { + throw new ApiException("Missing the required parameter 'createJourneyRequest' when calling createJourney(Async)"); + } + + + okhttp3.Call localVarCall = createJourneyCall(appId, createJourneyRequest, _callback); + return localVarCall; + + } + + /** + * Create journey + * The Journeys API is in beta. Endpoints and response fields can still change. Create a new journey with an audience and a node graph. Journeys are always created in the draft state. The authenticated App API key must have permission to create journeys. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param createJourneyRequest (required) + * @return Journey + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 Created -
400 Bad Request -
403 Forbidden -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public Journey createJourney(String appId, CreateJourneyRequest createJourneyRequest) throws ApiException { + ApiResponse localVarResp = createJourneyWithHttpInfo(appId, createJourneyRequest); + return localVarResp.getData(); + } + + /** + * Create journey + * The Journeys API is in beta. Endpoints and response fields can still change. Create a new journey with an audience and a node graph. Journeys are always created in the draft state. The authenticated App API key must have permission to create journeys. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param createJourneyRequest (required) + * @return ApiResponse<Journey> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 Created -
400 Bad Request -
403 Forbidden -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public ApiResponse createJourneyWithHttpInfo(String appId, CreateJourneyRequest createJourneyRequest) throws ApiException { + okhttp3.Call localVarCall = createJourneyValidateBeforeCall(appId, createJourneyRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create journey (asynchronously) + * The Journeys API is in beta. Endpoints and response fields can still change. Create a new journey with an audience and a node graph. Journeys are always created in the draft state. The authenticated App API key must have permission to create journeys. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param createJourneyRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 Created -
400 Bad Request -
403 Forbidden -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public okhttp3.Call createJourneyAsync(String appId, CreateJourneyRequest createJourneyRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createJourneyValidateBeforeCall(appId, createJourneyRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for createNotification * @param notification (required) @@ -1265,7 +1426,7 @@ public okhttp3.Call createNotificationCall(Notification notification, final ApiC Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -1409,7 +1570,7 @@ public okhttp3.Call createSegmentCall(String appId, Segment segment, final ApiCa Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -1565,7 +1726,7 @@ public okhttp3.Call createSubscriptionCall(String appId, String aliasLabel, Stri Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -1739,7 +1900,7 @@ public okhttp3.Call createTemplateCall(CreateTemplateRequest createTemplateReque Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -1885,7 +2046,7 @@ public okhttp3.Call createUserCall(String appId, User user, final ApiCallback _c Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -2052,7 +2213,7 @@ public okhttp3.Call deleteAliasCall(String appId, String aliasLabel, String alia Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -2225,7 +2386,7 @@ public okhttp3.Call deleteApiKeyCall(String appId, String tokenId, final ApiCall Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -2330,6 +2491,162 @@ public okhttp3.Call deleteApiKeyAsync(String appId, String tokenId, final ApiCal localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for deleteJourney + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param journeyId UUID of the journey to delete. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public okhttp3.Call deleteJourneyCall(String appId, String journeyId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/apps/{app_id}/journeys/{journey_id}" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "journey_id" + "\\}", localVarApiClient.escapeString(journeyId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + // Adds client sdk version header + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteJourneyValidateBeforeCall(String appId, String journeyId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling deleteJourney(Async)"); + } + + // verify the required parameter 'journeyId' is set + if (journeyId == null) { + throw new ApiException("Missing the required parameter 'journeyId' when calling deleteJourney(Async)"); + } + + + okhttp3.Call localVarCall = deleteJourneyCall(appId, journeyId, _callback); + return localVarCall; + + } + + /** + * Delete journey + * The Journeys API is in beta. Endpoints and response fields can still change. Permanently delete a journey by its UUID. Returns { \"success\": true } on success. The authenticated App API key must have permission to delete journeys. Deleting a journey stops any in-flight users and cannot be undone. Archive a running journey instead if you need to keep its data. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param journeyId UUID of the journey to delete. (required) + * @return GenericSuccessBoolResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public GenericSuccessBoolResponse deleteJourney(String appId, String journeyId) throws ApiException { + ApiResponse localVarResp = deleteJourneyWithHttpInfo(appId, journeyId); + return localVarResp.getData(); + } + + /** + * Delete journey + * The Journeys API is in beta. Endpoints and response fields can still change. Permanently delete a journey by its UUID. Returns { \"success\": true } on success. The authenticated App API key must have permission to delete journeys. Deleting a journey stops any in-flight users and cannot be undone. Archive a running journey instead if you need to keep its data. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param journeyId UUID of the journey to delete. (required) + * @return ApiResponse<GenericSuccessBoolResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public ApiResponse deleteJourneyWithHttpInfo(String appId, String journeyId) throws ApiException { + okhttp3.Call localVarCall = deleteJourneyValidateBeforeCall(appId, journeyId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete journey (asynchronously) + * The Journeys API is in beta. Endpoints and response fields can still change. Permanently delete a journey by its UUID. Returns { \"success\": true } on success. The authenticated App API key must have permission to delete journeys. Deleting a journey stops any in-flight users and cannot be undone. Archive a running journey instead if you need to keep its data. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param journeyId UUID of the journey to delete. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public okhttp3.Call deleteJourneyAsync(String appId, String journeyId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteJourneyValidateBeforeCall(appId, journeyId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for deleteSegment * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) @@ -2375,7 +2692,7 @@ public okhttp3.Call deleteSegmentCall(String appId, String segmentId, final ApiC Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -2532,7 +2849,7 @@ public okhttp3.Call deleteSubscriptionCall(String appId, String subscriptionId, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -2685,7 +3002,7 @@ public okhttp3.Call deleteTemplateCall(String templateId, String appId, final Ap Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -2844,7 +3161,7 @@ public okhttp3.Call deleteUserCall(String appId, String aliasLabel, String alias Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -3003,7 +3320,7 @@ public okhttp3.Call exportEventsCall(String notificationId, String appId, final Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -3161,7 +3478,7 @@ public okhttp3.Call exportSubscriptionsCall(String appId, ExportSubscriptionsReq Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -3311,7 +3628,7 @@ public okhttp3.Call getAliasesCall(String appId, String aliasLabel, String alias Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -3474,7 +3791,7 @@ public okhttp3.Call getAliasesBySubscriptionCall(String appId, String subscripti Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -3624,7 +3941,7 @@ public okhttp3.Call getAppCall(String appId, final ApiCallback _callback) throws Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -3764,7 +4081,7 @@ public okhttp3.Call getAppsCall(final ApiCallback _callback) throws ApiException Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -3900,7 +4217,7 @@ public okhttp3.Call getNotificationCall(String appId, String notificationId, fin Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -4059,7 +4376,7 @@ public okhttp3.Call getNotificationHistoryCall(String notificationId, GetNotific Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -4215,7 +4532,7 @@ public okhttp3.Call getNotificationsCall(String appId, Integer limit, Integer of Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -4394,7 +4711,7 @@ public okhttp3.Call getOutcomesCall(String appId, String outcomeNames, String ou Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); if (outcomeNames != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_names", outcomeNames)); @@ -4580,7 +4897,7 @@ public okhttp3.Call getSegmentCall(String appId, String segmentId, Boolean inclu Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); if (includeSegmentDetail != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("include-segment-detail", includeSegmentDetail)); @@ -4742,7 +5059,7 @@ public okhttp3.Call getSegmentsCall(String appId, Integer offset, Integer limit, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); if (offset != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); @@ -4903,7 +5220,7 @@ public okhttp3.Call getUserCall(String appId, String aliasLabel, String aliasId, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -5077,7 +5394,7 @@ public okhttp3.Call listAuditLogsCall(String organizationId, String startTime, S Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); if (startTime != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("start_time", startTime)); @@ -5303,7 +5620,7 @@ public okhttp3.Call rotateApiKeyCall(String appId, String tokenId, final ApiCall Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -5453,7 +5770,7 @@ public okhttp3.Call startLiveActivityCall(String appId, String activityType, Sta Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -5616,7 +5933,7 @@ public okhttp3.Call transferSubscriptionCall(String appId, String subscriptionId Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -5783,7 +6100,7 @@ public okhttp3.Call unsubscribeEmailWithTokenCall(String appId, String notificat Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); if (token != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("token", token)); @@ -5947,7 +6264,7 @@ public okhttp3.Call updateApiKeyCall(String appId, String tokenId, UpdateApiKeyR Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -6103,7 +6420,7 @@ public okhttp3.Call updateAppCall(String appId, App app, final ApiCallback _call Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -6212,10 +6529,10 @@ public okhttp3.Call updateAppAsync(String appId, App app, final ApiCallback return localVarCall; } /** - * Build call for updateLiveActivity - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param activityId Live Activity record ID (required) - * @param updateLiveActivityRequest (required) + * Build call for updateJourney + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param journeyId UUID of the journey to update. (required) + * @param updateJourneyRequest (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -6224,11 +6541,15 @@ public okhttp3.Call updateAppAsync(String appId, App app, final ApiCallback Status Code Description Response Headers 200 OK - 400 Bad Request - + 403 Forbidden - + 404 Not Found - + 409 Conflict - + 422 Unprocessable Entity - 429 Rate Limit Exceeded - 0 Unexpected error - */ - public okhttp3.Call updateLiveActivityCall(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateJourneyCall(String appId, String journeyId, UpdateJourneyRequest updateJourneyRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -6242,12 +6563,12 @@ public okhttp3.Call updateLiveActivityCall(String appId, String activityId, Upda basePath = null; } - Object localVarPostBody = updateLiveActivityRequest; + Object localVarPostBody = updateJourneyRequest; // create path and map variables - String localVarPath = "/apps/{app_id}/live_activities/{activity_id}/notifications" + String localVarPath = "/apps/{app_id}/journeys/{journey_id}" .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "activity_id" + "\\}", localVarApiClient.escapeString(activityId.toString())); + .replaceAll("\\{" + "journey_id" + "\\}", localVarApiClient.escapeString(journeyId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -6256,7 +6577,7 @@ public okhttp3.Call updateLiveActivityCall(String appId, String activityId, Upda Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -6275,84 +6596,92 @@ public okhttp3.Call updateLiveActivityCall(String appId, String activityId, Upda } String[] localVarAuthNames = new String[] { "rest_api_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateLiveActivityValidateBeforeCall(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updateJourneyValidateBeforeCall(String appId, String journeyId, UpdateJourneyRequest updateJourneyRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling updateLiveActivity(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling updateJourney(Async)"); } - // verify the required parameter 'activityId' is set - if (activityId == null) { - throw new ApiException("Missing the required parameter 'activityId' when calling updateLiveActivity(Async)"); + // verify the required parameter 'journeyId' is set + if (journeyId == null) { + throw new ApiException("Missing the required parameter 'journeyId' when calling updateJourney(Async)"); } - // verify the required parameter 'updateLiveActivityRequest' is set - if (updateLiveActivityRequest == null) { - throw new ApiException("Missing the required parameter 'updateLiveActivityRequest' when calling updateLiveActivity(Async)"); + // verify the required parameter 'updateJourneyRequest' is set + if (updateJourneyRequest == null) { + throw new ApiException("Missing the required parameter 'updateJourneyRequest' when calling updateJourney(Async)"); } - okhttp3.Call localVarCall = updateLiveActivityCall(appId, activityId, updateLiveActivityRequest, _callback); + okhttp3.Call localVarCall = updateJourneyCall(appId, journeyId, updateJourneyRequest, _callback); return localVarCall; } /** - * Update a Live Activity via Push - * Updates a specified live activity. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param activityId Live Activity record ID (required) - * @param updateLiveActivityRequest (required) - * @return UpdateLiveActivitySuccessResponse + * Update journey + * The Journeys API is in beta. Endpoints and response fields can still change. Apply a partial update to a journey using JSON Merge Patch (RFC 7396). Send only the fields you want to change; omitted fields are left unchanged. A null value clears a nullable field, and arrays such as nodes are replaced wholesale. Set state to active to activate a draft journey. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param journeyId UUID of the journey to update. (required) + * @param updateJourneyRequest (required) + * @return Journey * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
429 Rate Limit Exceeded -
0 Unexpected error -
*/ - public UpdateLiveActivitySuccessResponse updateLiveActivity(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest) throws ApiException { - ApiResponse localVarResp = updateLiveActivityWithHttpInfo(appId, activityId, updateLiveActivityRequest); + public Journey updateJourney(String appId, String journeyId, UpdateJourneyRequest updateJourneyRequest) throws ApiException { + ApiResponse localVarResp = updateJourneyWithHttpInfo(appId, journeyId, updateJourneyRequest); return localVarResp.getData(); } /** - * Update a Live Activity via Push - * Updates a specified live activity. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param activityId Live Activity record ID (required) - * @param updateLiveActivityRequest (required) - * @return ApiResponse<UpdateLiveActivitySuccessResponse> + * Update journey + * The Journeys API is in beta. Endpoints and response fields can still change. Apply a partial update to a journey using JSON Merge Patch (RFC 7396). Send only the fields you want to change; omitted fields are left unchanged. A null value clears a nullable field, and arrays such as nodes are replaced wholesale. Set state to active to activate a draft journey. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param journeyId UUID of the journey to update. (required) + * @param updateJourneyRequest (required) + * @return ApiResponse<Journey> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
429 Rate Limit Exceeded -
0 Unexpected error -
*/ - public ApiResponse updateLiveActivityWithHttpInfo(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest) throws ApiException { - okhttp3.Call localVarCall = updateLiveActivityValidateBeforeCall(appId, activityId, updateLiveActivityRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse updateJourneyWithHttpInfo(String appId, String journeyId, UpdateJourneyRequest updateJourneyRequest) throws ApiException { + okhttp3.Call localVarCall = updateJourneyValidateBeforeCall(appId, journeyId, updateJourneyRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update a Live Activity via Push (asynchronously) - * Updates a specified live activity. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param activityId Live Activity record ID (required) - * @param updateLiveActivityRequest (required) + * Update journey (asynchronously) + * The Journeys API is in beta. Endpoints and response fields can still change. Apply a partial update to a journey using JSON Merge Patch (RFC 7396). Send only the fields you want to change; omitted fields are left unchanged. A null value clears a nullable field, and arrays such as nodes are replaced wholesale. Set state to active to activate a draft journey. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param journeyId UUID of the journey to update. (required) + * @param updateJourneyRequest (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -6361,22 +6690,27 @@ public ApiResponse updateLiveActivityWithHttp Status Code Description Response Headers 200 OK - 400 Bad Request - + 403 Forbidden - + 404 Not Found - + 409 Conflict - + 422 Unprocessable Entity - 429 Rate Limit Exceeded - 0 Unexpected error - */ - public okhttp3.Call updateLiveActivityAsync(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateJourneyAsync(String appId, String journeyId, UpdateJourneyRequest updateJourneyRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateLiveActivityValidateBeforeCall(appId, activityId, updateLiveActivityRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = updateJourneyValidateBeforeCall(appId, journeyId, updateJourneyRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for updateSegment - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param segmentId The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. (required) - * @param updateSegmentRequest (optional) + * Build call for updateJourneyNode + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param journeyId UUID of the journey that owns the node. (required) + * @param nodeId Server-assigned UUID of the node to update, from a prior View journey fetch. (required) + * @param updateJourneyNodeRequest (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -6387,11 +6721,13 @@ public okhttp3.Call updateLiveActivityAsync(String appId, String activityId, Upd 400 Bad Request - 403 Forbidden - 404 Not Found - + 409 Conflict - + 422 Unprocessable Entity - 429 Rate Limit Exceeded - 0 Unexpected error - */ - public okhttp3.Call updateSegmentCall(String appId, String segmentId, UpdateSegmentRequest updateSegmentRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateJourneyNodeCall(String appId, String journeyId, String nodeId, UpdateJourneyNodeRequest updateJourneyNodeRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -6405,12 +6741,13 @@ public okhttp3.Call updateSegmentCall(String appId, String segmentId, UpdateSegm basePath = null; } - Object localVarPostBody = updateSegmentRequest; + Object localVarPostBody = updateJourneyNodeRequest; // create path and map variables - String localVarPath = "/apps/{app_id}/segments/{segment_id}" + String localVarPath = "/apps/{app_id}/journeys/{journey_id}/nodes/{node_id}" .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "segment_id" + "\\}", localVarApiClient.escapeString(segmentId.toString())); + .replaceAll("\\{" + "journey_id" + "\\}", localVarApiClient.escapeString(journeyId.toString())) + .replaceAll("\\{" + "node_id" + "\\}", localVarApiClient.escapeString(nodeId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -6419,7 +6756,7 @@ public okhttp3.Call updateSegmentCall(String appId, String segmentId, UpdateSegm Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -6442,31 +6779,42 @@ public okhttp3.Call updateSegmentCall(String appId, String segmentId, UpdateSegm } @SuppressWarnings("rawtypes") - private okhttp3.Call updateSegmentValidateBeforeCall(String appId, String segmentId, UpdateSegmentRequest updateSegmentRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updateJourneyNodeValidateBeforeCall(String appId, String journeyId, String nodeId, UpdateJourneyNodeRequest updateJourneyNodeRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling updateSegment(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling updateJourneyNode(Async)"); } - // verify the required parameter 'segmentId' is set - if (segmentId == null) { - throw new ApiException("Missing the required parameter 'segmentId' when calling updateSegment(Async)"); + // verify the required parameter 'journeyId' is set + if (journeyId == null) { + throw new ApiException("Missing the required parameter 'journeyId' when calling updateJourneyNode(Async)"); + } + + // verify the required parameter 'nodeId' is set + if (nodeId == null) { + throw new ApiException("Missing the required parameter 'nodeId' when calling updateJourneyNode(Async)"); + } + + // verify the required parameter 'updateJourneyNodeRequest' is set + if (updateJourneyNodeRequest == null) { + throw new ApiException("Missing the required parameter 'updateJourneyNodeRequest' when calling updateJourneyNode(Async)"); } - okhttp3.Call localVarCall = updateSegmentCall(appId, segmentId, updateSegmentRequest, _callback); + okhttp3.Call localVarCall = updateJourneyNodeCall(appId, journeyId, nodeId, updateJourneyNodeRequest, _callback); return localVarCall; } /** - * Update Segment - * Update an existing segment's name and/or filters. The name parameter is always required. When filters are provided, all existing filters are replaced with the new ones. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param segmentId The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. (required) - * @param updateSegmentRequest (optional) - * @return UpdateSegmentSuccessResponse + * Update journey node + * The Journeys API is in beta. Endpoints and response fields can still change. Apply a partial update to a single node, located by its server-assigned id, using JSON Merge Patch (RFC 7396). Send only the node fields you want to change; the rest of the node and the rest of the journey graph are left untouched. Returns the full updated journey. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param journeyId UUID of the journey that owns the node. (required) + * @param nodeId Server-assigned UUID of the node to update, from a prior View journey fetch. (required) + * @param updateJourneyNodeRequest (required) + * @return Journey * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -6475,22 +6823,25 @@ private okhttp3.Call updateSegmentValidateBeforeCall(String appId, String segmen + +
400 Bad Request -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
429 Rate Limit Exceeded -
0 Unexpected error -
*/ - public UpdateSegmentSuccessResponse updateSegment(String appId, String segmentId, UpdateSegmentRequest updateSegmentRequest) throws ApiException { - ApiResponse localVarResp = updateSegmentWithHttpInfo(appId, segmentId, updateSegmentRequest); + public Journey updateJourneyNode(String appId, String journeyId, String nodeId, UpdateJourneyNodeRequest updateJourneyNodeRequest) throws ApiException { + ApiResponse localVarResp = updateJourneyNodeWithHttpInfo(appId, journeyId, nodeId, updateJourneyNodeRequest); return localVarResp.getData(); } /** - * Update Segment - * Update an existing segment's name and/or filters. The name parameter is always required. When filters are provided, all existing filters are replaced with the new ones. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param segmentId The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. (required) - * @param updateSegmentRequest (optional) - * @return ApiResponse<UpdateSegmentSuccessResponse> + * Update journey node + * The Journeys API is in beta. Endpoints and response fields can still change. Apply a partial update to a single node, located by its server-assigned id, using JSON Merge Patch (RFC 7396). Send only the node fields you want to change; the rest of the node and the rest of the journey graph are left untouched. Returns the full updated journey. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param journeyId UUID of the journey that owns the node. (required) + * @param nodeId Server-assigned UUID of the node to update, from a prior View journey fetch. (required) + * @param updateJourneyNodeRequest (required) + * @return ApiResponse<Journey> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -6499,22 +6850,25 @@ public UpdateSegmentSuccessResponse updateSegment(String appId, String segmentId + +
400 Bad Request -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
429 Rate Limit Exceeded -
0 Unexpected error -
*/ - public ApiResponse updateSegmentWithHttpInfo(String appId, String segmentId, UpdateSegmentRequest updateSegmentRequest) throws ApiException { - okhttp3.Call localVarCall = updateSegmentValidateBeforeCall(appId, segmentId, updateSegmentRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse updateJourneyNodeWithHttpInfo(String appId, String journeyId, String nodeId, UpdateJourneyNodeRequest updateJourneyNodeRequest) throws ApiException { + okhttp3.Call localVarCall = updateJourneyNodeValidateBeforeCall(appId, journeyId, nodeId, updateJourneyNodeRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update Segment (asynchronously) - * Update an existing segment's name and/or filters. The name parameter is always required. When filters are provided, all existing filters are replaced with the new ones. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param segmentId The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. (required) - * @param updateSegmentRequest (optional) + * Update journey node (asynchronously) + * The Journeys API is in beta. Endpoints and response fields can still change. Apply a partial update to a single node, located by its server-assigned id, using JSON Merge Patch (RFC 7396). Send only the node fields you want to change; the rest of the node and the rest of the journey graph are left untouched. Returns the full updated journey. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param journeyId UUID of the journey that owns the node. (required) + * @param nodeId Server-assigned UUID of the node to update, from a prior View journey fetch. (required) + * @param updateJourneyNodeRequest (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -6525,22 +6879,24 @@ public ApiResponse updateSegmentWithHttpInfo(Strin 400 Bad Request - 403 Forbidden - 404 Not Found - + 409 Conflict - + 422 Unprocessable Entity - 429 Rate Limit Exceeded - 0 Unexpected error - */ - public okhttp3.Call updateSegmentAsync(String appId, String segmentId, UpdateSegmentRequest updateSegmentRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateJourneyNodeAsync(String appId, String journeyId, String nodeId, UpdateJourneyNodeRequest updateJourneyNodeRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateSegmentValidateBeforeCall(appId, segmentId, updateSegmentRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = updateJourneyNodeValidateBeforeCall(appId, journeyId, nodeId, updateJourneyNodeRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for updateSubscription - * @param appId (required) - * @param subscriptionId (required) - * @param subscriptionBody (required) + * Build call for updateLiveActivity + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param activityId Live Activity record ID (required) + * @param updateLiveActivityRequest (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -6549,13 +6905,11 @@ public okhttp3.Call updateSegmentAsync(String appId, String segmentId, UpdateSeg Status Code Description Response Headers 200 OK - 400 Bad Request - - 404 Not Found - - 409 Conflict - 429 Rate Limit Exceeded - 0 Unexpected error - */ - public okhttp3.Call updateSubscriptionCall(String appId, String subscriptionId, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateLiveActivityCall(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -6569,12 +6923,12 @@ public okhttp3.Call updateSubscriptionCall(String appId, String subscriptionId, basePath = null; } - Object localVarPostBody = subscriptionBody; + Object localVarPostBody = updateLiveActivityRequest; // create path and map variables - String localVarPath = "/apps/{app_id}/subscriptions/{subscription_id}" + String localVarPath = "/apps/{app_id}/live_activities/{activity_id}/notifications" .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "subscription_id" + "\\}", localVarApiClient.escapeString(subscriptionId.toString())); + .replaceAll("\\{" + "activity_id" + "\\}", localVarApiClient.escapeString(activityId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -6583,7 +6937,7 @@ public okhttp3.Call updateSubscriptionCall(String appId, String subscriptionId, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -6602,85 +6956,84 @@ public okhttp3.Call updateSubscriptionCall(String appId, String subscriptionId, } String[] localVarAuthNames = new String[] { "rest_api_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateSubscriptionValidateBeforeCall(String appId, String subscriptionId, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updateLiveActivityValidateBeforeCall(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling updateSubscription(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling updateLiveActivity(Async)"); } - // verify the required parameter 'subscriptionId' is set - if (subscriptionId == null) { - throw new ApiException("Missing the required parameter 'subscriptionId' when calling updateSubscription(Async)"); + // verify the required parameter 'activityId' is set + if (activityId == null) { + throw new ApiException("Missing the required parameter 'activityId' when calling updateLiveActivity(Async)"); } - // verify the required parameter 'subscriptionBody' is set - if (subscriptionBody == null) { - throw new ApiException("Missing the required parameter 'subscriptionBody' when calling updateSubscription(Async)"); + // verify the required parameter 'updateLiveActivityRequest' is set + if (updateLiveActivityRequest == null) { + throw new ApiException("Missing the required parameter 'updateLiveActivityRequest' when calling updateLiveActivity(Async)"); } - okhttp3.Call localVarCall = updateSubscriptionCall(appId, subscriptionId, subscriptionBody, _callback); + okhttp3.Call localVarCall = updateLiveActivityCall(appId, activityId, updateLiveActivityRequest, _callback); return localVarCall; } /** - * - * Updates an existing Subscription’s properties. - * @param appId (required) - * @param subscriptionId (required) - * @param subscriptionBody (required) + * Update a Live Activity via Push + * Updates a specified live activity. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param activityId Live Activity record ID (required) + * @param updateLiveActivityRequest (required) + * @return UpdateLiveActivitySuccessResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
0 Unexpected error -
*/ - public void updateSubscription(String appId, String subscriptionId, SubscriptionBody subscriptionBody) throws ApiException { - updateSubscriptionWithHttpInfo(appId, subscriptionId, subscriptionBody); + public UpdateLiveActivitySuccessResponse updateLiveActivity(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest) throws ApiException { + ApiResponse localVarResp = updateLiveActivityWithHttpInfo(appId, activityId, updateLiveActivityRequest); + return localVarResp.getData(); } /** - * - * Updates an existing Subscription’s properties. - * @param appId (required) - * @param subscriptionId (required) - * @param subscriptionBody (required) - * @return ApiResponse<Void> + * Update a Live Activity via Push + * Updates a specified live activity. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param activityId Live Activity record ID (required) + * @param updateLiveActivityRequest (required) + * @return ApiResponse<UpdateLiveActivitySuccessResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
0 Unexpected error -
*/ - public ApiResponse updateSubscriptionWithHttpInfo(String appId, String subscriptionId, SubscriptionBody subscriptionBody) throws ApiException { - okhttp3.Call localVarCall = updateSubscriptionValidateBeforeCall(appId, subscriptionId, subscriptionBody, null); - return localVarApiClient.execute(localVarCall); + public ApiResponse updateLiveActivityWithHttpInfo(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest) throws ApiException { + okhttp3.Call localVarCall = updateLiveActivityValidateBeforeCall(appId, activityId, updateLiveActivityRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * (asynchronously) - * Updates an existing Subscription’s properties. - * @param appId (required) - * @param subscriptionId (required) - * @param subscriptionBody (required) + * Update a Live Activity via Push (asynchronously) + * Updates a specified live activity. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param activityId Live Activity record ID (required) + * @param updateLiveActivityRequest (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -6689,37 +7042,37 @@ public ApiResponse updateSubscriptionWithHttpInfo(String appId, String sub Status Code Description Response Headers 200 OK - 400 Bad Request - - 404 Not Found - - 409 Conflict - 429 Rate Limit Exceeded - 0 Unexpected error - */ - public okhttp3.Call updateSubscriptionAsync(String appId, String subscriptionId, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateLiveActivityAsync(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateSubscriptionValidateBeforeCall(appId, subscriptionId, subscriptionBody, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + okhttp3.Call localVarCall = updateLiveActivityValidateBeforeCall(appId, activityId, updateLiveActivityRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for updateSubscriptionByToken - * @param appId Your OneSignal App ID in UUID v4 format. (required) - * @param tokenType The type of token to use when looking up the subscription. See Subscription Types. (required) - * @param token The value of the token to lookup by (e.g., email address, phone number). (required) - * @param subscriptionBody (required) + * Build call for updateSegment + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param segmentId The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. (required) + * @param updateSegmentRequest (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - + + +
Status Code Description Response Headers
202 ACCEPTED -
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
*/ - public okhttp3.Call updateSubscriptionByTokenCall(String appId, String tokenType, String token, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateSegmentCall(String appId, String segmentId, UpdateSegmentRequest updateSegmentRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -6733,13 +7086,12 @@ public okhttp3.Call updateSubscriptionByTokenCall(String appId, String tokenType basePath = null; } - Object localVarPostBody = subscriptionBody; + Object localVarPostBody = updateSegmentRequest; // create path and map variables - String localVarPath = "/apps/{app_id}/subscriptions_by_token/{token_type}/{token}" + String localVarPath = "/apps/{app_id}/segments/{segment_id}" .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "token_type" + "\\}", localVarApiClient.escapeString(tokenType.toString())) - .replaceAll("\\{" + "token" + "\\}", localVarApiClient.escapeString(token.toString())); + .replaceAll("\\{" + "segment_id" + "\\}", localVarApiClient.escapeString(segmentId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -6748,7 +7100,7 @@ public okhttp3.Call updateSubscriptionByTokenCall(String appId, String tokenType Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -6771,112 +7123,913 @@ public okhttp3.Call updateSubscriptionByTokenCall(String appId, String tokenType } @SuppressWarnings("rawtypes") - private okhttp3.Call updateSubscriptionByTokenValidateBeforeCall(String appId, String tokenType, String token, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updateSegmentValidateBeforeCall(String appId, String segmentId, UpdateSegmentRequest updateSegmentRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling updateSubscriptionByToken(Async)"); - } - - // verify the required parameter 'tokenType' is set - if (tokenType == null) { - throw new ApiException("Missing the required parameter 'tokenType' when calling updateSubscriptionByToken(Async)"); - } - - // verify the required parameter 'token' is set - if (token == null) { - throw new ApiException("Missing the required parameter 'token' when calling updateSubscriptionByToken(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling updateSegment(Async)"); } - // verify the required parameter 'subscriptionBody' is set - if (subscriptionBody == null) { - throw new ApiException("Missing the required parameter 'subscriptionBody' when calling updateSubscriptionByToken(Async)"); + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException("Missing the required parameter 'segmentId' when calling updateSegment(Async)"); } - okhttp3.Call localVarCall = updateSubscriptionByTokenCall(appId, tokenType, token, subscriptionBody, _callback); + okhttp3.Call localVarCall = updateSegmentCall(appId, segmentId, updateSegmentRequest, _callback); return localVarCall; } /** - * Update subscription by token - * Update properties on an existing OneSignal subscription using its token. + * Update Segment + * Update an existing segment's name and/or filters. The name parameter is always required. When filters are provided, all existing filters are replaced with the new ones. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param segmentId The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. (required) + * @param updateSegmentRequest (optional) + * @return UpdateSegmentSuccessResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public UpdateSegmentSuccessResponse updateSegment(String appId, String segmentId, UpdateSegmentRequest updateSegmentRequest) throws ApiException { + ApiResponse localVarResp = updateSegmentWithHttpInfo(appId, segmentId, updateSegmentRequest); + return localVarResp.getData(); + } + + /** + * Update Segment + * Update an existing segment's name and/or filters. The name parameter is always required. When filters are provided, all existing filters are replaced with the new ones. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param segmentId The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. (required) + * @param updateSegmentRequest (optional) + * @return ApiResponse<UpdateSegmentSuccessResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public ApiResponse updateSegmentWithHttpInfo(String appId, String segmentId, UpdateSegmentRequest updateSegmentRequest) throws ApiException { + okhttp3.Call localVarCall = updateSegmentValidateBeforeCall(appId, segmentId, updateSegmentRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Segment (asynchronously) + * Update an existing segment's name and/or filters. The name parameter is always required. When filters are provided, all existing filters are replaced with the new ones. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param segmentId The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. (required) + * @param updateSegmentRequest (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public okhttp3.Call updateSegmentAsync(String appId, String segmentId, UpdateSegmentRequest updateSegmentRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateSegmentValidateBeforeCall(appId, segmentId, updateSegmentRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateSubscription + * @param appId (required) + * @param subscriptionId (required) + * @param subscriptionBody (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public okhttp3.Call updateSubscriptionCall(String appId, String subscriptionId, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = subscriptionBody; + + // create path and map variables + String localVarPath = "/apps/{app_id}/subscriptions/{subscription_id}" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "subscription_id" + "\\}", localVarApiClient.escapeString(subscriptionId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + // Adds client sdk version header + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateSubscriptionValidateBeforeCall(String appId, String subscriptionId, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling updateSubscription(Async)"); + } + + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new ApiException("Missing the required parameter 'subscriptionId' when calling updateSubscription(Async)"); + } + + // verify the required parameter 'subscriptionBody' is set + if (subscriptionBody == null) { + throw new ApiException("Missing the required parameter 'subscriptionBody' when calling updateSubscription(Async)"); + } + + + okhttp3.Call localVarCall = updateSubscriptionCall(appId, subscriptionId, subscriptionBody, _callback); + return localVarCall; + + } + + /** + * + * Updates an existing Subscription’s properties. + * @param appId (required) + * @param subscriptionId (required) + * @param subscriptionBody (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public void updateSubscription(String appId, String subscriptionId, SubscriptionBody subscriptionBody) throws ApiException { + updateSubscriptionWithHttpInfo(appId, subscriptionId, subscriptionBody); + } + + /** + * + * Updates an existing Subscription’s properties. + * @param appId (required) + * @param subscriptionId (required) + * @param subscriptionBody (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public ApiResponse updateSubscriptionWithHttpInfo(String appId, String subscriptionId, SubscriptionBody subscriptionBody) throws ApiException { + okhttp3.Call localVarCall = updateSubscriptionValidateBeforeCall(appId, subscriptionId, subscriptionBody, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * Updates an existing Subscription’s properties. + * @param appId (required) + * @param subscriptionId (required) + * @param subscriptionBody (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public okhttp3.Call updateSubscriptionAsync(String appId, String subscriptionId, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateSubscriptionValidateBeforeCall(appId, subscriptionId, subscriptionBody, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for updateSubscriptionByToken * @param appId Your OneSignal App ID in UUID v4 format. (required) * @param tokenType The type of token to use when looking up the subscription. See Subscription Types. (required) * @param token The value of the token to lookup by (e.g., email address, phone number). (required) * @param subscriptionBody (required) - * @return Object + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
202 ACCEPTED -
400 Bad Request -
404 Not Found -
0 Unexpected error -
+ */ + public okhttp3.Call updateSubscriptionByTokenCall(String appId, String tokenType, String token, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = subscriptionBody; + + // create path and map variables + String localVarPath = "/apps/{app_id}/subscriptions_by_token/{token_type}/{token}" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "token_type" + "\\}", localVarApiClient.escapeString(tokenType.toString())) + .replaceAll("\\{" + "token" + "\\}", localVarApiClient.escapeString(token.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + // Adds client sdk version header + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateSubscriptionByTokenValidateBeforeCall(String appId, String tokenType, String token, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling updateSubscriptionByToken(Async)"); + } + + // verify the required parameter 'tokenType' is set + if (tokenType == null) { + throw new ApiException("Missing the required parameter 'tokenType' when calling updateSubscriptionByToken(Async)"); + } + + // verify the required parameter 'token' is set + if (token == null) { + throw new ApiException("Missing the required parameter 'token' when calling updateSubscriptionByToken(Async)"); + } + + // verify the required parameter 'subscriptionBody' is set + if (subscriptionBody == null) { + throw new ApiException("Missing the required parameter 'subscriptionBody' when calling updateSubscriptionByToken(Async)"); + } + + + okhttp3.Call localVarCall = updateSubscriptionByTokenCall(appId, tokenType, token, subscriptionBody, _callback); + return localVarCall; + + } + + /** + * Update subscription by token + * Update properties on an existing OneSignal subscription using its token. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param tokenType The type of token to use when looking up the subscription. See Subscription Types. (required) + * @param token The value of the token to lookup by (e.g., email address, phone number). (required) + * @param subscriptionBody (required) + * @return Object + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
202 ACCEPTED -
400 Bad Request -
404 Not Found -
0 Unexpected error -
+ */ + public Object updateSubscriptionByToken(String appId, String tokenType, String token, SubscriptionBody subscriptionBody) throws ApiException { + ApiResponse localVarResp = updateSubscriptionByTokenWithHttpInfo(appId, tokenType, token, subscriptionBody); + return localVarResp.getData(); + } + + /** + * Update subscription by token + * Update properties on an existing OneSignal subscription using its token. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param tokenType The type of token to use when looking up the subscription. See Subscription Types. (required) + * @param token The value of the token to lookup by (e.g., email address, phone number). (required) + * @param subscriptionBody (required) + * @return ApiResponse<Object> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
202 ACCEPTED -
400 Bad Request -
404 Not Found -
0 Unexpected error -
+ */ + public ApiResponse updateSubscriptionByTokenWithHttpInfo(String appId, String tokenType, String token, SubscriptionBody subscriptionBody) throws ApiException { + okhttp3.Call localVarCall = updateSubscriptionByTokenValidateBeforeCall(appId, tokenType, token, subscriptionBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update subscription by token (asynchronously) + * Update properties on an existing OneSignal subscription using its token. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param tokenType The type of token to use when looking up the subscription. See Subscription Types. (required) + * @param token The value of the token to lookup by (e.g., email address, phone number). (required) + * @param subscriptionBody (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
202 ACCEPTED -
400 Bad Request -
404 Not Found -
0 Unexpected error -
+ */ + public okhttp3.Call updateSubscriptionByTokenAsync(String appId, String tokenType, String token, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateSubscriptionByTokenValidateBeforeCall(appId, tokenType, token, subscriptionBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateTemplate + * @param templateId (required) + * @param appId (required) + * @param updateTemplateRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
0 Unexpected error -
+ */ + public okhttp3.Call updateTemplateCall(String templateId, String appId, UpdateTemplateRequest updateTemplateRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateTemplateRequest; + + // create path and map variables + String localVarPath = "/templates/{template_id}" + .replaceAll("\\{" + "template_id" + "\\}", localVarApiClient.escapeString(templateId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + // Adds client sdk version header + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); + + if (appId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateTemplateValidateBeforeCall(String templateId, String appId, UpdateTemplateRequest updateTemplateRequest, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'templateId' is set + if (templateId == null) { + throw new ApiException("Missing the required parameter 'templateId' when calling updateTemplate(Async)"); + } + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling updateTemplate(Async)"); + } + + // verify the required parameter 'updateTemplateRequest' is set + if (updateTemplateRequest == null) { + throw new ApiException("Missing the required parameter 'updateTemplateRequest' when calling updateTemplate(Async)"); + } + + + okhttp3.Call localVarCall = updateTemplateCall(templateId, appId, updateTemplateRequest, _callback); + return localVarCall; + + } + + /** + * Update template + * Update an existing template. + * @param templateId (required) + * @param appId (required) + * @param updateTemplateRequest (required) + * @return TemplateResource + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
0 Unexpected error -
+ */ + public TemplateResource updateTemplate(String templateId, String appId, UpdateTemplateRequest updateTemplateRequest) throws ApiException { + ApiResponse localVarResp = updateTemplateWithHttpInfo(templateId, appId, updateTemplateRequest); + return localVarResp.getData(); + } + + /** + * Update template + * Update an existing template. + * @param templateId (required) + * @param appId (required) + * @param updateTemplateRequest (required) + * @return ApiResponse<TemplateResource> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
0 Unexpected error -
+ */ + public ApiResponse updateTemplateWithHttpInfo(String templateId, String appId, UpdateTemplateRequest updateTemplateRequest) throws ApiException { + okhttp3.Call localVarCall = updateTemplateValidateBeforeCall(templateId, appId, updateTemplateRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update template (asynchronously) + * Update an existing template. + * @param templateId (required) + * @param appId (required) + * @param updateTemplateRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
0 Unexpected error -
+ */ + public okhttp3.Call updateTemplateAsync(String templateId, String appId, UpdateTemplateRequest updateTemplateRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateTemplateValidateBeforeCall(templateId, appId, updateTemplateRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateUser + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (required) + * @param updateUserRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
202 ACCEPTED -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public okhttp3.Call updateUserCall(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateUserRequest; + + // create path and map variables + String localVarPath = "/apps/{app_id}/users/by/{alias_label}/{alias_id}" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "alias_label" + "\\}", localVarApiClient.escapeString(aliasLabel.toString())) + .replaceAll("\\{" + "alias_id" + "\\}", localVarApiClient.escapeString(aliasId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + // Adds client sdk version header + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateUserValidateBeforeCall(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling updateUser(Async)"); + } + + // verify the required parameter 'aliasLabel' is set + if (aliasLabel == null) { + throw new ApiException("Missing the required parameter 'aliasLabel' when calling updateUser(Async)"); + } + + // verify the required parameter 'aliasId' is set + if (aliasId == null) { + throw new ApiException("Missing the required parameter 'aliasId' when calling updateUser(Async)"); + } + + // verify the required parameter 'updateUserRequest' is set + if (updateUserRequest == null) { + throw new ApiException("Missing the required parameter 'updateUserRequest' when calling updateUser(Async)"); + } + + + okhttp3.Call localVarCall = updateUserCall(appId, aliasLabel, aliasId, updateUserRequest, _callback); + return localVarCall; + + } + + /** + * + * Updates an existing User’s properties. + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (required) + * @param updateUserRequest (required) + * @return PropertiesBody + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
202 ACCEPTED -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public PropertiesBody updateUser(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest) throws ApiException { + ApiResponse localVarResp = updateUserWithHttpInfo(appId, aliasLabel, aliasId, updateUserRequest); + return localVarResp.getData(); + } + + /** + * + * Updates an existing User’s properties. + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (required) + * @param updateUserRequest (required) + * @return ApiResponse<PropertiesBody> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
202 ACCEPTED -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public ApiResponse updateUserWithHttpInfo(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest) throws ApiException { + okhttp3.Call localVarCall = updateUserValidateBeforeCall(appId, aliasLabel, aliasId, updateUserRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Updates an existing User’s properties. + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (required) + * @param updateUserRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
202 ACCEPTED -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public okhttp3.Call updateUserAsync(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateUserValidateBeforeCall(appId, aliasLabel, aliasId, updateUserRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for viewApiKeys + * @param appId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
0 Unexpected error -
+ */ + public okhttp3.Call viewApiKeysCall(String appId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/apps/{app_id}/auth/tokens" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + // Adds client sdk version header + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "organization_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call viewApiKeysValidateBeforeCall(String appId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling viewApiKeys(Async)"); + } + + + okhttp3.Call localVarCall = viewApiKeysCall(appId, _callback); + return localVarCall; + + } + + /** + * View API keys + * View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app. + * @param appId (required) + * @return ApiKeyTokensListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + -
Status Code Description Response Headers
202 ACCEPTED -
200 OK -
400 Bad Request -
404 Not Found -
0 Unexpected error -
*/ - public Object updateSubscriptionByToken(String appId, String tokenType, String token, SubscriptionBody subscriptionBody) throws ApiException { - ApiResponse localVarResp = updateSubscriptionByTokenWithHttpInfo(appId, tokenType, token, subscriptionBody); + public ApiKeyTokensListResponse viewApiKeys(String appId) throws ApiException { + ApiResponse localVarResp = viewApiKeysWithHttpInfo(appId); return localVarResp.getData(); } /** - * Update subscription by token - * Update properties on an existing OneSignal subscription using its token. - * @param appId Your OneSignal App ID in UUID v4 format. (required) - * @param tokenType The type of token to use when looking up the subscription. See Subscription Types. (required) - * @param token The value of the token to lookup by (e.g., email address, phone number). (required) - * @param subscriptionBody (required) - * @return ApiResponse<Object> + * View API keys + * View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app. + * @param appId (required) + * @return ApiResponse<ApiKeyTokensListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + -
Status Code Description Response Headers
202 ACCEPTED -
200 OK -
400 Bad Request -
404 Not Found -
0 Unexpected error -
*/ - public ApiResponse updateSubscriptionByTokenWithHttpInfo(String appId, String tokenType, String token, SubscriptionBody subscriptionBody) throws ApiException { - okhttp3.Call localVarCall = updateSubscriptionByTokenValidateBeforeCall(appId, tokenType, token, subscriptionBody, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse viewApiKeysWithHttpInfo(String appId) throws ApiException { + okhttp3.Call localVarCall = viewApiKeysValidateBeforeCall(appId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update subscription by token (asynchronously) - * Update properties on an existing OneSignal subscription using its token. - * @param appId Your OneSignal App ID in UUID v4 format. (required) - * @param tokenType The type of token to use when looking up the subscription. See Subscription Types. (required) - * @param token The value of the token to lookup by (e.g., email address, phone number). (required) - * @param subscriptionBody (required) + * View API keys (asynchronously) + * View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app. + * @param appId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details - + -
Status Code Description Response Headers
202 ACCEPTED -
200 OK -
400 Bad Request -
404 Not Found -
0 Unexpected error -
*/ - public okhttp3.Call updateSubscriptionByTokenAsync(String appId, String tokenType, String token, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call viewApiKeysAsync(String appId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateSubscriptionByTokenValidateBeforeCall(appId, tokenType, token, subscriptionBody, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = viewApiKeysValidateBeforeCall(appId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for updateTemplate - * @param templateId (required) - * @param appId (required) - * @param updateTemplateRequest (required) + * Build call for viewJourney + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param journeyId UUID of the journey to retrieve. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -6884,11 +8037,12 @@ public okhttp3.Call updateSubscriptionByTokenAsync(String appId, String tokenTyp - + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
*/ - public okhttp3.Call updateTemplateCall(String templateId, String appId, UpdateTemplateRequest updateTemplateRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call viewJourneyCall(String appId, String journeyId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -6902,11 +8056,12 @@ public okhttp3.Call updateTemplateCall(String templateId, String appId, UpdateTe basePath = null; } - Object localVarPostBody = updateTemplateRequest; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/templates/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", localVarApiClient.escapeString(templateId.toString())); + String localVarPath = "/apps/{app_id}/journeys/{journey_id}" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "journey_id" + "\\}", localVarApiClient.escapeString(journeyId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -6915,11 +8070,7 @@ public okhttp3.Call updateTemplateCall(String templateId, String appId, UpdateTe Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); - - if (appId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); - } + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -6930,7 +8081,7 @@ public okhttp3.Call updateTemplateCall(String templateId, String appId, UpdateTe } final String[] localVarContentTypes = { - "application/json" + }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -6938,82 +8089,76 @@ public okhttp3.Call updateTemplateCall(String templateId, String appId, UpdateTe } String[] localVarAuthNames = new String[] { "rest_api_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateTemplateValidateBeforeCall(String templateId, String appId, UpdateTemplateRequest updateTemplateRequest, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'templateId' is set - if (templateId == null) { - throw new ApiException("Missing the required parameter 'templateId' when calling updateTemplate(Async)"); - } + private okhttp3.Call viewJourneyValidateBeforeCall(String appId, String journeyId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling updateTemplate(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling viewJourney(Async)"); } - // verify the required parameter 'updateTemplateRequest' is set - if (updateTemplateRequest == null) { - throw new ApiException("Missing the required parameter 'updateTemplateRequest' when calling updateTemplate(Async)"); + // verify the required parameter 'journeyId' is set + if (journeyId == null) { + throw new ApiException("Missing the required parameter 'journeyId' when calling viewJourney(Async)"); } - okhttp3.Call localVarCall = updateTemplateCall(templateId, appId, updateTemplateRequest, _callback); + okhttp3.Call localVarCall = viewJourneyCall(appId, journeyId, _callback); return localVarCall; } /** - * Update template - * Update an existing template. - * @param templateId (required) - * @param appId (required) - * @param updateTemplateRequest (required) - * @return TemplateResource + * View journey + * The Journeys API is in beta. Endpoints and response fields can still change. Retrieve the full configuration of a single journey by its UUID, including its audience and node graph. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param journeyId UUID of the journey to retrieve. (required) + * @return Journey * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
*/ - public TemplateResource updateTemplate(String templateId, String appId, UpdateTemplateRequest updateTemplateRequest) throws ApiException { - ApiResponse localVarResp = updateTemplateWithHttpInfo(templateId, appId, updateTemplateRequest); + public Journey viewJourney(String appId, String journeyId) throws ApiException { + ApiResponse localVarResp = viewJourneyWithHttpInfo(appId, journeyId); return localVarResp.getData(); } /** - * Update template - * Update an existing template. - * @param templateId (required) - * @param appId (required) - * @param updateTemplateRequest (required) - * @return ApiResponse<TemplateResource> + * View journey + * The Journeys API is in beta. Endpoints and response fields can still change. Retrieve the full configuration of a single journey by its UUID, including its audience and node graph. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param journeyId UUID of the journey to retrieve. (required) + * @return ApiResponse<Journey> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
*/ - public ApiResponse updateTemplateWithHttpInfo(String templateId, String appId, UpdateTemplateRequest updateTemplateRequest) throws ApiException { - okhttp3.Call localVarCall = updateTemplateValidateBeforeCall(templateId, appId, updateTemplateRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse viewJourneyWithHttpInfo(String appId, String journeyId) throws ApiException { + okhttp3.Call localVarCall = viewJourneyValidateBeforeCall(appId, journeyId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update template (asynchronously) - * Update an existing template. - * @param templateId (required) - * @param appId (required) - * @param updateTemplateRequest (required) + * View journey (asynchronously) + * The Journeys API is in beta. Endpoints and response fields can still change. Retrieve the full configuration of a single journey by its UUID, including its audience and node graph. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param journeyId UUID of the journey to retrieve. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -7021,37 +8166,35 @@ public ApiResponse updateTemplateWithHttpInfo(String templateI - + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
*/ - public okhttp3.Call updateTemplateAsync(String templateId, String appId, UpdateTemplateRequest updateTemplateRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call viewJourneyAsync(String appId, String journeyId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateTemplateValidateBeforeCall(templateId, appId, updateTemplateRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = viewJourneyValidateBeforeCall(appId, journeyId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for updateUser - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @param updateUserRequest (required) + * Build call for viewJourneyStats + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param journeyId UUID of the journey to retrieve stats for. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - + +
Status Code Description Response Headers
202 ACCEPTED -
400 Bad Request -
409 Conflict -
200 OK -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
*/ - public okhttp3.Call updateUserCall(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call viewJourneyStatsCall(String appId, String journeyId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -7065,13 +8208,12 @@ public okhttp3.Call updateUserCall(String appId, String aliasLabel, String alias basePath = null; } - Object localVarPostBody = updateUserRequest; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apps/{app_id}/users/by/{alias_label}/{alias_id}" + String localVarPath = "/apps/{app_id}/journeys/{journey_id}/stats" .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "alias_label" + "\\}", localVarApiClient.escapeString(aliasLabel.toString())) - .replaceAll("\\{" + "alias_id" + "\\}", localVarApiClient.escapeString(aliasId.toString())); + .replaceAll("\\{" + "journey_id" + "\\}", localVarApiClient.escapeString(journeyId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -7080,7 +8222,7 @@ public okhttp3.Call updateUserCall(String appId, String aliasLabel, String alias Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); final String[] localVarAccepts = { "application/json" @@ -7091,7 +8233,7 @@ public okhttp3.Call updateUserCall(String appId, String aliasLabel, String alias } final String[] localVarContentTypes = { - "application/json" + }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -7099,117 +8241,100 @@ public okhttp3.Call updateUserCall(String appId, String aliasLabel, String alias } String[] localVarAuthNames = new String[] { "rest_api_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateUserValidateBeforeCall(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call viewJourneyStatsValidateBeforeCall(String appId, String journeyId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling updateUser(Async)"); - } - - // verify the required parameter 'aliasLabel' is set - if (aliasLabel == null) { - throw new ApiException("Missing the required parameter 'aliasLabel' when calling updateUser(Async)"); - } - - // verify the required parameter 'aliasId' is set - if (aliasId == null) { - throw new ApiException("Missing the required parameter 'aliasId' when calling updateUser(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling viewJourneyStats(Async)"); } - // verify the required parameter 'updateUserRequest' is set - if (updateUserRequest == null) { - throw new ApiException("Missing the required parameter 'updateUserRequest' when calling updateUser(Async)"); + // verify the required parameter 'journeyId' is set + if (journeyId == null) { + throw new ApiException("Missing the required parameter 'journeyId' when calling viewJourneyStats(Async)"); } - okhttp3.Call localVarCall = updateUserCall(appId, aliasLabel, aliasId, updateUserRequest, _callback); + okhttp3.Call localVarCall = viewJourneyStatsCall(appId, journeyId, _callback); return localVarCall; } /** - * - * Updates an existing User’s properties. - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @param updateUserRequest (required) - * @return PropertiesBody + * View journey stats + * The Journeys API is in beta. Endpoints and response fields can still change. Retrieve performance stats for a single journey: journey-level entry and exit counts, per-node counts keyed by node id, per-branch counts keyed by branch id, and channel delivery stats for message-sending nodes. The response carries no definition detail, so join it by id against the journey from View journey. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param journeyId UUID of the journey to retrieve stats for. (required) + * @return JourneyStats * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - - + +
Status Code Description Response Headers
202 ACCEPTED -
400 Bad Request -
409 Conflict -
200 OK -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
*/ - public PropertiesBody updateUser(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest) throws ApiException { - ApiResponse localVarResp = updateUserWithHttpInfo(appId, aliasLabel, aliasId, updateUserRequest); + public JourneyStats viewJourneyStats(String appId, String journeyId) throws ApiException { + ApiResponse localVarResp = viewJourneyStatsWithHttpInfo(appId, journeyId); return localVarResp.getData(); } /** - * - * Updates an existing User’s properties. - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @param updateUserRequest (required) - * @return ApiResponse<PropertiesBody> + * View journey stats + * The Journeys API is in beta. Endpoints and response fields can still change. Retrieve performance stats for a single journey: journey-level entry and exit counts, per-node counts keyed by node id, per-branch counts keyed by branch id, and channel delivery stats for message-sending nodes. The response carries no definition detail, so join it by id against the journey from View journey. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param journeyId UUID of the journey to retrieve stats for. (required) + * @return ApiResponse<JourneyStats> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - - + +
Status Code Description Response Headers
202 ACCEPTED -
400 Bad Request -
409 Conflict -
200 OK -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
*/ - public ApiResponse updateUserWithHttpInfo(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest) throws ApiException { - okhttp3.Call localVarCall = updateUserValidateBeforeCall(appId, aliasLabel, aliasId, updateUserRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse viewJourneyStatsWithHttpInfo(String appId, String journeyId) throws ApiException { + okhttp3.Call localVarCall = viewJourneyStatsValidateBeforeCall(appId, journeyId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * (asynchronously) - * Updates an existing User’s properties. - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @param updateUserRequest (required) + * View journey stats (asynchronously) + * The Journeys API is in beta. Endpoints and response fields can still change. Retrieve performance stats for a single journey: journey-level entry and exit counts, per-node counts keyed by node id, per-branch counts keyed by branch id, and channel delivery stats for message-sending nodes. The response carries no definition detail, so join it by id against the journey from View journey. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param journeyId UUID of the journey to retrieve stats for. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details - - - + +
Status Code Description Response Headers
202 ACCEPTED -
400 Bad Request -
409 Conflict -
200 OK -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
*/ - public okhttp3.Call updateUserAsync(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call viewJourneyStatsAsync(String appId, String journeyId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateUserValidateBeforeCall(appId, aliasLabel, aliasId, updateUserRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = viewJourneyStatsValidateBeforeCall(appId, journeyId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for viewApiKeys - * @param appId (required) + * Build call for viewJourneys + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param cursor Opaque pagination token from a previous response's next_cursor. Omit for the first page. (optional) + * @param limit Maximum journeys to return per page. Minimum 1, maximum 50. (optional, default to 50) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -7218,10 +8343,12 @@ public okhttp3.Call updateUserAsync(String appId, String aliasLabel, String alia Status Code Description Response Headers 200 OK - 400 Bad Request - + 403 Forbidden - + 429 Rate Limit Exceeded - 0 Unexpected error - */ - public okhttp3.Call viewApiKeysCall(String appId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call viewJourneysCall(String appId, String cursor, Integer limit, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -7238,7 +8365,7 @@ public okhttp3.Call viewApiKeysCall(String appId, final ApiCallback _callback) t Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apps/{app_id}/auth/tokens" + String localVarPath = "/apps/{app_id}/journeys" .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); List localVarQueryParams = new ArrayList(); @@ -7248,7 +8375,15 @@ public okhttp3.Call viewApiKeysCall(String appId, final ApiCallback _callback) t Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); + + if (cursor != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("cursor", cursor)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } final String[] localVarAccepts = { "application/json" @@ -7266,67 +8401,77 @@ public okhttp3.Call viewApiKeysCall(String appId, final ApiCallback _callback) t localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "organization_api_key" }; + String[] localVarAuthNames = new String[] { "rest_api_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call viewApiKeysValidateBeforeCall(String appId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call viewJourneysValidateBeforeCall(String appId, String cursor, Integer limit, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling viewApiKeys(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling viewJourneys(Async)"); } - okhttp3.Call localVarCall = viewApiKeysCall(appId, _callback); + okhttp3.Call localVarCall = viewJourneysCall(appId, cursor, limit, _callback); return localVarCall; } /** - * View API keys - * View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app. - * @param appId (required) - * @return ApiKeyTokensListResponse + * View journeys + * The Journeys API is in beta. Endpoints and response fields can still change. Retrieve a paginated list of journeys for an app. Returns a summary representation of each journey; use View journey for the full configuration. Uses forward-only cursor-based pagination. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param cursor Opaque pagination token from a previous response's next_cursor. Omit for the first page. (optional) + * @param limit Maximum journeys to return per page. Minimum 1, maximum 50. (optional, default to 50) + * @return JourneyListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
429 Rate Limit Exceeded -
0 Unexpected error -
*/ - public ApiKeyTokensListResponse viewApiKeys(String appId) throws ApiException { - ApiResponse localVarResp = viewApiKeysWithHttpInfo(appId); + public JourneyListResponse viewJourneys(String appId, String cursor, Integer limit) throws ApiException { + ApiResponse localVarResp = viewJourneysWithHttpInfo(appId, cursor, limit); return localVarResp.getData(); } /** - * View API keys - * View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app. - * @param appId (required) - * @return ApiResponse<ApiKeyTokensListResponse> + * View journeys + * The Journeys API is in beta. Endpoints and response fields can still change. Retrieve a paginated list of journeys for an app. Returns a summary representation of each journey; use View journey for the full configuration. Uses forward-only cursor-based pagination. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param cursor Opaque pagination token from a previous response's next_cursor. Omit for the first page. (optional) + * @param limit Maximum journeys to return per page. Minimum 1, maximum 50. (optional, default to 50) + * @return ApiResponse<JourneyListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
429 Rate Limit Exceeded -
0 Unexpected error -
*/ - public ApiResponse viewApiKeysWithHttpInfo(String appId) throws ApiException { - okhttp3.Call localVarCall = viewApiKeysValidateBeforeCall(appId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse viewJourneysWithHttpInfo(String appId, String cursor, Integer limit) throws ApiException { + okhttp3.Call localVarCall = viewJourneysValidateBeforeCall(appId, cursor, limit, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * View API keys (asynchronously) - * View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app. - * @param appId (required) + * View journeys (asynchronously) + * The Journeys API is in beta. Endpoints and response fields can still change. Retrieve a paginated list of journeys for an app. Returns a summary representation of each journey; use View journey for the full configuration. Uses forward-only cursor-based pagination. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param cursor Opaque pagination token from a previous response's next_cursor. Omit for the first page. (optional) + * @param limit Maximum journeys to return per page. Minimum 1, maximum 50. (optional, default to 50) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -7335,13 +8480,15 @@ public ApiResponse viewApiKeysWithHttpInfo(String appI Status Code Description Response Headers 200 OK - 400 Bad Request - + 403 Forbidden - + 429 Rate Limit Exceeded - 0 Unexpected error - */ - public okhttp3.Call viewApiKeysAsync(String appId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call viewJourneysAsync(String appId, String cursor, Integer limit, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = viewApiKeysValidateBeforeCall(appId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = viewJourneysValidateBeforeCall(appId, cursor, limit, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -7388,7 +8535,7 @@ public okhttp3.Call viewTemplateCall(String templateId, String appId, final ApiC Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -7544,7 +8691,7 @@ public okhttp3.Call viewTemplatesCall(String appId, Integer limit, Integer offse Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.2"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.12.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); diff --git a/src/main/java/com/onesignal/client/model/CreateJourneyRequest.java b/src/main/java/com/onesignal/client/model/CreateJourneyRequest.java new file mode 100644 index 0000000..e3bd8b2 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/CreateJourneyRequest.java @@ -0,0 +1,393 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.onesignal.client.model.JourneyAudience; +import com.onesignal.client.model.JourneyEarlyExit; +import com.onesignal.client.model.JourneyNode; +import com.onesignal.client.model.JourneyReentryRules; +import com.onesignal.client.model.JourneySchedule; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * Writable fields for Create journey. Journeys are always created in the draft state. Server-controlled fields such as state or id are rejected. + */ +@ApiModel(description = "Writable fields for Create journey. Journeys are always created in the draft state. Server-controlled fields such as state or id are rejected.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateJourneyRequest { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_AUDIENCE = "audience"; + @SerializedName(SERIALIZED_NAME_AUDIENCE) + private JourneyAudience audience; + + public static final String SERIALIZED_NAME_EARLY_EXIT = "early_exit"; + @SerializedName(SERIALIZED_NAME_EARLY_EXIT) + private JourneyEarlyExit earlyExit; + + public static final String SERIALIZED_NAME_REENTRY_RULES = "reentry_rules"; + @SerializedName(SERIALIZED_NAME_REENTRY_RULES) + private JourneyReentryRules reentryRules; + + public static final String SERIALIZED_NAME_SCHEDULE = "schedule"; + @SerializedName(SERIALIZED_NAME_SCHEDULE) + private JourneySchedule schedule; + + public static final String SERIALIZED_NAME_NODES = "nodes"; + @SerializedName(SERIALIZED_NAME_NODES) + private List nodes = null; + + public CreateJourneyRequest() { + } + + public CreateJourneyRequest name(String name) { + + this.name = name; + return this; + } + + /** + * Journey name, up to 300 characters. + * @return name + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Journey name, up to 300 characters.") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public CreateJourneyRequest description(String description) { + + this.description = description; + return this; + } + + /** + * Optional journey description, up to 1024 characters. + * @return description + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional journey description, up to 1024 characters.") + + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public CreateJourneyRequest audience(JourneyAudience audience) { + + this.audience = audience; + return this; + } + + /** + * Get audience + * @return audience + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneyAudience getAudience() { + return audience; + } + + + public void setAudience(JourneyAudience audience) { + this.audience = audience; + } + + + public CreateJourneyRequest earlyExit(JourneyEarlyExit earlyExit) { + + this.earlyExit = earlyExit; + return this; + } + + /** + * Get earlyExit + * @return earlyExit + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneyEarlyExit getEarlyExit() { + return earlyExit; + } + + + public void setEarlyExit(JourneyEarlyExit earlyExit) { + this.earlyExit = earlyExit; + } + + + public CreateJourneyRequest reentryRules(JourneyReentryRules reentryRules) { + + this.reentryRules = reentryRules; + return this; + } + + /** + * Get reentryRules + * @return reentryRules + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneyReentryRules getReentryRules() { + return reentryRules; + } + + + public void setReentryRules(JourneyReentryRules reentryRules) { + this.reentryRules = reentryRules; + } + + + public CreateJourneyRequest schedule(JourneySchedule schedule) { + + this.schedule = schedule; + return this; + } + + /** + * Get schedule + * @return schedule + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneySchedule getSchedule() { + return schedule; + } + + + public void setSchedule(JourneySchedule schedule) { + this.schedule = schedule; + } + + + public CreateJourneyRequest nodes(List nodes) { + + this.nodes = nodes; + return this; + } + + public CreateJourneyRequest addNodesItem(JourneyNode nodesItem) { + if (this.nodes == null) { + this.nodes = new ArrayList<>(); + } + this.nodes.add(nodesItem); + return this; + } + + /** + * Ordered list of journey nodes. Server-assigned id fields are rejected on create. + * @return nodes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Ordered list of journey nodes. Server-assigned id fields are rejected on create.") + + public List getNodes() { + return nodes; + } + + + public void setNodes(List nodes) { + this.nodes = nodes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateJourneyRequest createJourneyRequest = (CreateJourneyRequest) o; + return Objects.equals(this.name, createJourneyRequest.name) && + Objects.equals(this.description, createJourneyRequest.description) && + Objects.equals(this.audience, createJourneyRequest.audience) && + Objects.equals(this.earlyExit, createJourneyRequest.earlyExit) && + Objects.equals(this.reentryRules, createJourneyRequest.reentryRules) && + Objects.equals(this.schedule, createJourneyRequest.schedule) && + Objects.equals(this.nodes, createJourneyRequest.nodes); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, audience, earlyExit, reentryRules, schedule, nodes); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateJourneyRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); + sb.append(" earlyExit: ").append(toIndentedString(earlyExit)).append("\n"); + sb.append(" reentryRules: ").append(toIndentedString(reentryRules)).append("\n"); + sb.append(" schedule: ").append(toIndentedString(schedule)).append("\n"); + sb.append(" nodes: ").append(toIndentedString(nodes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("audience"); + openapiFields.add("early_exit"); + openapiFields.add("reentry_rules"); + openapiFields.add("schedule"); + openapiFields.add("nodes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateJourneyRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateJourneyRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateJourneyRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateJourneyRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateJourneyRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateJourneyRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateJourneyRequest + * @throws IOException if the JSON string is invalid with respect to CreateJourneyRequest + */ + public static CreateJourneyRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateJourneyRequest.class); + } + + /** + * Convert an instance of CreateJourneyRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/Journey.java b/src/main/java/com/onesignal/client/model/Journey.java new file mode 100644 index 0000000..6b879a7 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/Journey.java @@ -0,0 +1,715 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.onesignal.client.model.JourneyAudience; +import com.onesignal.client.model.JourneyEarlyExit; +import com.onesignal.client.model.JourneyNode; +import com.onesignal.client.model.JourneyReentryRules; +import com.onesignal.client.model.JourneySchedule; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * Full journey representation returned by the detail, create, and update endpoints. + */ +@ApiModel(description = "Full journey representation returned by the detail, create, and update endpoints.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Journey { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_APP_ID = "app_id"; + @SerializedName(SERIALIZED_NAME_APP_ID) + private String appId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + /** + * Journey state. New journeys are created as draft. processing is transient while activation is in progress. archived is a journey that has been stopped. Change it through the state field on Update journey. + */ + @JsonAdapter(StateEnum.Adapter.class) + public enum StateEnum { + DRAFT("draft"), + + SCHEDULED("scheduled"), + + PROCESSING("processing"), + + ACTIVE("active"), + + ARCHIVED("archived"); + + private String value; + + StateEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StateEnum fromValue(String value) { + for (StateEnum b : StateEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StateEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StateEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StateEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private StateEnum state; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public static final String SERIALIZED_NAME_STARTED_AT = "started_at"; + @SerializedName(SERIALIZED_NAME_STARTED_AT) + private String startedAt; + + public static final String SERIALIZED_NAME_ARCHIVED_AT = "archived_at"; + @SerializedName(SERIALIZED_NAME_ARCHIVED_AT) + private String archivedAt; + + public static final String SERIALIZED_NAME_CREATED_SOURCE = "created_source"; + @SerializedName(SERIALIZED_NAME_CREATED_SOURCE) + private String createdSource; + + public static final String SERIALIZED_NAME_AUDIENCE = "audience"; + @SerializedName(SERIALIZED_NAME_AUDIENCE) + private JourneyAudience audience; + + public static final String SERIALIZED_NAME_EARLY_EXIT = "early_exit"; + @SerializedName(SERIALIZED_NAME_EARLY_EXIT) + private JourneyEarlyExit earlyExit; + + public static final String SERIALIZED_NAME_REENTRY_RULES = "reentry_rules"; + @SerializedName(SERIALIZED_NAME_REENTRY_RULES) + private JourneyReentryRules reentryRules; + + public static final String SERIALIZED_NAME_SCHEDULE = "schedule"; + @SerializedName(SERIALIZED_NAME_SCHEDULE) + private JourneySchedule schedule; + + public static final String SERIALIZED_NAME_NODES = "nodes"; + @SerializedName(SERIALIZED_NAME_NODES) + private List nodes = null; + + public static final String SERIALIZED_NAME_CONCURRENCY_KEY = "concurrency_key"; + @SerializedName(SERIALIZED_NAME_CONCURRENCY_KEY) + private String concurrencyKey; + + public Journey() { + } + + public Journey id(String id) { + + this.id = id; + return this; + } + + /** + * Journey UUID. Read-only. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Journey UUID. Read-only.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public Journey appId(String appId) { + + this.appId = appId; + return this; + } + + /** + * UUID of the app the journey belongs to. Read-only. + * @return appId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "UUID of the app the journey belongs to. Read-only.") + + public String getAppId() { + return appId; + } + + + public void setAppId(String appId) { + this.appId = appId; + } + + + public Journey name(String name) { + + this.name = name; + return this; + } + + /** + * Journey name, up to 300 characters. + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Journey name, up to 300 characters.") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public Journey description(String description) { + + this.description = description; + return this; + } + + /** + * Journey description, up to 1024 characters. Defaults to an empty string. + * @return description + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Journey description, up to 1024 characters. Defaults to an empty string.") + + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public Journey state(StateEnum state) { + + this.state = state; + return this; + } + + /** + * Journey state. New journeys are created as draft. processing is transient while activation is in progress. archived is a journey that has been stopped. Change it through the state field on Update journey. + * @return state + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Journey state. New journeys are created as draft. processing is transient while activation is in progress. archived is a journey that has been stopped. Change it through the state field on Update journey.") + + public StateEnum getState() { + return state; + } + + + public void setState(StateEnum state) { + this.state = state; + } + + + public Journey createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * ISO 8601 creation time. Read-only. + * @return createdAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "ISO 8601 creation time. Read-only.") + + public String getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public Journey updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * ISO 8601 last-update time. Read-only. + * @return updatedAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "ISO 8601 last-update time. Read-only.") + + public String getUpdatedAt() { + return updatedAt; + } + + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + + public Journey startedAt(String startedAt) { + + this.startedAt = startedAt; + return this; + } + + /** + * ISO 8601 time the journey was activated, or null. Read-only. May stay null briefly after you set state to active: activation is enqueued, and started_at populates once the journey finishes processing. + * @return startedAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "ISO 8601 time the journey was activated, or null. Read-only. May stay null briefly after you set state to active: activation is enqueued, and started_at populates once the journey finishes processing.") + + public String getStartedAt() { + return startedAt; + } + + + public void setStartedAt(String startedAt) { + this.startedAt = startedAt; + } + + + public Journey archivedAt(String archivedAt) { + + this.archivedAt = archivedAt; + return this; + } + + /** + * ISO 8601 time the journey was archived, or null. Read-only. + * @return archivedAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "ISO 8601 time the journey was archived, or null. Read-only.") + + public String getArchivedAt() { + return archivedAt; + } + + + public void setArchivedAt(String archivedAt) { + this.archivedAt = archivedAt; + } + + + public Journey createdSource(String createdSource) { + + this.createdSource = createdSource; + return this; + } + + /** + * Origin of the journey, for example public_api or dashboard. Read-only. + * @return createdSource + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Origin of the journey, for example public_api or dashboard. Read-only.") + + public String getCreatedSource() { + return createdSource; + } + + + public void setCreatedSource(String createdSource) { + this.createdSource = createdSource; + } + + + public Journey audience(JourneyAudience audience) { + + this.audience = audience; + return this; + } + + /** + * Get audience + * @return audience + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneyAudience getAudience() { + return audience; + } + + + public void setAudience(JourneyAudience audience) { + this.audience = audience; + } + + + public Journey earlyExit(JourneyEarlyExit earlyExit) { + + this.earlyExit = earlyExit; + return this; + } + + /** + * Get earlyExit + * @return earlyExit + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneyEarlyExit getEarlyExit() { + return earlyExit; + } + + + public void setEarlyExit(JourneyEarlyExit earlyExit) { + this.earlyExit = earlyExit; + } + + + public Journey reentryRules(JourneyReentryRules reentryRules) { + + this.reentryRules = reentryRules; + return this; + } + + /** + * Get reentryRules + * @return reentryRules + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneyReentryRules getReentryRules() { + return reentryRules; + } + + + public void setReentryRules(JourneyReentryRules reentryRules) { + this.reentryRules = reentryRules; + } + + + public Journey schedule(JourneySchedule schedule) { + + this.schedule = schedule; + return this; + } + + /** + * Get schedule + * @return schedule + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneySchedule getSchedule() { + return schedule; + } + + + public void setSchedule(JourneySchedule schedule) { + this.schedule = schedule; + } + + + public Journey nodes(List nodes) { + + this.nodes = nodes; + return this; + } + + public Journey addNodesItem(JourneyNode nodesItem) { + if (this.nodes == null) { + this.nodes = new ArrayList<>(); + } + this.nodes.add(nodesItem); + return this; + } + + /** + * Ordered list of journey nodes. + * @return nodes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Ordered list of journey nodes.") + + public List getNodes() { + return nodes; + } + + + public void setNodes(List nodes) { + this.nodes = nodes; + } + + + public Journey concurrencyKey(String concurrencyKey) { + + this.concurrencyKey = concurrencyKey; + return this; + } + + /** + * Opaque optimistic-concurrency token. Read-only. Pass it back on update to guard against overwriting a concurrent change (409). Send it back exactly as read; do not construct or parse it. + * @return concurrencyKey + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Opaque optimistic-concurrency token. Read-only. Pass it back on update to guard against overwriting a concurrent change (409). Send it back exactly as read; do not construct or parse it.") + + public String getConcurrencyKey() { + return concurrencyKey; + } + + + public void setConcurrencyKey(String concurrencyKey) { + this.concurrencyKey = concurrencyKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Journey journey = (Journey) o; + return Objects.equals(this.id, journey.id) && + Objects.equals(this.appId, journey.appId) && + Objects.equals(this.name, journey.name) && + Objects.equals(this.description, journey.description) && + Objects.equals(this.state, journey.state) && + Objects.equals(this.createdAt, journey.createdAt) && + Objects.equals(this.updatedAt, journey.updatedAt) && + Objects.equals(this.startedAt, journey.startedAt) && + Objects.equals(this.archivedAt, journey.archivedAt) && + Objects.equals(this.createdSource, journey.createdSource) && + Objects.equals(this.audience, journey.audience) && + Objects.equals(this.earlyExit, journey.earlyExit) && + Objects.equals(this.reentryRules, journey.reentryRules) && + Objects.equals(this.schedule, journey.schedule) && + Objects.equals(this.nodes, journey.nodes) && + Objects.equals(this.concurrencyKey, journey.concurrencyKey); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, appId, name, description, state, createdAt, updatedAt, startedAt, archivedAt, createdSource, audience, earlyExit, reentryRules, schedule, nodes, concurrencyKey); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Journey {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" startedAt: ").append(toIndentedString(startedAt)).append("\n"); + sb.append(" archivedAt: ").append(toIndentedString(archivedAt)).append("\n"); + sb.append(" createdSource: ").append(toIndentedString(createdSource)).append("\n"); + sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); + sb.append(" earlyExit: ").append(toIndentedString(earlyExit)).append("\n"); + sb.append(" reentryRules: ").append(toIndentedString(reentryRules)).append("\n"); + sb.append(" schedule: ").append(toIndentedString(schedule)).append("\n"); + sb.append(" nodes: ").append(toIndentedString(nodes)).append("\n"); + sb.append(" concurrencyKey: ").append(toIndentedString(concurrencyKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("app_id"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("state"); + openapiFields.add("created_at"); + openapiFields.add("updated_at"); + openapiFields.add("started_at"); + openapiFields.add("archived_at"); + openapiFields.add("created_source"); + openapiFields.add("audience"); + openapiFields.add("early_exit"); + openapiFields.add("reentry_rules"); + openapiFields.add("schedule"); + openapiFields.add("nodes"); + openapiFields.add("concurrency_key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Journey.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Journey' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Journey.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Journey value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Journey read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Journey given an JSON string + * + * @param jsonString JSON string + * @return An instance of Journey + * @throws IOException if the JSON string is invalid with respect to Journey + */ + public static Journey fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Journey.class); + } + + /** + * Convert an instance of Journey to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/JourneyAudience.java b/src/main/java/com/onesignal/client/model/JourneyAudience.java new file mode 100644 index 0000000..2887cbb --- /dev/null +++ b/src/main/java/com/onesignal/client/model/JourneyAudience.java @@ -0,0 +1,422 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.onesignal.client.model.JourneyEventAttribute; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * The journey entry audience. The kind field selects which other fields apply. + */ +@ApiModel(description = "The journey entry audience. The kind field selects which other fields apply.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JourneyAudience { + private static final long serialVersionUID = 1L; + + /** + * Audience kind. Selects which other fields apply. + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + SEGMENT("segment"), + + EVENT_TRIGGER("event_trigger"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + public static final String SERIALIZED_NAME_INCLUDED_SEGMENT_IDS = "included_segment_ids"; + @SerializedName(SERIALIZED_NAME_INCLUDED_SEGMENT_IDS) + private List includedSegmentIds = null; + + public static final String SERIALIZED_NAME_EXCLUDED_SEGMENT_IDS = "excluded_segment_ids"; + @SerializedName(SERIALIZED_NAME_EXCLUDED_SEGMENT_IDS) + private List excludedSegmentIds = null; + + public static final String SERIALIZED_NAME_FUTURE_ADDITIONS_ONLY = "future_additions_only"; + @SerializedName(SERIALIZED_NAME_FUTURE_ADDITIONS_ONLY) + private Boolean futureAdditionsOnly; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + private List> attributes = null; + + public JourneyAudience() { + } + + public JourneyAudience kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Audience kind. Selects which other fields apply. + * @return kind + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Audience kind. Selects which other fields apply.") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + public JourneyAudience includedSegmentIds(List includedSegmentIds) { + + this.includedSegmentIds = includedSegmentIds; + return this; + } + + public JourneyAudience addIncludedSegmentIdsItem(String includedSegmentIdsItem) { + if (this.includedSegmentIds == null) { + this.includedSegmentIds = new ArrayList<>(); + } + this.includedSegmentIds.add(includedSegmentIdsItem); + return this; + } + + /** + * segment audiences: Segment UUIDs whose users enter the journey. + * @return includedSegmentIds + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "segment audiences: Segment UUIDs whose users enter the journey.") + + public List getIncludedSegmentIds() { + return includedSegmentIds; + } + + + public void setIncludedSegmentIds(List includedSegmentIds) { + this.includedSegmentIds = includedSegmentIds; + } + + + public JourneyAudience excludedSegmentIds(List excludedSegmentIds) { + + this.excludedSegmentIds = excludedSegmentIds; + return this; + } + + public JourneyAudience addExcludedSegmentIdsItem(String excludedSegmentIdsItem) { + if (this.excludedSegmentIds == null) { + this.excludedSegmentIds = new ArrayList<>(); + } + this.excludedSegmentIds.add(excludedSegmentIdsItem); + return this; + } + + /** + * segment audiences: Segment UUIDs whose users are excluded. + * @return excludedSegmentIds + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "segment audiences: Segment UUIDs whose users are excluded.") + + public List getExcludedSegmentIds() { + return excludedSegmentIds; + } + + + public void setExcludedSegmentIds(List excludedSegmentIds) { + this.excludedSegmentIds = excludedSegmentIds; + } + + + public JourneyAudience futureAdditionsOnly(Boolean futureAdditionsOnly) { + + this.futureAdditionsOnly = futureAdditionsOnly; + return this; + } + + /** + * segment audiences: when true, only users who newly match the segment after activation enter the journey. Defaults to false. + * @return futureAdditionsOnly + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "segment audiences: when true, only users who newly match the segment after activation enter the journey. Defaults to false.") + + public Boolean getFutureAdditionsOnly() { + return futureAdditionsOnly; + } + + + public void setFutureAdditionsOnly(Boolean futureAdditionsOnly) { + this.futureAdditionsOnly = futureAdditionsOnly; + } + + + public JourneyAudience name(String name) { + + this.name = name; + return this; + } + + /** + * event_trigger audiences: event name that triggers entry, up to 255 characters. + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "event_trigger audiences: event name that triggers entry, up to 255 characters.") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public JourneyAudience attributes(List> attributes) { + + this.attributes = attributes; + return this; + } + + public JourneyAudience addAttributesItem(List attributesItem) { + if (this.attributes == null) { + this.attributes = new ArrayList<>(); + } + this.attributes.add(attributesItem); + return this; + } + + /** + * Event attribute matchers, as a list of condition groups. Send a single group whose conditions are AND'd together. More than one group is rejected. + * @return attributes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Event attribute matchers, as a list of condition groups. Send a single group whose conditions are AND'd together. More than one group is rejected.") + + public List> getAttributes() { + return attributes; + } + + + public void setAttributes(List> attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyAudience journeyAudience = (JourneyAudience) o; + return Objects.equals(this.kind, journeyAudience.kind) && + Objects.equals(this.includedSegmentIds, journeyAudience.includedSegmentIds) && + Objects.equals(this.excludedSegmentIds, journeyAudience.excludedSegmentIds) && + Objects.equals(this.futureAdditionsOnly, journeyAudience.futureAdditionsOnly) && + Objects.equals(this.name, journeyAudience.name) && + Objects.equals(this.attributes, journeyAudience.attributes); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(kind, includedSegmentIds, excludedSegmentIds, futureAdditionsOnly, name, attributes); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyAudience {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" includedSegmentIds: ").append(toIndentedString(includedSegmentIds)).append("\n"); + sb.append(" excludedSegmentIds: ").append(toIndentedString(excludedSegmentIds)).append("\n"); + sb.append(" futureAdditionsOnly: ").append(toIndentedString(futureAdditionsOnly)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("kind"); + openapiFields.add("included_segment_ids"); + openapiFields.add("excluded_segment_ids"); + openapiFields.add("future_additions_only"); + openapiFields.add("name"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("kind"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyAudience.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyAudience' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JourneyAudience.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyAudience value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyAudience read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyAudience given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyAudience + * @throws IOException if the JSON string is invalid with respect to JourneyAudience + */ + public static JourneyAudience fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyAudience.class); + } + + /** + * Convert an instance of JourneyAudience to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/JourneyBranch.java b/src/main/java/com/onesignal/client/model/JourneyBranch.java new file mode 100644 index 0000000..795d0a4 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/JourneyBranch.java @@ -0,0 +1,287 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.onesignal.client.model.JourneyCondition; +import com.onesignal.client.model.JourneyNode; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * JourneyBranch + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JourneyBranch { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_CONDITION = "condition"; + @SerializedName(SERIALIZED_NAME_CONDITION) + private JourneyCondition condition; + + public static final String SERIALIZED_NAME_WEIGHT = "weight"; + @SerializedName(SERIALIZED_NAME_WEIGHT) + private BigDecimal weight; + + public static final String SERIALIZED_NAME_NODES = "nodes"; + @SerializedName(SERIALIZED_NAME_NODES) + private List nodes = null; + + public JourneyBranch() { + } + + public JourneyBranch id(String id) { + + this.id = id; + return this; + } + + /** + * Server-assigned branch identifier. Read-only on create; echo it on update to keep the branch. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Server-assigned branch identifier. Read-only on create; echo it on update to keep the branch.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public JourneyBranch condition(JourneyCondition condition) { + + this.condition = condition; + return this; + } + + /** + * Get condition + * @return condition + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneyCondition getCondition() { + return condition; + } + + + public void setCondition(JourneyCondition condition) { + this.condition = condition; + } + + + public JourneyBranch weight(BigDecimal weight) { + + this.weight = weight; + return this; + } + + /** + * Branch weight for split_range nodes. Weights across a node's branches must sum to 100. + * @return weight + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Branch weight for split_range nodes. Weights across a node's branches must sum to 100.") + + public BigDecimal getWeight() { + return weight; + } + + + public void setWeight(BigDecimal weight) { + this.weight = weight; + } + + + public JourneyBranch nodes(List nodes) { + + this.nodes = nodes; + return this; + } + + public JourneyBranch addNodesItem(JourneyNode nodesItem) { + if (this.nodes == null) { + this.nodes = new ArrayList<>(); + } + this.nodes.add(nodesItem); + return this; + } + + /** + * Nodes run when this branch is taken, before flow converges to the next sibling node. + * @return nodes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Nodes run when this branch is taken, before flow converges to the next sibling node.") + + public List getNodes() { + return nodes; + } + + + public void setNodes(List nodes) { + this.nodes = nodes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyBranch journeyBranch = (JourneyBranch) o; + return Objects.equals(this.id, journeyBranch.id) && + Objects.equals(this.condition, journeyBranch.condition) && + Objects.equals(this.weight, journeyBranch.weight) && + Objects.equals(this.nodes, journeyBranch.nodes); + } + + @Override + public int hashCode() { + return Objects.hash(id, condition, weight, nodes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyBranch {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" condition: ").append(toIndentedString(condition)).append("\n"); + sb.append(" weight: ").append(toIndentedString(weight)).append("\n"); + sb.append(" nodes: ").append(toIndentedString(nodes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("condition"); + openapiFields.add("weight"); + openapiFields.add("nodes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyBranch.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyBranch' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JourneyBranch.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyBranch value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyBranch read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyBranch given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyBranch + * @throws IOException if the JSON string is invalid with respect to JourneyBranch + */ + public static JourneyBranch fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyBranch.class); + } + + /** + * Convert an instance of JourneyBranch to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/JourneyBranchStats.java b/src/main/java/com/onesignal/client/model/JourneyBranchStats.java new file mode 100644 index 0000000..01cd535 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/JourneyBranchStats.java @@ -0,0 +1,185 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * Stats for a single branch of a branching node. Keyed in the response by the branch's server-assigned id. + */ +@ApiModel(description = "Stats for a single branch of a branching node. Keyed in the response by the branch's server-assigned id.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JourneyBranchStats { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_COMPLETED = "completed"; + @SerializedName(SERIALIZED_NAME_COMPLETED) + private Integer completed; + + public JourneyBranchStats() { + } + + public JourneyBranchStats completed(Integer completed) { + + this.completed = completed; + return this; + } + + /** + * Users who took this branch. + * @return completed + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Users who took this branch.") + + public Integer getCompleted() { + return completed; + } + + + public void setCompleted(Integer completed) { + this.completed = completed; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyBranchStats journeyBranchStats = (JourneyBranchStats) o; + return Objects.equals(this.completed, journeyBranchStats.completed); + } + + @Override + public int hashCode() { + return Objects.hash(completed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyBranchStats {\n"); + sb.append(" completed: ").append(toIndentedString(completed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("completed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyBranchStats.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyBranchStats' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JourneyBranchStats.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyBranchStats value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyBranchStats read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyBranchStats given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyBranchStats + * @throws IOException if the JSON string is invalid with respect to JourneyBranchStats + */ + public static JourneyBranchStats fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyBranchStats.class); + } + + /** + * Convert an instance of JourneyBranchStats to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/JourneyCondition.java b/src/main/java/com/onesignal/client/model/JourneyCondition.java new file mode 100644 index 0000000..3bee101 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/JourneyCondition.java @@ -0,0 +1,571 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.onesignal.client.model.JourneyEventAttribute; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * A branch condition. The kind field selects which other fields apply. + */ +@ApiModel(description = "A branch condition. The kind field selects which other fields apply.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JourneyCondition { + private static final long serialVersionUID = 1L; + + /** + * Condition kind. Selects which other fields apply. + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + SEGMENT_MEMBERSHIP("segment_membership"), + + ON_NOTIFICATION_ACTION("on_notification_action"), + + EVENT_TRIGGER("event_trigger"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + public static final String SERIALIZED_NAME_INCLUDED_SEGMENT_IDS = "included_segment_ids"; + @SerializedName(SERIALIZED_NAME_INCLUDED_SEGMENT_IDS) + private List includedSegmentIds = null; + + public static final String SERIALIZED_NAME_EXCLUDED_SEGMENT_IDS = "excluded_segment_ids"; + @SerializedName(SERIALIZED_NAME_EXCLUDED_SEGMENT_IDS) + private List excludedSegmentIds = null; + + /** + * on_notification_action conditions: the notification action to branch on. Which actions apply depends on the sending node's channel. + */ + @JsonAdapter(ActionEnum.Adapter.class) + public enum ActionEnum { + RECEIVED("received"), + + CLICKED("clicked"), + + OPENED("opened"); + + private String value; + + ActionEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ActionEnum fromValue(String value) { + for (ActionEnum b : ActionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ActionEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ActionEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ActionEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ACTION = "action"; + @SerializedName(SERIALIZED_NAME_ACTION) + private ActionEnum action; + + public static final String SERIALIZED_NAME_SENDING_NODE_ID = "sending_node_id"; + @SerializedName(SERIALIZED_NAME_SENDING_NODE_ID) + private String sendingNodeId; + + public static final String SERIALIZED_NAME_CLIENT_NODE_ID = "client_node_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_NODE_ID) + private String clientNodeId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + private List> attributes = null; + + public static final String SERIALIZED_NAME_ENTRY_EVENT_MATCH_ATTRIBUTES = "entry_event_match_attributes"; + @SerializedName(SERIALIZED_NAME_ENTRY_EVENT_MATCH_ATTRIBUTES) + private List entryEventMatchAttributes = null; + + public JourneyCondition() { + } + + public JourneyCondition kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Condition kind. Selects which other fields apply. + * @return kind + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Condition kind. Selects which other fields apply.") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + public JourneyCondition includedSegmentIds(List includedSegmentIds) { + + this.includedSegmentIds = includedSegmentIds; + return this; + } + + public JourneyCondition addIncludedSegmentIdsItem(String includedSegmentIdsItem) { + if (this.includedSegmentIds == null) { + this.includedSegmentIds = new ArrayList<>(); + } + this.includedSegmentIds.add(includedSegmentIdsItem); + return this; + } + + /** + * segment_membership conditions: Segment UUIDs the user must belong to. + * @return includedSegmentIds + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "segment_membership conditions: Segment UUIDs the user must belong to.") + + public List getIncludedSegmentIds() { + return includedSegmentIds; + } + + + public void setIncludedSegmentIds(List includedSegmentIds) { + this.includedSegmentIds = includedSegmentIds; + } + + + public JourneyCondition excludedSegmentIds(List excludedSegmentIds) { + + this.excludedSegmentIds = excludedSegmentIds; + return this; + } + + public JourneyCondition addExcludedSegmentIdsItem(String excludedSegmentIdsItem) { + if (this.excludedSegmentIds == null) { + this.excludedSegmentIds = new ArrayList<>(); + } + this.excludedSegmentIds.add(excludedSegmentIdsItem); + return this; + } + + /** + * segment_membership conditions: Segment UUIDs the user must not belong to. + * @return excludedSegmentIds + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "segment_membership conditions: Segment UUIDs the user must not belong to.") + + public List getExcludedSegmentIds() { + return excludedSegmentIds; + } + + + public void setExcludedSegmentIds(List excludedSegmentIds) { + this.excludedSegmentIds = excludedSegmentIds; + } + + + public JourneyCondition action(ActionEnum action) { + + this.action = action; + return this; + } + + /** + * on_notification_action conditions: the notification action to branch on. Which actions apply depends on the sending node's channel. + * @return action + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "on_notification_action conditions: the notification action to branch on. Which actions apply depends on the sending node's channel.") + + public ActionEnum getAction() { + return action; + } + + + public void setAction(ActionEnum action) { + this.action = action; + } + + + public JourneyCondition sendingNodeId(String sendingNodeId) { + + this.sendingNodeId = sendingNodeId; + return this; + } + + /** + * on_notification_action conditions: id of the sending node this action refers to. Returned on reads; accepted on write. + * @return sendingNodeId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "on_notification_action conditions: id of the sending node this action refers to. Returned on reads; accepted on write.") + + public String getSendingNodeId() { + return sendingNodeId; + } + + + public void setSendingNodeId(String sendingNodeId) { + this.sendingNodeId = sendingNodeId; + } + + + public JourneyCondition clientNodeId(String clientNodeId) { + + this.clientNodeId = clientNodeId; + return this; + } + + /** + * on_notification_action conditions: write-only alternative to sending_node_id. References the sending node by its client_node_id. + * @return clientNodeId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "on_notification_action conditions: write-only alternative to sending_node_id. References the sending node by its client_node_id.") + + public String getClientNodeId() { + return clientNodeId; + } + + + public void setClientNodeId(String clientNodeId) { + this.clientNodeId = clientNodeId; + } + + + public JourneyCondition name(String name) { + + this.name = name; + return this; + } + + /** + * event_trigger conditions: event name, up to 255 characters. + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "event_trigger conditions: event name, up to 255 characters.") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public JourneyCondition attributes(List> attributes) { + + this.attributes = attributes; + return this; + } + + public JourneyCondition addAttributesItem(List attributesItem) { + if (this.attributes == null) { + this.attributes = new ArrayList<>(); + } + this.attributes.add(attributesItem); + return this; + } + + /** + * Event attribute matchers, as a list of condition groups. Send a single group whose conditions are AND'd together. More than one group is rejected. + * @return attributes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Event attribute matchers, as a list of condition groups. Send a single group whose conditions are AND'd together. More than one group is rejected.") + + public List> getAttributes() { + return attributes; + } + + + public void setAttributes(List> attributes) { + this.attributes = attributes; + } + + + public JourneyCondition entryEventMatchAttributes(List entryEventMatchAttributes) { + + this.entryEventMatchAttributes = entryEventMatchAttributes; + return this; + } + + public JourneyCondition addEntryEventMatchAttributesItem(Object entryEventMatchAttributesItem) { + if (this.entryEventMatchAttributes == null) { + this.entryEventMatchAttributes = new ArrayList<>(); + } + this.entryEventMatchAttributes.add(entryEventMatchAttributesItem); + return this; + } + + /** + * event_trigger conditions: match incoming event properties against the journey's entry event. Only valid on event-triggered journeys. + * @return entryEventMatchAttributes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "event_trigger conditions: match incoming event properties against the journey's entry event. Only valid on event-triggered journeys.") + + public List getEntryEventMatchAttributes() { + return entryEventMatchAttributes; + } + + + public void setEntryEventMatchAttributes(List entryEventMatchAttributes) { + this.entryEventMatchAttributes = entryEventMatchAttributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyCondition journeyCondition = (JourneyCondition) o; + return Objects.equals(this.kind, journeyCondition.kind) && + Objects.equals(this.includedSegmentIds, journeyCondition.includedSegmentIds) && + Objects.equals(this.excludedSegmentIds, journeyCondition.excludedSegmentIds) && + Objects.equals(this.action, journeyCondition.action) && + Objects.equals(this.sendingNodeId, journeyCondition.sendingNodeId) && + Objects.equals(this.clientNodeId, journeyCondition.clientNodeId) && + Objects.equals(this.name, journeyCondition.name) && + Objects.equals(this.attributes, journeyCondition.attributes) && + Objects.equals(this.entryEventMatchAttributes, journeyCondition.entryEventMatchAttributes); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(kind, includedSegmentIds, excludedSegmentIds, action, sendingNodeId, clientNodeId, name, attributes, entryEventMatchAttributes); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyCondition {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" includedSegmentIds: ").append(toIndentedString(includedSegmentIds)).append("\n"); + sb.append(" excludedSegmentIds: ").append(toIndentedString(excludedSegmentIds)).append("\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" sendingNodeId: ").append(toIndentedString(sendingNodeId)).append("\n"); + sb.append(" clientNodeId: ").append(toIndentedString(clientNodeId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" entryEventMatchAttributes: ").append(toIndentedString(entryEventMatchAttributes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("kind"); + openapiFields.add("included_segment_ids"); + openapiFields.add("excluded_segment_ids"); + openapiFields.add("action"); + openapiFields.add("sending_node_id"); + openapiFields.add("client_node_id"); + openapiFields.add("name"); + openapiFields.add("attributes"); + openapiFields.add("entry_event_match_attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("kind"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyCondition.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyCondition' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JourneyCondition.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyCondition value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyCondition read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyCondition given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyCondition + * @throws IOException if the JSON string is invalid with respect to JourneyCondition + */ + public static JourneyCondition fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyCondition.class); + } + + /** + * Convert an instance of JourneyCondition to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/JourneyEarlyExit.java b/src/main/java/com/onesignal/client/model/JourneyEarlyExit.java new file mode 100644 index 0000000..aacc179 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/JourneyEarlyExit.java @@ -0,0 +1,227 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.onesignal.client.model.JourneyEarlyExitRules; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * Conditions that remove a user from the journey before it completes. At least one rule must be set under rules. Send null to remove early exit entirely. + */ +@ApiModel(description = "Conditions that remove a user from the journey before it completes. At least one rule must be set under rules. Send null to remove early exit entirely.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JourneyEarlyExit { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_RULES = "rules"; + @SerializedName(SERIALIZED_NAME_RULES) + private JourneyEarlyExitRules rules; + + public static final String SERIALIZED_NAME_TAG_ON_EARLY_EXIT = "tag_on_early_exit"; + @SerializedName(SERIALIZED_NAME_TAG_ON_EARLY_EXIT) + private Map tagOnEarlyExit = null; + + public JourneyEarlyExit() { + } + + public JourneyEarlyExit rules(JourneyEarlyExitRules rules) { + + this.rules = rules; + return this; + } + + /** + * Get rules + * @return rules + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneyEarlyExitRules getRules() { + return rules; + } + + + public void setRules(JourneyEarlyExitRules rules) { + this.rules = rules; + } + + + public JourneyEarlyExit tagOnEarlyExit(Map tagOnEarlyExit) { + + this.tagOnEarlyExit = tagOnEarlyExit; + return this; + } + + public JourneyEarlyExit putTagOnEarlyExitItem(String key, String tagOnEarlyExitItem) { + if (this.tagOnEarlyExit == null) { + this.tagOnEarlyExit = new HashMap<>(); + } + this.tagOnEarlyExit.put(key, tagOnEarlyExitItem); + return this; + } + + /** + * Tag key-value pairs applied when a user exits early. + * @return tagOnEarlyExit + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Tag key-value pairs applied when a user exits early.") + + public Map getTagOnEarlyExit() { + return tagOnEarlyExit; + } + + + public void setTagOnEarlyExit(Map tagOnEarlyExit) { + this.tagOnEarlyExit = tagOnEarlyExit; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyEarlyExit journeyEarlyExit = (JourneyEarlyExit) o; + return Objects.equals(this.rules, journeyEarlyExit.rules) && + Objects.equals(this.tagOnEarlyExit, journeyEarlyExit.tagOnEarlyExit); + } + + @Override + public int hashCode() { + return Objects.hash(rules, tagOnEarlyExit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyEarlyExit {\n"); + sb.append(" rules: ").append(toIndentedString(rules)).append("\n"); + sb.append(" tagOnEarlyExit: ").append(toIndentedString(tagOnEarlyExit)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rules"); + openapiFields.add("tag_on_early_exit"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyEarlyExit.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyEarlyExit' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JourneyEarlyExit.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyEarlyExit value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyEarlyExit read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyEarlyExit given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyEarlyExit + * @throws IOException if the JSON string is invalid with respect to JourneyEarlyExit + */ + public static JourneyEarlyExit fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyEarlyExit.class); + } + + /** + * Convert an instance of JourneyEarlyExit to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/JourneyEarlyExitRules.java b/src/main/java/com/onesignal/client/model/JourneyEarlyExitRules.java new file mode 100644 index 0000000..c8c9dd9 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/JourneyEarlyExitRules.java @@ -0,0 +1,288 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.onesignal.client.model.JourneyEarlyExitRulesOnEvent; +import com.onesignal.client.model.JourneyEarlyExitRulesOnSegment; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * JourneyEarlyExitRules + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JourneyEarlyExitRules { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_ON_SEGMENT = "on_segment"; + @SerializedName(SERIALIZED_NAME_ON_SEGMENT) + private JourneyEarlyExitRulesOnSegment onSegment; + + public static final String SERIALIZED_NAME_WHEN_NOT_IN_AUDIENCE = "when_not_in_audience"; + @SerializedName(SERIALIZED_NAME_WHEN_NOT_IN_AUDIENCE) + private Boolean whenNotInAudience; + + public static final String SERIALIZED_NAME_ON_SESSION = "on_session"; + @SerializedName(SERIALIZED_NAME_ON_SESSION) + private Boolean onSession; + + public static final String SERIALIZED_NAME_ON_EVENT = "on_event"; + @SerializedName(SERIALIZED_NAME_ON_EVENT) + private JourneyEarlyExitRulesOnEvent onEvent; + + public JourneyEarlyExitRules() { + } + + public JourneyEarlyExitRules onSegment(JourneyEarlyExitRulesOnSegment onSegment) { + + this.onSegment = onSegment; + return this; + } + + /** + * Get onSegment + * @return onSegment + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneyEarlyExitRulesOnSegment getOnSegment() { + return onSegment; + } + + + public void setOnSegment(JourneyEarlyExitRulesOnSegment onSegment) { + this.onSegment = onSegment; + } + + + public JourneyEarlyExitRules whenNotInAudience(Boolean whenNotInAudience) { + + this.whenNotInAudience = whenNotInAudience; + return this; + } + + /** + * Exit when the user no longer matches the journey audience. Defaults to false. + * @return whenNotInAudience + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Exit when the user no longer matches the journey audience. Defaults to false.") + + public Boolean getWhenNotInAudience() { + return whenNotInAudience; + } + + + public void setWhenNotInAudience(Boolean whenNotInAudience) { + this.whenNotInAudience = whenNotInAudience; + } + + + public JourneyEarlyExitRules onSession(Boolean onSession) { + + this.onSession = onSession; + return this; + } + + /** + * Exit on a new session start. Defaults to false. + * @return onSession + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Exit on a new session start. Defaults to false.") + + public Boolean getOnSession() { + return onSession; + } + + + public void setOnSession(Boolean onSession) { + this.onSession = onSession; + } + + + public JourneyEarlyExitRules onEvent(JourneyEarlyExitRulesOnEvent onEvent) { + + this.onEvent = onEvent; + return this; + } + + /** + * Get onEvent + * @return onEvent + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneyEarlyExitRulesOnEvent getOnEvent() { + return onEvent; + } + + + public void setOnEvent(JourneyEarlyExitRulesOnEvent onEvent) { + this.onEvent = onEvent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyEarlyExitRules journeyEarlyExitRules = (JourneyEarlyExitRules) o; + return Objects.equals(this.onSegment, journeyEarlyExitRules.onSegment) && + Objects.equals(this.whenNotInAudience, journeyEarlyExitRules.whenNotInAudience) && + Objects.equals(this.onSession, journeyEarlyExitRules.onSession) && + Objects.equals(this.onEvent, journeyEarlyExitRules.onEvent); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(onSegment, whenNotInAudience, onSession, onEvent); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyEarlyExitRules {\n"); + sb.append(" onSegment: ").append(toIndentedString(onSegment)).append("\n"); + sb.append(" whenNotInAudience: ").append(toIndentedString(whenNotInAudience)).append("\n"); + sb.append(" onSession: ").append(toIndentedString(onSession)).append("\n"); + sb.append(" onEvent: ").append(toIndentedString(onEvent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("on_segment"); + openapiFields.add("when_not_in_audience"); + openapiFields.add("on_session"); + openapiFields.add("on_event"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyEarlyExitRules.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyEarlyExitRules' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JourneyEarlyExitRules.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyEarlyExitRules value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyEarlyExitRules read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyEarlyExitRules given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyEarlyExitRules + * @throws IOException if the JSON string is invalid with respect to JourneyEarlyExitRules + */ + public static JourneyEarlyExitRules fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyEarlyExitRules.class); + } + + /** + * Convert an instance of JourneyEarlyExitRules to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/JourneyEarlyExitRulesOnEvent.java b/src/main/java/com/onesignal/client/model/JourneyEarlyExitRulesOnEvent.java new file mode 100644 index 0000000..fe31767 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/JourneyEarlyExitRulesOnEvent.java @@ -0,0 +1,185 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * JourneyEarlyExitRulesOnEvent + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JourneyEarlyExitRulesOnEvent { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public JourneyEarlyExitRulesOnEvent() { + } + + public JourneyEarlyExitRulesOnEvent name(String name) { + + this.name = name; + return this; + } + + /** + * Exit when this event occurs. Up to 255 characters. + * @return name + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Exit when this event occurs. Up to 255 characters.") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyEarlyExitRulesOnEvent journeyEarlyExitRulesOnEvent = (JourneyEarlyExitRulesOnEvent) o; + return Objects.equals(this.name, journeyEarlyExitRulesOnEvent.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyEarlyExitRulesOnEvent {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyEarlyExitRulesOnEvent.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyEarlyExitRulesOnEvent' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JourneyEarlyExitRulesOnEvent.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyEarlyExitRulesOnEvent value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyEarlyExitRulesOnEvent read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyEarlyExitRulesOnEvent given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyEarlyExitRulesOnEvent + * @throws IOException if the JSON string is invalid with respect to JourneyEarlyExitRulesOnEvent + */ + public static JourneyEarlyExitRulesOnEvent fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyEarlyExitRulesOnEvent.class); + } + + /** + * Convert an instance of JourneyEarlyExitRulesOnEvent to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/JourneyEarlyExitRulesOnSegment.java b/src/main/java/com/onesignal/client/model/JourneyEarlyExitRulesOnSegment.java new file mode 100644 index 0000000..7e72edb --- /dev/null +++ b/src/main/java/com/onesignal/client/model/JourneyEarlyExitRulesOnSegment.java @@ -0,0 +1,194 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * JourneyEarlyExitRulesOnSegment + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JourneyEarlyExitRulesOnSegment { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_INCLUDED_SEGMENT_IDS = "included_segment_ids"; + @SerializedName(SERIALIZED_NAME_INCLUDED_SEGMENT_IDS) + private List includedSegmentIds = null; + + public JourneyEarlyExitRulesOnSegment() { + } + + public JourneyEarlyExitRulesOnSegment includedSegmentIds(List includedSegmentIds) { + + this.includedSegmentIds = includedSegmentIds; + return this; + } + + public JourneyEarlyExitRulesOnSegment addIncludedSegmentIdsItem(String includedSegmentIdsItem) { + if (this.includedSegmentIds == null) { + this.includedSegmentIds = new ArrayList<>(); + } + this.includedSegmentIds.add(includedSegmentIdsItem); + return this; + } + + /** + * Exit when the user enters any of these segments. + * @return includedSegmentIds + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Exit when the user enters any of these segments.") + + public List getIncludedSegmentIds() { + return includedSegmentIds; + } + + + public void setIncludedSegmentIds(List includedSegmentIds) { + this.includedSegmentIds = includedSegmentIds; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyEarlyExitRulesOnSegment journeyEarlyExitRulesOnSegment = (JourneyEarlyExitRulesOnSegment) o; + return Objects.equals(this.includedSegmentIds, journeyEarlyExitRulesOnSegment.includedSegmentIds); + } + + @Override + public int hashCode() { + return Objects.hash(includedSegmentIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyEarlyExitRulesOnSegment {\n"); + sb.append(" includedSegmentIds: ").append(toIndentedString(includedSegmentIds)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("included_segment_ids"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyEarlyExitRulesOnSegment.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyEarlyExitRulesOnSegment' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JourneyEarlyExitRulesOnSegment.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyEarlyExitRulesOnSegment value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyEarlyExitRulesOnSegment read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyEarlyExitRulesOnSegment given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyEarlyExitRulesOnSegment + * @throws IOException if the JSON string is invalid with respect to JourneyEarlyExitRulesOnSegment + */ + public static JourneyEarlyExitRulesOnSegment fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyEarlyExitRulesOnSegment.class); + } + + /** + * Convert an instance of JourneyEarlyExitRulesOnSegment to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/JourneyEventAttribute.java b/src/main/java/com/onesignal/client/model/JourneyEventAttribute.java new file mode 100644 index 0000000..31831bf --- /dev/null +++ b/src/main/java/com/onesignal/client/model/JourneyEventAttribute.java @@ -0,0 +1,313 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * JourneyEventAttribute + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JourneyEventAttribute { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + /** + * Comparison operator. + */ + @JsonAdapter(OperatorEnum.Adapter.class) + public enum OperatorEnum { + EQUAL("equal"), + + NOT_EQUAL("not_equal"), + + LESS("less"), + + LESS_OR_EQUAL("less_or_equal"), + + GREATER_OR_EQUAL("greater_or_equal"), + + GREATER("greater"), + + IS("is"), + + IS_NOT("is_not"), + + EXISTS("exists"), + + NOT_EXISTS("not_exists"), + + BEFORE("before"), + + AFTER("after"); + + private String value; + + OperatorEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OperatorEnum fromValue(String value) { + for (OperatorEnum b : OperatorEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OperatorEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OperatorEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return OperatorEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_OPERATOR = "operator"; + @SerializedName(SERIALIZED_NAME_OPERATOR) + private OperatorEnum operator; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public JourneyEventAttribute() { + } + + public JourneyEventAttribute key(String key) { + + this.key = key; + return this; + } + + /** + * Event attribute key. + * @return key + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Event attribute key.") + + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public JourneyEventAttribute operator(OperatorEnum operator) { + + this.operator = operator; + return this; + } + + /** + * Comparison operator. + * @return operator + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Comparison operator.") + + public OperatorEnum getOperator() { + return operator; + } + + + public void setOperator(OperatorEnum operator) { + this.operator = operator; + } + + + public JourneyEventAttribute value(String value) { + + this.value = value; + return this; + } + + /** + * Value to compare against. Not required for exists and not_exists. + * @return value + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Value to compare against. Not required for exists and not_exists.") + + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyEventAttribute journeyEventAttribute = (JourneyEventAttribute) o; + return Objects.equals(this.key, journeyEventAttribute.key) && + Objects.equals(this.operator, journeyEventAttribute.operator) && + Objects.equals(this.value, journeyEventAttribute.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, operator, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyEventAttribute {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("operator"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("operator"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyEventAttribute.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyEventAttribute' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JourneyEventAttribute.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyEventAttribute value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyEventAttribute read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyEventAttribute given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyEventAttribute + * @throws IOException if the JSON string is invalid with respect to JourneyEventAttribute + */ + public static JourneyEventAttribute fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyEventAttribute.class); + } + + /** + * Convert an instance of JourneyEventAttribute to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/JourneyListAudience.java b/src/main/java/com/onesignal/client/model/JourneyListAudience.java new file mode 100644 index 0000000..08447f7 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/JourneyListAudience.java @@ -0,0 +1,232 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * Entry audience reduced to its kind. Use View journey for the full audience configuration. + */ +@ApiModel(description = "Entry audience reduced to its kind. Use View journey for the full audience configuration.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JourneyListAudience { + private static final long serialVersionUID = 1L; + + /** + * Audience kind. + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + SEGMENT("segment"), + + EVENT_TRIGGER("event_trigger"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + public JourneyListAudience() { + } + + public JourneyListAudience kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Audience kind. + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Audience kind.") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyListAudience journeyListAudience = (JourneyListAudience) o; + return Objects.equals(this.kind, journeyListAudience.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyListAudience {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("kind"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyListAudience.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyListAudience' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JourneyListAudience.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyListAudience value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyListAudience read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyListAudience given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyListAudience + * @throws IOException if the JSON string is invalid with respect to JourneyListAudience + */ + public static JourneyListAudience fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyListAudience.class); + } + + /** + * Convert an instance of JourneyListAudience to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/JourneyListItem.java b/src/main/java/com/onesignal/client/model/JourneyListItem.java new file mode 100644 index 0000000..1278362 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/JourneyListItem.java @@ -0,0 +1,583 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.onesignal.client.model.JourneyListAudience; +import com.onesignal.client.model.JourneyReentryRules; +import com.onesignal.client.model.JourneySchedule; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * Summary journey representation returned by the list endpoint. Excludes description, nodes, early-exit configuration, and concurrency_key. + */ +@ApiModel(description = "Summary journey representation returned by the list endpoint. Excludes description, nodes, early-exit configuration, and concurrency_key.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JourneyListItem { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_APP_ID = "app_id"; + @SerializedName(SERIALIZED_NAME_APP_ID) + private String appId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + /** + * Journey state. New journeys are created as draft. processing is transient while activation is in progress. archived is a journey that has been stopped. Change it through the state field on Update journey. + */ + @JsonAdapter(StateEnum.Adapter.class) + public enum StateEnum { + DRAFT("draft"), + + SCHEDULED("scheduled"), + + PROCESSING("processing"), + + ACTIVE("active"), + + ARCHIVED("archived"); + + private String value; + + StateEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StateEnum fromValue(String value) { + for (StateEnum b : StateEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StateEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StateEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StateEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private StateEnum state; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public static final String SERIALIZED_NAME_STARTED_AT = "started_at"; + @SerializedName(SERIALIZED_NAME_STARTED_AT) + private String startedAt; + + public static final String SERIALIZED_NAME_ARCHIVED_AT = "archived_at"; + @SerializedName(SERIALIZED_NAME_ARCHIVED_AT) + private String archivedAt; + + public static final String SERIALIZED_NAME_CREATED_SOURCE = "created_source"; + @SerializedName(SERIALIZED_NAME_CREATED_SOURCE) + private String createdSource; + + public static final String SERIALIZED_NAME_SCHEDULE = "schedule"; + @SerializedName(SERIALIZED_NAME_SCHEDULE) + private JourneySchedule schedule; + + public static final String SERIALIZED_NAME_AUDIENCE = "audience"; + @SerializedName(SERIALIZED_NAME_AUDIENCE) + private JourneyListAudience audience; + + public static final String SERIALIZED_NAME_REENTRY_RULES = "reentry_rules"; + @SerializedName(SERIALIZED_NAME_REENTRY_RULES) + private JourneyReentryRules reentryRules; + + public JourneyListItem() { + } + + public JourneyListItem id(String id) { + + this.id = id; + return this; + } + + /** + * Journey UUID. Read-only. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Journey UUID. Read-only.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public JourneyListItem appId(String appId) { + + this.appId = appId; + return this; + } + + /** + * UUID of the app the journey belongs to. Read-only. + * @return appId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "UUID of the app the journey belongs to. Read-only.") + + public String getAppId() { + return appId; + } + + + public void setAppId(String appId) { + this.appId = appId; + } + + + public JourneyListItem name(String name) { + + this.name = name; + return this; + } + + /** + * Journey name, up to 300 characters. + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Journey name, up to 300 characters.") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public JourneyListItem state(StateEnum state) { + + this.state = state; + return this; + } + + /** + * Journey state. New journeys are created as draft. processing is transient while activation is in progress. archived is a journey that has been stopped. Change it through the state field on Update journey. + * @return state + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Journey state. New journeys are created as draft. processing is transient while activation is in progress. archived is a journey that has been stopped. Change it through the state field on Update journey.") + + public StateEnum getState() { + return state; + } + + + public void setState(StateEnum state) { + this.state = state; + } + + + public JourneyListItem createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * ISO 8601 creation time. Read-only. + * @return createdAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "ISO 8601 creation time. Read-only.") + + public String getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public JourneyListItem updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * ISO 8601 last-update time. Read-only. + * @return updatedAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "ISO 8601 last-update time. Read-only.") + + public String getUpdatedAt() { + return updatedAt; + } + + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + + public JourneyListItem startedAt(String startedAt) { + + this.startedAt = startedAt; + return this; + } + + /** + * ISO 8601 time the journey was activated, or null. Read-only. + * @return startedAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "ISO 8601 time the journey was activated, or null. Read-only.") + + public String getStartedAt() { + return startedAt; + } + + + public void setStartedAt(String startedAt) { + this.startedAt = startedAt; + } + + + public JourneyListItem archivedAt(String archivedAt) { + + this.archivedAt = archivedAt; + return this; + } + + /** + * ISO 8601 time the journey was archived, or null. Read-only. + * @return archivedAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "ISO 8601 time the journey was archived, or null. Read-only.") + + public String getArchivedAt() { + return archivedAt; + } + + + public void setArchivedAt(String archivedAt) { + this.archivedAt = archivedAt; + } + + + public JourneyListItem createdSource(String createdSource) { + + this.createdSource = createdSource; + return this; + } + + /** + * Origin of the journey, for example public_api or dashboard. Read-only. + * @return createdSource + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Origin of the journey, for example public_api or dashboard. Read-only.") + + public String getCreatedSource() { + return createdSource; + } + + + public void setCreatedSource(String createdSource) { + this.createdSource = createdSource; + } + + + public JourneyListItem schedule(JourneySchedule schedule) { + + this.schedule = schedule; + return this; + } + + /** + * Get schedule + * @return schedule + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneySchedule getSchedule() { + return schedule; + } + + + public void setSchedule(JourneySchedule schedule) { + this.schedule = schedule; + } + + + public JourneyListItem audience(JourneyListAudience audience) { + + this.audience = audience; + return this; + } + + /** + * Get audience + * @return audience + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneyListAudience getAudience() { + return audience; + } + + + public void setAudience(JourneyListAudience audience) { + this.audience = audience; + } + + + public JourneyListItem reentryRules(JourneyReentryRules reentryRules) { + + this.reentryRules = reentryRules; + return this; + } + + /** + * Get reentryRules + * @return reentryRules + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneyReentryRules getReentryRules() { + return reentryRules; + } + + + public void setReentryRules(JourneyReentryRules reentryRules) { + this.reentryRules = reentryRules; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyListItem journeyListItem = (JourneyListItem) o; + return Objects.equals(this.id, journeyListItem.id) && + Objects.equals(this.appId, journeyListItem.appId) && + Objects.equals(this.name, journeyListItem.name) && + Objects.equals(this.state, journeyListItem.state) && + Objects.equals(this.createdAt, journeyListItem.createdAt) && + Objects.equals(this.updatedAt, journeyListItem.updatedAt) && + Objects.equals(this.startedAt, journeyListItem.startedAt) && + Objects.equals(this.archivedAt, journeyListItem.archivedAt) && + Objects.equals(this.createdSource, journeyListItem.createdSource) && + Objects.equals(this.schedule, journeyListItem.schedule) && + Objects.equals(this.audience, journeyListItem.audience) && + Objects.equals(this.reentryRules, journeyListItem.reentryRules); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, appId, name, state, createdAt, updatedAt, startedAt, archivedAt, createdSource, schedule, audience, reentryRules); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyListItem {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" startedAt: ").append(toIndentedString(startedAt)).append("\n"); + sb.append(" archivedAt: ").append(toIndentedString(archivedAt)).append("\n"); + sb.append(" createdSource: ").append(toIndentedString(createdSource)).append("\n"); + sb.append(" schedule: ").append(toIndentedString(schedule)).append("\n"); + sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); + sb.append(" reentryRules: ").append(toIndentedString(reentryRules)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("app_id"); + openapiFields.add("name"); + openapiFields.add("state"); + openapiFields.add("created_at"); + openapiFields.add("updated_at"); + openapiFields.add("started_at"); + openapiFields.add("archived_at"); + openapiFields.add("created_source"); + openapiFields.add("schedule"); + openapiFields.add("audience"); + openapiFields.add("reentry_rules"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyListItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyListItem' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JourneyListItem.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyListItem value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyListItem read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyListItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyListItem + * @throws IOException if the JSON string is invalid with respect to JourneyListItem + */ + public static JourneyListItem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyListItem.class); + } + + /** + * Convert an instance of JourneyListItem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/JourneyListResponse.java b/src/main/java/com/onesignal/client/model/JourneyListResponse.java new file mode 100644 index 0000000..7cef2db --- /dev/null +++ b/src/main/java/com/onesignal/client/model/JourneyListResponse.java @@ -0,0 +1,255 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.onesignal.client.model.JourneyListItem; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * JourneyListResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JourneyListResponse { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_JOURNEYS = "journeys"; + @SerializedName(SERIALIZED_NAME_JOURNEYS) + private List journeys = null; + + public static final String SERIALIZED_NAME_HAS_MORE = "has_more"; + @SerializedName(SERIALIZED_NAME_HAS_MORE) + private Boolean hasMore; + + public static final String SERIALIZED_NAME_NEXT_CURSOR = "next_cursor"; + @SerializedName(SERIALIZED_NAME_NEXT_CURSOR) + private String nextCursor; + + public JourneyListResponse() { + } + + public JourneyListResponse journeys(List journeys) { + + this.journeys = journeys; + return this; + } + + public JourneyListResponse addJourneysItem(JourneyListItem journeysItem) { + if (this.journeys == null) { + this.journeys = new ArrayList<>(); + } + this.journeys.add(journeysItem); + return this; + } + + /** + * Journeys ordered by creation time, newest first. + * @return journeys + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Journeys ordered by creation time, newest first.") + + public List getJourneys() { + return journeys; + } + + + public void setJourneys(List journeys) { + this.journeys = journeys; + } + + + public JourneyListResponse hasMore(Boolean hasMore) { + + this.hasMore = hasMore; + return this; + } + + /** + * true if more journeys exist beyond this page. + * @return hasMore + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "true if more journeys exist beyond this page.") + + public Boolean getHasMore() { + return hasMore; + } + + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + + + public JourneyListResponse nextCursor(String nextCursor) { + + this.nextCursor = nextCursor; + return this; + } + + /** + * Cursor for the next page. Present only when has_more is true. + * @return nextCursor + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Cursor for the next page. Present only when has_more is true.") + + public String getNextCursor() { + return nextCursor; + } + + + public void setNextCursor(String nextCursor) { + this.nextCursor = nextCursor; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyListResponse journeyListResponse = (JourneyListResponse) o; + return Objects.equals(this.journeys, journeyListResponse.journeys) && + Objects.equals(this.hasMore, journeyListResponse.hasMore) && + Objects.equals(this.nextCursor, journeyListResponse.nextCursor); + } + + @Override + public int hashCode() { + return Objects.hash(journeys, hasMore, nextCursor); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyListResponse {\n"); + sb.append(" journeys: ").append(toIndentedString(journeys)).append("\n"); + sb.append(" hasMore: ").append(toIndentedString(hasMore)).append("\n"); + sb.append(" nextCursor: ").append(toIndentedString(nextCursor)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("journeys"); + openapiFields.add("has_more"); + openapiFields.add("next_cursor"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JourneyListResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyListResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyListResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyListResponse + * @throws IOException if the JSON string is invalid with respect to JourneyListResponse + */ + public static JourneyListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyListResponse.class); + } + + /** + * Convert an instance of JourneyListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/JourneyMessageStats.java b/src/main/java/com/onesignal/client/model/JourneyMessageStats.java new file mode 100644 index 0000000..0781236 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/JourneyMessageStats.java @@ -0,0 +1,197 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * Delivery stats for a message-sending node. Present only on send_push, send_email, send_sms, send_iam, and send_webhook nodes. The keys inside totals depend on the node's channel. + */ +@ApiModel(description = "Delivery stats for a message-sending node. Present only on send_push, send_email, send_sms, send_iam, and send_webhook nodes. The keys inside totals depend on the node's channel.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JourneyMessageStats { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_TOTALS = "totals"; + @SerializedName(SERIALIZED_NAME_TOTALS) + private Map totals = null; + + public JourneyMessageStats() { + } + + public JourneyMessageStats totals(Map totals) { + + this.totals = totals; + return this; + } + + public JourneyMessageStats putTotalsItem(String key, BigDecimal totalsItem) { + if (this.totals == null) { + this.totals = new HashMap<>(); + } + this.totals.put(key, totalsItem); + return this; + } + + /** + * All-time totals for this node, keyed by channel-specific stat name. + * @return totals + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "All-time totals for this node, keyed by channel-specific stat name.") + + public Map getTotals() { + return totals; + } + + + public void setTotals(Map totals) { + this.totals = totals; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyMessageStats journeyMessageStats = (JourneyMessageStats) o; + return Objects.equals(this.totals, journeyMessageStats.totals); + } + + @Override + public int hashCode() { + return Objects.hash(totals); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyMessageStats {\n"); + sb.append(" totals: ").append(toIndentedString(totals)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("totals"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyMessageStats.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyMessageStats' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JourneyMessageStats.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyMessageStats value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyMessageStats read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyMessageStats given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyMessageStats + * @throws IOException if the JSON string is invalid with respect to JourneyMessageStats + */ + public static JourneyMessageStats fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyMessageStats.class); + } + + /** + * Convert an instance of JourneyMessageStats to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/JourneyNode.java b/src/main/java/com/onesignal/client/model/JourneyNode.java new file mode 100644 index 0000000..94326d4 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/JourneyNode.java @@ -0,0 +1,824 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.onesignal.client.model.JourneyBranch; +import com.onesignal.client.model.JourneyTimeWindow; +import com.onesignal.client.model.JourneyWaitUntilExpiration; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * A journey node. The kind field selects which other fields apply. Branching nodes (split_range, yes_no, wait_until) nest their sub-graphs inline via branches[].nodes. + */ +@ApiModel(description = "A journey node. The kind field selects which other fields apply. Branching nodes (split_range, yes_no, wait_until) nest their sub-graphs inline via branches[].nodes.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JourneyNode { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + /** + * Node kind. Selects which other fields apply. + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + WAIT("wait"), + + TIME_WINDOW("time_window"), + + SEND_PUSH("send_push"), + + SEND_EMAIL("send_email"), + + SEND_SMS("send_sms"), + + SEND_IAM("send_iam"), + + SEND_WEBHOOK("send_webhook"), + + TAG("tag"), + + SPLIT_RANGE("split_range"), + + YES_NO("yes_no"), + + WAIT_UNTIL("wait_until"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + public static final String SERIALIZED_NAME_CLIENT_NODE_ID = "client_node_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_NODE_ID) + private String clientNodeId; + + public static final String SERIALIZED_NAME_ANNOTATION = "annotation"; + @SerializedName(SERIALIZED_NAME_ANNOTATION) + private String annotation; + + public static final String SERIALIZED_NAME_DURATION_SECONDS = "duration_seconds"; + @SerializedName(SERIALIZED_NAME_DURATION_SECONDS) + private Integer durationSeconds; + + /** + * time_window nodes: schedule_in_timezone uses the configured windows; last_active_time holds relative to the user's last active time. + */ + @JsonAdapter(RelativeToEnum.Adapter.class) + public enum RelativeToEnum { + SCHEDULE_IN_TIMEZONE("schedule_in_timezone"), + + LAST_ACTIVE_TIME("last_active_time"); + + private String value; + + RelativeToEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RelativeToEnum fromValue(String value) { + for (RelativeToEnum b : RelativeToEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RelativeToEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RelativeToEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RelativeToEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_RELATIVE_TO = "relative_to"; + @SerializedName(SERIALIZED_NAME_RELATIVE_TO) + private RelativeToEnum relativeTo; + + public static final String SERIALIZED_NAME_WINDOWS = "windows"; + @SerializedName(SERIALIZED_NAME_WINDOWS) + private List windows = null; + + public static final String SERIALIZED_NAME_TIME_ZONE = "time_zone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + private String timeZone; + + public static final String SERIALIZED_NAME_USE_USER_TIME_ZONE = "use_user_time_zone"; + @SerializedName(SERIALIZED_NAME_USE_USER_TIME_ZONE) + private Boolean useUserTimeZone; + + public static final String SERIALIZED_NAME_TEMPLATE_ID = "template_id"; + @SerializedName(SERIALIZED_NAME_TEMPLATE_ID) + private String templateId; + + public static final String SERIALIZED_NAME_IAM_ID = "iam_id"; + @SerializedName(SERIALIZED_NAME_IAM_ID) + private String iamId; + + public static final String SERIALIZED_NAME_USER_TTL_SECONDS = "user_ttl_seconds"; + @SerializedName(SERIALIZED_NAME_USER_TTL_SECONDS) + private Integer userTtlSeconds; + + public static final String SERIALIZED_NAME_WEBHOOK_ID = "webhook_id"; + @SerializedName(SERIALIZED_NAME_WEBHOOK_ID) + private String webhookId; + + public static final String SERIALIZED_NAME_ASSIGNMENTS = "assignments"; + @SerializedName(SERIALIZED_NAME_ASSIGNMENTS) + private Map assignments = null; + + public static final String SERIALIZED_NAME_RANDOMIZE_ON_ENTRY = "randomize_on_entry"; + @SerializedName(SERIALIZED_NAME_RANDOMIZE_ON_ENTRY) + private Boolean randomizeOnEntry; + + public static final String SERIALIZED_NAME_BRANCHES = "branches"; + @SerializedName(SERIALIZED_NAME_BRANCHES) + private List branches = null; + + public static final String SERIALIZED_NAME_EXPIRATION = "expiration"; + @SerializedName(SERIALIZED_NAME_EXPIRATION) + private JourneyWaitUntilExpiration expiration; + + public JourneyNode() { + } + + public JourneyNode id(String id) { + + this.id = id; + return this; + } + + /** + * Server-assigned node UUID. Returned on reads. Required on update to keep an existing node. Rejected on create with a 400 validation error. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Server-assigned node UUID. Returned on reads. Required on update to keep an existing node. Rejected on create with a 400 validation error.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public JourneyNode kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Node kind. Selects which other fields apply. + * @return kind + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Node kind. Selects which other fields apply.") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + public JourneyNode clientNodeId(String clientNodeId) { + + this.clientNodeId = clientNodeId; + return this; + } + + /** + * Optional client-assigned identifier, unique within the journey. Use it to reference this node from elsewhere in the same request. Persisted and returned on reads. + * @return clientNodeId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional client-assigned identifier, unique within the journey. Use it to reference this node from elsewhere in the same request. Persisted and returned on reads.") + + public String getClientNodeId() { + return clientNodeId; + } + + + public void setClientNodeId(String clientNodeId) { + this.clientNodeId = clientNodeId; + } + + + public JourneyNode annotation(String annotation) { + + this.annotation = annotation; + return this; + } + + /** + * Optional free-text label, up to 255 characters. Stored and returned as-is with no effect on journey behavior. + * @return annotation + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional free-text label, up to 255 characters. Stored and returned as-is with no effect on journey behavior.") + + public String getAnnotation() { + return annotation; + } + + + public void setAnnotation(String annotation) { + this.annotation = annotation; + } + + + public JourneyNode durationSeconds(Integer durationSeconds) { + + this.durationSeconds = durationSeconds; + return this; + } + + /** + * wait nodes: seconds to hold the user. Minimum 60, maximum 31556952 (1 year). + * minimum: 60 + * maximum: 31556952 + * @return durationSeconds + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "wait nodes: seconds to hold the user. Minimum 60, maximum 31556952 (1 year).") + + public Integer getDurationSeconds() { + return durationSeconds; + } + + + public void setDurationSeconds(Integer durationSeconds) { + this.durationSeconds = durationSeconds; + } + + + public JourneyNode relativeTo(RelativeToEnum relativeTo) { + + this.relativeTo = relativeTo; + return this; + } + + /** + * time_window nodes: schedule_in_timezone uses the configured windows; last_active_time holds relative to the user's last active time. + * @return relativeTo + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "time_window nodes: schedule_in_timezone uses the configured windows; last_active_time holds relative to the user's last active time.") + + public RelativeToEnum getRelativeTo() { + return relativeTo; + } + + + public void setRelativeTo(RelativeToEnum relativeTo) { + this.relativeTo = relativeTo; + } + + + public JourneyNode windows(List windows) { + + this.windows = windows; + return this; + } + + public JourneyNode addWindowsItem(JourneyTimeWindow windowsItem) { + if (this.windows == null) { + this.windows = new ArrayList<>(); + } + this.windows.add(windowsItem); + return this; + } + + /** + * time_window nodes: one or more time windows. A window with no day_of_week applies to every day. Required when relative_to is schedule_in_timezone; omit when it is last_active_time. + * @return windows + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "time_window nodes: one or more time windows. A window with no day_of_week applies to every day. Required when relative_to is schedule_in_timezone; omit when it is last_active_time.") + + public List getWindows() { + return windows; + } + + + public void setWindows(List windows) { + this.windows = windows; + } + + + public JourneyNode timeZone(String timeZone) { + + this.timeZone = timeZone; + return this; + } + + /** + * time_window nodes: IANA timezone identifier used when the user's timezone is unavailable. + * @return timeZone + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "time_window nodes: IANA timezone identifier used when the user's timezone is unavailable.") + + public String getTimeZone() { + return timeZone; + } + + + public void setTimeZone(String timeZone) { + this.timeZone = timeZone; + } + + + public JourneyNode useUserTimeZone(Boolean useUserTimeZone) { + + this.useUserTimeZone = useUserTimeZone; + return this; + } + + /** + * time_window nodes: when true, uses the user's timezone if available. + * @return useUserTimeZone + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "time_window nodes: when true, uses the user's timezone if available.") + + public Boolean getUseUserTimeZone() { + return useUserTimeZone; + } + + + public void setUseUserTimeZone(Boolean useUserTimeZone) { + this.useUserTimeZone = useUserTimeZone; + } + + + public JourneyNode templateId(String templateId) { + + this.templateId = templateId; + return this; + } + + /** + * send_push, send_email, and send_sms nodes: UUID of the template to send. + * @return templateId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "send_push, send_email, and send_sms nodes: UUID of the template to send.") + + public String getTemplateId() { + return templateId; + } + + + public void setTemplateId(String templateId) { + this.templateId = templateId; + } + + + public JourneyNode iamId(String iamId) { + + this.iamId = iamId; + return this; + } + + /** + * send_iam nodes: UUID of the in-app message to send. + * @return iamId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "send_iam nodes: UUID of the in-app message to send.") + + public String getIamId() { + return iamId; + } + + + public void setIamId(String iamId) { + this.iamId = iamId; + } + + + public JourneyNode userTtlSeconds(Integer userTtlSeconds) { + + this.userTtlSeconds = userTtlSeconds; + return this; + } + + /** + * send_iam nodes: optional time-to-live for the in-app message, in seconds. + * minimum: 1 + * @return userTtlSeconds + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "send_iam nodes: optional time-to-live for the in-app message, in seconds.") + + public Integer getUserTtlSeconds() { + return userTtlSeconds; + } + + + public void setUserTtlSeconds(Integer userTtlSeconds) { + this.userTtlSeconds = userTtlSeconds; + } + + + public JourneyNode webhookId(String webhookId) { + + this.webhookId = webhookId; + return this; + } + + /** + * send_webhook nodes: UUID of the webhook to send. + * @return webhookId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "send_webhook nodes: UUID of the webhook to send.") + + public String getWebhookId() { + return webhookId; + } + + + public void setWebhookId(String webhookId) { + this.webhookId = webhookId; + } + + + public JourneyNode assignments(Map assignments) { + + this.assignments = assignments; + return this; + } + + public JourneyNode putAssignmentsItem(String key, String assignmentsItem) { + if (this.assignments == null) { + this.assignments = new HashMap<>(); + } + this.assignments.put(key, assignmentsItem); + return this; + } + + /** + * tag nodes: tag key-value pairs to assign. An empty string value removes the tag. Keys are limited to 255 characters and values to 1024. + * @return assignments + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "tag nodes: tag key-value pairs to assign. An empty string value removes the tag. Keys are limited to 255 characters and values to 1024.") + + public Map getAssignments() { + return assignments; + } + + + public void setAssignments(Map assignments) { + this.assignments = assignments; + } + + + public JourneyNode randomizeOnEntry(Boolean randomizeOnEntry) { + + this.randomizeOnEntry = randomizeOnEntry; + return this; + } + + /** + * split_range nodes: when true, assigns each user to a branch at random on entry. Defaults to false. + * @return randomizeOnEntry + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "split_range nodes: when true, assigns each user to a branch at random on entry. Defaults to false.") + + public Boolean getRandomizeOnEntry() { + return randomizeOnEntry; + } + + + public void setRandomizeOnEntry(Boolean randomizeOnEntry) { + this.randomizeOnEntry = randomizeOnEntry; + } + + + public JourneyNode branches(List branches) { + + this.branches = branches; + return this; + } + + public JourneyNode addBranchesItem(JourneyBranch branchesItem) { + if (this.branches == null) { + this.branches = new ArrayList<>(); + } + this.branches.add(branchesItem); + return this; + } + + /** + * Branching nodes: nested branches. split_range requires 2-20 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-10 condition branches. + * @return branches + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Branching nodes: nested branches. split_range requires 2-20 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-10 condition branches.") + + public List getBranches() { + return branches; + } + + + public void setBranches(List branches) { + this.branches = branches; + } + + + public JourneyNode expiration(JourneyWaitUntilExpiration expiration) { + + this.expiration = expiration; + return this; + } + + /** + * Get expiration + * @return expiration + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneyWaitUntilExpiration getExpiration() { + return expiration; + } + + + public void setExpiration(JourneyWaitUntilExpiration expiration) { + this.expiration = expiration; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyNode journeyNode = (JourneyNode) o; + return Objects.equals(this.id, journeyNode.id) && + Objects.equals(this.kind, journeyNode.kind) && + Objects.equals(this.clientNodeId, journeyNode.clientNodeId) && + Objects.equals(this.annotation, journeyNode.annotation) && + Objects.equals(this.durationSeconds, journeyNode.durationSeconds) && + Objects.equals(this.relativeTo, journeyNode.relativeTo) && + Objects.equals(this.windows, journeyNode.windows) && + Objects.equals(this.timeZone, journeyNode.timeZone) && + Objects.equals(this.useUserTimeZone, journeyNode.useUserTimeZone) && + Objects.equals(this.templateId, journeyNode.templateId) && + Objects.equals(this.iamId, journeyNode.iamId) && + Objects.equals(this.userTtlSeconds, journeyNode.userTtlSeconds) && + Objects.equals(this.webhookId, journeyNode.webhookId) && + Objects.equals(this.assignments, journeyNode.assignments) && + Objects.equals(this.randomizeOnEntry, journeyNode.randomizeOnEntry) && + Objects.equals(this.branches, journeyNode.branches) && + Objects.equals(this.expiration, journeyNode.expiration); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, kind, clientNodeId, annotation, durationSeconds, relativeTo, windows, timeZone, useUserTimeZone, templateId, iamId, userTtlSeconds, webhookId, assignments, randomizeOnEntry, branches, expiration); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyNode {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" clientNodeId: ").append(toIndentedString(clientNodeId)).append("\n"); + sb.append(" annotation: ").append(toIndentedString(annotation)).append("\n"); + sb.append(" durationSeconds: ").append(toIndentedString(durationSeconds)).append("\n"); + sb.append(" relativeTo: ").append(toIndentedString(relativeTo)).append("\n"); + sb.append(" windows: ").append(toIndentedString(windows)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append(" useUserTimeZone: ").append(toIndentedString(useUserTimeZone)).append("\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append(" iamId: ").append(toIndentedString(iamId)).append("\n"); + sb.append(" userTtlSeconds: ").append(toIndentedString(userTtlSeconds)).append("\n"); + sb.append(" webhookId: ").append(toIndentedString(webhookId)).append("\n"); + sb.append(" assignments: ").append(toIndentedString(assignments)).append("\n"); + sb.append(" randomizeOnEntry: ").append(toIndentedString(randomizeOnEntry)).append("\n"); + sb.append(" branches: ").append(toIndentedString(branches)).append("\n"); + sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("kind"); + openapiFields.add("client_node_id"); + openapiFields.add("annotation"); + openapiFields.add("duration_seconds"); + openapiFields.add("relative_to"); + openapiFields.add("windows"); + openapiFields.add("time_zone"); + openapiFields.add("use_user_time_zone"); + openapiFields.add("template_id"); + openapiFields.add("iam_id"); + openapiFields.add("user_ttl_seconds"); + openapiFields.add("webhook_id"); + openapiFields.add("assignments"); + openapiFields.add("randomize_on_entry"); + openapiFields.add("branches"); + openapiFields.add("expiration"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("kind"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyNode.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyNode' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JourneyNode.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyNode value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyNode read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyNode given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyNode + * @throws IOException if the JSON string is invalid with respect to JourneyNode + */ + public static JourneyNode fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyNode.class); + } + + /** + * Convert an instance of JourneyNode to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/JourneyNodeStats.java b/src/main/java/com/onesignal/client/model/JourneyNodeStats.java new file mode 100644 index 0000000..ec7db95 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/JourneyNodeStats.java @@ -0,0 +1,371 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.onesignal.client.model.JourneyMessageStats; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * Stats for a single node. Keyed in the response by the node's server-assigned id. + */ +@ApiModel(description = "Stats for a single node. Keyed in the response by the node's server-assigned id.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JourneyNodeStats { + private static final long serialVersionUID = 1L; + + /** + * Node kind, repeated here so stats can be read without joining against the journey definition. + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + WAIT("wait"), + + TIME_WINDOW("time_window"), + + SEND_PUSH("send_push"), + + SEND_EMAIL("send_email"), + + SEND_SMS("send_sms"), + + SEND_IAM("send_iam"), + + SEND_WEBHOOK("send_webhook"), + + TAG("tag"), + + SPLIT_RANGE("split_range"), + + YES_NO("yes_no"), + + WAIT_UNTIL("wait_until"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + public static final String SERIALIZED_NAME_WAITING = "waiting"; + @SerializedName(SERIALIZED_NAME_WAITING) + private Integer waiting; + + public static final String SERIALIZED_NAME_COMPLETED = "completed"; + @SerializedName(SERIALIZED_NAME_COMPLETED) + private Integer completed; + + public static final String SERIALIZED_NAME_EXITED_EARLY = "exited_early"; + @SerializedName(SERIALIZED_NAME_EXITED_EARLY) + private Integer exitedEarly; + + public static final String SERIALIZED_NAME_MESSAGE_STATS = "message_stats"; + @SerializedName(SERIALIZED_NAME_MESSAGE_STATS) + private JourneyMessageStats messageStats; + + public JourneyNodeStats() { + } + + public JourneyNodeStats kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Node kind, repeated here so stats can be read without joining against the journey definition. + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Node kind, repeated here so stats can be read without joining against the journey definition.") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + public JourneyNodeStats waiting(Integer waiting) { + + this.waiting = waiting; + return this; + } + + /** + * Users currently held at this node. + * @return waiting + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Users currently held at this node.") + + public Integer getWaiting() { + return waiting; + } + + + public void setWaiting(Integer waiting) { + this.waiting = waiting; + } + + + public JourneyNodeStats completed(Integer completed) { + + this.completed = completed; + return this; + } + + /** + * Users who advanced past this node normally. + * @return completed + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Users who advanced past this node normally.") + + public Integer getCompleted() { + return completed; + } + + + public void setCompleted(Integer completed) { + this.completed = completed; + } + + + public JourneyNodeStats exitedEarly(Integer exitedEarly) { + + this.exitedEarly = exitedEarly; + return this; + } + + /** + * Users who left the journey from this node through an early exit rule. + * @return exitedEarly + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Users who left the journey from this node through an early exit rule.") + + public Integer getExitedEarly() { + return exitedEarly; + } + + + public void setExitedEarly(Integer exitedEarly) { + this.exitedEarly = exitedEarly; + } + + + public JourneyNodeStats messageStats(JourneyMessageStats messageStats) { + + this.messageStats = messageStats; + return this; + } + + /** + * Get messageStats + * @return messageStats + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneyMessageStats getMessageStats() { + return messageStats; + } + + + public void setMessageStats(JourneyMessageStats messageStats) { + this.messageStats = messageStats; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyNodeStats journeyNodeStats = (JourneyNodeStats) o; + return Objects.equals(this.kind, journeyNodeStats.kind) && + Objects.equals(this.waiting, journeyNodeStats.waiting) && + Objects.equals(this.completed, journeyNodeStats.completed) && + Objects.equals(this.exitedEarly, journeyNodeStats.exitedEarly) && + Objects.equals(this.messageStats, journeyNodeStats.messageStats); + } + + @Override + public int hashCode() { + return Objects.hash(kind, waiting, completed, exitedEarly, messageStats); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyNodeStats {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" waiting: ").append(toIndentedString(waiting)).append("\n"); + sb.append(" completed: ").append(toIndentedString(completed)).append("\n"); + sb.append(" exitedEarly: ").append(toIndentedString(exitedEarly)).append("\n"); + sb.append(" messageStats: ").append(toIndentedString(messageStats)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("kind"); + openapiFields.add("waiting"); + openapiFields.add("completed"); + openapiFields.add("exited_early"); + openapiFields.add("message_stats"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyNodeStats.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyNodeStats' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JourneyNodeStats.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyNodeStats value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyNodeStats read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyNodeStats given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyNodeStats + * @throws IOException if the JSON string is invalid with respect to JourneyNodeStats + */ + public static JourneyNodeStats fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyNodeStats.class); + } + + /** + * Convert an instance of JourneyNodeStats to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/JourneyReentryRules.java b/src/main/java/com/onesignal/client/model/JourneyReentryRules.java new file mode 100644 index 0000000..5faf12d --- /dev/null +++ b/src/main/java/com/onesignal/client/model/JourneyReentryRules.java @@ -0,0 +1,198 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * Controls whether and how soon a user can re-enter the journey. null means re-entry is not allowed. + */ +@ApiModel(description = "Controls whether and how soon a user can re-enter the journey. null means re-entry is not allowed.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JourneyReentryRules { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_DURATION_SECONDS = "duration_seconds"; + @SerializedName(SERIALIZED_NAME_DURATION_SECONDS) + private Integer durationSeconds; + + public JourneyReentryRules() { + } + + public JourneyReentryRules durationSeconds(Integer durationSeconds) { + + this.durationSeconds = durationSeconds; + return this; + } + + /** + * Minimum seconds before a user can re-enter. Must be at least 600 (10 minutes). + * minimum: 600 + * @return durationSeconds + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Minimum seconds before a user can re-enter. Must be at least 600 (10 minutes).") + + public Integer getDurationSeconds() { + return durationSeconds; + } + + + public void setDurationSeconds(Integer durationSeconds) { + this.durationSeconds = durationSeconds; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyReentryRules journeyReentryRules = (JourneyReentryRules) o; + return Objects.equals(this.durationSeconds, journeyReentryRules.durationSeconds); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(durationSeconds); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyReentryRules {\n"); + sb.append(" durationSeconds: ").append(toIndentedString(durationSeconds)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("duration_seconds"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyReentryRules.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyReentryRules' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JourneyReentryRules.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyReentryRules value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyReentryRules read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyReentryRules given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyReentryRules + * @throws IOException if the JSON string is invalid with respect to JourneyReentryRules + */ + public static JourneyReentryRules fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyReentryRules.class); + } + + /** + * Convert an instance of JourneyReentryRules to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/JourneySchedule.java b/src/main/java/com/onesignal/client/model/JourneySchedule.java new file mode 100644 index 0000000..8a9a5ef --- /dev/null +++ b/src/main/java/com/onesignal/client/model/JourneySchedule.java @@ -0,0 +1,257 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * Optional future start and/or stop time. null means no scheduled activation. + */ +@ApiModel(description = "Optional future start and/or stop time. null means no scheduled activation.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JourneySchedule { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_START_AT = "start_at"; + @SerializedName(SERIALIZED_NAME_START_AT) + private String startAt; + + public static final String SERIALIZED_NAME_STOP_AT = "stop_at"; + @SerializedName(SERIALIZED_NAME_STOP_AT) + private String stopAt; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + private String error; + + public JourneySchedule() { + } + + public JourneySchedule startAt(String startAt) { + + this.startAt = startAt; + return this; + } + + /** + * ISO 8601 start time. Use UTC (Z or +00:00). Must be at least 5 minutes in the future. + * @return startAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "ISO 8601 start time. Use UTC (Z or +00:00). Must be at least 5 minutes in the future.") + + public String getStartAt() { + return startAt; + } + + + public void setStartAt(String startAt) { + this.startAt = startAt; + } + + + public JourneySchedule stopAt(String stopAt) { + + this.stopAt = stopAt; + return this; + } + + /** + * ISO 8601 stop time. Use UTC (Z or +00:00). Must be in the future and later than start_at. + * @return stopAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "ISO 8601 stop time. Use UTC (Z or +00:00). Must be in the future and later than start_at.") + + public String getStopAt() { + return stopAt; + } + + + public void setStopAt(String stopAt) { + this.stopAt = stopAt; + } + + + public JourneySchedule error(String error) { + + this.error = error; + return this; + } + + /** + * Read-only. Present when a scheduling error occurred. + * @return error + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Read-only. Present when a scheduling error occurred.") + + public String getError() { + return error; + } + + + public void setError(String error) { + this.error = error; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneySchedule journeySchedule = (JourneySchedule) o; + return Objects.equals(this.startAt, journeySchedule.startAt) && + Objects.equals(this.stopAt, journeySchedule.stopAt) && + Objects.equals(this.error, journeySchedule.error); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(startAt, stopAt, error); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneySchedule {\n"); + sb.append(" startAt: ").append(toIndentedString(startAt)).append("\n"); + sb.append(" stopAt: ").append(toIndentedString(stopAt)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("start_at"); + openapiFields.add("stop_at"); + openapiFields.add("error"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneySchedule.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneySchedule' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JourneySchedule.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneySchedule value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneySchedule read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JourneySchedule given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneySchedule + * @throws IOException if the JSON string is invalid with respect to JourneySchedule + */ + public static JourneySchedule fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneySchedule.class); + } + + /** + * Convert an instance of JourneySchedule to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/JourneyStats.java b/src/main/java/com/onesignal/client/model/JourneyStats.java new file mode 100644 index 0000000..ae2359d --- /dev/null +++ b/src/main/java/com/onesignal/client/model/JourneyStats.java @@ -0,0 +1,356 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.onesignal.client.model.JourneyBranchStats; +import com.onesignal.client.model.JourneyNodeStats; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * Journey-level counts plus flat, id-keyed maps of node and branch stats. Contains no definition detail; join it by id against the journey from View journey. + */ +@ApiModel(description = "Journey-level counts plus flat, id-keyed maps of node and branch stats. Contains no definition detail; join it by id against the journey from View journey.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JourneyStats { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_STARTED = "started"; + @SerializedName(SERIALIZED_NAME_STARTED) + private Integer started; + + public static final String SERIALIZED_NAME_COMPLETED = "completed"; + @SerializedName(SERIALIZED_NAME_COMPLETED) + private Integer completed; + + public static final String SERIALIZED_NAME_EXITED_EARLY = "exited_early"; + @SerializedName(SERIALIZED_NAME_EXITED_EARLY) + private Integer exitedEarly; + + public static final String SERIALIZED_NAME_NODES = "nodes"; + @SerializedName(SERIALIZED_NAME_NODES) + private Map nodes = null; + + public static final String SERIALIZED_NAME_BRANCHES = "branches"; + @SerializedName(SERIALIZED_NAME_BRANCHES) + private Map branches = null; + + public JourneyStats() { + } + + public JourneyStats id(String id) { + + this.id = id; + return this; + } + + /** + * UUID of the journey these stats belong to. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "UUID of the journey these stats belong to.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public JourneyStats started(Integer started) { + + this.started = started; + return this; + } + + /** + * Users who entered the journey. + * @return started + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Users who entered the journey.") + + public Integer getStarted() { + return started; + } + + + public void setStarted(Integer started) { + this.started = started; + } + + + public JourneyStats completed(Integer completed) { + + this.completed = completed; + return this; + } + + /** + * Users who reached the end of the journey normally. + * @return completed + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Users who reached the end of the journey normally.") + + public Integer getCompleted() { + return completed; + } + + + public void setCompleted(Integer completed) { + this.completed = completed; + } + + + public JourneyStats exitedEarly(Integer exitedEarly) { + + this.exitedEarly = exitedEarly; + return this; + } + + /** + * Users who left the journey through an early exit rule. + * @return exitedEarly + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Users who left the journey through an early exit rule.") + + public Integer getExitedEarly() { + return exitedEarly; + } + + + public void setExitedEarly(Integer exitedEarly) { + this.exitedEarly = exitedEarly; + } + + + public JourneyStats nodes(Map nodes) { + + this.nodes = nodes; + return this; + } + + public JourneyStats putNodesItem(String key, JourneyNodeStats nodesItem) { + if (this.nodes == null) { + this.nodes = new HashMap<>(); + } + this.nodes.put(key, nodesItem); + return this; + } + + /** + * Node stats keyed by node id. Includes every node in the graph, at any nesting depth. + * @return nodes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Node stats keyed by node id. Includes every node in the graph, at any nesting depth.") + + public Map getNodes() { + return nodes; + } + + + public void setNodes(Map nodes) { + this.nodes = nodes; + } + + + public JourneyStats branches(Map branches) { + + this.branches = branches; + return this; + } + + public JourneyStats putBranchesItem(String key, JourneyBranchStats branchesItem) { + if (this.branches == null) { + this.branches = new HashMap<>(); + } + this.branches.put(key, branchesItem); + return this; + } + + /** + * Branch stats keyed by branch id. Empty for a journey with no branching nodes. + * @return branches + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Branch stats keyed by branch id. Empty for a journey with no branching nodes.") + + public Map getBranches() { + return branches; + } + + + public void setBranches(Map branches) { + this.branches = branches; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyStats journeyStats = (JourneyStats) o; + return Objects.equals(this.id, journeyStats.id) && + Objects.equals(this.started, journeyStats.started) && + Objects.equals(this.completed, journeyStats.completed) && + Objects.equals(this.exitedEarly, journeyStats.exitedEarly) && + Objects.equals(this.nodes, journeyStats.nodes) && + Objects.equals(this.branches, journeyStats.branches); + } + + @Override + public int hashCode() { + return Objects.hash(id, started, completed, exitedEarly, nodes, branches); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyStats {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" started: ").append(toIndentedString(started)).append("\n"); + sb.append(" completed: ").append(toIndentedString(completed)).append("\n"); + sb.append(" exitedEarly: ").append(toIndentedString(exitedEarly)).append("\n"); + sb.append(" nodes: ").append(toIndentedString(nodes)).append("\n"); + sb.append(" branches: ").append(toIndentedString(branches)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("started"); + openapiFields.add("completed"); + openapiFields.add("exited_early"); + openapiFields.add("nodes"); + openapiFields.add("branches"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyStats.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyStats' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JourneyStats.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyStats value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyStats read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyStats given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyStats + * @throws IOException if the JSON string is invalid with respect to JourneyStats + */ + public static JourneyStats fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyStats.class); + } + + /** + * Convert an instance of JourneyStats to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/JourneyTimePoint.java b/src/main/java/com/onesignal/client/model/JourneyTimePoint.java new file mode 100644 index 0000000..a7db98b --- /dev/null +++ b/src/main/java/com/onesignal/client/model/JourneyTimePoint.java @@ -0,0 +1,218 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * JourneyTimePoint + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JourneyTimePoint { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_HOUR = "hour"; + @SerializedName(SERIALIZED_NAME_HOUR) + private Integer hour; + + public static final String SERIALIZED_NAME_MINUTE = "minute"; + @SerializedName(SERIALIZED_NAME_MINUTE) + private Integer minute; + + public JourneyTimePoint() { + } + + public JourneyTimePoint hour(Integer hour) { + + this.hour = hour; + return this; + } + + /** + * Hour of day, 0-23. + * minimum: 0 + * maximum: 23 + * @return hour + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Hour of day, 0-23.") + + public Integer getHour() { + return hour; + } + + + public void setHour(Integer hour) { + this.hour = hour; + } + + + public JourneyTimePoint minute(Integer minute) { + + this.minute = minute; + return this; + } + + /** + * Minute of hour, 0-59. Defaults to 0. + * minimum: 0 + * maximum: 59 + * @return minute + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Minute of hour, 0-59. Defaults to 0.") + + public Integer getMinute() { + return minute; + } + + + public void setMinute(Integer minute) { + this.minute = minute; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyTimePoint journeyTimePoint = (JourneyTimePoint) o; + return Objects.equals(this.hour, journeyTimePoint.hour) && + Objects.equals(this.minute, journeyTimePoint.minute); + } + + @Override + public int hashCode() { + return Objects.hash(hour, minute); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyTimePoint {\n"); + sb.append(" hour: ").append(toIndentedString(hour)).append("\n"); + sb.append(" minute: ").append(toIndentedString(minute)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("hour"); + openapiFields.add("minute"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyTimePoint.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyTimePoint' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JourneyTimePoint.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyTimePoint value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyTimePoint read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyTimePoint given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyTimePoint + * @throws IOException if the JSON string is invalid with respect to JourneyTimePoint + */ + public static JourneyTimePoint fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyTimePoint.class); + } + + /** + * Convert an instance of JourneyTimePoint to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/JourneyTimeWindow.java b/src/main/java/com/onesignal/client/model/JourneyTimeWindow.java new file mode 100644 index 0000000..41eb3e6 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/JourneyTimeWindow.java @@ -0,0 +1,260 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.onesignal.client.model.JourneyTimePoint; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * A wall-clock window. Each window must span at least 15 minutes. + */ +@ApiModel(description = "A wall-clock window. Each window must span at least 15 minutes.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JourneyTimeWindow { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_START = "start"; + @SerializedName(SERIALIZED_NAME_START) + private JourneyTimePoint start; + + public static final String SERIALIZED_NAME_END = "end"; + @SerializedName(SERIALIZED_NAME_END) + private JourneyTimePoint end; + + public static final String SERIALIZED_NAME_DAY_OF_WEEK = "day_of_week"; + @SerializedName(SERIALIZED_NAME_DAY_OF_WEEK) + private Integer dayOfWeek; + + public JourneyTimeWindow() { + } + + public JourneyTimeWindow start(JourneyTimePoint start) { + + this.start = start; + return this; + } + + /** + * When the window opens. + * @return start + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "When the window opens.") + + public JourneyTimePoint getStart() { + return start; + } + + + public void setStart(JourneyTimePoint start) { + this.start = start; + } + + + public JourneyTimeWindow end(JourneyTimePoint end) { + + this.end = end; + return this; + } + + /** + * When the window closes. + * @return end + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "When the window closes.") + + public JourneyTimePoint getEnd() { + return end; + } + + + public void setEnd(JourneyTimePoint end) { + this.end = end; + } + + + public JourneyTimeWindow dayOfWeek(Integer dayOfWeek) { + + this.dayOfWeek = dayOfWeek; + return this; + } + + /** + * Day of week, 1 = Monday. Omit to apply the window to every day. + * minimum: 1 + * maximum: 7 + * @return dayOfWeek + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Day of week, 1 = Monday. Omit to apply the window to every day.") + + public Integer getDayOfWeek() { + return dayOfWeek; + } + + + public void setDayOfWeek(Integer dayOfWeek) { + this.dayOfWeek = dayOfWeek; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyTimeWindow journeyTimeWindow = (JourneyTimeWindow) o; + return Objects.equals(this.start, journeyTimeWindow.start) && + Objects.equals(this.end, journeyTimeWindow.end) && + Objects.equals(this.dayOfWeek, journeyTimeWindow.dayOfWeek); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(start, end, dayOfWeek); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyTimeWindow {\n"); + sb.append(" start: ").append(toIndentedString(start)).append("\n"); + sb.append(" end: ").append(toIndentedString(end)).append("\n"); + sb.append(" dayOfWeek: ").append(toIndentedString(dayOfWeek)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("start"); + openapiFields.add("end"); + openapiFields.add("day_of_week"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyTimeWindow.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyTimeWindow' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JourneyTimeWindow.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyTimeWindow value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyTimeWindow read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyTimeWindow given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyTimeWindow + * @throws IOException if the JSON string is invalid with respect to JourneyTimeWindow + */ + public static JourneyTimeWindow fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyTimeWindow.class); + } + + /** + * Convert an instance of JourneyTimeWindow to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/JourneyWaitUntilExpiration.java b/src/main/java/com/onesignal/client/model/JourneyWaitUntilExpiration.java new file mode 100644 index 0000000..98dad9e --- /dev/null +++ b/src/main/java/com/onesignal/client/model/JourneyWaitUntilExpiration.java @@ -0,0 +1,229 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * Optional expiration timer. null waits indefinitely. + */ +@ApiModel(description = "Optional expiration timer. null waits indefinitely.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JourneyWaitUntilExpiration { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_DURATION_SECONDS = "duration_seconds"; + @SerializedName(SERIALIZED_NAME_DURATION_SECONDS) + private Integer durationSeconds; + + public static final String SERIALIZED_NAME_EXITS = "exits"; + @SerializedName(SERIALIZED_NAME_EXITS) + private Boolean exits; + + public JourneyWaitUntilExpiration() { + } + + public JourneyWaitUntilExpiration durationSeconds(Integer durationSeconds) { + + this.durationSeconds = durationSeconds; + return this; + } + + /** + * Seconds to wait before the timer fires. Minimum 60, maximum 31556952 (1 year). + * minimum: 60 + * maximum: 31556952 + * @return durationSeconds + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Seconds to wait before the timer fires. Minimum 60, maximum 31556952 (1 year).") + + public Integer getDurationSeconds() { + return durationSeconds; + } + + + public void setDurationSeconds(Integer durationSeconds) { + this.durationSeconds = durationSeconds; + } + + + public JourneyWaitUntilExpiration exits(Boolean exits) { + + this.exits = exits; + return this; + } + + /** + * When true, the user exits the journey when the timer fires; when false, the user continues to convergence. + * @return exits + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "When true, the user exits the journey when the timer fires; when false, the user continues to convergence.") + + public Boolean getExits() { + return exits; + } + + + public void setExits(Boolean exits) { + this.exits = exits; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyWaitUntilExpiration journeyWaitUntilExpiration = (JourneyWaitUntilExpiration) o; + return Objects.equals(this.durationSeconds, journeyWaitUntilExpiration.durationSeconds) && + Objects.equals(this.exits, journeyWaitUntilExpiration.exits); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(durationSeconds, exits); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyWaitUntilExpiration {\n"); + sb.append(" durationSeconds: ").append(toIndentedString(durationSeconds)).append("\n"); + sb.append(" exits: ").append(toIndentedString(exits)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("duration_seconds"); + openapiFields.add("exits"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyWaitUntilExpiration.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyWaitUntilExpiration' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JourneyWaitUntilExpiration.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyWaitUntilExpiration value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyWaitUntilExpiration read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyWaitUntilExpiration given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyWaitUntilExpiration + * @throws IOException if the JSON string is invalid with respect to JourneyWaitUntilExpiration + */ + public static JourneyWaitUntilExpiration fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyWaitUntilExpiration.class); + } + + /** + * Convert an instance of JourneyWaitUntilExpiration to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/UpdateJourneyNodeRequest.java b/src/main/java/com/onesignal/client/model/UpdateJourneyNodeRequest.java new file mode 100644 index 0000000..dc50c56 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/UpdateJourneyNodeRequest.java @@ -0,0 +1,728 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.onesignal.client.model.JourneyBranch; +import com.onesignal.client.model.JourneyTimeWindow; +import com.onesignal.client.model.JourneyWaitUntilExpiration; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * Node fields to change, merged onto the current node. Send only the fields you want to change. The node's kind and id cannot be changed. Send null to clear a nullable field. Which other fields apply depends on the node's kind, matching JourneyNode. + */ +@ApiModel(description = "Node fields to change, merged onto the current node. Send only the fields you want to change. The node's kind and id cannot be changed. Send null to clear a nullable field. Which other fields apply depends on the node's kind, matching JourneyNode.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateJourneyNodeRequest { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_CLIENT_NODE_ID = "client_node_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_NODE_ID) + private String clientNodeId; + + public static final String SERIALIZED_NAME_ANNOTATION = "annotation"; + @SerializedName(SERIALIZED_NAME_ANNOTATION) + private String annotation; + + public static final String SERIALIZED_NAME_DURATION_SECONDS = "duration_seconds"; + @SerializedName(SERIALIZED_NAME_DURATION_SECONDS) + private Integer durationSeconds; + + /** + * time_window nodes: schedule_in_timezone uses the configured windows; last_active_time holds relative to the user's last active time. + */ + @JsonAdapter(RelativeToEnum.Adapter.class) + public enum RelativeToEnum { + SCHEDULE_IN_TIMEZONE("schedule_in_timezone"), + + LAST_ACTIVE_TIME("last_active_time"); + + private String value; + + RelativeToEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RelativeToEnum fromValue(String value) { + for (RelativeToEnum b : RelativeToEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RelativeToEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RelativeToEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RelativeToEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_RELATIVE_TO = "relative_to"; + @SerializedName(SERIALIZED_NAME_RELATIVE_TO) + private RelativeToEnum relativeTo; + + public static final String SERIALIZED_NAME_WINDOWS = "windows"; + @SerializedName(SERIALIZED_NAME_WINDOWS) + private List windows = null; + + public static final String SERIALIZED_NAME_TIME_ZONE = "time_zone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + private String timeZone; + + public static final String SERIALIZED_NAME_USE_USER_TIME_ZONE = "use_user_time_zone"; + @SerializedName(SERIALIZED_NAME_USE_USER_TIME_ZONE) + private Boolean useUserTimeZone; + + public static final String SERIALIZED_NAME_TEMPLATE_ID = "template_id"; + @SerializedName(SERIALIZED_NAME_TEMPLATE_ID) + private String templateId; + + public static final String SERIALIZED_NAME_IAM_ID = "iam_id"; + @SerializedName(SERIALIZED_NAME_IAM_ID) + private String iamId; + + public static final String SERIALIZED_NAME_USER_TTL_SECONDS = "user_ttl_seconds"; + @SerializedName(SERIALIZED_NAME_USER_TTL_SECONDS) + private Integer userTtlSeconds; + + public static final String SERIALIZED_NAME_WEBHOOK_ID = "webhook_id"; + @SerializedName(SERIALIZED_NAME_WEBHOOK_ID) + private String webhookId; + + public static final String SERIALIZED_NAME_ASSIGNMENTS = "assignments"; + @SerializedName(SERIALIZED_NAME_ASSIGNMENTS) + private Map assignments = null; + + public static final String SERIALIZED_NAME_RANDOMIZE_ON_ENTRY = "randomize_on_entry"; + @SerializedName(SERIALIZED_NAME_RANDOMIZE_ON_ENTRY) + private Boolean randomizeOnEntry; + + public static final String SERIALIZED_NAME_BRANCHES = "branches"; + @SerializedName(SERIALIZED_NAME_BRANCHES) + private List branches = null; + + public static final String SERIALIZED_NAME_EXPIRATION = "expiration"; + @SerializedName(SERIALIZED_NAME_EXPIRATION) + private JourneyWaitUntilExpiration expiration; + + public static final String SERIALIZED_NAME_CONCURRENCY_KEY = "concurrency_key"; + @SerializedName(SERIALIZED_NAME_CONCURRENCY_KEY) + private String concurrencyKey; + + public UpdateJourneyNodeRequest() { + } + + public UpdateJourneyNodeRequest clientNodeId(String clientNodeId) { + + this.clientNodeId = clientNodeId; + return this; + } + + /** + * Optional client-assigned identifier, unique within the journey. Use it to reference this node from elsewhere in the same request. Persisted and returned on reads. + * @return clientNodeId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional client-assigned identifier, unique within the journey. Use it to reference this node from elsewhere in the same request. Persisted and returned on reads.") + + public String getClientNodeId() { + return clientNodeId; + } + + + public void setClientNodeId(String clientNodeId) { + this.clientNodeId = clientNodeId; + } + + + public UpdateJourneyNodeRequest annotation(String annotation) { + + this.annotation = annotation; + return this; + } + + /** + * Optional free-text label, up to 255 characters. Stored and returned as-is with no effect on journey behavior. + * @return annotation + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional free-text label, up to 255 characters. Stored and returned as-is with no effect on journey behavior.") + + public String getAnnotation() { + return annotation; + } + + + public void setAnnotation(String annotation) { + this.annotation = annotation; + } + + + public UpdateJourneyNodeRequest durationSeconds(Integer durationSeconds) { + + this.durationSeconds = durationSeconds; + return this; + } + + /** + * wait nodes: seconds to hold the user. Minimum 60, maximum 31556952 (1 year). + * minimum: 60 + * maximum: 31556952 + * @return durationSeconds + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "wait nodes: seconds to hold the user. Minimum 60, maximum 31556952 (1 year).") + + public Integer getDurationSeconds() { + return durationSeconds; + } + + + public void setDurationSeconds(Integer durationSeconds) { + this.durationSeconds = durationSeconds; + } + + + public UpdateJourneyNodeRequest relativeTo(RelativeToEnum relativeTo) { + + this.relativeTo = relativeTo; + return this; + } + + /** + * time_window nodes: schedule_in_timezone uses the configured windows; last_active_time holds relative to the user's last active time. + * @return relativeTo + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "time_window nodes: schedule_in_timezone uses the configured windows; last_active_time holds relative to the user's last active time.") + + public RelativeToEnum getRelativeTo() { + return relativeTo; + } + + + public void setRelativeTo(RelativeToEnum relativeTo) { + this.relativeTo = relativeTo; + } + + + public UpdateJourneyNodeRequest windows(List windows) { + + this.windows = windows; + return this; + } + + public UpdateJourneyNodeRequest addWindowsItem(JourneyTimeWindow windowsItem) { + if (this.windows == null) { + this.windows = new ArrayList<>(); + } + this.windows.add(windowsItem); + return this; + } + + /** + * time_window nodes: one or more time windows. A window with no day_of_week applies to every day. Required when relative_to is schedule_in_timezone; omit when it is last_active_time. + * @return windows + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "time_window nodes: one or more time windows. A window with no day_of_week applies to every day. Required when relative_to is schedule_in_timezone; omit when it is last_active_time.") + + public List getWindows() { + return windows; + } + + + public void setWindows(List windows) { + this.windows = windows; + } + + + public UpdateJourneyNodeRequest timeZone(String timeZone) { + + this.timeZone = timeZone; + return this; + } + + /** + * time_window nodes: IANA timezone identifier used when the user's timezone is unavailable. + * @return timeZone + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "time_window nodes: IANA timezone identifier used when the user's timezone is unavailable.") + + public String getTimeZone() { + return timeZone; + } + + + public void setTimeZone(String timeZone) { + this.timeZone = timeZone; + } + + + public UpdateJourneyNodeRequest useUserTimeZone(Boolean useUserTimeZone) { + + this.useUserTimeZone = useUserTimeZone; + return this; + } + + /** + * time_window nodes: when true, uses the user's timezone if available. + * @return useUserTimeZone + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "time_window nodes: when true, uses the user's timezone if available.") + + public Boolean getUseUserTimeZone() { + return useUserTimeZone; + } + + + public void setUseUserTimeZone(Boolean useUserTimeZone) { + this.useUserTimeZone = useUserTimeZone; + } + + + public UpdateJourneyNodeRequest templateId(String templateId) { + + this.templateId = templateId; + return this; + } + + /** + * send_push, send_email, and send_sms nodes: UUID of the template to send. + * @return templateId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "send_push, send_email, and send_sms nodes: UUID of the template to send.") + + public String getTemplateId() { + return templateId; + } + + + public void setTemplateId(String templateId) { + this.templateId = templateId; + } + + + public UpdateJourneyNodeRequest iamId(String iamId) { + + this.iamId = iamId; + return this; + } + + /** + * send_iam nodes: UUID of the in-app message to send. + * @return iamId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "send_iam nodes: UUID of the in-app message to send.") + + public String getIamId() { + return iamId; + } + + + public void setIamId(String iamId) { + this.iamId = iamId; + } + + + public UpdateJourneyNodeRequest userTtlSeconds(Integer userTtlSeconds) { + + this.userTtlSeconds = userTtlSeconds; + return this; + } + + /** + * send_iam nodes: optional time-to-live for the in-app message, in seconds. + * minimum: 1 + * @return userTtlSeconds + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "send_iam nodes: optional time-to-live for the in-app message, in seconds.") + + public Integer getUserTtlSeconds() { + return userTtlSeconds; + } + + + public void setUserTtlSeconds(Integer userTtlSeconds) { + this.userTtlSeconds = userTtlSeconds; + } + + + public UpdateJourneyNodeRequest webhookId(String webhookId) { + + this.webhookId = webhookId; + return this; + } + + /** + * send_webhook nodes: UUID of the webhook to send. + * @return webhookId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "send_webhook nodes: UUID of the webhook to send.") + + public String getWebhookId() { + return webhookId; + } + + + public void setWebhookId(String webhookId) { + this.webhookId = webhookId; + } + + + public UpdateJourneyNodeRequest assignments(Map assignments) { + + this.assignments = assignments; + return this; + } + + public UpdateJourneyNodeRequest putAssignmentsItem(String key, String assignmentsItem) { + if (this.assignments == null) { + this.assignments = new HashMap<>(); + } + this.assignments.put(key, assignmentsItem); + return this; + } + + /** + * tag nodes: tag key-value pairs to assign. An empty string value removes the tag. Keys are limited to 255 characters and values to 1024. + * @return assignments + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "tag nodes: tag key-value pairs to assign. An empty string value removes the tag. Keys are limited to 255 characters and values to 1024.") + + public Map getAssignments() { + return assignments; + } + + + public void setAssignments(Map assignments) { + this.assignments = assignments; + } + + + public UpdateJourneyNodeRequest randomizeOnEntry(Boolean randomizeOnEntry) { + + this.randomizeOnEntry = randomizeOnEntry; + return this; + } + + /** + * split_range nodes: when true, assigns each user to a branch at random on entry. Defaults to false. + * @return randomizeOnEntry + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "split_range nodes: when true, assigns each user to a branch at random on entry. Defaults to false.") + + public Boolean getRandomizeOnEntry() { + return randomizeOnEntry; + } + + + public void setRandomizeOnEntry(Boolean randomizeOnEntry) { + this.randomizeOnEntry = randomizeOnEntry; + } + + + public UpdateJourneyNodeRequest branches(List branches) { + + this.branches = branches; + return this; + } + + public UpdateJourneyNodeRequest addBranchesItem(JourneyBranch branchesItem) { + if (this.branches == null) { + this.branches = new ArrayList<>(); + } + this.branches.add(branchesItem); + return this; + } + + /** + * Branching nodes: nested branches. split_range requires 2-20 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-10 condition branches. + * @return branches + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Branching nodes: nested branches. split_range requires 2-20 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-10 condition branches.") + + public List getBranches() { + return branches; + } + + + public void setBranches(List branches) { + this.branches = branches; + } + + + public UpdateJourneyNodeRequest expiration(JourneyWaitUntilExpiration expiration) { + + this.expiration = expiration; + return this; + } + + /** + * Get expiration + * @return expiration + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneyWaitUntilExpiration getExpiration() { + return expiration; + } + + + public void setExpiration(JourneyWaitUntilExpiration expiration) { + this.expiration = expiration; + } + + + public UpdateJourneyNodeRequest concurrencyKey(String concurrencyKey) { + + this.concurrencyKey = concurrencyKey; + return this; + } + + /** + * Optional optimistic-concurrency token. Pass the concurrency_key from a prior fetch to reject the update with 409 if the journey changed. Omit to skip the check. It is not merged onto the node. + * @return concurrencyKey + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional optimistic-concurrency token. Pass the concurrency_key from a prior fetch to reject the update with 409 if the journey changed. Omit to skip the check. It is not merged onto the node.") + + public String getConcurrencyKey() { + return concurrencyKey; + } + + + public void setConcurrencyKey(String concurrencyKey) { + this.concurrencyKey = concurrencyKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateJourneyNodeRequest updateJourneyNodeRequest = (UpdateJourneyNodeRequest) o; + return Objects.equals(this.clientNodeId, updateJourneyNodeRequest.clientNodeId) && + Objects.equals(this.annotation, updateJourneyNodeRequest.annotation) && + Objects.equals(this.durationSeconds, updateJourneyNodeRequest.durationSeconds) && + Objects.equals(this.relativeTo, updateJourneyNodeRequest.relativeTo) && + Objects.equals(this.windows, updateJourneyNodeRequest.windows) && + Objects.equals(this.timeZone, updateJourneyNodeRequest.timeZone) && + Objects.equals(this.useUserTimeZone, updateJourneyNodeRequest.useUserTimeZone) && + Objects.equals(this.templateId, updateJourneyNodeRequest.templateId) && + Objects.equals(this.iamId, updateJourneyNodeRequest.iamId) && + Objects.equals(this.userTtlSeconds, updateJourneyNodeRequest.userTtlSeconds) && + Objects.equals(this.webhookId, updateJourneyNodeRequest.webhookId) && + Objects.equals(this.assignments, updateJourneyNodeRequest.assignments) && + Objects.equals(this.randomizeOnEntry, updateJourneyNodeRequest.randomizeOnEntry) && + Objects.equals(this.branches, updateJourneyNodeRequest.branches) && + Objects.equals(this.expiration, updateJourneyNodeRequest.expiration) && + Objects.equals(this.concurrencyKey, updateJourneyNodeRequest.concurrencyKey); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(clientNodeId, annotation, durationSeconds, relativeTo, windows, timeZone, useUserTimeZone, templateId, iamId, userTtlSeconds, webhookId, assignments, randomizeOnEntry, branches, expiration, concurrencyKey); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateJourneyNodeRequest {\n"); + sb.append(" clientNodeId: ").append(toIndentedString(clientNodeId)).append("\n"); + sb.append(" annotation: ").append(toIndentedString(annotation)).append("\n"); + sb.append(" durationSeconds: ").append(toIndentedString(durationSeconds)).append("\n"); + sb.append(" relativeTo: ").append(toIndentedString(relativeTo)).append("\n"); + sb.append(" windows: ").append(toIndentedString(windows)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append(" useUserTimeZone: ").append(toIndentedString(useUserTimeZone)).append("\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append(" iamId: ").append(toIndentedString(iamId)).append("\n"); + sb.append(" userTtlSeconds: ").append(toIndentedString(userTtlSeconds)).append("\n"); + sb.append(" webhookId: ").append(toIndentedString(webhookId)).append("\n"); + sb.append(" assignments: ").append(toIndentedString(assignments)).append("\n"); + sb.append(" randomizeOnEntry: ").append(toIndentedString(randomizeOnEntry)).append("\n"); + sb.append(" branches: ").append(toIndentedString(branches)).append("\n"); + sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n"); + sb.append(" concurrencyKey: ").append(toIndentedString(concurrencyKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("client_node_id"); + openapiFields.add("annotation"); + openapiFields.add("duration_seconds"); + openapiFields.add("relative_to"); + openapiFields.add("windows"); + openapiFields.add("time_zone"); + openapiFields.add("use_user_time_zone"); + openapiFields.add("template_id"); + openapiFields.add("iam_id"); + openapiFields.add("user_ttl_seconds"); + openapiFields.add("webhook_id"); + openapiFields.add("assignments"); + openapiFields.add("randomize_on_entry"); + openapiFields.add("branches"); + openapiFields.add("expiration"); + openapiFields.add("concurrency_key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateJourneyNodeRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateJourneyNodeRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateJourneyNodeRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateJourneyNodeRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateJourneyNodeRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateJourneyNodeRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateJourneyNodeRequest + * @throws IOException if the JSON string is invalid with respect to UpdateJourneyNodeRequest + */ + public static UpdateJourneyNodeRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateJourneyNodeRequest.class); + } + + /** + * Convert an instance of UpdateJourneyNodeRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/UpdateJourneyRequest.java b/src/main/java/com/onesignal/client/model/UpdateJourneyRequest.java new file mode 100644 index 0000000..c3fb610 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/UpdateJourneyRequest.java @@ -0,0 +1,503 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.onesignal.client.model.JourneyAudience; +import com.onesignal.client.model.JourneyEarlyExit; +import com.onesignal.client.model.JourneyNode; +import com.onesignal.client.model.JourneyReentryRules; +import com.onesignal.client.model.JourneySchedule; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * Partial update applied with JSON Merge Patch (RFC 7396). Send only the fields you want to change. A null value clears a nullable field. Arrays such as nodes are replaced wholesale. + */ +@ApiModel(description = "Partial update applied with JSON Merge Patch (RFC 7396). Send only the fields you want to change. A null value clears a nullable field. Arrays such as nodes are replaced wholesale.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateJourneyRequest { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_AUDIENCE = "audience"; + @SerializedName(SERIALIZED_NAME_AUDIENCE) + private JourneyAudience audience; + + public static final String SERIALIZED_NAME_EARLY_EXIT = "early_exit"; + @SerializedName(SERIALIZED_NAME_EARLY_EXIT) + private JourneyEarlyExit earlyExit; + + public static final String SERIALIZED_NAME_REENTRY_RULES = "reentry_rules"; + @SerializedName(SERIALIZED_NAME_REENTRY_RULES) + private JourneyReentryRules reentryRules; + + public static final String SERIALIZED_NAME_SCHEDULE = "schedule"; + @SerializedName(SERIALIZED_NAME_SCHEDULE) + private JourneySchedule schedule; + + public static final String SERIALIZED_NAME_NODES = "nodes"; + @SerializedName(SERIALIZED_NAME_NODES) + private List nodes = null; + + /** + * Target state. Set active to activate a draft journey, or scheduled together with a future schedule.start_at to activate it later. Set archived to stop a running journey; archiving is permanent. Only scheduled and processing journeys can return to draft. + */ + @JsonAdapter(StateEnum.Adapter.class) + public enum StateEnum { + DRAFT("draft"), + + SCHEDULED("scheduled"), + + ACTIVE("active"), + + ARCHIVED("archived"); + + private String value; + + StateEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StateEnum fromValue(String value) { + for (StateEnum b : StateEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StateEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StateEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StateEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private StateEnum state; + + public static final String SERIALIZED_NAME_CONCURRENCY_KEY = "concurrency_key"; + @SerializedName(SERIALIZED_NAME_CONCURRENCY_KEY) + private String concurrencyKey; + + public UpdateJourneyRequest() { + } + + public UpdateJourneyRequest name(String name) { + + this.name = name; + return this; + } + + /** + * Journey name. + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Journey name.") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public UpdateJourneyRequest description(String description) { + + this.description = description; + return this; + } + + /** + * Journey description. Send null to clear it. + * @return description + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Journey description. Send null to clear it.") + + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public UpdateJourneyRequest audience(JourneyAudience audience) { + + this.audience = audience; + return this; + } + + /** + * Get audience + * @return audience + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneyAudience getAudience() { + return audience; + } + + + public void setAudience(JourneyAudience audience) { + this.audience = audience; + } + + + public UpdateJourneyRequest earlyExit(JourneyEarlyExit earlyExit) { + + this.earlyExit = earlyExit; + return this; + } + + /** + * Get earlyExit + * @return earlyExit + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneyEarlyExit getEarlyExit() { + return earlyExit; + } + + + public void setEarlyExit(JourneyEarlyExit earlyExit) { + this.earlyExit = earlyExit; + } + + + public UpdateJourneyRequest reentryRules(JourneyReentryRules reentryRules) { + + this.reentryRules = reentryRules; + return this; + } + + /** + * Get reentryRules + * @return reentryRules + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneyReentryRules getReentryRules() { + return reentryRules; + } + + + public void setReentryRules(JourneyReentryRules reentryRules) { + this.reentryRules = reentryRules; + } + + + public UpdateJourneyRequest schedule(JourneySchedule schedule) { + + this.schedule = schedule; + return this; + } + + /** + * Get schedule + * @return schedule + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JourneySchedule getSchedule() { + return schedule; + } + + + public void setSchedule(JourneySchedule schedule) { + this.schedule = schedule; + } + + + public UpdateJourneyRequest nodes(List nodes) { + + this.nodes = nodes; + return this; + } + + public UpdateJourneyRequest addNodesItem(JourneyNode nodesItem) { + if (this.nodes == null) { + this.nodes = new ArrayList<>(); + } + this.nodes.add(nodesItem); + return this; + } + + /** + * Full ordered list of nodes, which replaces the existing graph wholesale. Preserve each node's server-assigned id from a prior fetch to keep in-flight users on that node; omit id to add a new node. + * @return nodes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Full ordered list of nodes, which replaces the existing graph wholesale. Preserve each node's server-assigned id from a prior fetch to keep in-flight users on that node; omit id to add a new node.") + + public List getNodes() { + return nodes; + } + + + public void setNodes(List nodes) { + this.nodes = nodes; + } + + + public UpdateJourneyRequest state(StateEnum state) { + + this.state = state; + return this; + } + + /** + * Target state. Set active to activate a draft journey, or scheduled together with a future schedule.start_at to activate it later. Set archived to stop a running journey; archiving is permanent. Only scheduled and processing journeys can return to draft. + * @return state + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Target state. Set active to activate a draft journey, or scheduled together with a future schedule.start_at to activate it later. Set archived to stop a running journey; archiving is permanent. Only scheduled and processing journeys can return to draft.") + + public StateEnum getState() { + return state; + } + + + public void setState(StateEnum state) { + this.state = state; + } + + + public UpdateJourneyRequest concurrencyKey(String concurrencyKey) { + + this.concurrencyKey = concurrencyKey; + return this; + } + + /** + * Optional optimistic-concurrency token. Pass the concurrency_key from a prior fetch to reject the update with 409 if the journey changed. Omit to skip the check. + * @return concurrencyKey + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional optimistic-concurrency token. Pass the concurrency_key from a prior fetch to reject the update with 409 if the journey changed. Omit to skip the check.") + + public String getConcurrencyKey() { + return concurrencyKey; + } + + + public void setConcurrencyKey(String concurrencyKey) { + this.concurrencyKey = concurrencyKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateJourneyRequest updateJourneyRequest = (UpdateJourneyRequest) o; + return Objects.equals(this.name, updateJourneyRequest.name) && + Objects.equals(this.description, updateJourneyRequest.description) && + Objects.equals(this.audience, updateJourneyRequest.audience) && + Objects.equals(this.earlyExit, updateJourneyRequest.earlyExit) && + Objects.equals(this.reentryRules, updateJourneyRequest.reentryRules) && + Objects.equals(this.schedule, updateJourneyRequest.schedule) && + Objects.equals(this.nodes, updateJourneyRequest.nodes) && + Objects.equals(this.state, updateJourneyRequest.state) && + Objects.equals(this.concurrencyKey, updateJourneyRequest.concurrencyKey); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, audience, earlyExit, reentryRules, schedule, nodes, state, concurrencyKey); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateJourneyRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); + sb.append(" earlyExit: ").append(toIndentedString(earlyExit)).append("\n"); + sb.append(" reentryRules: ").append(toIndentedString(reentryRules)).append("\n"); + sb.append(" schedule: ").append(toIndentedString(schedule)).append("\n"); + sb.append(" nodes: ").append(toIndentedString(nodes)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" concurrencyKey: ").append(toIndentedString(concurrencyKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("audience"); + openapiFields.add("early_exit"); + openapiFields.add("reentry_rules"); + openapiFields.add("schedule"); + openapiFields.add("nodes"); + openapiFields.add("state"); + openapiFields.add("concurrency_key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateJourneyRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateJourneyRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateJourneyRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateJourneyRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateJourneyRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateJourneyRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateJourneyRequest + * @throws IOException if the JSON string is invalid with respect to UpdateJourneyRequest + */ + public static UpdateJourneyRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateJourneyRequest.class); + } + + /** + * Convert an instance of UpdateJourneyRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} +