x-generator: NSwag v13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))
swagger: '2.0'
info:
  title: Absorb Integration API
  version: v1
consumes:
  - application/json
produces:
  - application/json
paths:
  /resource-categories:
    get:
      tags:
        - Resource Categories
      summary: Lists resource categories.
      operationId: ResourceCategories_GetResourceCategories
      parameters:
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '1'
      responses:
        '200':
          x-nullable: false
          description: ''
          schema:
            type: array
            items:
              $ref: '#/definitions/ResourceCategoryResource'
      security:
        - api_key: []
    post:
      tags:
        - Resource Categories
      summary: Create resource category.
      operationId: ResourceCategories_CreateResourceCategory
      parameters:
        - name: request
          in: body
          schema:
            $ref: '#/definitions/CreateResourceCategoryRequest'
          x-nullable: true
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '1'
      responses:
        '201':
          x-nullable: false
          description: ''
          schema:
            $ref: '#/definitions/ResourceCategoryResource'
        '403':
          x-nullable: false
          description: User does not have required permissions to create resource category.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
        '422':
          x-nullable: false
          description: Provided ID or Parent ID invalid.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
  /resource-categories/{id}:
    get:
      tags:
        - Resource Categories
      summary: Get resource category.
      operationId: ResourceCategories_GetResourceCategory
      parameters:
        - type: string
          name: id
          in: path
          required: true
          description: The ID of the resource category.
          format: guid
          x-nullable: false
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '1'
      responses:
        '200':
          x-nullable: false
          description: ''
          schema:
            $ref: '#/definitions/ResourceCategoryResource'
        '404':
          x-nullable: false
          description: Resource category not found.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
    put:
      tags:
        - Resource Categories
      summary: Update resource category.
      operationId: ResourceCategories_UpdateResourceCategory
      parameters:
        - type: string
          name: id
          in: path
          required: true
          description: The ID of the resource category.
          format: guid
          x-nullable: false
        - name: resourceCategory
          in: body
          description: The model for the resource category data.
          schema:
            $ref: '#/definitions/UpdateResourceCategoryRequestBody'
          x-nullable: true
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '1'
      responses:
        '201':
          x-nullable: false
          description: ''
          schema:
            $ref: '#/definitions/ResourceCategoryResource'
        '404':
          x-nullable: false
          description: Resource Category not found.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
        '422':
          x-nullable: false
          description: A validation error occured with the provided parameters.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
definitions:
  ResourceCategoryResource:
    type: object
    description: >-
      Represents information about a resource category for an Integration API
      endpoint.
    properties:
      id:
        type: string
        description: The unique resource category identifier.
        format: guid
      name:
        type: string
        description: The resource category's name.
      parentId:
        type: string
        description: The resource category's parent ID.
        format: guid
      description:
        type: string
        description: The resource category's description.
  Link:
    type: object
    properties:
      Rel:
        $ref: '#/definitions/Relation'
      Items:
        type: array
        items:
          $ref: '#/definitions/LinkItem'
  Relation:
    type: object
    properties:
      Name:
        type: string
  LinkItem:
    type: object
    properties:
      Href:
        type: string
      Name:
        type: string
      Templated:
        type: boolean
      Type:
        type: string
      Deprecation:
        type: string
      Profile:
        type: string
      Title:
        type: string
      Hreflang:
        type: string
  IEmbeddedResource:
    type: object
    x-abstract: true
    properties:
      Name:
        type: string
      Resources:
        type: array
        items:
          $ref: '#/definitions/IResource'
  IResource:
    type: object
    x-abstract: true
    properties:
      Links:
        type: array
        items:
          $ref: '#/definitions/Link'
      EmbeddedResources:
        type: array
        items:
          $ref: '#/definitions/IEmbeddedResource'
  GenericErrorResponse:
    type: object
    description: |-
      This class is NOT to be used as an actual response. This is to be used as
      the return type for non-200 responses in `SwaggerResponse` attributes.
    properties:
      validations:
        type: array
        description: The validations (if any) which caused the error.
        items:
          type: string
      code:
        description: The status code returned.
        allOf:
          - $ref: '#/definitions/HttpStatusCode'
      message:
        type: string
        description: The error message.
      term:
        type: string
        description: The general error term.
      _meta:
        type: object
        description: 'A list of meta data (if any). '
        additionalProperties:
          type: string
  HttpStatusCode:
    type: integer
    description: ''
    x-enumNames:
      - Continue
      - SwitchingProtocols
      - OK
      - Created
      - Accepted
      - NonAuthoritativeInformation
      - NoContent
      - ResetContent
      - PartialContent
      - MultipleChoices
      - Ambiguous
      - MovedPermanently
      - Moved
      - Found
      - Redirect
      - SeeOther
      - RedirectMethod
      - NotModified
      - UseProxy
      - Unused
      - TemporaryRedirect
      - RedirectKeepVerb
      - BadRequest
      - Unauthorized
      - PaymentRequired
      - Forbidden
      - NotFound
      - MethodNotAllowed
      - NotAcceptable
      - ProxyAuthenticationRequired
      - RequestTimeout
      - Conflict
      - Gone
      - LengthRequired
      - PreconditionFailed
      - RequestEntityTooLarge
      - RequestUriTooLong
      - UnsupportedMediaType
      - RequestedRangeNotSatisfiable
      - ExpectationFailed
      - UpgradeRequired
      - InternalServerError
      - NotImplemented
      - BadGateway
      - ServiceUnavailable
      - GatewayTimeout
      - HttpVersionNotSupported
  CreateResourceCategoryRequest:
    type: object
    description: Request to create a new resource category.
    required:
      - name
    properties:
      id:
        type: string
        description: >-
          The unique identifier to use for the resource category. If not
          supplied one will be created.
        format: guid
      name:
        type: string
        description: The name.
        maxLength: 4000
        minLength: 0
      parentId:
        type: string
        description: The ID of the parent resource category (if any).
        format: guid
      description:
        type: string
        description: The description.
  UpdateResourceCategoryRequestBody:
    type: object
    description: The request to update a resource category.
    properties:
      name:
        type: string
        description: The resource category name.
      parentId:
        type: string
        description: The resource category parent ID.
        format: guid
      description:
        type: string
        description: The resource category description.
securityDefinitions:
  api_key:
    type: apiKey
    name: x-api-key
    in: header
tags:
  - name: Resource Categories
x-servers:
  - url: https://rest.myabsorb.com
    description: US
  - url: https://rest.myabsorb.ca
    description: CA
  - url: https://rest.myabsorb.eu
    description: EU
  - url: https://rest.myabsorb.com.au
    description: AU
