get:
  operationId: getLifecycleState
  tags:
    - Lifecycle States
  summary: Retrieves Lifecycle State
  description: >-
    This endpoint retrieves a Lifecycle State.

    A token with ORG_ADMIN or API authority is required to call this API.
  security:
    - oauth2: [idn:identity-profile-lifecycle-state:read]
  parameters:
    - in: path
      name: identity-profile-id
      description: Identity Profile ID
      required: true
      schema:
        type: string
      example: 2b838de9-db9b-abcf-e646-d4f274ad4238
    - in: path
      name: lifecycle-state-id
      description: Lifecycle State ID
      required: true
      schema:
        type: string
      example: ef38f94347e94562b5bb8424a56397d8
  responses:
    '200':
      description: The requested LifecycleState was successfully retrieved.
      content:
        application/json:
          schema:
            $ref: '../schemas/LifecycleState.yaml'
    '400':
      $ref: '../responses/400.yaml'
    '401':
      $ref: '../responses/401.yaml'
    '403':
      $ref: '../responses/403.yaml'
    '404':
      $ref: '../responses/404.yaml'
    '429':
      $ref: '../responses/429.yaml'
    '500':
      $ref: '../responses/500.yaml'
patch:
  operationId: updateLifecycleStates
  tags:
    - Lifecycle States
  summary: Update Lifecycle State
  description: >-
    This endpoint updates individual Lifecycle State fields using the [JSON Patch](https://tools.ietf.org/html/rfc6902) standard.

    A token with ORG_ADMIN or API authority is required to call this API.
  security:
    - oauth2: [idn:identity-profile-lifecycle-state:manage]
  parameters:
    - in: path
      name: identity-profile-id
      description: Identity Profile ID
      required: true
      schema:
        type: string
      example: 2b838de9-db9b-abcf-e646-d4f274ad4238
    - in: path
      name: lifecycle-state-id
      description: Lifecycle State ID
      required: true
      schema:
        type: string
      example: ef38f94347e94562b5bb8424a56397d8
  requestBody:
    required: true
    description: |
      A list of lifecycle state update operations according to the [JSON Patch](https://tools.ietf.org/html/rfc6902) standard.

      The following fields can be updated:
      * enabled
      * description
      * accountActions
      * accessProfileIds
      * emailNotificationOption
    content:
      application/json-patch+json:
        schema:
          type: array
          items:
            $ref: '../schemas/JsonPatchOperation.yaml'
        example:
          - op: "replace"
            path: "/description"
            value: "Updated description!"
          - op: "replace"
            path: "/accessProfileIds"
            value:
              - "2c918087742bab150174407a80f3125e"
              - "2c918087742bab150174407a80f3124f"
          - op: "replace"
            path: "/accountActions"
            value:
              - "action": "ENABLE"
                "sourceIds":
                  - "2c9180846a2f82fb016a481c1b1560c5"
                  - "2c9180846a2f82fb016a481c1b1560cc"
              - "action": "DISABLE"
                "sourceIds":
                  - "2c91808869a0c9980169a207258513fb"
          - op: "replace"
            path: "/emailNotificationOption"
            value:
              "notifyManagers": true
              "notifyAllAdmins": false
              "notifySpecificUsers": false
              "emailAddressList": []
  responses:
    '200':
      description: The LifecycleState was successfully updated.
      content:
        application/json:
          schema:
            $ref: '../schemas/LifecycleState.yaml'
    '400':
      $ref: '../responses/400.yaml'
    '401':
      $ref: '../responses/401.yaml'
    '403':
      $ref: '../responses/403.yaml'
    '404':
      $ref: '../responses/404.yaml'
    '429':
      $ref: '../responses/429.yaml'
    '500':
      $ref: '../responses/500.yaml'
delete:
  operationId: deleteLifecycleState
  tags:
    - Lifecycle States
  summary: Delete Lifecycle State by ID
  description: >-
    This endpoint deletes the Lifecycle State using it's ID.

    A token with API, or ORG_ADMIN authority is required to call this API.
  security:
    - oauth2: [idn:identity-profile-lifecycle-state:manage]
  parameters:
    - in: path
      name: identity-profile-id
      description: Identity Profile ID
      required: true
      schema:
        type: string
      example: 2b838de9-db9b-abcf-e646-d4f274ad4238
    - in: path
      name: lifecycle-state-id
      description: Lifecycle State ID
      required: true
      schema:
        type: string
      example: ef38f94347e94562b5bb8424a56397d8
  responses:
    '202':
      description: The request was successfully accepted into the system.
      content:
        application/json:
          schema:
            $ref: '../schemas/BaseReferenceDto.yaml'
    '400':
      $ref: '../responses/400.yaml'
    '401':
      $ref: '../responses/401.yaml'
    '403':
      $ref: '../responses/403.yaml'
    '404':
      $ref: '../responses/404.yaml'
    '429':
      $ref: '../responses/429.yaml'
    '500':
      $ref: '../responses/500.yaml'
