{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/stormmcp/json-schema/stormmcp-provider-integration-model-response-schema.json",
  "title": "ProviderIntegrationModelResponse",
  "description": "Represents a provider integration with its metadata and configuration.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/stormmcp-integrations-api-openapi.yml#/components/schemas/ProviderIntegrationModelResponse",
  "required": [
    "id"
  ],
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Gets or sets the unique identifier of the provider integration.",
      "format": "uuid"
    },
    "enabled": {
      "type": "boolean",
      "description": "Gets or sets a value indicating whether this integration is enabled."
    },
    "configuration": {
      "description": "Gets or sets the configuration for this integration.",
      "$ref": "#/$defs/GenericProviderConfigurationModel"
    },
    "level": {
      "description": "Gets or sets the access level for this provider configuration.\nPersonal: only the creator can see and use this configuration.\nTenant: all users in the tenant organization can see and use this configuration.",
      "$ref": "#/$defs/Level"
    },
    "userId": {
      "type": [
        "null",
        "string"
      ],
      "description": "Gets or sets the user identifier of the user who owns this configuration.\nUsed by the frontend to determine if the current user can toggle the level.\nNull when the scope is tenant-shared and no single owner exists.",
      "format": "uuid"
    },
    "tenantConfigExists": {
      "type": [
        "null",
        "boolean"
      ],
      "description": "Gets or sets a value indicating whether a Tenant-level configuration exists for this library.\nThis is only populated when returning a Personal configuration (null for Tenant configs)."
    },
    "credentialProviderConfigId": {
      "type": [
        "null",
        "string"
      ],
      "description": "Gets or sets the credential provider configuration ID from the User Credential Store.\nThis is the ID of the OAuth provider configuration backing the integration.\nNull when no OAuth provider configuration has been selected / registered yet.",
      "format": "uuid"
    },
    "authType": {
      "description": "Gets or sets the authentication type stored on this configuration.",
      "$ref": "#/$defs/McpServerAuthType"
    },
    "uriVariableSources": {
      "type": [
        "null",
        "array"
      ],
      "items": {
        "$ref": "#/$defs/UriVariableEffectiveValue"
      },
      "description": "Gets or sets the effective URI variable values for a Personal OAuth or Fhir row.\nEach entry names the value the caller would use and where it came from\n(`personal`, `tenant`, or `peer`). Null on every other row.\nA secret-typed variable is listed with no value. This list is not written back\nto the stored configuration."
    }
  },
  "$defs": {
    "GenericProviderConfigurationModel": {
      "type": "object",
      "properties": {
        "properties": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/GenericProviderPropertyModel"
          },
          "description": "Gets or sets the configuration properties."
        },
        "oAuthCreationMethod": {
          "type": [
            "null",
            "string"
          ],
          "description": "Gets or sets the OAuth creation method (Manual or DCR).\nHelps the frontend decide whether to show a provider configuration dropdown (Manual)\nor a transparent \"Connect\" button (DCR family sharing)."
        }
      },
      "description": "Represents the configuration properties for a generic provider.\nThis class contains only the configuration parameters, not metadata like enabled status."
    },
    "GenericProviderPropertyModel": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "Gets or sets the property key/name."
        },
        "friendlyName": {
          "type": "string",
          "description": "Gets or sets the friendly display name for the property."
        },
        "type": {
          "description": "Gets or sets the property type.",
          "$ref": "#/$defs/GenericProviderPropertyType"
        },
        "value": {
          "type": [
            "null",
            "string"
          ],
          "description": "Gets or sets the current value of the property."
        },
        "required": {
          "type": "boolean",
          "description": "Gets or sets a value indicating whether this property is required."
        },
        "helpText": {
          "type": [
            "null",
            "string"
          ],
          "description": "Gets or sets the help text for this property."
        },
        "placeholder": {
          "type": [
            "null",
            "string"
          ],
          "description": "Gets or sets the placeholder text for this property."
        },
        "enumValues": {
          "type": [
            "null",
            "array"
          ],
          "items": {
            "type": "string"
          },
          "description": "Gets or sets the available values for Enum type properties."
        },
        "enumLabels": {
          "type": [
            "null",
            "object"
          ],
          "additionalProperties": {
            "type": "string"
          },
          "description": "Gets or sets the display labels for Enum values.\nMaps enum value to its display label."
        },
        "dependsOn": {
          "type": [
            "null",
            "string"
          ],
          "description": "Gets or sets the key of another property this property depends on.\nWhen set, this property should only be shown when the dependency has the value specified in ShowWhenValue."
        },
        "showWhenValue": {
          "type": [
            "null",
            "string"
          ],
          "description": "Gets or sets the value the dependency property must have for this property to be shown.\nUsed with DependsOn to create conditional visibility."
        }
      },
      "description": "Represents a single property in a generic provider configuration."
    },
    "GenericProviderPropertyType": {
      "enum": [
        "String",
        "Secret",
        "Boolean",
        "Integer",
        "Double",
        "Url",
        "Enum"
      ],
      "description": "Defines the available property types for generic provider configurations."
    },
    "Level": {
      "enum": [
        "Personal",
        "Tenant"
      ]
    },
    "McpServerAuthType": {
      "type": "integer",
      "description": "An enumeration representing the authentication types for MCP servers."
    },
    "UriVariableEffectiveValue": {
      "required": [
        "key",
        "source"
      ],
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "Gets the declared variable name."
        },
        "value": {
          "type": [
            "null",
            "string"
          ],
          "description": "Gets the effective value. Null for a secret-typed variable."
        },
        "source": {
          "type": "string",
          "description": "Gets where the value came from: string UriVariableValueSources.Personal, string UriVariableValueSources.Tenant, or string UriVariableValueSources.Peer."
        }
      },
      "description": "One URI variable as the configuration GET reports it for a Personal row:\nthe value that would be used, and whether it is stored on that row or filled\nfrom the tenant row or a peer row. Secret-typed variables omit string? UriVariableEffectiveValue.Value."
    }
  }
}