{
  "typeName" : "AWS::Braket::SpendingLimit",
  "description" : "Creates a spending limit for a specified quantum device. Spending limits help you control costs by setting maximum amounts that can be spent on quantum computing tasks within a specified time period.",
  "definitions" : {
    "TimePeriod" : {
      "type" : "object",
      "description" : "Defines a time range for spending limits, specifying when the limit is active.",
      "properties" : {
        "StartAt" : {
          "type" : "string",
          "description" : "The start date and time for the spending limit period, in ISO 8601 format."
        },
        "EndAt" : {
          "type" : "string",
          "description" : "The end date and time for the spending limit period, in ISO 8601 format."
        }
      },
      "required" : [ "StartAt", "EndAt" ],
      "additionalProperties" : false
    },
    "Tag" : {
      "type" : "object",
      "description" : "A key-value pair to associate with a resource.",
      "properties" : {
        "Key" : {
          "type" : "string",
          "description" : "The key name of the tag.",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "type" : "string",
          "description" : "The value for the tag.",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    }
  },
  "properties" : {
    "SpendingLimitArn" : {
      "type" : "string",
      "description" : "The Amazon Resource Name (ARN) that uniquely identifies the spending limit.",
      "minLength" : 0,
      "maxLength" : 256,
      "pattern" : "^arn:aws[a-z\\-]*:braket:[a-z0-9\\-]+:[0-9]{12}:spending-limit/.*$"
    },
    "DeviceArn" : {
      "type" : "string",
      "description" : "The Amazon Resource Name (ARN) of the quantum device to apply the spending limit to.",
      "minLength" : 1,
      "maxLength" : 256
    },
    "SpendingLimit" : {
      "type" : "string",
      "description" : "The maximum amount that can be spent on the specified device, in USD.",
      "minLength" : 1,
      "pattern" : "^\\d+(\\.\\d{1,2})?$"
    },
    "TimePeriod" : {
      "$ref" : "#/definitions/TimePeriod"
    },
    "QueuedSpend" : {
      "type" : "string",
      "description" : "The amount currently queued for spending on the device, in USD."
    },
    "TotalSpend" : {
      "type" : "string",
      "description" : "The total amount spent on the device so far during the current time period, in USD."
    },
    "CreatedAt" : {
      "type" : "string",
      "description" : "The date and time when the spending limit was created, in ISO 8601 format."
    },
    "UpdatedAt" : {
      "type" : "string",
      "description" : "The date and time when the spending limit was last modified, in ISO 8601 format."
    },
    "Tags" : {
      "type" : "array",
      "description" : "The tags to apply to the spending limit.",
      "uniqueItems" : true,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "additionalProperties" : false,
  "required" : [ "DeviceArn", "SpendingLimit" ],
  "createOnlyProperties" : [ "/properties/DeviceArn" ],
  "readOnlyProperties" : [ "/properties/SpendingLimitArn", "/properties/QueuedSpend", "/properties/TotalSpend", "/properties/CreatedAt", "/properties/UpdatedAt" ],
  "primaryIdentifier" : [ "/properties/SpendingLimitArn" ],
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "braket:TagResource", "braket:UntagResource", "braket:ListTagsForResource" ]
  },
  "handlers" : {
    "create" : {
      "permissions" : [ "braket:CreateSpendingLimit", "braket:SearchSpendingLimits", "braket:TagResource" ]
    },
    "read" : {
      "permissions" : [ "braket:SearchSpendingLimits", "braket:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "braket:UpdateSpendingLimit", "braket:SearchSpendingLimits", "braket:TagResource", "braket:UntagResource" ]
    },
    "delete" : {
      "permissions" : [ "braket:DeleteSpendingLimit", "braket:SearchSpendingLimits" ]
    },
    "list" : {
      "permissions" : [ "braket:SearchSpendingLimits" ]
    }
  }
}