Skip to content

Commit 525ea24

Browse files
authored
change google.api.resource_ref to aep (#111)
1 parent 1e90f9a commit 525ea24

File tree

73 files changed

+340
-353
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+340
-353
lines changed

docs/rules/0004/resource-reference-type.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ redirect_from:
1010

1111
# Resource annotation presence
1212

13-
This rule enforces that any field with a `google.api.resource_reference`
13+
This rule enforces that any field with a `(aep.api.field_info).resource_reference`
1414
annotation has a `string` type, as described in [AEP-4][].
1515

1616
## Details
1717

18-
This rule scans all fields with a `google.api.resource_reference` annotation.
18+
This rule scans all fields with a `(aep.api.field_info).resource_reference` annotation.
1919
If one is found, the type is checked, and the rule complains if the type is
2020
anything other than `string`.
2121

@@ -33,7 +33,7 @@ message Book {
3333
string path = 1;
3434
3535
// This is not a resource reference; the annotation does not belong.
36-
Author author = 2 [(google.api.resource_reference) = {
36+
Author author = 2 [(aep.api.field_info).resource_reference = {
3737
type: "library.googleapis.com/Author"
3838
}];
3939
}
@@ -55,7 +55,7 @@ message Book {
5555
message Book {
5656
string path = 1;
5757
58-
string author = 2 [(google.api.resource_reference) = {
58+
string author = 2 [(aep.api.field_info).resource_reference = {
5959
type: "library.googleapis.com/Author"
6060
}];
6161
}

docs/rules/0121/no-mutable-cycles.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ message Book {
3333
3434
// Incorrect. Creates potential reference cycle.
3535
string author = 2 [
36-
(google.api.resource_reference).type = "library.googleapis.com/Author"
36+
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Author"
3737
];
3838
}
3939
@@ -47,7 +47,7 @@ message Author {
4747
4848
// Incorrect. Creates potential reference cycle.
4949
string book = 2 [
50-
(google.api.resource_reference).type = "library.googleapis.com/Book"
50+
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book"
5151
];
5252
}
5353
```
@@ -65,7 +65,7 @@ message Book {
6565
6666
// Correct because the other reference is OUTPUT_ONLY.
6767
string author = 2 [
68-
(google.api.resource_reference).type = "library.googleapis.com/Author"
68+
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Author"
6969
];
7070
}
7171
@@ -79,7 +79,7 @@ message Author {
7979
8080
// Correct because an OUTPUT_ONLY reference breaks the mutation cycle.
8181
string book = 2 [
82-
(google.api.resource_reference).type = "library.googleapis.com/Book",
82+
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book",
8383
(aep.api.field_behavior) = FIELD_BEHAVIOR_OUTPUT_ONLY
8484
];
8585
}
@@ -102,7 +102,7 @@ message Book {
102102
// (-- api-linter: core::0121::no-mutable-cycles=disabled
103103
// aep.dev/not-precedent: We need to do this because reasons. --)
104104
string author = 2 [
105-
(google.api.resource_reference).type = "library.googleapis.com/Author"
105+
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Author"
106106
];
107107
}
108108
@@ -117,7 +117,7 @@ message Author {
117117
// (-- api-linter: core::0121::no-mutable-cycles=disabled
118118
// aep.dev/not-precedent: We need to do this because reasons. --)
119119
string book = 2 [
120-
(google.api.resource_reference).type = "library.googleapis.com/Book"
120+
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book"
121121
];
122122
}
123123
```

docs/rules/0122/resource-reference-type.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ redirect_from:
1010

1111
# Resource reference type
1212

13-
This rule enforces that all fields with the `google.api.resource_reference`
13+
This rule enforces that all fields with the `(aep.api.field_info).resource_reference`
1414
annotation are strings, as mandated in [AEP-122][].
1515

1616
## Details
1717

18-
This rule complains if it sees a field with a `google.api.resource_reference`
18+
This rule complains if it sees a field with a `(aep.api.field_info).resource_reference`
1919
that has a type other than `string`.
2020

2121
## Examples
@@ -28,7 +28,7 @@ message Book {
2828
string path = 1;
2929
3030
// Resource references should be strings.
31-
Author author = 2 [(google.api.resource_reference) = {
31+
Author author = 2 [(aep.api.field_info).resource_reference = {
3232
type: "library.googleapis.com/Author"
3333
}];
3434
}
@@ -41,7 +41,7 @@ message Book {
4141
message Book {
4242
string path = 1;
4343
44-
string author = 2 [(google.api.resource_reference) = {
44+
string author = 2 [(aep.api.field_info).resource_reference = {
4545
type: "library.googleapis.com/Author"
4646
}];
4747
}
@@ -69,7 +69,7 @@ message Book {
6969
7070
// (-- api-linter: core::0122::resource-reference-type=disabled
7171
// aep.dev/not-precedent: We need to do this because reasons. --)
72-
Author author = 2 [(google.api.resource_reference) = {
72+
Author author = 2 [(aep.api.field_info).resource_reference = {
7373
type: "library.googleapis.com/Author"
7474
}];
7575
}

docs/rules/0124/reference-same-package.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ in the same package, as described in [AEP-124][].
1515

1616
## Details
1717

18-
This rule scans all fields with `google.api.resource_reference` annotations,
18+
This rule scans all fields with `(aep.api.field_info).resource_reference` annotations,
1919
and complains if the `type` on them refers to a resource that is defined in a
2020
different protobuf package.
2121

@@ -46,7 +46,7 @@ message Book {
4646
package google.example.libray.v1; // Typo: Different package.
4747
4848
message GetBookRequest {
49-
string name = 1 [(google.api.resource_reference) = {
49+
string name = 1 [(aep.api.field_info).resource_reference = {
5050
type: "library.googleapis.com/Book" // Lint warning: package mismatch.
5151
}];
5252
}
@@ -70,7 +70,7 @@ message Book {
7070
}
7171
7272
message GetBookRequest {
73-
string name = 1 [(google.api.resource_reference) = {
73+
string name = 1 [(aep.api.field_info).resource_reference = {
7474
type: "library.googleapis.com/Book"
7575
}];
7676
}
@@ -98,7 +98,7 @@ package google.example.library.v1;
9898
message GetBookRequest {
9999
// (-- api-linter: core::0124::reference-same-package=disabled
100100
// aep.dev/not-precedent: We need to do this because reasons. --)
101-
string name = 1 [(google.api.resource_reference) = {
101+
string name = 1 [(aep.api.field_info).resource_reference = {
102102
type: "library.googleapis.com/Book"
103103
}];
104104
}

docs/rules/0127/http-template-pattern.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ rpc GetBook(GetBookRequest) returns (Book) {
3636
}
3737
message GetBookRequest {
3838
string path = 1 [
39-
(google.api.resource_reference).type = "library.googleapis.com/Book"
39+
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book"
4040
];
4141
}
4242
message Book {
@@ -61,7 +61,7 @@ rpc GetBook(GetBookRequest) returns (Book) {
6161
}
6262
message GetBookRequest {
6363
string path = 1 [
64-
(google.api.resource_reference).type = "library.googleapis.com/Book"
64+
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book"
6565
];
6666
}
6767
message Book {

docs/rules/0131/request-path-behavior.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ value of `FIELD_BEHAVIOR_REQUIRED`.
2929
// Incorrect.
3030
message GetBookRequest {
3131
// The `aep.api.field_behavior` annotation should also be included.
32-
string path = 1 [(google.api.resource_reference) = {
32+
string path = 1 [(aep.api.field_info).resource_reference = {
3333
type: "library.googleapis.com/Book"
3434
}];
3535
}
@@ -42,7 +42,7 @@ message GetBookRequest {
4242
message GetBookRequest {
4343
string path = 1 [
4444
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
45-
(google.api.resource_reference).type = "library.googleapis.com/Book"
45+
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book"
4646
];
4747
}
4848
```
@@ -56,7 +56,7 @@ Remember to also include an [aep.dev/not-precedent][] comment explaining why.
5656
message GetBookRequest {
5757
// (-- api-linter: core::0131::request-path-behavior=disabled
5858
// aep.dev/not-precedent: We need to do this because reasons. --)
59-
string path = 1 [(google.api.resource_reference) = {
59+
string path = 1 [(aep.api.field_info).resource_reference = {
6060
type: "library.googleapis.com/Book"
6161
}];
6262
}

docs/rules/0131/request-path-reference-type.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ rule:
33
aep: 131
44
name: [core, '0131', request-path-reference-type]
55
summary: |
6-
The `google.api.resource_reference` on the `path` field of a Get RPC request
6+
The `(aep.api.field_info).resource_reference` on the `path` field of a Get RPC request
77
message should use `type`, not `child_type`.
88
permalink: /131/request-path-reference-type
99
redirect_from:
@@ -12,13 +12,13 @@ redirect_from:
1212

1313
# Get methods: Resource reference
1414

15-
This rule enforces that the `google.api.resource_reference` on the `path` field
15+
This rule enforces that the `(aep.api.field_info).resource_reference` on the `path` field
1616
of a Get RPC request message uses `type`, not `child_type`, as suggested in
1717
[AEP-131][].
1818

1919
## Details
2020

21-
This rule looks at the `google.api.resource_reference` annotation on the `path`
21+
This rule looks at the `(aep.api.field_info).resource_reference` annotation on the `path`
2222
field of any message matching `Get*Request` and complains if it does not use a
2323
direct `type` reference.
2424

@@ -29,11 +29,11 @@ direct `type` reference.
2929
```proto
3030
// Incorrect.
3131
message GetBookRequest {
32-
// The `google.api.resource_reference` annotation should be a direct `type`
32+
// The `(aep.api.field_info).resource_reference` annotation should be a direct `type`
3333
// reference.
3434
string path = 1 [
3535
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
36-
(google.api.resource_reference).child_type = "library.googleapis.com/Book"
36+
(aep.api.field_info).resource_reference.child_type = "library.googleapis.com/Book"
3737
];
3838
}
3939
```
@@ -45,7 +45,7 @@ message GetBookRequest {
4545
message GetBookRequest {
4646
string path = 1 [
4747
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
48-
(google.api.resource_reference).type = "library.googleapis.com/Book"
48+
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book"
4949
];
5050
}
5151
```
@@ -61,7 +61,7 @@ message GetBookRequest {
6161
// aep.dev/not-precedent: We need to do this because reasons. --)
6262
string path = 1 [
6363
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
64-
(google.api.resource_reference).child_type = "library.googleapis.com/Book"
64+
(aep.api.field_info).resource_reference.child_type = "library.googleapis.com/Book"
6565
];
6666
}
6767
```

docs/rules/0131/request-path-reference.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ rule:
33
aep: 131
44
name: [core, '0131', request-path-reference]
55
summary: |
6-
Get RPCs should annotate the `path` field with `google.api.resource_reference`.
6+
Get RPCs should annotate the `path` field with `(aep.api.field_info).resource_reference`.
77
permalink: /131/request-path-reference
88
redirect_from:
99
- /0131/request-path-reference
@@ -12,13 +12,13 @@ redirect_from:
1212
# Get methods: Resource reference
1313

1414
This rule enforces that all `Get` standard methods have
15-
`google.api.resource_reference` on their `string path` field, as mandated in
15+
`(aep.api.field_info).resource_reference` on their `string path` field, as mandated in
1616
[AEP-131][].
1717

1818
## Details
1919

2020
This rule looks at the `path` field of any message matching `Get*Request` and
21-
complains if it does not have a `google.api.resource_reference` annotation.
21+
complains if it does not have a `(aep.api.field_info).resource_reference` annotation.
2222

2323
## Examples
2424

@@ -27,7 +27,7 @@ complains if it does not have a `google.api.resource_reference` annotation.
2727
```proto
2828
// Incorrect.
2929
message GetBookRequest {
30-
// The `google.api.resource_reference` annotation should also be included.
30+
// The `(aep.api.field_info).resource_reference` annotation should also be included.
3131
string path = 1 [(aep.api.field_info).field_behavior = FIELD_BEHAVIOR_REQUIRED];
3232
}
3333
```
@@ -39,7 +39,7 @@ message GetBookRequest {
3939
message GetBookRequest {
4040
string path = 1 [
4141
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
42-
(google.api.resource_reference).type = "library.googleapis.com/Book"
42+
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book"
4343
];
4444
}
4545
```

docs/rules/0131/request-path-required.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ the `path` field is missing.
2727
message GetBookRequest {
2828
string book = 1 [ // Field path should be `path`.
2929
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
30-
(google.api.resource_reference).type = "library.googleapis.com/Book"
30+
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book"
3131
];
3232
}
3333
```
@@ -39,7 +39,7 @@ message GetBookRequest {
3939
message GetBookRequest {
4040
string path = 1 [
4141
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
42-
(google.api.resource_reference).type = "library.googleapis.com/Book"
42+
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book"
4343
];
4444
}
4545
```
@@ -55,7 +55,7 @@ Remember to also include an [aep.dev/not-precedent][] comment explaining why.
5555
message GetBookRequest {
5656
string book = 1 [
5757
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
58-
(google.api.resource_reference).type = "library.googleapis.com/Book"
58+
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book"
5959
];
6060
}
6161
```

docs/rules/0131/request-required-fields.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ message GetBookRequest {
3131
// Format: publishers/{publisher}/books/{book}
3232
string path = 1 [
3333
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
34-
(google.api.resource_reference) = {
34+
(aep.api.field_info).resource_reference = {
3535
type: "library.googleapis.com/Book"
3636
}];
3737
@@ -49,7 +49,7 @@ message GetBookRequest {
4949
// Format: publishers/{publisher}/books/{book}
5050
string path = 1 [
5151
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
52-
(google.api.resource_reference) = {
52+
(aep.api.field_info).resource_reference = {
5353
type: "library.googleapis.com/Book"
5454
}];
5555
@@ -68,7 +68,7 @@ message GetBookRequest {
6868
// Format: publishers/{publisher}/books/{book}
6969
string path = 1 [
7070
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
71-
(google.api.resource_reference) = {
71+
(aep.api.field_info).resource_reference = {
7272
type: "library.googleapis.com/Book"
7373
}];
7474

0 commit comments

Comments
 (0)