openapi: 3.0.1 
security:
  - lambdaAuthorizer: []
info:
  title: Archer.SCIM.Service.API
  version: "1.0"
  description: The SCIM API allows you to manage Users/Groups within your organization, enabling automated user provisioning for Archer Instances through an Identity Provider(Idp)
servers:
  - url: https://asta.scim.blade.dev-eng.archerirm.us
tags:
  - name: Users
    description: Operations on users belonging to an organization
  - name: Groups
    description: Operations on groups belonging to an organization
  - name: ServiceProviderConfig
    description: Service Provider Config
  - name: Schemas
    description: SCIM Schemas used for Archer
  - name: ResourceTypes
    description: SCIM resource types defined for Archer
paths:
  /:
    get:
      tags:
        - Root
      summary: Root Endpoint
      description: Returns a 200 OK response when the API is reachable.
      operationId: getRoot
      responses:
        '200':
          $ref: '#/components/responses/RootResponse'
      security: []  # No authentication required
      x-amazon-apigateway-integration:
        type: mock
        requestTemplates:
          application/json: |
            {
              "statusCode": 200
            }
        responses:
          default:
            statusCode: 200
            responseTemplates:
              application/json: >
                {}
  /Users:
#post user endpoint
    post:
      tags:
        - Users
      summary: Create User
      description: Creates a new user and adds them to the Archer Instance. 
      operationId: createUsers
      requestBody:
        $ref: '#/components/requestBodies/UserDefinitionBody'
      responses:
        '201':
          $ref: '#/components/responses/UserCreatedResponse'
        '409':
          $ref: '#/components/responses/ConflictUserExistsResponse'
        '404':
          $ref: '#/components/responses/UserCreationFailedResponse'
        '400':
          $ref: '#/components/responses/BadRequestResponse'
        '403':
          $ref: '#/components/responses/UnauthorizedResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
      x-amazon-apigateway-request-validator: basic
      x-amazon-apigateway-integration:
        uri: ${lambda_arn}
        passthroughBehavior: when_no_match
        httpMethod: POST
        type: aws_proxy
      security:
        - lambdaAuthorizer: []
      x-codegen-request-body-name: body
