Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

Add generated types for each LRO response #40

Description

@michaelbausor

For each LRO rpc e.g.

rpc GetBigFoo(GetBigFooRequest) returns (google.longrunning.Operation)

generate a using statement for the gax::Operation response in the client and use it in the generated method. E.g.:

using GetBigFooOperation = gax::Operation<Foo, FooMeta>;

This turns this code:

gax::StatusOr<gax::Operation<Foo, FooMeta>> res = client.GetBigFoo(getBigFooRequest);
if (res) {
  gax::Operation<Foo, FooMeta> op = *std::move(res);
}

into this:

gax::StatusOr<GetBigFooOperation> res = client.GetBigFoo(getBigFooRequest);
if (res) {
  GetBigFooOperation op = *std::move(res);
}

This is not only a saving of characters typed, but also ties together the two parameters (result and metadata type) into a single type that describes a particular operation. These parameters and not mix-and-matchable, so it makes sense to treat each possible LRO response as a unit.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions