{"record":{"id":"c1a7b76c7c525c4c","repo":"microsoft/semantic-kernel","slug":"vertex-api-version-apiversion-is-not-supported","errorCode":null,"errorMessage":"Vertex API version {apiVersion} is not supported.","messagePattern":"Vertex API version (.+?) is not supported\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Connectors/Connectors.Google/Core/ClientBase.cs","lineNumber":123,"sourceCode":"        }\n\n        return httpRequestMessage;\n    }\n\n    protected static string GetApiVersionSubLink(GoogleAIVersion apiVersion)\n        => apiVersion switch\n        {\n            GoogleAIVersion.V1 => \"v1\",\n            GoogleAIVersion.V1_Beta => \"v1beta\",\n            _ => throw new NotSupportedException($\"Google API version {apiVersion} is not supported.\")\n        };\n\n    protected static string GetApiVersionSubLink(VertexAIVersion apiVersion)\n        => apiVersion switch\n        {\n            VertexAIVersion.V1 => \"v1\",\n            VertexAIVersion.V1_Beta => \"v1beta1\",\n            _ => throw new NotSupportedException($\"Vertex API version {apiVersion} is not supported.\")\n        };\n\n    /// <summary>\n    /// Gets the Vertex AI endpoint base URI for the given location.\n    /// The global location uses <c>https://aiplatform.googleapis.com</c> while\n    /// regional locations use <c>https://{location}-aiplatform.googleapis.com</c>.\n    /// </summary>\n    protected static string GetVertexAIBaseUri(string location)\n        => string.Equals(location, \"global\", StringComparison.OrdinalIgnoreCase)\n            ? \"https://aiplatform.googleapis.com\"\n            : $\"https://{location}-aiplatform.googleapis.com\";\n}\n","sourceCodeStart":105,"sourceCodeEnd":136,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Connectors/Connectors.Google/Core/ClientBase.cs#L105-L136","documentation":"Thrown by ClientBase.GetApiVersionSubLink(VertexAIVersion) when the enum value is neither VertexAIVersion.V1 nor VertexAIVersion.V1_Beta. The switch maps V1 to 'v1' and V1_Beta to 'v1beta1'. This is the Vertex AI equivalent of the GoogleAIVersion guard, covering the same invalid-enum scenarios.","triggerScenarios":"Casting an arbitrary integer to VertexAIVersion that does not map to V1 or V1_Beta. A future SDK version introduces a new VertexAIVersion member not handled by this connector.","commonSituations":"Same as error 326 but for Vertex AI: library version mismatch, invalid enum casts, dynamic/reflective enum construction.","solutions":["Use VertexAIVersion.V1 or VertexAIVersion.V1_Beta explicitly.","Upgrade the Connectors.Google package if a new Vertex AI API version is required.","Avoid integer-to-enum casts for VertexAIVersion."],"exampleFix":"// before — invalid cast\nvar version = (VertexAIVersion)configValue;\n\n// after\nvar version = VertexAIVersion.V1;","handlingStrategy":"validation","validationCode":"if (!Enum.IsDefined(typeof(VertexAIVersion), apiVersion) ||\n    (apiVersion != VertexAIVersion.V1 && apiVersion != VertexAIVersion.V1_Beta))\n{\n    throw new ArgumentOutOfRangeException(nameof(apiVersion),\n        $\"VertexAIVersion must be V1 or V1_Beta. Got {apiVersion}.\");\n}","typeGuard":"static bool IsSupportedVertexVersion(VertexAIVersion v) =>\n    v == VertexAIVersion.V1 || v == VertexAIVersion.V1_Beta;","tryCatchPattern":"null","preventionTips":["Always use the named VertexAIVersion enum values; never cast integers.","When upgrading the SDK, check for new enum members and verify connector support."],"tags":["google","vertex-ai","versioning","enum","notsupported"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}