swagger: "2.0"
info:
  version: 0.0.1
  title: "devops"
  description: "System Operations Microservice"
  termsOfService: "http://taxnexus.net/terms/"
  contact:
    email: "noc@taxnexus.net"
  license:
    name: "Proprietary - Copyright (c) 2018-2021 by Taxnexus, Inc."
securityDefinitions:
  ApiKeyAuth:
    type: "apiKey"
    in: "header"
    name: "X-API-Key"
schemes:
  - "http"
basePath: "/v1"
host: "devops.vernonkeenan.com:8080"
consumes:
  - "application/json"
produces:
  - "application/json"
parameters:
  databaseIdQuery:
    description: Taxnexus Record Id of a Database
    in: query
    name: databaseId
    required: false
    type: string
  taxnexusAccountQuery:
    description: Taxnexus Account of a Tenant
    in: query
    name: taxnexusAccount
    required: false
    type: string
  tenantIdQuery:
    description: Taxnexus Record Id of a Tenant
    in: query
    name: tenantId
    required: false
    type: string
  tenantRequest:
    description: An array of Tenant records
    in: body
    name: TenantRequest
    required: true
    schema:
      $ref: "#/definitions/TenantRequest"
  databaseRequest:
    description: An array of Database records
    in: body
    name: DatabaseRequest
    required: true
    schema:
      $ref: "#/definitions/DatabaseRequest"
  X-API-Key:
    name: X-API-Key
    in: "header"
    required: true
    type: string
  ClusterRequest:
    description: An array of Cluster records
    in: body
    name: ClusterRequest
    required: true
    schema:
      $ref: "#/definitions/ClusterRequest"
  TemplateRequest:
    description: An array of Template records
    in: body
    name: TemplateRequest
    required: true
    schema:
      $ref: "#/definitions/TemplateRequest"
  UserRequest:
    description: An array of User records
    in: body
    name: UserRequest
    required: true
    schema:
      $ref: "#/definitions/UserRequest"
  accountIdQuery:
    description: Taxnexus Record Id of an Account
    in: query
    name: accountId
    required: false
    type: string
  contactIdQuery:
    description: Taxnexus Record Id of a Contact
    in: query
    name: contactId
    required: false
    type: string
  accountNumberQuery:
    description:
      The Taxnexus Account Number of the Account to be used a record
      retrieval
    in: query
    name: accountNumber
    required: false
    type: string
  activeQuery:
    description: Retrieve active records only?
    in: query
    name: active
    required: false
    type: boolean
  apiKeyQuery:
    description: Service account or developer API key
    in: query
    name: apikey
    type: string
  clusterIdPath:
    description: Taxnexus Record Id of a Cluster
    in: path
    name: clusterIdPath
    type: string
    required: true
  databaseIdPath:
    description: Taxnexus Record Id of a Database
    in: path
    name: databaseIdPath
    type: string
    required: true
  clusterIdQuery:
    description: Taxnexus Record Id of a Cluster
    in: query
    name: clusterId
    required: false
    type: string
  companyIdQuery:
    description: Taxnexus Record Id of a Company
    in: query
    name: companyId
    required: false
    type: string
  ingestIdPath:
    description: Taxnexus Record Id of a Ingest
    in: path
    name: ingestIdPath
    type: string
    required: true
  ingestIdQuery:
    description: Taxnexus Record Id of an Ingest
    in: query
    name: ingestId
    required: false
    type: string
  jobIdPath:
    description: Taxnexus Record Id of a Job
    in: path
    name: jobIdPath
    type: string
    required: true
  jobIdQuery:
    description: Taxnexus Record Id of a Job
    in: query
    name: jobId
    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? (default 0)
    format: int64
    in: query
    name: offset
    required: false
    type: integer
  serviceIdPath:
    description: Taxnexus Record Id of a Service
    in: path
    name: serviceIdPath
    type: string
    required: true
  serviceIdQuery:
    description: Service ID
    in: query
    name: serviceId
    type: string
  templateIdPath:
    description: Taxnexus Record Id of a Template
    in: path
    name: templateIdPath
    type: string
    required: true
  templateIdQuery:
    description: Template ID
    in: query
    name: templateId
    type: string
  objectTypeQuery:
    description: Object Type Name
    in: query
    name: objectType
    type: string
  isMasterQuery:
    description: Is Master Template?
    in: query
    name: isMaster
    type: boolean
  userIdPath:
    description: Taxnexus Record Id of a User
    in: path
    name: userIdPath
    type: string
    required: true
  tenantIdPath:
    description: Taxnexus Record Id of a Tenant
    in: path
    name: tenantIdPath
    type: string
    required: true
  userIdQuery:
    description: Taxnexus User ID (unique)
    in: query
    name: userId
    type: string
  emailQuery:
    description: Email Address (not unique)
    in: query
    name: email
    type: string
  usernameQuery:
    description: Username (unique)
    in: query
    name: username
    type: string
  userRequest:
    description: An array of user records
    in: body
    name: UserRequest
    required: true
    schema:
      $ref: "#/definitions/UserRequest"
