Skip to content

Commit 3d31840

Browse files
authored
feat(examples): use aep.api.resource (#383)
now that aep.api.resource exists, it can serve as the source of truth instead of google.api.resource.
1 parent 7470d8a commit 3d31840

17 files changed

Lines changed: 40 additions & 36 deletions

aep/general/0004/aep.md.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ APIs **must** annotate the resource types for each resource in the API
4747

4848
{% tab proto %}
4949

50-
For protobuf, use the [`google.api.resource`][resource] annotation:
50+
For protobuf, use the [`aep.api.resource`][resource] annotation:
5151

5252
```proto
5353
// A representation of a user event.
5454
message UserEvent {
55-
option (google.api.resource) = {
55+
option (aep.api.resource) = {
5656
type: "user.example.com/user-event"
5757
singular: "user-event"
5858
plural: "user-events"

aep/general/0008/aep.md.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ clients or their authors, including but not limited to:
4444
Examples of enhancements include:
4545

4646
- Requiring new proto annotations that enable more descriptive interfaces on
47-
clients (e.g. requiring `singular` and `plural` on a `google.api.resource`
47+
clients (e.g. requiring `singular` and `plural` on a `aep.api.resource`
4848
annotation).
4949

5050
AEP guidance **must not** be a significant detriment to a client's usability or

aep/general/0122/aep.md.j2

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,13 @@ and the full resource path does not change between these.
191191

192192
When defining a resource, the first field **should** be the resource path,
193193
which **must** be of type `string` and **must** be called `path` for the
194-
resource path. The message **should** include a `google.api.resource`
195-
annotation declaring the type (see AEP-4 for more on this).
194+
resource path. The message **should** include a `aep.api.resource` annotation
195+
declaring the type (see AEP-4 for more on this).
196196

197197
```proto
198198
// A representation of a book in the library.
199199
message Book {
200-
option (google.api.resource) = {
200+
option (aep.api.resource) = {
201201
type: "apis.example.com/library/Book"
202202
pattern: "publishers/{publisher_id}/books/{book_id}"
203203
};
@@ -296,7 +296,7 @@ When referencing a resource path for a different resource:
296296
```proto
297297
// A representation of a book in a library.
298298
message Book {
299-
option (google.api.resource) = {
299+
option (aep.api.resource) = {
300300
type: "apis.example.com/library/Book"
301301
pattern: "publishers/{publisher_id}/books/{book_id}"
302302
};

aep/general/0124/embedded_resource.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import "google/api/resource.proto";
66
message Book {
77
// The resource path pattern for Book indicates that Publisher is the
88
// canonical parent.
9-
option (google.api.resource) = {
9+
option (aep.api.resource) = {
1010
type: "library.googleapis.com/Book"
1111
pattern: "publishers/{publisher_id}/books/{book_id}"
1212
};

aep/general/0124/many_to_many_repeated.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import "google/api/field_behavior.proto";
55
import "google/api/resource.proto";
66

77
message Book {
8-
option (google.api.resource) = {
8+
option (aep.api.resource) = {
99
type: "library.googleapis.com/Book"
1010
pattern: "publishers/{publisher_id}/books/{book_id}"
1111
};

aep/general/0124/many_to_many_subresource.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import "google/api/resource.proto";
77
message BookAuthor {
88
// The resource pattern for BookAuthor indicates that Book is the
99
// canonical parent.
10-
option (google.api.resource) = {
10+
option (aep.api.resource) = {
1111
type: "library.googleapis.com/BookAuthor"
1212
pattern: "publishers/{publisher_id}/books/{book_id}/authors/{book_author}"
1313
};

aep/general/0124/multiple_many_to_one.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import "google/api/resource.proto";
66
message Book {
77
// The resource path pattern for Book indicates that Publisher is the
88
// canonical parent.
9-
option (google.api.resource) = {
9+
option (aep.api.resource) = {
1010
type: "library.googleapis.com/Book"
1111
pattern: "publishers/{publisher_id}/books/{book_id}"
1212
};

aep/general/0126/enum.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import "google/api/resource.proto";
1818

1919
// A representation of a book.
2020
message Book {
21-
option (google.api.resource) = {
21+
option (aep.api.resource) = {
2222
type: "library.googleapis.com/Book"
2323
pattern: "publishers/{publisher_id}/books/{book_id}"
2424
};

aep/general/0136/library.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ message SortBooksResponse {}
7373

7474
// A representation of a single book.
7575
message Book {
76-
option (google.api.resource) = {
76+
option (aep.api.resource) = {
7777
type: "library.googleapis.com/Book"
7878
pattern: "publishers/{publisher_id}/books/{book_id}"
7979
};

aep/general/0144/add_remove.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ message RemoveAuthorRequest {
4848

4949
// A representation of a single book.
5050
message Book {
51-
option (google.api.resource) = {
51+
option (aep.api.resource) = {
5252
type: "library.googleapis.com/Book"
5353
pattern: "publishers/{publisher_id}/books/{book_id}"
5454
};

0 commit comments

Comments
 (0)