openapi: 3.1.0
info:
  title: Cocon Fiber Transactional API
  version: v1
  license:
    name: Proprietary
    url: https://www.speerit.nl
  description: |
    The Cocon Fiber Transactional API provides asset management functionality.
servers:
  - url: https://platform.speerit.nl/external
security:
  - Api-Key-Header: []
  - Client-Id-Header: []
paths:
  /api/v1/buildings/{id}/delayed-connections:
    post:
      operationId: createBuildingDelayedConnection
      tags:
        - Delayed connection
      summary: Create a delayed connection for a building
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DelayedConnectionRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DelayedConnectionResponse'
        '400':
          $ref: '#/components/responses/CommonErrorResponse'
        '401':
          $ref: '#/components/responses/CommonErrorResponse'
        '403':
          $ref: '#/components/responses/CommonErrorResponse'
        '404':
          $ref: '#/components/responses/CommonErrorResponse'
        '500':
          $ref: '#/components/responses/CommonErrorResponse'
  /api/v1/contacts:
    post:
      operationId: createContact
      tags:
        - Contact
      summary: Create a contact
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactCreateRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
        '400':
          $ref: '#/components/responses/CommonErrorResponse'
        '401':
          $ref: '#/components/responses/CommonErrorResponse'
        '403':
          $ref: '#/components/responses/CommonErrorResponse'
        '500':
          $ref: '#/components/responses/CommonErrorResponse'
  /api/v1/contacts/{id}:
    patch:
      operationId: patchContact
      tags:
        - Contact
      summary: Update a contact
      parameters:
        - $ref: '#/components/parameters/IdParam'
      requestBody:
        description: ''
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/ContactUpdateRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
        '400':
          $ref: '#/components/responses/CommonErrorResponse'
        '401':
          $ref: '#/components/responses/CommonErrorResponse'
        '403':
          $ref: '#/components/responses/CommonErrorResponse'
        '404':
          $ref: '#/components/responses/CommonErrorResponse'
        '500':
          $ref: '#/components/responses/CommonErrorResponse'
    delete:
      operationId: deleteContact
      tags:
        - Contact
      summary: Delete a contact
      parameters:
        - $ref: '#/components/parameters/IdParam'
      responses:
        '204':
          description: No Content
        '400':
          $ref: '#/components/responses/CommonErrorResponse'
        '401':
          $ref: '#/components/responses/CommonErrorResponse'
        '403':
          $ref: '#/components/responses/CommonErrorResponse'
        '404':
          $ref: '#/components/responses/CommonErrorResponse'
        '500':
          $ref: '#/components/responses/CommonErrorResponse'
  /api/v1/customer-contracts:
    post:
      operationId: createCustomerContract
      tags:
        - Customer contract
      summary: Create a customer contract
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerContractCreateRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerContract'
        '400':
          $ref: '#/components/responses/CommonErrorResponse'
        '401':
          $ref: '#/components/responses/CommonErrorResponse'
        '403':
          $ref: '#/components/responses/CommonErrorResponse'
        '500':
          $ref: '#/components/responses/CommonErrorResponse'
  /api/v1/customer-contracts/{id}:
    get:
      operationId: getCustomerContract
      tags:
        - Customer contract
      summary: Get a customer contract by id
      parameters:
        - $ref: '#/components/parameters/IdParam'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerContract'
        '401':
          $ref: '#/components/responses/CommonErrorResponse'
        '403':
          $ref: '#/components/responses/CommonErrorResponse'
        '404':
          $ref: '#/components/responses/CommonErrorResponse'
        '500':
          $ref: '#/components/responses/CommonErrorResponse'
    patch:
      operationId: patchCustomerContract
      tags:
        - Customer contract
      summary: Update a customer contract
      parameters:
        - $ref: '#/components/parameters/IdParam'
      requestBody:
        description: ''
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/CustomerContractPatchRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerContract'
        '400':
          $ref: '#/components/responses/CommonErrorResponse'
        '401':
          $ref: '#/components/responses/CommonErrorResponse'
        '403':
          $ref: '#/components/responses/CommonErrorResponse'
        '404':
          $ref: '#/components/responses/CommonErrorResponse'
        '500':
          $ref: '#/components/responses/CommonErrorResponse'
    delete:
      operationId: deleteCustomerContract
      tags:
        - Customer contract
      summary: Delete a customer contract
      parameters:
        - $ref: '#/components/parameters/IdParam'
      responses:
        '204':
          description: No Content
        '400':
          $ref: '#/components/responses/CommonErrorResponse'
        '401':
          $ref: '#/components/responses/CommonErrorResponse'
        '403':
          $ref: '#/components/responses/CommonErrorResponse'
        '404':
          $ref: '#/components/responses/CommonErrorResponse'
        '500':
          $ref: '#/components/responses/CommonErrorResponse'
  /api/v1/customers:
    post:
      operationId: createCustomer
      tags:
        - Customer
      summary: Create a customer
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerCreateRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlatCustomer'
        '400':
          $ref: '#/components/responses/CommonErrorResponse'
        '401':
          $ref: '#/components/responses/CommonErrorResponse'
        '403':
          $ref: '#/components/responses/CommonErrorResponse'
        '500':
          $ref: '#/components/responses/CommonErrorResponse'
  /api/v1/customers/{id}:
    get:
      operationId: getCustomer
      tags:
        - Customer
      summary: Get customers by id
      parameters:
        - $ref: '#/components/parameters/IdParam'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlatCustomer'
        '401':
          $ref: '#/components/responses/CommonErrorResponse'
        '403':
          $ref: '#/components/responses/CommonErrorResponse'
        '404':
          $ref: '#/components/responses/CommonErrorResponse'
        '500':
          $ref: '#/components/responses/CommonErrorResponse'
    patch:
      operationId: patchCustomer
      tags:
        - Customer
      summary: Update a customer
      parameters:
        - $ref: '#/components/parameters/IdParam'
      requestBody:
        description: The customer to update
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/CustomerUpdateRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlatCustomer'
        '400':
          $ref: '#/components/responses/CommonErrorResponse'
        '401':
          $ref: '#/components/responses/CommonErrorResponse'
        '403':
          $ref: '#/components/responses/CommonErrorResponse'
        '404':
          $ref: '#/components/responses/CommonErrorResponse'
        '500':
          $ref: '#/components/responses/CommonErrorResponse'
    delete:
      operationId: deleteCustomer
      tags:
        - Customer
      summary: Delete a customer
      parameters:
        - $ref: '#/components/parameters/IdParam'
      responses:
        '204':
          description: No Content
        '400':
          $ref: '#/components/responses/CommonErrorResponse'
        '401':
          $ref: '#/components/responses/CommonErrorResponse'
        '403':
          $ref: '#/components/responses/CommonErrorResponse'
        '404':
          $ref: '#/components/responses/CommonErrorResponse'
        '500':
          $ref: '#/components/responses/CommonErrorResponse'
  /api/v1/customers/contacts/{contactId}:
    get:
      operationId: getCustomersContact
      tags:
        - Customer
        - Contact
      summary: Get contacts by customer id and contact id
      parameters:
        - name: contactId
          in: path
          description: ''
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/schemas-Contact'
        '400':
          $ref: '#/components/responses/CommonErrorResponse'
        '401':
          $ref: '#/components/responses/CommonErrorResponse'
        '403':
          $ref: '#/components/responses/CommonErrorResponse'
        '404':
          $ref: '#/components/responses/CommonErrorResponse'
        '500':
          $ref: '#/components/responses/CommonErrorResponse'
  /api/v1/customers/{id}/contacts/{contactId}:
    get:
      operationId: getCustomerContact
      tags:
        - Customer
        - Contact
      summary: Get contacts by customer id and contact id
      parameters:
        - $ref: '#/components/parameters/IdParam'
        - name: contactId
          in: path
          description: The id of the contact to retrieve
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/schemas-Contact'
        '400':
          $ref: '#/components/responses/CommonErrorResponse'
        '401':
          $ref: '#/components/responses/CommonErrorResponse'
        '403':
          $ref: '#/components/responses/CommonErrorResponse'
        '404':
          $ref: '#/components/responses/CommonErrorResponse'
        '500':
          $ref: '#/components/responses/CommonErrorResponse'
  /api/v1/delayed-connections:
    post:
      operationId: createDelayedConnection
      tags:
        - Delayed connection
      summary: Create a delayed connection
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DelayedConnectionExtendedRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/schemas-DelayedConnectionResponse'
        '400':
          $ref: '#/components/responses/CommonErrorResponse'
        '401':
          $ref: '#/components/responses/CommonErrorResponse'
        '403':
          $ref: '#/components/responses/CommonErrorResponse'
        '404':
          $ref: '#/components/responses/CommonErrorResponse'
        '500':
          $ref: '#/components/responses/CommonErrorResponse'
  /api/v1/delayed-connections/batch/{id}:
    get:
      operationId: getDelayedConnectionsBatch
      tags:
        - Delayed connection
      summary: Get status details for a delayed connections batch operation
      parameters:
        - $ref: '#/components/parameters/IdParam'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchDelayedConnectionsStatusResponse'
        '401':
          $ref: '#/components/responses/CommonErrorResponse'
        '403':
          $ref: '#/components/responses/CommonErrorResponse'
        '404':
          $ref: '#/components/responses/CommonErrorResponse'
        '500':
          $ref: '#/components/responses/CommonErrorResponse'
  /api/v1/delayed-connections/batch:
    post:
      operationId: createDelayedConnectionBatch
      tags:
        - Delayed connection
      summary: Register a batch to create multiple delayed connections
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchDelayedConnectionsRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchDelayedConnectionsResponse'
        '400':
          $ref: '#/components/responses/CommonErrorResponse'
        '401':
          $ref: '#/components/responses/CommonErrorResponse'
        '403':
          $ref: '#/components/responses/CommonErrorResponse'
        '500':
          $ref: '#/components/responses/CommonErrorResponse'
  /api/v1/project-asset-approvals:
    post:
      operationId: createProjectAssetApproval
      tags:
        - Project asset approval
      summary: Create a project asset approval
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectAssetApprovalRequest'
      responses:
        '200':
          description: OK
        '400':
          $ref: '#/components/responses/CommonErrorResponse'
          description: |
            The following error codes can be returned:
            - PA-0001: The `type` property of `assetApproval` cannot be left empty
            - PA-0002: The `type` property of `assetApproval` must contain a valid value
            - PA-0003: The `type` property of `asset` cannot be left empty
            - PA-0004: The `type` property of `asset` must contain a valid value
            - PA-0005: The `name` property of `asset` cannot be left empty
            - PA-0006: The `name` property of `asset` must refer to an existing asset
            - PA-0007: The `installationCompany` property cannot be left empty
            - PA-0008: The `installationCompany` property must refer to an existing installation company
            - PA-0009: The `projectName` property canot be left empty
            - PA-0010: The `projectName` property must refer to an existing project
        '401':
          $ref: '#/components/responses/CommonErrorResponse'
        '403':
          $ref: '#/components/responses/CommonErrorResponse'
        '500':
          $ref: '#/components/responses/CommonErrorResponse'
