Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support for nested messages and enums within group blocks #1687

Closed
wants to merge 11 commits into from
204 changes: 204 additions & 0 deletions google/rpc/error_details.json
@@ -0,0 +1,204 @@
{
"nested": {
"google": {
"nested": {
"rpc": {
"nested": {
"RetryInfo": {
"fields": {
"retryDelay": {
"type": "Duration",
"id": 1
}
},
"nested": {
"Duration": {
"fields": {
"seconds": {
"type": "int64",
"id": 1
},
"nanos": {
"type": "int32",
"id": 2
}
}
}
}
},
"DebugInfo": {
"fields": {
"stackEntries": {
"rule": "repeated",
"type": "string",
"id": 1
},
"detail": {
"type": "string",
"id": 2
}
}
},
"QuotaFailure": {
"fields": {
"violations": {
"rule": "repeated",
"type": "Violation",
"id": 1
}
},
"nested": {
"Violation": {
"fields": {
"subject": {
"type": "string",
"id": 1
},
"description": {
"type": "string",
"id": 2
}
}
}
}
},
"ErrorInfo": {
"fields": {
"reason": {
"type": "string",
"id": 1
},
"domain": {
"type": "string",
"id": 2
},
"metadata": {
"keyType": "string",
"type": "string",
"id": 3
}
}
},
"PreconditionFailure": {
"fields": {
"violations": {
"rule": "repeated",
"type": "Violation",
"id": 1
}
},
"nested": {
"Violation": {
"fields": {
"type": {
"type": "string",
"id": 1
},
"subject": {
"type": "string",
"id": 2
},
"description": {
"type": "string",
"id": 3
}
}
}
}
},
"BadRequest": {
"fields": {
"fieldViolations": {
"rule": "repeated",
"type": "FieldViolation",
"id": 1
}
},
"nested": {
"FieldViolation": {
"fields": {
"field": {
"type": "string",
"id": 1
},
"description": {
"type": "string",
"id": 2
}
}
}
}
},
"RequestInfo": {
"fields": {
"requestId": {
"type": "string",
"id": 1
},
"servingData": {
"type": "string",
"id": 2
}
}
},
"ResourceInfo": {
"fields": {
"resourceType": {
"type": "string",
"id": 1
},
"resourceName": {
"type": "string",
"id": 2
},
"owner": {
"type": "string",
"id": 3
},
"description": {
"type": "string",
"id": 4
}
}
},
"Help": {
"fields": {
"links": {
"rule": "repeated",
"type": "Link",
"id": 1
}
},
"nested": {
"Link": {
"fields": {
"description": {
"type": "string",
"id": 1
},
"url": {
"type": "string",
"id": 2
}
}
}
}
},
"LocalizedMessage": {
"fields": {
"locale": {
"type": "string",
"id": 1
},
"message": {
"type": "string",
"id": 2
}
}
}
}
}
}
}
}
}
77 changes: 77 additions & 0 deletions google/rpc/error_details.proto
@@ -0,0 +1,77 @@
syntax = "proto3";

package google.rpc;

message RetryInfo {
message Duration {
int64 seconds = 1;
int32 nanos = 2;
}

Duration retry_delay = 1;
}

message DebugInfo {
repeated string stack_entries = 1;
string detail = 2;
}

message QuotaFailure {
message Violation {
string subject = 1;
string description = 2;
}

repeated Violation violations = 1;
}

message ErrorInfo {
string reason = 1;
string domain = 2;
map<string, string> metadata = 3;
}

message PreconditionFailure {
message Violation {
string type = 1;
string subject = 2;
string description = 3;
}

repeated Violation violations = 1;
}

message BadRequest {
message FieldViolation {
string field = 1;
string description = 2;
}

repeated FieldViolation field_violations = 1;
}

message RequestInfo {
string request_id = 1;
string serving_data = 2;
}

message ResourceInfo {
string resource_type = 1;
string resource_name = 2;
string owner = 3;
string description = 4;
}

message Help {
message Link {
string description = 1;
string url = 2;
}

repeated Link links = 1;
}

message LocalizedMessage {
string locale = 1;
string message = 2;
}
45 changes: 45 additions & 0 deletions google/rpc/status.json
@@ -0,0 +1,45 @@
{
"nested": {
"google": {
"nested": {
"protobuf": {
"nested": {
"Any": {
"fields": {
"type_url": {
"type": "string",
"id": 1
},
"value": {
"type": "bytes",
"id": 2
}
}
}
}
},
"rpc": {
"nested": {
"Status": {
"fields": {
"code": {
"type": "int32",
"id": 1
},
"message": {
"type": "string",
"id": 2
},
"details": {
"rule": "repeated",
"type": "google.protobuf.Any",
"id": 3
}
}
}
}
}
}
}
}
}
11 changes: 11 additions & 0 deletions google/rpc/status.proto
@@ -0,0 +1,11 @@
syntax = "proto3";

package google.rpc;

import "google/protobuf/any.proto";

message Status {
int32 code = 1;
string message = 2;
repeated google.protobuf.Any details = 3;
}
8 changes: 8 additions & 0 deletions index.d.ts
Expand Up @@ -2147,6 +2147,14 @@ export namespace util {
*/
function safeProp(prop: string): string;

/**
* Returns the value of a property found directly in a given object.
* @param object Source object
* @param prop Property name
* @returns Value or `undefined` if not set
*/
function getProp(object: object, prop: string): any;

/**
* Converts the first character of a string to upper case.
* @param str String to convert
Expand Down
11 changes: 6 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.