Search in sources :

Example 6 with GetSchemaRequest

use of com.google.pubsub.v1.GetSchemaRequest in project gapic-generator-java by googleapis.

the class SyncGetSchema method syncGetSchema.

public static void syncGetSchema() throws Exception {
    // It may require modifications to work in your environment.
    try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
        GetSchemaRequest request = GetSchemaRequest.newBuilder().setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()).setView(SchemaView.forNumber(0)).build();
        Schema response = schemaServiceClient.getSchema(request);
    }
}
Also used : Schema(com.google.pubsub.v1.Schema) GetSchemaRequest(com.google.pubsub.v1.GetSchemaRequest) SchemaServiceClient(com.google.cloud.pubsub.v1.SchemaServiceClient)

Aggregations

GetSchemaRequest (com.google.pubsub.v1.GetSchemaRequest)6 Schema (com.google.pubsub.v1.Schema)6 AbstractMessage (com.google.protobuf.AbstractMessage)4 Test (org.junit.Test)4 SchemaServiceClient (com.google.cloud.pubsub.v1.SchemaServiceClient)2 ByteString (com.google.protobuf.ByteString)2 SchemaName (com.google.pubsub.v1.SchemaName)2