openapi: 3.0.0
info:
  license:
    name: MIT
    url: https://github.com/aziontech/azionapi-openapi/blob/main/LICENSE.md
  title: Network Lists API
  version: 1.0.0
servers:
- description: Production
  url: https://api.azionapi.net
security:
- tokenAuth: []
paths:
  /network_lists:
    get:
      parameters:
      - explode: true
        in: query
        name: page
        required: false
        schema:
          type: integer
        style: form
      - explode: true
        in: query
        name: page_size
        required: false
        schema:
          type: integer
        style: form
      - explode: true
        in: query
        name: sort
        required: false
        schema:
          type: string
        style: form
      - explode: true
        in: query
        name: order_by
        required: false
        schema:
          type: string
        style: form
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListNetworkListsResponse'
          description: A list of Network Lists
        "400":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
            text/html:
              schema:
                type: string
          description: Bad Request
        "403":
          description: Forbidden
        "404":
          description: Not Found
      summary: List all user Network Lists
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateNetworkListsRequest'
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NetworkListsResponse'
          description: A Network Lists object
        "400":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
            text/html:
              schema:
                type: string
          description: Bad Request
        "403":
          description: Forbidden
        "404":
          description: Not Found
        "500":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Internal Server Error
      summary: Create a Network Lists
  /network_lists/{uuid}:
    delete:
      parameters:
      - example: application/json; version=3
        explode: false
        in: header
        name: Accept
        required: false
        schema:
          type: string
        style: simple
      - description: "The id of the networkList to be deleted.\t"
        explode: false
        in: path
        name: uuid
        required: true
        schema:
          type: string
        style: simple
      responses:
        "204":
          description: No Content
        "400":
          description: Bad Request
        "403":
          description: Forbidden
        "404":
          description: Not Found
        "422":
          description: Unprocessable Entity
        "500":
          description: Internal Server Error
      summary: Delete a Network Lists set by uuid
    get:
      parameters:
      - explode: false
        in: path
        name: uuid
        required: true
        schema:
          type: string
        style: simple
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NetworkListUuidResponse'
          description: A Network Lists object
        "400":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
            text/html:
              schema:
                type: string
          description: Bad Request
        "403":
          description: Forbidden
        "404":
          description: Not Found
      summary: Retrieve a Network Lists set by uuid
    put:
      parameters:
      - explode: false
        in: path
        name: uuid
        required: true
        schema:
          type: string
        style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateNetworkListsRequest'
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NetworkListsResponse'
          description: Successfully updated
        "400":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
            text/html:
              schema:
                type: string
          description: Bad Request
        "403":
          description: Forbidden
        "404":
          description: Not Found
        "500":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Internal Server Error
      summary: Overwrite some Network Lists attributes
