public Topic GetTopic(string topicId, PublisherClient publisher) { TopicName topicName = new TopicName(_projectId, topicId); Topic topic = _publisher.GetTopic(topicName); return(topic); }
public static object GetTopic(string projectId, string topicId) { PublisherClient publisher = PublisherClient.Create(); TopicName topicName = new TopicName(projectId, topicId); Topic topic = publisher.GetTopic(topicName); Console.WriteLine($"Topic found: {topic.TopicName.ToString()}"); return(0); }
public void TestDeleteTopic() { string topicId = "testTopicForDeleteTopic"; Run("createTopic", _projectId, topicId); Run("deleteTopic", _projectId, topicId); TopicName topicName = new TopicName(_projectId, topicId); Exception ex = Assert.Throws <Grpc.Core.RpcException>(() => _publisher.GetTopic(topicName)); }
public void TestDeleteTopic() { string topicId = "testTopicForDeleteTopic" + TestUtil.RandomName(); Run("createTopic", _projectId, topicId); Run("deleteTopic", _projectId, topicId); _tempTopicIds.Clear(); // We already deleted it. TopicName topicName = new TopicName(_projectId, topicId); Exception ex = Assert.Throws <Grpc.Core.RpcException>(() => _publisher.GetTopic(topicName)); }
public void GetTopic() { // Snippet: GetTopic(TopicName,CallSettings) // Create client PublisherClient publisherClient = PublisherClient.Create(); // Initialize request argument(s) TopicName topic = new TopicName("[PROJECT]", "[TOPIC]"); // Make the request Topic response = publisherClient.GetTopic(topic); // End snippet }
public void GetTopic() { // Snippet: GetTopic(string,CallSettings) // Create client PublisherClient publisherClient = PublisherClient.Create(); // Initialize request argument(s) string formattedTopic = PublisherClient.FormatTopicName("[PROJECT]", "[TOPIC]"); // Make the request Topic response = publisherClient.GetTopic(formattedTopic); // End snippet }
public void GetTopic_RequestObject() { // Snippet: GetTopic(GetTopicRequest,CallSettings) // Create client PublisherClient publisherClient = PublisherClient.Create(); // Initialize request argument(s) GetTopicRequest request = new GetTopicRequest { TopicAsTopicName = new TopicName("[PROJECT]", "[TOPIC]"), }; // Make the request Topic response = publisherClient.GetTopic(request); // End snippet }