#get user endpoint
    get:
      tags:
        - Users
      summary: Get Users
      description: Queries multiple user identities in the instance. Filtering and Pagination is available.
      operationId: getUsers
      parameters:
        - name: filter
          in: query
          description: 'Without a filter, all users in an instance are returned. The filter parameter must be a properly formed SCIM filter using the operator eq (equals). The filter works for the userName attribute. For example, /Users?filter=userName eq "Johndoe"'
          schema:
            type: string
            pattern: "^filter=\\s+userName\\s+eq\\s+\"([^\"]*)\"$"
            maxLength: 999999
      responses:
        '200':
          $ref: '#/components/responses/UsersListResponse'
        '403':
          $ref: '#/components/responses/UnauthorizedResponse'
        '400':
          $ref: '#/components/responses/BadRequestParamsResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
      x-amazon-apigateway-integration:
        uri: ${lambda_arn}
        passthroughBehavior: when_no_match
        httpMethod: POST
        type: aws_proxy
      security:
        - lambdaAuthorizer: []
  /Users/{userKey}:
    parameters:
      - $ref: '#/components/parameters/UserKeyParam'

    get:
      tags:
        - Users
      summary: Get User with UserId
      description: Queries user identity in the instance.
      operationId: getUser
      responses:
        '200':
          $ref: '#/components/responses/UserResponse'
        '404':
          $ref: '#/components/responses/UserNotFoundResponse'
        '403':
          $ref: '#/components/responses/UnauthorizedResponse'
        '400':
          $ref: '#/components/responses/BadRequestParamsResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
      x-amazon-apigateway-integration:
        uri: ${lambda_arn}
        passthroughBehavior: when_no_match
        httpMethod: POST
        type: aws_proxy
      security:
        - lambdaAuthorizer: []
    put:
      tags:
        - Users
      summary: Replace User
      description: Changes an existing user's attributes. The request must include the full user definition (to modify one or more values without sending the full definition, see Update User).
      operationId: replaceUser
      parameters:
        - $ref: '#/components/parameters/UserKeyParam'
      requestBody:
        $ref: '#/components/requestBodies/UserDefinitionBody'
      responses:
        '200':
          $ref: '#/components/responses/UserResponse'
        '409':
          $ref: '#/components/responses/ConflictUserExistsResponse'
        '404':
          $ref: '#/components/responses/ReplaceUserFailedResponse'
        '400':
          $ref: '#/components/responses/BadRequestResponse'
        '403':
          $ref: '#/components/responses/UnauthorizedResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
      x-amazon-apigateway-request-validator: basic
      x-amazon-apigateway-integration:
        uri: ${lambda_arn}
        passthroughBehavior: when_no_match
        httpMethod: POST
        type: aws_proxy
      security:
        - lambdaAuthorizer: []
      x-codegen-request-body-name: body
    patch:
      tags:
        - Users
      summary: Update User
      description: Changes a limited set (or all if you choose) of the user's data.
      operationId: updateUser
      parameters:
        - $ref: '#/components/parameters/UserKeyParam'
      requestBody:
        $ref: '#/components/requestBodies/UserPatchBody'
      responses:
        '200':
          $ref: '#/components/responses/UserResponse'
        '409':
          $ref: '#/components/responses/ConflictUserExistsResponse'
        '404':
          $ref: '#/components/responses/UpdateUserFailedResponse'
        '400':
          $ref: '#/components/responses/BadRequestResponse'
        '403':
          $ref: '#/components/responses/UnauthorizedResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
      x-amazon-apigateway-request-validator: basic
      x-amazon-apigateway-integration:
        uri: ${lambda_arn}
        passthroughBehavior: when_no_match
        httpMethod: POST
        type: aws_proxy
      security:
        - lambdaAuthorizer: []
      x-codegen-request-body-name: body
    delete:
      tags:
        - Users
      summary: Delete User
      description: Deletes a user from the instance.
      operationId: deleteUser
      parameters:
        - $ref: '#/components/parameters/UserKeyParam'
      responses:
        '204':
          $ref: '#/components/responses/NoContentResponse'
        '404':
          $ref: '#/components/responses/UserDeleteFailedResponse'
        '400':
          $ref: '#/components/responses/BadRequestParamsResponse'
        '403':
          $ref: '#/components/responses/UnauthorizedResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
      x-amazon-apigateway-integration:
        uri: ${lambda_arn}
        passthroughBehavior: when_no_match
        httpMethod: POST
        type: aws_proxy
      security:
        - lambdaAuthorizer: []
  /Groups:
    post:
      tags:
        - Groups
      summary: Create Group
      description: Creates a new user group and adds it to the instance. Member users must be in the instance.
      operationId: createGroup
      requestBody:
        $ref: '#/components/requestBodies/GroupDefinitionBody'
      responses:
        '201':
          $ref: '#/components/responses/GroupCreatedResponse'
        '409':
          $ref: '#/components/responses/ConflictGroupExistsResponse'
        '404':
          $ref: '#/components/responses/GroupCreationFailedResponse'
        '400':
          $ref: '#/components/responses/BadRequestResponse'
        '403':
          $ref: '#/components/responses/UnauthorizedResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
      x-amazon-apigateway-request-validator: basic
      x-amazon-apigateway-integration:
        uri: ${lambda_arn}
        passthroughBehavior: when_no_match
        httpMethod: POST
        type: aws_proxy
      security:
        - lambdaAuthorizer: []
      x-codegen-request-body-name: body
    get:
      tags:
        - Groups
      summary: Get Groups
      description: Queries multiple group identities in the instance. Pagination is available.
      operationId: getGroups
      parameters:
        - name: filter
          in: query
          description: 'All groups are returned in a paginated manner. Page size must be 100 or less. For example, GET /Groups?count=50&startIndex=1'
          schema:
            type: string
            pattern: '^count=\\d+&startIndex=\\d+$'
            maxLength: 999999
      responses:
        '200':
          $ref: '#/components/responses/GroupsListResponse'
        '404':
          $ref: '#/components/responses/GroupNotFoundResponse'
        '403':
          $ref: '#/components/responses/UnauthorizedResponse'
        '400':
          $ref: '#/components/responses/BadRequestParamsResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
      x-amazon-apigateway-integration:
        uri: ${lambda_arn}
        passthroughBehavior: when_no_match
        httpMethod: POST
        type: aws_proxy
      security:
        - lambdaAuthorizer: []
  /Groups/{groupKey}:
    parameters:
      - $ref: '#/components/parameters/GroupKeyParam'

    get:
      tags:
        - Groups
      summary: Get Group
      description: Queries group details in the instance.
      operationId: getGroup
      responses:
        '200':
          $ref: '#/components/responses/GroupResponse'
        '404':
          $ref: '#/components/responses/GroupNotFoundResponse'
        '403':
          $ref: '#/components/responses/UnauthorizedResponse'
        '400':
          $ref: '#/components/responses/BadRequestParamsResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
      x-amazon-apigateway-request-validator: "params-only"
      x-amazon-apigateway-integration:
        uri: ${lambda_arn}
        passthroughBehavior: when_no_match
        httpMethod: POST
        type: aws_proxy
      security:
        - lambdaAuthorizer: []
    patch:
      tags:
        - Groups
      summary: Update Group
      description: Updates one or more values of an existing group without sending the full definition. Member users must be in the instance.
      operationId: updateGroup
      parameters:
        - $ref: '#/components/parameters/GroupKeyParam'
      requestBody:
        $ref: '#/components/requestBodies/GroupPatchBody'
      responses:
        '200':
          $ref: '#/components/responses/GroupResponse'
        '409':
          $ref: '#/components/responses/ConflictGroupExistsResponse'
        '404':
          $ref: '#/components/responses/ReplaceGroupFailedResponse'
        '400':
          $ref: '#/components/responses/BadRequestParamsResponse'
        '403':
          $ref: '#/components/responses/UnauthorizedResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
      x-amazon-apigateway-request-validator: basic
      x-amazon-apigateway-integration:
        uri: ${lambda_arn}
        passthroughBehavior: when_no_match
        httpMethod: POST
        type: aws_proxy
      security:
        - lambdaAuthorizer: []
      x-codegen-request-body-name: body
    put:
      tags:
        - Groups
      summary: Replace Group
      description: Changes an existing group's attributes. The request must include the full group definition (to modify one or more values without sending the full definition).
      operationId: replaceGroup
      parameters:
        - $ref: '#/components/parameters/GroupKeyParam'
      requestBody:
        $ref: '#/components/requestBodies/GroupDefinitionBody'
      responses:
        '201':
          $ref: '#/components/responses/GroupCreatedResponse'
        '409':
          $ref: '#/components/responses/ConflictGroupExistsResponse'
        '404':
          $ref: '#/components/responses/GroupCreationFailedResponse'
        '400':
          $ref: '#/components/responses/BadRequestResponse'
        '403':
          $ref: '#/components/responses/UnauthorizedResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
      x-amazon-apigateway-request-validator: "basic"
      x-amazon-apigateway-integration:
        uri: ${lambda_arn}
        passthroughBehavior: when_no_match
        httpMethod: POST
        type: aws_proxy
      security:
        - lambdaAuthorizer: []
      x-codegen-request-body-name: body
    delete:
      tags:
        - Groups
      summary: Delete Group
      description: Deletes a group from the instance. The group must be in the instance.
      operationId: deleteGroup
      parameters:
        - $ref: '#/components/parameters/GroupKeyParam'
      responses:
        '204':
          $ref: '#/components/responses/NoContentResponse'
        '404':
          $ref: '#/components/responses/GroupDeleteFailedResponse'
        '400':
          $ref: '#/components/responses/BadRequestParamsResponse'
        '403':
          $ref: '#/components/responses/UnauthorizedResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
      x-amazon-apigateway-integration:
        uri: ${lambda_arn}
        passthroughBehavior: when_no_match
        httpMethod: POST
        type: aws_proxy
      security:
        - lambdaAuthorizer: []
  /ServiceProviderConfig:
    get:
      tags:
        - ServiceProviderConfig
      summary: SCIM Service Provider Configuration
      description: Describes the SCIM service provider’s configuration including supported features and authentication schemes.
      operationId: getServiceProviderConfig
      responses:
        '200':
          description: Service Provider Configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArcherSCIMModelsServiceProviderConfigResponse'
        '403':
          description: Authorization Failure
          content:
            application/json:
              schema: 
                $ref: '#/components/schemas/ArcherSCIMModelsErrorResponseValidation'
              example:
                message: User is not authorized to access this resource with an explicit deny
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema: 
                $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
              example:
                schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
                detail: "An Internal Error Has Occurred"
                status: "500"
                instance_id: "50000"
      x-amazon-apigateway-integration:
        uri: ${lambda_arn}
        passthroughBehavior: when_no_match
        httpMethod: POST
        type: aws_proxy
      security:
        - lambdaAuthorizer: []

  /Schemas:
    get:
      tags:
        - Schemas
      summary: List of Available SCIM Schemas needed for Archer
      description: Returns all available SCIM schemas supported by the service.
      operationId: listSchemas
      responses:
        '200':
          $ref: "#/components/schemas/ArcherSCIMSchemasResponse"
        '400':
          $ref: '#/components/responses/BadRequestParamsResponse'
        '403':
          $ref: '#/components/responses/UnauthorizedResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
      x-amazon-apigateway-integration:
        uri: ${lambda_arn}
        passthroughBehavior: when_no_match
        httpMethod: POST
        type: aws_proxy
        security:
          - lambdaAuthorizer: []


  /Schemas/{schemaId}:
    get:
      operationId: getSchemaById
      summary: Retrieve a SCIM schema by ID
      description: Returns a specific SCIM schema definition.
      tags:
        - Schemas
      parameters:
        - name: schemaId
          in: path
          required: true
          schema:
            type: string
          example: urn:ietf:params:scim:schemas:core:2.0:User
      responses:
        '200':
          $ref: "#/components/schemas/ArcherSCIMSchema"
        '400':
          $ref: '#/components/responses/BadRequestParamsResponse'
        '403':
          $ref: '#/components/responses/UnauthorizedResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
      x-amazon-apigateway-integration:
        uri: ${lambda_arn}
        passthroughBehavior: when_no_match
        httpMethod: POST
        type: aws_proxy
        security:
          - lambdaAuthorizer: []

  /ResourceTypes:
    get:
      tags:
        - ResourceTypes
      summary: List SCIM Resource Types
      description: Returns the list of supported SCIM resource types and their metadata.
      operationId: listResourceTypes
      responses:
        '200':
          $ref: '#/components/schemas/ResourceTypesListResponse'
        '400':
          $ref: '#/components/responses/BadRequestParamsResponse'
        '403':
          description: Authorization Failure
          content:
            application/json:
              schema: 
                $ref: '#/components/schemas/ArcherSCIMModelsErrorResponseValidation'
              example:
                message: User is not authorized to access this resource with an explicit deny
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema: 
                $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
              example:
                schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
                detail: "An Internal Error Has Occurred"
                status: "500"
                scimType: "unavailable"
                instance_id: "50000"
      x-amazon-apigateway-integration:
        uri: ${lambda_arn}
        passthroughBehavior: when_no_match
        httpMethod: POST
        type: aws_proxy
        security:
          - lambdaAuthorizer: []   

                
  /ResourceTypes/User:
    get:
      tags:
        - ResourceTypes
      summary: Get SCIM Resource Type - User
      description: Returns metadata about the User resource type.
      operationId: getUserResourceType
      responses:
        '200':
          $ref: '#/components/schemas/ResourceTypesListResponse'
        '400':
          $ref: '#/components/responses/BadRequestParamsResponse'
        '403':
          description: Authorization Failure
          content:
            application/json:
              schema: 
                $ref: '#/components/schemas/ArcherSCIMModelsErrorResponseValidation'
              example:
                message: User is not authorized to access this resource with an explicit deny
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema: 
                $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
              example:
                schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
                detail: "An Internal Error Has Occurred"
                status: "500"
                scimType: "unavailable"
                instance_id: "50000"
      x-amazon-apigateway-integration:
        uri: ${lambda_arn}
        passthroughBehavior: when_no_match
        httpMethod: POST
        type: aws_proxy
        security:
          - lambdaAuthorizer: []

  /ResourceTypes/Group:
    get:
      tags:
        - ResourceTypes
      summary: Get SCIM Resource Type - Group
      description: Returns metadata about the Group resource type.
      operationId: getGroupResourceType
      responses:
        '200':
          $ref: '#/components/schemas/ResourceTypesListResponse'
        '400':
          $ref: '#/components/responses/BadRequestParamsResponse'
        '403':
          description: Authorization Failure
          content:
            application/json:
              schema: 
                $ref: '#/components/schemas/ArcherSCIMModelsErrorResponseValidation'
              example:
                message: User is not authorized to access this resource with an explicit deny
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema: 
                $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
              example:
                schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
                detail: "An Internal Error Has Occurred"
                status: "500"
                scimType: "unavailable"
                instance_id: "50000"
      x-amazon-apigateway-integration:
        uri: ${lambda_arn}
        passthroughBehavior: when_no_match
        httpMethod: POST
        type: aws_proxy
        security:
          - lambdaAuthorizer: []

  /Bulk:
    post:
      tags:
        - Bulk
      summary: Bulk Operations (Not Implemented)
      description: Bulk operations are not currently supported by this SCIM implementation.
      operationId: bulkOperations
      responses:
        '501':
          $ref: '#/components/responses/NotImplementedResponse'
      security: []
      x-amazon-apigateway-integration:
        type: mock
        requestTemplates:
          application/json: |
            {
              "statusCode": 501
            }
        responses:
          default:
            statusCode: 501
            responseTemplates:
              application/json: |
                {
                  "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
                  "detail": "Bulk operations are not supported",
                  "status": "501",
                  "scimType": "notImplemented"
                }