responses:
  AccessForbidden:
    description: "Access forbidden, account lacks access"
    headers:
      Access-Control-Allow-Origin:
        type: string
    schema:
      $ref: "#/definitions/Error"
  ClusterSingletonResponse:
    description: Single Cluster record response
    headers:
      Access-Control-Allow-Origin:
        type: string
      Cache-Control:
        type: string
    schema:
      $ref: "#/definitions/Cluster"
  ClusterObservableResponse:
    description: Single Cluster record response
    headers:
      Access-Control-Allow-Origin:
        type: string
      Cache-Control:
        type: string
    schema:
      type: array
      items:
        $ref: "#/definitions/Cluster"
  ClusterResponse:
    description: Taxnexus Response with Cluster objects
    headers:
      Access-Control-Allow-Origin:
        type: string
      Cache-Control:
        type: string
    schema:
      $ref: "#/definitions/ClusterResponse"
  DeveopsDeleteResponse:
    description:
      Taxnexus Response with Message Objects with Delete Status
    headers:
      Access-Control-Allow-Origin:
        type: string
    schema:
      $ref: "#/definitions/DeleteResponse"
  NotFound:
    headers:
      Access-Control-Allow-Origin:
        type: string
    description: Resource was not found
    schema:
      $ref: "#/definitions/Error"
  DatabaseResponse:
    headers:
      Access-Control-Allow-Origin:
        type: string
    description: Taxnexus Response with Database objects
    schema:
      $ref: "#/definitions/DatabaseResponse"
  DatabaseSingletonResponse:
    description: Single Database record response
    headers:
      Access-Control-Allow-Origin:
        type: string
      Cache-Control:
        type: string
    schema:
      $ref: "#/definitions/Database"
  DatabaseObservableResponse:
    description: Single Database record response
    headers:
      Access-Control-Allow-Origin:
        type: string
      Cache-Control:
        type: string
    schema:
      type: array
      items:
        $ref: "#/definitions/Database"
  TenantResponse:
    headers:
      Access-Control-Allow-Origin:
        type: string
    description: Taxnexus Response with Tenant objects
    schema:
      $ref: "#/definitions/TenantResponse"
  TenantSingletonResponse:
    description: Single Tenant record response
    headers:
      Access-Control-Allow-Origin:
        type: string
      Cache-Control:
        type: string
    schema:
      $ref: "#/definitions/Tenant"
  TenantObservableResponse:
    description: Single Tenant record response
    headers:
      Access-Control-Allow-Origin:
        type: string
      Cache-Control:
        type: string
    schema:
      type: array
      items:
        $ref: "#/definitions/Tenant"
  ServerError:
    headers:
      Access-Control-Allow-Origin:
        type: string
    description: Server Internal Error
    schema:
      $ref: "#/definitions/Error"
  TemplateResponse:
    description: Taxnexus Response with Template objects
    headers:
      Access-Control-Allow-Origin:
        type: string
      Cache-Control:
        type: string
    schema:
      $ref: "#/definitions/TemplateResponse"
  TemplateSingletonResponse:
    description: Single Template record response
    headers:
      Access-Control-Allow-Origin:
        type: string
      Cache-Control:
        type: string
    schema:
      $ref: "#/definitions/Template"
  TemplateObservableResponse:
    description: Simple Template record response
    headers:
      Access-Control-Allow-Origin:
        type: string
      Cache-Control:
        type: string
    schema:
      type: array
      items:
        $ref: "#/definitions/Template"
  Unauthorized:
    description: "Access Unauthorized, invalid API-KEY was used"
    headers:
      Access-Control-Allow-Origin:
        type: string
      Cache-Control:
        type: string
    schema:
      $ref: "#/definitions/Error"
  UnprocessableEntity:
    description: "Unprocessable Entity, likely a bad parameter"
    headers:
      Access-Control-Allow-Origin:
        type: string
      Cache-Control:
        type: string
    schema:
      $ref: "#/definitions/Error"
  UserResponse:
    description: Taxnexus Response with User objects
    headers:
      Access-Control-Allow-Origin:
        type: string
      Cache-Control:
        type: string
    schema:
      $ref: "#/definitions/UserResponse"
  UserSingletonResponse:
    description: Single User record response
    headers:
      Access-Control-Allow-Origin:
        type: string
      Cache-Control:
        type: string
    schema:
      $ref: "#/definitions/User"
  UserObservableResponse:
    description: Simple User record response
    headers:
      Access-Control-Allow-Origin:
        type: string
      Cache-Control:
        type: string
    schema:
      type: array
      items:
        $ref: "#/definitions/User"
  CORSResponse:
    description: CORS OPTIONS response
    headers:
      Access-Control-Allow-Origin:
        type: string
      Access-Control-Allow-Headers:
        type: string
      Access-Control-Allow-Methods:
        type: string
      Access-Control-Expose-Headers:
        type: string
      Access-Control-Max-Age:
        type: string
      Access-Control-Allow-Credentials:
        type: string
      Cache-Control:
        type: string
