With buf.gen.yaml
as:
version: v2
plugins:
- remote: buf.build/grpc/ruby:v1.71.0
out: gen
include_imports: true
- remote: buf.build/protocolbuffers/ruby:v30.2
out: gen
include_imports: true
Run:
buf generate https://github.com/zitadel/zitadel#format=git,tag=v2.71.7
Using it:
irb -I gen
ZITADEL_URL = "http://localhost:8080"
# doing a healthcheck:
require 'zitadel/auth_services_pb'
stub = Zitadel::Auth::V1::AuthService::Stub.new("localhost:8080", :this_channel_is_insecure)
stub.healthz(Zitadel::Auth::V1::HealthzRequest.new)
require 'zitadel/org/v2/org_service_services_pb'
stub = Zitadel::Org::V2::OrganizationService::Stub.new(ZITADEL_URL, :this_channel_is_insecure)
response = stub.add_organization(::Zitadel::Org::V2::AddOrganizationRequest.new(name: "TestOrg"), metadata: { authorization: "Bearer #{token}" })
response.details.resource_owner
# => "315704095795052547"
response.to_h
# => {details: {sequence: 4, change_date: {seconds: 1744670304, nanos: 849619000}, resource_owner: "315704095795052547"}, organization_id: "315704095795052547"}