{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-datazone/json-schema/amazon-datazone-create-subscription-request-input-schema.json",
  "title": "CreateSubscriptionRequestInput",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-datazone-subscription-requests-api-openapi.yml#/components/schemas/CreateSubscriptionRequestInput",
  "type": "object",
  "properties": {
    "domainIdentifier": {
      "type": "string",
      "description": "The ID of the Amazon DataZone domain in which the subscription request is created."
    },
    "subscribedPrincipals": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SubscribedPrincipalInput"
      },
      "description": "The Amazon DataZone principals for whom the subscription request is created."
    },
    "subscribedListings": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SubscribedListingInput"
      },
      "description": "The published asset for which the subscription grant is to be created."
    },
    "requestReason": {
      "type": "string",
      "description": "The reason for the subscription request."
    },
    "clientToken": {
      "type": "string",
      "description": "A unique, case-sensitive identifier that is provided to ensure the idempotency of the request."
    },
    "metadataForms": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FormInput"
      },
      "description": "The metadata form included in the subscription request."
    },
    "assetPermissions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AssetPermission"
      },
      "description": "The asset permissions of the subscription request."
    },
    "assetScopes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AcceptedAssetScope"
      },
      "description": "The asset scopes of the subscription request."
    }
  },
  "required": [
    "domainIdentifier",
    "subscribedPrincipals",
    "subscribedListings",
    "requestReason"
  ],
  "$defs": {
    "AcceptedAssetScope": {
      "type": "object",
      "properties": {
        "assetId": {
          "type": "string",
          "description": "The asset ID of the accepted asset scope."
        },
        "filterIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The filter IDs of the accepted asset scope."
        }
      },
      "required": [
        "assetId",
        "filterIds"
      ]
    },
    "AssetPermission": {
      "type": "object",
      "properties": {
        "assetId": {
          "type": "string",
          "description": "The asset ID as part of the asset permissions."
        },
        "permissions": {
          "$ref": "#/$defs/Permissions"
        }
      },
      "required": [
        "assetId",
        "permissions"
      ]
    },
    "FormInput": {
      "type": "object",
      "properties": {
        "formName": {
          "type": "string",
          "description": "The name of the metadata form."
        },
        "typeIdentifier": {
          "type": "string",
          "description": "The ID of the metadata form type."
        },
        "typeRevision": {
          "type": "string",
          "description": "The revision of the metadata form type."
        },
        "content": {
          "type": "string",
          "description": "The content of the metadata form."
        }
      },
      "required": [
        "formName"
      ]
    },
    "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."
    },
    "SubscribedGroupInput": {
      "type": "object",
      "properties": {
        "identifier": {
          "type": "string",
          "description": "The ID of the subscribed group."
        }
      }
    },
    "SubscribedIamPrincipalInput": {
      "type": "object",
      "properties": {
        "identifier": {
          "type": "string",
          "description": "The ARN of the subscribed IAM principal."
        }
      }
    },
    "SubscribedListingInput": {
      "type": "object",
      "properties": {
        "identifier": {
          "type": "string",
          "description": "The identifier of the published asset for which the subscription grant is to be created."
        }
      },
      "required": [
        "identifier"
      ]
    },
    "SubscribedPrincipalInput": {
      "type": "object",
      "properties": {
        "project": {
          "$ref": "#/$defs/SubscribedProjectInput"
        },
        "user": {
          "$ref": "#/$defs/SubscribedUserInput"
        },
        "group": {
          "$ref": "#/$defs/SubscribedGroupInput"
        },
        "iam": {
          "$ref": "#/$defs/SubscribedIamPrincipalInput"
        }
      },
      "description": "Exactly one member is set."
    },
    "SubscribedProjectInput": {
      "type": "object",
      "properties": {
        "identifier": {
          "type": "string",
          "description": "The identifier of the project that is to be given a subscription grant."
        }
      }
    },
    "SubscribedUserInput": {
      "type": "object",
      "properties": {
        "identifier": {
          "type": "string",
          "description": "The ID of the subscribed user."
        }
      }
    }
  }
}