paths:
  /clusters:
    get:
      description: Return a list of Cluster records from the datastore
      operationId: getClusters
      parameters:
        - $ref: "#/parameters/clusterIdQuery"
        - $ref: "#/parameters/companyIdQuery"
        - $ref: "#/parameters/limitQuery"
        - $ref: "#/parameters/offsetQuery"
      responses:
        "200":
          $ref: "#/responses/ClusterResponse"
        "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 Clusters
      tags:
        - Cluster
    options:
      description: CORS support
      operationId: clustersOptions
      responses:
        "200":
          $ref: "#/responses/CORSResponse"
      tags:
        - cors
    post:
      description: Create Clusters in Taxnexus
      operationId: postClusters
      parameters:
        - $ref: "#/parameters/ClusterRequest"
      responses:
        "200":
          $ref: "#/responses/ClusterResponse"
        "401":
          $ref: "#/responses/Unauthorized"
        "403":
          $ref: "#/responses/AccessForbidden"
        "404":
          $ref: "#/responses/NotFound"
        "422":
          $ref: "#/responses/UnprocessableEntity"
        "500":
          $ref: "#/responses/ServerError"
      security:
        - ApiKeyAuth: []
      summary: Create new Clusters
      tags:
        - Cluster
    put:
      description: Update Cluster in Taxnexus
      operationId: putClusters
      parameters:
        - $ref: "#/parameters/ClusterRequest"
      responses:
        "200":
          $ref: "#/responses/ClusterResponse"
        "401":
          $ref: "#/responses/Unauthorized"
        "403":
          $ref: "#/responses/AccessForbidden"
        "404":
          $ref: "#/responses/NotFound"
        "422":
          $ref: "#/responses/UnprocessableEntity"
        "500":
          $ref: "#/responses/ServerError"
      security:
        - ApiKeyAuth: []
      summary: Update Clustera
      tags:
        - Cluster
  /clusters/observable:
    get:
      description: Returns a Cluster retrieval in a observable array
      operationId: getClustersObservable
      responses:
        "200":
          $ref: "#/responses/ClusterObservableResponse"
        "401":
          $ref: "#/responses/Unauthorized"
        "403":
          $ref: "#/responses/AccessForbidden"
        "404":
          $ref: "#/responses/NotFound"
        "422":
          $ref: "#/responses/UnprocessableEntity"
        "500":
          $ref: "#/responses/ServerError"
      security:
        - ApiKeyAuth: []
      summary: Get Clusters in an observable array
      tags:
        - Cluster
    options:
      description: CORS support
      operationId: clusterOptions
      responses:
        "200":
          $ref: "#/responses/CORSResponse"
      tags:
        - cors
  "/clusters/{clusterIdPath}":
    get:
      description:
        Return a single Cluster object from datastore as a Singleton
      operationId: getCluster
      parameters:
        - $ref: "#/parameters/clusterIdPath"
      responses:
        "200":
          $ref: "#/responses/ClusterSingletonResponse"
        "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 single Cluster object
      tags:
        - Cluster
  /databases:
    get:
      description: Return a list of Database records from the datastore
      operationId: getDatabases
      parameters:
        - $ref: "#/parameters/databaseIdQuery"
        - $ref: "#/parameters/companyIdQuery"
        - $ref: "#/parameters/limitQuery"
        - $ref: "#/parameters/offsetQuery"
      responses:
        "200":
          $ref: "#/responses/DatabaseResponse"
        "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 Databases
      tags:
        - Database
    options:
      description: CORS support
      operationId: databasesOptions
      responses:
        "200":
          $ref: "#/responses/CORSResponse"
      tags:
        - cors
    post:
      description: Create Databases in Taxnexus
      operationId: postDatabases
      parameters:
        - $ref: "#/parameters/databaseRequest"
      responses:
        "200":
          $ref: "#/responses/DatabaseResponse"
        "401":
          $ref: "#/responses/Unauthorized"
        "403":
          $ref: "#/responses/AccessForbidden"
        "404":
          $ref: "#/responses/NotFound"
        "422":
          $ref: "#/responses/UnprocessableEntity"
        "500":
          $ref: "#/responses/ServerError"
      security:
        - ApiKeyAuth: []
      summary: Create new Databases
      tags:
        - Database
    put:
      description: Update Database in Taxnexus
      operationId: putDatabases
      parameters:
        - $ref: "#/parameters/databaseRequest"
      responses:
        "200":
          $ref: "#/responses/DatabaseResponse"
        "401":
          $ref: "#/responses/Unauthorized"
        "403":
          $ref: "#/responses/AccessForbidden"
        "404":
          $ref: "#/responses/NotFound"
        "422":
          $ref: "#/responses/UnprocessableEntity"
        "500":
          $ref: "#/responses/ServerError"
      security:
        - ApiKeyAuth: []
      summary: Update Databases
      tags:
        - Database
  /databases/observable:
    get:
      description: Returns a Database retrieval in a observable array
      operationId: getDatabasesObservable
      responses:
        "200":
          $ref: "#/responses/DatabaseObservableResponse"
        "401":
          $ref: "#/responses/Unauthorized"
        "403":
          $ref: "#/responses/AccessForbidden"
        "404":
          $ref: "#/responses/NotFound"
        "422":
          $ref: "#/responses/UnprocessableEntity"
        "500":
          $ref: "#/responses/ServerError"
      security:
        - ApiKeyAuth: []
      summary: Get Databases in an observable array
      tags:
        - Database
    options:
      description: CORS support
      operationId: databaseOptions
      responses:
        "200":
          $ref: "#/responses/CORSResponse"
      tags:
        - cors
  "/databases/{databaseIdPath}":
    get:
      description:
        Return a single Database object from datastore as a Singleton
      operationId: getDatabase
      parameters:
        - $ref: "#/parameters/databaseIdPath"
      responses:
        "200":
          $ref: "#/responses/DatabaseSingletonResponse"
        "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 single Database object
      tags:
        - Database
  /templates:
    get:
      description: Return a list of Templates from the datastore
      operationId: getTemplates
      parameters:
        - $ref: "#/parameters/limitQuery"
        - $ref: "#/parameters/offsetQuery"
        - $ref: "#/parameters/activeQuery"
        - $ref: "#/parameters/templateIdQuery"
        - $ref: "#/parameters/isMasterQuery"
        - $ref: "#/parameters/objectTypeQuery"
      responses:
        "200":
          $ref: "#/responses/TemplateResponse"
        "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 Templates
      tags:
        - Template
    options:
      description: CORS support
      operationId: templatesOptions
      responses:
        "200":
          $ref: "#/responses/CORSResponse"
      tags:
        - cors
    post:
      description: Create new Templates
      operationId: postTemplates
      parameters:
        - $ref: "#/parameters/TemplateRequest"
      responses:
        "200":
          $ref: "#/responses/TemplateResponse"
        "401":
          $ref: "#/responses/Unauthorized"
        "403":
          $ref: "#/responses/AccessForbidden"
        "404":
          $ref: "#/responses/NotFound"
        "422":
          $ref: "#/responses/UnprocessableEntity"
        "500":
          $ref: "#/responses/ServerError"
      security:
        - ApiKeyAuth: []
      summary: Create new Templates
      tags:
        - Template
  /templates/observable:
    get:
      description: Returns a Template retrieval in a observable array
      operationId: getTemplatesObservable
      responses:
        "200":
          $ref: "#/responses/TemplateObservableResponse"
        "401":
          $ref: "#/responses/Unauthorized"
        "403":
          $ref: "#/responses/AccessForbidden"
        "404":
          $ref: "#/responses/NotFound"
        "422":
          $ref: "#/responses/UnprocessableEntity"
        "500":
          $ref: "#/responses/ServerError"
      security:
        - ApiKeyAuth: []
      summary: Get Templates in an observable array
      tags:
        - Template
    options:
      description: CORS support
      operationId: templateOptions
      responses:
        "200":
          $ref: "#/responses/CORSResponse"
      tags:
        - cors
  "/templates/{templateIdPath}":
    get:
      description:
        Return a single Template object from datastore as a Singleton
      operationId: getTemplate
      parameters:
        - $ref: "#/parameters/templateIdPath"
      responses:
        "200":
          $ref: "#/responses/TemplateSingletonResponse"
        "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 single Template object
      tags:
        - Template
  /tenants:
    get:
      description: Return a list of Tenant records from the datastore
      operationId: getTenants
      parameters:
        - $ref: "#/parameters/taxnexusAccountQuery"
        - $ref: "#/parameters/tenantIdQuery"
        - $ref: "#/parameters/companyIdQuery"
        - $ref: "#/parameters/limitQuery"
        - $ref: "#/parameters/offsetQuery"
      responses:
        "200":
          $ref: "#/responses/TenantResponse"
        "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 Tenants
      tags:
        - Tenant
    options:
      description: CORS support
      operationId: tenantsOptions
      responses:
        "200":
          $ref: "#/responses/CORSResponse"
      tags:
        - cors
    post:
      description: Create Tenants in Taxnexus
      operationId: postTenants
      parameters:
        - $ref: "#/parameters/tenantRequest"
      responses:
        "200":
          $ref: "#/responses/TenantResponse"
        "401":
          $ref: "#/responses/Unauthorized"
        "403":
          $ref: "#/responses/AccessForbidden"
        "404":
          $ref: "#/responses/NotFound"
        "422":
          $ref: "#/responses/UnprocessableEntity"
        "500":
          $ref: "#/responses/ServerError"
      security:
        - ApiKeyAuth: []
      summary: Create new Tenants
      tags:
        - Tenant
    put:
      description: Update Tenant in Taxnexus
      operationId: putTenants
      parameters:
        - $ref: "#/parameters/tenantRequest"
      responses:
        "200":
          $ref: "#/responses/TenantResponse"
        "401":
          $ref: "#/responses/Unauthorized"
        "403":
          $ref: "#/responses/AccessForbidden"
        "404":
          $ref: "#/responses/NotFound"
        "422":
          $ref: "#/responses/UnprocessableEntity"
        "500":
          $ref: "#/responses/ServerError"
      security:
        - ApiKeyAuth: []
      summary: Update Tenants
      tags:
        - Tenant
  /tenants/observable:
    get:
      description: Returns a Tenant retrieval in a observable array
      operationId: getTenantsObservable
      responses:
        "200":
          $ref: "#/responses/TenantObservableResponse"
        "401":
          $ref: "#/responses/Unauthorized"
        "403":
          $ref: "#/responses/AccessForbidden"
        "404":
          $ref: "#/responses/NotFound"
        "422":
          $ref: "#/responses/UnprocessableEntity"
        "500":
          $ref: "#/responses/ServerError"
      security:
        - ApiKeyAuth: []
      summary: Get Tenants in an observable array
      tags:
        - Tenant
    options:
      description: CORS support
      operationId: tenantOptions
      responses:
        "200":
          $ref: "#/responses/CORSResponse"
      tags:
        - cors
  "/tenants/{tenantIdPath}":
    get:
      description:
        Return a single Tenant object from datastore as a Singleton
      operationId: getTenant
      parameters:
        - $ref: "#/parameters/tenantIdPath"
      responses:
        "200":
          $ref: "#/responses/TenantSingletonResponse"
        "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 single Tenant object
      tags:
        - Tenant
  /users:
    get:
      description: Return a list of User records from the datastore
      operationId: getUsers
      parameters:
        - $ref: "#/parameters/limitQuery"
        - $ref: "#/parameters/offsetQuery"
        - $ref: "#/parameters/accountIdQuery"
        - $ref: "#/parameters/contactIdQuery"
        - $ref: "#/parameters/activeQuery"
        - $ref: "#/parameters/emailQuery"
        - $ref: "#/parameters/userIdQuery"
        - $ref: "#/parameters/usernameQuery"
      responses:
        "200":
          $ref: "#/responses/UserResponse"
        "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 Users
      tags:
        - User
    options:
      description: CORS support
      operationId: usersOptions
      responses:
        "200":
          $ref: "#/responses/CORSResponse"
      tags:
        - cors
    post:
      description: Create new Users
      operationId: postUsers
      parameters:
        - $ref: "#/parameters/UserRequest"
      responses:
        "200":
          $ref: "#/responses/UserResponse"
        "401":
          $ref: "#/responses/Unauthorized"
        "403":
          $ref: "#/responses/AccessForbidden"
        "404":
          $ref: "#/responses/NotFound"
        "422":
          $ref: "#/responses/UnprocessableEntity"
        "500":
          $ref: "#/responses/ServerError"
      security:
        - ApiKeyAuth: []
      summary: Create new Users
      tags:
        - User
    put:
      description: Update existing users
      operationId: putUsers
      parameters:
        - $ref: "#/parameters/UserRequest"
      responses:
        "200":
          $ref: "#/responses/UserResponse"
        "401":
          $ref: "#/responses/Unauthorized"
        "403":
          $ref: "#/responses/AccessForbidden"
        "404":
          $ref: "#/responses/NotFound"
        "422":
          $ref: "#/responses/UnprocessableEntity"
        "500":
          $ref: "#/responses/ServerError"
      security:
        - ApiKeyAuth: []
      summary: Update existing users
      tags:
        - User
  /users/observable:
    get:
      description: Returns a User retrieval in a observable array
      operationId: getUsersObservable
      responses:
        "200":
          $ref: "#/responses/UserObservableResponse"
        "401":
          $ref: "#/responses/Unauthorized"
        "403":
          $ref: "#/responses/AccessForbidden"
        "404":
          $ref: "#/responses/NotFound"
        "422":
          $ref: "#/responses/UnprocessableEntity"
        "500":
          $ref: "#/responses/ServerError"
      security:
        - ApiKeyAuth: []
      summary: Get Users in an observable array
      tags:
        - User
    options:
      description: CORS support
      operationId: userOptions
      responses:
        "200":
          $ref: "#/responses/CORSResponse"
      tags:
        - cors
  "/users/{userIdPath}":
    get:
      description:
        Return a single User object from datastore as a Singleton
      operationId: getUser
      parameters:
        - $ref: "#/parameters/userIdPath"
      responses:
        "200":
          $ref: "#/responses/UserSingletonResponse"
        "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 single User object
      tags:
        - User
