openapi: '3.0.1'
info:
  title: Notification API
  version: '4.4.2'
  x-visibility: external
  description: >-
    Notification APIs enables applications to distribute information through various notification channels like E-mail, Push notification and SMS. Application developer/operator may use different APIs to send notifications and get delivery status of notification through their application. It allows developers to manage and utilize the following operations related to notification messages, namely:

    <ol>
      <li>Registration of mobile apps and mobile app installation instances for receiving push notifications </li>
      <li>Sending push notifications to set of users of a mobile app; addressed either by email address or the mobile app instances.</li>
      <li>Sending emails to a set of target recipients or a broadcast group with an option to attach files.</li>
      <li>Sending SMS to to a set of target recipients.
    </ol>

    <B>Limitations</B>

      - This API cannot be accessed by subtenants.
      - The service may decide to throttle API requests temporarily returning a 429 status code.

    ## Generic Errors
      The following generic error codes might occur at any of the specified operation.Generic errors are prefixed with 'mdsp.core.generic.'.
      - 204: noContent
      - 400: invalidParameter
      - 400: invalidRequestBodyProperty
      - 400: missingParameter
      - 400: missingRequestBodyProperty
      - 401: unauthorized
      - 403: forbidden
      - 404: noMatch
      - 409: conflict
      - 429: tooManyRequests
      - 500: internalServerError
    See the MindSphere API documentation generic errors page for more information.

servers:
  - url: https://api.eu1.siemens.app/api/notification-1000001700/v4
    description: Xcelerator compliant URL

tags:
  - name: Email Notifications
    description: >-
      Operations to send emails with optional attachments, to target recipients.
  - name: Email Management
    description: >-
      Operations to manage administrative operations of email.
  - name: SMS Notifications
    description: >-
      Operations to send sms notifications to target recipients.
  - name: Push Notifications
    description: >-
      Operations to send push notifications to mobile apps.
  - name: Mobile Apps
    description: >-
      Operations to define mobile apps and instances for push notifications.
  - name: Templates
    description: >-
      Operations to define templates

