openapi: 3.0.3
info:
  title: hipchat-sns-bridge
  version: 1.0.0
  description: Hipchat to Amazon SNS bridge.
servers:
- url: http://hipchat-sns-bridge.common.giltaws.com
paths:
  /hipchat/capabilities:
    get:
      parameters:
      - name: redirect_to_hipchat_install
        in: query
        description: Whether to redirect to Hipchat install with Base64 encoded data.
        required: true
        schema:
          type: boolean
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComTeambytesHipchatSnsBridgeV1ModelsHipchatCapabilitiesDescriptor'
  /hipchat/installable:
    get:
      parameters:
      - name: installable_url
        in: query
        required: true
        schema:
          type: string
      - name: redirect_url
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComTeambytesHipchatSnsBridgeV1ModelsHipchatCapabilitiesDescriptor'
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ComTeambytesHipchatSnsBridgeV1ModelsHipchatInstallData'
        required: true
      responses:
        '200':
          description: Successful response
  /hipchat/installable/{oauthId}:
    delete:
      parameters:
      - name: oauthId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
  /hipchat/room/{roomId}/notification:
    post:
      parameters:
      - name: roomId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ComTeambytesHipchatSnsBridgeV1ModelsSnsNotification'
        required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: string
  /info:
    get:
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComTeambytesHipchatSnsBridgeV1ModelsServiceInfo'
components:
  schemas:
    ComTeambytesHipchatSnsBridgeV1ModelsServiceInfo:
      type: object
      required:
      - name
      - version
      - scala_version
      - sbt_version
      - build_time
      properties:
        name:
          description: Name of this service.
          type: string
        version:
          description: Version of this service.
          type: string
        scala_version:
          description: Version of Scala this service is using.
          type: string
        sbt_version:
          description: Version of SBT used to build this service.
          type: string
        build_time:
          description: Time the service was built at.
          type: string
          format: date-time
    ComTeambytesHipchatSnsBridgeV1ModelsHipchatApiConsumer:
      type: object
      required:
      - scopes
      properties:
        scopes:
          description: An array of scopes that are required to consume the HipChat
            API.
          type: array
          items:
            $ref: '#/components/schemas/ComTeambytesHipchatSnsBridgeV1EnumsHipchatScope'
        fromName:
          description: The name that messages should be from when sent from the integration
            itself.
          type: string
    ComTeambytesHipchatSnsBridgeV1ModelsSnsNotification:
      type: object
      required:
      - Type
      - MessageId
      - TopicArn
      - Message
      - Timestamp
      - SignatureVersion
      - Signature
      - SigningCertURL
      properties:
        Type:
          description: The type of message. For a unsubscribe confirmation, the type
            is UnsubscribeConfirmation.
          type: string
        MessageId:
          description: A Universally Unique Identifier, unique for each message published.
            For a message that Amazon SNS resends during a retry, the message ID of
            the original message is used.
          type: string
        TopicArn:
          description: The Amazon Resource Name (ARN) for the topic that this endpoint
            has been unsubscribed from.
          type: string
        Message:
          description: A string that describes the message.
          type: string
        Timestamp:
          description: The time (GMT) when the unsubscribe confirmation was sent.
          type: string
        SignatureVersion:
          description: Version of the Amazon SNS signature used.
          type: string
        Signature:
          description: Base64-encoded 'SHA1withRSA' signature of the Message, MessageId,
            Type, Timestamp, and TopicArn values.
          type: string
        SigningCertURL:
          description: The URL to the certificate that was used to sign the message.
          type: string
        Token:
          description: A value you can use with the ConfirmSubscription action to
            re-confirm the subscription. Alternatively, you can simply visit the SubscribeURL.
          type: string
        Subject:
          description: The Subject parameter specified when the notification was published
            to the topic. Note that this is an optional parameter. If no Subject was
            specified, then this name/value pair does not appear in this JSON document.
          type: string
        SubscribeURL:
          description: The URL that you must visit in order to re-confirm the subscription.
            Alternatively, you can instead use the Token with the ConfirmSubscription
            action to re-confirm the subscription.
          type: string
        UnsubscribeURL:
          description: A URL that you can use to unsubscribe the endpoint from this
            topic. If you visit this URL, Amazon SNS unsubscribes the endpoint and
            stops sending notifications to this endpoint.
          type: string
    ComTeambytesHipchatSnsBridgeV1ModelsHipchatInstallData:
      type: object
      required:
      - capabilitiesUrl
      - oauthId
      - oauthSecret
      - groupId
      properties:
        capabilitiesUrl:
          type: string
        oauthId:
          type: string
        oauthSecret:
          type: string
        groupId:
          type: integer
          format: int64
        roomId:
          type: string
    ComTeambytesHipchatSnsBridgeV1ModelsHipchatConfigurationPage:
      type: object
      required:
      - url
      properties:
        allowAccessToRoomAdmins:
          description: If the add-on is installed globally, this property can allow
            the configuration page to be accessed in the room administration pages
            making it possible to have room specific configuration for the global
            add-on. This is only valid for globally installed add-ons.
          type: string
        url:
          description: The URL to embed into a configure dialog via an iframe.
          type: string
    ComTeambytesHipchatSnsBridgeV1ModelsHipchatCapabilitiesDescriptor:
      type: object
      required:
      - name
      - description
      - key
      - links
      properties:
        name:
          description: The display name of this application.
          type: string
        description:
          description: A short description of this application.
          type: string
        key:
          description: The marketplace integration key that uniquely identifies the
            application, if registered.
          type: string
        apiVersion:
          description: The HipChat Connect API version used by this integration. Defaults
            to 1:1.
          type: string
        capabilities:
          $ref: '#/components/schemas/ComTeambytesHipchatSnsBridgeV1ModelsHipchatCapabilities'
          description: The set of capabilities this application supports.
        links:
          $ref: '#/components/schemas/ComTeambytesHipchatSnsBridgeV1ModelsHipchatLinks'
          description: URLs to retrieve this and related integration information.
        vendor:
          $ref: '#/components/schemas/ComTeambytesHipchatSnsBridgeV1ModelsHipchatVendor'
          description: The vendor that maintains this application.
    ComTeambytesHipchatSnsBridgeV1ModelsHipchatCapabilities:
      type: object
      properties:
        configurable:
          $ref: '#/components/schemas/ComTeambytesHipchatSnsBridgeV1ModelsHipchatConfigurationPage'
          description: Most integrations will need to be configured in order to work
            correctly. For this purpose, an integration can expose a 'configurable'
            capability that provides an HTML page to be included as a panel in the
            configuration dialog.
        hipchatApiConsumer:
          $ref: '#/components/schemas/ComTeambytesHipchatSnsBridgeV1ModelsHipchatApiConsumer'
          description: The ability to consume the HipChat API.
        installable:
          $ref: '#/components/schemas/ComTeambytesHipchatSnsBridgeV1ModelsHipchatInstallable'
          description: The capability of receiving a synchronous installation callback
            during integration installation.
        oauth2Provider:
          $ref: '#/components/schemas/ComTeambytesHipchatSnsBridgeV1ModelsHipchatOauth2Provider'
          description: The capability of providing and accepting OAuth 2 tokens for
            authentication.
    ComTeambytesHipchatSnsBridgeV1ModelsHipchatLinks:
      type: object
      required:
      - self
      properties:
        homepage:
          description: The URL to human-viewable home page of this integration.
          type: string
        api:
          description: The URL to the REST API root.
          type: string
        self:
          description: The URL to this descriptor.
          type: string
    ComTeambytesHipchatSnsBridgeV1ModelsError:
      description: A request semantic failure reason.
      type: object
      required:
      - description
      properties:
        description:
          type: string
    ComTeambytesHipchatSnsBridgeV1ModelsHipchatInstallable:
      type: object
      properties:
        callbackUrl:
          description: The URL to receive a confirmation of an integration installation.
          type: string
        installedUrl:
          description: The URL HipChat will redirect to post-installation.
          type: string
        allowGlobal:
          description: Whether the integration can be installed globally or not.
          type: boolean
        allowRoom:
          description: Whether the integration can be installed in a room or not.
          type: boolean
    ComTeambytesHipchatSnsBridgeV1ModelsHipchatVendor:
      type: object
      required:
      - name
      - url
      properties:
        name:
          description: The vendor display name.
          type: string
        url:
          description: The vendor's home page URL.
          type: string
    ComTeambytesHipchatSnsBridgeV1ModelsHipchatOauth2Provider:
      type: object
      properties:
        tokenUrl:
          description: The OAuth 2 token endpoint for retrieving an access token.
          type: string
        authorizationUrl:
          description: The OAuth 2 endpoint to direct browsers to in order to receive
            an authorization code that can be later exchanged using the token URL
            for an access token.
          type: string
    ComTeambytesHipchatSnsBridgeV1EnumsHipchatScope:
      description: Your add-on must declare the scopes it requires based on which
        API endpoints it needs to use, via its descriptor.
      type: string
      enum:
      - send_message
      - send_notification
