swagger: '2.0'
info:
  version: '2.0'
  title: password-policies
consumes:
  - application/json
produces:
  - application/json
paths:
  /password-policies:
    get:
      tags:
        - password-policies
      description: Get a collection of password policies.
      operationId: getPasswordPolicies
      parameters:
        - name: id
          in: query
          description: The unique numeric ID for identifying a password policy.
          required: false
          type: integer
          format: int64
        - name: matchUserId
          in: query
          description: Specifies whether the user ID and password can match. A value of 0 indicates that they cannot match. A value of 1 indicates that they can match. Default value is 0.
          required: false
          type: integer
          format: int32
        - name: maximumConsecutiveType
          in: query
          description: The maximum number of consecutive character type allowed in a password. Default value is 4.
          required: false
          type: integer
          format: int32
        - name: maximumInstances
          in: query
          description: The maximum number of times a character can occur in a password. Default value is 3.
          required: false
          type: integer
          format: int32
        - name: maximumLifetime
          in: query
          description: 'The maximum number of days for which a password is valid, from the last time it is updated. Default value is 90.'
          required: false
          type: integer
          format: int32
        - name: minimumAlphabetic
          in: query
          description: The minimum number of alphabetic characters that should be in a password. Default value is 1.
          required: false
          type: integer
          format: int32
        - name: minimumNumeric
          in: query
          description: The minimum number of numeric characters that should be in a password. Default value is 1.
          required: false
          type: integer
          format: int32
        - name: minimumPasswordLength
          in: query
          description: The minimum password length in characters. Default value is 8.
          required: false
          type: integer
          format: int32
        - name: reusePassword
          in: query
          description: 'Specifies whether the user''s previous password(s) can be reused. A value of 0 indicates that the previous password cannot be reused. A value of 1 or greater indicates that the previous password can be reused. A negative integer, n, indicates that the last n passwords cannot be reused. For example, if the value is set to -4, it means that the last 4 passwords cannot be reused. Note that a value of -1 or 0 both indicate that the previous password cannot be reused. Default value is -1.'
          required: false
          type: integer
          format: int32
        - name: offset
          in: query
          description: 'The position within the resulting dataset where the query begins returning item records. If the offset is "5", the records that returned begin with the sixth record that matches the query parameters. If the offset is "0", the records that are returned begin with the first record that matches the query parameters.'
          required: false
          type: integer
          format: int32
        - name: limit
          in: query
          description: The maximum number of records to return.
          required: false
          type: integer
          format: int32
        - name: fields
          in: query
          description: 'The comma-separated set of properties to be returned. If no properties are specified, all properties are returned.'
          required: false
          type: string
        - name: expand
          in: query
          description: 'The comma-separated set of related resources referenced in the links to be returned. If no related resources are specified, no related resources are returned.'
          required: false
          type: string
        - name: sort
          in: query
          description: 'The comma-separated set of properties which controls the order of the items being listed, prefixed by either (-) to sort by descending order, or optionally (+) to sort by ascending order. For example, sort=name,-d which means, order the items based on the name value in ascending order, then by the id value in descending order.'
          required: false
          type: string
      responses:
        '200':
          description: A collection of password policies.
          schema:
            $ref: '#/definitions/PasswordPolicyCollection'
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    post:
      tags:
        - password-policies
      description: Create a password policy.
      operationId: createPasswordPolicy
      parameters:
        - in: body
          name: PasswordPolicy
          description: The password policy.
          required: true
          schema:
            $ref: '#/definitions/PasswordPolicy'
      responses:
        '201':
          description: The operation was successful.
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
  '/password-policies/{id}':
    get:
      tags:
        - password-policies
      description: Get a password policy.
      operationId: getPasswordPolicyById
      parameters:
        - name: fields
          in: query
          description: 'The comma-separated set of properties to be returned. If no properties are specified, all properties are returned.'
          required: false
          type: string
        - name: expand
          in: query
          description: 'The comma-separated set of related resources referenced in the links to be returned. If no related resources are specified, no related resources are returned.'
          required: false
          type: string
        - name: sort
          in: query
          description: 'The comma-separated set of properties which controls the order of the items being listed, prefixed by either (-) to sort by descending order, or optionally (+) to sort by ascending order. For example, sort=name,-d which means, order the items based on the name value in ascending order, then by the id value in descending order.'
          required: false
          type: string
      responses:
        '200':
          description: The password policy.
          schema:
            $ref: '#/definitions/PasswordPolicy'
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '404':
          description: The resource was not found.
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    delete:
      tags:
        - password-policies
      description: Delete a password policy.
      operationId: deletePasswordPolicyById
      parameters: []
      responses:
        '204':
          description: The operation was successful.
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '404':
          description: The resource was not found.
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    patch:
      tags:
        - password-policies
      description: Update a password policy.
      operationId: updatePasswordPolicyById
      parameters:
        - in: body
          name: PasswordPolicy
          description: The password policy.
          required: true
          schema:
            $ref: '#/definitions/PasswordPolicy'
      responses:
        '200':
          description: The operation was successful.
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '404':
          description: The resource was not found.
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    parameters:
      - name: id
        in: path
        description: The unique numeric ID for identifying a password policy.
        required: true
        type: integer
        format: int64
  '/password-policies/{id}/descriptions':
    get:
      tags:
        - password-policies
      description: ''
      operationId: getDescriptionsOfPasswordPolicy
      parameters:
        - name: offset
          in: query
          description: 'The position within the resulting dataset where the query begins returning item records. If the offset is "5", the records that returned begin with the sixth record that matches the query parameters. If the offset is "0", the records that are returned begin with the first record that matches the query parameters.'
          required: false
          type: integer
          format: int32
        - name: limit
          in: query
          description: The maximum number of records to return.
          required: false
          type: integer
          format: int32
        - name: fields
          in: query
          description: 'The comma-separated set of properties to be returned. If no properties are specified, all properties are returned.'
          required: false
          type: string
        - name: expand
          in: query
          description: 'The comma-separated set of related resources referenced in the links to be returned. If no related resources are specified, no related resources are returned.'
          required: false
          type: string
        - name: sort
          in: query
          description: 'The comma-separated set of properties which controls the order of the items being listed, prefixed by either (-) to sort by descending order, or optionally (+) to sort by ascending order. For example, sort=name,-d which means, order the items based on the name value in ascending order, then by the id value in descending order.'
          required: false
          type: string
      responses:
        '200':
          description: A collection of password policy descriptions.
          schema:
            $ref: '#/definitions/PasswordPolicyDescriptionCollection'
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    parameters:
      - name: id
        in: path
        description: The unique numeric ID for identifying a password policy.
        required: true
        type: integer
        format: int64
  '/password-policies/{id}/user-account-policies':
    get:
      tags:
        - password-policies
      description: ''
      operationId: getUserAccountPoliciesOfPasswordPolicy
      parameters:
        - name: offset
          in: query
          description: 'The position within the resulting dataset where the query begins returning item records. If the offset is "5", the records that returned begin with the sixth record that matches the query parameters. If the offset is "0", the records that are returned begin with the first record that matches the query parameters.'
          required: false
          type: integer
          format: int32
        - name: limit
          in: query
          description: The maximum number of records to return.
          required: false
          type: integer
          format: int32
        - name: fields
          in: query
          description: 'The comma-separated set of properties to be returned. If no properties are specified, all properties are returned.'
          required: false
          type: string
        - name: expand
          in: query
          description: 'The comma-separated set of related resources referenced in the links to be returned. If no related resources are specified, no related resources are returned.'
          required: false
          type: string
        - name: sort
          in: query
          description: 'The comma-separated set of properties which controls the order of the items being listed, prefixed by either (-) to sort by descending order, or optionally (+) to sort by ascending order. For example, sort=name,-d which means, order the items based on the name value in ascending order, then by the id value in descending order.'
          required: false
          type: string
      responses:
        '200':
          description: A collection of user account policies records.
          schema:
            $ref: '#/definitions/UserAccountPolicyCollection'
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    parameters:
      - name: id
        in: path
        description: The unique numeric ID for identifying a password policy.
        required: true
        type: integer
        format: int64