components:
  schemas:
    ErrorModel:
      properties:
        code:
          type: string
      type: object
    Links:
      example:
        next: next
        previous: previous
      properties:
        previous:
          nullable: true
          type: string
        next:
          nullable: true
          type: string
      type: object
    NetworkLists:
      example:
        list_type: ip_cidr
        last_editor: Azion
        name: Network List created using the API
        id: 1614
        country_list:
        - country_list
        - country_list
        ip_list:
        - 192.168.0.1
        last_modified: 2023-08-10T05:00:07.893747Z
      properties:
        id:
          example: 1614
          format: int64
          type: integer
        last_editor:
          example: Azion
          type: string
        last_modified:
          example: 2023-08-10T05:00:07.893747Z
          type: string
        list_type:
          example: ip_cidr
          type: string
        name:
          example: Network List created using the API
          type: string
        country_list:
          items:
            type: string
          type: array
        ip_list:
          example:
          - 192.168.0.1
          items:
            type: string
          type: array
      type: object
    ListNetworkListsResponse:
      example:
        schema_version: 1
        count: 0
        links:
          next: next
          previous: previous
        total_pages: 6
        results:
        - list_type: ip_cidr
          last_editor: Azion
          name: Network List created using the API
          id: 1614
          country_list:
          - country_list
          - country_list
          ip_list:
          - 192.168.0.1
          last_modified: 2023-08-10T05:00:07.893747Z
        - list_type: ip_cidr
          last_editor: Azion
          name: Network List created using the API
          id: 1614
          country_list:
          - country_list
          - country_list
          ip_list:
          - 192.168.0.1
          last_modified: 2023-08-10T05:00:07.893747Z
      properties:
        count:
          format: int64
          type: integer
        total_pages:
          format: int64
          type: integer
        schema_version:
          format: int64
          type: integer
        links:
          $ref: '#/components/schemas/Links'
        results:
          items:
            $ref: '#/components/schemas/NetworkLists'
          type: array
      type: object
    NetworkListResponseEntry:
      example:
        list_type: ip_cidr
        items_values:
        - 192.168.0.1
        last_editor: Azion
        name: Network List created using the API
        id: 1614
        last_modified: 2023-08-10T05:00:07.893747Z
      properties:
        id:
          example: 1614
          format: int64
          type: integer
        last_editor:
          example: Azion
          type: string
        last_modified:
          example: 2023-08-10T05:00:07.893747Z
          type: string
        list_type:
          example: ip_cidr
          type: string
        name:
          example: Network List created using the API
          type: string
        items_values:
          example:
          - 192.168.0.1
          items:
            type: string
          type: array
      type: object
    NetworkListUuidResponseEntry:
      oneOf:
      - $ref: '#/components/schemas/NetworkListUuidResponseEntryString'
      - $ref: '#/components/schemas/NetworkListUuidResponseEntryInt'
    NetworkListUuidResponseEntryString:
      properties:
        last_editor:
          example: Azion
          type: string
        last_modified:
          example: 2023-08-10T05:00:07.893747Z
          type: string
        list_type:
          example: ip_cidr
          type: string
        name:
          example: Network List created using the API
          type: string
        items_values:
          example:
          - 192.168.0.1
          items:
            type: string
          type: array
      type: object
    NetworkListUuidResponseEntryInt:
      properties:
        last_editor:
          example: Azion
          type: string
        last_modified:
          example: 2023-08-10T05:00:07.893747Z
          type: string
        list_type:
          example: asn
          type: string
        name:
          example: Network List created using the API
          type: string
        items_values:
          example:
          - 1234
          items:
            type: integer
          type: array
      type: object
    CreateNetworkListsRequest:
      example:
        list_type: ip_cidr
        items_values:
        - 192.168.0.1
        name: Network List created using the API
      properties:
        name:
          example: Network List created using the API
          type: string
        items_values:
          example:
          - 192.168.0.1
          items:
            type: string
          type: array
        list_type:
          enum:
          - ip_cidr
          - asn
          - countries
          example: ip_cidr
          type: string
      type: object
    BadRequestResponse:
      properties:
        name:
          items:
            type: string
          type: array
        items_values:
          items:
            type: string
          type: array
        list_type:
          items:
            type: string
          type: array
      type: object
    NetworkListsResponse:
      example:
        schema_version: 3
        results:
          list_type: ip_cidr
          items_values:
          - 192.168.0.1
          last_editor: Azion
          name: Network List created using the API
          id: 1614
          last_modified: 2023-08-10T05:00:07.893747Z
      properties:
        results:
          $ref: '#/components/schemas/NetworkListResponseEntry'
        schema_version:
          example: 3
          format: int64
          type: integer
      type: object
    NetworkListUuidResponse:
      example:
        schema_version: 3
        results: null
      properties:
        results:
          $ref: '#/components/schemas/NetworkListUuidResponseEntry'
        schema_version:
          example: 3
          format: int64
          type: integer
      type: object
  securitySchemes:
    tokenAuth:
      description: |-
        You must inform a token to auth.
        Usage format: `Token <TOKEN>`
      in: header
      name: Authorization
      type: apiKey
