Esempio n. 1
0
    public Index GetIndex(
        string projectId = "your-project-id",
        string indexId   = "your-index-id")
    {
        // Create client
        DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.Create();

        // Initialize request argument(s)
        GetIndexRequest getIndexRequest = new GetIndexRequest
        {
            ProjectId = projectId,
            IndexId   = indexId
        };

        Index index = datastoreAdminClient.GetIndex(getIndexRequest);

        Console.WriteLine($"Index Id: {index.IndexId}");
        Console.WriteLine($"Kind: {index.Kind}");
        Console.WriteLine("Properties:");
        foreach (var property in index.Properties)
        {
            Console.WriteLine($"Property: {property.Name}");
            Console.WriteLine($"Direction: {property.Direction}");
        }
        return(index);
    }
 /// <summary>Snippet for GetIndex</summary>
 public void GetIndexRequestObject()
 {
     // Snippet: GetIndex(GetIndexRequest, CallSettings)
     // Create client
     DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.Create();
     // Initialize request argument(s)
     GetIndexRequest request = new GetIndexRequest
     {
         ProjectId = "",
         IndexId   = "",
     };
     // Make the request
     gcdav::Index response = datastoreAdminClient.GetIndex(request);
     // End snippet
 }