{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--aws-billingconductor-customlineitem.json",
  "title": "AWSBillingConductorCustomLineItemProperties",
  "description": "A custom line item is an one time charge that is applied to a specific billing group's bill.. Source:- <https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-billing-conductor.git>",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/lalcebo/json-schema/master/serverless/resources/cloudformation-modified/aws-billingconductor-customlineitem.json",
    "sourceSha256": "77ab301ec8e3109d4ce2c952543e138c44cec7e6d9fa5531d7449c7ad92d2619"
  },
  "type": "object",
  "properties": {
    "Name": {
      "oneOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "[a-zA-Z0-9_\\+=\\.\\-@]+"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ]
    },
    "Description": {
      "oneOf": [
        {
          "type": "string",
          "maxLength": 255
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ]
    },
    "CustomLineItemChargeDetails": {
      "$ref": "#/$defs/CustomLineItemChargeDetails"
    },
    "BillingGroupArn": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "arn:aws(-cn)?:billingconductor::[0-9]{12}:billinggroup/?[0-9]{12}"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "Billing Group ARN"
    },
    "BillingPeriodRange": {
      "$ref": "#/$defs/BillingPeriodRange"
    },
    "Tags": {
      "type": "array",
      "uniqueItems": true,
      "insertionOrder": false,
      "items": {
        "$ref": "#/$defs/Tag"
      }
    }
  },
  "typeName": "AWS::BillingConductor::CustomLineItem",
  "primaryIdentifier": [
    "/properties/Arn"
  ],
  "sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-billing-conductor.git",
  "additionalProperties": false,
  "createOnlyProperties": [
    "/properties/BillingGroupArn",
    "/properties/BillingPeriodRange/InclusiveStartBillingPeriod",
    "/properties/BillingPeriodRange/ExclusiveEndBillingPeriod",
    "/properties/CustomLineItemChargeDetails/Type"
  ],
  "$defs": {
    "Tag": {
      "type": "object",
      "properties": {
        "Key": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        },
        "Value": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        }
      },
      "title": "AWSBillingConductorCustomLineItemTagDefinition",
      "required": [
        "Key",
        "Value"
      ],
      "additionalProperties": false
    },
    "Type": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "FEE",
            "CREDIT"
          ]
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "title": "AWSBillingConductorCustomLineItemTypeDefinition"
    },
    "CustomLineItemPercentageChargeDetails": {
      "type": "object",
      "title": "AWSBillingConductorCustomLineItemCustomLineItemPercentageChargeDetailsDefinition",
      "properties": {
        "ChildAssociatedResources": {
          "type": "array",
          "insertionOrder": false,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "pattern": "(arn:aws(-cn)?:billingconductor::[0-9]{12}:(customlineitem|billinggroup)/)?[a-zA-Z0-9]{10,12}"
          }
        },
        "PercentageValue": {
          "type": "number",
          "minimum": 0,
          "maximum": 10000
        }
      },
      "required": [
        "PercentageValue"
      ],
      "additionalProperties": false
    },
    "CustomLineItemFlatChargeDetails": {
      "type": "object",
      "title": "AWSBillingConductorCustomLineItemCustomLineItemFlatChargeDetailsDefinition",
      "properties": {
        "ChargeValue": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000
        }
      },
      "required": [
        "ChargeValue"
      ],
      "additionalProperties": false
    },
    "CustomLineItemChargeDetails": {
      "type": "object",
      "title": "AWSBillingConductorCustomLineItemCustomLineItemChargeDetailsDefinition",
      "properties": {
        "Flat": {
          "$ref": "#/$defs/CustomLineItemFlatChargeDetails"
        },
        "Percentage": {
          "$ref": "#/$defs/CustomLineItemPercentageChargeDetails"
        },
        "Type": {
          "$ref": "#/$defs/Type"
        }
      },
      "required": [
        "Type"
      ],
      "additionalProperties": false
    },
    "InclusiveStartBillingPeriod": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "\\d{4}-(0?[1-9]|1[012])"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "title": "AWSBillingConductorCustomLineItemInclusiveStartBillingPeriodDefinition"
    },
    "ExclusiveEndBillingPeriod": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "\\d{4}-(0?[1-9]|1[012])"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "title": "AWSBillingConductorCustomLineItemExclusiveEndBillingPeriodDefinition"
    },
    "BillingPeriodRange": {
      "type": "object",
      "title": "AWSBillingConductorCustomLineItemBillingPeriodRangeDefinition",
      "properties": {
        "InclusiveStartBillingPeriod": {
          "$ref": "#/$defs/InclusiveStartBillingPeriod"
        },
        "ExclusiveEndBillingPeriod": {
          "$ref": "#/$defs/ExclusiveEndBillingPeriod"
        }
      },
      "additionalProperties": false
    }
  },
  "tagging": {
    "taggable": true,
    "tagOnCreate": true,
    "tagUpdatable": true,
    "cloudFormationSystemTags": true,
    "tagProperty": "/properties/Tags"
  },
  "required": [
    "Name",
    "BillingGroupArn"
  ],
  "readOnlyProperties": [
    "/properties/Arn",
    "/properties/CreationTime",
    "/properties/LastModifiedTime",
    "/properties/AssociationSize",
    "/properties/CurrencyCode",
    "/properties/ProductCode"
  ]
}