paths:
  /multicastSMSNotificationJobs:
    post:
      tags:
        - SMS Notifications
      security:
        - sms:
            - nose.sm.w
      summary: Sends an SMS notification to specified recipients.
      description: "<p> Publishes the notification via sms to the specified recipients. Templates can be used for sending messages, in which case the specific template id can  be passed to this API along with specific values for template parameters. If message and template, both are specified, message attribute will be used for sending SMS notification. <br>The message is scanned for any vulnerabilities before dispatching it to the recipients. A single SMS message can contain up to 140 bytes of information where-in the character quota depends on the encoding scheme. For example, an SMS message can contain: </p>
        <li>\t160 GSM characters </li>
        <li>\t140 ASCII characters </li>
        <li>\t70 UCS-2 characters </li>
      <p> If the message size exceeds 140 bytes, it will be split into multiple messages and sent. When message is split into multiple messages, each partial message will be billed as a single unit. Eg. If a message size is 200 bytes; then this it be billed as 2 units. Maximum size limit for a message is 1500 bytes.</p>
      <p> <b>Note:</b> Due to regulatory restrictions, sending <b>SMS</b> using the MindSphere notification service is <b>suspended</b> if at least one of the target recipients is from the <b>India</b> region. Recipients from the India region shall use other notification options (e-mail or push notification). </p>"
      operationId: createSMSNotificationJob
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MulticastSMSNotificationJobRequest'
      responses:
        '202':
          description: The notification has been successfully queued for dispatch via SMS.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SMSJobResponse'
        '400':
          description: |
            Bad request. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parameterized)</th>
              </tr>
              <tr>
                <td>smsSizeLimit</td>
                <td>SMS message exceeded maximum size limit</td>
              </tr>
              <tr>
                <td>maliciousMessage</td>
                <td>SMS message contains malicious content.</td>
              </tr>
              <tr>
                <td>invalidTemplateId</td>
                <td>Specified template not found in the system</td>
              </tr>
              <tr>
                <td>restrictedRegion</td>
                <td>Recipients from restricted region are not allowed. Please refer documentation</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
    get:
      tags:
        - SMS Notifications
      security:
        - sms:
            - nose.sm.r
      summary: Shows a list of all sms notification jobs.
      description: |
        Fetches a list sms notification jobs. The resultant list maybe filtered by providing a filter criteria. <br>
        <B>Note:</B> SMS notification jobs are stored in the system up to 180 days from the date of creation.
      operationId: getAllSMSNotificationJobs
      parameters:
        - name: filter
          in: query
          schema:
            type: string
          description: |
            JSON string describing filter operations performed on sms notification jobs to be returned.
            ```
            {
                "fromApplication": "MachineMonitor"
            }
            ```
            Unencoded example filter value to fetch all sms notification jobs from application 'MachineMonitor' with status 'Queued':
            ```
            {
              "fromApplication": "MachineMonitor",
              "status": "Queued"
            }
            ```
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/size'
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MulticastSMSNotificationJobs'
        '404':
          description: |
            Not found. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>jobNotFound</td>
                <td>No job found.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.

  /multicastSMSNotificationJobs/{id}:
    get:
      tags:
        - SMS Notifications
      security:
        - sms:
            - nose.sm.r
      summary: Shows status of an sms job.
      description: |
        Shows the status of the triggered multicast sms notification job.
      operationId: getSMSNotificationJobs
      parameters:
        - name: id
          in: path
          description: Job ID to fetch the details
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MulticastSMSNotificationJob'
        '404':
          description: |
            Not found. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>jobNotFound</td>
                <td>No job found for given ID.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.

  /multicastSMSNotificationJobs/{id}/deliveries:
    get:
      tags:
        - SMS Notifications
      security:
        - sms:
            - nose.sm.r
      summary: Shows detailed delivery information of an sms job.
      description: Shows per recipient status of sms dispatch.
      operationId: getSMSDeliveryStatus
      parameters:
        - name: id
          in: path
          description: Job ID to fetch the details
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/size'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationDispatchStatusSMS'
        '404':
          description: |
            Not found. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>jobNotFound</td>
                <td>No job found for given ID.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.

  /emailNotificationJobs:
    post:
      tags:
        - Email Notifications
      security:
        - email:
            - nose.em.w
      summary: Create an email job to send emails with attachments.
      description: Publishes an email to a set of recipients or a broadcast group. A broadcast group is a group of users within the tenant. <b>When using this endpoint, either `recipients` or `broadcastGroup` is required to be provided.</b> You may provide both, recipients and broadcast group as well. A recipient list can contain up to 50 recipients. When email is sent to recipients listed in `broadcastGroup`, the recipients are listed under 'bcc' field. The message to be sent in the email can be provided directly through message attribute or passed through a template. When using template, message attribute may not be specified. <b> When creating an email job  a message or template is required to be provided </b>. If both attributes are provided, the message attribute is used for sending email. In all 5 files can be uploaded as attachments; where-in the total size of all attachments is limited to 8MB. Only zip, csv, pdf and json file types are supported as attachments. The attached files are scanned for viruses before dispatching. The email job will be deleted automatically after 180 days from the date of creation.
      operationId: createCommonEmailNotificationJob
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - metadata
              properties:
                metadata:
                  type: string
                  description: |
                    See the model at `components/schemas/EmailNotificationRequestMetadata`. Content of the metadata attribute must be in <application/json> format, as given in the example below. The size of this attribute is limited to 100KB.
                    ```
                    {
                        "subject": "[Status] Machine Data Analysis",
                        "message": "Machine data analysis completed. Analysis report attached with this email.",
                        "fromApplication": "MachineMonitor",
                        "priority": "Normal",
                        "recipients": [
                          "plantengineer@mdspcustomer.com",
                          "plantmanager@mdspcustomer.com"
                        ],
                        "broadcastGroup": {
                          "broadcastType" : "All",
                          "subTenantId": "pnlmfg"
                        },
                        "sendEncrypted": true
                    }
                    ```
                    Example with templates
                    ```
                    {
                        "subject": "[Status] Machine Data Analysis",
                        "templateId": "0bff7e7a-cd25-4576-9908-4180ef086174",
                        "templateParams": [{"FactoryName": "MachineFactory"}],
                        "fromApplication": "MachineMonitor",
                        "priority": "Normal",
                        "recipients": [
                          "plantengineer@mdspcustomer.com",
                          "plantmanager@mdspcustomer.com"
                        ],
                        "broadcastGroup": {
                          "broadcastType" : "All",
                          "subTenantId": "pnlmfg"
                        },
                        "sendEncrypted": true
                    }
                    ```
                attachment:
                  type: string
                  format: binary
                  description: File to be uploaded as attachment in email notification. This parameter must be provided for each file to be attached with the email. Maximum 5 files can be attached with one email notification job.
      responses:
        '202':
          description: The notification has been successfully queued for dispatch via email.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailNotificationJobResponse'
        '400':
          description: |
            Bad request. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parameterized)</th>
              </tr>
              <tr>
                <td>emailSizeLimit</td>
                <td>Email message exceeded maximum size limit</td>
              </tr>
              <tr>
                <td>attachmentCountLimit</td>
                <td>Email attachments exceeded maximum count limit</td>
              </tr>
              <tr>
                <td>attachmentSizeLimit</td>
                <td>Email attachments exceeded maximum size limit</td>
              </tr>
              <tr>
                <td>maliciousMessage</td>
                <td>Email message contains malicious content.</td>
              </tr>
              <tr>
                <td>recipientCountLimit</td>
                <td>Recipients exceeded maximum limit.</td>
              </tr>
              <tr>
                <td>invalidRecipientTenant</td>
                <td>Specified recipient tenant in the broadcast group does not exist in the system.</td>
              </tr>
              <tr>
                <td>invalidSubTenant</td>
                <td>Specified sub-tenant does not exist in the system.</td>
              </tr>
              <tr>
                <td>invalidTemplateId</td>
                <td>Specified template not found in the system</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
    get:
      tags:
        - Email Notifications
      security:
        - email:
            - nose.em.r
      summary: Shows a list of email notification jobs.
      description: |
        Fetches a list email notification jobs. The resultant list maybe filtered by providing a filter criteria. </br><b>Note:</b> Email notification jobs are stored in the system up to 180 days from the date of creation.
      parameters:
        - name: filter
          in: query
          schema:
            type: string
          description: |
            JSON string describing filter operations performed on emailNotificationJobs to be returned.
            ```
            {
                "fromApplication": "MachineMonitor"
            }
            ```
            Unencoded example filter value to fetch all emailNotificationJobs from application 'MachineMonitor' with status 'Queued':
            ```
            {
              "fromApplication": "MachineMonitor",
              "status": "Queued"
            }
            ```
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/size'
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailNotificationJobResponseList'
        '404':
          description: |
            Not found. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>jobNotFound</td>
                <td>No jobs found.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.

  /emailNotificationJobs/{id}:
    get:
      tags:
        - Email Notifications
      security:
        - email:
            - nose.em.r
      summary: Shows the status of an email job.
      description: Allows the sender application to validate if the email job was dispatched or is waiting in the queue to be dispatched. It also provides information of any attachment that was found to be malicious. Information about the Email job can be retrieved up to 180 days from the creation of the email job, after which it will be automatically deleted from the system.
      parameters:
        - name: id
          in: path
          description: Job ID to fetch the details
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailNotificationJobResponseDetailed'
        '404':
          description: |
            Not found. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>jobNotFound</td>
                <td>No job found for given ID.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.

  /emailNotificationJobs/{id}/deliveries:
    get:
      tags:
        - Email Notifications
      security:
        - email:
            - nose.em.r
      summary: Shows email delivery status per recipient.
      description: Allows the sender application to validate the delivery of the email to its recipients. Information about the email job deliveries can be retrieved up to 180 days from the creation of the email job, after which it will be automatically deleted from the system.
      operationId: getEmailDeliveryStatus
      parameters:
        - name: id
          in: path
          description: Job ID to fetch the details
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/size'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationDeliveries'
        '404':
          description: |
            Not found. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>jobNotFound</td>
                <td>No job found for given ID.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.

  /multicastEmailNotificationJobs:
    post:
      tags:
        - Email Notifications
      security:
        - email:
            - nose.em.w
      deprecated: true
      summary: Sends an email notification to specified recipients with an option to attach files.
      description: Publishes the notification via email to the specified recipients, along with attachments as optional. Maximum 5 files can be uploaded as attachments; where-in the total size of all attachments is limited to 8MB. Only zip, csv, pdf and json file types are supported as attachments.
      operationId: createEmailNotificationJob
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - metadata
              properties:
                metadata:
                  type: string
                  description: |
                    See model components/schemas/MulticastEmailNotificationRequestMetadata. Content of the metadata attribute must be in <application/json> format, as shown in the example below. The size of this attribute is limited to 250KB.
                    ```
                    {
                        "subject": "[Status] Machine Data Analysis",
                        "message": "Machine data analysis completed. Analysis report attached with this email.",
                        "fromApplication": "MachineMonitor",
                        "priority": "Normal",
                        "recipients": [
                          "plantengineer@mdspcustomer.com",
                          "plantmanager@mdspcustomer.com"
                        ]
                    }
                    ```
                attachment:
                  type: string
                  format: binary
                  description: File to be uploaded as attachment in email notification. This parameter must be provided for each file to be attached with the email. Maximum 5 files can be attached with one email request.
      responses:
        '202':
          description: The notification has been successfully queued for dispatch via Email.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailNotificationJobResponse'
        '400':
          description: |
            Bad request. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parameterized)</th>
              </tr>
              <tr>
                <td>emailSizeLimit</td>
                <td>Email message exceeded maximum size limit</td>
              </tr>
              <tr>
                <td>attachmentCountLimit</td>
                <td>Email attachments exceeded maximum count limit</td>
              </tr>
              <tr>
                <td>attachmentSizeLimit</td>
                <td>Email attachments exceeded maximum size limit</td>
              </tr>
              <tr>
                <td>maliciousMessage</td>
                <td>Email message contains malicious content.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.

  /multicastEmailNotificationJobs/{id}:
    get:
      tags:
        - Email Notifications
      security:
        - email:
            - nose.em.r
      deprecated: true
      summary: Shows status of an email job.
      description: Shows the status of the triggered multicast email notification job.
      operationId: getCommonEmailNotificationJobs
      parameters:
        - name: id
          in: path
          description: Job ID to fetch the details
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MulticastEmailNotificationJob'
        '404':
          description: |
            Not found. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>jobNotFound</td>
                <td>No job found for given ID.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.

  /multicastEmailNotificationJobs/{id}/deliveries:
    get:
      tags:
        - Email Notifications
      security:
        - email:
            - nose.em.r
      deprecated: true
      summary: Shows email delivery status per recipient.
      description: Shows per recipient status of email dispatch status.
      operationId: getMulticastEmailDeliveryStatus
      parameters:
        - name: id
          in: path
          description: Job ID to fetch the details
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/size'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationDispatchStatus'
        '404':
          description: |
            Not found. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>jobNotFound</td>
                <td>No job found for given ID.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.

  /emailEncryptionCertificates:
    get:
      tags:
        - Email Management
      security:
        - email:
            - nose.em.r
      summary: Get a list of email encryption certificates.
      description: This endpoint can be used to validate if certificates for all the recipients are available in the system, before sending an encrypted email.
      operationId: getAllCertificates
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/size'
      responses:
        '200':
          description: Ok.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailEncryptionCertificatesList'
        default:
          description: Other error with any status code and response body format.

  /emailEncryptionCertificates/{email}:
    put:
      tags:
        - Email Management
      security:
        - email:
            - nose.em.w
      summary: Upload a new email encryption certificate for the specified recipient email.
      description: An application which needs to send encrypted emails to its recipients, needs to upload recipient certificates. Supported format for public certificates is PEM. To update the public certificate of an existing email, please use the `PATCH` method.
      operationId: updateCertificatePut
      parameters:
        - $ref: '#/components/parameters/email'
      requestBody:
        required: true
        description: Public certificate in PEM format.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailEncryptionCertificateModel'
      responses:
        '201':
          description: Created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailEncryptionCertificateModel'
        default:
          description: Other error with any status code and response body format.
    get:
      tags:
        - Email Management
      security:
        - email:
            - nose.em.r
      summary: Fetch the email encryption certificate corresponding to the specified recipient email.
      description: Gets the certificate corresponding to the input email.
      operationId: getCertificate
      parameters:
        - $ref: '#/components/parameters/email'
      responses:
        '200':
          description: ok.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailEncryptionCertificateModel'
        default:
          description: Other error with any status code and response body format.
    patch:
      tags:
        - Email Management
      security:
        - email:
            - nose.em.w
      summary: Update the specified recipient's email encryption certificate.
      description: Update a recipients certificate, in case of scenarios like certificate expiry or rotation. Supported format for public certificates is PEM.
      operationId: updateCertificate
      parameters:
        - name: If-Match
          in: header
          schema:
            type: string
          description: Perform certificate update only in case provided ETag value is still current.
        - $ref: '#/components/parameters/email'
      requestBody:
        required: true
        description: Public certificate in PEM format.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailEncryptionCertificateModel'
      responses:
        '200':
          description: Ok.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailEncryptionCertificateModel'
        default:
          description: Other error with any status code and response body format.
    delete:
      tags:
        - Email Management
      security:
        - email:
            - nose.em.w
      summary: Delete the email encryption certificate for the specified recipient email.
      description: >-
        Deletes the recipient's email encryption certificate from the system.
      operationId: deleteCertificate
      parameters:
        - name: If-Match
          in: header
          schema:
            type: string
          description: Perform certificate update only in case provided ETag value is still current.
        - $ref: '#/components/parameters/email'
      responses:
        '204':
          description: Successfully deleted email encryption certificate.
        default:
          description: Other error with any status code and response body format.

  /bouncedRecipients:
    get:
      tags:
        - Email Management
      security:
        - email:
            - nose.em.r
      summary: Get all the recipients to whom the email delivery failed/bounced.
      description: The recipients to whom the delivery failed/bounced are added to a blacklist. This api returns all the recipients of the tenant which were added to this blacklist.
      operationId: getBouncedRecipients
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/size'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BouncedRecipients'
        default:
          description: Other error with any status code and response body format.

  /bouncedRecipients/{email}:
    delete:
      tags:
        - Email Management
      security:
        - email:
            - nose.em.w
      summary: Delete recipient email from bounced recipient list.
      description: The recipients to whom the delivery failed/bounced are added to a blacklist. This operation deletes the specified recipient from this blacklist which are no more invalid and can be considered as valid email for sending emails.
      operationId: deleteBouncedRecipient
      parameters:
        - $ref: '#/components/parameters/email'
      responses:
        '204':
          description: Deleted Email from bounced recipients list
        default:
          description: Other error with any status code and response body format.

  /multicastPushNotificationJobs:
    post:
      tags:
        - Push Notifications
      security:
        - mobilepush:
            - nose.pn.w
      summary: Sends a push notification to selected mobile app instances.
      description: Publishes the notification via Mobile Push to the selected mobile app instances. The developer can choose to address recipients using their mobile device ids or using the recipient's email address. When a recipient is addressed using their email address, the Notification Service sends the notifications to all app instances registered with that email address. Templates can be used for sending messages, in which case the specific template id can be passed to this API along with specific values for template parameters. If message and template, both are specified, message attribute will be used for sending Push notification.
      operationId: createMobileAppNotificationJob
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MulticastPushNotificationJobsRequest'
      responses:
        '202':
          description: The notification has been successfully queued for dispatch via mobile push.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendResponse'
        '400':
          description: |
            Bad request. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>messageEnglishLanguageMissing</td>
                <td> Default language 'English (en)' not specified in message</td>
              </tr>
              <tr>
                <td>invalidTemplateId</td>
                <td>Specified template not found in the system</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
    get:
      tags:
        - Push Notifications
      security:
        - mobilepush:
            - nose.pn.r
      summary: Shows a list of push notification jobs
      description: Fetches a list of push notification jobs. The resultant list maybe filtered by providing a filter criteria. <br><B>Note</B> Push notification jobs are stored in the system up to 180 days from the date of creation.
      operationId: getAllPushNotifications
      parameters:
        - name: filter
          in: query
          schema:
            type: string
          description: |
            JSON string describing filter operations performed on pushNotificationJobs to be returned.
            ```
            {
                "mobileAppId": "65k88924-7ffc-1203-6h56-rr8834budg1w"
            }
            ```
            Unencoded example filter value to fetch all pushNotificationJobs in context of a specific mobile app with status 'queued':
            ```
            {
              "mobileAppId": "65k88924-7ffc-1203-6h56-rr8834budg1w",
              "status": "queued"
            }
            ```
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/size'
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PushNotificationJobsObject'
        '404':
          description: |
            Not found. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>jobNotFound</td>
                <td>No jobs found.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.

  /multicastPushNotificationJobs/{id}:
    get:
      tags:
        - Push Notifications
      security:
        - mobilepush:
            - nose.pn.r
      summary: Shows the status of a push notification job.
      description: ""
      operationId: getPushNotifications
      parameters:
        - name: id
          in: path
          description: Job ID to fetch the details
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendResponse'
        '404':
          description: |
            Not found. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>jobNotFound</td>
                <td>No job found for given ID.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.

  /mobileApps:
    post:
      tags:
        - Mobile Apps
      security:
        - mobileapps:
            - nose.ma.w
      summary: Register a new mobile app.
      description: >-
        A mobile app developer should use this api to register a mobile app with the Notification Service. This resource represents a mobile app in Notification Service. Either an iOS or Android configuration can be chosen for the app. Registration of the mobile app allows the developer to configure necessary push notification provider credentials.
        App Configuration details are masked and not displayed in response owing to security reasons.
      operationId: createMobileApp
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AppRegistrationRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppRegistrationResponse'
        '400':
          description: |
            Bad request. Possible errors:
            </br><table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 5%;">
                <col span="1" style="width: 65%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left"></th>
                <th align="left">Message</th>
              </tr>
              <tr>
                <td>mobileAppTypeMismatch</td>
                <td></td>
                <td>The value of request body property type must match the additionally provided property iOS or Android.</td>
              </tr>
              <tr>
                <td>invalidAndroidAppCredentials</td>
                <td></td>
                <td>The value of request body property android.fcmServerKey is not valid</td>
              </tr>
              <tr>
                <td>invalidIosAppCredentials</td>
                <td></td>
                <td>The value of request body property for FCM/APNS credentials are invalid.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
    get:
      tags:
        - Mobile Apps
      security:
        - mobileapps:
            - nose.ma.r
      summary: Show all registered apps for a tenant. App Configuration details are masked and not displayed in response owing to security reasons.
      operationId: queryMobileApps
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/size'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedAppRegistrationResponse'
        default:
          description: Other error with any status code and response body format.

  /mobileApps/{id}:
    patch:
      tags:
        - Mobile Apps
      security:
        - mobileapps:
            - nose.ma.w
      summary: Edit a registered mobile app. App Configuration details are masked and not displayed in response owing to security reasons.
      operationId: patchMobileApp
      parameters:
        - name: id
          in: path
          description: ID of app to edit
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AppRegistrationUpdateRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppRegistrationResponse'
        '400':
          description: |
            Bad request. Possible errors:
            </br><table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 5%;">
                <col span="1" style="width: 65%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left"></th>
                <th align="left">Message</th>
              </tr>
              <tr>
                <td>appTypeCredentialMismatch</td>
                <td></td>
                <td>The value of request body property iOS/Android must match the type of app.</td>
              </tr>
              <tr>
                <td>invalidAndroidAppCredentials</td>
                <td></td>
                <td>The value of request body property android.fcmServerKey is not valid</td>
              </tr>
              <tr>
                <td>invalidIosAppCredentials</td>
                <td></td>
                <td>The value of request body property for FCMAPNS credentials are invalid.</td>
              </tr>
              <tr>
                <td>appCredentialMismatch</td>
                <td></td>
                <td>Provided App credentials does not match with app type.</td>
              </tr>
              <tr>
                <td>iOSCredentialMismatch</td>
                <td></td>
                <td>Provided credentials does not match with existing iOS credential type.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
    delete:
      tags:
        - Mobile Apps
      security:
        - mobileapps:
            - nose.ma.w
      summary: Deregister an existing registered mobile app.
      description: Deregistration of a mobile app involves deletion of all saved credentials and other configuration. Any pending notification jobs which depend on this configuration will be terminated, marked with a **failed** status and the notifications will not be dispatched to the intended recipients.
      operationId: deleteMobileApp
      parameters:
        - name: id
          in: path
          description: ID of app to delete
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No content
        default:
          description: Other error with any status code and response body format.

  /mobileApps/{id}/instances:
    post:
      tags:
        - Mobile Apps
      security:
        - appInstances:
            - nose.ai.w
      summary: Registers a new mobile installation instance with a registered mobile app.
      description: Registration is invoked when a mobile app is installed on a device and user details can be updated by the developer based on login. If the instance is already registered, existing instance entry shall be updated. Push notification token detail is masked and not displayed in response owing to security reasons.
      operationId: createMobileAppInstance
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The mobile app identifier
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AppInstanceRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppInstanceResponse'
        default:
          description: Other error with any status code and response body format.
    get:
      tags:
        - Mobile Apps
      security:
        - mobileapps:
            - nose.ma.r
        - appInstances:
            - nose.ai.r
      summary: Show all registered mobile app instances for a given mobile app. Push notification token detail is masked and not displayed in response owing to security reasons.
      operationId: queryMobileappInstances
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The mobile app identifier
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/size'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedAppInstanceResponse'
        default:
          description: Other error with any status code and response body format.

  /mobileApps/{id}/instances/{instanceId}:
    patch:
      tags:
        - Mobile Apps
      security:
        - appInstances:
            - nose.ai.w
      summary: Edit a specific mobile app instance registration. Push notification token detail is masked and not displayed in response owing to security reasons.
      operationId: patchMobileAppInstance
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The mobile app identifier
        - name: instanceId
          in: path
          description: ID of mobile app instance to edit
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AppInstancePatchRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppInstanceResponse'
        default:
          description: Other error with any status code and response body format.
    delete:
      tags:
        - Mobile Apps
      security:
        - appInstances:
            - nose.ai.w
      summary: Delete a specific mobile app instance registration.
      description: Deregistration of a mobile app involves deletion of the corresponding push notification token. Any pending notification jobs which depend on this configuration will be terminated, marked with a **failed** status and the notifications will not be dispatched to the mobile app instance.
      operationId: deleteMobileAppInstance
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The mobile app identifier
        - name: instanceId
          in: path
          description: ID of app instance to delete
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No content
        default:
          description: Other error with any status code and response body format.

  /templates:
    post:
      tags:
        - Templates
      security:
        - email:
            - nose.em.w
        - sms:
            - nose.sm.w
        - mobilepush:
            - nose.pn.w
      summary: Create a template for notification.
      description: |
       Create a new template definition for sending notifications. Templates can be created for Email, SMS and PUSH type of notifications. When providing templates, the place holders defined in the templates need to be specified as `params` in the api `metadata` attribute. Provided below is a sample template for reference.

       ```
        Dear PlantEngineer,

          The regular maintenance of the machines is completed for %FactoryName%. Please plan to start the assembly line.

        Kind regards,
        Maintenance Engineer
       ```
       While creating a template definition for the above sample template, provide `FactoryName` as <b>params</b> in metadata attribute. <br>The maximum size of the email template is limited to 8 MB. However, the email message resulting from the Email template along with its attachments is limited by the email size limit; i.e. 8 MB.<br> In case of SMS, the sms message resulting from the template is limited to maximum size of SMS notification; i.e. 1500 bytes.<br> The following table lists the supported filetypes for various notifications:<br>

        <table>
          <tr>
            <th>Notification type</th>
            <th>Supported filetypes</th>
          </tr>
          <tr>
            <td align="center">Email</td>
            <td align="center">".html", ".txt"</td>
          </tr>
          <tr>
            <td align="center">SMS</td>
            <td align="center">".txt"</td>
          </tr>
          <tr>
            <td align="center">Push</td>
            <td align="center">*.json</td>
          </tr>
        </table>

       Templates for Push notification should follow the model as described in `components/schemas/PushMessageModel`.
      operationId: createTemplate
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - metadata
                - templateFile
              properties:
                metadata:
                  type: string
                  description: See the model at `components/schemas/CreateTemplate`. Content type must be <application/json>. The size of this attribute is limited to 100KB.
                templateFile:
                  type: string
                  format: binary
                  description: Template file in html, text or json format.
      responses:
        '201':
          description: Created template
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTemplate'
        '400':
          description: |
            Bad request. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parameterized)</th>
              </tr>
              <tr>
                <td>unsupportedFileType</td>
                <td>Unsupported template file type provided</td>
              </tr>
              <tr>
                <td>fileSizeExceeded</td>
                <td>Template file size exceeded limit</td>
              </tr>
              <tr>
                <td>metaDataSizeExceeded</td>
                <td>Size of metadata attribute exceeded limit</td>
              </tr>
              <tr>
                <td>invalidTemplateId</td>
                <td>Template file not provided</td>
              </tr>
              <tr>
                <td>missingMandatoryAttribute</td>
                <td>Missing mandatory properties in payload</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
    get:
      tags:
        - Templates
      security:
        - email:
            - nose.em.r
        - sms:
            - nose.sm.r
        - mobilepush:
            - nose.pn.r
      summary: Shows a list of templates.
      description: Fetches a list of all tenants. The resultant list may be filtered by providing a filter criteria.
      operationId: getTemplates
      parameters:
        - name: filter
          in: query
          schema:
            type: string
          description: |
            JSON string describing the template name to filter.
            ```
            {
                "name": "FactoryAlertTemplate"
            }
            ```
            JSON string describing filtering templates by type.
            ```
            {
                "type": "Email"
            }
            ```
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/size'
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTemplates'

  /templates/{id}:
    get:
      tags:
        - Templates
      security:
        - email:
            - nose.em.r
        - sms:
            - nose.sm.r
        - mobilepush:
            - nose.pn.r
      summary: Shows the details of the specified template.
      operationId: getTemplate
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            maxLength: 50
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTemplate'
        '400':
          description: |
            Bad request. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parameterized)</th>
              </tr>
              <tr>
                <td>invalidTemplateId</td>
                <td>Specified template not found in the system</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
    patch:
      tags:
        - Templates
      security:
        - email:
            - nose.em.w
        - sms:
            - nose.sm.w
        - mobilepush:
            - nose.pn.w
      summary: Update the specified template definition.
      description: The new template definition file provided with the request, overrides the previous definition file. <br>The maximum size of the email template is limited to 8 MB. However, the email message resulting from the Email template along with its attachments is limited by the email size limit; i.e. 8 MB.<br> In case of SMS, the sms message resulting from the template is limited to maximum size of SMS notification; i.e. 1500 bytes.
      operationId: updateTemplate
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            maxLength: 50
        - name: If-Match
          in: header
          schema:
            type: string
            maxLength: 50
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                metadata:
                  type: string
                  description: See the model at `components/schemas/CreateTemplate`. Content type must be <application/json>. The size of this attribute is limited to 100KB. Attributes `name` and `type` cannot be modified when updating the template.
                templateFile:
                  type: string
                  format: binary
                  description: Template file in html or text format.
      responses:
        '200':
          description: Ok
        '400':
          description: |
            Bad request. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parameterized)</th>
              </tr>
              <tr>
                <td>invalidTemplateId</td>
                <td>Specified template not found in the system</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
    delete:
      tags:
        - Templates
      security:
        - email:
            - nose.em.w
        - sms:
            - nose.sm.w
        - mobilepush:
            - nose.pn.w
      summary: Delete the specific template definition.
      operationId: deleteTemplate
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: If-Match
          in: header
          schema:
            type: string
      responses:
        '204':
          description: No content
        '400':
          description: |
            Bad request. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parameterized)</th>
              </tr>
              <tr>
                <td>invalidTemplateId</td>
                <td>Specified template not found in the system</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'

  /templates/{id}/file:
    get:
      tags:
        - Templates
      security:
        - email:
            - nose.em.r
        - sms:
            - nose.sm.r
        - mobilepush:
            - nose.pn.r
      summary: Download the template file for review
      operationId: getTemplateFile
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Ok
          content:
            application/json: {}
            text/html: {}
            text/plain: {}
        '400':
          description: |
            Bad request. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parameterized)</th>
              </tr>
              <tr>
                <td>invalidTemplateId</td>
                <td>Specified template not found in the system</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'

