openapi: 3.0.1
info:
  title: Claim Mapping Service
  description: The Claim Mapping Service provides APIs for CRUD'ing claim mapping rules'.
  version: '2.0'
tags:
  - name: ClaimMappingService
security:
  - Authorization: []
paths:
  /users/claim-mappings:
    get:
      summary: |-
        Return a list of claim mappings
        Permission Level: Read
      operationId: ClaimMappingService_ListClaimMappings
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2ListClaimMappingsResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: tenantId
          description: 'Tenant of the Roles to fetch, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: domain
          description: 'Domain of the role (example: zpa, reflexis, wfc, etc), Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: scope
          description: 'Some more general scoping (like a particular app in the domain), Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: pageSize
          description: 'Page Size, Default: 10, Required: false'
          in: query
          required: false
          schema:
            type: integer
            format: int32
        - name: pageToken
          description: 'Page number of the search results, Default: 0, Required: false'
          in: query
          required: false
          schema:
            type: string
      tags:
        - ClaimMappingService
    post:
      summary: |-
        Create a claim mapping
        Permission Level: Read-Write
      operationId: ClaimMappingService_CreateClaimMapping
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2ClaimMappingProto'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v2CreateClaimMappingRequest'
        required: true
      tags:
        - ClaimMappingService
  /users/claim-mappings/{claimMappingId}:
    get:
      summary: |-
        Return one claim mapping
        Permission Level: Read
      operationId: ClaimMappingService_GetClaimMapping
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2ClaimMappingProto'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: claimMappingId
          description: 'The ID to retrieve. Required: true'
          in: path
          required: true
          schema:
            type: string
        - name: tenantId
          description: 'The tenant ID. Required: false'
          in: query
          required: false
          schema:
            type: string
      tags:
        - ClaimMappingService
    delete:
      summary: |-
        Delete a claim mapping
        Permission Level: Read-Write
      operationId: ClaimMappingService_DeleteClaimMapping
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                type: object
                properties: {}
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: claimMappingId
          description: 'The ID to delete. Required: true'
          in: path
          required: true
          schema:
            type: string
        - name: tenantId
          description: 'The tenant ID. Required: false'
          in: query
          required: false
          schema:
            type: string
      tags:
        - ClaimMappingService
  /users/claim-mappings/{mapping.claimMappingId}:
    put:
      summary: |-
        Update a claim mapping
        Permission Level: Read-Write
      operationId: ClaimMappingService_UpdateClaimMapping
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2ClaimMappingProto'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: mapping.claimMappingId
          description: 'Optional claim ID. Generated if not provided. Required: false'
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClaimMappingServiceUpdateClaimMappingBody'
        required: true
      tags:
        - ClaimMappingService
servers:
  - url: https://prod-ui-zwseuprod01p.pp.zebra.com/api
    description: EU Server
  - url: https://prod-ui-zwsusprod01p.pp.zebra.com/api
    description: NA Server
components:
  schemas:
    ClaimMappingServiceUpdateClaimMappingBody:
      type: object
      properties:
        mapping:
          type: object
          properties:
            mapping:
              $ref: '#/components/schemas/v2ClaimMapping'
          title: 'Mapping to update, Required: true'
    protobufAny:
      type: object
      properties:
        '@type':
          type: string
      additionalProperties: {}
    rpcStatus:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/protobufAny'
    v2Claim:
      type: object
      properties:
        name:
          type: string
          title: The claim name
        value:
          type: string
          title: The claim value
      title: A claim. Claims are defined by the Customer IDP and sent as part of the OIDC token during authentication
    v2ClaimMapping:
      type: object
      properties:
        claim:
          $ref: '#/components/schemas/v2Claim'
        role:
          $ref: '#/components/schemas/v2UniqueRoleProto'
      title: A mapping between a claim and a role
    v2ClaimMappingProto:
      type: object
      properties:
        claimMappingId:
          type: string
          title: 'Optional claim ID. Generated if not provided. Required: false'
        mapping:
          $ref: '#/components/schemas/v2ClaimMapping'
      title: A mapping with an ID
    v2CreateClaimMappingRequest:
      type: object
      properties:
        mapping:
          $ref: '#/components/schemas/v2ClaimMappingProto'
    v2ListClaimMappingsResponse:
      type: object
      properties:
        mappings:
          type: array
          items:
            $ref: '#/components/schemas/v2ClaimMappingProto'
          title: List of results
        nextPageToken:
          type: string
          description: The token of the next page of results.
    v2UniqueRoleProto:
      type: object
      properties:
        tenantId:
          type: string
          description: 'The ID of the tenant. Required: false. Defaults to the tenant of the user making the call.'
        domain:
          type: string
          description: |-
            The platform domain. Required: true. (e.g. ZPA, Reflexis, WFC)
            Defaults to the domain in the request.
        scope:
          type: string
          description: 'Some more general scoping for the data (like a particular app in the domain). Required: false.'
        roleId:
          type: string
          description: 'The role ID. Required: true.'
        userIds:
          type: array
          items:
            type: string
          title: 'The User Ids for the Unique Role Proto, Required: false'
    googleRpcStatus:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/protobufAny'
  securitySchemes:
    Authorization:
      type: apiKey
      description: Bearer token
      name: Authorization
      in: header