components:
  securitySchemes:
    Api-Key-Header:
      type: apiKey
      name: X-Api-Key
      in: header
    Client-Id-Header:
      type: apiKey
      name: X-Client-Id
      in: header
  schemas:
    GeoJsonObject:
      description: |
        GeoJSon object The coordinate reference system for all GeoJSON coordinates is a geographic coordinate reference system, using the World Geodetic System 1984 (WGS 84) datum, with longitude and latitude units of decimal degrees. This is equivalent to the coordinate reference system identified by the Open Geospatial Consortium (OGC) URN An OPTIONAL third-position element SHALL be the height in meters above or below the WGS 84 reference ellipsoid. In the absence of elevation values, applications sensitive to height or depth SHOULD interpret positions as being at local ground or sea level.
      externalDocs:
        url: https://tools.ietf.org/html/rfc7946#section-3
      type: object
      properties:
        type:
          type: string
          enum:
            - Feature
            - FeatureCollection
            - Point
            - MultiPoint
            - LineString
            - MultiLineString
            - Polygon
            - MultiPolygon
            - GeometryCollection
        bbox:
          description: |
            A GeoJSON object MAY have a member named "bbox" to include information on the coordinate range for its Geometries, Features, or FeatureCollections. The value of the bbox member MUST be an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries.
          type: array
          items:
            type: number
      required:
        - type
      discriminator:
        propertyName: type
    Geometry:
      description: |
        Abstract type for all GeoJSon object except Feature and FeatureCollection
      externalDocs:
        url: https://tools.ietf.org/html/rfc7946#section-3
      allOf:
        - $ref: '#/components/schemas/GeoJsonObject'
        - type: object
          properties:
            type:
              type: string
              enum:
                - Point
                - MultiPoint
                - LineString
                - MultiLineString
                - Polygon
                - MultiPolygon
                - GeometryCollection
          required:
            - type
          discriminator:
            propertyName: type
    GeometryElement:
      description: |
        Abstract type for all GeoJSon 'Geometry' object the type of which is not 'GeometryCollection'
      externalDocs:
        url: https://tools.ietf.org/html/rfc7946#section-3
      allOf:
        - $ref: '#/components/schemas/Geometry'
        - type: object
          properties:
            type:
              type: string
              enum:
                - Point
                - MultiPoint
                - LineString
                - MultiLineString
                - Polygon
                - MultiPolygon
          required:
            - type
          discriminator:
            propertyName: type
    Position:
      description: |
        GeoJSon fundamental geometry construct. A position is an array of numbers. There MUST be two or more elements. The first two elements are longitude and latitude, or easting and northing, precisely in that order and using decimal numbers. Altitude or elevation MAY be included as an optional third element. Implementations SHOULD NOT extend positions beyond three elements because the semantics of extra elements are unspecified and ambiguous. Historically, some implementations have used a fourth element to carry a linear referencing measure (sometimes denoted as "M") or a numerical timestamp, but in most situations a parser will not be able to properly interpret these values. The interpretation and meaning of additional elements is beyond the scope of this specification, and additional elements MAY be ignored by parsers.
      externalDocs:
        url: https://tools.ietf.org/html/rfc7946#section-3.1.1
      type: array
      minItems: 2
      maxItems: 3
      items:
        type: number
    LineStringCoordinates:
      description: |
        GeoJSon fundamental geometry construct, array of two or more positions.
      externalDocs:
        url: https://tools.ietf.org/html/rfc7946#section-3.1.4
      type: array
      items:
        $ref: '#/components/schemas/Position'
      minItems: 2
    LineString:
      description: GeoJSon geometry
      externalDocs:
        url: https://tools.ietf.org/html/rfc7946#section-3.1.4
      allOf:
        - $ref: '#/components/schemas/GeometryElement'
        - type: object
          required:
            - coordinates
          properties:
            coordinates:
              $ref: '#/components/schemas/LineStringCoordinates'
    DelayedConnectionRequest:
      type: object
      properties:
        frameName:
          type:
            - string
            - 'null'
          description: Short name of the frame
        terminationUnitType:
          type:
            - string
            - 'null'
          description: Name of the fiber termination unit type that is placed in the frame
        attenuation1:
          type: number
          description: First attenuation
          format: double
        attenuation2:
          type: number
          description: Second attenuation
          format: double
        installationCompanyName:
          type:
            - string
            - 'null'
          description: Name of the installation company
        newRoute:
          $ref: '#/components/schemas/LineString'
        isWithoutGeometry:
          type: boolean
          description: Specifies that the newRoute value is intentionally omitted
      additionalProperties: false
    DelayedConnectionResponse:
      type: object
      properties:
        buildingId:
          type:
            - string
            - 'null'
          description: Unique identification
        cableId:
          type:
            - string
            - 'null'
          description: Id of the cable used for the delayed connection
        frameId:
          type:
            - string
            - 'null'
          description: Id of the frame used for the delayed connection
        patchPosition1Id:
          type:
            - string
            - 'null'
          description: Id of the patch position of the first fiber of the delayed connection
        patchPosition2Id:
          type:
            - string
            - 'null'
          description: Id of the patch position of the second fiber of the delayed connection
      additionalProperties: false
    Error:
      type: object
      properties:
        code:
          type:
            - string
            - 'null'
          description: An error code specifying a functional error
        message:
          type:
            - string
            - 'null'
          description: A message describing the cause of the functional error
      additionalProperties: false
    CoconPlatformError:
      type: object
      properties:
        timestamp:
          type:
            - string
            - 'null'
          readOnly: true
        id:
          type: string
          format: uuid
          readOnly: true
        status:
          type: integer
          format: int32
        errors:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/Error'
        message:
          type:
            - string
            - 'null'
      additionalProperties: false
    ContactCreateRequest:
      type: object
      properties:
        name:
          type:
            - string
            - 'null'
          description: Name of the contact
        customerId:
          type:
            - string
            - 'null'
          description: Id of the customer the contact belongs to
        isPrimaryContact:
          type: boolean
          description: Indicates whether the contact is the primary contact
        phoneNumber:
          type:
            - string
            - 'null'
          description: Phone number of the contact
        emailAddresses:
          type:
            - array
            - 'null'
          items:
            type: string
          description: Email address(es) of the contact
      additionalProperties: false
    Contact:
      type: object
      properties:
        id:
          type:
            - string
            - 'null'
          description: Unique identifier
        name:
          type:
            - string
            - 'null'
          description: The name of the contact
        customerName:
          type:
            - string
            - 'null'
          description: The name of the customer this contact belongs to
        isPrimaryContact:
          type: boolean
          description: Indicates whether the contact is the primary contact
        phoneNumber:
          type:
            - string
            - 'null'
          description: The phone number of this contact
        emailAddresses:
          type:
            - array
            - 'null'
          items:
            type: string
          description: The email address(es) of this contact
      additionalProperties: false
      description: Contact resource
    ContactUpdateRequest:
      type: object
      properties:
        name:
          type:
            - string
            - 'null'
          description: Name of the contact
        isPrimaryContact:
          type: boolean
          description: Indicates whether the contact is the primary contact
        phoneNumber:
          type:
            - string
            - 'null'
          description: Phone number of the contact
        emailAddresses:
          type:
            - array
            - 'null'
          items:
            type: string
          description: Email address(es) of the contact
      additionalProperties: false
    CustomerContractCreateRequest:
      type: object
      properties:
        name:
          type:
            - string
            - 'null'
          description: Name of the customer contract
        customerId:
          type:
            - string
            - 'null'
          description: Id of the customer the contract is related to
        contactIds:
          type:
            - array
            - 'null'
          items:
            type: string
          description: The ids of the contacts realted to this contract
        startDate:
          type:
            - string
            - 'null'
          description: The start date of the contract
          format: date
        endDate:
          type: string
          description: The end date of the contract
          format: date
        owner:
          type:
            - string
            - 'null'
          description: The owner of the contract
        comment:
          type:
            - string
            - 'null'
          description: Comment
        other:
          type:
            - string
            - 'null'
          description: Other information
        servicePriority:
          type:
            - string
            - 'null'
          description: The priority of this service
        allowDivergentPriority:
          type: boolean
          description: Allow the priority of the provided service to divert from its set priority
        contractTypeName:
          type:
            - string
            - 'null'
          description: Name of the type of the contract
      additionalProperties: false
    ContactReference:
      type: object
      description: Reference to a contact
      properties:
        id:
          type:
            - string
            - 'null'
          description: Unique identifier
        href:
          type:
            - string
            - 'null'
          description: Path to the resource
      additionalProperties: false
    CustomerContract:
      type: object
      properties:
        id:
          type:
            - string
            - 'null'
          description: Unique identifier
        name:
          type:
            - string
            - 'null'
          description: Name of the customer contract
        customerName:
          type:
            - string
            - 'null'
          description: Name of the customer this contract belongs to
        owner:
          type:
            - string
            - 'null'
          description: Owner of the contract
        startDate:
          type:
            - string
            - 'null'
          description: Start date of the contact
          format: date
        endDate:
          type: string
          description: End date of the contract
          format: date
        remarks:
          type:
            - string
            - 'null'
          description: Remarks regarding this contract
        additionalInformation:
          type:
            - string
            - 'null'
          description: Additional information regarding the contract
        contacts:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/ContactReference'
          description: List of contacts that are related to the customer contract
      additionalProperties: false
    CustomerContractPatchRequest:
      type: object
      properties:
        name:
          type:
            - string
            - 'null'
          description: Name of the customer contract
        contactIds:
          type:
            - array
            - 'null'
          items:
            type: string
          description: The ids of the contects realted to this contract
        startDate:
          type:
            - string
            - 'null'
          description: The start date of the contract
          format: date
        endDate:
          type: string
          description: The end date of the contract
          format: date
        owner:
          type:
            - string
            - 'null'
          description: The owner of the contract
        comment:
          type:
            - string
            - 'null'
          description: Comment
        other:
          type:
            - string
            - 'null'
          description: Other information
        allowDivergentPriority:
          type: boolean
          description: Allow the priority of the provided service to divert from its set priority
        contractTypeName:
          type:
            - string
            - 'null'
          description: Name of the type of the contract
      additionalProperties: false
    PostalAddress:
      type: object
      properties:
        street:
          type:
            - string
            - 'null'
          description: Street of the postal address
        houseNumber:
          type:
            - string
            - 'null'
          description: Housenumber of the postal address
        zipCode:
          type:
            - string
            - 'null'
          description: Zipcode of the postal address
        city:
          type:
            - string
            - 'null'
          description: City of the postal address
        country:
          type:
            - string
            - 'null'
          description: Country of the postal address
      additionalProperties: false
    OutageContactInformation:
      type: object
      properties:
        emailAddresses:
          type:
            - array
            - 'null'
          items:
            type: string
          description: List of email addresses to notify in case of outages
        phoneNumber:
          type:
            - string
            - 'null'
          description: Phone number to contact in case of outages
      additionalProperties: false
    CustomerCreateRequest:
      type: object
      properties:
        clientCode:
          type:
            - string
            - 'null'
          description: Client code of the customer
        name:
          type:
            - string
            - 'null'
          description: Name of the customer
        postalAddress:
          $ref: '#/components/schemas/PostalAddress'
        outageContactInformation:
          $ref: '#/components/schemas/OutageContactInformation'
        additionalInformation:
          type:
            - object
            - 'null'
          additionalProperties:
            type:
              - string
              - 'null'
          description: |
            Only accepts the following key:
              * ExternalReference
      additionalProperties: false
    FlatCustomer:
      type: object
      properties:
        id:
          type:
            - string
            - 'null'
          description: Unique identifier
        name:
          type:
            - string
            - 'null'
          description: Name of the customer
        postalAddress:
          type:
            - string
            - 'null'
          description: Address information of the customer
        emailAddresses:
          type:
            - array
            - 'null'
          items:
            type: string
          description: List of email addresses of the customer
        phoneNumber:
          type:
            - string
            - 'null'
          description: Phone number of the customer
        additionalInformation:
          type:
            - object
            - 'null'
          additionalProperties:
            type:
              - string
              - 'null'
          description: Additional information with regarding the customer
      additionalProperties: false
    CustomerUpdateRequest:
      type: object
      properties:
        clientCode:
          type:
            - string
            - 'null'
          description: Client code of the customer
        name:
          type:
            - string
            - 'null'
          description: Name of the customer
        postalAddress:
          $ref: '#/components/schemas/PostalAddress'
        outageContactInformation:
          $ref: '#/components/schemas/OutageContactInformation'
        additionalInformation:
          type:
            - object
            - 'null'
          additionalProperties:
            type:
              - string
              - 'null'
          description: |
            Only accepts the following key:
              * ExternalReference
      additionalProperties: false
    schemas-Contact:
      type: object
      properties:
        id:
          type:
            - string
            - 'null'
          description: Unique identifier
        name:
          type:
            - string
            - 'null'
          description: Name of the contact
        customerName:
          type:
            - string
            - 'null'
          description: Name of the customer the contact belongs to
        isPrimaryContact:
          type: boolean
          description: Indicates whether the contact is the primary contact
        phoneNumber:
          type:
            - string
            - 'null'
          description: Phone number of the contact
        emailAddresses:
          type:
            - array
            - 'null'
          items:
            type: string
          description: List of email addresses of the contact
      additionalProperties: false
    DelayedConnectionExtendedRequest:
      type: object
      properties:
        frameName:
          type:
            - string
            - 'null'
          description: Name of the frame
        terminationUnitType:
          type:
            - string
            - 'null'
          description: Name of the fiber termination unit type that is placed in the frame
        attenuation1:
          type: number
          description: First attenuation
          format: double
        attenuation2:
          type: number
          description: Second attenuation
          format: double
        installationCompanyName:
          type:
            - string
            - 'null'
          description: Name of the installation company
        newRoute:
          $ref: '#/components/schemas/LineString'
        isWithoutGeometry:
          type: boolean
          description: Specifies that the newRoute value is intentionally omitted
        buildingName:
          type:
            - string
            - 'null'
          description: Building name
      additionalProperties: false
    schemas-DelayedConnectionResponse:
      type: object
      properties:
        buildingId:
          type:
            - string
            - 'null'
          description: Id of the building related to the delayed connection
        cableId:
          type:
            - string
            - 'null'
          description: Id of the cable related to the delayed connection
        frameId:
          type:
            - string
            - 'null'
          description: Id of the frame related to the delayed connection
        patchPosition1Id:
          type:
            - string
            - 'null'
          description: Id of the patch position the first fiber is connected to
        patchPosition2Id:
          type:
            - string
            - 'null'
          description: Id of the patch position the second fiber is connected to
      additionalProperties: false
    BuildingSuccess:
      type: object
      properties:
        buildingName:
          type: string
          description: Building name (postcode, housenr., prefix)
        details:
          $ref: '#/components/schemas/schemas-DelayedConnectionResponse'
      additionalProperties: false
    BuildingFailure:
      type: object
      properties:
        buildingName:
          type:
            - string
            - 'null'
          description: Building name (postcode, housenr., prefix)
        errors:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/CoconPlatformError'
      additionalProperties: false
    BuildingPending:
      type: object
      properties:
        buildingName:
          type:
            - string
            - 'null'
          description: Building name (postcode, housenr., prefix)
      additionalProperties: false
    BatchDelayedConnectionsStatusResponse:
      type: object
      properties:
        batchId:
          type:
            - string
            - 'null'
          description: Batch id generated by registering a batch of delayed connections
        status:
          type:
            - string
            - 'null'
          description: Status of the batch
        success:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/BuildingSuccess'
          description: List of successfully finished delayed connection batch jobs
        failure:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/BuildingFailure'
          description: List of failed delayed connection batch jobs
        pending:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/BuildingPending'
          description: List of delayed connection batch jobs that are still in progress
      additionalProperties: false
    DelayedConnectionRequestShort:
      type: object
      properties:
        buildingName:
          type:
            - string
            - 'null'
          description: Name of the building related to the delayed connection
        frameName:
          type:
            - string
            - 'null'
          description: Name of the frame related to the delayed connection
        terminationUnitType:
          type:
            - string
            - 'null'
          description: Name of the fiber termination unit type that is placed in the frame
        attenuation1:
          type: number
          description: First attenuation
          format: double
        attenuation2:
          type: number
          description: Second attenuation
          format: double
        newRoute:
          $ref: '#/components/schemas/LineString'
        isWithoutGeometry:
          type: boolean
          description: Specifies that the newRoute value is intentionally omitted
      additionalProperties: false
    BatchDelayedConnectionsRequest:
      type: object
      properties:
        installationCompanyName:
          type:
            - string
            - 'null'
          description: Installation company that applies to all jobs in the batch
        delayedConnections:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/DelayedConnectionRequestShort'
          description: Batch of delayed connections
      additionalProperties: false
    BatchDelayedConnectionsResponse:
      type: object
      properties:
        batchId:
          type:
            - string
            - 'null'
          description: Batch id generated by registering a batch of delayed connections status
      additionalProperties: false
    ProjectAssetType:
      enum:
        - Building
        - Accesspoint
      type: string
      description: Type of the approved asset
    Asset:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/ProjectAssetType'
        name:
          type:
            - string
            - 'null'
          description: Name of the asset
      additionalProperties: false
    ProjectAssetApprovalType:
      enum:
        - Photo
      type: string
      description: Type of information that is used for approving the asset
    AssetApproval:
      type: object
      properties:
        asset:
          $ref: '#/components/schemas/Asset'
        installationCompany:
          type:
            - string
            - 'null'
          description: Name of the installation company
        type:
          $ref: '#/components/schemas/ProjectAssetApprovalType'
        author:
          type:
            - string
            - 'null'
          description: Original approver
      additionalProperties: false
    ProjectAssetApprovalRequest:
      type: object
      properties:
        projectName:
          type:
            - string
            - 'null'
          description: Name of the project this asset is part of and approved for
        timestamp:
          type: string
          format: date-time
          description: Date and time of the moment of approval
        approver:
          type:
            - string
            - 'null'
          description: Name of the original approver
        assetApproval:
          $ref: '#/components/schemas/AssetApproval'
      additionalProperties: false
  responses:
    CommonErrorResponse:
      description: Generic error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CoconPlatformError'
  parameters:
    IdParam:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: Unique identifier
      example: 10 or 1abc
x-tagGroups:
  - name: Asset management
    tags:
      - Contact
      - Customer
      - Customer contract
  - name: Delayed connections
    tags:
      - Delayed connection
  - name: Project asset approvals
    tags:
      - Project asset approval