definitions:
  Link:
    type: object
    properties:
      href:
        type: string
        format: uri
        description: The URL of the link.
    description: Links to related resources.
  Error:
    type: object
    properties:
      code:
        type: string
        description: The error message code.
      message:
        type: string
        description: The error message.
      messageKey:
        type: string
        description: The error message key.
      messageArguments:
        type: array
        description: The arguments used to construct the error message.
        items:
          type: object
      correlationId:
        type: string
        description: The unique identifier for the request.
      locale:
        type: string
        description: The locale of the error message.
    description: The error message item model.
  ErrorResponseContainer:
    type: object
    properties:
      requestId:
        type: string
        description: The request identifier.
      errors:
        type: array
        description: The errors.
        items:
          $ref: '#/definitions/Error'
    description: The error message model.
  PasswordPolicy:
    type: object
    properties:
      id:
        type: integer
        format: int64
        description: The unique numeric ID for identifying a password policy.
      matchUserId:
        type: integer
        format: int32
        description: Specifies whether the user ID and password can match. A value of 0 indicates that they cannot match. A value of 1 indicates that they can match. Default value is 0.
      maximumConsecutiveType:
        type: integer
        format: int32
        description: The maximum number of consecutive character type allowed in a password. Default value is 4.
      maximumInstances:
        type: integer
        format: int32
        description: The maximum number of times a character can occur in a password. Default value is 3.
      maximumLifetime:
        type: integer
        format: int32
        description: 'The maximum number of days for which a password is valid, from the last time it is updated. Default value is 90.'
      minimumAlphabetic:
        type: integer
        format: int32
        description: The minimum number of alphabetic characters that should be in a password. Default value is 1.
      minimumNumeric:
        type: integer
        format: int32
        description: The minimum number of numeric characters that should be in a password. Default value is 1.
      minimumPasswordLength:
        type: integer
        format: int32
        description: The minimum password length in characters. Default value is 8.
      reusePassword:
        type: integer
        format: int32
        description: 'Specifies whether the user''s previous password(s) can be reused. A value of 0 indicates that the previous password cannot be reused. A value of 1 or greater indicates that the previous password can be reused. A negative integer, n, indicates that the last n passwords cannot be reused. For example, if the value is set to -4, it means that the last 4 passwords cannot be reused. Note that a value of -1 or 0 both indicate that the previous password cannot be reused. Default value is -1.'
      links:
        type: object
        description: Links to related resources.
        properties:
          descriptions:
            type: object
            description: ''
            properties:
              href:
                type: string
                description: The URL of the link.
          user-account-policies:
            type: object
            description: ''
            properties:
              href:
                type: string
                description: The URL of the link.
    description: The password policy.
  PasswordPolicyCollection:
    type: object
    properties:
      count:
        type: integer
        format: int64
        description: The total number of items.
      items:
        type: array
        description: The items.
        items:
          $ref: '#/definitions/PasswordPolicy'
    description: A collection of password policies.
  PasswordPolicyDescription:
    type: object
    properties:
      passwordPolicyId:
        type: integer
        format: int64
        description: The unique numeric ID for identifying the password policy.
      description:
        type: string
        description: The description of the password policy.
      languageId:
        type: integer
        format: int32
        description: 'The language of the description. For a list of integer language identifiers, please refer to the Knowledge Center.'
    description: The description of a password policy.
  PasswordPolicyDescriptionCollection:
    type: object
    properties:
      count:
        type: integer
        format: int64
        description: The total number of items.
      items:
        type: array
        description: The items.
        items:
          $ref: '#/definitions/PasswordPolicyDescription'
    description: A collection of password policy descriptions.
  UserAccountPolicy:
    type: object
    properties:
      id:
        type: integer
        format: int32
        description: The unique numeric ID for identifying a user account policy.
      userAccountLockoutPolicyId:
        type: integer
        format: int64
        description: The unique numeric ID for identifying a user account lockout policy.
      passwordPolicyId:
        type: integer
        format: int64
        description: The unique numeric ID for identifying a password policy.
      links:
        type: object
        description: Links to related resources.
        properties:
          descriptions:
            type: object
            description: ''
            properties:
              href:
                type: string
                description: The URL of the link.
    description: The user account policy.
  UserAccountPolicyCollection:
    type: object
    properties:
      count:
        type: integer
        format: int64
        description: The total number of items.
      items:
        type: array
        description: The items.
        items:
          $ref: '#/definitions/UserAccountPolicy'
    description: A collection of user account policies records.
