Skip to content

Commit

Permalink
Update google-api-go-generator/gen.go
Browse files Browse the repository at this point in the history
Co-authored-by: Noah Dietz <noahdietz@users.noreply.github.com>
  • Loading branch information
codyoss and noahdietz committed Jun 12, 2024
1 parent 9bcbecd commit 83106d0
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions google-api-go-generator/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -2540,25 +2540,35 @@ func (meth *Method) IsRawRequest() bool {
// IsProtoStructRequest determines if the method request type is a
// [google.golang.org/protobuf/types/known/structpb.Struct].
func (meth *Method) IsProtoStructRequest() bool {
if meth == nil || meth.m == nil || meth.m.Request == nil {
if meth == nil || meth.m == nil {
return false
}
if meth.m.Request.Ref == "GoogleProtobufStruct" {
return true
}
return false

return isProtoStruct(meth.m.Request)
}

// IsProtoStructResponse determines if the method response type is a
// [google.golang.org/protobuf/types/known/structpb.Struct].
func (meth *Method) IsProtoStructResponse() bool {
if meth == nil || meth.m == nil || meth.m.Response == nil {
if meth == nil || meth.m == nil {
return false
}
if meth.m.Response.Ref == "GoogleProtobufStruct" {
return true
}
return false

return isProtoStruct(meth.m.Response)
}

// isProtoStruct determines if the Schema represents a
// [google.golang.org/protobuf/types/known/structpb.Struct].
func isProtoStruct(s *Schema) bool {
if s == nil {
return false
}

if s.Ref == "GoogleProtobufStruct" {
return true
}

return false
}

func (meth *Method) IsRawResponse() bool {
Expand Down

0 comments on commit 83106d0

Please sign in to comment.