{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-datazone/json-schema/amazon-datazone-get-subscription-grant-output-schema.json",
  "title": "GetSubscriptionGrantOutput",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-datazone-subscription-grants-api-openapi.yml#/components/schemas/GetSubscriptionGrantOutput",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The ID of the subscription grant."
    },
    "createdBy": {
      "type": "string",
      "description": "The Amazon DataZone user who created the subscription grant."
    },
    "updatedBy": {
      "type": "string",
      "description": "The Amazon DataZone user who updated the subscription grant."
    },
    "domainId": {
      "type": "string",
      "description": "The ID of the Amazon DataZone domain in which the subscription grant exists."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp of when the subscription grant is created."
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp of when the subscription grant was upated."
    },
    "environmentId": {
      "type": "string",
      "description": "The environment ID of the subscription grant."
    },
    "subscriptionTargetId": {
      "type": "string",
      "description": "The subscription target ID associated with the subscription grant."
    },
    "grantedEntity": {
      "$ref": "#/$defs/GrantedEntity"
    },
    "status": {
      "type": "string",
      "enum": [
        "PENDING",
        "IN_PROGRESS",
        "GRANT_FAILED",
        "REVOKE_FAILED",
        "GRANT_AND_REVOKE_FAILED",
        "COMPLETED",
        "INACCESSIBLE"
      ],
      "description": "The status of the subscription grant."
    },
    "assets": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SubscribedAsset"
      },
      "description": "The assets for which the subscription grant is created."
    },
    "subscriptionId": {
      "type": "string",
      "description": "The identifier of the subscription."
    }
  },
  "required": [
    "id",
    "createdBy",
    "domainId",
    "createdAt",
    "updatedAt",
    "subscriptionTargetId",
    "grantedEntity",
    "status"
  ],
  "$defs": {
    "AssetScope": {
      "type": "object",
      "properties": {
        "assetId": {
          "type": "string",
          "description": "The asset ID of the asset scope."
        },
        "filterIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The filter IDs of the asset scope."
        },
        "status": {
          "type": "string",
          "description": "The status of the asset scope."
        },
        "scopeName": {
          "type": "string",
          "description": "The name of the materialized asset scope."
        },
        "errorMessage": {
          "type": "string",
          "description": "The error message of the asset scope."
        }
      },
      "required": [
        "assetId",
        "filterIds",
        "status"
      ]
    },
    "FailureCause": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "The description of the error message."
        }
      }
    },
    "GrantedEntity": {
      "type": "object",
      "properties": {
        "listing": {
          "$ref": "#/$defs/ListingRevision"
        }
      },
      "description": "Exactly one member is set."
    },
    "ListingRevision": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "An identifier of a revision of an asset published in a Amazon DataZone catalog."
        },
        "revision": {
          "type": "string",
          "description": "The details of a revision of an asset published in a Amazon DataZone catalog."
        }
      },
      "required": [
        "id",
        "revision"
      ]
    },
    "Permissions": {
      "type": "object",
      "properties": {
        "s3": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "READ",
              "WRITE"
            ]
          },
          "description": "The S3 details of the asset permissions."
        }
      },
      "description": "Exactly one member is set."
    },
    "SubscribedAsset": {
      "type": "object",
      "properties": {
        "assetId": {
          "type": "string",
          "description": "The identifier of the asset for which the subscription grant is created."
        },
        "assetRevision": {
          "type": "string",
          "description": "The revision of the asset for which the subscription grant is created."
        },
        "status": {
          "type": "string",
          "enum": [
            "GRANT_PENDING",
            "REVOKE_PENDING",
            "GRANT_IN_PROGRESS",
            "REVOKE_IN_PROGRESS",
            "GRANTED",
            "REVOKED",
            "GRANT_FAILED",
            "REVOKE_FAILED"
          ],
          "description": "The status of the asset for which the subscription grant is created."
        },
        "targetName": {
          "type": "string",
          "description": "The target name of the asset for which the subscription grant is created."
        },
        "failureCause": {
          "$ref": "#/$defs/FailureCause"
        },
        "grantedTimestamp": {
          "type": "string",
          "description": "The timestamp of when the subscription grant to the asset is created."
        },
        "failureTimestamp": {
          "type": "string",
          "description": "The failure timestamp included in the details of the asset for which the subscription grant is created."
        },
        "assetScope": {
          "$ref": "#/$defs/AssetScope"
        },
        "permissions": {
          "$ref": "#/$defs/Permissions"
        }
      },
      "required": [
        "assetId",
        "assetRevision",
        "status"
      ]
    }
  }
}