{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-api-management/json-schema/microsoft-azure-api-management-ai-gateway-tool-server-secrets-schema.json",
  "title": "AiGatewayToolServerSecrets",
  "description": "Secret values configured on tool server endpoints.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-api-management-aigatewaytoolserverresources-api-openapi.yml#/components/schemas/AiGatewayToolServerSecrets",
  "type": "object",
  "properties": {
    "endpoints": {
      "type": "array",
      "description": "Endpoint secret values.",
      "items": {
        "$ref": "#/$defs/AiGatewayToolServerSecret"
      },
      "x-ms-identifiers": [
        "id"
      ]
    }
  },
  "required": [
    "endpoints"
  ],
  "$defs": {
    "AiGatewayToolServerAuthenticationType": {
      "type": "string",
      "description": "Endpoint authentication type.",
      "enum": [
        "none",
        "header",
        "oauth2",
        "managedIdentity"
      ],
      "x-ms-enum": {
        "name": "AiGatewayToolServerAuthenticationType",
        "modelAsString": true,
        "values": [
          {
            "name": "None",
            "value": "none",
            "description": "No authentication."
          },
          {
            "name": "Header",
            "value": "header",
            "description": "Static HTTP header authentication."
          },
          {
            "name": "OAuth2",
            "value": "oauth2",
            "description": "OAuth 2.0 authentication."
          },
          {
            "name": "ManagedIdentity",
            "value": "managedIdentity",
            "description": "Managed identity authentication."
          }
        ]
      }
    },
    "AiGatewayToolServerManagedIdentityAuthentication": {
      "type": "object",
      "description": "Managed identity authentication for a tool server endpoint.",
      "properties": {
        "resource": {
          "type": "string",
          "description": "Token audience for managed identity authentication."
        },
        "clientId": {
          "type": "string",
          "description": "Client ID of a user-assigned managed identity."
        }
      },
      "required": [
        "resource"
      ]
    },
    "AiGatewayToolServerOauth2GrantType": {
      "type": "string",
      "description": "OAuth 2.0 grant type.",
      "enum": [
        "clientCredentials",
        "authorizationCode"
      ],
      "x-ms-enum": {
        "name": "AiGatewayToolServerOauth2GrantType",
        "modelAsString": true,
        "values": [
          {
            "name": "ClientCredentials",
            "value": "clientCredentials",
            "description": "Client credentials grant."
          },
          {
            "name": "AuthorizationCode",
            "value": "authorizationCode",
            "description": "Authorization code grant."
          }
        ]
      }
    },
    "AiGatewayToolServerOauth2Parameter": {
      "type": "object",
      "description": "An additional parameter sent to an OAuth 2.0 endpoint.",
      "properties": {
        "name": {
          "type": "string",
          "description": "OAuth parameter name."
        },
        "value": {
          "type": "string",
          "description": "OAuth parameter value."
        }
      },
      "required": [
        "name",
        "value"
      ]
    },
    "AiGatewayToolServerOpenApiSourceType": {
      "type": "string",
      "description": "OpenAPI document source type.",
      "enum": [
        "inline",
        "url"
      ],
      "x-ms-enum": {
        "name": "AiGatewayToolServerOpenApiSourceType",
        "modelAsString": true,
        "values": [
          {
            "name": "Inline",
            "value": "inline",
            "description": "Inline OpenAPI document."
          },
          {
            "name": "Url",
            "value": "url",
            "description": "OpenAPI document fetched from a URL."
          }
        ]
      }
    },
    "AiGatewayToolServerSecret": {
      "type": "object",
      "description": "Secret value configured on one tool server endpoint.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable endpoint identifier."
        },
        "credentials": {
          "$ref": "#/$defs/AiGatewayToolServerSecretCredentials",
          "description": "Endpoint authentication including secret values."
        },
        "openApi": {
          "$ref": "#/$defs/AiGatewayToolServerSecretOpenApiConfiguration",
          "description": "OpenAPI configuration including inline content."
        }
      },
      "required": [
        "id"
      ]
    },
    "AiGatewayToolServerSecretCredentials": {
      "type": "object",
      "description": "Endpoint credentials returned by the secret retrieval action.",
      "properties": {
        "type": {
          "$ref": "#/$defs/AiGatewayToolServerAuthenticationType",
          "description": "Authentication type."
        },
        "managedIdentity": {
          "$ref": "#/$defs/AiGatewayToolServerManagedIdentityAuthentication",
          "description": "Managed identity configuration."
        },
        "headers": {
          "type": "array",
          "description": "Static headers injected when calling the endpoint.",
          "items": {
            "$ref": "#/$defs/AiGatewayToolServerSecretHeader"
          },
          "x-ms-identifiers": [
            "name"
          ]
        },
        "oauth2": {
          "$ref": "#/$defs/AiGatewayToolServerSecretOauth2Authentication",
          "description": "OAuth 2.0 configuration."
        }
      },
      "required": [
        "type"
      ]
    },
    "AiGatewayToolServerSecretHeader": {
      "type": "object",
      "description": "An endpoint header returned by the secret retrieval action.",
      "properties": {
        "name": {
          "type": "string",
          "description": "HTTP header name."
        },
        "values": {
          "type": "array",
          "format": "password",
          "description": "Secret values for the HTTP header.",
          "items": {
            "type": "string"
          },
          "x-ms-secret": true
        }
      },
      "required": [
        "name",
        "values"
      ]
    },
    "AiGatewayToolServerSecretOauth2Authentication": {
      "type": "object",
      "description": "OAuth settings returned by the secret retrieval action.",
      "properties": {
        "issuer": {
          "type": "string",
          "format": "uri",
          "description": "Expected OAuth authorization-server issuer for remote MCP discovery."
        },
        "authorizationUrl": {
          "type": "string",
          "format": "uri",
          "description": "OAuth authorization endpoint."
        },
        "tokenUrl": {
          "type": "string",
          "format": "uri",
          "description": "OAuth token endpoint."
        },
        "clientId": {
          "type": "string",
          "description": "OAuth client identifier."
        },
        "scopes": {
          "type": "array",
          "description": "OAuth scopes to request.",
          "items": {
            "type": "string"
          }
        },
        "grantType": {
          "$ref": "#/$defs/AiGatewayToolServerOauth2GrantType",
          "description": "OAuth grant type."
        },
        "authorizationParameters": {
          "type": "array",
          "description": "Additional authorization endpoint parameters.",
          "items": {
            "$ref": "#/$defs/AiGatewayToolServerOauth2Parameter"
          },
          "x-ms-identifiers": [
            "name"
          ]
        },
        "tokenParameters": {
          "type": "array",
          "description": "Additional token endpoint parameters.",
          "items": {
            "$ref": "#/$defs/AiGatewayToolServerOauth2Parameter"
          },
          "x-ms-identifiers": [
            "name"
          ]
        },
        "status": {
          "type": "string",
          "description": "Current OAuth connection status.",
          "readOnly": true
        },
        "loginLink": {
          "type": "string",
          "format": "uri",
          "description": "Login link used to complete interactive authorization.",
          "readOnly": true
        },
        "statusUpdatedUtc": {
          "type": "string",
          "format": "date-time",
          "description": "UTC timestamp of the last OAuth connection-status transition.",
          "readOnly": true
        },
        "clientSecret": {
          "type": "string",
          "format": "password",
          "description": "OAuth client secret.",
          "x-ms-secret": true
        }
      }
    },
    "AiGatewayToolServerSecretOpenApiConfiguration": {
      "type": "object",
      "description": "OpenAPI settings returned by the secret retrieval action.",
      "properties": {
        "specSource": {
          "$ref": "#/$defs/AiGatewayToolServerSecretOpenApiSpecSource",
          "description": "OpenAPI document source."
        }
      },
      "required": [
        "specSource"
      ]
    },
    "AiGatewayToolServerSecretOpenApiSpecSource": {
      "type": "object",
      "description": "OpenAPI document source returned by the secret retrieval action.",
      "properties": {
        "type": {
          "$ref": "#/$defs/AiGatewayToolServerOpenApiSourceType",
          "description": "Source type."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "URL of the OpenAPI document. Required when kind is Url."
        },
        "contentBase64": {
          "type": "string",
          "format": "password",
          "description": "Base64-encoded OpenAPI document. Required when kind is Inline.",
          "x-ms-secret": true
        }
      },
      "required": [
        "type"
      ]
    }
  }
}