{
  "typeName" : "AWS::IoT::SoftwarePackageVersion",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-iot",
  "description" : "resource definition",
  "definitions" : {
    "PackageVersionStatus" : {
      "type" : "string",
      "enum" : [ "DRAFT", "PUBLISHED", "DEPRECATED" ]
    },
    "PackageVersionArtifact" : {
      "description" : "The artifact location of the package version",
      "type" : "object",
      "properties" : {
        "S3Location" : {
          "$ref" : "#/definitions/S3Location"
        }
      },
      "required" : [ "S3Location" ],
      "additionalProperties" : false
    },
    "ResourceAttributes" : {
      "type" : "object",
      "patternProperties" : {
        "^[a-zA-Z0-9:_-]+$" : {
          "type" : "string",
          "minLength" : 1,
          "pattern" : "^[^\\p{C}]+$"
        }
      },
      "additionalProperties" : false
    },
    "Tag" : {
      "description" : "A key-value pair to associate with a resource.",
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "description" : "The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ",
          "minLength" : 1,
          "maxLength" : 128,
          "pattern" : "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"
        },
        "Value" : {
          "type" : "string",
          "description" : "The value for the tag. You can specify a value that is 1 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ",
          "minLength" : 1,
          "maxLength" : 256
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    },
    "Sbom" : {
      "description" : "The sbom zip archive location of the package version",
      "type" : "object",
      "properties" : {
        "S3Location" : {
          "$ref" : "#/definitions/S3Location"
        }
      },
      "required" : [ "S3Location" ],
      "additionalProperties" : false
    },
    "S3Location" : {
      "description" : "The Amazon S3 location",
      "type" : "object",
      "properties" : {
        "Bucket" : {
          "type" : "string",
          "description" : "The S3 bucket",
          "minLength" : 1
        },
        "Key" : {
          "type" : "string",
          "description" : "The S3 key",
          "minLength" : 1
        },
        "Version" : {
          "type" : "string",
          "description" : "The S3 version"
        }
      },
      "required" : [ "Bucket", "Key", "Version" ],
      "additionalProperties" : false
    },
    "SbomValidationStatus" : {
      "description" : "The validation status of the Sbom file",
      "type" : "string",
      "enum" : [ "IN_PROGRESS", "FAILED", "SUCCEEDED", "" ]
    }
  },
  "properties" : {
    "Attributes" : {
      "$ref" : "#/definitions/ResourceAttributes"
    },
    "Artifact" : {
      "$ref" : "#/definitions/PackageVersionArtifact"
    },
    "Description" : {
      "type" : "string",
      "maxLength" : 1024,
      "minLength" : 0,
      "pattern" : "^[^\\p{C}]+$"
    },
    "ErrorReason" : {
      "type" : "string"
    },
    "PackageName" : {
      "type" : "string",
      "maxLength" : 128,
      "minLength" : 1,
      "pattern" : "^[a-zA-Z0-9-_.]+$"
    },
    "PackageVersionArn" : {
      "type" : "string",
      "pattern" : "^arn:[!-~]+$"
    },
    "Recipe" : {
      "description" : "The inline json job document associated with a software package version",
      "type" : "string"
    },
    "Sbom" : {
      "$ref" : "#/definitions/Sbom"
    },
    "SbomValidationStatus" : {
      "$ref" : "#/definitions/SbomValidationStatus"
    },
    "Status" : {
      "$ref" : "#/definitions/PackageVersionStatus"
    },
    "Tags" : {
      "description" : "An array of key-value pairs to apply to this resource.",
      "type" : "array",
      "maxItems" : 50,
      "uniqueItems" : true,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "VersionName" : {
      "type" : "string",
      "maxLength" : 64,
      "minLength" : 1,
      "pattern" : "^[a-zA-Z0-9-_.]+$"
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : false,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "iot:TagResource", "iot:UntagResource", "iot:ListTagsForResource" ]
  },
  "required" : [ "PackageName" ],
  "readOnlyProperties" : [ "/properties/ErrorReason", "/properties/PackageVersionArn", "/properties/Status", "/properties/SbomValidationStatus" ],
  "createOnlyProperties" : [ "/properties/PackageName", "/properties/VersionName" ],
  "primaryIdentifier" : [ "/properties/PackageName", "/properties/VersionName" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "iot:CreatePackageVersion", "iot:GetPackageVersion", "iot:ListTagsForResource", "iot:TagResource", "iot:GetIndexingConfiguration", "s3:GetObjectVersion", "iot:AssociateSbomWithPackageVersion" ]
    },
    "read" : {
      "permissions" : [ "iot:GetPackageVersion", "iot:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "iot:UpdatePackageVersion", "iot:GetPackageVersion", "iot:ListTagsForResource", "iot:TagResource", "iot:UntagResource", "iot:GetIndexingConfiguration", "s3:GetObjectVersion", "iot:AssociateSbomWithPackageVersion", "iot:DisassociateSbomFromPackageVersion" ]
    },
    "delete" : {
      "permissions" : [ "iot:DeletePackageVersion", "iot:UpdatePackageVersion", "iot:GetPackageVersion", "iot:GetIndexingConfiguration" ]
    },
    "list" : {
      "handlerSchema" : {
        "properties" : {
          "PackageName" : {
            "$ref" : "resource-schema.json#/properties/PackageName"
          }
        },
        "required" : [ "PackageName" ]
      },
      "permissions" : [ "iot:ListPackageVersions" ]
    }
  },
  "additionalProperties" : false
}