{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/CreateConsent",
  "title": "CreateConsent",
  "required": [
    "applicationDisplayName",
    "clientADR",
    "clientTrustedAdvisor",
    "consentId",
    "consentStatus",
    "expirationDate",
    "expirationDateTime",
    "links",
    "preferences",
    "providerId",
    "revokeDate",
    "revokeDateTime",
    "scope",
    "startDate",
    "startDateTime",
    "title",
    "titleBody"
  ],
  "type": "object",
  "properties": {
    "dataAccessFrequency": {
      "type": "string",
      "description": "Data Access Frequency explains the number of times that this consent can be used.<br> Otherwise called as consent frequency type.",
      "enum": [
        "ONE_TIME",
        "RECURRING"
      ]
    },
    "otspADRName": {
      "type": "string",
      "description": "Name of the Accredited Data Recipient/Organization"
    },
    "expirationDateTime": {
      "type": "string",
      "description": "Consent expiry datetime."
    },
    "preferences": {
      "type": "array",
      "description": "Preferences describes options about the additional usage of data or purge data",
      "items": {
        "$ref": "#/components/schemas/Preferences"
      }
    },
    "otspADR": {
      "type": "string",
      "description": "Unique/Accredition Id of the ADR"
    },
    "clientADR": {
      "type": "string",
      "description": "Client Name of the ADR"
    },
    "renewal": {
      "$ref": "#/components/schemas/Renewal"
    },
    "clientTrustedAdvisor": {
      "type": "array",
      "description": "describes information of client trusted advisor",
      "items": {
        "$ref": "#/components/schemas/ClientTrustedAdvisor"
      }
    },
    "revokeDateTime": {
      "type": "string",
      "description": "Consent revoke datetime."
    },
    "providerConsentId": {
      "type": "string",
      "description": "Provider consent id"
    },
    "revokeDate": {
      "type": "string",
      "description": "Consent revoke date."
    },
    "title": {
      "type": "string",
      "description": "Title for the consent form."
    },
    "applicationDisplayName": {
      "type": "string",
      "description": "Application display name."
    },
    "titleBody": {
      "type": "string",
      "description": "Description for the title."
    },
    "consentId": {
      "type": "integer",
      "description": "Consent Id generated through POST Consent.",
      "format": "int64"
    },
    "startDateTime": {
      "type": "string",
      "description": "Consent start datetime."
    },
    "customDisplayData": {
      "$ref": "#/components/schemas/CustomDisplayData"
    },
    "thirdPartyADR": {
      "type": "array",
      "description": "ThirdPartyADR describes details of additional parties which are accredited data recipients under organization",
      "items": {
        "$ref": "#/components/schemas/ThirdPartyADR"
      }
    },
    "providerId": {
      "type": "integer",
      "description": "Provider Id for which the consent needs to be generated.",
      "format": "int64"
    },
    "consentStatus": {
      "type": "string",
      "description": "Status of the consent.",
      "enum": [
        "ACTIVE",
        "CONSENT_GENERATED",
        "CONSENT_ACCEPTED",
        "CONSENT_AUTHORIZED",
        "CONSENT_MISMATCH",
        "PENDING",
        "EXPIRED",
        "REVOKED",
        "CONSENT_REPEALED"
      ]
    },
    "scope": {
      "type": "array",
      "description": "Scope describes about the consent permissions and their purpose.",
      "items": {
        "$ref": "#/components/schemas/Scope"
      }
    },
    "links": {
      "type": "array",
      "description": "GET consent preferences API details",
      "items": {
        "$ref": "#/components/schemas/Links"
      }
    },
    "startDate": {
      "type": "string",
      "description": "Consent start date."
    },
    "expirationDate": {
      "type": "string",
      "description": "Consent expiry date."
    }
  }
}