components:
  schemas:
    AppInstancePatchRequest:
      type: object
      properties:
        deviceOS:
          type: string
          description: Device operating system
          example: iOS 10
        language:
          type: string
          description: Preferred ISO 639-1 Language code. Defaults to English if not specified.
          example: "de"
        pushNotificationToken:
          type: string
          description: Push notification identifier from Google or Apple.
          example: 7abcd558f29d0c1f048083e2134ad8ea4b3d87d8ae9c038b43c132706ff445f0

    AppInstanceObject:
      type: object
      properties:
        deviceModel:
          type: string
          description: Model of the mobile device against which the app is registered.
          example: iPhone X
        deviceOS:
          type: string
          description: Device operating system
          example: iOS 10
        language:
          type: string
          description: Preferred ISO 639-1 Language code. Defaults to English if not specified.
          example: "de"
        pushNotificationToken:
          type: string
          description: Masked value of the Push notification identifier from Google or Apple.
          example: XXXXXXXXXXXXXXXXXXXXXXXXX

    AppInstanceRequest:
      type: object
      allOf:
        - type: object
          properties:
            deviceModel:
              type: string
              example: iPhone X
              description: Attribute that will stored against a user, appId, registrationId. This can be displayed in UI and user can differentiate multiple installations of an app for the user in multiple mobile app instances.
        - $ref: '#/components/schemas/AppInstancePatchRequest'

    AppInstanceResponse:
      type: object
      allOf:
        - type: object
          properties:
            id:
              type: string
              example: '167e58934-5kk8-2389-5g90-ee4456betd1w'
        - $ref: '#/components/schemas/AppInstanceObject'

    AppInstanceResponseWithEmailAddress:
      type: object
      allOf:
        - $ref: '#/components/schemas/AppInstanceResponse'
        - type: object
          properties:
            userEmailAddress:
              type: string
              format: email
              example: 'joe.smith@siemens.com'

    PagedAppInstanceResponse:
      type: object
      properties:
        instances:
          type: array
          items:
            $ref: '#/components/schemas/AppInstanceResponseWithEmailAddress'
        page:
          $ref: '#/components/schemas/Page'

    AppRegistrationRequest:
      type: object
      properties:
        name:
          type: string
          description: App names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, hyphens, and periods, must be between 1 and 256 characters long, and must begin with a letter.
          example: 'Voith_Service_App'
        type:
          type: string
          enum:
            - iOS
            - Android
          example: iOS
          description: Describes the device platform. At least one device type should be specified.
        android:
          type: object
          properties:
            fcmServerKey:
              type: string
              description: Firebase cloud messaging server key
        ios:
          type: object
          properties:
            fcmServerKey:
              type: string
              description: Optional Firebase cloud messaging server key if FCM is to be used for sending notifications. If this key is not provided, an APNS notification will be sent using the certificate and private key provided.
            bundleId:
              type: string
              description: Bundle identifier of the iOS app
            apnsSslCertificate:
              type: string
              description: APNS SSL certificate content (.pem file format)
            apnsAppPrivateKey:
              type: string
              description: The private key associated with the APNS SSL certificate (.pem file format)
            production:
              type: boolean
              description: True for production environment, false for sandbox environment.
              default: false

    MobileAppObject:
      type: object
      properties:
        id:
          type: string
          description: id of the registered mobile app.
          example: 1b4f9820-a6eb-4c86-b499-a030533ef5a2
        name:
          type: string
          description: App names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, hyphens, and periods, must be between 1 and 256 characters long, and must begin with a letter.
          example: 'Voith_Service_App'
        type:
          type: string
          enum:
            - iOS
            - Android
          example: iOS
          description: Describes the device platform. At least one device type should be specified.
        android:
          type: object
          properties:
            fcmServerKey:
              type: string
              example: XXXXXXXXXXXXXXXXXXXXXXXXX
              description: Masked value of the Firebase cloud messaging server key
        ios:
          type: object
          properties:
            fcmServerKey:
              type: string
              example: XXXXXXXXXXXXXXXXXXXXXXXXX
              description: Masked value of the Optional Firebase cloud messaging server key if FCM is to be used for sending notifications. If this key is not provided, an APNS notification will be sent using the certificate and private key provided.
            bundleId:
              type: string
              description: Bundle identifier of the iOS app
            apnsSslCertificate:
              type: string
              description: Masked value of the APNS SSL certificate content (.pem file format)
              example: XXXXXXXXXXXXXXXXXXXXXXXXX
            apnsAppPrivateKey:
              type: string
              description: Masked value of the private key associated with the APNS SSL certificate (.pem file format)
              example: XXXXXXXXXXXXXXXXXXXXXXXXX
            production:
              type: boolean
              description: True for production environment, false for sandbox environment.
              default: false

    AppRegistrationResponse:
      type: object
      allOf:
        - type: object
          properties:
            id:
              type: string
              example: '04f92378-7vvt-6720-5j10-kk9976befc1a'
            type:
              type: string
              enum:
                - iOS
                - Android
              example: iOS
              description: Describes the mobile platform.
        - $ref: '#/components/schemas/MobileAppObject'

    AppRegistrationUpdateRequest:
      type: object
      properties:
        name:
          type: string
          description: App names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, hyphens, and periods, must be between 1 and 256 characters long, and must begin with a letter.
          example: 'Voith_Service_App'
        android:
          type: object
          properties:
            fcmServerKey:
              type: string
              description: Firebase cloud messaging server key
        ios:
          type: object
          properties:
            fcmServerKey:
              type: string
              description: Optional Firebase cloud messaging server key if FCM is to be used for sending notifications. If this key is not provided, an APNS notification will be sent using the certificate and private key provided.
            bundleId:
              type: string
              description: Bundle identifier of the iOS app
            apnsSslCertificate:
              type: string
              description: APNS SSL certificate content (.pem file format)
            apnsAppPrivateKey:
              type: string
              description: The private key associated with the APNS SSL certificate (.pem file format)
            production:
              type: boolean
              description: True for production environment, false for sandbox environment.
              default: false

    PagedAppRegistrationResponse:
      type: object
      properties:
        mobileApps:
          type: array
          items:
            $ref: '#/components/schemas/MobileAppObject'
        page:
          $ref: '#/components/schemas/Page'

    SendResponse:
      type: object
      properties:
        id:
          type: string
          example: '59f67823-5bhc-4780-8b23-ee8876mbtg9a'
        status:
          type: string
          enum:
            - queued
            - dispatched
            - failed
          example: queued
        mobileAppId:
          type: string
          example: '65k88924-7ffc-1203-6h56-rr8834budg1w'
        startTime:
          description: The time at which the job started.
          type: string
          example: '2017-07-21T17:32:28.000Z'
          format: date-time

    PushNotificationJobsObject:
      type: object
      properties:
        multicastPushNotificationJobs:
          type: array
          items:
            $ref: '#/components/schemas/SendResponse'
        page:
          $ref: '#/components/schemas/Page'

    SMSJobResponse:
      type: object
      properties:
        id:
          type: string
          example: '87e67823-5cha-5783-8b23-re8876m9ch4a'
          description: The job id of the SMS job request. This can be used to get the status of the sms job.

    Message:
      type: object
      properties:
        title:
          type: string
          description: The title of the notification. The content is a JSON object which contains a map of language codes to text for each language. The keys in the JSON should reflect valid ISO 639-1 language codes and English (en) should be mandatorily specified.
          example: '{ "en": "Siemens MindSphere March 2019", "de": "Siemens MindSphere März 2019"}'
        text:
          type: string
          description: The content of the push notification. The content is a JSON object which contains a map of language codes to text for each language. Maximum size of a single text content should not exceed 2KB.
          example: '{ "en": "Hi there, Welcome to MindSphere!", "de": "Hallo, Willkommen bei MindSphere!"}'

    MulticastPushNotificationJobsRequest:
      type: object
      properties:
        mobileAppId:
          type: string
          description: The mobile app identifier.
          example: '65k88924-7ffc-1203-6h56-rr8834budg1w'
        recipients:
          type: object
          properties:
            appInstanceIds:
              description: Optional set of mobile app instance ids to send the notification to. Limit is 50 instance ids per request.
              type: array
              items:
                type: string
                example: '91b55763-5eej-3489-8b78-hh5534weko7f'
            userEmailAddresses:
              description: Optional set of users (identified by email address) to send the notification to. Limit is 50 email addresses per request.
              type: array
              items:
                type: string
                format: email
                example: joe.smith@siemens.com
        message:
          $ref: '#/components/schemas/Message'
        templateId:
          type: string
          description: Id of the template to be used for message
          maxLength: 50
          example: "0bff7e7a-cd25-4576-9908-4180ef086174"
        templateParams:
          type: array
          items:
            type: object
            additionalProperties: {}
            maxProperties: 50
            example: {"FactoryName": "MachineFactory"}

    ScanDetail:
      type: object
      required:
        - filename
        - threat
      properties:
        filename:
          type: string
          example: "app.pdf"
        threat:
          description: Failed scan text.
          type: string
          example: "worm found"

    MulticastSMSNotificationJobRequest:
      type: object
      required:
        - recipients
        - fromApplication
      properties:
        message:
          type: string
          description: Body of the SMS message.
          minLength: 1
          maxLength: 1500
          example: Monthly machine data analysis completed.
        templateId:
          type: string
          description: Id of the template to be used for message
          maxLength: 50
          example: "0bff7e7a-cd25-4576-9908-4180ef086174"
        templateParams:
          type: array
          items:
            type: object
            additionalProperties: {}
            maxProperties: 50
            example: {"FactoryName": "MachineFactory"}
        recipients:
          type: array
          items:
            type: string
          minItems: 1
          maxItems: 50
          description: List of valid mobile numbers including the country code.
          example: ['+411xxxxxxx9', '+11xxxxxxx9']
        fromApplication:
          $ref: '#/components/schemas/FromApplication'

    MulticastEmailNotificationRequestMetadata:
      type: object
      required:
        - recipients
        - fromApplication
      properties:
        subject:
          type: string
          description: Subject to be displayed in the email notification.
        message:
          type: string
          description: Body of the email message.
        recipients:
          type: array
          items:
            type: string
          minItems: 1
          maxItems: 50
        fromApplication:
          $ref: '#/components/schemas/FromApplication'
        priority:
          type: string
          enum:
            - Low
            - Normal
            - High
          description: Optional priority to be requested for the email notification.
          default: Normal

    TemplateParameter:
      type: object
      properties:
        paramName:
          type: string
        paramValue:
          type: string

    EmailNotificationRequestMetadata:
      type: object
      required:
        - subject
        - fromApplication
      properties:
        subject:
          type: string
          description: Subject to be displayed in the email notification.
          minLength: 1
          maxLength: 78
        message:
          type: string
          description: Body of the email message.
          minLength: 1
          maxLength: 100000
        templateId:
          type: string
          description: Id of the template to be used for message
          maxLength: 50
        templateParams:
          type: array
          items:
            type: object
            additionalProperties: {}
            maxProperties: 50
            example: {"FactoryName": "MachineFactory"}
          maxItems: 50
        fromApplication:
          $ref: '#/components/schemas/FromApplication'
        priority:
          type: string
          enum:
            - Low
            - Normal
            - High
          description: Optional priority to be requested for the email notification.
          default: Normal
        recipients:
          type: array
          items:
            $ref: '#/components/schemas/Email'
          minItems: 1
          maxItems: 50
        broadcastGroup:
          type: object
          description: The group of users within the calling tenant to whom the email is to be sent.
          properties:
            broadcastType:
              type: string
              enum:
                - TenantMembersOnly
                - TenantAdminsOnly
                - SubTenantMembersOnly
                - All
              description: |
                Type of broadcast -

                1. **TenantMembersOnly** - all members (including admins) under the calling tenant; sub-tenant members are not included.

                2. **TenantAdminsOnly** - all admins under the calling tenant.

                3. **SubTenantMembersOnly** - all members (including admins) under a sub-tenant specified by the parameter 'subTenantId', under the calling tenant. The sub-tenant id is mandatory if this broadcast type is selected.

                4. **All** - all members under the calling tenant and associated sub-tenants.
            subTenantId:
              type: string
              description: The sub-tenant id which identifies a sub-tenant within the calling tenant. This parameter should be specified if **subTenantMembersOnly** is used as broadcast type. The success of the mails sent in this case depends on the correctness of the value of the subTenantId provided in the request. The notification job is rejected if the specified sub-tenant is not found in the system.
              minLength: 4
              maxLength: 255
        sendEncrypted:
          description: Flag to request sending encrypted email to all the recipients. An S/MIME encrypted e-mail will be sent only if PEM certificates for all the recipients are stored in EmailEncryptionCertificates store.
          type: boolean
          default: false

    MulticastSMSNotificationJob:
      type: object
      properties:
        id:
          type: string
          description: Job ID of the triggered request
          example: '59f92744-7bbc-4540-8b78-ee9976befc1a'
        fromApplication:
          type: string
          description: Source application which triggered the SMS Notification request.
          example: 'MachineMonitor'
        status:
          type: string
          enum:
            - queued
            - dispatched
            - failed
          description: >
            Provides status of the sms job request.
            <table>
              <tr>
                <th>Status</th>
                <th>Description</th>
              </tr>
              <tr>
                <td>queued</td>
                <td>SMS job request is received by the system.</td>
              </tr>
              <tr>
                <td>dispatched</td>
                <td>SMS job request is processed successfully. NOTE: The status "dispatched" does not guarantee successful delivery because of potential failures arising from downstream systems. </td>
              </tr>
              <tr>
                <td>failed</td>
                <td>Failed to dispatch the sms job, due to errors arising from downstream systems. No SMS is sent. The sender is requested to create a new sms job request.</td>
              </tr>
            </table>
          example: 'queued'
        startTime:
          type: string
          description: Time when the job was created.
          example: '2017-07-21T17:32:28.000Z'

    MulticastSMSNotificationJobs:
      type: object
      properties:
        multicastSMSNotificationJobs:
          type: array
          items:
            $ref: '#/components/schemas/MulticastSMSNotificationJob'
        page:
          $ref: '#/components/schemas/Page'

    EmailNotificationJobResponseList:
      type: object
      properties:
        emailNotificationJobs:
          type: array
          items:
            $ref: '#/components/schemas/EmailNotificationJobResponseDetailed'
        page:
          $ref: '#/components/schemas/Page'

    EmailNotificationJobResponse:
      type: object
      required:
        - id
        - status
        - startTime
        - fromApplication
      properties:
        id:
          type: string
          description: Job ID of the triggered request
          example: '59f92744-7bbc-4540-8b78-ee9976befc1a'
        fromApplication:
          type: string
          description: Source application which triggered the Email Notification request.
          example: 'MachineMonitor'
        status:
          type: string
          enum:
            - Queued
            - InProgress
            - Dispatched
            - DispatchedWithFailures
            - Failed
          description: >
            Provides status of the email job request.
            <table>
              <tr>
                <th>Status</th>
                <th>Description</th>
              </tr>
              <tr>
                <td>Queued</td>
                <td>Email job request is received by the system.</td>
              </tr>
              <tr>
                <td>InProgress</td>
                <td>Email job request is being processed. In case of attachments, email will be dispatched post scanning.</td>
              </tr>
              <tr>
                <td>Dispatched</td>
                <td>Email job request is processed successfully. NOTE: The status "dispatched" does not guarantee successful delivery because of potential failures arising from downstream systems. This status might change to "dispatchedWithFailures" in case the delivery was not successful to some of the recipients.</td>
              </tr>
              <tr>
                <td>DispatchedWithFailures</td>
                <td>The system will set this status in two cases:
              <li>Attachments are found to be infected. In this case the email is sent without attachments.</li>
              <li>Delivery to some of the recipients failed.</li></td>
              </tr>
              <tr>
                <td>Failed</td>
                <td>Failed to dispatch the email job, due to errors arising from downstream systems. No email is sent. The sender is requested to create a new email job request.</td>
              </tr>
            </table>
          example: 'Queued'
        startTime:
          type: string
          description: Time when the job was created.
          example: '2021-04-21T17:32:28.00'
          format: date-time

    EmailNotificationJobResponseDetailed:
      type: object
      required:
        - id
        - status
        - startTime
        - fromApplication
      properties:
        id:
          type: string
          description: Job ID of the triggered request
          example: '59f92744-7bbc-4540-8b78-ee9976befc1a'
        fromApplication:
          type: string
          description: Source application which triggered the Email Notification request.
          example: 'MachineMonitor'
        status:
          type: string
          enum:
            - Queued
            - InProgress
            - Dispatched
            - DispatchedWithFailures
            - Failed
          description: >
            Provides status of the email job request.
            <table>
              <tr>
                <th>Status</th>
                <th>Description</th>
              </tr>
              <tr>
                <td>Queued</td>
                <td>Email job request is received by the system.</td>
              </tr>
              <tr>
                <td>InProgress</td>
                <td>Email job request is being processed. In case of attachments, email will be dispatched post scanning.</td>
              </tr>
              <tr>
                <td>Dispatched</td>
                <td>Email job request is processed successfully. NOTE: The status "dispatched" does not guarantee successful delivery because of potential failures arising from downstream systems. This status might change to "dispatchedWithFailures" in case the delivery was not successful to some of the recipients.</td>
              </tr>
              <tr>
                <td>DispatchedWithFailures</td>
                <td>The system will set this status in two cases:
              <li>Attachments are found to be infected. In this case the email is sent without attachments.</li>
              <li>Delivery to some of the recipients failed.</li></td>
              </tr>
              <tr>
                <td>Failed</td>
                <td>Failed to dispatch the email job, due to errors arising from downstream systems. No email is sent. The sender is requested to create a new email job request.</td>
              </tr>
            </table>
          example: 'DispatchedWithFailures'
        startTime:
          type: string
          description: Time when the job was created.
          example: '2021-04-21T17:32:28.00'
          format: date-time
        maliciousAttachments:
          description: Details of the files that failed scanning.
          type: array
          items:
            $ref: '#/components/schemas/ScanDetail'
          readOnly: true

    MulticastEmailNotificationJob:
      type: object
      required:
        - id
        - fromApplication
        - status
        - startTime
      properties:
        id:
          type: string
          description: Job ID of the triggered request
          example: '59f92744-7bbc-4540-8b78-ee9976befc1a'
        fromApplication:
          type: string
          description: Source application which triggered the Email Notification request.
          example: 'MachineMonitor'
        status:
          type: string
          enum:
            - queued
            - dispatched
            - dispatchedWithFailures
            - failed
          description: >
            Provides status of the email job request.
            <table>
              <tr>
                <th>Status</th>
                <th>Description</th>
              </tr>
              <tr>
                <td>queued</td>
                <td>Email job request is received by the system. In case of attachments, email will be dispatched post scanning</td>
              </tr>
              <tr>
                <td>dispatched</td>
                <td>Email job request is processed successfully. NOTE: The status "dispatched" does not guarantee successful delivery because of potential failures arising from downstream systems. This status might change to "dispatchedWithFailures" in case the delivery was not successful to some of the recipients.</td>
              </tr>
              <tr>
                <td>dispatchedWithFailures</td>
                <td>The system will set this status in two cases:
              <li>Attachments are found to be infected. In this case the email is sent without attachments.</li>
              <li>Delivery to some of the recipients failed.</li></td>
              </tr>
              <tr>
                <td>failed</td>
                <td>Failed to dispatch the email job, due to errors arising from downstream systems. No email is sent. The sender is requested to create a new email job request.</td>
              </tr>
            </table>
          example: 'queued'
        startTime:
          type: string
          format: date-time
          description: Time when the job was created.
          example: '2017-07-21T17:32:28.000Z'
        maliciousAttachments:
          description: Details of the files that failed scanning.
          type: array
          items:
            $ref: '#/components/schemas/ScanDetail'
          readOnly: true

    DispatchStatusSMS:
      type: object
      properties:
        recipient:
          type: string
        status:
          description: Conveys the notification delivery status to individual recipient. The status "dispatched" does not guarantee successful delivery, because of potential failures that may arise from downstream systems. This status might change to "failed" in case the delivery was not successful.
          type: string
          enum:
            - queued
            - dispatched
            - failed
          default: queued
        reason:
          type: string
          description: Conveys reason of failure for known validations. e.g. If recipients are from restricted region and not processed.

    DispatchStatus:
      type: object
      required:
        - recipient
        - status
      properties:
        recipient:
          type: string
          example: 'plantengineer@mdspcustomer.com'
        status:
          description: Conveys the notification delivery status to individual recipient. The status "dispatched" does not guarantee successful delivery, because of potential failures that may arise from downstream systems. This status might change to "failed" in case the delivery was not successful.
          type: string
          enum:
            - dispatched
            - failed
          example: 'failed'

    DeliveryStatus:
      type: object
      required:
        - recipient
        - status
      properties:
        recipient:
          $ref: '#/components/schemas/Email'
        status:
          description: Conveys the notification delivery status to individual recipient. The status "Dispatched" does not guarantee successful delivery, because of potential failures that may arise from downstream systems. This status might change to "Failed" in case the delivery was not successful.
          type: string
          enum:
            - Dispatched
            - Failed
          example: 'Failed'

    NotificationDispatchStatusSMS:
      type: object
      description: Shows the dispatch status of the notification per recipient.
      properties:
        dispatchStatus:
          type: array
          items:
            $ref: '#/components/schemas/DispatchStatusSMS'
          example:
            - recipient: '+411xxxxxxx9'
              status: 'dispatched'
            - recipient: '+911xxxxxxx9'
              status: 'failed'
              reason: 'Recipients from restricted region are not allowed.'
        page:
          $ref: '#/components/schemas/Page'

    NotificationDispatchStatus:
      type: object
      description: Shows the dispatch status of the notification per recipient.
      properties:
        deliveryStatus:
          type: array
          items:
            $ref: '#/components/schemas/DispatchStatus'
        page:
          $ref: '#/components/schemas/Page'

    EmailEncryptionCertificateModel:
      type: object
      required:
        - certificate
      properties:
        email:
          $ref: '#/components/schemas/Email'
          readOnly: true
        certificate:
          $ref: '#/components/schemas/Certificate'
        eTag:
          type: string
          description: "Identifies emailEncryptionCertificates state and can be used in conditional request."
          example: "1"
          readOnly: true

    EmailEncryptionCertificatePartialModel:
      type: object
      required:
        - email
      properties:
        email:
          $ref: '#/components/schemas/Email'

    Email:
      type: string
      example: plantengineer@mdspcustomer.com
      pattern: "^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+$"
      minLength: 3
      maxLength: 200
      readOnly: true
      description: Recipient email.

    Certificate:
      type: string
      description: Public certificate of the recipient.
      minLength: 100
      maxLength: 10000
      example: |
          "-----BEGIN CERTIFICATE-----
          MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL
          MAkGA1UECBMCUE4xCzAJBgNVBAcTAkNOMQswCQYDVQQKEwJPTjELMAkGA1UECxMC
          VU4xFDASBgNVBAMTC0hlcm9uZyBZYW5nMB4XDTA1MDcxNTIxMTk0N1oXDTA1MDgx
          NDIxMTk0N1owVzELMAkGA1UEBhMCQ04xCzAJBgNVBAgTAlBOMQswCQYDVQQHEwJD
          TjELMAkGA1UEChMCT04xCzAJBgNVBAsTAlVOMRQwEgYDVQQDEwtIZXJvbmcgWWFu
          ZzBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQCp5hnG7ogBhtlynpOS21cBewKE/B7j
          V14qeyslnr26xZUsSVko36ZnhiaO/zbMOoRcKK9vEcgMtcLFuQTWDl3RAgMBAAGj
          gbEwga4wHQYDVR0OBBYEFFXI70krXeQDxZgbaCQoR4jUDncEMH8GA1UdIwR4MHaA
          FFXI70krXeQDxZgbaCQoR4jUDncEoVukWTBXMQswCQYDVQQGEwJDTjELMAkGA1UE
          CBMCUE4xCzAJBgNVBAcTAkNOMQswCQYDVQQKEwJPTjELMAkGA1UECxMCVU4xFDAS
          BgNVBAMTC0hlcm9uZyBZYW5nggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEE
          BQADQQA/ugzBrjjK9jcWnDVfGHlk3icNRq0oV7Ri32z/+HQX67aRfgZu7KWdI+Ju
          Wm7DCfrPNGVwFWUQOmsPue9rZBgO
          -----END CERTIFICATE-----"

    EmailEncryptionCertificatesList:
      type: object
      description: List of recipients for whom certificates are stored in system.
      required:
        - emailEncryptionCertificates
      properties:
        emailEncryptionCertificates:
          type: array
          items:
            $ref: '#/components/schemas/EmailEncryptionCertificatePartialModel'
        page:
          $ref: '#/components/schemas/Page'

    NotificationDeliveries:
      type: object
      required:
        - deliveries
      description: Shows the delivery status of the notification per recipient.
      properties:
        deliveries:
          type: array
          items:
            $ref: '#/components/schemas/DeliveryStatus'
        page:
          $ref: '#/components/schemas/Page'

    BouncedEmail:
      type: object
      required:
        - email
        - blacklistedDate
      properties:
        email:
          $ref: '#/components/schemas/Email'
        blacklistedDate:
          type: string
          description: Date on which the email got blacklisted.
          format: date
          example: '2018-12-11'

    BouncedRecipients:
      type: object
      required:
        - bouncedRecipients
      properties:
        bouncedRecipients:
          type: array
          items:
            $ref: '#/components/schemas/BouncedEmail'
        page:
          $ref: '#/components/schemas/Page'

    PushMessageModel:
      type: object
      properties:
        title:
          type: string
          description: Provide locale specific title for the push notification as described in the example.
          example: "{ \"en\": \"Siemens MindSphere March 2019\", \"de\": \"Siemens MindSphere März 2019\"}"
        text:
          type: string
          example: "{ \"en\": \"Hi there, Welcome to MindSphere!\", \"de\": \"Hallo, Willkommen bei MindSphere!\"}"
          description: Provide locale specific text message for the push notification as described in the example.

    Errors:
      type: object
      description: Error response body model.
      properties:
        errors:
          type: array
          description: "Concrete error codes and messages are defined at operation error response descriptions in this API specification."
          items:
            type: object
            properties:
              code:
                type: string
                description: "Unique error code. Every code is bound to one (parametrized) message."
                example: "mdsp.core.notification.exampleCode"
              logref:
                type: string
                description: "Logging correlation ID for debugging purposes."
                example: "0bff7e7a-cd25-4576-9908-4180ef086174"
              message:
                type: string
                description: "Human readable error message in English."
                example: "Example error message with parameter value 100"
              messageParameters:
                type: array
                description: |
                  In case an error message is parametrized, the parameter names and values are returned for, e.g., localization purposes. The parametrized error messages are defined at the operation error response descriptions in this API specification. Parameters are denoted by named placeholders '{\<parameter name\>}' in the message specifications. At runtime, returned message placeholders are substituted by actual parameter values.
                items:
                  type: object
                  description: "Message parameter"
                  properties:
                    name:
                      type: string
                      description: "Name of message parameter as specified in parametrized error message."
                    value:
                      type: string
                      description: "Value of message parameter as substituted in returned error message."
                example:
                  - { "name": "exampleParameterName", "value": "100" }

    Page:
      type: object
      properties:
        size:
          type: integer
        totalElements:
          type: integer
        totalPages:
          type: integer
        number:
          type: integer

    FromApplication:
      type: string
      description: Source application which triggered the Email Notification request. This name should match with the registered application name of host tenant.
      minLength: 1
      maxLength: 20

    CreateTemplate:
      type: object
      required:
        - name
        - type
      properties:
        name:
          type: string
          description: Name of the template
          example: "FactoryAlertTemplate"
          minLength: 1
          maxLength: 100
        id:
          type: string
          example: 0bff7e7a-cd25-4576-9908-4180ef086174
          minLength: 1
          maxLength: 50
          readOnly: true
        templateFileName:
          type: string
          example: "FactoryNotificationTemplate.html"
          minLength: 1
          maxLength: 200
          readOnly: true
        params:
          type: array
          items:
            type: object
            additionalProperties: {}
            maxProperties: 50
            example: {"FactoryName": "MachineFactory"}
            description: List of parameters or placeholders used in template. Optionally, you may specify the default value of the parameter in the template definition, eg "MachineFactory". If default value is not to be provided specify "".
          maxItems: 50
        type:
          type: string
          enum:
            - "Email"
            - "SMS"
            - "Push"
        eTag:
          type: string
          readOnly: true
          example: "1"
          maxLength: 50

    CreateTemplates:
      type: object
      properties:
        Templates:
          type: array
          items:
            $ref: '#/components/schemas/CreateTemplate'
        page:
          $ref: '#/components/schemas/Page'

  parameters:
    page:
      name: page
      in: query
      schema:
        type: integer
        default: 0
      description: Specifies the requested page index
    size:
      name: size
      in: query
      schema:
        type: integer
        default: 10
      description: Specifies the number of elements in a page. Maximum size value allowed is 50.
    email:
      name: email
      in: path
      required: true
      schema:
        type: string
        pattern: "^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+$"
        minLength: 3
        maxLength: 200

  securitySchemes:
    mobilepush:
      type: oauth2
      description: |
        For **Xcelerator** compliance, please use **authorizationUrl** = https://1000001700.eu1.sws.siemens.com/oauth/authorize and **tokenUrl** = https://1000001700.eu1.sws.siemens.com/oauth/token
      flows:
        authorizationCode:
          authorizationUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/authorize'
          tokenUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/token'
          scopes:
            nose.pn.r: Read push notification jobs
            nose.pn.w: Create push notification jobs
    mobileapps:
      type: oauth2
      description: |
        For **Xcelerator** compliance, please use **authorizationUrl** = https://1000001700.eu1.sws.siemens.com/oauth/authorize and **tokenUrl** = https://1000001700.eu1.sws.siemens.com/oauth/token
      flows:
        authorizationCode:
          authorizationUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/authorize'
          tokenUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/token'
          scopes:
            nose.ma.r: Read mobile app registrations
            nose.ma.w: Create, update and delete mobile app registrations
    appInstances:
      type: oauth2
      description: |
        For **Xcelerator** compliance, please use **authorizationUrl** = https://1000001700.eu1.sws.siemens.com/oauth/authorize and **tokenUrl** = https://1000001700.eu1.sws.siemens.com/oauth/token
      flows:
        authorizationCode:
          authorizationUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/authorize'
          tokenUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/token'
          scopes:
            nose.ai.r: Read mobile app instance registrations
            nose.ai.w: Create, update and delete mobile app instance registrations
    email:
      type: oauth2
      description: |
        For **Xcelerator** compliance, please use **authorizationUrl** = https://1000001700.eu1.sws.siemens.com/oauth/authorize and **tokenUrl** = https://1000001700.eu1.sws.siemens.com/oauth/token
      flows:
        authorizationCode:
          authorizationUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/authorize'
          tokenUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/token'
          scopes:
            nose.em.r: Read email notification jobs
            nose.em.w: Create email notification jobs, manage email admin operations like certificate upload
    sms:
      type: oauth2
      description: |
        For **Xcelerator** compliance, please use **authorizationUrl** = https://1000001700.eu1.sws.siemens.com/oauth/authorize and **tokenUrl** = https://1000001700.eu1.sws.siemens.com/oauth/token
      flows:
        authorizationCode:
          authorizationUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/authorize'
          tokenUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/token'
          scopes:
            nose.sm.r: Read SMS notification jobs
            nose.sm.w: Send SMS notification.
