openapi: 3.0.3
info:
  version: "2.3.3"
  title: Service Management
  description: API covers all operations related to service management.
paths:
  /v2/plans:
    post:
      tags:
        - "Plans"
      summary: Create plan
      description: Create a new service plan.
      operationId: CreateServicePlan
      parameters:
        - $ref: "#/components/parameters/systemOfMeasurement"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ServicePlan"
      responses:
        "201":
          description: Created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateServicePlanResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
    get:
      tags:
        - "Plans"
      summary: Get owned plans
      description: Returns the owned service plans.
      operationId: GetServicePlans
      parameters:
        - $ref: "#/components/parameters/systemOfMeasurement"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetServicePlansResponse"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/{servicePlanId}:
    parameters:
      - $ref: "#/components/parameters/ServicePlanIdInPath"
    get:
      tags:
        - "Plans"
      summary: Get plan
      description: Gets a service plan by ID.
      operationId: GetServicePlanById
      parameters:
        - $ref: "#/components/parameters/systemOfMeasurement"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetServicePlanByIdResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
    patch:
      tags:
        - "Plans"
      summary: Update plan
      description:
        Update service plan. Allowing partial updates where only the defined fields are taken into consideration. When
        updating planned services make sure to include all planned services since the list will be overwritten.
      operationId: UpdateServicePlanPartial
      parameters:
        - $ref: "#/components/parameters/systemOfMeasurement"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ServicePlanPartial"
      responses:
        "200":
          description: OK
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
    delete:
      tags:
        - "Plans"
      summary: Delete plan
      description: Delete the service plan.
      operationId: DeleteServicePlan
      responses:
        "200":
          description: OK
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/{servicePlanId}/options:
    parameters:
      - $ref: "#/components/parameters/ServicePlanIdInPath"
    get:
      tags:
        - "Plans"
      summary: Plan options
      description: Return the options for the given service plan.
      operationId: GetServicePlanOptions
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServicePlanOptions"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/{servicePlanId}/documents:
    parameters:
      - $ref: "#/components/parameters/ServicePlanIdInPath"
    post:
      tags:
        - "Plans"
      summary: Add document to plan
      description: Adds documents to the plan.
      operationId: AddServicePlanDocumentIds
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: AddServicePlanDocumentIdsRequest
              type: object
              required:
                - documentIds
              properties:
                documentIds:
                  type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/DocumentId"
                  description: List of document IDs.
      responses:
        "200":
          description: OK
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
    get:
      tags:
        - "Plans"
      summary: Get plan documents
      description: Gets the documents for the given service plan.
      operationId: GetServicePlanDocuments
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetServicePlanDocumentsResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/{servicePlanId}/documents/{documentId}:
    parameters:
      - $ref: "#/components/parameters/ServicePlanIdInPath"
      - $ref: "#/components/parameters/DocumentIdInPath"
    delete:
      tags:
        - "Plans"
      summary: Remove document from plan
      description: Deletes a document ID for the given service plan.
      operationId: DeleteServicePlanDocumentId
      responses:
        "200":
          description: OK
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/{servicePlanId}/documents/{documentId}/download:
    parameters:
      - $ref: "#/components/parameters/ServicePlanIdInPath"
      - $ref: "#/components/parameters/DocumentIdInPath"
    get:
      tags:
        - "Plans"
      summary: Download document from plan
      description: Download document from the service plan.
      operationId: DownloadServicePlanDocument
      responses:
        "200":
          $ref: "#/components/responses/SuccessfulFileDownload"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/{servicePlanId}/publication:
    parameters:
      - $ref: "#/components/parameters/ServicePlanIdInPath"
    get:
      tags:
        - "Plans"
      summary: Get publication
      description: Gets the publication for the given service plan.
      operationId: GetPublicationByServicePlanId
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetPublicationByServicePlanIdResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
    post:
      tags:
        - "Plans"
      summary: Create publication
      description:
        Publishes the provided service plan. It will thereby figure as the recommended service plans for the relevant
        brand and model combinations.
      operationId: PublishPlanById
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: PublishPlanByIdRequest
              type: object
              required:
                - supportedModels
              properties:
                supportedModels:
                  type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/SupportedModels"
                  description: List of supported models to make public plan eligible for.
      responses:
        "200":
          description: OK
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
    patch:
      tags:
        - "Plans"
      summary: Update publication
      description:
        Updates the publication for the given service plan. When updating the supported models field it is important to
        include all brands and models since the entire list will be overwritten.
      operationId: PatchServicePlanPublication
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PublicationPartial"
      responses:
        "200":
          description: OK
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
    delete:
      tags:
        - "Plans"
      summary: Delete publication
      description: Deletes the publication (unpublishes) for the given service plan.
      operationId: DeletePublicationByServicePlanId
      responses:
        "200":
          description: OK
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/{servicePlanId}/overlay:
    parameters:
      - $ref: "#/components/parameters/ServicePlanIdInPath"
    get:
      tags:
        - "Plans"
      summary: Get overlay
      description: Get overlay for the service plan. This is always in relation to your own account ID.
      operationId: GetServicePlanOverlay
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetServicePlanOverlayResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
    post:
      tags:
        - "Plans"
      summary: Create overlay
      description:
        Create overlay on the specified service plan. The overlay will only have effect on your own usage of the service
        plan.
      operationId: CreateServicePlanOverlay
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ServicePlanOverlay"
      responses:
        "200":
          description: Created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateServicePlanOverlayResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "409":
          $ref: "#/components/responses/ConflictError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
    patch:
      tags:
        - "Plans"
      summary: Update overlay
      description: Update overlay on the specified service plan. Only non null fields will be taken into account.
      operationId: UpdateServicePlanOverlayPartial
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ServicePlanOverlayPartial"
      responses:
        "200":
          description: Updated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UpdateServicePlanOverlayResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
    delete:
      tags:
        - "Plans"
      summary: Delete overlay
      description: Delete service plan overlay for the specified service plan.
      operationId: DeleteServicePlanOverlay
      responses:
        "200":
          description: Ok
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/{servicePlanId}/overlay/documents:
    parameters:
      - $ref: "#/components/parameters/ServicePlanIdInPath"
    post:
      tags:
        - "Plans"
      summary: Add document to overlay
      description: Add documents to a service plan overlay.
      operationId: AddServicePlanOverlayDocumentIds
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: AddServicePlanOverlayDocumentIdsRequest
              type: object
              required:
                - documentIds
              properties:
                documentIds:
                  type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/DocumentId"
                  description: List of document IDs.
      responses:
        "200":
          description: OK
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
    get:
      tags:
        - "Plans"
      summary: Get overlay documents
      description: Get documents from the overlay on this service plan.
      operationId: GetServicePlanOverlayDocuments
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetServicePlanOverlayDocumentsResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/{servicePlanId}/overlay/documents/{documentId}:
    parameters:
      - $ref: "#/components/parameters/ServicePlanIdInPath"
      - $ref: "#/components/parameters/DocumentIdInPath"
    delete:
      tags:
        - "Plans"
      summary: Remove document from overlay
      description: Deletes a document ID for the given service plan overlay.
      operationId: DeleteServicePlanOverlayDocumentId
      responses:
        "200":
          description: OK
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/{servicePlanId}/overlay/documents/{documentId}/download:
    parameters:
      - $ref: "#/components/parameters/ServicePlanIdInPath"
      - $ref: "#/components/parameters/DocumentIdInPath"
    get:
      tags:
        - "Plans"
      summary: Download document from overlay
      description: Download document from the service plan overlay.
      operationId: DownloadServicePlanOverlayDocument
      responses:
        "200":
          $ref: "#/components/responses/SuccessfulFileDownload"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/list:
    post:
      tags:
        - "Plans"
      summary: List plans
      description: Returns a list of service plan from the given service plan IDs.
      operationId: GetServicePlansByIds
      parameters:
        - $ref: "#/components/parameters/systemOfMeasurement"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: GetServicePlansByIdsRequest
              type: object
              required:
                - servicePlanIds
              properties:
                servicePlanIds:
                  type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/Id"
                  description: List of service plan IDs.
                  nullable: false
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetServicePlansByIdsResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/associated:
    get:
      tags:
        - "Plans"
      summary: Get associated plans
      description: Returns the service plans available through network association.
      operationId: GetAssociatedServicePlans
      parameters:
        - $ref: "#/components/parameters/systemOfMeasurement"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAssociatedServicePlansResponse"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/recommendation:
    get:
      tags:
        - "Plans"
      summary: Get recommended plan
      description: Returns the recommended (public) service plan for a given asset.
      operationId: GetRecommendedServicePlanForAsset
      parameters:
        - name: assetId
          in: query
          required: true
          description: ID of an asset.
          schema:
            $ref: "#/components/schemas/Id"
        - $ref: "#/components/parameters/systemOfMeasurement"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetRecommendedServicePlanForAssetResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/overlay/list:
    post:
      tags:
        - "Plans"
      summary: Get overlays
      description: Finds the service plan overlays for the given service plans.
      operationId: FindServicePlanOverlaysByServicePlanIds
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: FindServicePlanOverlaysByServicePlanIdsRequest
              type: object
              required:
                - servicePlanIds
              properties:
                servicePlanIds:
                  type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/Id"
                  description: List of service plan IDs to list service plan overlays status for
      responses:
        "200":
          description: List of service plan overlays for the given service plan IDs.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FindServicePlanOverlaysResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/publication/allowed-brands:
    get:
      tags:
        - "Plans"
      summary: Get allowed brands
      description: Returns the available brands for the requesting account to use for publications.
      operationId: GetAllowedBrands
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAllowedBrandsResponse"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"

  /providers:
    get:
      tags:
        - "Assignments"
      summary: Get providers
      parameters:
        - name: limitToSubAccounts
          in: query
          required: false
          schema:
            type: boolean
            default: false
          description: If true, only returns service providers that are sub-accounts of the invoking account.
      description: Returns all the accounts that can be assigned as providers.
      operationId: GetServiceProviders
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                title: GetAvailableServiceProvidersResponse
                type: object
                required:
                  - serviceProviders
                properties:
                  serviceProviders:
                    type: array
                    minItems: 1
                    items:
                      $ref: "#/components/schemas/ServiceProvider"
                    description: List of aggregated service plan usage.
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"

  /v2/plans/assignments:
    get:
      tags:
        - "Assignments"
      summary: Get assignments for asset
      description: Returns the service plan assignments for the given asset.
      operationId: GetAssignedServicePlanByAssetId
      parameters:
        - name: assetId
          in: query
          required: true
          description: Id of an asset
          schema:
            $ref: "#/components/schemas/Id"
        - $ref: "#/components/parameters/systemOfMeasurement"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAssignedServicePlanByAssetIdResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/assignments/list:
    post:
      tags:
        - "Assignments"
      summary: Get assignments
      description: List service plan assignments for the given assets.
      operationId: ListServicePlanAssignments
      parameters:
        - $ref: "#/components/parameters/systemOfMeasurement"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: GetServicePlanAssignmentsByAssetIdsRequest
              type: object
              required:
                - assetIds
              properties:
                assetIds:
                  type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/Id"
                  description: List of asset IDs to list assignments for.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetServicePlanAssignmentsByAssetIdsResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/assignments/options/list:
    post:
      tags:
        - "Assignments"
      summary: List options
      description: Returns the options for service plan assignments on the given asset list.
      operationId: GetServicePlanAssignmentOptions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: GetServicePlanAssignmentOptionsRequest
              type: object
              required:
                - assetIds
              properties:
                assetIds:
                  type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/Id"
                  description: List of asset IDs.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetServicePlanAssignmentOptionsResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/assignments/batch-update:
    post:
      deprecated: true
      tags:
        - "Assignments"
      summary: Update assignments
      description: Create, update and delete plan assignments in batch.
      operationId: CreateUpdateDeleteServicePlanAssignments
      parameters:
        - $ref: "#/components/parameters/systemOfMeasurement"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: CreateUpdateDeleteServicePlanAssignmentsRequest
              type: object
              properties:
                add:
                  type: array
                  minItems: 1
                  maxItems: 500
                  nullable: false
                  items:
                    $ref: "#/components/schemas/ServicePlanAssignmentUpdate"
                  description: List of service plan assignments to create or update.
                delete:
                  type: array
                  minItems: 1
                  maxItems: 500
                  nullable: false
                  items:
                    $ref: "#/components/schemas/AssetServicePlan"
                  description:
                    List of service plan assignments specified by asset ID and service plan ID to delete (remove).
      responses:
        "202":
          description: The change is received and accepted, but not fully propagated through-out the system.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateUpdateDeleteServicePlanAssignmentsResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/assignments/provider/assign:
    post:
      deprecated: true
      tags:
        - "Assignments"
      summary: Assign providers
      description:
        Assigns the invoking account as service provider for the given plans and assets. Existing assignments are
        overwritten.
      operationId: CreateOrUpdateServiceProviderAssignments
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: CreateOrUpdateServiceProviderAssignmentsRequest
              type: object
              required:
                - provideFor
              properties:
                provideFor:
                  type: array
                  minItems: 1
                  nullable: false
                  items:
                    $ref: "#/components/schemas/AssetServicePlan"
                  description:
                    List of service plan assignments specified by asset ID and service plan ID to provide for.
      responses:
        "202":
          description: The change is received and accepted, but not fully propagated through-out the system.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateOrUpdateServiceProviderAssignmentsResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/assignments/provider/unassign:
    post:
      tags:
        - "Assignments"
      summary: Unassign providers
      description: Unassigns service provider for the given service plans and asset list.
      operationId: UnassignServiceProviderAssignments
      parameters:
        - name: timeout
          required: false
          in: query
          schema:
            $ref: "#/components/schemas/Timeout"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: UnassignServiceProviderAssignmentsRequest
              type: object
              required:
                - unassign
              properties:
                unassign:
                  type: array
                  minItems: 1
                  nullable: false
                  items:
                    $ref: "#/components/schemas/AssetServicePlan"
                  description:
                    List of service plan assignments specified by asset ID and service plan ID to remove provider from.
      responses:
        "202":
          description: The change is received and accepted, but not fully propagated through-out the system.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UnassignServiceProviderAssignmentsResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/assignments/recommendation/list:
    post:
      tags:
        - "Assignments"
      summary: List assignable recommendations
      description: List assets with an assignable recommended service plan.
      operationId: GetAssetsAssignableFromRecommendation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: GetAssetsAssignableFromRecommendationRequest
              type: object
              properties:
                assetIds:
                  type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/Id"
                  description: List of asset IDs to check for an assignable recommended service plan.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAssetsAssignableFromRecommendationResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/assignments/recommendation:
    patch:
      tags:
        - "Assignments"
      summary: Assign recommended plan
      description: Create or updates plan assignments from recommended service plan.
      operationId: CreateOrUpdateServicePlanAssignmentsFromRecommendation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: CreateOrUpdateServicePlanAssignmentsFromRecommendationRequest
              type: object
              properties:
                assetIds:
                  type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/Id"
                  description: List of asset IDs.
                provideFor:
                  type: boolean
                  nullable: true
                  description:
                    True, if the plan assignment should be carried out by the invoking account. False, if provider
                    should be assigned at a later point. If excluded then new assignments will not have a provider and
                    existing assignments will keep their current provider.
      responses:
        "202":
          description: The change is received and accepted, but not fully propagated through-out the system.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateOrUpdateServicePlanAssignmentsFromRecommendationResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/assignments/service-status:
    get:
      tags:
        - "Assignments"
      summary: Get service statuses
      description: Returns the available statuses for the planned service for a given asset.
      operationId: GetPlannedServiceStatuses
      parameters:
        - name: assetId
          required: true
          in: query
          schema:
            $ref: "#/components/schemas/Id"
        - $ref: "#/components/parameters/systemOfMeasurement"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetPlannedServiceStatusesResponse"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/assignments/service-status/list:
    post:
      tags:
        - "Assignments"
      summary: List service statuses
      description: Finds the statuses of the planned services for the given asset list.
      operationId: GetPlannedServiceStatusByAssetIds
      parameters:
        - $ref: "#/components/parameters/systemOfMeasurement"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: GetPlannedServiceStatusByAssetIdsRequest
              type: object
              required:
                - assetIds
              properties:
                assetIds:
                  type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/Id"
                  description: List of asset IDs to list planned service status for.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetPlannedServiceStatusByAssetIdsResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/assignments/service-status/{serviceStatus}/assets:
    parameters:
      - $ref: "#/components/parameters/ServiceStatusInPath"
    get:
      tags:
        - "Assignments"
      summary: Get assets with service status
      description: Returns a list of asset IDs which has the given service status type.
      operationId: GetAssetsByServiceStatusType
      parameters:
        - $ref: "#/components/parameters/TuPageablePage"
        - $ref: "#/components/parameters/TuPageableSize"
        - $ref: "#/components/parameters/TuPageableSort"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAssetsByServiceStatusTypeResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"

  /assignments/batch-update:
    post:
      tags:
        - "Assignments"
      summary: Batch update assignments
      description: Create or updates plan assignments in batch.
      operationId: BatchUpdateAssignments
      parameters:
        - $ref: "#/components/parameters/systemOfMeasurement"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: BatchUpdateAssignmentsRequest
              type: object
              properties:
                serviceProviderId:
                  type: string
                  nullable: true
                  format: uuid
                  description: Should be given if provider need to be assigned. Null, if provider should be assigned at a later point. If null then new assignments will not have a provider and existing assignments will keep their current provider.
                add:
                  type: array
                  minItems: 1
                  maxItems: 500
                  nullable: false
                  items:
                    $ref: "#/components/schemas/ServicePlanAssignmentCreateUpdate"
                  description: List of service plan assignments to create or update.
      responses:
        "202":
          description: The change is received and accepted, but not fully propagated through-out the system.
          content:
            application/json:
              schema:
                title: BatchUpdateAssignmentsResponse
                type: object
                required:
                  - affectedAssetIds
                properties:
                  affectedAssetIds:
                    type: array
                    items:
                      $ref: "#/components/schemas/Id"
                    description: list of asset ids for which the plan assignment was changed
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"

  /assignments/batch-delete:
    delete:
      tags:
        - "Assignments"
      summary: Batch delete assignments
      description: Delete assignments in batch.
      operationId: BatchDeleteAssignments
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: BatchDeleteAssignmentsRequest
              type: object
              properties:
                delete:
                  type: array
                  minItems: 1
                  maxItems: 500
                  nullable: false
                  items:
                    $ref: "#/components/schemas/AssetServicePlan"
                  description:
                    List of service plan assignments specified by asset ID and service plan ID to delete (remove).
      responses:
        "202":
          description: The change is received and accepted, but not fully propagated through-out the system.
          content:
            application/json:
              schema:
                title: BatchDeleteAssignmentsResponse
                type: object
                required:
                  - affectedAssetIds
                properties:
                  affectedAssetIds:
                    type: array
                    items:
                      $ref: "#/components/schemas/Id"
                    description: list of asset ids for which the plan assignment was removed
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"

  /assignments/batch-update-provider:
    post:
      tags:
        - "Assignments"
      summary: Batch update provider
      description: Assigns the given account as service provider for the given plans and assets. Existing assignments are overwritten.
      operationId: BatchUpdateAssignmentsProvider
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: BatchUpdateAssignmentsProviderRequest
              type: object
              required:
                - serviceProviderId
                - add
              properties:
                serviceProviderId:
                  type: string
                  nullable: true
                  format: uuid
                  description: Must be given if provider need to be assigned. If null do nothing.
                provideFor:
                  type: array
                  minItems: 1
                  maxItems: 500
                  nullable: false
                  items:
                    $ref: "#/components/schemas/AssetServicePlan"
                  description:
                    List of service plan assignments specified by asset ID and service plan ID to provide for.
      responses:
        "202":
          description: The change is received and accepted, but not fully propagated through-out the system.
          content:
            application/json:
              schema:
                title: BatchUpdateAssignmentsProviderResponse
                type: object
                required:
                  - affectedAssetIds
                properties:
                  affectedAssetIds:
                    type: array
                    items:
                      $ref: "#/components/schemas/Id"
                    description: list of asset ids for which the service provider was updated
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"

  /assignments/validate-provider-asset-visibility:
    post:
      tags:
        - "Assignments"
      summary: Provider asset visibility
      description: Returns IDs of assets that the given service provider does not have visibility to.
      operationId: ValidateProviderAssetVisibility
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: ValidateProviderAssetVisibilityRequest
              type: object
              required:
                - assetIds
                - serviceProviderId
              properties:
                assetIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/AssetId"
                  description: List of asset IDs to check if having visibility to.
                serviceProviderId:
                  type: string
                  nullable: false
                  format: uuid
                  description: The provider ID for checking visibility for.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                title: ValidateProviderAssetVisibilityResponse
                type: object
                required:
                  - assetIdsNotVisibleToProvider
                properties:
                  assetIdsNotVisibleToProvider:
                    type: array
                    items:
                      $ref: "#/components/schemas/AssetId"
                    description: List of asset IDs which can't be assigned to given provider.
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"

  /assignments/validate-provider-plans-state:
    post:
      tags:
        - "Assignments"
      summary: Provider plans state
      description: Returns the options for service plan assignments on the given asset list for given provider.
      operationId: ValidateProviderPlansState
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: ValidateProviderPlansStateRequest
              type: object
              required:
                - assetIds
                - serviceProviderId
              properties:
                assetIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/AssetId"
                  description: List of asset IDs to check if having visibility to.
                serviceProviderId:
                  type: string
                  nullable: false
                  format: uuid
                  description: The provider for checking visibility for.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                title: ValidateProviderPlansStateResponse
                type: object
                required:
                  - servicePlansNotVisible
                  - servicePlansNotAssignableToProvider
                  - servicePlansWithOtherProvider
                  - servicePlansWithRequestedProvider
                  - servicePlansWithoutProvider
                properties:
                  servicePlansNotVisible:
                    deprecated: true
                    type: array
                    items:
                      $ref: "#/components/schemas/ServicePlanProviderOption"
                    description: 'Deprecated: use servicePlansNotAssignableToProvider. A list of service plans that cannot be assigned to a given provider.'
                  servicePlansNotAssignableToProvider:
                    type: array
                    items:
                      $ref: "#/components/schemas/ServicePlanProviderOption"
                    description: A list of service plans that cannot be assigned to a given provider.
                  servicePlansWithOtherProvider:
                    type: array
                    items:
                      $ref: "#/components/schemas/ServicePlanProviderOption"
                    description: A list of service plans that are already assigned to another provider.
                  servicePlansWithRequestedProvider:
                    type: array
                    items:
                      $ref: "#/components/schemas/ServicePlanProviderOption"
                    description: A list of service plans to which a given provider has already been assigned.
                  servicePlansWithoutProvider:
                    type: array
                    items:
                      $ref: "#/components/schemas/ServicePlanProviderOption"
                    description: A list of service plans that can be assigned to a given provider.
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"

  /v2/service-log/latest-service-time:
    post:
      deprecated: true
      summary: 'Returns latest service time of latest service log per asset. Deprecated: returns only classic service logs.'
      tags:
        - "Classic"
      operationId: GetLatestServiceLogServiceTimePerAsset
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: GetLatestServiceLogServiceTimePerAssetRequest
              type: object
              required:
                - assetIds
              properties:
                assetIds:
                  type: array
                  nullable: false
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/Id"
                  description: List of asset ids to list latest service time of latest service log for
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetLatestServiceLogServiceTimePerAssetResponse"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/assignments/service-registrations:
    post:
      tags:
        - "Registrations"
      summary: Register services
      description: Register service for the assets.
      operationId: RegisterService
      parameters:
        - name: timeout
          required: false
          in: query
          schema:
            $ref: "#/components/schemas/Timeout"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: RegisterServiceRequest
              type: object
              required:
                - assetId
              properties:
                assetId:
                  $ref: "#/components/schemas/Id"
                performedAt:
                  type: string
                  format: date-time
                  nullable: false
                  description:
                    "Intended for registering services back in time. If service is performed now/today this property 
                     should be left out."
                  example: "2021-09-20T06:09:09.621736Z"
                servicesPerformed:
                  type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/ServicePerformed"
                servicesSkipped:
                  type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/ServiceSkipped"
      responses:
        "202":
          description: The change is received and accepted, but not fully propagated through-out the system.
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v3/plans/assignments/service-registrations:
    post:
      tags:
        - "Registrations"
      summary: Register services (explicit values)
      description: >
        Register service for an asset using explicit performedAt, operatingHours, and distance values.
        All three are required and used directly without any insights lookup.
      operationId: RegisterServiceV2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: RegisterServiceV2Request
              type: object
              required:
                - assetId
                - performedAt
                - operatingHours
                - distance
              properties:
                assetId:
                  $ref: "#/components/schemas/Id"
                performedAt:
                  type: string
                  format: date-time
                  nullable: false
                  description: "The exact time the service was performed."
                  example: "2021-09-20T06:09:09.621736Z"
                operatingHours:
                  type: integer
                  nullable: false
                  description: "The operating hours on the asset at time of service."
                  example: 1500
                distance:
                  type: integer
                  nullable: false
                  description: "The distance on the asset at time of service."
                  example: 12345
                servicesPerformed:
                  type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/ServicePerformed"
                servicesSkipped:
                  type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/ServiceSkipped"
      responses:
        "200":
          description: OK
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v3/plans/assignments/service-registrations/update:
    post:
      tags:
        - "Registrations"
      summary: Update most recent service registration (explicit values)
      description: >
        Update the most recent service registration for a planned service on an asset using explicit
        performedAt, operatingHours, and distance values. All three are used directly without any insights lookup.
      operationId: UpdateServiceV2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: UpdateServiceV2Request
              type: object
              required:
                - assetId
                - serviceRegistrationId
                - performedAt
                - operatingHours
                - distance
                - servicePerformed
              properties:
                assetId:
                  $ref: "#/components/schemas/Id"
                serviceRegistrationId:
                  $ref: "#/components/schemas/ServiceRegistrationId"
                performedAt:
                  type: string
                  format: date-time
                  nullable: false
                  description: "The exact time the service was performed."
                  example: "2021-09-20T06:09:09.621736Z"
                operatingHours:
                  type: integer
                  nullable: false
                  description: "The operating hours on the asset at time of service."
                  example: 1500
                distance:
                  type: integer
                  nullable: false
                  description: "The distance on the asset at time of service."
                  example: 12345
                servicePerformed:
                  $ref: "#/components/schemas/ServicePerformed"
      responses:
        "200":
          description: OK
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v3/plans/assignments/service-registrations/check/{assetId}:
    get:
      tags:
        - "Registrations"
      summary: Resolve service insights
      description: >
        Resolves insights for an asset from operating hours, distance, or a date.
        Exactly one of operatingHours, distance, or performedAt must be provided.
      operationId: ResolveServiceInsights
      parameters:
        - name: assetId
          in: path
          required: true
          description: ID of the asset.
          schema:
            $ref: "#/components/schemas/Id"
        - name: operatingHours
          in: query
          required: false
          description: The operating hours value to resolve. Mutually exclusive with performedAt and distance.
          schema:
            type: integer
            example: 1500
        - name: performedAt
          in: query
          required: false
          description: The date-time to look up insights for. Mutually exclusive with operatingHours and distance.
          schema:
            type: string
            format: date-time
            example: "2021-09-20T06:09:09.621736Z"
        - name: distance
          in: query
          required: false
          description: The distance value to resolve. Mutually exclusive with operatingHours and performedAt.
          schema:
            type: integer
            example: 12345
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResolveServiceInsightsResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/plans/assignments/service-registrations/list:
    post:
      deprecated: true
      tags:
        - "Registrations"
      summary: List registrations
      description: Finds the service registrations for the given asset list.
      operationId: GetServiceRegistrations
      parameters:
        - $ref: "#/components/parameters/systemOfMeasurement"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: GetServiceRegistrationsRequest
              type: object
              required:
                - assetIds
              properties:
                assetIds:
                  type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/Id"
                  description: List of asset IDs to list service registrations for.
                from:
                  type: string
                  format: date-time
                  description: Filter to registrations with a service time on or after this date/time (inclusive). Optional.
                to:
                  type: string
                  format: date-time
                  description: Filter to registrations with a service time on or before this date/time (inclusive). Optional.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetServiceRegistrationsResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"

  /booking:
    post:
      tags:
        - "Booking"
      summary: Make booking
      description: Makes a booking at the specified planned service.
      operationId: MakeBooking
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: MakeBookingRequest
              type: object
              required:
                - assetId
                - plannedServiceId
              properties:
                assetId:
                  $ref: "#/components/schemas/Id"
                plannedServiceId:
                  $ref: "#/components/schemas/PlannedServiceId"
                bookingTime:
                  type: string
                  format: date-time
                  nullable: true
                  example: "2024-09-20T06:09:09.621736Z"
      responses:
        "200":
          description: OK
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
    delete:
      tags:
        - "Booking"
      summary: Cancel booking
      description: Cancels a booking at the specified planned service.
      operationId: CancelBooking
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: CancelBookingRequest
              type: object
              required:
                - assetId
                - plannedServiceId
              properties:
                assetId:
                  $ref: "#/components/schemas/Id"
                plannedServiceId:
                  $ref: "#/components/schemas/PlannedServiceId"
      responses:
        "200":
          description: OK
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"

  /v3/plans/assignments/service-registrations/list:
    post:
      tags:
        - "Registrations"
      summary: List registrations
      description: |
        Finds the service registrations for the given asset list. To download files use:
        /plans/assignments/service-registrations/{serviceRegistrationId}/documents/{documentId}/download.
      operationId: GetServiceRegistrationsV3
      parameters:
        - $ref: "#/components/parameters/systemOfMeasurement"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: GetServiceRegistrationsRequestV3
              type: object
              required:
                - assetIds
              properties:
                assetIds:
                  type: array
                  minItems: 1
                  items:
                    $ref: "#/components/schemas/Id"
                  description: List of asset IDs to list service registrations for.
                from:
                  type: string
                  format: date-time
                  description: Filter to registrations with a service time on or after this date/time (inclusive). Optional.
                to:
                  type: string
                  format: date-time
                  description: Filter to registrations with a service time on or before this date/time (inclusive). Optional.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetServiceRegistrationsResponseV3"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"

  /plans/assignments/service-registrations/{serviceRegistrationId}/documents/{documentId}/download:
    parameters:
      - $ref: "#/components/parameters/ServiceRegistrationIdInPath"
      - $ref: "#/components/parameters/DocumentIdInPath"
      - $ref: "#/components/parameters/systemOfMeasurement"
    get:
      tags:
        - "Registrations"
      summary: Download document from registration
      description: Download document from the registration.
      operationId: DownloadServiceRegistrationDocument
      responses:
        "200":
          $ref: "#/components/responses/SuccessfulFileDownload"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/networks:
    post:
      tags:
        - "Networks"
      summary: Create network
      description: Create a new service network.
      operationId: CreateServiceNetwork
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: CreateServiceNetworkRequest
              type: object
              required:
                - networkName
              properties:
                networkName:
                  $ref: "#/components/schemas/ServiceNetworkName"
                servicePlanIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/ServicePlanId"
                  description: List of service plan IDs.
                serviceProviderIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/ServiceProviderAccountId"
                  description: List of service provider IDs.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateServiceNetworkResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
    get:
      tags:
        - "Networks"
      summary: Get owned networks
      description: Returns owned service networks.
      operationId: GetServiceNetworks
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetServiceNetworksResponse"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/networks/{serviceNetworkId}:
    parameters:
      - $ref: "#/components/parameters/ServiceNetworkIdInPath"
    get:
      tags:
        - "Networks"
      summary: Get network
      description: Get network details by ID.
      operationId: GetServiceNetworkById
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetServiceNetworkByIdResponse"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
    patch:
      tags:
        - "Networks"
      summary: Update network
      description:
        Update the service network. Only defined fields are taking into consideration. When updating service plan and
        provider IDs it's important to include all plans and providers since the full list will be overwritten.
      operationId: UpdateServiceNetworkPartial
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: UpdateServiceNetworkRequestPartial
              type: object
              properties:
                networkName:
                  $ref: "#/components/schemas/ServiceNetworkName"
                servicePlanIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/ServicePlanId"
                  description: List of service plan IDs.
                serviceProviderIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/ServiceProviderAccountId"
                  description: List of service provider IDs.
      responses:
        "200":
          description: OK
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
    delete:
      tags:
        - "Networks"
      summary: Delete network
      description: Delete service network by ID.
      operationId: DeleteServiceNetwork
      responses:
        "200":
          description: OK
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/networks/{serviceNetworkId}/plans:
    parameters:
      - $ref: "#/components/parameters/ServiceNetworkIdInPath"
    get:
      deprecated: true
      tags:
        - "Networks"
      summary: Get plans in network
      description:
        "Deprecated use GET /networks/{serviceNetworkId} and /plans/list instead. Returns service plans within the network."
      operationId: GetServicePlansByNetwork
      parameters:
        - $ref: "#/components/parameters/systemOfMeasurement"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetServicePlansByNetworkResponse"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
    patch:
      tags:
        - "Networks"
      summary: Add/remove plans
      operationId: AddOrRemovePlansFromNetwork
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: AddOrRemovePlansFromNetworkRequest
              type: object
              properties:
                add:
                  type: array
                  items:
                    $ref: "#/components/schemas/ServicePlanId"
                  description: List of service plan IDs to add.
                remove:
                  type: array
                  items:
                    $ref: "#/components/schemas/ServicePlanId"
                  description: List of service plan IDs to remove.
      responses:
        "200":
          description: OK
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/networks/{serviceNetworkId}/providers:
    parameters:
      - $ref: "#/components/parameters/ServiceNetworkIdInPath"
    get:
      deprecated: true
      tags:
        - "Networks"
      summary: Get providers in network
      description: "Deprecated: use /networks/{serviceNetworkId} instead. Returns account IDs of all service providers within the network."
      operationId: GetServiceNetworkProviders
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetServiceProvidersResponse"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
    patch:
      tags:
        - "Networks"
      summary: Add/remove providers
      operationId: AddOrRemoveProvidersFromNetwork
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: AddOrRemoveProvidersFromNetworkRequest
              type: object
              properties:
                add:
                  type: array
                  items:
                    $ref: "#/components/schemas/ServiceProviderAccountId"
                  description: List of service provider IDs to add.
                remove:
                  type: array
                  items:
                    $ref: "#/components/schemas/ServiceProviderAccountId"
                  description: List of service provider IDs to remove.
      responses:
        "200":
          description: OK
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /v2/networks/associated:
    get:
      tags:
        - "Networks"
      summary: Get associated networks
      description:
        Associated service networks are networks, which the caller is associated with as a service provider, but not as
        a network owner.
      operationId: GetAssociatedServiceNetworks
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAssociatedServiceNetworksResponse"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
  /files:
    post:
      tags:
        - "Files"
      summary: Uploads a file.
      operationId: Upload
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                title: UploadFileResponse
                type: object
                required:
                  - id
                  - name
                properties:
                  id:
                    $ref: "#/components/schemas/Id"
                  name:
                    type: string
                description: "Response containing ID for the uploaded file."
                nullable: false
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "413":
          $ref: "#/components/responses/PayloadTooLargeErrorResponse"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"

  /notification-subscriptions:
    get:
      tags:
        - "Notification Subscription"
      operationId: getNotificationSubscriptions
      summary: Get notification subscriptions
      parameters:
        - name: page
          in: query
          required: false
          description: Zero-based page index (0..N)
          example: 0
          schema:
            minimum: 0
            type: integer
            format: int32
            default: 0
        - name: size
          in: query
          required: false
          description: The size of the page to be returned
          example: 20
          schema:
            minimum: 1
            type: integer
            format: int32
            default: 20
        - name: sort
          description: "Sort order: `property` (ascending by default), `+property` (ascending), `-property` (descending)."
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                title: GetNotificationSubscriptionsResponse
                type: object
                required:
                  - content
                  - number
                  - numberOfElements
                  - size
                  - totalElements
                  - totalPages
                properties:
                  content:
                    type: array
                    items:
                      $ref: "#/components/schemas/NotificationSubscriptionResponse"
                  number:
                    type: integer
                    description: "The number of the current page."
                    format: int32
                  numberOfElements:
                    type: integer
                    description: "The number of elements currently on this page."
                    format: int32
                  size:
                    type: integer
                    description: "The size of the page."
                    format: int32
                  totalElements:
                    type: integer
                    description: "The total number of elements."
                    format: int64
                  totalPages:
                    type: integer
                    description: "The number of total pages."
                    format: int32
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
    post:
      tags:
        - "Notification Subscription"
      operationId: createNotificationSubscription
      summary: Create notification subscription
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NotificationSubscriptionCreation"
      responses:
        "201":
          description: Created
          content:
            application/json:
              schema:
                title: CreateNotificationSubscriptionResponse
                type: object
                required:
                  - subscription
                properties:
                  subscription:
                    $ref: "#/components/schemas/NotificationSubscriptionResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"

  /notification-subscriptions/{subscriptionId}:
    parameters:
      - name: subscriptionId
        required: true
        in: path
        schema:
          $ref: "#/components/schemas/SubscriptionId"
    get:
      tags:
        - "Notification Subscription"
      operationId: getNotificationSubscription
      summary: Get notification subscription
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                title: GetNotificationSubscriptionResponse
                type: object
                required:
                  - subscription
                properties:
                  subscription:
                    $ref: "#/components/schemas/NotificationSubscriptionResponse"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
    patch:
      tags:
        - "Notification Subscription"
      operationId: updateNotificationSubscription
      summary: Update notification subscription
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NotificationSubscriptionUpdate"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                title: UpdateNotificationSubscriptionResponse
                type: object
                required:
                  - subscription
                properties:
                  subscription:
                    $ref: "#/components/schemas/NotificationSubscriptionResponse"
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "404":
          $ref: "#/components/responses/NotFoundError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"
    delete:
      tags:
        - "Notification Subscription"
      operationId: deleteNotificationSubscription
      summary: Delete notification subscription
      responses:
        "204":
          description: No content
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"

  /v2beta1/service-triggers/fire:
    post:
      tags:
        - "Service Triggered"
      summary: Fire an external service trigger
      description: |
        Beta (`v2beta1`). Contract may change until GA.

        Makes the planned service due for this asset. Pass the trigger ID from the service plan and the asset ID. A well-formed request always returns an empty 200.
      operationId: FireServiceTrigger
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FireServiceTriggerRequest"
      responses:
        "200":
          description: Fire command received.
        "400":
          $ref: "#/components/responses/BadRequestError"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "403":
          $ref: "#/components/responses/ForbiddenError"
        "429":
          $ref: "#/components/responses/RateLimitError"
        "500":
          $ref: "#/components/responses/InternalServerError"
        "504":
          $ref: "#/components/responses/UpstreamTimeoutError"

