{
  "openapi": "3.0.1",
  "info": {
    "title": "ServiceBus API",
    "version": "1.0",
    "description": "ServiceBus API provides operations for sending and receiving messages to and from Azure ServiceBus (AzSB).",
    "termsOfService": "https://lvsc-developer.venetianlasvegas.com/terms/",
    "contact": {
      "email": "api-team@venetian.com"
    },
    "license": {
      "name": "VLV Developer 1.0",
      "url": "https://lvsc-developer.venetianlasvegas.com/licenses/LICENSE-1.0.html"
    }
  },
  "servers": [
    {
      "url": "https://vlv-proxy-api-dev.venetianlasvegasdev.com/api/v1",
      "description": "Dev environment v1"
    },
    {
      "url": "https://vlv-proxy-api-tst.venetianlasvegasdev.com/api/v1",
      "description": "Test environment v1"
    },
    {
      "url": "https://vlv-proxy-api-prd.venetianlasvegas.com/api/v1",
      "description": "Prod environment v1"
    }
  ],
  "tags": [
    {
      "name": "ServiceBus API",
      "description": "ServiceBus API provides operations for sending and receiving messages to and from Azure ServiceBus (AzSB)."
    },
    {
      "name": "Ping",
      "description": "Ping operation to test api responsiveness."
    }
  ],
  "paths": {
    "/servicebus/ping": {
      "get": {
        "tags": [
          "Ping"
        ],
        "operationId": "ping",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/servicebus/{appName}/sendmessage/{topicId}": {
      "post": {
        "tags": [
          "ServiceBus API"
        ],
        "operationId": "ServiceBussendmessage",
        "summary": "Publish message to Azure ServiceBus topic",
        "description": "Publish message to Azure ServiceBus topic. The request payload is an object and differs for each application. See following sample payload for Gigya webhook.<br>{<br>&nbsp; \"events\": [<br>&nbsp;&nbsp; { <br>&nbsp;&nbsp;&nbsp;\"type\": \"accountUpdated\", <br>&nbsp;&nbsp;&nbsp;\"id\": \"XXXX0b84-5b2d-4ddf-9210-63922ca9a760\", <br>&nbsp;&nbsp;&nbsp;\"timestamp\": 1745520970, <br>&nbsp;&nbsp;&nbsp;\"callId\": \"XXXX0d7f86d0415dbc05e03d5fcea926\", <br>&nbsp;&nbsp;&nbsp;\"version\": \"2.0\", <br>&nbsp;&nbsp;&nbsp;\"apiKey\": \"Za\", <br>&nbsp;&nbsp;&nbsp;\"data\": { <br>&nbsp;&nbsp;&nbsp;&nbsp;\"accountType\": \"full\", <br>&nbsp;&nbsp;&nbsp;&nbsp;\"apiKey\": \"WfTXZa\", <br>&nbsp;&nbsp;&nbsp;&nbsp;\"uid\": \"XXXX691b18ef49e2b1d8cb8654a77d1f\" <br>&nbsp;&nbsp;&nbsp;} <br>&nbsp;&nbsp;} <br>&nbsp;], <br>&nbsp;\"nonce\": \"XXXXc9bc-11ac-4a47-af5d-118383476b14\", <br>&nbsp;\"timestamp\": 1745520972 <br>}",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "appName",
            "in": "path",
            "required": true,
            "example": "offermanager",
            "description": "Name of the application that uses ServiceBus API to publish messages to Azure ServiceBus topic (i.e. offermanager).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "topicId",
            "in": "path",
            "required": true,
            "example": "offermanagertopic",
            "description": "ServiceBus Topic ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Message to be published to Azure ServiceBus topic",
                "example": "{\n\t \"events\": [\n\t\t { \n\t\t\t\"type\": \"accountUpdated\", \n\t\t\t\"id\": \"XXXX0b84-5b2d-4ddf-9210-63922ca9a760\", \n\t\t\t\"timestamp\": 1745520970, \n\t\t\t\"callId\": \"XXXX0d7f86d0415dbc05e03d5fcea926\", \n\t\t\t\"version\": \"2.0\", \n\t\t\t\"apiKey\": \"Za\", \n\t\t\t\"data\": { \n\t\t\t\t\"accountType\": \"full\", \n\t\t\t\t\"apiKey\": \"WfTXZa\", \n\t\t\t\t\"uid\": \"XXXX691b18ef49e2b1d8cb8654a77d1f\" \n\t\t\t} \n\t\t} \n\t], \n\t\"nonce\": \"XXXXc9bc-11ac-4a47-af5d-118383476b14\", \n\t\"timestamp\": 1745520972 \n}"
              }
            },
            "application/xml": {
              "schema": {
                "type": "object",
                "description": "Message to be published to Azure ServiceBus topic"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/apiResponses"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/apiResponses"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/apiResponses"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/apiResponses"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/apiResponses"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/apiResponses"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/apiResponses"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/apiResponses"
                }
              }
            }
          },
          "500": {
            "description": "System Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/apiResponses"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/apiResponses"
                }
              }
            }
          }
        }
      }
    },
    "/servicebus/{appName}/getmessage/{topicId}": {
      "post": {
        "tags": [
          "ServiceBus API"
        ],
        "operationId": "ServiceBusgetmessage",
        "summary": "Retrieve message from Azure ServiceBus topic",
        "description": "Retrieve message from Azure ServiceBus topic.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "appName",
            "in": "path",
            "required": true,
            "example": "offermanager",
            "description": "Name of the application that uses ServiceBus API to pull messages from Azure ServiceBus subscription (i.e. offermanager).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "topicId",
            "in": "path",
            "required": true,
            "example": "offermanagertopic",
            "description": "ServiceBus topic ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PullMessageRequest"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/PullMessageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/apiResponses"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/apiResponses"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/apiResponses"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/apiResponses"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/apiResponses"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/apiResponses"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/apiResponses"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/apiResponses"
                }
              }
            }
          },
          "500": {
            "description": "System Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/apiResponses"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/apiResponses"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PullMessageRequest": {
        "type": "object",
        "required": [ "maxMessages", "acknowledge" ],
        "properties": {
          "maxMessages": {
            "type": "integer",
            "description": "No. of messages to pull",
            "format": "int32",
            "example": "1"
          },
          "acknowledge": {
            "type": "boolean",
            "description": "Set to true to acknowledge the message."
          }
        },
        "additionalProperties": false
      },
      "apiResponses": {
        "xml": {
          "name": "ArrayOfApiResponse",
          "wrapped": true
        },
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/apiResponse"
        }
      },
      "apiResponse": {
        "xml": {
          "name": "ApiResponse"
        },
        "type": "object",
        "properties": {
          "code": {
            "xml": {
              "name": "Code"
            },
            "type": "integer",
            "format": "int32",
            "example": 123,
            "description": "Response code."
          },
          "responseType": {
            "xml": {
              "name": "ResponseType"
            },
            "type": "string",
            "enum": [
              "Success",
              "Fail",
              "Warning"
            ],
            "example": "Success",
            "description": "Type of response."
          },
          "message": {
            "xml": {
              "name": "Message"
            },
            "type": "string",
            "example": "Operation Response Message"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}