using Google.Cloud.DevOps.V1; // Serialized project ID string string serializedProjectId = "Cg1wcm9qZWN0LWlkcAoB"; // Create a new project ID object from the serialized string ProjectId projectId = ProjectId.CreateFromSerialized(serializedProjectId);
using Google.Cloud.DevOps.V1; using System.Text.Json; // Serialized project ID JSON string string serializedProjectId = "{\"projectId\":\"my-project\"}"; // Deserialize the JSON string var json = JsonSerializer.DeserializeThis example illustrates a more complex scenario where the input is a JSON string containing the serialized project ID information. The JSON string is first deserialized into a JsonElement object, then the project ID string value is extracted and used as input to create a new ProjectId object using the Create method.(serializedProjectId); // Extract the project ID string value string projectIdString = json.GetProperty("projectId").GetString(); // Create a new project ID from the extracted string value ProjectId projectId = ProjectId.Create(projectIdString);