openapi: 3.0.0
info:
  title: 3gpp-lpi-pp
  version: 1.0.0.alpha-1
  description: |
    API for Location Privacy Indication Parameters Provisioning.
    © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC).
    All rights reserved.
externalDocs:
  description: 3GPP TS 29.522 V16.3.0; 5G System; Network Exposure Function Northbound APIs.
  url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.522/'
security:
  - {}
  - oAuth2ClientCredentials: []
servers:
  - url: '{apiRoot}/3gpp-lpi-pp/v1'
    variables:
      apiRoot:
        default: https://example.com
        description: apiRoot as defined in subclause 5.2.4 of 3GPP TS 29.122.
paths:
  /{afId}/provisionedLpis:
    get:
      summary: read all of the active LPI Parameters Provisioning resources for the AF
      tags:
        - Resource collection level GET Operation
      parameters:
        - name: afId
          in: path
          description: Identifier of the AF
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK (Successful get all of the active resources for the AF)
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LpiParametersProvision'
                minItems: 1
        '400':
          $ref: 'TS29122_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29122_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29122_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29122_CommonData.yaml#/components/responses/404'
        '406':
          $ref: 'TS29122_CommonData.yaml#/components/responses/406'
        '429':
          $ref: 'TS29122_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29122_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29122_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29122_CommonData.yaml#/components/responses/default'

    post:
      summary: Creates a new LPI Parameters Provisioning resource
      tags:
        - Resource collection level POST Operation
      parameters:
        - name: afId
          in: path
          description: Identifier of the AF
          required: true
          schema:
            type: string
      requestBody:
        description: new resource creation
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LpiParametersProvision'
      responses:
        '201':
          description: Created (Successful creation)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LpiParametersProvision'
          headers:
            Location:
              description: 'Contains the URI of the newly created resource'
              required: true
              schema:
                type: string
        '400':
          $ref: 'TS29122_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29122_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29122_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29122_CommonData.yaml#/components/responses/404'
        '411':
          $ref: 'TS29122_CommonData.yaml#/components/responses/411'
        '413':
          $ref: 'TS29122_CommonData.yaml#/components/responses/413'
        '415':
          $ref: 'TS29122_CommonData.yaml#/components/responses/415'
        '429':
          $ref: 'TS29122_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29122_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29122_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29122_CommonData.yaml#/components/responses/default'

  /{afId}/provisionedLpis/{provisionedLpiId}:
    get:
      summary: read an active LPI Parameters Provisioning resource for the AF and the provisioned LPI Id
      tags:
        - Individual resource level GET Operation
      parameters:
        - name: afId
          in: path
          description: Identifier of the AF
          required: true
          schema:
            type: string
        - name: provisionedLpiId
          in: path
          description: Identifier of the provisioned LPI parameter resource
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK (Successful get the active resource)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LpiParametersProvision'
        '400':
          $ref: 'TS29122_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29122_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29122_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29122_CommonData.yaml#/components/responses/404'
        '406':
          $ref: 'TS29122_CommonData.yaml#/components/responses/406'
        '429':
          $ref: 'TS29122_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29122_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29122_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29122_CommonData.yaml#/components/responses/default'

    put:
      summary: Updates/replaces an existing LPI Parameters Provisioning resource
      tags:
        - Individual resource level PUT Operation
      parameters:
        - name: afId
          in: path
          description: Identifier of the AF
          required: true
          schema:
            type: string
        - name: provisionedLpiId
          in: path
          description: Identifier of the provisioned LPI parameter resource
          required: true
          schema:
            type: string
      requestBody:
        description: Parameters to update/replace the existing resource
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LpiParametersProvision'
      responses:
        '200':
          description: OK (Successful update of the existing resource)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LpiParametersProvision'
        '204':
          description: Successful case. The resource has been successfully updated and no additional content is sent in the response message.
        '400':
          $ref: 'TS29122_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29122_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29122_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29122_CommonData.yaml#/components/responses/404'
        '411':
          $ref: 'TS29122_CommonData.yaml#/components/responses/411'
        '413':
          $ref: 'TS29122_CommonData.yaml#/components/responses/413'
        '415':
          $ref: 'TS29122_CommonData.yaml#/components/responses/415'
        '429':
          $ref: 'TS29122_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29122_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29122_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29122_CommonData.yaml#/components/responses/default'

    delete:
      summary: Deletes an already existing LPI Parameters Provisioning resource
      tags:
        - Individual resource level DELETE Operation
      parameters:
        - name: afId
          in: path
          description: Identifier of the AF
          required: true
          schema:
            type: string
        - name: provisionedLpiId
          in: path
          description: Identifier of the provisioned LPI parameter resource
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content (Successful deletion of the existing resource)
        '400':
          $ref: 'TS29122_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29122_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29122_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29122_CommonData.yaml#/components/responses/404'
        '429':
          $ref: 'TS29122_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29122_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29122_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29122_CommonData.yaml#/components/responses/default'
components:
  securitySchemes:
    oAuth2ClientCredentials:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: '{tokenUrl}'
          scopes: {}
  schemas: 
    LpiParametersProvision:
      type: object
      properties:
        self:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/Link'
        exterGroupId:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId'
        gpsi:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi'
        lpi:
          $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/Lpi'
        suppFeat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
      required:
        - lpi
        - suppFeat