components:
  # Reusable Parameters
  parameters:
    UserKeyParam:
      name: userKey
      in: path
      description: The key of the user to query. The user must be in the instance
      required: true
      schema:
        type: integer
        format: int64
        minimum: 0
        maximum: 999999

    GroupKeyParam:
      name: groupKey
      in: path
      description: The ID of the group to query. The group must be in the instance
      required: true
      schema:
        type: integer
        format: int64
        minimum: 0
        maximum: 999999

  # Reusable Request Bodies
  requestBodies:
    UserDefinitionBody:
      description: The schema model of the user to create
      required: true
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsUsersUserDefinition'
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsUsersUserDefinition'

    UserPatchBody:
      description: The new user data for partial update
      required: true
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsUsersPatchRequestBody'
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsUsersPatchRequestBody'

    GroupDefinitionBody:
      description: The details of the group to create
      required: true
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsGroupsGroupDefinition'
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsGroupsGroupDefinition'

    GroupPatchBody:
      description: The group data to update. It is allowed to update one or more values of the group definition
      required: true
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsGroupPatchRequestBody'
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsGroupPatchRequestBody'

  # Reusable Responses
  responses:
    RootResponse:
      description: Successful response
      content:
        application/scim+json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: "API is reachable"
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: "API is reachable"

    NoContentResponse:
      description: The request has succeeded
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false

    BadRequestResponse:
      description: Bad Request Body
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponseValidation'
          example:
            message: Invalid request body
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponseValidation'
          example:
            message: Invalid request body

    BadRequestParamsResponse:
      description: Bad request parameters
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponseValidation'
          example:
            message: Invalid Query parameters
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponseValidation'
          example:
            message: Invalid Query parameters

    UnauthorizedResponse:
      description: Authorization Failure
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponseValidation'
          example:
            message: User is not authorized to access this resource with an explicit deny
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponseValidation'
          example:
            message: User is not authorized to access this resource with an explicit deny

    InternalServerErrorResponse:
      description: Internal Server Error
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            detail: "An Internal Error Has Occurred"
            status: "500"
            instance_id: "50000"
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            detail: "An Internal Error Has Occurred"
            status: "500"
            instance_id: "50000"
            
    NotImplementedResponse:
      description: Not Implemented
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            detail: "This operation is not implemented"
            status: "501"
            scimType: "notImplemented"
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            detail: "This operation is not implemented"
            status: "501"
            scimType: "notImplemented"


    # User-specific Responses
    UserCreatedResponse:
      description: User has been created successfully
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsUsersResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsUsersResponse'

    UserResponse:
      description: The request has succeeded
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsUsersResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsUsersResponse'

    UsersListResponse:
      description: Returns user / list of users in the instance or returns an empty list if no user is found
      content:
        application/scim+json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/ArcherSCIMModelsUsersUserListResponse'
              - $ref: '#/components/schemas/ArcherSCIMModelsUsersResponse'
              - $ref: '#/components/schemas/ArcherSCIMModelsUsersGetUserErrorResponse'
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/ArcherSCIMModelsUsersUserListResponse'
              - $ref: '#/components/schemas/ArcherSCIMModelsUsersResponse'
              - $ref: '#/components/schemas/ArcherSCIMModelsUsersGetUserErrorResponse'

    ConflictUserExistsResponse:
      description: Conflict - Uniqueness constraint violation
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            scimType: "uniqueness"
            detail: "User already exists"
            status: "409"
            instance_id: "50000"
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            scimType: "uniqueness"
            detail: "User already exists"
            status: "409"
            instance_id: "50000"

    UserCreationFailedResponse:
      description: User Creation has failed
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            detail: "User creation failed"
            status: "404"
            instance_id: "50000"
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            detail: "User creation failed"
            status: "404"
            instance_id: "50000"

    UserNotFoundResponse:
      description: User is not in the instance
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            detail: "The resource cannot be found."
            status: "404"
            instance_id: "50000"
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            detail: "The resource cannot be found."
            status: "404"
            instance_id: "50000"

    ReplaceUserFailedResponse:
      description: Replace User Failed
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            detail: "Replace User Failed"
            status: "404"
            instance_id: "50000"
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            detail: "Replace User Failed"
            status: "404"
            instance_id: "50000"

    UpdateUserFailedResponse:
      description: Update User Failed
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            detail: "Update User Failed"
            status: "404"
            instance_id: "50000"
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            detail: "Update User Failed"
            status: "404"
            instance_id: "50000"

    UserDeleteFailedResponse:
      description: Invalid userId or user not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            detail: "Invalid userId or user not found"
            status: "404"
            instance_id: "50000"

    # Group-specific Responses
    GroupCreatedResponse:
      description: The group has been created
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsGroupsResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsGroupsResponse'

    GroupResponse:
      description: The request has succeeded
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsGroupsResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsGroupsResponse'

    GroupsListResponse:
      description: The request has succeeded
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsGroupListResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsGroupListResponse'

    ConflictGroupExistsResponse:
      description: Conflict - Uniqueness constraint violation
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            scimType: "uniqueness"
            detail: "Group already exists"
            status: "409"
            instance_id: "50000"
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            scimType: "uniqueness"
            detail: "Group already exists"
            status: "409"
            instance_id: "50000"

    GroupCreationFailedResponse:
      description: Group Creation has failed
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            detail: "Group creation failed"
            status: "404"
            instance_id: "50000"
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            detail: "Group creation failed"
            status: "404"
            instance_id: "50000"

    GroupNotFoundResponse:
      description: Group is not in the instance
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            detail: "Invalid group Id or Group does not exist"
            status: "404"
            instance_id: "50000"
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            detail: "Invalid group Id or Group does not exist"
            status: "404"
            instance_id: "50000"

    ReplaceGroupFailedResponse:
      description: Replace group failed
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            detail: "Replace group failed"
            status: "404"
            instance_id: "50000"
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            detail: "Replace group failed"
            status: "404"
            instance_id: "50000"

    GroupDeleteFailedResponse:
      description: Invalid Group or group does not exists
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsErrorResponse'
          example:
            schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"]
            detail: "Invalid Group or group does not exists"
            status: "404"
            instance_id: "50000"

    # Schema & Metadata Responses
    ServiceProviderConfigResponse:
      description: Service Provider Configuration
      content:
        application/scim+json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsServiceProviderConfigResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/ArcherSCIMModelsServiceProviderConfigResponse'

    ArcherSCIMSchemasResponse:
      description: List of SCIM schemas
      content:
        application/scim+json:
          schema:
            type: object
            properties:
              schemas:
                type: array
                items:
                  type: string
                example:
                  - urn:ietf:params:scim:api:messages:2.0:ListResponse
              totalResults:
                type: integer
                example: 4
              itemsPerPage:
                type: integer
                example: 4
              startIndex:
                type: integer
                example: 1
              Resources:
                type: array
                items:
                  $ref: "#/components/schemas/ArcherSCIMSchema"
              meta:
                type: object
                properties:
                  resourceType:
                    type: string
                    example: ListResponse
        application/json:
          schema:
            type: object
            properties:
              schemas:
                type: array
                items:
                  type: string
                example:
                  - urn:ietf:params:scim:api:messages:2.0:ListResponse
              totalResults:
                type: integer
                example: 4
              itemsPerPage:
                type: integer
                example: 4
              startIndex:
                type: integer
                example: 1
              Resources:
                type: array
                items:
                  $ref: "#/components/schemas/ArcherSCIMSchema"
              meta:
                type: object
                properties:
                  resourceType:
                    type: string
                    example: ListResponse

    ArcherSCIMSchema:
      description: List of SCIM resource schemas
      content:
        application/scim+json:
          schema:
            type: object
            properties:
              id:
                type: string
                example: urn:ietf:params:scim:schemas:core:2.0:User
              name:
                type: string
                example: User
              description:
                type: string
                example: Core User Schema
              attributes:
                type: array
                items:
                  $ref: "#/components/schemas/ArcherSCIMSchemaAttribute"
              meta:
                type: object
                properties:
                  resourceType:
                    type: string
                    example: Schema
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
                example: urn:ietf:params:scim:schemas:core:2.0:User
              name:
                type: string
                example: User
              description:
                type: string
                example: Core User Schema
              attributes:
                type: array
                items:
                  $ref: "#/components/schemas/ArcherSCIMSchemaAttribute"
              meta:
                type: object
                properties:
                  resourceType:
                    type: string
                    example: Schema

    ResourceTypesListResponse:
      description: List of SCIM resource types
      content:
        application/scim+json:
          schema:
            type: object
            properties:
              schemas:
                type: array
                items:
                  type: string
              Resources:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    name:
                      type: string
                    endpoint:
                      type: string
                    description:
                      type: string
                    schema:
                      type: string
                    schemaExtensions:
                      type: array
                      items:
                        type: object
                        properties:
                          schema:
                            type: string
                          required:
                            type: boolean
              meta:
                type: object
                properties:
                  resourceType:
                    type: string
        application/json:
          schema:
            type: object
            properties:
              schemas:
                type: array
                items:
                  type: string
              Resources:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    name:
                      type: string
                    endpoint:
                      type: string
                    description:
                      type: string
                    schema:
                      type: string
                    schemaExtensions:
                      type: array
                      items:
                        type: object
                        properties:
                          schema:
                            type: string
                          required:
                            type: boolean
              meta:
                type: object
                properties:
                  resourceType:
                    type: string

    UserResourceTypeResponse:
      description: User resource type metadata
      content:
        application/scim+json:
          schema:
            type: object
            properties:
              schemas:
                type: array
                items:
                  type: string
              id:
                type: string
              name:
                type: string
              endpoint:
                type: string
              description:
                type: string
              schema:
                type: string
              schemaExtensions:
                type: array
                items:
                  type: object
                  properties:
                    schema:
                      type: string
                    required:
                      type: boolean
              meta:
                type: object
                properties:
                  resourceType:
                    type: string
        application/json:
          schema:
            type: object
            properties:
              schemas:
                type: array
                items:
                  type: string
              id:
                type: string
              name:
                type: string
              endpoint:
                type: string
              description:
                type: string
              schema:
                type: string
              schemaExtensions:
                type: array
                items:
                  type: object
                  properties:
                    schema:
                      type: string
                    required:
                      type: boolean
              meta:
                type: object
                properties:
                  resourceType:
                    type: string

    GroupResourceTypeResponse:
      description: Group resource type metadata
      content:
        application/scim+json:
          schema:
            type: object
            properties:
              schemas:
                type: array
                items:
                  type: string
              id:
                type: string
              name:
                type: string
              endpoint:
                type: string
              description:
                type: string
              schema:
                type: string
              schemaExtensions:
                type: array
                items:
                  type: object
                  properties:
                    schema:
                      type: string
                    required:
                      type: boolean
              meta:
                type: object
                properties:
                  resourceType:
                    type: string
        application/json:
          schema:
            type: object
            properties:
              schemas:
                type: array
                items:
                  type: string
              id:
                type: string
              name:
                type: string
              endpoint:
                type: string
              description:
                type: string
              schema:
                type: string
              schemaExtensions:
                type: array
                items:
                  type: object
                  properties:
                    schema:
                      type: string
                    required:
                      type: boolean
              meta:
                type: object
                properties:
                  resourceType:
                    type: string

  schemas:
    ArcherSCIMModelsUsersUserDefinition:
      type: object
      required:
        - userName
        - name
      properties:
        schemas:
          type: array
          items:
            type: string
            enum:
              - urn:ietf:params:scim:schemas:core:2.0:User
              - urn:ietf:params:scim:schemas:extension:enterprise:2.0:User
              - urn:ietf:params:scim:schemas:extension:Archer:2.0:User
          example: 
            - urn:ietf:params:scim:schemas:core:2.0:User
            - urn:ietf:params:scim:schemas:extension:enterprise:2.0:User
            - urn:ietf:params:scim:schemas:extension:Archer:2.0:User
          minItems: 1
          contains:
            const: urn:ietf:params:scim:schemas:core:2.0:User
        userName:
          type: string
          maxLength: 256
          pattern: "^[A-Za-zÀ-ÿ\u4E00-\u9FFF\uAC00-\uD7AF\u3040-\u309F\u30A0-\u30FF\u0100-\u017F\u00C0-\u00FF\u0400-\u04FF\u0370-\u03FF\u00F1\u00F3\u00E9\u00E0\u00E7\u00ED\u00E2\u00F6\u00F4\u00E9\u0020\u002D\u005F@#&*!.?]+$"
          example: "Johndoe"
        active:
          type: boolean
          example: true
        meta:
          type: object
          properties:
            resourceType:
              type: string
              example: User
        name:
          type: object
          required:
            - givenName
            - familyName
          properties:
            givenName:
              type: string
              description: The user's first name
              maxLength: 256
              pattern: "(^[A-Za-zÀ-ÿ\u4E00-\u9FFF\uAC00-\uD7AF\u3040-\u309F\u30A0-\u30FF\u0100-\u017F\u00C0-\u00FF\u0400-\u04FF\u0370-\u03FF\u00F1\u00F3\u00E9\u00E0\u00E7\u00ED\u00E2\u00F6\u00F4\u00E9\u0020\u002D\u005F@#&*!.?]+$|^$)"
              example: "John"
            middleName:
              description: The user's middle name
              oneOf:
                - type: string
                  maxLength: 256
                  pattern: "(^[A-Za-zÀ-ÿ\u4E00-\u9FFF\uAC00-\uD7AF\u3040-\u309F\u30A0-\u30FF\u0100-\u017F\u00C0-\u00FF\u0400-\u04FF\u0370-\u03FF\u00F1\u00F3\u00E9\u00E0\u00E7\u00ED\u00E2\u00F6\u00F4\u00E9\u0020\u002D\u005F@#&*!.?]+$|^$)"
                  example: ""
                - type: "null"
            familyName:
              type: string
              description: The user's family/surname name
              maxLength: 256
              pattern: "(^[A-Za-zÀ-ÿ\u4E00-\u9FFF\uAC00-\uD7AF\u3040-\u309F\u30A0-\u30FF\u0100-\u017F\u00C0-\u00FF\u0400-\u04FF\u0370-\u03FF\u00F1\u00F3\u00E9\u00E0\u00E7\u00ED\u00E2\u00F6\u00F4\u00E9\u0020\u002D\u005F@#&*!.?]+$|^$)"
              example: "doe"
        title:
          type: string
          description: The user's title 
          maxLength: 256
          example: "Software Principal Engineer"
        displayName:
          type: string
          description: The user's displayname
          maxLength: 256
          example: "John,Doe"
        profileUrl:
          type: string
          description: The user's profileUrl
          maxLength: 2048
          example: "https://test.com/scim/v2/Users/347912"
        preferredLanguage:
          description: The user's prefferedLanguage
          oneOf:
            - type: string
              maxLength: 256
              example: "None"
            - type: "null"
        locale:
          description: The user's locale
          oneOf:
            - type: string
              maxLength: 256
              example: "en-US"
            - type: "null"
        timezone:
          description: The user's timeZone
          oneOf:
            - type: string
              maxLength: 256
              example: "UTC"
            - type: "null"
        emails:
          type: array
          items:
            type: object
            properties:
              value:
                description: The user's email
                oneOf:
                  - type: string
                    maxLength: 100
                    example: "abc@abc.com"
                  - type: "null"
              type:
                description: The user's Type
                oneOf:
                  - type: string
                    maxLength: 100
                    example: "Business"
                  - type: "null"
              primary:
                description: Whether this email is primary
                oneOf:
                  - type: boolean
                    example: true
                  - type: "null"
        phoneNumbers:
          type: array
          items:
            type: object
            properties:
              value:
                description: The user's PhoneNumber
                oneOf:
                  - type: string
                    maxLength: 15
                    pattern: "^(\\+?\\d{1,3}[- ]?)?(\\d{2,4}([- ]?\\d{2,4})*)$|^$"
                    example: "08 9007 4790"
                  - type: "null"
              type:
                description: The user's Type
                oneOf:
                  - type: string
                    maxLength: 256
                    example: "Business"
                  - type: "null"
              primary:
                description: Whether this phone number is primary
                oneOf:
                  - type: boolean
                    example: true
                  - type: "null"
        groups:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
                description: Unique identifier for the group.
              display:
                type: string
                description: Display name of the group.
              type:
                type: string
                description: Type of group membership.
          description: List of groups the user belongs to.
          default: []
        urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:
          type: object
          properties:
            organization:
              description: The user's Organization
              oneOf:
                - type: string
                  maxLength: 256
                  example: ""
                - type: "null"
            department:
              description: The user's department
              oneOf:
                - type: string
                  maxLength: 256
                  example: ""
                - type: "null"
        urn:ietf:params:scim:schemas:extension:Archer:2.0:User:
          type: object
          properties:
            domainId:
              oneOf:
                - type: string
                  description: The user's domainId as a string
                  maxLength: 6
                - type: integer
                  format: int64
                  minimum: 0
                  maximum: 999999
                  description: The user's domainId as a number
                - type: "null"
            defaultHomeDashboardId:
              oneOf:
                - type: string
                  description: The user's defaultHomeDashboardId as a string
                  maxLength: 6
                - type: integer
                  format: int64
                  minimum: -1
                  maximum: 999999
                  description: The user's defaultHomeDashboardId as a number
                - type: "null"
              example: 1
            defaultHomeWorkspaceId:
              oneOf:
                - type: string
                  description: The user's defaultHomeWorkspaceId as a string
                  maxLength: 6
                - type: integer
                  format: int64
                  minimum: -1
                  maximum: 999999
                  description: The user's defaultHomeWorkspaceId as a number
                - type: "null"
              example: 1              
            enableApproveContentByEmail:
              oneOf:
                - type: string
                  description: The user's enableApproveContentByEmail as a string
                  maxLength: 6
                - type: boolean
                  description: The user's enableApproveContentByEmail as boolean
                  maxLength: 6
              example: false
            forcePasswordChange:
              oneOf:
                - type: string
                  description: The user's forcePasswordChange as a string
                  maxLength: 6
                - type: boolean
                  description: The user's enableApproveContentByEmail as boolean
                  maxLength: 6
            additionalNote:
              description: The user's additionalNote
              oneOf:
                - type: string
                  maxLength: 256
                  example: ""
                - type: "null"
            securityId:
              oneOf:
                - type: string
                  description: The user's securityId as a string
                  maxLength: 6
                - type: integer
                  format: int64
                  minimum: 0
                  maximum: 999999
                  description: The user's securityId as a number
                - type: "null"
              example: 3
    ArcherSCIMModelsUsersResponse:
      required:
        - id
        - externalId
        - meta
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
            maxLength: 256
            pattern: '^urn:ietf:params:scim:api:messages:2\\.0:ListResponse$'
            example: "urn:ietf:params:scim:api:messages:2.0:ListResponse"
        id:
          type: string
          description: The user's unique key
          maxLength: 6
        externalId:
          type: string
          description: The user's unique key
          maxLength: 6
        members:
          type: array
          description: An array of members
          items:
            $ref: '#/components/schemas/ArcherSCIMModelsUsersUserDefinition'
        meta: 
          $ref: '#/components/schemas/ArcherSCIMModelsUsersMetadata'
    ArcherSCIMModelsUsersMetadata:
      required:
        - resourceType
        - created 
        - lastmodified
      type: object
      properties:
        resourceType:
          type: string
          description: ""
          maxLength: 10
          pattern: ""
          example: "User"
        created:
          type: string
          description: The date and type the user created 
          format: date-time
          maxLength: 56
          pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}$"
          example: "2023-08-10T13:52:35.197"
        lastmodified:
          type: string 
          description: The date and type the user last modified
          maxLength: 56
          pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}$"
          example: "2024-09-04T15:35:23.687"
      description: User Metadata
    ArcherSCIMModelsGroupsGroupDefinition:
      required:
        - displayName
        - members
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
            description: The group's schemas
            maxLength: 256
            pattern: "^urn:ietf:params:scim:schemas:(core|extension:(enterprise|Archer)):2\\.0:(User|Group)$"
            example: "urn:ietf:params:scim:schemas:core:2.0:Group"
        displayName:
          type: string
          description: The group's display name
          maxLength: 256
          pattern: "^[A-Za-zÀ-ÿ\u4E00-\u9FFF\uAC00-\uD7AF\u3040-\u309F\u30A0-\u30FF\u0100-\u017F\u00C0-\u00FF\u0400-\u04FF\u0370-\u03FF\u00F1\u00F3\u00E9\u00E0\u00E7\u00ED\u00E2\u00F6\u00F4\u00E9\u0020\u002D\u005F@#&*!.?]+$"
          example: SCIMTestGroup
        members:
          type: array
          description: An array of members
          items:
            $ref: '#/components/schemas/ArcherSCIMModelsGroupsDefinitionMember'
      description: Describes the parameters to create a Group
    ArcherSCIMModelsGroupsResponse:
      required:
        - displayName
        - id
        - meta
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
            maxLength: 256
            pattern: '^urn:ietf:params:scim:api:messages:2\\.0:Group$'
            example: "urn:ietf:params:scim:api:messages:2.0:Group"
        id:
          type: string
          description: The group's unique key
          maxLength: 6
          example: ""
        displayName:
          type: string
          description: The group's display name
          maxLength: 256
          example: "John"
          pattern: "^[A-Za-zÀ-ÿ\u4E00-\u9FFF\uAC00-\uD7AF\u3040-\u309F\u30A0-\u30FF\u0100-\u017F\u00C0-\u00FF\u0400-\u04FF\u0370-\u03FF\u00F1\u00F3\u00E9\u00E0\u00E7\u00ED\u00E2\u00F6\u00F4\u00E9\u0020\u002D\u005F@#&*!.?]+$"
        members:
          type: array
          description: An array of members
          items:
            $ref: '#/components/schemas/ArcherSCIMModelsGroupsDefinitionMember'
        meta:
          $ref: '#/components/schemas/ArcherSCIMModelsGroupsMetadata'
      description: Describes a group belonging to an organization
    ArcherSCIMModelsGroupsMetadata:
      required:
        - created
      type: object
      properties:
        resourceType:
          type: string
          example: Group
          description: The resource type of the group
          maxLength: 2048
      description: Group metadata
    
    ArcherSCIMModelsGroupsDefinitionMember:
      type: object
      required:
        - value
      properties:
        display:
          type: string
          maxLength: 1026
          example: "Cole, Joe"
          description: A member of a group. This can be the display name of a user or group
        value:
          type: string
          description: Depending on the member type this is a groupKey or a userKey
          maxLength: 12
          example: "1210"
      
    ArcherSCIMModelsGroupPatchRequestBody:
      required:
        - Operations
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
            maxLength: 60
            pattern: '^urn:ietf:params:scim:api:messages:2.0:PatchOp$'
            example: urn:ietf:params:scim:api:messages:2.0:PatchOp
        Operations:
          type: array
          description: Operations allowed while doing a PATCH request on Group
          items:
            anyOf:
              - $ref: "#/components/schemas/ArcherSCIMModelsGroupsPatchGroupOperations"
              - $ref: "#/components/schemas/ArcherSCIMModelsGroups2PatchGroupOperations"
      description: Describes the PATCH definition
    
    ArcherSCIMModelsUsersPatchRequestBody:
      required:
        - Operations
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
            maxLength: 60
            pattern: '^urn:ietf:params:scim:api:messages:2.0:PatchOp$'
            example: urn:ietf:params:scim:api:messages:2.0:PatchOp
        Operations:
          type: array
          description: Operations allowed while doing a PATCH request on User
          items:
            anyOf:
              - $ref: "#/components/schemas/ArcherSCIMModelsUsersPatchUserOperations"
              - $ref: "#/components/schemas/ArcherSCIMModelsUsers2PatchUserOperations"
      description: Describes the PATCH definition
    
    ArcherSCIMModelsGroupsPatchGroupOperations:
      required:
        - op
      type: object
      properties:
        op:
          type: string
          maxLength: 8
          pattern: '^(remove|Remove|add|Add|replace|Replace)$'
          description: Type of operation to be performed on Group
          enum:
            - add
            - Add
            - remove
            - Remove
            - replace
            - Replace
        path:
          type: string
          description: the parameter to be modified
          maxLength: 100
          example: members
        value:
          oneOf:
            - type: array
              description: Values for member operations
              example: [
                {
                  "value" : "{{valid_userId}}"
                }]
              items:
                $ref: "#/components/schemas/ArcherSCIMModelsGroupPatchValue"
            - type: string
              description: Value for displayName operation
              maxLength: 256
      description: The operations which are allowed in a Group PATCH request
    
    ArcherSCIMModelsGroups2PatchGroupOperations:
      required:
        - op
      type: object
      properties:
        op:
          type: string
          maxLength: 8
          pattern: '^(remove|Remove|add|Add|replace|Replace)$'
          description: Type of operation to be performed on Group
          enum:
            - add
            - Add
            - remove
            - Remove
            - replace
            - Replace
        path:
          type: string
          description: the parameter to be modified
          maxLength: 100
          example: members
        value:
          type: array
          description: Values which needs to be passed in a PATCH request
          example: [
            {
              "value" : "{{new_userId}}"
            }]
          items:
            $ref: "#/components/schemas/ArcherSCIMModelsGroupPatchValue"
      description: The operations which are allowed in a Group PATCH request
    
    ArcherSCIMModelsUsersPatchUserOperations:
      required:
        - op
      type: object
      properties:
        op:
          type: string
          maxLength: 8
          pattern: '^(add|Add|remove|Remove|replace|Replace)$' 
          description: Type of operation to be performed on User
          enum:
            - add
            - Add
            - remove
            - Remove
            - replace
            - Replace
        path:
          type: string
          description: the parameter to be modified
          maxLength: 100
          example: members
        value:
          type: string
          description: Values which needs to be added to the particular parameter
          pattern: "^.*$"
          example: ""
          items: 
            $ref: "#/components/schemas/ArcherSCIMModelsUserPatchValue"
      description: The operations which are allowed in a User PATCH request.
    ArcherSCIMModelsUsers2PatchUserOperations:
      required:
        - op
      type: object
      properties:
        op:
          type: string
          maxLength: 8
          pattern: '^(add|Add|remove|Remove|replace|Replace)$' 
          description: Type of operation to be performed on User
          enum:
            - add
            - Add
            - remove
            - Remove
            - replace
            - Replace
        path:
          type: string
          description: the parameter to be modified
          maxLength: 100
          example: members
        value:
          type: string
          description: Values which needs to be added to the particular parameter
          pattern: "^.*$"
          example: ""
          items: 
            $ref: "#/components/schemas/ArcherSCIMModelsUserPatchValue"
      description: The operations which are allowed in a User PATCH request.
    ArcherSCIMModelsUserPatchValue:
      required:
        - value
      type: object
      properties:
        value:
          type: string
          description: userKey which needs to undergo the operation
          maxLength: 256
          example: ""
      description: Operation allowed in a PATCH request
    ArcherSCIMModelsGroupPatchValue:
      required:
        - value
      type: object
      properties:
        value:
          type: string
          description: userKey which needs to undergo the operation
          maxLength: 256
          example: ""
      description: Operation allowed in a PATCH request
    ArcherSCIMModelsUsersUserListResponse:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
            maxLength: 52
            pattern: '^urn:ietf:params:scim:api:messages:2\\.0:ListResponse$'
            example: "urn:ietf:params:scim:api:messages:2.0:ListResponse"
        itemsPerPage:
          type: integer
          example: 2
          format: int64
          minimum: 0
          maximum: 999999
        startIndex:
          type: integer
          example: 1
          format: int64
          minimum: 0
          maximum: 999999
        totalResults:
          type: integer
          example: 0
          format: int64
          minimum: 0
          maximum: 999999
        Resources:
          type: array
          items:
            $ref: '#/components/schemas/ArcherSCIMModelsUsersUserDefinition'
    ArcherSCIMModelsGroupListResponse:
      required:
        - displayName
        - id
        - meta
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
            maxLength: 256
            pattern: '^urn:ietf:params:scim:api:messages:2\\.0:Group$'
            example: "urn:ietf:params:scim:api:messages:2.0:Group"
        id:
          type: string
          description: The group's unique key
          maxLength: 6
          example: ""
        displayName:
          type: string
          description: The group's display name
          maxLength: 256
          example: "John"
          pattern: "^[A-Za-zÀ-ÿ\u4E00-\u9FFF\uAC00-\uD7AF\u3040-\u309F\u30A0-\u30FF\u0100-\u017F\u00C0-\u00FF\u0400-\u04FF\u0370-\u03FF\u00F1\u00F3\u00E9\u00E0\u00E7\u00ED\u00E2\u00F6\u00F4\u00E9\u0020\u002D\u005F@#&*!.?]+$"
        members:
          type: array
          description: An array of members
          items:
            $ref: '#/components/schemas/ArcherSCIMModelsGroupsDefinitionMember'
        meta:
          $ref: '#/components/schemas/ArcherSCIMModelsGroupsMetadata'
        itemsPerPage:
          type: integer
          example: 2
          format: int64
          minimum: 0
          maximum: 999999
        schema:
          type: array
          items:
            type: string
            maxLength: 100
            example: "urn:ietf:params:scim:api:messages:2.0:ListResponse"
        startIndex:
          type: integer
          example: 1
          format: int64
          minimum: 0
          maximum: 999999
        totalResults:
          type: integer
          example: 0
          format: int64
          minimum: 0
          maximum: 999999
    ArcherSCIMModelsUsersGetUserErrorResponse:
      type: object
      properties:
        totalResults:
          type: integer
          example: 0
          format: int64
          minimum: 0
          maximum: 999999
        itemsPerPage:
          type: integer
          example: 10
          format: int64
          minimum: 0
          maximum: 999999
        startIndex:
          type: integer
          example: 1
          format: int64
          minimum: 0
          maximum: 999999
        schemas:
          type: array
          items:
            type: string
            maxLength: 52
            pattern: '^urn:ietf:params:scim:api:messages:2\\.0:ListResponse$'
            example:
              - "urn:ietf:params:scim:api:messages:2.0:ListResponse"
        Resources:
          type: array
          items:
            type: object
          example: []

    ArcherSCIMModelsErrorResponse:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
            maxLength: 52
            pattern: '^urn:ietf:params:scim:api:messages:2\\.0:Error$'
            enum:
              - urn:ietf:params:scim:api:messages:2.0:Error
            example: 
              - urn:ietf:params:scim:api:messages:2.0:Error
        detail: 
          type: string
          maxLength: 50
          description: "An user provision failure"
        status:
          type: string
          maxLength: 4
          description: "404"
        instance_id:
          type: string
          maxLength: 6
          description: "500038"
    ArcherSCIMModelsErrorResponseValidation:
      type: object
      properties:
        message:
          type: string
          maxLength: 50
          description: "Invalid request parameters"
          
    ArcherSCIMModelsServiceProviderConfigResponse:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
          example: ["urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig"]
        patch:
          type: object
          properties:
            supported:
              type: boolean
        bulk:
          type: object
          properties:
            supported:
              type: boolean
            maxOperations:
              type: integer
            maxPayloadSize:
              type: integer
        filter:
          type: object
          properties:
            supported:
              type: boolean
            maxResults:
              type: integer
        changePassword:
          type: object
          properties:
            supported:
              type: boolean
        sort:
          type: object
          properties:
            supported:
              type: boolean
        etag:
          type: object
          properties:
            supported:
              type: boolean
        authenticationSchemes:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              name:
                type: string
              description:
                type: string
              specUri:
                type: string
              documentationUri:
                type: string
        meta:
          type: object
          properties:
            resourceType:
              type: string


        
  securitySchemes:
    lambdaAuthorizer:
      type: apiKey
      name: Authorization
      in: header
      x-amazon-apigateway-authorizer:
        type: request
        identitySource: method.request.header.Authorization
        authorizerUri: ${authorizer_uri}
        authorizerCredentials: ${authorizer_credentials}
        authorizerPayloadFormatVersion: '2.0'
        authorizerResultTtlInSeconds: 300
      x-amazon-apigateway-authtype: Custom scheme with corporate claims
#validators aws apigateway
x-amazon-apigateway-request-validators:
  basic:
    validateRequestParameters: false
    validateRequestBody: true
  params-only:
    validateRequestParameters: true
    validateRequestBody: false