components:
  parameters:
    ServiceNetworkIdInPath:
      name: serviceNetworkId
      in: path
      required: true
      description: ID of service network.
      schema:
        $ref: "#/components/schemas/ServiceNetworkId"
    ServicePlanIdInPath:
      name: servicePlanId
      in: path
      required: true
      description: ID of service plan.
      schema:
        $ref: "#/components/schemas/ServicePlanId"
    ServiceRegistrationIdInPath:
      name: serviceRegistrationId
      in: path
      required: true
      description: ID of service registration.
      schema:
        $ref: "#/components/schemas/Id"
    DocumentIdInPath:
      name: documentId
      in: path
      required: true
      description: ID of document.
      schema:
        $ref: "#/components/schemas/DocumentId"
    ServiceStatusInPath:
      name: serviceStatus
      in: path
      required: true
      schema:
        $ref: "#/components/schemas/ServiceStatusType"
    TuPageablePage:
      name: page
      in: query
      required: false
      description: "Zero-based page index (0..N)"
      schema:
        type: integer
        nullable: false
    TuPageableSize:
      name: size
      in: query
      required: false
      description: "The size of the page to be returned"
      schema:
        type: integer
        maximum: 3000
        nullable: false
    TuPageableSort:
      name: sort
      in: query
      required: false
      description: "<Sort order: `property` (ascending by default), `+property` (ascending), `-property` (descending)>."
      schema:
        type: array
        items:
          type: string
        minItems: 1
        nullable: false
    systemOfMeasurement:
      in: header
      name: systemOfMeasurement
      required: false
      description: My system of measurement
      schema:
        type: string
        enum: [ SI, US_CUSTOMARY ]
        default: SI

  responses:
    SuccessfulFileDownload:
      description: OK
      content:
        application/octet-stream:
          schema:
            type: string
            format: binary
    InternalServerError:
      description: A server error has occurred
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    BadRequestError:
      description: "Error occurred while processing service plan"
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    NotFoundError:
      description: "The resource is not found"
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    UnauthorizedError:
      description: "Access token is missing or invalid"
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    ForbiddenError:
      description: "User is not allowed to make this request"
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    ConflictError:
      description:
        Request could not be processed due to a conflict. This could e.g. be creating a new overlay when one already
        exists.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    PayloadTooLargeErrorResponse:
      description: Payload exceeded max size
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/PayloadTooLargeError"
    UpstreamTimeoutError:
      description: "Upstream request timeout"
    RateLimitError:
      description: "Rate limit exceeded"

  schemas:
    GetAssetsByServiceStatusTypeResponse:
      type: object
      required:
        - content
      properties:
        assetIds:
          deprecated: true
          type: array
          items:
            $ref: "#/components/schemas/Id"
          description: List of asset IDs with the given status type.
        content:
          type: array
          items:
            $ref: "#/components/schemas/Id"
          description: List of asset IDs with the given status type.
      allOf:
        - $ref: "#/components/schemas/Paginated"

    Error:
      type: "object"
      required:
        - status
        - message
      properties:
        status:
          type: integer
          format: int32
          description: HTTP response status
          nullable: false
          example: 500
        message:
          type: "string"
          description: "Technical error description (not for end user)"
          nullable: false
          example: "Something went wrong"
        code:
          type: string
          description: "Code identifying the error"
          example: "INTERNAL_SERVER_ERROR"
    PayloadTooLargeError:
      type: object
      properties:
        maxFileSize:
          type: string
          nullable: false
          description: "Max allowed file size"
          example: "20MB"
      allOf:
        - $ref: "#/components/schemas/Error"

    Paginated:
      type: object
      properties:
        totalPages:
          type: integer
          nullable: false
          description: "The number of total pages."
        totalElements:
          type: integer
          nullable: false
          description: "The total number of elements."
        number:
          type: integer
          nullable: false
          description: "The number of the current page."
        size:
          type: integer
          nullable: false
          description: "The size of the page."
        numberOfElements:
          type: integer
          nullable: false
          description: "The number of elements currently on this page."

    # Model

    Id:
      type: string
      format: uuid
      description: "Unique identifier"
      nullable: false
      example: "6037a205-927c-4937-8b05-602c4f677929"

    Metadata:
      type: object
      required:
        - createdAt
      properties:
        createdAt:
          type: string
          format: date-time
          nullable: false
          example: "2021-09-20T06:09:09.621736Z"
        updatedAt:
          type: string
          format: date-time
          nullable: false
          example: "2021-09-25T12:14:03.321736Z"
    ServiceCriteria:
      type: object
      properties:
        distanceCriteria:
          $ref: "#/components/schemas/DistanceCriteria"
        timeIntervalCriteria:
          $ref: "#/components/schemas/TimeIntervalCriteria"
        cumulativeOperatingHoursCriteria:
          $ref: "#/components/schemas/CumulativeOperatingHoursCriteria"
        externalCriteria:
          $ref: "#/components/schemas/ExternalCriteria"
      nullable: false

    IdentifiableServiceCriteria:
      type: object
      properties:
        distanceCriteria:
          $ref: "#/components/schemas/IdentifiableDistanceCriteria"
        timeIntervalCriteria:
          $ref: "#/components/schemas/IdentifiableTimeIntervalCriteria"
        cumulativeOperatingHoursCriteria:
          $ref: "#/components/schemas/IdentifiableCumulativeOperatingHoursCriteria"
        externalCriteria:
          $ref: "#/components/schemas/IdentifiableExternalCriteria"
      nullable: false

    IdentifiableDistanceCriteria:
      type: object
      required:
        - id
      properties:
        id:
          $ref: "#/components/schemas/Id"
      allOf:
        - $ref: "#/components/schemas/DistanceCriteria"

    IdentifiableTimeIntervalCriteria:
      type: object
      required:
        - id
      properties:
        id:
          $ref: "#/components/schemas/Id"
      allOf:
        - $ref: "#/components/schemas/TimeIntervalCriteria"

    IdentifiableCumulativeOperatingHoursCriteria:
      type: object
      required:
        - id
      properties:
        id:
          $ref: "#/components/schemas/Id"
      allOf:
        - $ref: "#/components/schemas/CumulativeOperatingHoursCriteria"

    ExternalCriteria:
      type: object
      description: Can be fired via triggerId to trigger the service.

    IdentifiableExternalCriteria:
      type: object
      required:
        - id
      properties:
        id:
          $ref: "#/components/schemas/Id"
        triggerId:
          $ref: "#/components/schemas/Id"
          description: Used to fire this External criterion.

    FireServiceTriggerRequest:
      type: object
      required:
        - assetId
        - triggerId
      properties:
        assetId:
          $ref: "#/components/schemas/Id"
        triggerId:
          $ref: "#/components/schemas/Id"

    ServiceCriteriaOverlay:
      type: object
      required:
        - serviceCriteriaId
        - overriddenNotifyBefore
      properties:
        serviceCriteriaId:
          $ref: "#/components/schemas/Id"
        overriddenNotifyBefore:
          type: integer
          format: int32
          nullable: false
          description: "Depending on referenced service criteria the days, operating hours or km prior to service to flags an upcoming service. For example given a serviceHours of 500 hours and a overriddenNotifyBefore of 50 (hours) then at 450 operating hours the asset is flagged for upcoming service."
          example: "50"

    PlannedServiceStatusCriteriaCumulativeOperatingHours:
      type: object
      properties:
        criteria:
          $ref: "#/components/schemas/IdentifiableCumulativeOperatingHoursCriteria"
        triggered:
          type: boolean
          default: false
    PlannedServiceStatusCriteriaDistance:
      type: object
      properties:
        criteria:
          $ref: "#/components/schemas/IdentifiableDistanceCriteria"
        triggered:
          type: boolean
          default: false
    PlannedServiceStatusCriteriaTime:
      type: object
      properties:
        criteria:
          $ref: "#/components/schemas/IdentifiableTimeCriteria"
        triggered:
          type: boolean
          default: false

    IdentifiableTimeCriteria:
      type: object
      required:
        - id
      properties:
        id:
          $ref: "#/components/schemas/Id"
      allOf:
        - $ref: "#/components/schemas/TimeCriteria"

    TimeCriteria:
      type: object
      required:
        - serviceTime
      properties:
        notifyDaysBefore:
          type: integer
          format: int32
          nullable: false
          description: The number of days before the actual serviceTime where a notification will be created.
          example: "50"
        serviceTime:
          type: string
          format: date-time
          description: A specific service time.
          nullable: false
          example: "2021-09-25T12:14:03.321736Z"

    DistanceCriteria:
      type: object
      required:
        - serviceDistance
      properties:
        notifyDistanceBefore:
          type: integer
          format: int32
          nullable: false
          description:
            Distance in kilometers prior to serviceDistance to flags an upcoming service. Given a serviceDistance of
            5000 km and a notifyDistanceBefore of 200 km then at 4800 km of distance the asset is flagged for upcoming
            service.
          example: "50"
        serviceDistance:
          type: integer
          format: int32
          nullable: false
          description: Distance in kilometers.
          example: "500"

    CumulativeOperatingHoursCriteria:
      type: object
      required:
        - serviceHours
      properties:
        notifyHoursBefore:
          type: integer
          format: int32
          nullable: false
          minimum: 0
          description: "Hours prior to service hours to flags an upcoming service. Given a serviceHours of 500 hours and a notifyHoursBefore of 50 hours then at 450 operating hours the asset is flagged for upcoming service"
          example: "75"
        serviceHours:
          type: integer
          format: int32
          nullable: false
          minimum: 0
          description: "Cumulative operating hours in hours"
          example: "700"

    TimeIntervalCriteria:
      type: object
      required:
        - serviceIntervalValue
        - serviceIntervalType
      properties:
        notifyDaysBefore:
          type: integer
          format: int32
          nullable: false
          minimum: 0
          exclusiveMinimum: true
          description: "Days prior to service interval to flags an upcoming service"
          example: "14"
        serviceIntervalValue:
          type: integer
          format: int32
          nullable: false
          description: "Deadline interval for service. After this interval since the last service, the asset will be overdue for service."
          example: "180"
        serviceIntervalType:
          $ref: "#/components/schemas/TimeIntervalType"


    TimeIntervalType:
      type: string
      enum:
        - DAYS
        - MONTHS
        - YEARS
      description: "The unit of measurement for this time interval"
      example: "DAYS"

    PlannedServiceStatusForAsset:
      type: object
      required:
        - assetId
        - plannedServiceStatus
      properties:
        assetId:
          $ref: "#/components/schemas/Id"
        plannedServiceStatus:
          type: array
          minItems: 0
          items:
            $ref: "#/components/schemas/PlannedServiceStatus"
          nullable: false

    PlannedServiceName:
      type: string
      minLength: 1
      maxLength: 255
      nullable: false
      description: "Name of the planned service"
      example: "Yearly Service"

    PlannedServiceStatus:
      type: object
      required:
        - servicePlanId
        - plannedServiceId
        - serviceProviderAccountId
        - status
      properties:
        servicePlanId:
          $ref: "#/components/schemas/ServicePlanId"
        plannedServiceId:
          $ref: "#/components/schemas/PlannedServiceId"
        serviceProviderAccountId:
          $ref: "#/components/schemas/ServiceProviderAccountId"
        cumulativeOperatingHoursCriteria:
          $ref: "#/components/schemas/PlannedServiceStatusCriteriaCumulativeOperatingHours"
        distanceCriteria:
          $ref: "#/components/schemas/PlannedServiceStatusCriteriaDistance"
        timeCriteria:
          $ref: "#/components/schemas/PlannedServiceStatusCriteriaTime"
        triggeredAt:
          type: string
          format: date-time
          nullable: false
          example: "2021-09-20T06:09:09.621736Z"
        status:
          type: string
          x-extensible-enum:
            - PLANNED
            - UPCOMING
            - OVERDUE
            - UNKNOWN
          nullable: false
        name:
          $ref: "#/components/schemas/PlannedServiceName"
        predictionCriteria:
          type: string
          x-extensible-enum:
            - DISTANCE
            - CUMULATIVE_OPERATING_HOURS
            - TIME_INTERVAL
          nullable: true
          description: "Criteria that is expected to go overdue at the predicted time"
        predictedServiceTime:
          type: string
          format: date-time
          nullable: true
          example: "2021-09-20T06:09:09.621736Z"
          description: "Estimated time in which the service will have to be performed."
        predictedAt:
          type: string
          format: date-time
          nullable: true
          example: "2021-09-20T06:09:09.621736Z"
          description: "Time when prediction for service was calculated."
        booked:
          type: boolean
          default: false
        bookingDate:
          type: string
          format: date-time
          nullable: true
          example: "2021-09-20T06:09:09.621736Z"
          description: "The date-time that the service is scheduled for."

    PlannedService:
      type: object
      required:
        - serviceCriteria
      properties:
        id:
          $ref: "#/components/schemas/PlannedServiceId"
          description: "ID of existing planned service that is being edited, or null if this is a new service."
        serviceCriteria:
          $ref: "#/components/schemas/ServiceCriteria"
        recurrent:
          type: boolean
          default: false
          description: If 'true' then the service is planned recurrently. Otherwise the planned service is planned once.
          example: "true"
        offset:
          type: boolean
          default: false
          description:
            If 'true' then the service is planned offset from the latest service registration. Otherwise the planned
            service is fixed to the given number.
          example: "true"
        name:
          $ref: "#/components/schemas/PlannedServiceName"
        notifyPredictedDaysBefore:
          type: integer
          format: int32
          example: "30"
          description: "Days before service interval to mark upcoming service based on predicted due date."
        notes:
          type: string
          description: "Service level instructions for the planned service."
          example: "Check fluid levels, replace oil filter and perform oil change."

    IdentifiablePlannedService:
      required:
        - id
        - serviceCriteria
        - recurrent
        - offset
      properties:
        id:
          $ref: "#/components/schemas/PlannedServiceId"
        serviceCriteria:
          $ref: "#/components/schemas/IdentifiableServiceCriteria"
        recurrent:
          type: boolean
          description: "If 'true' then the service is planned recurrently. Otherwise the planned service is planned once."
          example: "true"
        offset:
          type: boolean
          description: "If 'true' then the service is planned offset from the latest service registration. Otherwise the planned service is fixed to the given number."
          example: "true"
        name:
          type: string
          minLength: 1
          maxLength: 255
          nullable: false
          description: "Name of the planned service"
          example: "Yearly Service"
        notifyPredictedDaysBefore:
          type: integer
          format: int32
          example: "30"
          description: "Days before service interval to mark upcoming service based on predicted due date."
        notes:
          type: string
          description: "Service level instructions for the planned service."
          example: "Check fluid levels, replace oil filter and perform oil change."

    ServicePlanName:
      type: string
      minLength: 1
      example: "My Plan Name"
      nullable: false

    StoredServicePlan:
      required:
        - id
        - metadata
        - plannedServices
        - name
        - isPublic
        - isOwner
        - oemOfficial
      properties:
        id:
          $ref: "#/components/schemas/ServicePlanId"
        metadata:
          $ref: "#/components/schemas/Metadata"
        plannedServices:
          type: array
          minItems: 1
          items:
            $ref: "#/components/schemas/IdentifiablePlannedService"
        name:
          $ref: "#/components/schemas/ServicePlanName"
        description:
          type: string
          minLength: 1
          maxLength: 10000
          example: "My Service Note"
          nullable: false
        isPublic:
          deprecated: true
          type: boolean
          example: true
          description: "Deprecated: use oemOfficial. Whether the plan is public"
          nullable: false
        isOwner:
          type: boolean
          example: true
          description: "Whether the plan is owned by the calling account"
          nullable: false
        oemOfficial:
          type: boolean
          example: true
          description: "Whether the plan was published as OEM official plan"
          nullable: false
        headRevision:
          $ref: "#/components/schemas/ServicePlanRevision"

    ServicePlanRevision:
      type: object
      description: "A revision of a service plan, representing a point-in-time version of the plan."
      required:
        - id
        - plannedServices
      properties:
        id:
          type: string
          format: uuid
          description: "Unique identifier of the revision."
          example: "6037a205-927c-4937-8b05-602c4f677929"
        sequence:
          type: integer
          format: int32
          nullable: true
          description: "Monotonically increasing sequence number of the revision within the plan."
          example: 3
        effectiveFrom:
          type: string
          format: date-time
          nullable: true
          description: "Timestamp from which this revision is effective."
          example: "2021-09-20T06:09:09.621736Z"
        effectiveTo:
          type: string
          format: date-time
          nullable: true
          description: "Timestamp until which this revision was effective, if it has been superseded."
          example: "2021-09-25T12:14:03.321736Z"
        plannedServices:
          type: array
          description: "List of planned services as captured in this revision."
          items:
            $ref: "#/components/schemas/IdentifiablePlannedService"

    ServicePlanPartial:
      properties:
        name:
          type: string
          minLength: 1
          example: "My Plan Name"
        plannedServices:
          type: array
          minItems: 1
          items:
            $ref: "#/components/schemas/PlannedService"
        description:
          type: string
          minLength: 1
          maxLength: 10000
          example: "My PLan Description"
        baseRevisionId:
          type: string
          format: uuid
          nullable: true
          description: "The ID of the revision this edit is based on."
          example: "6037a205-927c-4937-8b05-602c4f677929"

    ServicePlan:
      required:
        - name
        - plannedServices
      properties:
        name:
          $ref: "#/components/schemas/ServicePlanName"
        plannedServices:
          type: array
          minItems: 1
          items:
            $ref: "#/components/schemas/PlannedService"
          nullable: false
        description:
          type: string
          minLength: 1
          maxLength: 10000
          example: "My PLan Description"
          nullable: false

    ServicePlanOverlayPartial:
      properties:
        serviceCriteriaOverlays:
          type: array
          nullable: false
          minItems: 1
          items:
            $ref: "#/components/schemas/ServiceCriteriaOverlay"
        documentIds:
          type: array
          nullable: false
          minItems: 1
          items:
            $ref: "#/components/schemas/DocumentId"
        overriddenNotifyPredictedDaysBefore:
          type: integer
          format: int32
          example: "30"
          description: "Days before service interval to mark upcoming service based on predicted due date."

    ServicePlanOverlay:
      required:
        - serviceCriteriaOverlays
      allOf:
        - $ref: "#/components/schemas/ServicePlanOverlayPartial"

    IdentifiableServicePlanOverlay:
      required:
        - id
        - servicePlanId
      properties:
        id:
          $ref: "#/components/schemas/Id"
        servicePlanId:
          $ref: "#/components/schemas/ServicePlanId"
      allOf:
        - $ref: "#/components/schemas/ServicePlanOverlay"

    ServiceNetworkId:
      type: string
      format: uuid
      description: "Id of a Service Provider Network"
      nullable: false
      example: "e62824ba-6e60-48cf-b4d1-07204fe9ab56"

    ServiceProviderAccountId:
      type: string
      format: uuid
      description: "Account Id of Service Provider"
      nullable: false
      example: "e62824ba-6e60-48cf-b4d1-07204fe9ab56"

    ServiceNetwork:
      type: object
      required:
        - id
        - name
        - owner
        - servicePlanIds
        - serviceProviderIds
      properties:
        id:
          $ref: "#/components/schemas/Id"
        name:
          $ref: "#/components/schemas/ServiceNetworkName"
        owner:
          $ref: "#/components/schemas/ServiceProviderAccountId"
        servicePlanIds:
          type: array
          items:
            $ref: "#/components/schemas/ServicePlanId"
          description: List of service plan IDs.
          nullable: false
        serviceProviderIds:
          type: array
          items:
            $ref: "#/components/schemas/ServiceProviderAccountId"
          description: List of service provider IDs.
          nullable: false

    ServiceNetworkName:
      type: string
      minLength: 1
      nullable: false
      example: "My Service Network Name"

    ServicePlanAssignment:
      type: object
      required:
        - assetId
        - plan
      properties:
        assetId:
          $ref: "#/components/schemas/Id"
        plan:
          $ref: "#/components/schemas/StoredServicePlan"
        provider:
          $ref: "#/components/schemas/ServiceProviderAccountId"
        planUnsupported:
          type: boolean
          nullable: false
          description: True, if the service plan is no longer supported by the oem as a public plan. The service plan can still be used, but once unassigned it will no longer be accessible for the service provider.

    ServicePlanAssignmentUpdate:
      type: object
      required:
        - assetId
        - servicePlanId
      properties:
        assetId:
          $ref: "#/components/schemas/Id"
        servicePlanId:
          $ref: "#/components/schemas/ServicePlanId"
        provideFor:
          type: boolean
          nullable: true
          description:
            True, if the plan assignment should be carried out by the invoking account.
            False or null, if provider should be assigned at a later point for new assignments and be left untouched for
            existing assignments.
        startFrom:
          $ref: '#/components/schemas/ServicePlanAssignmentStartFrom'

    ServicePlanAssignmentStartFrom:
      type: object
      nullable: false
      required:
        - startFromSource
      description: "Defines when the service plan should start from. If left out and updating an existing assignment then the start from on the assignment is not changed. If left out and creating a new assignment then defaults to starting from time of invocation."
      properties:
        startFromSource:
          type: string
          enum:
            - SERVICE_TIME_OF_LATEST_CLASSIC_SERVICE_LOG
            - TIME_INPUT
          description: "The chosen source of service plan assignment start. SERVICE_TIME_OF_LATEST_CLASSIC_SERVICE_LOG uses service time of the latest service log from classic. If there is no service log in classic then time of invocation is used. TIME_INPUT uses the provided time field"
          example: "TIME_INPUT"
          nullable: false
        time:
          type: string
          format: date-time
          nullable: false
          example: "2021-01-01T00:00:00.000000Z"
          description: "The date-time the service plan should start from. If the date-time is in the future then the plan will not be active until the date-time. Operating hours and distance is retrieved from the given asset at the point of time"
        bypassPendingServices:
          type: boolean
          nullable: true
          description: "True, planned services, which are exceeded by the asset's distance or operating hours, will be bypassed. False, the asset's distance or operating hours will start from zero, but calendar-based criteria will start from the start from date. Defaults to 'true' if left out."
        insights:
          $ref: "#/components/schemas/ServicePlanAssignmentInsights"

    ServicePlanAssignmentInsights:
      type: object
      description: "Insights for using as starting value when assigning service plans in a retrofit scenario where no insights are yet available for the asset."
      properties:
        operatingHours:
          type: integer
          format: int32
          example: "100"
          description: "The operating hours at the time of the service plan start."
        distance:
          type: integer
          format: int32
          example: "100"
          description: "The distance at the time of the service plan start."

    AssetServicePlan:
      type: object
      required:
        - assetId
        - servicePlanId
      properties:
        assetId:
          $ref: "#/components/schemas/Id"
        servicePlanId:
          $ref: "#/components/schemas/ServicePlanId"

    ServicePlanAssignmentCreateUpdate:
      type: object
      required:
        - servicePlanId
        - assetId
      properties:
        assetId:
          $ref: "#/components/schemas/AssetId"
        servicePlanId:
          $ref: "#/components/schemas/ServicePlanId"
        startFrom:
          $ref: '#/components/schemas/ServicePlanAssignmentStartFrom'

    ServicePlanId:
      type: string
      format: uuid
      nullable: false
      description: "Identifier for service plan"
      example: "eeba6427-3c44-4691-8e74-446403db8867"

    PlannedServiceId:
      type: string
      format: uuid
      nullable: false
      description: "Identifier for planned service"
      example: "e62824ba-6e60-48cf-b4d1-07204fe9bb54"

    AssetId:
      type: string
      format: uuid
      nullable: false
      description: "Identifier for an asset"
      example: "eeba6427-3c44-4691-8e74-446403db8867"

    Document:
      type: object
      required:
        - id
        - name
      properties:
        id:
          $ref: "#/components/schemas/DocumentId"
        name:
          type: string
          nullable: false
          description: "Name of document"
          example: "Document name"

    DocumentId:
      type: string
      format: uuid
      nullable: false
      description: "Identifier for document"
      example: "29d77c71-1216-476c-b1e3-c82489ab3bb7"

    ServicePlanProviderOption:
      type: object
      required:
        - servicePlanId
        - servicePlanName
      properties:
        servicePlanId:
          $ref: "#/components/schemas/ServicePlanId"
        servicePlanName:
          $ref: "#/components/schemas/ServicePlanName"

    AggregatedServicePlanUsage:
      type: object
      required:
        - planId
        - assignmentCount
      properties:
        planId:
          $ref: "#/components/schemas/Id"
        assignmentCount:
          nullable: false
          example: 10
          type: integer

    ServicePlanOptions:
      type: object
      required:
        - servicePlanId
        - deleteable
        - updateable
        - criteriaUpdateable
      properties:
        servicePlanId:
          $ref: "#/components/schemas/ServicePlanId"
        deleteable:
          nullable: false
          example: "true"
          description:
            Whether or not the service plan can be deleted. Once a service plan has been assigned to asset it will no
            longer be possible to delete the service plan.
          type: boolean
        updateable:
          nullable: false
          example: "true"
          description:
            Whether or not the service plan can be updated. Note the service plan can be updatable, but if
            criteriaUpdateable is false then it is limited to changes that will not modify the service schedule.
          type: boolean
        criteriaUpdateable:
          nullable: false
          example: "true"
          description:
            Whether or not the service plan's criterias can be can be updated. If the service plan is assigned to assets
            then it is not possible to update the service schedule.
          type: boolean

    ServicePlanAssignmentOption:
      type: object
      required:
        - servicePlanAssignmentId
        - servicePlanId
        - assetId
        - canUnassign
        - canProvideFor
        - canBeAssignedByCurrentAccountProvider
        - canChangeStartFrom
      properties:
        servicePlanAssignmentId:
          $ref: "#/components/schemas/Id"
        assetId:
          $ref: "#/components/schemas/Id"
        servicePlanId:
          $ref: "#/components/schemas/ServicePlanId"
        canUnassign:
          nullable: false
          example: "true"
          description: Whether or not the service plan can be unassigned by the calling account.
          type: boolean
        canProvideFor:
          deprecated: true
          nullable: false
          example: "true"
          description: 'Deprecated: user canBeAssignedByCurrentAccountProvider. Whether or not the service plan can be provided for by the calling account.'
          type: boolean
        canBeAssignedByCurrentAccountProvider:
          nullable: false
          example: "true"
          description: Whether or not the service plan can be provided for by the calling account.
          type: boolean
        canChangeStartFrom:
          nullable: false
          example: "true"
          description:
            Whether or not the service plan can be reassigned with a different start-from by the calling account.
          type: boolean

    ServiceRegistration:
      type: object
      required:
        - id
        - assetId
        - servicePlanId
        - servicePlanName
        - serviceTime
        - registrationType
      properties:
        id:
          $ref: "#/components/schemas/Id"
        assetId:
          $ref: "#/components/schemas/Id"
        servicePlanId:
          $ref: "#/components/schemas/ServicePlanId"
        servicePlanName:
          $ref: "#/components/schemas/ServicePlanName"
        servicesPerformed:
          type: array
          minItems: 1
          items:
            $ref: "#/components/schemas/ServicePerformed"
        servicesSkipped:
          type: array
          minItems: 1
          items:
            $ref: "#/components/schemas/ServiceSkipped"
        serviceTime:
          type: string
          format: date-time
          nullable: false
          example: "2021-01-01T00:00:00.000000Z"
        operatingHours:
          type: integer
          format: int32
          example: "1000"
          description: The operating hours at the time of the service. Null if future plan assignment/registration.
        distance:
          type: integer
          format: int32
          example: "1000"
          description: The distance at the time of the service. Null if future plan assignment/registration.
        registrationType:
          type: string
          x-extensible-enum:
            - REGISTRATION
            - SERVICE_PLAN_ASSIGNMENT
          nullable: false
          example: "REGISTRATION"
        userId:
          $ref: "#/components/schemas/Id"

    ServiceRegistrationV3:
      type: object
      required:
        - id
        - assetId
        - servicePlanName
        - serviceTime
        - registrationType
      properties:
        id:
          $ref: "#/components/schemas/Id"
        assetId:
          $ref: "#/components/schemas/Id"
        servicePlanId:
          $ref: "#/components/schemas/ServicePlanId"
        servicePlanName:
          $ref: "#/components/schemas/ServicePlanName"
        servicesPerformed:
          type: array
          minItems: 1
          items:
            $ref: "#/components/schemas/ServicePerformedV3"
        servicesSkipped:
          type: array
          minItems: 1
          items:
            $ref: "#/components/schemas/ServiceSkippedV3"
        serviceHistory:
          type: array
          minItems: 1
          items:
            $ref: "#/components/schemas/ServiceHistory"
        serviceTime:
          type: string
          format: date-time
          nullable: false
          example: "2021-01-01T00:00:00.000000Z"
        operatingHours:
          type: integer
          format: int32
          example: "1000"
          description: The operating hours at the time of the service. Null if future plan assignment/registration.
        distance:
          type: integer
          format: int32
          example: "1000"
          description: The distance at the time of the service. Null if future plan assignment/registration.
        registrationType:
          type: string
          x-extensible-enum:
            - REGISTRATION
            - SERVICE_PLAN_ASSIGNMENT
            - CLASSIC_REGISTRATION
          nullable: false
          example: "REGISTRATION"
        userId:
          $ref: "#/components/schemas/Id"

    ServiceRegistrationId:
      type: string
      format: uuid
      description: Identifier for a service registration.
      example: "eeba6427-3c44-4691-8e74-446403db8867"

    ResolveServiceInsightsResponse:
      type: object
      properties:
        performedAt:
          type: string
          format: date-time
          nullable: true
          description: The resolved or provided timestamp. Null if the timestamp could not be resolved from the provided value.
          example: "2021-09-20T06:09:09.621736Z"
        operatingHours:
          type: integer
          nullable: true
          description: The operating hours at the resolved timestamp.
          example: 1500
        distance:
          type: integer
          nullable: true
          description: The distance value at the resolved timestamp.
          example: 12345

    ServicePerformed:
      type: object
      required:
        - plannedServiceId
      properties:
        plannedServiceId:
          $ref: "#/components/schemas/PlannedServiceId"
        plannedServiceName:
          $ref: "#/components/schemas/PlannedServiceName"
        documentIds:
          type: array
          minItems: 1
          maxItems: 10
          items:
            $ref: "#/components/schemas/DocumentId"
          description: List of IDs for uploaded files.
        note:
          type: string
          minLength: 1
          maxLength: 500
          example: "Expert inspection carried out. Truck is approved."
          description: Additional information about service performed.

    ServiceSkipped:
      type: object
      required:
        - plannedServiceId
      properties:
        plannedServiceId:
          $ref: "#/components/schemas/PlannedServiceId"
        plannedServiceName:
          $ref: "#/components/schemas/PlannedServiceName"
        documentIds:
          type: array
          minItems: 1
          maxItems: 10
          items:
            $ref: "#/components/schemas/DocumentId"
          description: List of IDs for uploaded files.
        note:
          type: string
          minLength: 1
          maxLength: 500
          example: "The service is skipped because the next one is due in a week."
          description: Additional information about service skipped.

    ServicePerformedV3:
      type: object
      properties:
        plannedServiceId:
          $ref: "#/components/schemas/PlannedServiceId"
        plannedServiceName:
          $ref: "#/components/schemas/PlannedServiceName"
        documents:
          type: array
          items:
            $ref: "#/components/schemas/Document"
          description: List of documents for the registration.
        note:
          type: string
          minLength: 1
          maxLength: 500
          example: "Expert inspection carried out. Truck is approved."
          description: Additional information about service performed.

    ServiceSkippedV3:
      type: object
      properties:
        plannedServiceId:
          $ref: "#/components/schemas/PlannedServiceId"
        plannedServiceName:
          $ref: "#/components/schemas/PlannedServiceName"
        documents:
          type: array
          items:
            $ref: "#/components/schemas/Document"
          description: List of documents for the registration.
        note:
          type: string
          minLength: 1
          maxLength: 500
          example: "The service is skipped because the next one is due in a week."
          description: Additional information about service skipped.

    ServiceHistory:
      type: object
      properties:
        plannedServiceId:
          $ref: "#/components/schemas/PlannedServiceId"
        plannedServiceName:
          $ref: "#/components/schemas/PlannedServiceName"
        documents:
          type: array
          items:
            $ref: "#/components/schemas/Document"
          description: List of documents for the history.
        note:
          type: string
          minLength: 1
          maxLength: 500
          example: "The service is booked for next week."
          description: Additional information.
        registrationEntryType:
          type: string
          x-extensible-enum:
            - SERVICED
            - SKIPPED
            - REGISTERED
            - BOOKED
            - UNBOOKED
          example: "SERVICED"

    SupportedModels:
      type: object
      nullable: false
      required:
        - brand
        - models
      properties:
        brand:
          type: string
          nullable: false
          example: "My Brand"
        models:
          type: array
          nullable: false
          minItems: 1
          items:
            type: string
            nullable: false
            example: "My Model"

    PublicationPartial:
      type: object
      nullable: false
      properties:
        supportedModels:
          type: array
          minItems: 1
          items:
            $ref: "#/components/schemas/SupportedModels"

    Publication:
      type: object
      nullable: false
      required:
        - id
        - servicePlanId
        - supportedModels
      allOf:
        - $ref: "#/components/schemas/PublicationPartial"
      properties:
        id:
          $ref: "#/components/schemas/Id"
        servicePlanId:
          $ref: "#/components/schemas/ServicePlanId"

    Timeout:
      type: integer
      format: int32
      nullable: false
      description:
        Seconds to wait for operation propagating through system. If this property is not specified the default timeout
        is 15 seconds.
      example: "120"

    ServiceProvider:
      type: object
      required:
        - id
        - name
      properties:
        id:
          $ref: "#/components/schemas/ServiceProviderAccountId"
        name:
          nullable: false
          example: "Construction OEM"
          type: string

    ServiceStatusType:
      type: string
      enum:
        - DRAFT
        - PLANNED
        - UPCOMING
        - OVERDUE
      description: "Service status"
    CreateServicePlanResponse:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Id"
      description: Response containing ID for the newly created Service Plan.
      nullable: false
    GetServicePlansResponse:
      type: object
      required:
        - servicePlans
      properties:
        servicePlans:
          type: array
          items:
            $ref: "#/components/schemas/StoredServicePlan"
          description: List of stored service plans.
    GetAssociatedServicePlansResponse:
      type: object
      required:
        - servicePlans
      properties:
        servicePlans:
          type: array
          items:
            $ref: "#/components/schemas/StoredServicePlan"
          description: List of stored service plans.
    GetServicePlanByIdResponse:
      type: object
      required:
        - servicePlan
      properties:
        servicePlan:
          $ref: "#/components/schemas/StoredServicePlan"
      description: Response containing service plan with the given ID.
      nullable: false
    GetServicePlansByIdsResponse:
      type: object
      required:
        - servicePlans
      properties:
        servicePlans:
          type: array
          items:
            $ref: "#/components/schemas/StoredServicePlan"
          description: List of stored service plans.
          nullable: false
    GetRecommendedServicePlanForAssetResponse:
      type: object
      required:
        - servicePlan
      properties:
        servicePlan:
          $ref: "#/components/schemas/StoredServicePlan"
      description: Response containing recommended service plan.
      nullable: false
    GetAssignedServicePlanByAssetIdResponse:
      type: object
      required:
        - servicePlanAssignments
      properties:
        servicePlanAssignments:
          type: array
          items:
            $ref: "#/components/schemas/ServicePlanAssignment"
    CreateUpdateDeleteServicePlanAssignmentsResponse:
      type: object
      required:
        - affectedAssetIds
      properties:
        affectedAssetIds:
          type: array
          items:
            $ref: "#/components/schemas/Id"
          description: List of asset IDs for which the plan assignment was changed.
    CreateOrUpdateServicePlanAssignmentsFromRecommendationResponse:
      type: object
      required:
        - affectedAssetIds
      properties:
        affectedAssetIds:
          type: array
          items:
            $ref: "#/components/schemas/Id"
          description: List of asset IDs for which the plan assignment was changed.
    GetAssetsAssignableFromRecommendationResponse:
      type: object
      required:
        - assignableAssetIds
      properties:
        assignableAssetIds:
          type: array
          items:
            $ref: "#/components/schemas/Id"
          description: List of asset IDs, which has an assignable recommended service plan.
    GetServicePlanAssignmentsByAssetIdsResponse:
      type: object
      required:
        - assignmentsForAssets
      properties:
        assignmentsForAssets:
          type: array
          items:
            $ref: "#/components/schemas/ServicePlanAssignment"
    GetServicePlanDocumentsResponse:
      type: object
      required:
        - documents
      properties:
        documents:
          type: array
          items:
            $ref: "#/components/schemas/Document"
          description: List of documents found for the service plan.
    GetServicePlanOverlayDocumentsResponse:
      type: object
      required:
        - documents
      properties:
        documents:
          type: array
          items:
            $ref: "#/components/schemas/Document"
          description: List of documents found for the service plan overlay.
    GetServicePlanOverlayResponse:
      type: object
      required:
        - overlay
      properties:
        overlay:
          $ref: "#/components/schemas/IdentifiableServicePlanOverlay"
      description: Overlay for the service plan.
      nullable: false
    CreateServicePlanOverlayResponse:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Id"
      description: Response containing ID for the newly created service plan overlay.
      nullable: false
    UpdateServicePlanOverlayResponse:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Id"
      description: Response containing ID for the updated service plan overlay.
      nullable: false
    FindServicePlanOverlaysResponse:
      type: object
      required:
        - servicePlanOverlays
      properties:
        servicePlanOverlays:
          type: array
          items:
            $ref: "#/components/schemas/IdentifiableServicePlanOverlay"
          description: List of service plan overlays.
    GetServiceNetworksResponse:
      type: object
      required:
        - networks
      properties:
        networks:
          type: array
          items:
            $ref: "#/components/schemas/ServiceNetwork"
          description: List of service networks.
    GetAggregatedPlansResponse:
      type: object
      required:
        - aggregatedPlans
      properties:
        aggregatedPlans:
          type: array
          minItems: 1
          items:
            $ref: "#/components/schemas/AggregatedServicePlanUsage"
          description: List of aggregated service plan usage.
    GetPublicationByServicePlanIdResponse:
      type: object
      required:
        - publication
      properties:
        publication:
          $ref: "#/components/schemas/Publication"
      description: Response containing publication for the given service plan.
      nullable: false
    GetAllowedBrandsResponse:
      type: object
      required:
        - brands
      properties:
        brands:
          type: array
          items:
            type: string
            example: "My Brand"
          description: List of available brands to use for publications.
    GetPlannedServiceStatusesResponse:
      type: object
      required:
        - plannedServiceStatuses
      properties:
        plannedServiceStatuses:
          type: array
          items:
            $ref: "#/components/schemas/PlannedServiceStatus"
          description: List of planned service statuses for the given asset.
    GetPlannedServiceStatusByAssetIdsResponse:
      type: object
      required:
        - plannedServiceStatusForAssets
      properties:
        plannedServiceStatusForAssets:
          type: array
          items:
            $ref: "#/components/schemas/PlannedServiceStatusForAsset"
          nullable: false
    CreateOrUpdateServiceProviderAssignmentsResponse:
      type: object
      required:
        - affectedAssetIds
      properties:
        affectedAssetIds:
          type: array
          items:
            $ref: "#/components/schemas/Id"
          description: List of asset IDs for which the service provider was updated.
    UnassignServiceProviderAssignmentsResponse:
      type: object
      required:
        - affectedAssetIds
      properties:
        affectedAssetIds:
          type: array
          items:
            $ref: "#/components/schemas/Id"
          description: List of asset IDs for which the service provider was unassigned.
    GetServicePlanAssignmentOptionsResponse:
      type: object
      required:
        - servicePlanAssignmentOptions
      properties:
        servicePlanAssignmentOptions:
          type: array
          items:
            $ref: "#/components/schemas/ServicePlanAssignmentOption"
          description: list of service plan assignment options
          nullable: false
    GetServiceRegistrationsResponse:
      type: object
      required:
        - serviceRegistrations
      properties:
        serviceRegistrations:
          type: array
          items:
            $ref: "#/components/schemas/ServiceRegistration"
          nullable: false
    GetServiceRegistrationsResponseV3:
      type: object
      required:
        - serviceRegistrations
      properties:
        serviceRegistrations:
          type: array
          items:
            $ref: "#/components/schemas/ServiceRegistrationV3"
          nullable: false
    CreateServiceNetworkResponse:
      type: object
      required:
        - network
      properties:
        network:
          $ref: "#/components/schemas/ServiceNetwork"
    GetAssociatedServiceNetworksResponse:
      type: object
      required:
        - networks
      properties:
        networks:
          type: array
          items:
            $ref: "#/components/schemas/ServiceNetwork"
          description: List of service networks.
    GetServiceNetworkByIdResponse:
      type: object
      required:
        - network
      properties:
        network:
          $ref: "#/components/schemas/ServiceNetwork"
    GetServicePlansByNetworkResponse:
      type: object
      required:
        - servicePlans
      properties:
        servicePlans:
          type: array
          items:
            $ref: "#/components/schemas/StoredServicePlan"
          description: List of service plans.
    GetServiceProvidersResponse:
      type: object
      required:
        - serviceProviderAccountIds
      properties:
        serviceProviderAccountIds:
          type: array
          items:
            $ref: "#/components/schemas/ServiceProviderAccountId"
          description: List of service provider account IDs.
    GetLatestServiceLogServiceTimePerAssetResponse:
      type: object
      required:
        - latestServiceTimes
      properties:
        latestServiceTimes:
          type: array
          nullable: false
          items:
            $ref: "#/components/schemas/LatestServiceTime"
          description: list of latest service time

    LatestServiceTime:
      type: object
      required:
        - serviceTime
        - assetId
      properties:
        serviceTime:
          type: string
          format: date-time
          nullable: false
          example: "2021-01-01T00:00:00.000000Z"
          description: Time of service
        assetId:
          $ref: "#/components/schemas/Id"

    SubscriptionId:
      type: string
      format: uuid
      nullable: false
      description: "Identifier for service plan subscription"
      example: "e5a8fbe1-1615-4ae7-8c48-d45269676599"

    NotificationSubscriptionResponse:
      type: object
      required:
        - id
        - name
        - condition
        - notificationType
      properties:
        id:
          $ref: "#/components/schemas/SubscriptionId"
        name:
          type: string
          minLength: 1
          maxLength: 255
          example: "My subscription name"
        condition:
          $ref: "#/components/schemas/Condition"
        notificationType:
          $ref: "#/components/schemas/NotificationType"
        active:
          type: boolean
          nullable: false
          example: true
        note:
          type: string
          maxLength: 1024
        createdDate:
          type: string
          format: date-time
        lastModifiedDate:
          type: string
          format: date-time
        groupIds:
          type: array
          uniqueItems: true
          items:
            type: string
            format: uuid
            nullable: false
            example: 00000000-0000-0000-0000-000000000000
        assetIds:
          type: array
          uniqueItems: true
          items:
            type: string
            format: uuid
            nullable: false
            example: 00000000-0000-0000-0000-000000000000
        userIds:
          type: array
          uniqueItems: true
          items:
            type: string
            format: uuid
            nullable: false
            example: 00000000-0000-0000-0000-000000000000
        contactIds:
          type: array
          uniqueItems: true
          items:
            type: string
            format: uuid
            nullable: false
            example: 00000000-0000-0000-0000-000000000000

    Condition:
      type: string
      x-extensible-enum:
        - UPCOMING
        - OVERDUE
      example: UPCOMING

    NotificationType:
      type: string
      x-extensible-enum:
        - EMAIL
      example: EMAIL

    NotificationSubscriptionCreation:
      type: object
      required:
        - name
        - condition
        - notificationType
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
          example: "My subscription name"
        condition:
          $ref: "#/components/schemas/Condition"
        notificationType:
          $ref: "#/components/schemas/NotificationType"
        active:
          type: boolean
          nullable: false
          default: true
          example: true
        note:
          type: string
          maxLength: 1024
        groupIds:
          type: array
          uniqueItems: true
          items:
            type: string
            format: uuid
            nullable: false
            example: 00000000-0000-0000-0000-000000000000
        assetIds:
          type: array
          uniqueItems: true
          items:
            type: string
            format: uuid
            nullable: false
            example: 00000000-0000-0000-0000-000000000000
        userIds:
          type: array
          uniqueItems: true
          items:
            type: string
            format: uuid
            nullable: false
            example: 00000000-0000-0000-0000-000000000000
        contactIds:
          type: array
          uniqueItems: true
          items:
            type: string
            format: uuid
            nullable: false
            example: 00000000-0000-0000-0000-000000000000

    NotificationSubscriptionUpdate:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
          example: "My subscription name"
        condition:
          $ref: "#/components/schemas/Condition"
        notificationType:
          $ref: "#/components/schemas/NotificationType"
        active:
          type: boolean
          nullable: false
          example: true
        note:
          type: string
          maxLength: 1024
        groupIdsToAdd:
          type: array
          uniqueItems: true
          items:
            type: string
            format: uuid
            nullable: false
            example: 00000000-0000-0000-0000-000000000000
        groupIdsToRemove:
          type: array
          uniqueItems: true
          items:
            type: string
            format: uuid
            nullable: false
            example: 00000000-0000-0000-0000-000000000000
        assetIdsToAdd:
          type: array
          uniqueItems: true
          items:
            type: string
            format: uuid
            nullable: false
            example: 00000000-0000-0000-0000-000000000000
        assetIdsToRemove:
          type: array
          uniqueItems: true
          items:
            type: string
            format: uuid
            nullable: false
            example: 00000000-0000-0000-0000-000000000000
        userIdsToAdd:
          type: array
          uniqueItems: true
          items:
            type: string
            format: uuid
            nullable: false
            example: 00000000-0000-0000-0000-000000000000
        userIdsToRemove:
          type: array
          uniqueItems: true
          items:
            type: string
            format: uuid
            nullable: false
            example: 00000000-0000-0000-0000-000000000000
        contactIdsToAdd:
          type: array
          uniqueItems: true
          items:
            type: string
            format: uuid
            nullable: false
            example: 00000000-0000-0000-0000-000000000000
        contactIdsToRemove:
          type: array
          uniqueItems: true
          items:
            type: string
            format: uuid
            nullable: false
            example: 00000000-0000-0000-0000-000000000000

  securitySchemes:
    authorizationBearer:
      type: "http"
      scheme: "bearer"
      bearerFormat: "JWT"
security:
  - authorizationBearer: [ ]
servers:
  - description: Endpoint for API users
    url: https://iris.trackunit.com/api/service-management
