swagger: "2.0"
info:
  version: 0.3.4
  title: "plex"
  description: "Cross-Schema Retrieval Microservice"
  termsOfService: "https://salesforcedevops.net/terms/"
  contact:
    email: "vern@vernonkeenan.com"
  license:
    name: "Proprietary - Copyright (c) 2018-2024 by Vernon Keenan"
securityDefinitions:
  ApiKeyAuth:
    type: "apiKey"
    in: "header"
    name: "X-API-Key"
schemes:
  - "https"
basePath: "/vk/plex/v1"
host: "gw.tnxs.net"
consumes:
  - "application/json"
produces:
  - "application/json"
parameters:
  slugQuery:
    description: The slug of the item to retrieve
    in: query
    name: slug
    required: false
    type: string
  CompanyIdQuery:
    description: Record Id of an Company
    in: query
    name: companyId
    required: false
    type: string
  ChannelQuery:
    description: The channel to filter companies by
    in: query
    name: channel
    required: false
    type: string
  limitQuery:
    description: "How many objects to return at one time"
    format: int64
    in: query
    name: limit
    required: false
    type: integer
  offsetQuery:
    description: How many objects to skip?
    format: int64
    in: query
    name: offset
    required: false
    type: integer
responses:
  AccessForbidden:
    description: "Access forbidden, Company lacks access"
    schema:
      $ref: "#/definitions/Error"
  InvalidDataError:
    description: Invalid data was sent
    schema:
      $ref: "#/definitions/InvalidError"
  NotFound:
    description: Resource was not found
    headers:
      Access-Control-Allow-Origin:
        type: string
    schema:
      $ref: "#/definitions/Error"
  ServerError:
    description: Server Internal Error
    headers:
      Access-Control-Allow-Origin:
        type: string
    schema:
      $ref: "#/definitions/Error"
  Unauthorized:
    description: "Access unauthorized, invalid API-KEY was used"
    schema:
      $ref: "#/definitions/Error"
  UnprocessableEntity:
    description: "Unprocessable Entity, likely a bad parameter"
    schema:
      $ref: "#/definitions/Error"
  CompanyResponse:
    description: The SalesforceDevops.net Company Object
    schema:
      $ref: "#/definitions/CompanyResponse"
paths:
  /companies:
    get:
      description: Return all or a single company fully hydrated object
      operationId: getCompanies
      parameters:
        - $ref: "#/parameters/CompanyIdQuery"
        - $ref: "#/parameters/slugQuery"
        - $ref: "#/parameters/ChannelQuery"
      responses:
        "200":
          $ref: "#/responses/CompanyResponse"
        "401":
          $ref: "#/responses/Unauthorized"
        "403":
          $ref: "#/responses/AccessForbidden"
        "404":
          $ref: "#/responses/NotFound"
        "422":
          $ref: "#/responses/UnprocessableEntity"
        "500":
          $ref: "#/responses/ServerError"
      security:
        - ApiKeyAuth: []
      summary: Get a list of companies
      tags:
        - Companies
