openapi: 3.0.0
info:
  description: 'Free temporary Email Address te beat spam and harmful stuff'
  # license:
  #   name: 'MIT'
  #   url: 'https://opensource.org/licenses/MIT'

  version: 1.0.0
  title: ShyMail
tags:
  - name: inbox
    description: Access to inbox
  - name: email
    description: Access to email
  - name: domain
    description: Access to currently used domains
paths:
  /inbox/{address}:
    get:
      tags:
        - inbox
      summary: Get emails for certain address
      description: ''
      operationId: addPet
      parameters:
        - name: address
          in: path
          required: true
          schema:
            type: string
            example: 'aegon@shy.my.id'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Inbox'

  /email/{messageId}:
    get:
      tags:
        - email
      summary: Get email
      description: ''
      operationId: getMessage
      parameters:
        - name: messageId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailFull'
  /domain:
    get:
      tags:
        - domain
      summary: Get domains
      description: ''
      operationId: getDomains

      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Domains'

externalDocs:
  description: Find out more about Swagger
  url: http://swagger.io
servers:
  - url: https://api.shy.my.id
components:
  schemas:
    Email:
      type: object
      properties:
        id:
          type: string
          example: '631c0235071e16df6e2e6e13'
        date:
          type: string
          example: Sat, 10 Sep 2022 03:18:52 +0000
        from:
          type: string
          example: 'MongoDB Cloud <mongodb-account@mongodb.com>'
        to:
          type: array
          items: {}
          example:
            - aegon@shy.my.id
        subject:
          type: string
          example: 'MongoDB Cloud: Your MongoDB Cloud Account'
        bodyPreview:
          type: string
          example: 'Email Address Verification \r\n\r\n Verify Email https://account.mongodb.com/account/verify/email/aegon%40shy.my.id/39af5b93391afd78c96ae60182be2d277b68ca'
        isSeen:
          type: boolean
          example: false
        createdAt:
          type: integer
          description: Unix timestamp of when the email is saved in the database
          example: 1662779957
    EmailFull:
      type: object
      properties:
        id:
          type: string
          example: '631c0235071e16df6e2e6e13'
        date:
          type: string
          example: Sat, 10 Sep 2022 03:18:52 +0000
        from:
          type: string
          example: 'MongoDB Cloud <mongodb-account@mongodb.com>'
        to:
          type: array
          items: {}
          example:
            - aegon@shy.my.id
        subject:
          type: string
          example: 'MongoDB Cloud: Your MongoDB Cloud Account'
        bodyPreview:
          type: string
          example: 'Email Address Verification \r\n\r\n Verify Email https://account.mongodb.com/account/verify/email/aegon%40shy.my.id/39af5b93391afd78c96ae60182be2d277b68ca'
        body:
          type: string
          example: 'Email Address Verification \r\n\r\n Verify Email https://account.mongodb.com/account/verify/email/aegon%40shy.my.id/39af5b93391afd78c96ae60182be2d277b68ca'
        isSeen:
          type: boolean
          example: false
        createdAt:
          type: integer
          description: Unix timestamp of when the email is saved in the database
          example: 1662779957
    Inbox:
      type: object
      properties:
        status:
          type: integer
          example: 200
          format: int64
        message:
          type: string
          example: OK
          format: text
        data:
          type: array
          items:
            $ref: '#/components/schemas/Email'
    Domains:
      type: array
      items:
        type: string
        example: 'shy.my.id'