definitions:
  Address:
    properties:
      City:
        description: City
        type: string
      Country:
        description: Country full name
        type: string
      CountryCode:
        description: Country Code
        type: string
      PostalCode:
        description: Postal Code
        type: string
      State:
        description: State full name
        type: string
      StateCode:
        description: State Code
        type: string
      Street:
        description: Street number and name
        type: string
    type: object
  Cluster:
    properties:
      CreatedByID:
        description: Created By
        type: string
      CreatedDate:
        description: Created Date
        type: string
      Description:
        description: Description
        type: string
      Environment:
        description: Environment
        type: string
      Gateway:
        description: Gateway
        type: string
      ID:
        description: Taxnexus Record Id
        type: string
      IPAddress:
        description: IP Address
        type: string
      LastModifiedByID:
        description: Last Modified By
        type: string
      LastModifiedDate:
        description: Last Modified Date
        type: string
      Name:
        description: Cluster Name
        type: string
      OwnerID:
        description: Owner
        type: string
      Ref:
        description: External Reference
        type: string
      Status:
        description: Status
        type: string
      Subnet:
        description: Subnet
        type: string
      Type:
        description: Type
        type: string
      TenantID:
        description: The ID of the tenant who owns this Database
        type: string
      Zone:
        description: Zone
        type: string
    type: object
  ClusterRequest:
    properties:
      Data:
        items:
          $ref: "#/definitions/Cluster"
        type: array
    type: object
  ClusterResponse:
    description: An array of cluster objects
    properties:
      Data:
        items:
          $ref: "#/definitions/Cluster"
        type: array
      Meta:
        $ref: "#/definitions/ResponseMeta"
    type: object
  Database:
    description: A Database provisioned and owned by a Tenant
    properties:
      Active:
        description: Is this database active?
        type: boolean
      ClusterID:
        description:
          The ID of the Cluster in which this database is deployed
        type: string
      CreatedByID:
        description: Created By
        type: string
      CreatedDate:
        description: Created Date
        type: string
      DSN:
        description: Database connection string
        type: string
      DatabaseName:
        description: The name of the physical database in the cluster
        type: string
      ID:
        description: Record Id
        type: string
      LastModifiedByID:
        description: Last Modified By
        type: string
      LastModifiedDate:
        description: Last Modifed Date
        type: string
      Status:
        description: The current status of this Tenant
        type: string
      TenantID:
        description: The ID of the tenant who owns this Database
        type: string
      Type:
        description: "The type of Database (mysql, etc)"
        type: string
    type: object
  DatabaseRequest:
    description: An array of Database objects
    properties:
      Data:
        items:
          $ref: "#/definitions/Database"
        type: array
    type: object
  DatabaseResponse:
    description: An array of Database objects
    properties:
      Data:
        items:
          $ref: "#/definitions/Database"
        type: array
      Meta:
        $ref: "#/definitions/ResponseMeta"
    type: object
  DeleteResponse:
    properties:
      Data:
        items:
          $ref: "#/definitions/Message"
        type: array
      Meta:
        $ref: "#/definitions/ResponseMeta"
    type: object
  Error:
    properties:
      code:
        format: int64
        type: integer
      fields:
        type: string
      message:
        type: string
    type: object
  Message:
    properties:
      Message:
        type: string
      Ref:
        type: string
      Status:
        type: integer
    type: object
  Pagination:
    properties:
      Limit:
        format: int64
        type: integer
      POffset:
        format: int64
        type: integer
      PageSize:
        format: int64
        type: integer
      SetSize:
        format: int64
        type: integer
    type: object
  RequestMeta:
    properties:
      TaxnexusAccount:
        description: Taxnexus Account Number of the Reseller or OEM
        type: string
    required:
      - TaxnexusAccount
    type: object
  ResponseMeta:
    properties:
      Contact:
        description: Microservice Contact Info
        type: string
      Copyright:
        description: Copyright Info
        type: string
      License:
        description: License Information and Restrictions
        type: string
      OperationID:
        description: Operation ID
        type: string
      Pagination:
        $ref: "#/definitions/Pagination"
      RequestIP:
        description: Request IP Address
        type: string
      RequestType:
        description: Request Type
        type: string
      RequestURL:
        description: Request URL
        type: string
      ServerInfo:
        description: Data Server Info
        type: string
      ServerResponseTime:
        description: Data Server Response Time (ms)
        type: string
      ServerTimestamp:
        description: Backend Server Timestamp
        type: string
      TaxnexusAccount:
        description:
          Taxnexus Account Number used for recording transactions
        type: string
    type: object
  Role:
    description: A functional role within a Tenant
    properties:
      Auth0RoleID:
        description: The corresponding Auth0 Role
        type: string
      CreatedByID:
        description: Created By
        type: string
      CreatedDate:
        description: Created Date
        type: string
      Description:
        description: Role Description
        type: string
      ID:
        description: Record Id
        type: string
      LastModifiedByID:
        description: Last Modified By
        type: string
      LastModifiedDate:
        description: Last Modifed Date
        type: string
      RoleName:
        description: The name of this role
        type: string
      TenantID:
        description: The ID of the Tenant that owns this Role
        type: string
    type: object
  RoleRequest:
    description: An array of Role objects
    properties:
      Date:
        items:
          $ref: "#/definitions/Role"
        type: array
    type: object
  RoleResponse:
    description: An array of Role objects
    properties:
      Data:
        items:
          $ref: "#/definitions/Role"
        type: array
      Meta:
        $ref: "#/definitions/ResponseMeta"
    type: object
  Template:
    properties:
      CompanyID:
        description: Company
        type: string
      CreatedByID:
        type: string
      CreatedDate:
        type: string
      Description:
        description: Description
        type: string
      HTML:
        description: HTML Body
        format: byte
        type: string
      ID:
        description: Taxnexus Record Id
        type: string
      IsActive:
        description: Active?
        type: boolean
      IsMaster:
        description: Master Template?
        type: boolean
      LastModifiedByID:
        type: string
      LastModifiedDate:
        type: string
      Name:
        description: Template Name
        type: string
      ObjectType:
        description: Object
        type: string
      RecordTypeName:
        description: Record Type Name
        type: string
      TenantID:
        description: Tenant that owns this object instance
        type: string
      Type:
        description: Type
        type: string
      URL:
        description: URL
        type: string
    type: object
  TemplateRequest:
    description: An array of Templates
    properties:
      Data:
        items:
          $ref: "#/definitions/Template"
        type: array
    type: object
  TemplateResponse:
    description: An array of Templates
    properties:
      Data:
        items:
          $ref: "#/definitions/Template"
        type: array
      Meta:
        $ref: "#/definitions/ResponseMeta"
    type: object
  Tenant:
    description: Taxnexus Account Tenant
    properties:
      AccountID:
        description: The Account that owns this Tenant
        type: string
      Active:
        description: Is this Tenant currently active?
        type: boolean
      CreatedByID:
        description: Created By
        type: string
      CreatedDate:
        description: Created Date
        type: string
      Databases:
        items:
          $ref: "#/definitions/Database"
        type: array
      ID:
        description: Record Id
        type: string
      LastModifiedByID:
        description: Last Modified By
        type: string
      LastModifiedDate:
        description: Last Modifed Date
        type: string
      Roles:
        items:
          $ref: "#/definitions/Role"
        type: array
      Status:
        description: The current status of this Tenant
        type: string
      TenantName:
        description: Name of the Tenant Resource
        type: string
      TenantUsers:
        items:
          $ref: "#/definitions/TenantUser"
        type: array
      Type:
        description: The type of Tenant
        type: string
      Version:
        description:
          The version number of the Tenant Onboarding system used to
          create this tenant
        type: string
    type: object
  TenantRequest:
    description: An array of Tenant objects
    properties:
      Data:
        items:
          $ref: "#/definitions/Tenant"
        type: array
    type: object
  TenantResponse:
    description: An array of Tenant objects
    properties:
      Data:
        items:
          $ref: "#/definitions/Tenant"
        type: array
      Meta:
        $ref: "#/definitions/ResponseMeta"
    type: object
  TenantUser:
    description: Relationship object that connects users to a tenant
    properties:
      AccessLevel:
        description: The makeTenantUser access level for this User
        type: string
      AccountID:
        description: Account ID
        type: string
      Auth0UserID:
        description: Auth0 User ID
        type: string
      CompanyName:
        description: Account Name
        type: string
      ContactID:
        description: Contact ID
        type: string
      TaxnexusAccount:
        description: Taxnexus Account
        type: string
      TenantActive:
        description: Tenant active?
        type: boolean
      TenantID:
        description: The Tenant ID
        type: string
      TenantName:
        description: Tenant Name
        type: string
      TenantStatus:
        description: Tenant Status
        type: string
      TenantType:
        description: Tenant type
        type: string
      TenantVersion:
        description: Tenant Version
        type: string
      UserEmail:
        description: User Email Address
        type: string
      UserFullName:
        description: User Full Name
        type: string
      UserID:
        description: The User ID
        type: string
      Username:
        description: Username
        type: string
    type: object
  User:
    properties:
      APIKey:
        description: API Key
        type: string
      AboutMe:
        description: About Me
        type: string
      AccountID:
        description: Account ID
        type: string
      Address:
        $ref: "#/definitions/Address"
      Alias:
        description: Alias
        type: string
      Auth0UserID:
        description: Auth0 User Id
        type: string
      CommunityNickname:
        description: Nickname
        type: string
      CompanyName:
        description: Company Name
        type: string
      ContactID:
        description: Contact
        type: string
      CreatedByID:
        description: Created User ID
        type: string
      CreatedDate:
        description: Date Created
        type: string
      DelegatedApproverID:
        description: Delegated Approver
        type: string
      Department:
        description: Department
        type: string
      Division:
        description: Division
        type: string
      Email:
        description: Email address
        type: string
      EmployeeNumber:
        description: Employee Number
        type: string
      EndOfDay:
        description: Time day ends
        type: string
      Environment:
        description: Environment
        type: string
      Extension:
        description: Extension
        type: string
      FabricAPIKey:
        description: Fabric API Key
        type: string
      Fax:
        description: Fax
        type: string
      FirstName:
        description: The first name
        type: string
      ForecastEnabled:
        description: Allow Forecasting
        type: boolean
      FullPhotoURL:
        description: Full Photo URL
        type: string
      ID:
        description: Taxnexus ID
        type: string
      IsActive:
        description: Active
        type: boolean
      IsPortalEnabled:
        description: Is the user enabled for Communities?
        type: boolean
      IsProphilePhotoActive:
        description: Has Profile Photo
        type: boolean
      IsSystemControlled:
        type: boolean
      LastIP:
        description: IP address of last login
        type: string
      LastLogin:
        description: Last login time
        type: string
      LastModifiedByID:
        description: Last Modified User ID
        type: string
      LastModifiedDate:
        description: Last Modified Date
        type: string
      LastName:
        description: The Last Name
        type: string
      LoginCount:
        description: Number of times user has logged in
        format: int64
        type: number
      ManagerID:
        description: Manager
        type: string
      MobilePhone:
        description: Mobile
        type: string
      Name:
        description: Name
        type: string
      OutOfOfficeMessage:
        description: Out of office message
        type: string
      Phone:
        description: Phone
        type: string
      PortalRole:
        description: Portal Role Level
        type: string
      ProfileID:
        description: Profile
        type: string
      ReceivesAdminEmails:
        description: Info Emails
        type: boolean
      ReceivesAdminInfoEmails:
        description: Admin Info Emails
        type: boolean
      SenderEmail:
        description: Email Sender Address
        type: string
      SenderName:
        description: Email Sender Name
        type: string
      Signature:
        description: Email Signature
        type: string
      SmallPhotoURL:
        description: Small Photo URL
        type: string
      StartOfDay:
        description: The time day starts
        type: string
      TaxnexusAccount:
        description: Taxnexus Account
        type: string
      TenantID:
        description: Tenant ID associated with this user
        type: string
      TenantUsers:
        items:
          $ref: "#/definitions/TenantUser"
        type: array
      TimeZone:
        description: Time Zone
        type: string
      Title:
        description: Title
        type: string
      UserRoleID:
        description: Role
        type: string
      UserRoles:
        items:
          $ref: "#/definitions/UserRole"
        type: array
      UserType:
        description: User Type
        type: string
      Username:
        description: Username
        type: string
    type: object
  UserRequest:
    properties:
      Data:
        items:
          $ref: "#/definitions/User"
        type: array
    type: object
  UserResponse:
    description: An array of Print-Ready ingest Objects
    properties:
      Data:
        items:
          $ref: "#/definitions/User"
        type: array
      Meta:
        $ref: "#/definitions/ResponseMeta"
    type: object
  UserRole:
    description: Relationship object that connects user to a role
    properties:
      AccountID:
        description: Account Id
        type: string
      Auth0RoleID:
        description: Linked role ID
        type: string
      Auth0UserID:
        description: Auth0 User ID
        type: string
      CompanyName:
        description: Company Name
        type: string
      ContactID:
        description: Contact ID
        type: string
      RoleDescription:
        description: Role description
        type: string
      RoleID:
        description: The Role ID
        type: string
      RoleName:
        description: Role Name
        type: string
      TaxnexusAccount:
        description: Taxnexus Account Number
        type: string
      UserEmail:
        description: User Email Address
        type: string
      UserFullName:
        description: User Full Name
        type: string
      UserID:
        description: The User ID
        type: string
      Username:
        description: Username
        type: string
    type: object
