{
  "typeName" : "AWS::IoTWireless::PartnerAccount",
  "description" : "Create and manage partner account",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git",
  "definitions" : {
    "SidewalkAccountInfo" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "AppServerPrivateKey" : {
          "type" : "string",
          "pattern" : "[a-fA-F0-9]{64}",
          "minLength" : 1,
          "maxLength" : 4096
        }
      },
      "required" : [ "AppServerPrivateKey" ]
    },
    "SidewalkAccountInfoWithFingerprint" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "AmazonId" : {
          "type" : "string",
          "maxLength" : 2048
        },
        "Fingerprint" : {
          "type" : "string",
          "pattern" : "[a-fA-F0-9]{64}",
          "minLength" : 64,
          "maxLength" : 64
        },
        "Arn" : {
          "type" : "string"
        }
      }
    },
    "SidewalkUpdateAccount" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "AppServerPrivateKey" : {
          "type" : "string",
          "pattern" : "[a-fA-F0-9]{64}",
          "minLength" : 1,
          "maxLength" : 4096
        }
      }
    },
    "Tag" : {
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 127
        },
        "Value" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 255
        }
      },
      "additionalProperties" : false
    }
  },
  "properties" : {
    "Sidewalk" : {
      "description" : "The Sidewalk account credentials.",
      "$ref" : "#/definitions/SidewalkAccountInfo"
    },
    "PartnerAccountId" : {
      "description" : "The partner account ID to disassociate from the AWS account",
      "type" : "string",
      "maxLength" : 256
    },
    "PartnerType" : {
      "description" : "The partner type",
      "type" : "string",
      "enum" : [ "Sidewalk" ]
    },
    "SidewalkResponse" : {
      "description" : "The Sidewalk account credentials.",
      "$ref" : "#/definitions/SidewalkAccountInfoWithFingerprint"
    },
    "AccountLinked" : {
      "description" : "Whether the partner account is linked to the AWS account.",
      "type" : "boolean"
    },
    "SidewalkUpdate" : {
      "description" : "The Sidewalk account credentials.",
      "$ref" : "#/definitions/SidewalkUpdateAccount"
    },
    "Fingerprint" : {
      "description" : "The fingerprint of the Sidewalk application server private key.",
      "type" : "string"
    },
    "Arn" : {
      "description" : "PartnerAccount arn. Returned after successful create.",
      "type" : "string"
    },
    "Tags" : {
      "description" : "A list of key-value pairs that contain metadata for the destination.",
      "type" : "array",
      "uniqueItems" : true,
      "maxItems" : 200,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "additionalProperties" : false,
  "readOnlyProperties" : [ "/properties/Arn", "/properties/Fingerprint" ],
  "writeOnlyProperties" : [ "/properties/SidewalkUpdate", "/properties/Sidewalk" ],
  "createOnlyProperties" : [ "/properties/PartnerAccountId" ],
  "primaryIdentifier" : [ "/properties/PartnerAccountId" ],
  "taggable" : true,
  "handlers" : {
    "create" : {
      "permissions" : [ "iotwireless:AssociateAwsAccountWithPartnerAccount", "iotwireless:TagResource", "iotwireless:ListTagsForResource" ]
    },
    "read" : {
      "permissions" : [ "iotwireless:GetPartnerAccount", "iotwireless:ListTagsForResource" ]
    },
    "list" : {
      "permissions" : [ "iotwireless:ListPartnerAccounts", "iotwireless:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "iotwireless:UpdatePartnerAccount", "iotwireless:UntagResource", "iotwireless:ListTagsForResource" ]
    },
    "delete" : {
      "permissions" : [ "iotwireless:DisassociateAwsAccountFromPartnerAccount" ]
    }
  }
}