definitions:
  Address:
    properties:
      City:
        description: City
        type: string
        x-nullable: true
      Country:
        description: Country full name
        type: string
        x-nullable: true
      CountryCode:
        description: Country Code
        type: string
        x-nullable: true
      PostalCode:
        description: Postal Code
        type: string
        x-nullable: true
      State:
        description: State full name
        type: string
        x-nullable: true
      StateCode:
        description: State Code
        type: string
        x-nullable: true
      Street:
        description: Street number and name
        type: string
        x-nullable: true
    type: object
  Company:
    properties:
      ID:
        description: Company Id
        type: string
      AccountID:
        description: Account Id
        type: string
        x-nullable: true
      AccountNumber:
        description: Company Number
        type: string
        x-nullable: true
      AccountSource:
        description: The marketing origin of this Company
        type: string
        x-nullable: true
      Active:
        type: boolean
        x-nullable: true
      AnnualRevenue:
        x-nullable: true
        description: Annual Revenue Estimate
        format: double
        type: number
      AppExchange:
        x-nullable: true
        description: Salesforce AppExchange URL
        type: string
      CloudRevenueTotal:
        x-nullable: true
        type: number
      CloudType:
        x-nullable: true
        description: The type of cloud company
        type: string
      CloudYear:
        description: The year company started cloud revenue
        type: string
        x-nullable: true
      CrunchbaseURL:
        description: Company Crunchbase URL
        type: string
        x-nullable: true
      Description:
        description: Description of the Company
        type: string
        x-nullable: true
      EarningsCall:
        description: Earnings Call Date
        type: string
        x-nullable: true
      Email:
        description: Main Company Email
        type: string
        x-nullable: true
      EquityFunding:
        description: The amount of equity EquityFunding
        type: number
        x-nullable: true
      Facebook:
        description: Company Facebook URL
        type: string
        x-nullable: true
      Fax:
        description: Fax number
        type: string
        x-nullable: true
      FoundedDate:
        description: Date company founded
        type: string
        x-nullable: true
      FullDescription:
        description: Full Description of the Company
        type: string
        x-nullable: true
      IPODate:
        description: IPO Date
        type: string
        x-nullable: true
      ImageAltText:
        type: string
        x-nullable: true
      ImageURL:
        x-nullable: true
        type: string
      Industries:
        x-nullable: true
        description: Industries
        type: string
      Industry:
        x-nullable: true
        description: Industry
        type: string
      LinkedIn:
        x-nullable: true
        description: Company LinkedIn URL
        type: string
      ListingAddress:
        x-nullable: true
        $ref: "#/definitions/Address"
      Location:
        x-nullable: true
        description: Headquarters Location Description
        type: string
      Logo:
        x-nullable: true
        description: Company Logo URL
        type: string
      MarketCapitalization:
        x-nullable: true
        description: Market Capitalization
        type: number
      Name:
        x-nullable: true
        description: Company Name
        type: string
      NumberInvestments:
        x-nullable: true
        description: Number of Investments
        type: number
      NumberOfEmployees:
        x-nullable: true
        description: Employee Count Estimate
        format: int64
        type: number
      Ownership:
        x-nullable: true
        description: Ownership
        type: string
      ParentID:
        x-nullable: true
        description: Parent Company
        type: string
      Phone:
        x-nullable: true
        description: Phone
        type: string
      Publish:
        x-nullable: true
        description: Publish this record?
        type: boolean
      SalesforceFirst:
        x-nullable: true
        description: A Salesforce-First company?
        type: boolean
      Slug:
        x-nullable: true
        description: Slug
        type: string
      TagLine:
        x-nullable: true
        description: Company tagline
        type: string
      TickerSymbol:
        x-nullable: true
        description: Ticker Symbol
        type: string
      Twitter:
        x-nullable: true
        description: Twitter URL
        type: string
      Type:
        x-nullable: true
        description: Type
        type: string
      Website:
        x-nullable: true
        description: Website
        type: string
      YearStarted:
        x-nullable: true
        description: Year Started
        type: string
      Products:
        description: Company Products
        x-nullable: true
        type: array
        items:
          $ref: "#/definitions/Product"
      Services:
        description: Company Services
        x-nullable: true
        type: array
        items:
          $ref: "#/definitions/Service"
      FinancialStatements:
        description: Financial Statements
        x-nullable: true
        type: array
        items:
          $ref: "#/definitions/FinancialStatement"
      Categories:
        description: Company Categories
        x-nullable: true
        type: array
        items:
          $ref: "#/definitions/Category"
    type: object
  FinancialStatement:
    type: object
    description: A financial statement for a company
    properties:
      ID:
        description: Record Id
        type: string
      AccessNumber:
        x-nullable: true
        description: EDGAR Access Number
        type: string
      AccountID:
        x-nullable: true
        description: Account ID
        type: string
      CloudRevenue:
        x-nullable: true
        description: Cloud Revenue
        type: number
      CreatedByID:
        x-nullable: true
        description: Created By User ID
        type: string
      CreatedDate:
        x-nullable: true
        description: Created Date
        type: string
      Description:
        x-nullable: true
        description: Description
        type: string
      EdgarURL:
        x-nullable: true
        description: EDGAR URL
        type: string
      FilingType:
        x-nullable: true
        description: Filing Type
        type: string
      GrossProfit:
        x-nullable: true
        description: Gross Profit
        type: number
      LastModifiedByID:
        x-nullable: true
        description: Last Modified By User ID
        type: string
      LastModifiedDate:
        x-nullable: true
        description: Last Modified Date
        type: string
      NetIncome:
        x-nullable: true
        description: Net Income
        type: number
      PeriodEndDate:
        x-nullable: true
        description: Period End Date
        type: string
      TotalRevenue:
        x-nullable: true
        description: Total Revenue
        type: number
      Year:
        x-nullable: true
        description: Year
        type: string
  Product:
    description: A software product or service vended by a Company
    properties:
      ID:
        description: Record Id
        type: string
      AccountID:
        description: ID of the Company that owns this Product
        type: string
        x-nullable: true
      AppExchange:
        description: Salesforce AppExchange URL
        type: string
        x-nullable: true
      CreatedByID:
        description: Created By User ID
        type: string
        x-nullable: true
      CreatedDate:
        description: Created Date
        type: string
        x-nullable: true
      Description:
        description: Description of product
        type: string
        x-nullable: true
      FullDescription:
        description: Full Description of product
        type: string
        x-nullable: true
      ImageAltText:
        description: Image Alt Text
        type: string
        x-nullable: true
      ImageURL:
        description: Image URL
        type: string
        x-nullable: true
      Industries:
        x-nullable: true
        description: Industries
        type: array
        items:
          $ref: "#/definitions/Industry"
      LastModifiedByID:
        x-nullable: true
        description: Last Modified By User ID
        type: string
      LastModifiedDate:
        x-nullable: true
        description: Last Modified Date
        type: string
      Logo:
        x-nullable: true
        description: Logo
        type: string
      Name:
        x-nullable: true
        description: Product Name
        type: string
      ProductVideoID:
        x-nullable: true
        description: Product Video ID
        type: string
      Published:
        x-nullable: true
        description: Published
        type: boolean
      SalesforceSpecific:
        x-nullable: true
        description: Salesforce Specific
        type: boolean
      Slug:
        x-nullable: true
        description: Slug
        type: string
      TagLine:
        x-nullable: true
        description: TagLine
        type: string
      URL:
        x-nullable: true
        description: Website
        type: string
    type: object
  Service:
    description: A service performed by a Company
    properties:
      ID:
        description: Record Id
        type: string
      AccountID:
        description: ID of the Company that owns this Service
        type: string
        x-nullable: true
      AppExchange:
        description: Salesforce AppExchange URL
        type: string
        x-nullable: true
      CreatedByID:
        description: Created By User ID
        type: string
        x-nullable: true
      CreatedDate:
        description: Created Date
        type: string
        x-nullable: true
      Description:
        description: Description of service
        type: string
        x-nullable: true
      FullDescription:
        description: Full Description of service
        type: string
        x-nullable: true
      ImageAltText:
        description: Image Alt Text
        type: string
        x-nullable: true
      ImageURL:
        description: Image URL
        type: string
        x-nullable: true
      Industries:
        x-nullable: true
        description: Industries
        type: array
        items:
          $ref: "#/definitions/Industry"
      LastModifiedByID:
        description: Last Modified By User ID
        type: string
        x-nullable: true
      LastModifiedDate:
        description: Last Modified Date
        type: string
        x-nullable: true
      Logo:
        description: Logo
        type: string
        x-nullable: true
      Name:
        description: Service Name
        type: string
        x-nullable: true
      Published:
        description: Published
        type: boolean
        x-nullable: true
      SalesforceSpecific:
        description: Salesforce Specific
        type: boolean
        x-nullable: true
      ServiceVideoID:
        description: Service Video ID
        type: string
        x-nullable: true
      Slug:
        description: Slug
        type: string
        x-nullable: true
      TagLine:
        description: Tag Line
        type: string
        x-nullable: true
      URL:
        description: URL
        type: string
        x-nullable: true
    type: object

  Industry:
    description: An industry that is being researched
    properties:
      ID:
        description: Record Id
        type: string
      Companies:
        x-nullable: true
        description: The AccountIDs of the Companies in this Industry
        type: array
        items:
          type: string
      Products:
        x-nullable: true
        description: The list of Products in this industry
        type: array
        items:
          $ref: "#/definitions/Product"
      CreatedByID:
        x-nullable: true
        description: Created By User ID
        type: string
      CreatedDate:
        x-nullable: true
        description: Created Date
        type: string
      Description:
        x-nullable: true
        description: Industry Description
        type: string
      ImageAltText:
        x-nullable: true
        description: Image Alt Text
        type: string
      ImageURL:
        x-nullable: true
        description: Image URL
        type: string
      LastModifiedByID:
        x-nullable: true
        description: Last Modified By User ID
        type: string
      LastModifiedDate:
        x-nullable: true
        description: Last Modified Date
        type: string
      Level:
        x-nullable: true
        description: The hierarchical level of this Industry
        type: string
      Logo:
        x-nullable: true
        description: Logo
        type: string
      Name:
        x-nullable: true
        description: Industry Name
        type: string
      ParentIndustryID:
        x-nullable: true
        description: The ID of the Parent Industry
        type: string
      Path:
        x-nullable: true
        description: The full path of this industry, including Parent
        type: string
      Slug:
        x-nullable: true
        description: The CMS Slug for this Industry
        type: string
      TagLine:
        x-nullable: true
        description: TagLine
        type: string
    type: object
  Category:
    description: Junction object between Industry and Company
    properties:
      ID:
        description: Record Id
        type: string
      CompanyID:
        x-nullable: true
        description: ID of the Company that owns this Category
        type: string
      CompanyName:
        x-nullable: true
        description: Name of the Company
        type: string
      CompanySlug:
        x-nullable: true
        description: Slug of the Company
        type: string
      CompanyTagLine:
        x-nullable: true
        description: TagLine of the Company
        type: string
      IndustryID:
        x-nullable: true
        description: ID of the Industry that owns this Category
        type: string
      IndustryName:
        x-nullable: true
        description: Name of the Industry
        type: string
      IndustrySlug:
        x-nullable: true
        description: Slug of the Industry
        type: string
      IndustryTagLine:
        x-nullable: true
        description: TagLine of the Industry
        type: string
      CreatedByID:
        x-nullable: true
        description: Created By User ID
        type: string
      CreatedByDate:
        x-nullable: true
        description: Created Date
        type: string
      Path:
        x-nullable: true
        description: The full path of this category, including Parent
        type: string
    type: object
  CompanyRequest:
    description: An array of Company objects with Contacts
    properties:
      Data:
        items:
          $ref: "#/definitions/Company"
        type: array
    type: object
  CompanyResponse:
    description: An array of Company objects with Contacts
    properties:
      Data:
        items:
          $ref: "#/definitions/Company"
        type: array
      Meta:
        $ref: "../../lib/swagger/defs/response-meta.yaml#/ResponseMeta"
    type: object
  Error:
    $ref: "../../lib/swagger/defs/error.yaml#/Error"
  InvalidError:
    allOf:
      - $ref: "#/definitions/Error"
      - properties:
          details:
            items:
              type: string
            type: array
        type: object
