/**
 * This file was automatically generated from OpenAPI schema.
 * Do not manually modify this file.
 */

const SubscriptionSchema: Record<string, unknown> = {
  "openapi": "3.0.0",
  "info": {
    "title": "Subscription",
    "x-deprecated": true,
    "x-superseded-by": "v1beta3",
    "description": "API for managing subscriptions using various payment processors in a SaaS application.",
    "version": "v1beta2",
    "contact": {
      "name": "Meshery Maintainers",
      "email": "maintainers@meshery.io",
      "url": "https://meshery.io"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "servers": [
    {
      "url": "http://localhost:8080",
      "description": "Local development server"
    }
  ],
  "tags": [
    {
      "name": "Subscriptions",
      "description": "Operations related to subscriptions"
    },
    {
      "name": "Plans",
      "description": "Operations related to plans"
    },
    {
      "name": "Payment Processors",
      "description": "Operations related to payment processors"
    }
  ],
  "paths": {
    "/api/entitlement/subscriptions": {
      "get": {
        "x-internal": [
          "cloud"
        ],
        "tags": [
          "Subscriptions"
        ],
        "description": "Returns all subscriptions for the organization",
        "operationId": "getSubscriptions",
        "summary": "Read subscriptions",
        "security": [
          {
            "jwt": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Get responses by page",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "pagesize",
            "in": "query",
            "description": "Get responses by pagesize",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "Get ordered responses",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter subscriptions by status",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "page",
                    "page_size",
                    "total_count",
                    "subscriptions"
                  ],
                  "properties": {
                    "page": {
                      "type": "integer",
                      "description": "Current page number of the result set.",
                      "minimum": 0
                    },
                    "page_size": {
                      "type": "integer",
                      "description": "Number of items per page.",
                      "minimum": 1
                    },
                    "total_count": {
                      "type": "integer",
                      "description": "Total number of items available.",
                      "minimum": 0
                    },
                    "subscriptions": {
                      "type": "array",
                      "items": {
                        "x-go-type": "Subscription",
                        "type": "object",
                        "additionalProperties": false,
                        "description": "Subscription entity schema.",
                        "required": [
                          "id",
                          "org_id",
                          "plan_id",
                          "billing_id",
                          "status",
                          "quantity"
                        ],
                        "properties": {
                          "id": {
                            "x-oapi-codegen-extra-tags": {
                              "db": "id"
                            },
                            "type": "string",
                            "format": "uuid",
                            "description": "A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.",
                            "x-go-type": "uuid.UUID",
                            "x-go-type-import": {
                              "path": "github.com/gofrs/uuid"
                            }
                          },
                          "org_id": {
                            "x-oapi-codegen-extra-tags": {
                              "db": "org_id"
                            },
                            "type": "string",
                            "format": "uuid",
                            "description": "A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.",
                            "x-go-type": "uuid.UUID",
                            "x-go-type-import": {
                              "path": "github.com/gofrs/uuid"
                            }
                          },
                          "plan_id": {
                            "x-oapi-codegen-extra-tags": {
                              "db": "plan_id"
                            },
                            "type": "string",
                            "format": "uuid",
                            "description": "A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.",
                            "x-go-type": "uuid.UUID",
                            "x-go-type-import": {
                              "path": "github.com/gofrs/uuid"
                            }
                          },
                          "plan": {
                            "x-go-type": "planv1beta2.Plan",
                            "x-go-type-import": {
                              "path": "github.com/meshery/schemas/models/v1beta2/plan",
                              "name": "planv1beta2"
                            },
                            "x-oapi-codegen-extra-tags": {
                              "belongs_to": "plans",
                              "fk_id": "PlanId",
                              "json": "plan,omitempty"
                            },
                            "type": "object",
                            "additionalProperties": false,
                            "description": "Plan entity schema.",
                            "required": [
                              "id",
                              "name",
                              "cadence",
                              "unit",
                              "price_per_unit",
                              "minimum_units",
                              "currency"
                            ],
                            "properties": {
                              "id": {
                                "x-oapi-codegen-extra-tags": {
                                  "db": "id",
                                  "json": "id",
                                  "csv": "id"
                                },
                                "type": "string",
                                "format": "uuid",
                                "description": "A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.",
                                "x-go-type": "uuid.UUID",
                                "x-go-type-import": {
                                  "path": "github.com/gofrs/uuid"
                                }
                              },
                              "name": {
                                "x-go-type": "PlanName",
                                "x-oapi-codegen-extra-tags": {
                                  "db": "name",
                                  "json": "name",
                                  "csv": "name"
                                },
                                "type": "string",
                                "description": "Name of the plan",
                                "x-enum-casing-exempt": true,
                                "enum": [
                                  "Free",
                                  "Team Designer",
                                  "Team Operator",
                                  "Enterprise"
                                ]
                              },
                              "cadence": {
                                "x-go-type": "PlanCadence",
                                "x-oapi-codegen-extra-tags": {
                                  "db": "cadence",
                                  "json": "cadence",
                                  "csv": "cadence"
                                },
                                "type": "string",
                                "enum": [
                                  "none",
                                  "monthly",
                                  "annually"
                                ]
                              },
                              "unit": {
                                "x-go-type": "PlanUnit",
                                "x-oapi-codegen-extra-tags": {
                                  "db": "unit",
                                  "json": "unit",
                                  "csv": "unit"
                                },
                                "type": "string",
                                "enum": [
                                  "user",
                                  "free"
                                ]
                              },
                              "minimum_units": {
                                "type": "integer",
                                "description": "Minimum number of units required for the plan",
                                "x-oapi-codegen-extra-tags": {
                                  "db": "minimum_units",
                                  "json": "minimum_units",
                                  "csv": "minimum_units"
                                },
                                "minimum": 0
                              },
                              "price_per_unit": {
                                "type": "number",
                                "description": "Price per unit of the plan",
                                "x-oapi-codegen-extra-tags": {
                                  "db": "price_per_unit",
                                  "json": "price_per_unit",
                                  "csv": "price_per_unit"
                                },
                                "minimum": 0
                              },
                              "currency": {
                                "x-go-type": "Currency",
                                "x-oapi-codegen-extra-tags": {
                                  "db": "currency",
                                  "json": "currency",
                                  "csv": "currency"
                                },
                                "type": "string",
                                "enum": [
                                  "usd"
                                ]
                              }
                            }
                          },
                          "quantity": {
                            "description": "number of units subscribed (eg number of users)",
                            "type": "integer",
                            "x-oapi-codegen-extra-tags": {
                              "db": "quantity"
                            },
                            "minimum": 0
                          },
                          "start_date": {
                            "x-oapi-codegen-extra-tags": {
                              "db": "start_date"
                            },
                            "type": "string",
                            "format": "date-time",
                            "x-go-type-skip-optional-pointer": true
                          },
                          "end_date": {
                            "x-oapi-codegen-extra-tags": {
                              "db": "end_date"
                            },
                            "type": "string",
                            "format": "date-time",
                            "x-go-type-skip-optional-pointer": true
                          },
                          "status": {
                            "x-go-type": "SubscriptionStatus",
                            "x-oapi-codegen-extra-tags": {
                              "db": "status"
                            },
                            "type": "string",
                            "description": "Possible statuses of a Stripe subscription.",
                            "enum": [
                              "incomplete",
                              "incomplete_expired",
                              "trialing",
                              "active",
                              "past_due",
                              "canceled",
                              "unpaid"
                            ],
                            "x-enumDescriptions": {
                              "incomplete": "The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",
                              "incomplete_expired": "The subscription was created but never activated due to failed initial payment. It is now expired.",
                              "trialing": "The subscription is currently in a trial period before the first payment is due.",
                              "active": "The subscription is active, and billing is functioning normally.",
                              "past_due": "The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",
                              "canceled": "The subscription has been canceled and will no longer generate invoices.",
                              "unpaid": "The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."
                            }
                          },
                          "created_at": {
                            "x-oapi-codegen-extra-tags": {
                              "db": "created_at"
                            },
                            "type": "string",
                            "format": "date-time",
                            "x-go-type-skip-optional-pointer": true
                          },
                          "updated_at": {
                            "x-oapi-codegen-extra-tags": {
                              "db": "updated_at"
                            },
                            "type": "string",
                            "format": "date-time",
                            "x-go-type-skip-optional-pointer": true
                          },
                          "deleted_at": {
                            "x-oapi-codegen-extra-tags": {
                              "db": "deleted_at"
                            },
                            "type": "string",
                            "format": "date-time",
                            "x-go-type": "sql.NullTime",
                            "x-go-type-import": {
                              "path": "database/sql"
                            },
                            "x-go-type-skip-optional-pointer": true
                          },
                          "billing_id": {
                            "type": "string",
                            "description": "Billing ID of the subscription. This is the ID of the subscription in the billing system. eg Stripe",
                            "x-id-format": "external",
                            "x-oapi-codegen-extra-tags": {
                              "db": "billing_id"
                            },
                            "maxLength": 500,
                            "pattern": "^[A-Za-z0-9_\\-]+$"
                          }
                        }
                      },
                      "description": "Subscriptions returned in the current page of results."
                    }
                  }
                }
              }
            },
            "description": "Get subscription response"
          },
          "400": {
            "description": "Invalid request body or request param",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Expired JWT token used or insufficient privilege",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/entitlement/subscriptions/{subscriptionId}/cancel": {
      "post": {
        "x-internal": [
          "cloud"
        ],
        "tags": [
          "Subscriptions"
        ],
        "operationId": "cancelSubscription",
        "summary": "Cancel an existing subscription. The subscription will remain active until the end of the billing period and then it will be canceled.",
        "security": [
          {
            "jwt": []
          }
        ],
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "description": "Subscription ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "page",
                    "page_size",
                    "total_count",
                    "subscriptions"
                  ],
                  "properties": {
                    "page": {
                      "type": "integer",
                      "description": "Current page number of the result set.",
                      "minimum": 0
                    },
                    "page_size": {
                      "type": "integer",
                      "description": "Number of items per page.",
                      "minimum": 1
                    },
                    "total_count": {
                      "type": "integer",
                      "description": "Total number of items available.",
                      "minimum": 0
                    },
                    "subscriptions": {
                      "type": "array",
                      "items": {
                        "x-go-type": "Subscription",
                        "type": "object",
                        "additionalProperties": false,
                        "description": "Subscription entity schema.",
                        "required": [
                          "id",
                          "org_id",
                          "plan_id",
                          "billing_id",
                          "status",
                          "quantity"
                        ],
                        "properties": {
                          "id": {
                            "x-oapi-codegen-extra-tags": {
                              "db": "id"
                            },
                            "type": "string",
                            "format": "uuid",
                            "description": "A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.",
                            "x-go-type": "uuid.UUID",
                            "x-go-type-import": {
                              "path": "github.com/gofrs/uuid"
                            }
                          },
                          "org_id": {
                            "x-oapi-codegen-extra-tags": {
                              "db": "org_id"
                            },
                            "type": "string",
                            "format": "uuid",
                            "description": "A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.",
                            "x-go-type": "uuid.UUID",
                            "x-go-type-import": {
                              "path": "github.com/gofrs/uuid"
                            }
                          },
                          "plan_id": {
                            "x-oapi-codegen-extra-tags": {
                              "db": "plan_id"
                            },
                            "type": "string",
                            "format": "uuid",
                            "description": "A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.",
                            "x-go-type": "uuid.UUID",
                            "x-go-type-import": {
                              "path": "github.com/gofrs/uuid"
                            }
                          },
                          "plan": {
                            "x-go-type": "planv1beta2.Plan",
                            "x-go-type-import": {
                              "path": "github.com/meshery/schemas/models/v1beta2/plan",
                              "name": "planv1beta2"
                            },
                            "x-oapi-codegen-extra-tags": {
                              "belongs_to": "plans",
                              "fk_id": "PlanId",
                              "json": "plan,omitempty"
                            },
                            "type": "object",
                            "additionalProperties": false,
                            "description": "Plan entity schema.",
                            "required": [
                              "id",
                              "name",
                              "cadence",
                              "unit",
                              "price_per_unit",
                              "minimum_units",
                              "currency"
                            ],
                            "properties": {
                              "id": {
                                "x-oapi-codegen-extra-tags": {
                                  "db": "id",
                                  "json": "id",
                                  "csv": "id"
                                },
                                "type": "string",
                                "format": "uuid",
                                "description": "A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.",
                                "x-go-type": "uuid.UUID",
                                "x-go-type-import": {
                                  "path": "github.com/gofrs/uuid"
                                }
                              },
                              "name": {
                                "x-go-type": "PlanName",
                                "x-oapi-codegen-extra-tags": {
                                  "db": "name",
                                  "json": "name",
                                  "csv": "name"
                                },
                                "type": "string",
                                "description": "Name of the plan",
                                "x-enum-casing-exempt": true,
                                "enum": [
                                  "Free",
                                  "Team Designer",
                                  "Team Operator",
                                  "Enterprise"
                                ]
                              },
                              "cadence": {
                                "x-go-type": "PlanCadence",
                                "x-oapi-codegen-extra-tags": {
                                  "db": "cadence",
                                  "json": "cadence",
                                  "csv": "cadence"
                                },
                                "type": "string",
                                "enum": [
                                  "none",
                                  "monthly",
                                  "annually"
                                ]
                              },
                              "unit": {
                                "x-go-type": "PlanUnit",
                                "x-oapi-codegen-extra-tags": {
                                  "db": "unit",
                                  "json": "unit",
                                  "csv": "unit"
                                },
                                "type": "string",
                                "enum": [
                                  "user",
                                  "free"
                                ]
                              },
                              "minimum_units": {
                                "type": "integer",
                                "description": "Minimum number of units required for the plan",
                                "x-oapi-codegen-extra-tags": {
                                  "db": "minimum_units",
                                  "json": "minimum_units",
                                  "csv": "minimum_units"
                                },
                                "minimum": 0
                              },
                              "price_per_unit": {
                                "type": "number",
                                "description": "Price per unit of the plan",
                                "x-oapi-codegen-extra-tags": {
                                  "db": "price_per_unit",
                                  "json": "price_per_unit",
                                  "csv": "price_per_unit"
                                },
                                "minimum": 0
                              },
                              "currency": {
                                "x-go-type": "Currency",
                                "x-oapi-codegen-extra-tags": {
                                  "db": "currency",
                                  "json": "currency",
                                  "csv": "currency"
                                },
                                "type": "string",
                                "enum": [
                                  "usd"
                                ]
                              }
                            }
                          },
                          "quantity": {
                            "description": "number of units subscribed (eg number of users)",
                            "type": "integer",
                            "x-oapi-codegen-extra-tags": {
                              "db": "quantity"
                            },
                            "minimum": 0
                          },
                          "start_date": {
                            "x-oapi-codegen-extra-tags": {
                              "db": "start_date"
                            },
                            "type": "string",
                            "format": "date-time",
                            "x-go-type-skip-optional-pointer": true
                          },
                          "end_date": {
                            "x-oapi-codegen-extra-tags": {
                              "db": "end_date"
                            },
                            "type": "string",
                            "format": "date-time",
                            "x-go-type-skip-optional-pointer": true
                          },
                          "status": {
                            "x-go-type": "SubscriptionStatus",
                            "x-oapi-codegen-extra-tags": {
                              "db": "status"
                            },
                            "type": "string",
                            "description": "Possible statuses of a Stripe subscription.",
                            "enum": [
                              "incomplete",
                              "incomplete_expired",
                              "trialing",
                              "active",
                              "past_due",
                              "canceled",
                              "unpaid"
                            ],
                            "x-enumDescriptions": {
                              "incomplete": "The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",
                              "incomplete_expired": "The subscription was created but never activated due to failed initial payment. It is now expired.",
                              "trialing": "The subscription is currently in a trial period before the first payment is due.",
                              "active": "The subscription is active, and billing is functioning normally.",
                              "past_due": "The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",
                              "canceled": "The subscription has been canceled and will no longer generate invoices.",
                              "unpaid": "The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."
                            }
                          },
                          "created_at": {
                            "x-oapi-codegen-extra-tags": {
                              "db": "created_at"
                            },
                            "type": "string",
                            "format": "date-time",
                            "x-go-type-skip-optional-pointer": true
                          },
                          "updated_at": {
                            "x-oapi-codegen-extra-tags": {
                              "db": "updated_at"
                            },
                            "type": "string",
                            "format": "date-time",
                            "x-go-type-skip-optional-pointer": true
                          },
                          "deleted_at": {
                            "x-oapi-codegen-extra-tags": {
                              "db": "deleted_at"
                            },
                            "type": "string",
                            "format": "date-time",
                            "x-go-type": "sql.NullTime",
                            "x-go-type-import": {
                              "path": "database/sql"
                            },
                            "x-go-type-skip-optional-pointer": true
                          },
                          "billing_id": {
                            "type": "string",
                            "description": "Billing ID of the subscription. This is the ID of the subscription in the billing system. eg Stripe",
                            "x-id-format": "external",
                            "x-oapi-codegen-extra-tags": {
                              "db": "billing_id"
                            },
                            "maxLength": 500,
                            "pattern": "^[A-Za-z0-9_\\-]+$"
                          }
                        }
                      },
                      "description": "Subscriptions returned in the current page of results."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body or request param",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Expired JWT token used or insufficient privilege",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Result not found",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/entitlement/subscriptions/create": {
      "post": {
        "x-internal": [
          "cloud"
        ],
        "tags": [
          "Subscriptions"
        ],
        "operationId": "createSubscription",
        "summary": "Create a new subscription for an organization",
        "security": [
          {
            "jwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "orgId": {
                    "description": "Organization ID",
                    "type": "string",
                    "format": "uuid",
                    "x-go-type": "uuid.UUID",
                    "x-go-type-import": {
                      "path": "github.com/gofrs/uuid"
                    }
                  },
                  "planId": {
                    "type": "string",
                    "description": "Price ID from the payment processor",
                    "x-id-format": "external",
                    "maxLength": 500,
                    "pattern": "^[A-Za-z0-9_\\-]+$"
                  },
                  "couponId": {
                    "type": "string",
                    "description": "Coupon ID to apply",
                    "x-id-format": "external",
                    "maxLength": 500,
                    "pattern": "^[A-Za-z0-9_\\-]+$"
                  },
                  "userCount": {
                    "type": "integer",
                    "description": "Number of users in the organization",
                    "minimum": 0
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Email of the customer"
                  },
                  "paymentProcessor": {
                    "type": "string",
                    "enum": [
                      "stripe",
                      "paypal",
                      "braintree"
                    ],
                    "description": "Supported payment processors"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "A new subscription has been created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "subscriptionId": {
                      "type": "string",
                      "description": "ID of the associated subscription.",
                      "x-id-format": "external",
                      "maxLength": 500,
                      "pattern": "^[A-Za-z0-9_\\-]+$"
                    },
                    "clientSecret": {
                      "type": "string",
                      "description": "Client secret returned by the payment processor for the subscription checkout flow.",
                      "maxLength": 500
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body or request param",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Expired JWT token used or insufficient privilege",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/entitlement/subscriptions/{subscriptionId}/upgrade": {
      "post": {
        "x-internal": [
          "cloud"
        ],
        "tags": [
          "Subscriptions"
        ],
        "operationId": "upgradeSubscription",
        "summary": "Upgrade or downgrade an existing subscription by changing one of the plans in the subscription",
        "security": [
          {
            "jwt": []
          }
        ],
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "description": "Subscription ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "oldPlanId": {
                    "description": "Old Plan id that is being changed",
                    "type": "string",
                    "format": "uuid",
                    "x-go-type": "uuid.UUID",
                    "x-go-type-import": {
                      "path": "github.com/gofrs/uuid"
                    }
                  },
                  "newPlanId": {
                    "description": "New Plan id that is being changed to",
                    "type": "string",
                    "format": "uuid",
                    "x-go-type": "uuid.UUID",
                    "x-go-type-import": {
                      "path": "github.com/gofrs/uuid"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "description": "Subscription entity schema.",
                  "required": [
                    "id",
                    "org_id",
                    "plan_id",
                    "billing_id",
                    "status",
                    "quantity"
                  ],
                  "properties": {
                    "id": {
                      "x-oapi-codegen-extra-tags": {
                        "db": "id"
                      },
                      "type": "string",
                      "format": "uuid",
                      "description": "A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.",
                      "x-go-type": "uuid.UUID",
                      "x-go-type-import": {
                        "path": "github.com/gofrs/uuid"
                      }
                    },
                    "org_id": {
                      "x-oapi-codegen-extra-tags": {
                        "db": "org_id"
                      },
                      "type": "string",
                      "format": "uuid",
                      "description": "A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.",
                      "x-go-type": "uuid.UUID",
                      "x-go-type-import": {
                        "path": "github.com/gofrs/uuid"
                      }
                    },
                    "plan_id": {
                      "x-oapi-codegen-extra-tags": {
                        "db": "plan_id"
                      },
                      "type": "string",
                      "format": "uuid",
                      "description": "A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.",
                      "x-go-type": "uuid.UUID",
                      "x-go-type-import": {
                        "path": "github.com/gofrs/uuid"
                      }
                    },
                    "plan": {
                      "x-go-type": "planv1beta2.Plan",
                      "x-go-type-import": {
                        "path": "github.com/meshery/schemas/models/v1beta2/plan",
                        "name": "planv1beta2"
                      },
                      "x-oapi-codegen-extra-tags": {
                        "belongs_to": "plans",
                        "fk_id": "PlanId",
                        "json": "plan,omitempty"
                      },
                      "type": "object",
                      "additionalProperties": false,
                      "description": "Plan entity schema.",
                      "required": [
                        "id",
                        "name",
                        "cadence",
                        "unit",
                        "price_per_unit",
                        "minimum_units",
                        "currency"
                      ],
                      "properties": {
                        "id": {
                          "x-oapi-codegen-extra-tags": {
                            "db": "id",
                            "json": "id",
                            "csv": "id"
                          },
                          "type": "string",
                          "format": "uuid",
                          "description": "A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.",
                          "x-go-type": "uuid.UUID",
                          "x-go-type-import": {
                            "path": "github.com/gofrs/uuid"
                          }
                        },
                        "name": {
                          "x-go-type": "PlanName",
                          "x-oapi-codegen-extra-tags": {
                            "db": "name",
                            "json": "name",
                            "csv": "name"
                          },
                          "type": "string",
                          "description": "Name of the plan",
                          "x-enum-casing-exempt": true,
                          "enum": [
                            "Free",
                            "Team Designer",
                            "Team Operator",
                            "Enterprise"
                          ]
                        },
                        "cadence": {
                          "x-go-type": "PlanCadence",
                          "x-oapi-codegen-extra-tags": {
                            "db": "cadence",
                            "json": "cadence",
                            "csv": "cadence"
                          },
                          "type": "string",
                          "enum": [
                            "none",
                            "monthly",
                            "annually"
                          ]
                        },
                        "unit": {
                          "x-go-type": "PlanUnit",
                          "x-oapi-codegen-extra-tags": {
                            "db": "unit",
                            "json": "unit",
                            "csv": "unit"
                          },
                          "type": "string",
                          "enum": [
                            "user",
                            "free"
                          ]
                        },
                        "minimum_units": {
                          "type": "integer",
                          "description": "Minimum number of units required for the plan",
                          "x-oapi-codegen-extra-tags": {
                            "db": "minimum_units",
                            "json": "minimum_units",
                            "csv": "minimum_units"
                          },
                          "minimum": 0
                        },
                        "price_per_unit": {
                          "type": "number",
                          "description": "Price per unit of the plan",
                          "x-oapi-codegen-extra-tags": {
                            "db": "price_per_unit",
                            "json": "price_per_unit",
                            "csv": "price_per_unit"
                          },
                          "minimum": 0
                        },
                        "currency": {
                          "x-go-type": "Currency",
                          "x-oapi-codegen-extra-tags": {
                            "db": "currency",
                            "json": "currency",
                            "csv": "currency"
                          },
                          "type": "string",
                          "enum": [
                            "usd"
                          ]
                        }
                      }
                    },
                    "quantity": {
                      "description": "number of units subscribed (eg number of users)",
                      "type": "integer",
                      "x-oapi-codegen-extra-tags": {
                        "db": "quantity"
                      },
                      "minimum": 0
                    },
                    "start_date": {
                      "x-oapi-codegen-extra-tags": {
                        "db": "start_date"
                      },
                      "type": "string",
                      "format": "date-time",
                      "x-go-type-skip-optional-pointer": true
                    },
                    "end_date": {
                      "x-oapi-codegen-extra-tags": {
                        "db": "end_date"
                      },
                      "type": "string",
                      "format": "date-time",
                      "x-go-type-skip-optional-pointer": true
                    },
                    "status": {
                      "x-go-type": "SubscriptionStatus",
                      "x-oapi-codegen-extra-tags": {
                        "db": "status"
                      },
                      "type": "string",
                      "description": "Possible statuses of a Stripe subscription.",
                      "enum": [
                        "incomplete",
                        "incomplete_expired",
                        "trialing",
                        "active",
                        "past_due",
                        "canceled",
                        "unpaid"
                      ],
                      "x-enumDescriptions": {
                        "incomplete": "The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",
                        "incomplete_expired": "The subscription was created but never activated due to failed initial payment. It is now expired.",
                        "trialing": "The subscription is currently in a trial period before the first payment is due.",
                        "active": "The subscription is active, and billing is functioning normally.",
                        "past_due": "The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",
                        "canceled": "The subscription has been canceled and will no longer generate invoices.",
                        "unpaid": "The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."
                      }
                    },
                    "created_at": {
                      "x-oapi-codegen-extra-tags": {
                        "db": "created_at"
                      },
                      "type": "string",
                      "format": "date-time",
                      "x-go-type-skip-optional-pointer": true
                    },
                    "updated_at": {
                      "x-oapi-codegen-extra-tags": {
                        "db": "updated_at"
                      },
                      "type": "string",
                      "format": "date-time",
                      "x-go-type-skip-optional-pointer": true
                    },
                    "deleted_at": {
                      "x-oapi-codegen-extra-tags": {
                        "db": "deleted_at"
                      },
                      "type": "string",
                      "format": "date-time",
                      "x-go-type": "sql.NullTime",
                      "x-go-type-import": {
                        "path": "database/sql"
                      },
                      "x-go-type-skip-optional-pointer": true
                    },
                    "billing_id": {
                      "type": "string",
                      "description": "Billing ID of the subscription. This is the ID of the subscription in the billing system. eg Stripe",
                      "x-id-format": "external",
                      "x-oapi-codegen-extra-tags": {
                        "db": "billing_id"
                      },
                      "maxLength": 500,
                      "pattern": "^[A-Za-z0-9_\\-]+$"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body or request param",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Expired JWT token used or insufficient privilege",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Result not found",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/entitlement/subscriptions/{subscriptionId}/upgrade-preview": {
      "post": {
        "x-internal": [
          "cloud"
        ],
        "tags": [
          "Subscriptions"
        ],
        "operationId": "previewSubscriptionUpgrade",
        "summary": "Preview the invoice for upgrading or downgrading an existing subscription by changing one of the plans in the subscription",
        "security": [
          {
            "jwt": []
          }
        ],
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "description": "Subscription ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "oldPlanId": {
                    "description": "Old Plan id that is being changed",
                    "type": "string",
                    "format": "uuid",
                    "x-go-type": "uuid.UUID",
                    "x-go-type-import": {
                      "path": "github.com/gofrs/uuid"
                    }
                  },
                  "newPlanId": {
                    "description": "New Plan id that is being changed to",
                    "type": "string",
                    "format": "uuid",
                    "x-go-type": "uuid.UUID",
                    "x-go-type-import": {
                      "path": "github.com/gofrs/uuid"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preview of the upgraded subscription invoice",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body or request param",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Expired JWT token used or insufficient privilege",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Result not found",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/entitlement/subscriptions/webhooks": {
      "post": {
        "x-internal": [
          "cloud"
        ],
        "tags": [
          "Payment Processors"
        ],
        "operationId": "handleSubscriptionWebhook",
        "summary": "Handle webhook events from payment processors",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Payload for webhook events from payment processors"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook processed"
          },
          "400": {
            "description": "Invalid request body or request param",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Expired JWT token used or insufficient privilege",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "400": {
        "description": "Invalid request body or request param",
        "content": {
          "text/plain": {
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "401": {
        "description": "Expired JWT token used or insufficient privilege",
        "content": {
          "text/plain": {
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "404": {
        "description": "Result not found",
        "content": {
          "text/plain": {
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "500": {
        "description": "Internal server error",
        "content": {
          "text/plain": {
            "schema": {
              "type": "string"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "jwt": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "parameters": {
      "subscriptionId": {
        "name": "subscriptionId",
        "in": "path",
        "required": true,
        "description": "Subscription ID",
        "schema": {
          "type": "string"
        }
      },
      "page": {
        "name": "page",
        "in": "query",
        "description": "Get responses by page",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "pagesize": {
        "name": "pagesize",
        "in": "query",
        "description": "Get responses by pagesize",
        "schema": {
          "type": "integer"
        }
      },
      "pagesizeWithAll": {
        "name": "pagesize",
        "in": "query",
        "description": "Get responses by pagesize (pass all to get all responses)",
        "schema": {
          "type": "string"
        }
      },
      "order": {
        "name": "order",
        "in": "query",
        "description": "Get ordered responses",
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "PaymentProcessor": {
        "type": "string",
        "enum": [
          "stripe",
          "paypal",
          "braintree"
        ],
        "description": "Supported payment processors"
      },
      "CreateSubscriptionRequest": {
        "type": "object",
        "properties": {
          "orgId": {
            "description": "Organization ID",
            "type": "string",
            "format": "uuid",
            "x-go-type": "uuid.UUID",
            "x-go-type-import": {
              "path": "github.com/gofrs/uuid"
            }
          },
          "planId": {
            "type": "string",
            "description": "Price ID from the payment processor",
            "x-id-format": "external",
            "maxLength": 500,
            "pattern": "^[A-Za-z0-9_\\-]+$"
          },
          "couponId": {
            "type": "string",
            "description": "Coupon ID to apply",
            "x-id-format": "external",
            "maxLength": 500,
            "pattern": "^[A-Za-z0-9_\\-]+$"
          },
          "userCount": {
            "type": "integer",
            "description": "Number of users in the organization",
            "minimum": 0
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Email of the customer"
          },
          "paymentProcessor": {
            "type": "string",
            "enum": [
              "stripe",
              "paypal",
              "braintree"
            ],
            "description": "Supported payment processors"
          }
        }
      },
      "UpgradeSubscriptionRequest": {
        "type": "object",
        "properties": {
          "oldPlanId": {
            "description": "Old Plan id that is being changed",
            "type": "string",
            "format": "uuid",
            "x-go-type": "uuid.UUID",
            "x-go-type-import": {
              "path": "github.com/gofrs/uuid"
            }
          },
          "newPlanId": {
            "description": "New Plan id that is being changed to",
            "type": "string",
            "format": "uuid",
            "x-go-type": "uuid.UUID",
            "x-go-type-import": {
              "path": "github.com/gofrs/uuid"
            }
          }
        }
      },
      "CreateSubscriptionResponse": {
        "type": "object",
        "properties": {
          "subscriptionId": {
            "type": "string",
            "description": "ID of the associated subscription.",
            "x-id-format": "external",
            "maxLength": 500,
            "pattern": "^[A-Za-z0-9_\\-]+$"
          },
          "clientSecret": {
            "type": "string",
            "description": "Client secret returned by the payment processor for the subscription checkout flow.",
            "maxLength": 500
          }
        }
      },
      "UpdateUsersRequest": {
        "type": "object",
        "properties": {
          "paymentProcessor": {
            "type": "string",
            "enum": [
              "stripe",
              "paypal",
              "braintree"
            ],
            "description": "Supported payment processors"
          }
        }
      },
      "CancelSubscriptionRequest": {
        "type": "object",
        "properties": {
          "subscriptionId": {
            "type": "string",
            "description": "Subscription ID from the payment processor",
            "x-id-format": "external",
            "maxLength": 500,
            "pattern": "^[A-Za-z0-9_\\-]+$"
          },
          "paymentProcessor": {
            "type": "string",
            "enum": [
              "stripe",
              "paypal",
              "braintree"
            ],
            "description": "Supported payment processors"
          }
        }
      },
      "WebhookEvent": {
        "type": "object",
        "description": "Payload for webhook events from payment processors"
      },
      "SubscriptionPage": {
        "type": "object",
        "required": [
          "page",
          "page_size",
          "total_count",
          "subscriptions"
        ],
        "properties": {
          "page": {
            "type": "integer",
            "description": "Current page number of the result set.",
            "minimum": 0
          },
          "page_size": {
            "type": "integer",
            "description": "Number of items per page.",
            "minimum": 1
          },
          "total_count": {
            "type": "integer",
            "description": "Total number of items available.",
            "minimum": 0
          },
          "subscriptions": {
            "type": "array",
            "items": {
              "x-go-type": "Subscription",
              "type": "object",
              "additionalProperties": false,
              "description": "Subscription entity schema.",
              "required": [
                "id",
                "org_id",
                "plan_id",
                "billing_id",
                "status",
                "quantity"
              ],
              "properties": {
                "id": {
                  "x-oapi-codegen-extra-tags": {
                    "db": "id"
                  },
                  "type": "string",
                  "format": "uuid",
                  "description": "A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.",
                  "x-go-type": "uuid.UUID",
                  "x-go-type-import": {
                    "path": "github.com/gofrs/uuid"
                  }
                },
                "org_id": {
                  "x-oapi-codegen-extra-tags": {
                    "db": "org_id"
                  },
                  "type": "string",
                  "format": "uuid",
                  "description": "A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.",
                  "x-go-type": "uuid.UUID",
                  "x-go-type-import": {
                    "path": "github.com/gofrs/uuid"
                  }
                },
                "plan_id": {
                  "x-oapi-codegen-extra-tags": {
                    "db": "plan_id"
                  },
                  "type": "string",
                  "format": "uuid",
                  "description": "A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.",
                  "x-go-type": "uuid.UUID",
                  "x-go-type-import": {
                    "path": "github.com/gofrs/uuid"
                  }
                },
                "plan": {
                  "x-go-type": "planv1beta2.Plan",
                  "x-go-type-import": {
                    "path": "github.com/meshery/schemas/models/v1beta2/plan",
                    "name": "planv1beta2"
                  },
                  "x-oapi-codegen-extra-tags": {
                    "belongs_to": "plans",
                    "fk_id": "PlanId",
                    "json": "plan,omitempty"
                  },
                  "type": "object",
                  "additionalProperties": false,
                  "description": "Plan entity schema.",
                  "required": [
                    "id",
                    "name",
                    "cadence",
                    "unit",
                    "price_per_unit",
                    "minimum_units",
                    "currency"
                  ],
                  "properties": {
                    "id": {
                      "x-oapi-codegen-extra-tags": {
                        "db": "id",
                        "json": "id",
                        "csv": "id"
                      },
                      "type": "string",
                      "format": "uuid",
                      "description": "A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.",
                      "x-go-type": "uuid.UUID",
                      "x-go-type-import": {
                        "path": "github.com/gofrs/uuid"
                      }
                    },
                    "name": {
                      "x-go-type": "PlanName",
                      "x-oapi-codegen-extra-tags": {
                        "db": "name",
                        "json": "name",
                        "csv": "name"
                      },
                      "type": "string",
                      "description": "Name of the plan",
                      "x-enum-casing-exempt": true,
                      "enum": [
                        "Free",
                        "Team Designer",
                        "Team Operator",
                        "Enterprise"
                      ]
                    },
                    "cadence": {
                      "x-go-type": "PlanCadence",
                      "x-oapi-codegen-extra-tags": {
                        "db": "cadence",
                        "json": "cadence",
                        "csv": "cadence"
                      },
                      "type": "string",
                      "enum": [
                        "none",
                        "monthly",
                        "annually"
                      ]
                    },
                    "unit": {
                      "x-go-type": "PlanUnit",
                      "x-oapi-codegen-extra-tags": {
                        "db": "unit",
                        "json": "unit",
                        "csv": "unit"
                      },
                      "type": "string",
                      "enum": [
                        "user",
                        "free"
                      ]
                    },
                    "minimum_units": {
                      "type": "integer",
                      "description": "Minimum number of units required for the plan",
                      "x-oapi-codegen-extra-tags": {
                        "db": "minimum_units",
                        "json": "minimum_units",
                        "csv": "minimum_units"
                      },
                      "minimum": 0
                    },
                    "price_per_unit": {
                      "type": "number",
                      "description": "Price per unit of the plan",
                      "x-oapi-codegen-extra-tags": {
                        "db": "price_per_unit",
                        "json": "price_per_unit",
                        "csv": "price_per_unit"
                      },
                      "minimum": 0
                    },
                    "currency": {
                      "x-go-type": "Currency",
                      "x-oapi-codegen-extra-tags": {
                        "db": "currency",
                        "json": "currency",
                        "csv": "currency"
                      },
                      "type": "string",
                      "enum": [
                        "usd"
                      ]
                    }
                  }
                },
                "quantity": {
                  "description": "number of units subscribed (eg number of users)",
                  "type": "integer",
                  "x-oapi-codegen-extra-tags": {
                    "db": "quantity"
                  },
                  "minimum": 0
                },
                "start_date": {
                  "x-oapi-codegen-extra-tags": {
                    "db": "start_date"
                  },
                  "type": "string",
                  "format": "date-time",
                  "x-go-type-skip-optional-pointer": true
                },
                "end_date": {
                  "x-oapi-codegen-extra-tags": {
                    "db": "end_date"
                  },
                  "type": "string",
                  "format": "date-time",
                  "x-go-type-skip-optional-pointer": true
                },
                "status": {
                  "x-go-type": "SubscriptionStatus",
                  "x-oapi-codegen-extra-tags": {
                    "db": "status"
                  },
                  "type": "string",
                  "description": "Possible statuses of a Stripe subscription.",
                  "enum": [
                    "incomplete",
                    "incomplete_expired",
                    "trialing",
                    "active",
                    "past_due",
                    "canceled",
                    "unpaid"
                  ],
                  "x-enumDescriptions": {
                    "incomplete": "The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",
                    "incomplete_expired": "The subscription was created but never activated due to failed initial payment. It is now expired.",
                    "trialing": "The subscription is currently in a trial period before the first payment is due.",
                    "active": "The subscription is active, and billing is functioning normally.",
                    "past_due": "The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",
                    "canceled": "The subscription has been canceled and will no longer generate invoices.",
                    "unpaid": "The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."
                  }
                },
                "created_at": {
                  "x-oapi-codegen-extra-tags": {
                    "db": "created_at"
                  },
                  "type": "string",
                  "format": "date-time",
                  "x-go-type-skip-optional-pointer": true
                },
                "updated_at": {
                  "x-oapi-codegen-extra-tags": {
                    "db": "updated_at"
                  },
                  "type": "string",
                  "format": "date-time",
                  "x-go-type-skip-optional-pointer": true
                },
                "deleted_at": {
                  "x-oapi-codegen-extra-tags": {
                    "db": "deleted_at"
                  },
                  "type": "string",
                  "format": "date-time",
                  "x-go-type": "sql.NullTime",
                  "x-go-type-import": {
                    "path": "database/sql"
                  },
                  "x-go-type-skip-optional-pointer": true
                },
                "billing_id": {
                  "type": "string",
                  "description": "Billing ID of the subscription. This is the ID of the subscription in the billing system. eg Stripe",
                  "x-id-format": "external",
                  "x-oapi-codegen-extra-tags": {
                    "db": "billing_id"
                  },
                  "maxLength": 500,
                  "pattern": "^[A-Za-z0-9_\\-]+$"
                }
              }
            },
            "description": "Subscriptions returned in the current page of results."
          }
        }
      },
      "Subscription": {
        "type": "object",
        "additionalProperties": false,
        "description": "Subscription entity schema.",
        "required": [
          "id",
          "org_id",
          "plan_id",
          "billing_id",
          "status",
          "quantity"
        ],
        "properties": {
          "id": {
            "x-oapi-codegen-extra-tags": {
              "db": "id"
            },
            "type": "string",
            "format": "uuid",
            "description": "A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.",
            "x-go-type": "uuid.UUID",
            "x-go-type-import": {
              "path": "github.com/gofrs/uuid"
            }
          },
          "org_id": {
            "x-oapi-codegen-extra-tags": {
              "db": "org_id"
            },
            "type": "string",
            "format": "uuid",
            "description": "A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.",
            "x-go-type": "uuid.UUID",
            "x-go-type-import": {
              "path": "github.com/gofrs/uuid"
            }
          },
          "plan_id": {
            "x-oapi-codegen-extra-tags": {
              "db": "plan_id"
            },
            "type": "string",
            "format": "uuid",
            "description": "A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.",
            "x-go-type": "uuid.UUID",
            "x-go-type-import": {
              "path": "github.com/gofrs/uuid"
            }
          },
          "plan": {
            "x-go-type": "planv1beta2.Plan",
            "x-go-type-import": {
              "path": "github.com/meshery/schemas/models/v1beta2/plan",
              "name": "planv1beta2"
            },
            "x-oapi-codegen-extra-tags": {
              "belongs_to": "plans",
              "fk_id": "PlanId",
              "json": "plan,omitempty"
            },
            "type": "object",
            "additionalProperties": false,
            "description": "Plan entity schema.",
            "required": [
              "id",
              "name",
              "cadence",
              "unit",
              "price_per_unit",
              "minimum_units",
              "currency"
            ],
            "properties": {
              "id": {
                "x-oapi-codegen-extra-tags": {
                  "db": "id",
                  "json": "id",
                  "csv": "id"
                },
                "type": "string",
                "format": "uuid",
                "description": "A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.",
                "x-go-type": "uuid.UUID",
                "x-go-type-import": {
                  "path": "github.com/gofrs/uuid"
                }
              },
              "name": {
                "x-go-type": "PlanName",
                "x-oapi-codegen-extra-tags": {
                  "db": "name",
                  "json": "name",
                  "csv": "name"
                },
                "type": "string",
                "description": "Name of the plan",
                "x-enum-casing-exempt": true,
                "enum": [
                  "Free",
                  "Team Designer",
                  "Team Operator",
                  "Enterprise"
                ]
              },
              "cadence": {
                "x-go-type": "PlanCadence",
                "x-oapi-codegen-extra-tags": {
                  "db": "cadence",
                  "json": "cadence",
                  "csv": "cadence"
                },
                "type": "string",
                "enum": [
                  "none",
                  "monthly",
                  "annually"
                ]
              },
              "unit": {
                "x-go-type": "PlanUnit",
                "x-oapi-codegen-extra-tags": {
                  "db": "unit",
                  "json": "unit",
                  "csv": "unit"
                },
                "type": "string",
                "enum": [
                  "user",
                  "free"
                ]
              },
              "minimum_units": {
                "type": "integer",
                "description": "Minimum number of units required for the plan",
                "x-oapi-codegen-extra-tags": {
                  "db": "minimum_units",
                  "json": "minimum_units",
                  "csv": "minimum_units"
                },
                "minimum": 0
              },
              "price_per_unit": {
                "type": "number",
                "description": "Price per unit of the plan",
                "x-oapi-codegen-extra-tags": {
                  "db": "price_per_unit",
                  "json": "price_per_unit",
                  "csv": "price_per_unit"
                },
                "minimum": 0
              },
              "currency": {
                "x-go-type": "Currency",
                "x-oapi-codegen-extra-tags": {
                  "db": "currency",
                  "json": "currency",
                  "csv": "currency"
                },
                "type": "string",
                "enum": [
                  "usd"
                ]
              }
            }
          },
          "quantity": {
            "description": "number of units subscribed (eg number of users)",
            "type": "integer",
            "x-oapi-codegen-extra-tags": {
              "db": "quantity"
            },
            "minimum": 0
          },
          "start_date": {
            "x-oapi-codegen-extra-tags": {
              "db": "start_date"
            },
            "type": "string",
            "format": "date-time",
            "x-go-type-skip-optional-pointer": true
          },
          "end_date": {
            "x-oapi-codegen-extra-tags": {
              "db": "end_date"
            },
            "type": "string",
            "format": "date-time",
            "x-go-type-skip-optional-pointer": true
          },
          "status": {
            "x-go-type": "SubscriptionStatus",
            "x-oapi-codegen-extra-tags": {
              "db": "status"
            },
            "type": "string",
            "description": "Possible statuses of a Stripe subscription.",
            "enum": [
              "incomplete",
              "incomplete_expired",
              "trialing",
              "active",
              "past_due",
              "canceled",
              "unpaid"
            ],
            "x-enumDescriptions": {
              "incomplete": "The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",
              "incomplete_expired": "The subscription was created but never activated due to failed initial payment. It is now expired.",
              "trialing": "The subscription is currently in a trial period before the first payment is due.",
              "active": "The subscription is active, and billing is functioning normally.",
              "past_due": "The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",
              "canceled": "The subscription has been canceled and will no longer generate invoices.",
              "unpaid": "The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."
            }
          },
          "created_at": {
            "x-oapi-codegen-extra-tags": {
              "db": "created_at"
            },
            "type": "string",
            "format": "date-time",
            "x-go-type-skip-optional-pointer": true
          },
          "updated_at": {
            "x-oapi-codegen-extra-tags": {
              "db": "updated_at"
            },
            "type": "string",
            "format": "date-time",
            "x-go-type-skip-optional-pointer": true
          },
          "deleted_at": {
            "x-oapi-codegen-extra-tags": {
              "db": "deleted_at"
            },
            "type": "string",
            "format": "date-time",
            "x-go-type": "sql.NullTime",
            "x-go-type-import": {
              "path": "database/sql"
            },
            "x-go-type-skip-optional-pointer": true
          },
          "billing_id": {
            "type": "string",
            "description": "Billing ID of the subscription. This is the ID of the subscription in the billing system. eg Stripe",
            "x-id-format": "external",
            "x-oapi-codegen-extra-tags": {
              "db": "billing_id"
            },
            "maxLength": 500,
            "pattern": "^[A-Za-z0-9_\\-]+$"
          }
        }
      },
      "SubscriptionStatus": {
        "type": "string",
        "description": "Possible statuses of a Stripe subscription.",
        "enum": [
          "incomplete",
          "incomplete_expired",
          "trialing",
          "active",
          "past_due",
          "canceled",
          "unpaid"
        ],
        "x-enumDescriptions": {
          "incomplete": "The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",
          "incomplete_expired": "The subscription was created but never activated due to failed initial payment. It is now expired.",
          "trialing": "The subscription is currently in a trial period before the first payment is due.",
          "active": "The subscription is active, and billing is functioning normally.",
          "past_due": "The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",
          "canceled": "The subscription has been canceled and will no longer generate invoices.",
          "unpaid": "The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."
        }
      }
    }
  }
};

export default SubscriptionSchema;
