From 14d434b16d0b88fb9bb9af8c03b9b6ad1d12e8f8 Mon Sep 17 00:00:00 2001 From: Ivan Koptiev Date: Tue, 8 Jul 2025 00:10:28 +0300 Subject: [PATCH 1/8] feat: add Opaque API and Protobuf Editions support --- internal/codegenerator/supported_features.go | 14 +- .../internal/gengateway/generator.go | 10 +- .../internal/gengateway/generator_test.go | 17 ++- .../internal/gengateway/template.go | 122 +++++++++++++++++- .../internal/gengateway/template_test.go | 7 +- protoc-gen-grpc-gateway/main.go | 8 +- 6 files changed, 164 insertions(+), 14 deletions(-) diff --git a/internal/codegenerator/supported_features.go b/internal/codegenerator/supported_features.go index 18c6cf07183..dd476abfc4c 100644 --- a/internal/codegenerator/supported_features.go +++ b/internal/codegenerator/supported_features.go @@ -2,18 +2,25 @@ package codegenerator import ( "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/types/descriptorpb" "google.golang.org/protobuf/types/pluginpb" ) func supportedCodeGeneratorFeatures() uint64 { - // Enable support for optional keyword in proto3. - return uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) + // Enable support for Protobuf Editions + return uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL | pluginpb.CodeGeneratorResponse_FEATURE_SUPPORTS_EDITIONS) +} + +func supportedEditions() (descriptorpb.Edition, descriptorpb.Edition) { + // Declare support for edition 2023 only + return descriptorpb.Edition_EDITION_2023, descriptorpb.Edition_EDITION_2023 } // SetSupportedFeaturesOnPluginGen sets supported proto3 features // on protogen.Plugin. func SetSupportedFeaturesOnPluginGen(gen *protogen.Plugin) { gen.SupportedFeatures = supportedCodeGeneratorFeatures() + gen.SupportedEditionsMinimum, gen.SupportedEditionsMaximum = supportedEditions() } // SetSupportedFeaturesOnCodeGeneratorResponse sets supported proto3 features @@ -21,4 +28,7 @@ func SetSupportedFeaturesOnPluginGen(gen *protogen.Plugin) { func SetSupportedFeaturesOnCodeGeneratorResponse(resp *pluginpb.CodeGeneratorResponse) { sf := supportedCodeGeneratorFeatures() resp.SupportedFeatures = &sf + minE, maxE := supportedEditions() + minEN, maxEN := int32(minE.Number()), int32(maxE.Number()) + resp.MinimumEdition, resp.MaximumEdition = &minEN, &maxEN } diff --git a/protoc-gen-grpc-gateway/internal/gengateway/generator.go b/protoc-gen-grpc-gateway/internal/gengateway/generator.go index 819cbf5509e..e81e95c793b 100644 --- a/protoc-gen-grpc-gateway/internal/gengateway/generator.go +++ b/protoc-gen-grpc-gateway/internal/gengateway/generator.go @@ -6,11 +6,12 @@ import ( "go/format" "path" - "github.com/grpc-ecosystem/grpc-gateway/v2/internal/descriptor" - gen "github.com/grpc-ecosystem/grpc-gateway/v2/internal/generator" "google.golang.org/grpc/grpclog" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/pluginpb" + + "github.com/grpc-ecosystem/grpc-gateway/v2/internal/descriptor" + gen "github.com/grpc-ecosystem/grpc-gateway/v2/internal/generator" ) var errNoTargetService = errors.New("no target service defined in the file") @@ -22,11 +23,12 @@ type generator struct { registerFuncSuffix string allowPatchFeature bool standalone bool + useOpaqueAPI bool } // New returns a new generator which generates grpc gateway files. func New(reg *descriptor.Registry, useRequestContext bool, registerFuncSuffix string, - allowPatchFeature, standalone bool) gen.Generator { + allowPatchFeature, standalone bool, useOpaqueAPI bool) gen.Generator { var imports []descriptor.GoPackage for _, pkgpath := range []string{ "context", @@ -66,6 +68,7 @@ func New(reg *descriptor.Registry, useRequestContext bool, registerFuncSuffix st registerFuncSuffix: registerFuncSuffix, allowPatchFeature: allowPatchFeature, standalone: standalone, + useOpaqueAPI: useOpaqueAPI, } } @@ -132,6 +135,7 @@ func (g *generator) generate(file *descriptor.File) (string, error) { UseRequestContext: g.useRequestContext, RegisterFuncSuffix: g.registerFuncSuffix, AllowPatchFeature: g.allowPatchFeature, + UseOpaqueAPI: g.useOpaqueAPI, } if g.reg != nil { params.OmitPackageDoc = g.reg.GetOmitPackageDoc() diff --git a/protoc-gen-grpc-gateway/internal/gengateway/generator_test.go b/protoc-gen-grpc-gateway/internal/gengateway/generator_test.go index 2c5fe023293..610c4ce5fa9 100644 --- a/protoc-gen-grpc-gateway/internal/gengateway/generator_test.go +++ b/protoc-gen-grpc-gateway/internal/gengateway/generator_test.go @@ -3,9 +3,10 @@ package gengateway import ( "testing" - "github.com/grpc-ecosystem/grpc-gateway/v2/internal/descriptor" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/descriptorpb" + + "github.com/grpc-ecosystem/grpc-gateway/v2/internal/descriptor" ) func newExampleFileDescriptorWithGoPkg(gp *descriptor.GoPackage, filenamePrefix string) *descriptor.File { @@ -76,8 +77,22 @@ func newExampleFileDescriptorWithGoPkg(gp *descriptor.GoPackage, filenamePrefix } func TestGenerator_Generate(t *testing.T) { + + // Test with Open Struct API (default) + t.Run("OpenStructAPI", func(t *testing.T) { + testGeneratorGenerate(t, false) + }) + + // Test with Opaque API + t.Run("OpaqueAPI", func(t *testing.T) { + testGeneratorGenerate(t, true) + }) +} + +func testGeneratorGenerate(t *testing.T, useOpaqueAPI bool) { g := new(generator) g.reg = descriptor.NewRegistry() + g.useOpaqueAPI = useOpaqueAPI result, err := g.Generate([]*descriptor.File{ crossLinkFixture(newExampleFileDescriptorWithGoPkg(&descriptor.GoPackage{ Path: "example.com/path/to/example", diff --git a/protoc-gen-grpc-gateway/internal/gengateway/template.go b/protoc-gen-grpc-gateway/internal/gengateway/template.go index 80df6a0b984..f3ef4e89607 100644 --- a/protoc-gen-grpc-gateway/internal/gengateway/template.go +++ b/protoc-gen-grpc-gateway/internal/gengateway/template.go @@ -8,10 +8,11 @@ import ( "strings" "text/template" + "google.golang.org/grpc/grpclog" + "github.com/grpc-ecosystem/grpc-gateway/v2/internal/casing" "github.com/grpc-ecosystem/grpc-gateway/v2/internal/descriptor" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc/grpclog" ) type param struct { @@ -21,12 +22,14 @@ type param struct { RegisterFuncSuffix string AllowPatchFeature bool OmitPackageDoc bool + UseOpaqueAPI bool } type binding struct { *descriptor.Binding Registry *descriptor.Registry AllowPatchFeature bool + UseOpaqueAPI bool } // GetBodyFieldPath returns the binding body's field path. @@ -147,6 +150,7 @@ type trailerParams struct { Services []*descriptor.Service UseRequestContext bool RegisterFuncSuffix string + UseOpaqueAPI bool } func applyTemplate(p param, reg *descriptor.Registry) (string, error) { @@ -182,6 +186,7 @@ func applyTemplate(p param, reg *descriptor.Registry) (string, error) { Binding: b, Registry: reg, AllowPatchFeature: p.AllowPatchFeature, + UseOpaqueAPI: p.UseOpaqueAPI, }); err != nil { return "", err } @@ -191,6 +196,7 @@ func applyTemplate(p param, reg *descriptor.Registry) (string, error) { Binding: b, Registry: reg, AllowPatchFeature: p.AllowPatchFeature, + UseOpaqueAPI: p.UseOpaqueAPI, }); err != nil { return "", err } @@ -208,6 +214,7 @@ func applyTemplate(p param, reg *descriptor.Registry) (string, error) { Services: targetServices, UseRequestContext: p.UseRequestContext, RegisterFuncSuffix: p.RegisterFuncSuffix, + UseOpaqueAPI: p.UseOpaqueAPI, } // Local if err := localTrailerTemplate.Execute(w, tp); err != nil { @@ -335,6 +342,7 @@ func request_{{ .Method.Service.GetName }}_{{ .Method.GetName }}_{{ .Index }}(ct _ = template.Must(handlerTemplate.New("client-rpc-request-func").Funcs(funcMap).Parse(` {{ $AllowPatchFeature := .AllowPatchFeature }} +{{ $UseOpaqueAPI := .UseOpaqueAPI }} {{ if .HasQueryParam }} var filter_{{ .Method.Service.GetName }}_{{ .Method.GetName }}_{{ .Index }} = {{ .QueryParamFilter }} {{ end }} @@ -365,20 +373,53 @@ var filter_{{ .Method.Service.GetName }}_{{ .Method.GetName }}_{{ .Index }} = {{ {{printf "%s" $protoReq }} {{- end }} {{- if not $isFieldMask }} + {{- if $UseOpaqueAPI }} + var bodyData {{.Method.RequestType.GoType .Method.Service.File.GoPkg.Path}} + if err := marshaler.NewDecoder(req.Body).Decode(&bodyData); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + {{- if eq "*" .GetBodyFieldPath }} + protoReq = bodyData + {{- else }} + protoReq.Set{{ .GetBodyFieldStructName }}(bodyData.Get{{ .GetBodyFieldStructName }}()) + {{- end }} + {{- else }} if err := marshaler.NewDecoder(req.Body).Decode(&{{.Body.AssignableExpr "protoReq" .Method.Service.File.GoPkg.Path}}); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + {{- end }} if req.Body != nil { _, _ = io.Copy(io.Discard, req.Body) } {{- end }} {{- if $isFieldMask }} + {{- if $UseOpaqueAPI }} + var bodyData {{.Method.RequestType.GoType .Method.Service.File.GoPkg.Path}} + if err := marshaler.NewDecoder(newReader()).Decode(&bodyData); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + {{- if eq "*" .GetBodyFieldPath }} + protoReq = bodyData + {{- else }} + protoReq.Set{{ .GetBodyFieldStructName }}(bodyData.Get{{ .GetBodyFieldStructName }}()) + {{- end }} + {{- else }} if err := marshaler.NewDecoder(newReader()).Decode(&{{ .Body.AssignableExpr "protoReq" .Method.Service.File.GoPkg.Path }}); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + {{- end }} if req.Body != nil { _, _ = io.Copy(io.Discard, req.Body) } + {{- if $UseOpaqueAPI }} + if !protoReq.Has{{ .FieldMaskField }}() || len(protoReq.Get{{ .FieldMaskField }}().GetPaths()) == 0 { + if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Get{{ .GetBodyFieldStructName }}()); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } else { + protoReq.Set{{ .FieldMaskField }}(fieldMask) + } + } + {{- else }} if protoReq.{{ .FieldMaskField }} == nil || len(protoReq.{{ .FieldMaskField }}.GetPaths()) == 0 { if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.{{ .GetBodyFieldStructName }}); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) @@ -387,6 +428,7 @@ var filter_{{ .Method.Service.GetName }}_{{ .Method.GetName }}_{{ .Index }} = {{ } } {{- end }} + {{- end }} {{- else }} if req.Body != nil { _, _ = io.Copy(io.Discard, req.Body) @@ -421,19 +463,35 @@ var filter_{{ .Method.Service.GetName }}_{{ .Method.GetName }}_{{ .Index }} = {{ {{- if ne "" $protoReq }} {{ printf "%s" $protoReq }} {{- end}} + {{- if $UseOpaqueAPI }} + converted{{ $param.FieldPath.String | camelIdentifier }}, err := {{ $param.ConvertFuncExpr }}(val{{ if $param.IsRepeated }}, {{ $binding.Registry.GetRepeatedPathParamSeparator | printf "%c" | printf "%q" }}{{ end }}) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", {{ $param | printf "%q"}}, err) + } + protoReq.Set{{ $param.FieldPath.String | camelIdentifier }}(converted{{ $param.FieldPath.String | camelIdentifier }}) + {{- else }} {{ $param.AssignableExpr "protoReq" $binding.Method.Service.File.GoPkg.Path }}, err = {{ $param.ConvertFuncExpr }}(val{{ if $param.IsRepeated }}, {{ $binding.Registry.GetRepeatedPathParamSeparator | printf "%c" | printf "%q" }}{{ end }}) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", {{ $param | printf "%q"}}, err) } + {{- end }} {{- end}} {{- if and $enum $param.IsRepeated }} s := make([]{{ $enum.GoType $param.Method.Service.File.GoPkg.Path }}, len(es)) for i, v := range es { s[i] = {{ $enum.GoType $param.Method.Service.File.GoPkg.Path}}(v) } + {{- if $UseOpaqueAPI }} + protoReq.Set{{ $param.FieldPath.String | camelIdentifier }}(s) + {{- else }} {{ $param.AssignableExpr "protoReq" $binding.Method.Service.File.GoPkg.Path }} = s + {{- end }} {{- else if $enum}} + {{- if $UseOpaqueAPI }} + protoReq.Set{{ $param.FieldPath.String | camelIdentifier }}({{ $enum.GoType $param.Method.Service.File.GoPkg.Path | camelIdentifier }}(e)) + {{- else }} {{ $param.AssignableExpr "protoReq" $binding.Method.Service.File.GoPkg.Path }} = {{ $enum.GoType $param.Method.Service.File.GoPkg.Path | camelIdentifier }}(e) + {{- end }} {{- end}} {{- end }} {{- end }} @@ -524,6 +582,7 @@ func local_request_{{ .Method.Service.GetName }}_{{ .Method.GetName }}_{{ .Index _ = template.Must(localHandlerTemplate.New("local-client-rpc-request-func").Funcs(funcMap).Parse(` {{ $AllowPatchFeature := .AllowPatchFeature }} +{{ $UseOpaqueAPI := .UseOpaqueAPI }} {{ template "local-request-func-signature" . }} { var ( protoReq {{.Method.RequestType.GoType .Method.Service.File.GoPkg.Path}} @@ -551,14 +610,47 @@ func local_request_{{ .Method.Service.GetName }}_{{ .Method.GetName }}_{{ .Index {{ printf "%s" $protoReq }} {{- end }} {{- if not $isFieldMask }} + {{- if $UseOpaqueAPI }} + var bodyData {{.Method.RequestType.GoType .Method.Service.File.GoPkg.Path}} + if err := marshaler.NewDecoder(req.Body).Decode(&bodyData); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + {{- if eq "*" .GetBodyFieldPath }} + protoReq = bodyData + {{- else }} + protoReq.Set{{ .GetBodyFieldStructName }}(bodyData.Get{{ .GetBodyFieldStructName }}()) + {{- end }} + {{- else }} if err := marshaler.NewDecoder(req.Body).Decode(&{{ .Body.AssignableExpr "protoReq" .Method.Service.File.GoPkg.Path }}); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } {{- end }} + {{- end }} {{- if $isFieldMask }} + {{- if $UseOpaqueAPI }} + var bodyData {{.Method.RequestType.GoType .Method.Service.File.GoPkg.Path}} + if err := marshaler.NewDecoder(newReader()).Decode(&bodyData); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + {{- if eq "*" .GetBodyFieldPath }} + protoReq = bodyData + {{- else }} + protoReq.Set{{ .GetBodyFieldStructName }}(bodyData.Get{{ .GetBodyFieldStructName }}()) + {{- end }} + {{- else }} if err := marshaler.NewDecoder(newReader()).Decode(&{{ .Body.AssignableExpr "protoReq" .Method.Service.File.GoPkg.Path }}); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + {{- end }} + {{- if $UseOpaqueAPI }} + if !protoReq.Has{{ .FieldMaskField }}() || len(protoReq.Get{{ .FieldMaskField }}().GetPaths()) == 0 { + if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Get{{ .GetBodyFieldStructName }}()); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } else { + protoReq.Set{{ .FieldMaskField }}(fieldMask) + } + } + {{- else }} if protoReq.{{ .FieldMaskField }} == nil || len(protoReq.{{ .FieldMaskField }}.GetPaths()) == 0 { if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.{{ .GetBodyFieldStructName }}); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) @@ -567,6 +659,7 @@ func local_request_{{ .Method.Service.GetName }}_{{ .Method.GetName }}_{{ .Index } } {{- end }} + {{- end }} {{- end }} {{- if .PathParams}} {{- $binding := .}} @@ -596,20 +689,36 @@ func local_request_{{ .Method.Service.GetName }}_{{ .Method.GetName }}_{{ .Index {{- $protoReq := $param.AssignableExprPrep "protoReq" $binding.Method.Service.File.GoPkg.Path -}} {{- if ne "" $protoReq }} {{ printf "%s" $protoReq }} - {{- end }} + {{- end}} + {{- if $UseOpaqueAPI }} + converted{{ $param.FieldPath.String | camelIdentifier }}, err := {{ $param.ConvertFuncExpr }}(val{{ if $param.IsRepeated }}, {{ $binding.Registry.GetRepeatedPathParamSeparator | printf "%c" | printf "%q" }}{{ end }}) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", {{ $param | printf "%q"}}, err) + } + protoReq.Set{{ $param.FieldPath.String | camelIdentifier }}(converted{{ $param.FieldPath.String | camelIdentifier }}) + {{- else }} {{ $param.AssignableExpr "protoReq" $binding.Method.Service.File.GoPkg.Path }}, err = {{ $param.ConvertFuncExpr }}(val{{ if $param.IsRepeated }}, {{ $binding.Registry.GetRepeatedPathParamSeparator | printf "%c" | printf "%q" }}{{ end }}) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", {{ $param | printf "%q" }}, err) } + {{- end }} {{- end}} {{- if and $enum $param.IsRepeated }} s := make([]{{ $enum.GoType $param.Method.Service.File.GoPkg.Path }}, len(es)) for i, v := range es { s[i] = {{ $enum.GoType $param.Method.Service.File.GoPkg.Path }}(v) } + {{- if $UseOpaqueAPI }} + protoReq.Set{{ $param.FieldPath.String | camelIdentifier }}(s) + {{- else }} {{ $param.AssignableExpr "protoReq" $binding.Method.Service.File.GoPkg.Path }} = s + {{- end }} {{- else if $enum }} + {{- if $UseOpaqueAPI }} + protoReq.Set{{ $param.FieldPath.String | camelIdentifier }}({{ $enum.GoType $param.Method.Service.File.GoPkg.Path | camelIdentifier }}(e)) + {{- else }} {{ $param.AssignableExpr "protoReq" $binding.Method.Service.File.GoPkg.Path }} = {{ $enum.GoType $param.Method.Service.File.GoPkg.Path | camelIdentifier }}(e) + {{- end }} {{- end }} {{- end }} {{- end }} @@ -689,6 +798,7 @@ func Register{{ $svc.GetName }}{{ $.RegisterFuncSuffix }}Server(ctx context.Cont trailerTemplate = template.Must(template.New("trailer").Funcs(funcMap).Parse(` {{ $UseRequestContext := .UseRequestContext }} +{{ $UseOpaqueAPI := .UseOpaqueAPI }} {{range $svc := .Services}} // Register{{ $svc.GetName }}{{ $.RegisterFuncSuffix }}FromEndpoint is same as Register{{ $svc.GetName }}{{ $.RegisterFuncSuffix }} but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. @@ -782,7 +892,15 @@ type response_{{ $svc.GetName }}_{{ $m.GetName }}_{{ $b.Index }} struct { func (m response_{{ $svc.GetName }}_{{ $m.GetName }}_{{ $b.Index }}) XXX_ResponseBody() interface{} { response := m.{{ $m.ResponseType.GetName }} + {{- if $UseOpaqueAPI }} + {{- if eq "*" $b.ResponseBody.FieldPath.String }} + return response + {{- else }} + return response.Get{{ $b.ResponseBody.FieldPath.String | camelIdentifier }}() + {{- end }} + {{- else }} return {{ $b.ResponseBody.AssignableExpr "response" $m.Service.File.GoPkg.Path }} + {{- end }} } {{ end }} {{ end }} diff --git a/protoc-gen-grpc-gateway/internal/gengateway/template_test.go b/protoc-gen-grpc-gateway/internal/gengateway/template_test.go index 59c748be0f3..0faa65ae31a 100644 --- a/protoc-gen-grpc-gateway/internal/gengateway/template_test.go +++ b/protoc-gen-grpc-gateway/internal/gengateway/template_test.go @@ -4,10 +4,11 @@ import ( "strings" "testing" - "github.com/grpc-ecosystem/grpc-gateway/v2/internal/descriptor" - "github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/descriptorpb" + + "github.com/grpc-ecosystem/grpc-gateway/v2/internal/descriptor" + "github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule" ) func crossLinkFixture(f *descriptor.File) *descriptor.File { @@ -965,7 +966,7 @@ func TestDuplicatePathsInDifferentService(t *testing.T) { } _, err := applyTemplate(param{File: crossLinkFixture(&file), RegisterFuncSuffix: "Handler", AllowPatchFeature: true}, descriptor.NewRegistry()) if err != nil { - t.Errorf("applyTemplate(%#v) failed; want success", file) + t.Errorf("applyTemplate(%#v) failed; want success - %s", file, err) return } } diff --git a/protoc-gen-grpc-gateway/main.go b/protoc-gen-grpc-gateway/main.go index 086a4624d37..222e1fcfdfa 100644 --- a/protoc-gen-grpc-gateway/main.go +++ b/protoc-gen-grpc-gateway/main.go @@ -16,11 +16,12 @@ import ( "runtime/debug" "strings" + "google.golang.org/grpc/grpclog" + "google.golang.org/protobuf/compiler/protogen" + "github.com/grpc-ecosystem/grpc-gateway/v2/internal/codegenerator" "github.com/grpc-ecosystem/grpc-gateway/v2/internal/descriptor" "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway/internal/gengateway" - "google.golang.org/grpc/grpclog" - "google.golang.org/protobuf/compiler/protogen" ) var ( @@ -36,6 +37,7 @@ var ( versionFlag = flag.Bool("version", false, "print the current version") warnOnUnboundMethods = flag.Bool("warn_on_unbound_methods", false, "emit a warning message if an RPC method has no HttpRule annotation") generateUnboundMethods = flag.Bool("generate_unbound_methods", false, "generate proxy methods even for RPC methods that have no HttpRule annotation") + useOpaqueAPI = flag.Bool("use_opaque_api", false, "generate code compatible with the new Opaque API instead of the older Open Struct API") _ = flag.Bool("logtostderr", false, "Legacy glog compatibility. This flag is a no-op, you can safely remove it") ) @@ -80,7 +82,7 @@ func main() { codegenerator.SetSupportedFeaturesOnPluginGen(gen) - generator := gengateway.New(reg, *useRequestContext, *registerFuncSuffix, *allowPatchFeature, *standalone) + generator := gengateway.New(reg, *useRequestContext, *registerFuncSuffix, *allowPatchFeature, *standalone, *useOpaqueAPI) if grpclog.V(1) { grpclog.Infof("Parsing code generator request") From 6a205339533418d83b80f6034e012768f5fdf464 Mon Sep 17 00:00:00 2001 From: Ivan Koptiev Date: Wed, 16 Jul 2025 22:41:09 +0300 Subject: [PATCH 2/8] docs: add example and update README --- Makefile | 3 + README.md | 2 + .../proto/examplepb/opaque.buf.gen.yaml | 17 + .../internal/proto/examplepb/opaque.pb.go | 7117 +++++++++++++++++ .../internal/proto/examplepb/opaque.pb.gw.go | 375 + .../internal/proto/examplepb/opaque.proto | 405 + .../proto/examplepb/opaque.swagger.json | 1069 +++ .../proto/examplepb/opaque_grpc.pb.go | 244 + 8 files changed, 9232 insertions(+) create mode 100644 examples/internal/proto/examplepb/opaque.buf.gen.yaml create mode 100644 examples/internal/proto/examplepb/opaque.pb.go create mode 100644 examples/internal/proto/examplepb/opaque.pb.gw.go create mode 100644 examples/internal/proto/examplepb/opaque.proto create mode 100644 examples/internal/proto/examplepb/opaque.swagger.json create mode 100644 examples/internal/proto/examplepb/opaque_grpc.pb.go diff --git a/Makefile b/Makefile index c8791a64f37..2caf27e1765 100644 --- a/Makefile +++ b/Makefile @@ -151,6 +151,9 @@ proto: --template ./protoc-gen-openapiv2/options/buf.gen.yaml \ --path ./protoc-gen-openapiv2/options/annotations.proto \ --path ./protoc-gen-openapiv2/options/openapiv2.proto + buf generate \ + --template ./examples/internal/proto/examplepb/opaque.buf.gen.yaml \ + --path examples/internal/proto/examplepb/opaque.proto generate: proto $(ECHO_EXAMPLE_SRCS) $(ABE_EXAMPLE_SRCS) $(UNANNOTATED_ECHO_EXAMPLE_SRCS) $(RESPONSE_BODY_EXAMPLE_SRCS) $(GENERATE_UNBOUND_METHODS_EXAMPLE_SRCS) diff --git a/README.md b/README.md index 128d9744bfd..638ed258aa0 100644 --- a/README.md +++ b/README.md @@ -628,6 +628,8 @@ gRPC-Gateway, and a gRPC server, see - Automatically translating PATCH requests into Field Mask gRPC requests. See [the docs](https://grpc-ecosystem.github.io/grpc-gateway/docs/mapping/patch_feature/) for more information. +- [Protobuf Editions](https://protobuf.dev/editions/overview/) support (edition 2023). +- Go [Opaque API](https://go.dev/blog/protobuf-opaque) support. ### No plan to support diff --git a/examples/internal/proto/examplepb/opaque.buf.gen.yaml b/examples/internal/proto/examplepb/opaque.buf.gen.yaml new file mode 100644 index 00000000000..bc4d4ec35a7 --- /dev/null +++ b/examples/internal/proto/examplepb/opaque.buf.gen.yaml @@ -0,0 +1,17 @@ +version: v2 +plugins: + - remote: buf.build/protocolbuffers/go:v1.36.6 + out: . + opt: + - paths=source_relative + - default_api_level=API_OPAQUE + - remote: buf.build/grpc/go:v1.5.1 + out: . + opt: + - paths=source_relative + - require_unimplemented_servers=false + - local: protoc-gen-grpc-gateway + out: . + opt: + - paths=source_relative + - use_opaque_api=true diff --git a/examples/internal/proto/examplepb/opaque.pb.go b/examples/internal/proto/examplepb/opaque.pb.go new file mode 100644 index 00000000000..b7578bdd95b --- /dev/null +++ b/examples/internal/proto/examplepb/opaque.pb.go @@ -0,0 +1,7117 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc (unknown) +// source: examples/internal/proto/examplepb/opaque.proto + +package examplepb + +import ( + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" + reflect "reflect" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type OpaqueSearchProductsRequest_OpaqueSortOrder int32 + +const ( + OpaqueSearchProductsRequest_OPAQUE_SORT_ORDER_UNSPECIFIED OpaqueSearchProductsRequest_OpaqueSortOrder = 0 + OpaqueSearchProductsRequest_OPAQUE_SORT_ORDER_RELEVANCE OpaqueSearchProductsRequest_OpaqueSortOrder = 1 + OpaqueSearchProductsRequest_OPAQUE_SORT_ORDER_PRICE_LOW_TO_HIGH OpaqueSearchProductsRequest_OpaqueSortOrder = 2 + OpaqueSearchProductsRequest_OPAQUE_SORT_ORDER_PRICE_HIGH_TO_LOW OpaqueSearchProductsRequest_OpaqueSortOrder = 3 + OpaqueSearchProductsRequest_OPAQUE_SORT_ORDER_NEWEST_FIRST OpaqueSearchProductsRequest_OpaqueSortOrder = 4 + OpaqueSearchProductsRequest_OPAQUE_SORT_ORDER_RATING OpaqueSearchProductsRequest_OpaqueSortOrder = 5 + OpaqueSearchProductsRequest_OPAQUE_SORT_ORDER_POPULARITY OpaqueSearchProductsRequest_OpaqueSortOrder = 6 +) + +// Enum value maps for OpaqueSearchProductsRequest_OpaqueSortOrder. +var ( + OpaqueSearchProductsRequest_OpaqueSortOrder_name = map[int32]string{ + 0: "OPAQUE_SORT_ORDER_UNSPECIFIED", + 1: "OPAQUE_SORT_ORDER_RELEVANCE", + 2: "OPAQUE_SORT_ORDER_PRICE_LOW_TO_HIGH", + 3: "OPAQUE_SORT_ORDER_PRICE_HIGH_TO_LOW", + 4: "OPAQUE_SORT_ORDER_NEWEST_FIRST", + 5: "OPAQUE_SORT_ORDER_RATING", + 6: "OPAQUE_SORT_ORDER_POPULARITY", + } + OpaqueSearchProductsRequest_OpaqueSortOrder_value = map[string]int32{ + "OPAQUE_SORT_ORDER_UNSPECIFIED": 0, + "OPAQUE_SORT_ORDER_RELEVANCE": 1, + "OPAQUE_SORT_ORDER_PRICE_LOW_TO_HIGH": 2, + "OPAQUE_SORT_ORDER_PRICE_HIGH_TO_LOW": 3, + "OPAQUE_SORT_ORDER_NEWEST_FIRST": 4, + "OPAQUE_SORT_ORDER_RATING": 5, + "OPAQUE_SORT_ORDER_POPULARITY": 6, + } +) + +func (x OpaqueSearchProductsRequest_OpaqueSortOrder) Enum() *OpaqueSearchProductsRequest_OpaqueSortOrder { + p := new(OpaqueSearchProductsRequest_OpaqueSortOrder) + *p = x + return p +} + +func (x OpaqueSearchProductsRequest_OpaqueSortOrder) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OpaqueSearchProductsRequest_OpaqueSortOrder) Descriptor() protoreflect.EnumDescriptor { + return file_examples_internal_proto_examplepb_opaque_proto_enumTypes[0].Descriptor() +} + +func (OpaqueSearchProductsRequest_OpaqueSortOrder) Type() protoreflect.EnumType { + return &file_examples_internal_proto_examplepb_opaque_proto_enumTypes[0] +} + +func (x OpaqueSearchProductsRequest_OpaqueSortOrder) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +type OpaqueAddress_OpaqueAddressType int32 + +const ( + OpaqueAddress_OPAQUE_ADDRESS_TYPE_UNSPECIFIED OpaqueAddress_OpaqueAddressType = 0 + OpaqueAddress_OPAQUE_ADDRESS_TYPE_RESIDENTIAL OpaqueAddress_OpaqueAddressType = 1 + OpaqueAddress_OPAQUE_ADDRESS_TYPE_BUSINESS OpaqueAddress_OpaqueAddressType = 2 + OpaqueAddress_OPAQUE_ADDRESS_TYPE_SHIPPING OpaqueAddress_OpaqueAddressType = 3 + OpaqueAddress_OPAQUE_ADDRESS_TYPE_BILLING OpaqueAddress_OpaqueAddressType = 4 +) + +// Enum value maps for OpaqueAddress_OpaqueAddressType. +var ( + OpaqueAddress_OpaqueAddressType_name = map[int32]string{ + 0: "OPAQUE_ADDRESS_TYPE_UNSPECIFIED", + 1: "OPAQUE_ADDRESS_TYPE_RESIDENTIAL", + 2: "OPAQUE_ADDRESS_TYPE_BUSINESS", + 3: "OPAQUE_ADDRESS_TYPE_SHIPPING", + 4: "OPAQUE_ADDRESS_TYPE_BILLING", + } + OpaqueAddress_OpaqueAddressType_value = map[string]int32{ + "OPAQUE_ADDRESS_TYPE_UNSPECIFIED": 0, + "OPAQUE_ADDRESS_TYPE_RESIDENTIAL": 1, + "OPAQUE_ADDRESS_TYPE_BUSINESS": 2, + "OPAQUE_ADDRESS_TYPE_SHIPPING": 3, + "OPAQUE_ADDRESS_TYPE_BILLING": 4, + } +) + +func (x OpaqueAddress_OpaqueAddressType) Enum() *OpaqueAddress_OpaqueAddressType { + p := new(OpaqueAddress_OpaqueAddressType) + *p = x + return p +} + +func (x OpaqueAddress_OpaqueAddressType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OpaqueAddress_OpaqueAddressType) Descriptor() protoreflect.EnumDescriptor { + return file_examples_internal_proto_examplepb_opaque_proto_enumTypes[1].Descriptor() +} + +func (OpaqueAddress_OpaqueAddressType) Type() protoreflect.EnumType { + return &file_examples_internal_proto_examplepb_opaque_proto_enumTypes[1] +} + +func (x OpaqueAddress_OpaqueAddressType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +type OpaqueProduct_OpaqueProductStatus int32 + +const ( + OpaqueProduct_OPAQUE_PRODUCT_STATUS_UNSPECIFIED OpaqueProduct_OpaqueProductStatus = 0 + OpaqueProduct_OPAQUE_PRODUCT_STATUS_DRAFT OpaqueProduct_OpaqueProductStatus = 1 + OpaqueProduct_OPAQUE_PRODUCT_STATUS_ACTIVE OpaqueProduct_OpaqueProductStatus = 2 + OpaqueProduct_OPAQUE_PRODUCT_STATUS_OUT_OF_STOCK OpaqueProduct_OpaqueProductStatus = 3 + OpaqueProduct_OPAQUE_PRODUCT_STATUS_DISCONTINUED OpaqueProduct_OpaqueProductStatus = 4 +) + +// Enum value maps for OpaqueProduct_OpaqueProductStatus. +var ( + OpaqueProduct_OpaqueProductStatus_name = map[int32]string{ + 0: "OPAQUE_PRODUCT_STATUS_UNSPECIFIED", + 1: "OPAQUE_PRODUCT_STATUS_DRAFT", + 2: "OPAQUE_PRODUCT_STATUS_ACTIVE", + 3: "OPAQUE_PRODUCT_STATUS_OUT_OF_STOCK", + 4: "OPAQUE_PRODUCT_STATUS_DISCONTINUED", + } + OpaqueProduct_OpaqueProductStatus_value = map[string]int32{ + "OPAQUE_PRODUCT_STATUS_UNSPECIFIED": 0, + "OPAQUE_PRODUCT_STATUS_DRAFT": 1, + "OPAQUE_PRODUCT_STATUS_ACTIVE": 2, + "OPAQUE_PRODUCT_STATUS_OUT_OF_STOCK": 3, + "OPAQUE_PRODUCT_STATUS_DISCONTINUED": 4, + } +) + +func (x OpaqueProduct_OpaqueProductStatus) Enum() *OpaqueProduct_OpaqueProductStatus { + p := new(OpaqueProduct_OpaqueProductStatus) + *p = x + return p +} + +func (x OpaqueProduct_OpaqueProductStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OpaqueProduct_OpaqueProductStatus) Descriptor() protoreflect.EnumDescriptor { + return file_examples_internal_proto_examplepb_opaque_proto_enumTypes[2].Descriptor() +} + +func (OpaqueProduct_OpaqueProductStatus) Type() protoreflect.EnumType { + return &file_examples_internal_proto_examplepb_opaque_proto_enumTypes[2] +} + +func (x OpaqueProduct_OpaqueProductStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +type OpaqueProduct_OpaqueProductDimensions_OpaqueUnit int32 + +const ( + OpaqueProduct_OpaqueProductDimensions_OPAQUE_UNIT_UNSPECIFIED OpaqueProduct_OpaqueProductDimensions_OpaqueUnit = 0 + OpaqueProduct_OpaqueProductDimensions_OPAQUE_UNIT_METRIC OpaqueProduct_OpaqueProductDimensions_OpaqueUnit = 1 + OpaqueProduct_OpaqueProductDimensions_OPAQUE_UNIT_IMPERIAL OpaqueProduct_OpaqueProductDimensions_OpaqueUnit = 2 +) + +// Enum value maps for OpaqueProduct_OpaqueProductDimensions_OpaqueUnit. +var ( + OpaqueProduct_OpaqueProductDimensions_OpaqueUnit_name = map[int32]string{ + 0: "OPAQUE_UNIT_UNSPECIFIED", + 1: "OPAQUE_UNIT_METRIC", + 2: "OPAQUE_UNIT_IMPERIAL", + } + OpaqueProduct_OpaqueProductDimensions_OpaqueUnit_value = map[string]int32{ + "OPAQUE_UNIT_UNSPECIFIED": 0, + "OPAQUE_UNIT_METRIC": 1, + "OPAQUE_UNIT_IMPERIAL": 2, + } +) + +func (x OpaqueProduct_OpaqueProductDimensions_OpaqueUnit) Enum() *OpaqueProduct_OpaqueProductDimensions_OpaqueUnit { + p := new(OpaqueProduct_OpaqueProductDimensions_OpaqueUnit) + *p = x + return p +} + +func (x OpaqueProduct_OpaqueProductDimensions_OpaqueUnit) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OpaqueProduct_OpaqueProductDimensions_OpaqueUnit) Descriptor() protoreflect.EnumDescriptor { + return file_examples_internal_proto_examplepb_opaque_proto_enumTypes[3].Descriptor() +} + +func (OpaqueProduct_OpaqueProductDimensions_OpaqueUnit) Type() protoreflect.EnumType { + return &file_examples_internal_proto_examplepb_opaque_proto_enumTypes[3] +} + +func (x OpaqueProduct_OpaqueProductDimensions_OpaqueUnit) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +type OpaqueCustomer_OpaqueCustomerStatus int32 + +const ( + OpaqueCustomer_OPAQUE_CUSTOMER_STATUS_UNSPECIFIED OpaqueCustomer_OpaqueCustomerStatus = 0 + OpaqueCustomer_OPAQUE_CUSTOMER_STATUS_ACTIVE OpaqueCustomer_OpaqueCustomerStatus = 1 + OpaqueCustomer_OPAQUE_CUSTOMER_STATUS_INACTIVE OpaqueCustomer_OpaqueCustomerStatus = 2 + OpaqueCustomer_OPAQUE_CUSTOMER_STATUS_SUSPENDED OpaqueCustomer_OpaqueCustomerStatus = 3 + OpaqueCustomer_OPAQUE_CUSTOMER_STATUS_DELETED OpaqueCustomer_OpaqueCustomerStatus = 4 +) + +// Enum value maps for OpaqueCustomer_OpaqueCustomerStatus. +var ( + OpaqueCustomer_OpaqueCustomerStatus_name = map[int32]string{ + 0: "OPAQUE_CUSTOMER_STATUS_UNSPECIFIED", + 1: "OPAQUE_CUSTOMER_STATUS_ACTIVE", + 2: "OPAQUE_CUSTOMER_STATUS_INACTIVE", + 3: "OPAQUE_CUSTOMER_STATUS_SUSPENDED", + 4: "OPAQUE_CUSTOMER_STATUS_DELETED", + } + OpaqueCustomer_OpaqueCustomerStatus_value = map[string]int32{ + "OPAQUE_CUSTOMER_STATUS_UNSPECIFIED": 0, + "OPAQUE_CUSTOMER_STATUS_ACTIVE": 1, + "OPAQUE_CUSTOMER_STATUS_INACTIVE": 2, + "OPAQUE_CUSTOMER_STATUS_SUSPENDED": 3, + "OPAQUE_CUSTOMER_STATUS_DELETED": 4, + } +) + +func (x OpaqueCustomer_OpaqueCustomerStatus) Enum() *OpaqueCustomer_OpaqueCustomerStatus { + p := new(OpaqueCustomer_OpaqueCustomerStatus) + *p = x + return p +} + +func (x OpaqueCustomer_OpaqueCustomerStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OpaqueCustomer_OpaqueCustomerStatus) Descriptor() protoreflect.EnumDescriptor { + return file_examples_internal_proto_examplepb_opaque_proto_enumTypes[4].Descriptor() +} + +func (OpaqueCustomer_OpaqueCustomerStatus) Type() protoreflect.EnumType { + return &file_examples_internal_proto_examplepb_opaque_proto_enumTypes[4] +} + +func (x OpaqueCustomer_OpaqueCustomerStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +type OpaqueOrder_OpaqueOrderStatus int32 + +const ( + OpaqueOrder_OPAQUE_ORDER_STATUS_UNSPECIFIED OpaqueOrder_OpaqueOrderStatus = 0 + OpaqueOrder_OPAQUE_ORDER_STATUS_PENDING OpaqueOrder_OpaqueOrderStatus = 1 + OpaqueOrder_OPAQUE_ORDER_STATUS_PROCESSING OpaqueOrder_OpaqueOrderStatus = 2 + OpaqueOrder_OPAQUE_ORDER_STATUS_SHIPPED OpaqueOrder_OpaqueOrderStatus = 3 + OpaqueOrder_OPAQUE_ORDER_STATUS_DELIVERED OpaqueOrder_OpaqueOrderStatus = 4 + OpaqueOrder_OPAQUE_ORDER_STATUS_CANCELLED OpaqueOrder_OpaqueOrderStatus = 5 + OpaqueOrder_OPAQUE_ORDER_STATUS_RETURNED OpaqueOrder_OpaqueOrderStatus = 6 +) + +// Enum value maps for OpaqueOrder_OpaqueOrderStatus. +var ( + OpaqueOrder_OpaqueOrderStatus_name = map[int32]string{ + 0: "OPAQUE_ORDER_STATUS_UNSPECIFIED", + 1: "OPAQUE_ORDER_STATUS_PENDING", + 2: "OPAQUE_ORDER_STATUS_PROCESSING", + 3: "OPAQUE_ORDER_STATUS_SHIPPED", + 4: "OPAQUE_ORDER_STATUS_DELIVERED", + 5: "OPAQUE_ORDER_STATUS_CANCELLED", + 6: "OPAQUE_ORDER_STATUS_RETURNED", + } + OpaqueOrder_OpaqueOrderStatus_value = map[string]int32{ + "OPAQUE_ORDER_STATUS_UNSPECIFIED": 0, + "OPAQUE_ORDER_STATUS_PENDING": 1, + "OPAQUE_ORDER_STATUS_PROCESSING": 2, + "OPAQUE_ORDER_STATUS_SHIPPED": 3, + "OPAQUE_ORDER_STATUS_DELIVERED": 4, + "OPAQUE_ORDER_STATUS_CANCELLED": 5, + "OPAQUE_ORDER_STATUS_RETURNED": 6, + } +) + +func (x OpaqueOrder_OpaqueOrderStatus) Enum() *OpaqueOrder_OpaqueOrderStatus { + p := new(OpaqueOrder_OpaqueOrderStatus) + *p = x + return p +} + +func (x OpaqueOrder_OpaqueOrderStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OpaqueOrder_OpaqueOrderStatus) Descriptor() protoreflect.EnumDescriptor { + return file_examples_internal_proto_examplepb_opaque_proto_enumTypes[5].Descriptor() +} + +func (OpaqueOrder_OpaqueOrderStatus) Type() protoreflect.EnumType { + return &file_examples_internal_proto_examplepb_opaque_proto_enumTypes[5] +} + +func (x OpaqueOrder_OpaqueOrderStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +type OpaqueCustomerEvent_OpaqueEventType int32 + +const ( + OpaqueCustomerEvent_OPAQUE_EVENT_TYPE_UNSPECIFIED OpaqueCustomerEvent_OpaqueEventType = 0 + OpaqueCustomerEvent_OPAQUE_EVENT_TYPE_PAGE_VIEW OpaqueCustomerEvent_OpaqueEventType = 1 + OpaqueCustomerEvent_OPAQUE_EVENT_TYPE_PRODUCT_VIEW OpaqueCustomerEvent_OpaqueEventType = 2 + OpaqueCustomerEvent_OPAQUE_EVENT_TYPE_ADD_TO_CART OpaqueCustomerEvent_OpaqueEventType = 3 + OpaqueCustomerEvent_OPAQUE_EVENT_TYPE_REMOVE_FROM_CART OpaqueCustomerEvent_OpaqueEventType = 4 + OpaqueCustomerEvent_OPAQUE_EVENT_TYPE_CHECKOUT_START OpaqueCustomerEvent_OpaqueEventType = 5 + OpaqueCustomerEvent_OPAQUE_EVENT_TYPE_CHECKOUT_COMPLETE OpaqueCustomerEvent_OpaqueEventType = 6 + OpaqueCustomerEvent_OPAQUE_EVENT_TYPE_SEARCH OpaqueCustomerEvent_OpaqueEventType = 7 + OpaqueCustomerEvent_OPAQUE_EVENT_TYPE_ACCOUNT_UPDATE OpaqueCustomerEvent_OpaqueEventType = 8 +) + +// Enum value maps for OpaqueCustomerEvent_OpaqueEventType. +var ( + OpaqueCustomerEvent_OpaqueEventType_name = map[int32]string{ + 0: "OPAQUE_EVENT_TYPE_UNSPECIFIED", + 1: "OPAQUE_EVENT_TYPE_PAGE_VIEW", + 2: "OPAQUE_EVENT_TYPE_PRODUCT_VIEW", + 3: "OPAQUE_EVENT_TYPE_ADD_TO_CART", + 4: "OPAQUE_EVENT_TYPE_REMOVE_FROM_CART", + 5: "OPAQUE_EVENT_TYPE_CHECKOUT_START", + 6: "OPAQUE_EVENT_TYPE_CHECKOUT_COMPLETE", + 7: "OPAQUE_EVENT_TYPE_SEARCH", + 8: "OPAQUE_EVENT_TYPE_ACCOUNT_UPDATE", + } + OpaqueCustomerEvent_OpaqueEventType_value = map[string]int32{ + "OPAQUE_EVENT_TYPE_UNSPECIFIED": 0, + "OPAQUE_EVENT_TYPE_PAGE_VIEW": 1, + "OPAQUE_EVENT_TYPE_PRODUCT_VIEW": 2, + "OPAQUE_EVENT_TYPE_ADD_TO_CART": 3, + "OPAQUE_EVENT_TYPE_REMOVE_FROM_CART": 4, + "OPAQUE_EVENT_TYPE_CHECKOUT_START": 5, + "OPAQUE_EVENT_TYPE_CHECKOUT_COMPLETE": 6, + "OPAQUE_EVENT_TYPE_SEARCH": 7, + "OPAQUE_EVENT_TYPE_ACCOUNT_UPDATE": 8, + } +) + +func (x OpaqueCustomerEvent_OpaqueEventType) Enum() *OpaqueCustomerEvent_OpaqueEventType { + p := new(OpaqueCustomerEvent_OpaqueEventType) + *p = x + return p +} + +func (x OpaqueCustomerEvent_OpaqueEventType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OpaqueCustomerEvent_OpaqueEventType) Descriptor() protoreflect.EnumDescriptor { + return file_examples_internal_proto_examplepb_opaque_proto_enumTypes[6].Descriptor() +} + +func (OpaqueCustomerEvent_OpaqueEventType) Type() protoreflect.EnumType { + return &file_examples_internal_proto_examplepb_opaque_proto_enumTypes[6] +} + +func (x OpaqueCustomerEvent_OpaqueEventType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +type OpaqueActivityUpdate_OpaqueUpdateType int32 + +const ( + OpaqueActivityUpdate_OPAQUE_UPDATE_TYPE_UNSPECIFIED OpaqueActivityUpdate_OpaqueUpdateType = 0 + OpaqueActivityUpdate_OPAQUE_UPDATE_TYPE_RECOMMENDATION OpaqueActivityUpdate_OpaqueUpdateType = 1 + OpaqueActivityUpdate_OPAQUE_UPDATE_TYPE_NOTIFICATION OpaqueActivityUpdate_OpaqueUpdateType = 2 + OpaqueActivityUpdate_OPAQUE_UPDATE_TYPE_OFFER OpaqueActivityUpdate_OpaqueUpdateType = 3 + OpaqueActivityUpdate_OPAQUE_UPDATE_TYPE_INVENTORY_UPDATE OpaqueActivityUpdate_OpaqueUpdateType = 4 + OpaqueActivityUpdate_OPAQUE_UPDATE_TYPE_PRICE_CHANGE OpaqueActivityUpdate_OpaqueUpdateType = 5 + OpaqueActivityUpdate_OPAQUE_UPDATE_TYPE_CART_REMINDER OpaqueActivityUpdate_OpaqueUpdateType = 6 +) + +// Enum value maps for OpaqueActivityUpdate_OpaqueUpdateType. +var ( + OpaqueActivityUpdate_OpaqueUpdateType_name = map[int32]string{ + 0: "OPAQUE_UPDATE_TYPE_UNSPECIFIED", + 1: "OPAQUE_UPDATE_TYPE_RECOMMENDATION", + 2: "OPAQUE_UPDATE_TYPE_NOTIFICATION", + 3: "OPAQUE_UPDATE_TYPE_OFFER", + 4: "OPAQUE_UPDATE_TYPE_INVENTORY_UPDATE", + 5: "OPAQUE_UPDATE_TYPE_PRICE_CHANGE", + 6: "OPAQUE_UPDATE_TYPE_CART_REMINDER", + } + OpaqueActivityUpdate_OpaqueUpdateType_value = map[string]int32{ + "OPAQUE_UPDATE_TYPE_UNSPECIFIED": 0, + "OPAQUE_UPDATE_TYPE_RECOMMENDATION": 1, + "OPAQUE_UPDATE_TYPE_NOTIFICATION": 2, + "OPAQUE_UPDATE_TYPE_OFFER": 3, + "OPAQUE_UPDATE_TYPE_INVENTORY_UPDATE": 4, + "OPAQUE_UPDATE_TYPE_PRICE_CHANGE": 5, + "OPAQUE_UPDATE_TYPE_CART_REMINDER": 6, + } +) + +func (x OpaqueActivityUpdate_OpaqueUpdateType) Enum() *OpaqueActivityUpdate_OpaqueUpdateType { + p := new(OpaqueActivityUpdate_OpaqueUpdateType) + *p = x + return p +} + +func (x OpaqueActivityUpdate_OpaqueUpdateType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OpaqueActivityUpdate_OpaqueUpdateType) Descriptor() protoreflect.EnumDescriptor { + return file_examples_internal_proto_examplepb_opaque_proto_enumTypes[7].Descriptor() +} + +func (OpaqueActivityUpdate_OpaqueUpdateType) Type() protoreflect.EnumType { + return &file_examples_internal_proto_examplepb_opaque_proto_enumTypes[7] +} + +func (x OpaqueActivityUpdate_OpaqueUpdateType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// OpaqueGetProductRequest represents a request for product information +type OpaqueGetProductRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_ProductId *string `protobuf:"bytes,1,opt,name=product_id,json=productId"` + xxx_hidden_IncludeVariants bool `protobuf:"varint,2,opt,name=include_variants,json=includeVariants"` + xxx_hidden_IncludeRelatedProducts bool `protobuf:"varint,3,opt,name=include_related_products,json=includeRelatedProducts"` + xxx_hidden_LanguageCode *string `protobuf:"bytes,4,opt,name=language_code,json=languageCode"` + xxx_hidden_CurrencyCode *string `protobuf:"bytes,5,opt,name=currency_code,json=currencyCode"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueGetProductRequest) Reset() { + *x = OpaqueGetProductRequest{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueGetProductRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueGetProductRequest) ProtoMessage() {} + +func (x *OpaqueGetProductRequest) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueGetProductRequest) GetProductId() string { + if x != nil { + if x.xxx_hidden_ProductId != nil { + return *x.xxx_hidden_ProductId + } + return "" + } + return "" +} + +func (x *OpaqueGetProductRequest) GetIncludeVariants() bool { + if x != nil { + return x.xxx_hidden_IncludeVariants + } + return false +} + +func (x *OpaqueGetProductRequest) GetIncludeRelatedProducts() bool { + if x != nil { + return x.xxx_hidden_IncludeRelatedProducts + } + return false +} + +func (x *OpaqueGetProductRequest) GetLanguageCode() string { + if x != nil { + if x.xxx_hidden_LanguageCode != nil { + return *x.xxx_hidden_LanguageCode + } + return "" + } + return "" +} + +func (x *OpaqueGetProductRequest) GetCurrencyCode() string { + if x != nil { + if x.xxx_hidden_CurrencyCode != nil { + return *x.xxx_hidden_CurrencyCode + } + return "" + } + return "" +} + +func (x *OpaqueGetProductRequest) SetProductId(v string) { + x.xxx_hidden_ProductId = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 5) +} + +func (x *OpaqueGetProductRequest) SetIncludeVariants(v bool) { + x.xxx_hidden_IncludeVariants = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 5) +} + +func (x *OpaqueGetProductRequest) SetIncludeRelatedProducts(v bool) { + x.xxx_hidden_IncludeRelatedProducts = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 5) +} + +func (x *OpaqueGetProductRequest) SetLanguageCode(v string) { + x.xxx_hidden_LanguageCode = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 5) +} + +func (x *OpaqueGetProductRequest) SetCurrencyCode(v string) { + x.xxx_hidden_CurrencyCode = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 4, 5) +} + +func (x *OpaqueGetProductRequest) HasProductId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *OpaqueGetProductRequest) HasIncludeVariants() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *OpaqueGetProductRequest) HasIncludeRelatedProducts() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *OpaqueGetProductRequest) HasLanguageCode() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *OpaqueGetProductRequest) HasCurrencyCode() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 4) +} + +func (x *OpaqueGetProductRequest) ClearProductId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_ProductId = nil +} + +func (x *OpaqueGetProductRequest) ClearIncludeVariants() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_IncludeVariants = false +} + +func (x *OpaqueGetProductRequest) ClearIncludeRelatedProducts() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_IncludeRelatedProducts = false +} + +func (x *OpaqueGetProductRequest) ClearLanguageCode() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_LanguageCode = nil +} + +func (x *OpaqueGetProductRequest) ClearCurrencyCode() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 4) + x.xxx_hidden_CurrencyCode = nil +} + +type OpaqueGetProductRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + ProductId *string + IncludeVariants *bool + IncludeRelatedProducts *bool + LanguageCode *string + CurrencyCode *string +} + +func (b0 OpaqueGetProductRequest_builder) Build() *OpaqueGetProductRequest { + m0 := &OpaqueGetProductRequest{} + b, x := &b0, m0 + _, _ = b, x + if b.ProductId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 5) + x.xxx_hidden_ProductId = b.ProductId + } + if b.IncludeVariants != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 5) + x.xxx_hidden_IncludeVariants = *b.IncludeVariants + } + if b.IncludeRelatedProducts != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 5) + x.xxx_hidden_IncludeRelatedProducts = *b.IncludeRelatedProducts + } + if b.LanguageCode != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 5) + x.xxx_hidden_LanguageCode = b.LanguageCode + } + if b.CurrencyCode != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 4, 5) + x.xxx_hidden_CurrencyCode = b.CurrencyCode + } + return m0 +} + +// OpaqueGetProductResponse represents a response with product information +type OpaqueGetProductResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Product *OpaqueProduct `protobuf:"bytes,1,opt,name=product"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueGetProductResponse) Reset() { + *x = OpaqueGetProductResponse{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueGetProductResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueGetProductResponse) ProtoMessage() {} + +func (x *OpaqueGetProductResponse) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueGetProductResponse) GetProduct() *OpaqueProduct { + if x != nil { + return x.xxx_hidden_Product + } + return nil +} + +func (x *OpaqueGetProductResponse) SetProduct(v *OpaqueProduct) { + x.xxx_hidden_Product = v +} + +func (x *OpaqueGetProductResponse) HasProduct() bool { + if x == nil { + return false + } + return x.xxx_hidden_Product != nil +} + +func (x *OpaqueGetProductResponse) ClearProduct() { + x.xxx_hidden_Product = nil +} + +type OpaqueGetProductResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Product *OpaqueProduct +} + +func (b0 OpaqueGetProductResponse_builder) Build() *OpaqueGetProductResponse { + m0 := &OpaqueGetProductResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Product = b.Product + return m0 +} + +// OpaqueSearchProductsRequest represents a product search request +type OpaqueSearchProductsRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Query *string `protobuf:"bytes,1,opt,name=query"` + xxx_hidden_CategoryIds []string `protobuf:"bytes,2,rep,name=category_ids,json=categoryIds"` + xxx_hidden_Brands []string `protobuf:"bytes,3,rep,name=brands"` + xxx_hidden_MinPrice *OpaquePrice `protobuf:"bytes,4,opt,name=min_price,json=minPrice"` + xxx_hidden_MaxPrice *OpaquePrice `protobuf:"bytes,5,opt,name=max_price,json=maxPrice"` + xxx_hidden_Tags []string `protobuf:"bytes,6,rep,name=tags"` + xxx_hidden_SortBy OpaqueSearchProductsRequest_OpaqueSortOrder `protobuf:"varint,7,opt,name=sort_by,json=sortBy,enum=grpc.gateway.examples.internal.proto.examplepb.OpaqueSearchProductsRequest_OpaqueSortOrder"` + xxx_hidden_Page int32 `protobuf:"varint,8,opt,name=page"` + xxx_hidden_PageSize int32 `protobuf:"varint,9,opt,name=page_size,json=pageSize"` + xxx_hidden_LanguageCode *string `protobuf:"bytes,10,opt,name=language_code,json=languageCode"` + xxx_hidden_CurrencyCode *string `protobuf:"bytes,11,opt,name=currency_code,json=currencyCode"` + xxx_hidden_FieldMask *fieldmaskpb.FieldMask `protobuf:"bytes,12,opt,name=field_mask,json=fieldMask"` + xxx_hidden_Filters map[string]string `protobuf:"bytes,13,rep,name=filters" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueSearchProductsRequest) Reset() { + *x = OpaqueSearchProductsRequest{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueSearchProductsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueSearchProductsRequest) ProtoMessage() {} + +func (x *OpaqueSearchProductsRequest) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueSearchProductsRequest) GetQuery() string { + if x != nil { + if x.xxx_hidden_Query != nil { + return *x.xxx_hidden_Query + } + return "" + } + return "" +} + +func (x *OpaqueSearchProductsRequest) GetCategoryIds() []string { + if x != nil { + return x.xxx_hidden_CategoryIds + } + return nil +} + +func (x *OpaqueSearchProductsRequest) GetBrands() []string { + if x != nil { + return x.xxx_hidden_Brands + } + return nil +} + +func (x *OpaqueSearchProductsRequest) GetMinPrice() *OpaquePrice { + if x != nil { + return x.xxx_hidden_MinPrice + } + return nil +} + +func (x *OpaqueSearchProductsRequest) GetMaxPrice() *OpaquePrice { + if x != nil { + return x.xxx_hidden_MaxPrice + } + return nil +} + +func (x *OpaqueSearchProductsRequest) GetTags() []string { + if x != nil { + return x.xxx_hidden_Tags + } + return nil +} + +func (x *OpaqueSearchProductsRequest) GetSortBy() OpaqueSearchProductsRequest_OpaqueSortOrder { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 6) { + return x.xxx_hidden_SortBy + } + } + return OpaqueSearchProductsRequest_OPAQUE_SORT_ORDER_UNSPECIFIED +} + +func (x *OpaqueSearchProductsRequest) GetPage() int32 { + if x != nil { + return x.xxx_hidden_Page + } + return 0 +} + +func (x *OpaqueSearchProductsRequest) GetPageSize() int32 { + if x != nil { + return x.xxx_hidden_PageSize + } + return 0 +} + +func (x *OpaqueSearchProductsRequest) GetLanguageCode() string { + if x != nil { + if x.xxx_hidden_LanguageCode != nil { + return *x.xxx_hidden_LanguageCode + } + return "" + } + return "" +} + +func (x *OpaqueSearchProductsRequest) GetCurrencyCode() string { + if x != nil { + if x.xxx_hidden_CurrencyCode != nil { + return *x.xxx_hidden_CurrencyCode + } + return "" + } + return "" +} + +func (x *OpaqueSearchProductsRequest) GetFieldMask() *fieldmaskpb.FieldMask { + if x != nil { + return x.xxx_hidden_FieldMask + } + return nil +} + +func (x *OpaqueSearchProductsRequest) GetFilters() map[string]string { + if x != nil { + return x.xxx_hidden_Filters + } + return nil +} + +func (x *OpaqueSearchProductsRequest) SetQuery(v string) { + x.xxx_hidden_Query = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 13) +} + +func (x *OpaqueSearchProductsRequest) SetCategoryIds(v []string) { + x.xxx_hidden_CategoryIds = v +} + +func (x *OpaqueSearchProductsRequest) SetBrands(v []string) { + x.xxx_hidden_Brands = v +} + +func (x *OpaqueSearchProductsRequest) SetMinPrice(v *OpaquePrice) { + x.xxx_hidden_MinPrice = v +} + +func (x *OpaqueSearchProductsRequest) SetMaxPrice(v *OpaquePrice) { + x.xxx_hidden_MaxPrice = v +} + +func (x *OpaqueSearchProductsRequest) SetTags(v []string) { + x.xxx_hidden_Tags = v +} + +func (x *OpaqueSearchProductsRequest) SetSortBy(v OpaqueSearchProductsRequest_OpaqueSortOrder) { + x.xxx_hidden_SortBy = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 6, 13) +} + +func (x *OpaqueSearchProductsRequest) SetPage(v int32) { + x.xxx_hidden_Page = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 7, 13) +} + +func (x *OpaqueSearchProductsRequest) SetPageSize(v int32) { + x.xxx_hidden_PageSize = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 8, 13) +} + +func (x *OpaqueSearchProductsRequest) SetLanguageCode(v string) { + x.xxx_hidden_LanguageCode = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 9, 13) +} + +func (x *OpaqueSearchProductsRequest) SetCurrencyCode(v string) { + x.xxx_hidden_CurrencyCode = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 10, 13) +} + +func (x *OpaqueSearchProductsRequest) SetFieldMask(v *fieldmaskpb.FieldMask) { + x.xxx_hidden_FieldMask = v +} + +func (x *OpaqueSearchProductsRequest) SetFilters(v map[string]string) { + x.xxx_hidden_Filters = v +} + +func (x *OpaqueSearchProductsRequest) HasQuery() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *OpaqueSearchProductsRequest) HasMinPrice() bool { + if x == nil { + return false + } + return x.xxx_hidden_MinPrice != nil +} + +func (x *OpaqueSearchProductsRequest) HasMaxPrice() bool { + if x == nil { + return false + } + return x.xxx_hidden_MaxPrice != nil +} + +func (x *OpaqueSearchProductsRequest) HasSortBy() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 6) +} + +func (x *OpaqueSearchProductsRequest) HasPage() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 7) +} + +func (x *OpaqueSearchProductsRequest) HasPageSize() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 8) +} + +func (x *OpaqueSearchProductsRequest) HasLanguageCode() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 9) +} + +func (x *OpaqueSearchProductsRequest) HasCurrencyCode() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 10) +} + +func (x *OpaqueSearchProductsRequest) HasFieldMask() bool { + if x == nil { + return false + } + return x.xxx_hidden_FieldMask != nil +} + +func (x *OpaqueSearchProductsRequest) ClearQuery() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Query = nil +} + +func (x *OpaqueSearchProductsRequest) ClearMinPrice() { + x.xxx_hidden_MinPrice = nil +} + +func (x *OpaqueSearchProductsRequest) ClearMaxPrice() { + x.xxx_hidden_MaxPrice = nil +} + +func (x *OpaqueSearchProductsRequest) ClearSortBy() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 6) + x.xxx_hidden_SortBy = OpaqueSearchProductsRequest_OPAQUE_SORT_ORDER_UNSPECIFIED +} + +func (x *OpaqueSearchProductsRequest) ClearPage() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 7) + x.xxx_hidden_Page = 0 +} + +func (x *OpaqueSearchProductsRequest) ClearPageSize() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 8) + x.xxx_hidden_PageSize = 0 +} + +func (x *OpaqueSearchProductsRequest) ClearLanguageCode() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 9) + x.xxx_hidden_LanguageCode = nil +} + +func (x *OpaqueSearchProductsRequest) ClearCurrencyCode() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 10) + x.xxx_hidden_CurrencyCode = nil +} + +func (x *OpaqueSearchProductsRequest) ClearFieldMask() { + x.xxx_hidden_FieldMask = nil +} + +type OpaqueSearchProductsRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Query *string + CategoryIds []string + Brands []string + MinPrice *OpaquePrice + MaxPrice *OpaquePrice + Tags []string + SortBy *OpaqueSearchProductsRequest_OpaqueSortOrder + Page *int32 + PageSize *int32 + LanguageCode *string + CurrencyCode *string + FieldMask *fieldmaskpb.FieldMask + Filters map[string]string +} + +func (b0 OpaqueSearchProductsRequest_builder) Build() *OpaqueSearchProductsRequest { + m0 := &OpaqueSearchProductsRequest{} + b, x := &b0, m0 + _, _ = b, x + if b.Query != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 13) + x.xxx_hidden_Query = b.Query + } + x.xxx_hidden_CategoryIds = b.CategoryIds + x.xxx_hidden_Brands = b.Brands + x.xxx_hidden_MinPrice = b.MinPrice + x.xxx_hidden_MaxPrice = b.MaxPrice + x.xxx_hidden_Tags = b.Tags + if b.SortBy != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 6, 13) + x.xxx_hidden_SortBy = *b.SortBy + } + if b.Page != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 7, 13) + x.xxx_hidden_Page = *b.Page + } + if b.PageSize != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 8, 13) + x.xxx_hidden_PageSize = *b.PageSize + } + if b.LanguageCode != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 9, 13) + x.xxx_hidden_LanguageCode = b.LanguageCode + } + if b.CurrencyCode != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 10, 13) + x.xxx_hidden_CurrencyCode = b.CurrencyCode + } + x.xxx_hidden_FieldMask = b.FieldMask + x.xxx_hidden_Filters = b.Filters + return m0 +} + +// OpaqueSearchProductsResponse represents a single product in search results +type OpaqueSearchProductsResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Product *OpaqueProduct `protobuf:"bytes,1,opt,name=product"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueSearchProductsResponse) Reset() { + *x = OpaqueSearchProductsResponse{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueSearchProductsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueSearchProductsResponse) ProtoMessage() {} + +func (x *OpaqueSearchProductsResponse) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueSearchProductsResponse) GetProduct() *OpaqueProduct { + if x != nil { + return x.xxx_hidden_Product + } + return nil +} + +func (x *OpaqueSearchProductsResponse) SetProduct(v *OpaqueProduct) { + x.xxx_hidden_Product = v +} + +func (x *OpaqueSearchProductsResponse) HasProduct() bool { + if x == nil { + return false + } + return x.xxx_hidden_Product != nil +} + +func (x *OpaqueSearchProductsResponse) ClearProduct() { + x.xxx_hidden_Product = nil +} + +type OpaqueSearchProductsResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Product *OpaqueProduct +} + +func (b0 OpaqueSearchProductsResponse_builder) Build() *OpaqueSearchProductsResponse { + m0 := &OpaqueSearchProductsResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Product = b.Product + return m0 +} + +// OpaqueProcessOrdersRequest represents a request to process order +type OpaqueProcessOrdersRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Order *OpaqueOrder `protobuf:"bytes,1,opt,name=order"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueProcessOrdersRequest) Reset() { + *x = OpaqueProcessOrdersRequest{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueProcessOrdersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueProcessOrdersRequest) ProtoMessage() {} + +func (x *OpaqueProcessOrdersRequest) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueProcessOrdersRequest) GetOrder() *OpaqueOrder { + if x != nil { + return x.xxx_hidden_Order + } + return nil +} + +func (x *OpaqueProcessOrdersRequest) SetOrder(v *OpaqueOrder) { + x.xxx_hidden_Order = v +} + +func (x *OpaqueProcessOrdersRequest) HasOrder() bool { + if x == nil { + return false + } + return x.xxx_hidden_Order != nil +} + +func (x *OpaqueProcessOrdersRequest) ClearOrder() { + x.xxx_hidden_Order = nil +} + +type OpaqueProcessOrdersRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Order *OpaqueOrder +} + +func (b0 OpaqueProcessOrdersRequest_builder) Build() *OpaqueProcessOrdersRequest { + m0 := &OpaqueProcessOrdersRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Order = b.Order + return m0 +} + +// OpaqueProcessOrdersResponse represents orders processing result +type OpaqueProcessOrdersResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Summary *OpaqueOrderSummary `protobuf:"bytes,1,opt,name=summary"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueProcessOrdersResponse) Reset() { + *x = OpaqueProcessOrdersResponse{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueProcessOrdersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueProcessOrdersResponse) ProtoMessage() {} + +func (x *OpaqueProcessOrdersResponse) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueProcessOrdersResponse) GetSummary() *OpaqueOrderSummary { + if x != nil { + return x.xxx_hidden_Summary + } + return nil +} + +func (x *OpaqueProcessOrdersResponse) SetSummary(v *OpaqueOrderSummary) { + x.xxx_hidden_Summary = v +} + +func (x *OpaqueProcessOrdersResponse) HasSummary() bool { + if x == nil { + return false + } + return x.xxx_hidden_Summary != nil +} + +func (x *OpaqueProcessOrdersResponse) ClearSummary() { + x.xxx_hidden_Summary = nil +} + +type OpaqueProcessOrdersResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Summary *OpaqueOrderSummary +} + +func (b0 OpaqueProcessOrdersResponse_builder) Build() *OpaqueProcessOrdersResponse { + m0 := &OpaqueProcessOrdersResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Summary = b.Summary + return m0 +} + +// OpaqueStreamCustomerActivityRequest represents a report of user activity +type OpaqueStreamCustomerActivityRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Event *OpaqueCustomerEvent `protobuf:"bytes,1,opt,name=event"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueStreamCustomerActivityRequest) Reset() { + *x = OpaqueStreamCustomerActivityRequest{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueStreamCustomerActivityRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueStreamCustomerActivityRequest) ProtoMessage() {} + +func (x *OpaqueStreamCustomerActivityRequest) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueStreamCustomerActivityRequest) GetEvent() *OpaqueCustomerEvent { + if x != nil { + return x.xxx_hidden_Event + } + return nil +} + +func (x *OpaqueStreamCustomerActivityRequest) SetEvent(v *OpaqueCustomerEvent) { + x.xxx_hidden_Event = v +} + +func (x *OpaqueStreamCustomerActivityRequest) HasEvent() bool { + if x == nil { + return false + } + return x.xxx_hidden_Event != nil +} + +func (x *OpaqueStreamCustomerActivityRequest) ClearEvent() { + x.xxx_hidden_Event = nil +} + +type OpaqueStreamCustomerActivityRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Event *OpaqueCustomerEvent +} + +func (b0 OpaqueStreamCustomerActivityRequest_builder) Build() *OpaqueStreamCustomerActivityRequest { + m0 := &OpaqueStreamCustomerActivityRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Event = b.Event + return m0 +} + +// OpaqueStreamCustomerActivityRequest represents a report of server activity +type OpaqueStreamCustomerActivityResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Event *OpaqueActivityUpdate `protobuf:"bytes,2,opt,name=event"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueStreamCustomerActivityResponse) Reset() { + *x = OpaqueStreamCustomerActivityResponse{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueStreamCustomerActivityResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueStreamCustomerActivityResponse) ProtoMessage() {} + +func (x *OpaqueStreamCustomerActivityResponse) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueStreamCustomerActivityResponse) GetEvent() *OpaqueActivityUpdate { + if x != nil { + return x.xxx_hidden_Event + } + return nil +} + +func (x *OpaqueStreamCustomerActivityResponse) SetEvent(v *OpaqueActivityUpdate) { + x.xxx_hidden_Event = v +} + +func (x *OpaqueStreamCustomerActivityResponse) HasEvent() bool { + if x == nil { + return false + } + return x.xxx_hidden_Event != nil +} + +func (x *OpaqueStreamCustomerActivityResponse) ClearEvent() { + x.xxx_hidden_Event = nil +} + +type OpaqueStreamCustomerActivityResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Event *OpaqueActivityUpdate +} + +func (b0 OpaqueStreamCustomerActivityResponse_builder) Build() *OpaqueStreamCustomerActivityResponse { + m0 := &OpaqueStreamCustomerActivityResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Event = b.Event + return m0 +} + +// OpaqueAddress represents a physical address +type OpaqueAddress struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_StreetLine1 *string `protobuf:"bytes,1,opt,name=street_line1,json=streetLine1"` + xxx_hidden_StreetLine2 *string `protobuf:"bytes,2,opt,name=street_line2,json=streetLine2"` + xxx_hidden_City *string `protobuf:"bytes,3,opt,name=city"` + xxx_hidden_State *string `protobuf:"bytes,4,opt,name=state"` + xxx_hidden_Country *string `protobuf:"bytes,5,opt,name=country"` + xxx_hidden_PostalCode *string `protobuf:"bytes,6,opt,name=postal_code,json=postalCode"` + xxx_hidden_AddressType OpaqueAddress_OpaqueAddressType `protobuf:"varint,7,opt,name=address_type,json=addressType,enum=grpc.gateway.examples.internal.proto.examplepb.OpaqueAddress_OpaqueAddressType"` + xxx_hidden_IsDefault *wrapperspb.BoolValue `protobuf:"bytes,8,opt,name=is_default,json=isDefault"` + xxx_hidden_Metadata map[string]string `protobuf:"bytes,9,rep,name=metadata" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueAddress) Reset() { + *x = OpaqueAddress{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueAddress) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueAddress) ProtoMessage() {} + +func (x *OpaqueAddress) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueAddress) GetStreetLine1() string { + if x != nil { + if x.xxx_hidden_StreetLine1 != nil { + return *x.xxx_hidden_StreetLine1 + } + return "" + } + return "" +} + +func (x *OpaqueAddress) GetStreetLine2() string { + if x != nil { + if x.xxx_hidden_StreetLine2 != nil { + return *x.xxx_hidden_StreetLine2 + } + return "" + } + return "" +} + +func (x *OpaqueAddress) GetCity() string { + if x != nil { + if x.xxx_hidden_City != nil { + return *x.xxx_hidden_City + } + return "" + } + return "" +} + +func (x *OpaqueAddress) GetState() string { + if x != nil { + if x.xxx_hidden_State != nil { + return *x.xxx_hidden_State + } + return "" + } + return "" +} + +func (x *OpaqueAddress) GetCountry() string { + if x != nil { + if x.xxx_hidden_Country != nil { + return *x.xxx_hidden_Country + } + return "" + } + return "" +} + +func (x *OpaqueAddress) GetPostalCode() string { + if x != nil { + if x.xxx_hidden_PostalCode != nil { + return *x.xxx_hidden_PostalCode + } + return "" + } + return "" +} + +func (x *OpaqueAddress) GetAddressType() OpaqueAddress_OpaqueAddressType { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 6) { + return x.xxx_hidden_AddressType + } + } + return OpaqueAddress_OPAQUE_ADDRESS_TYPE_UNSPECIFIED +} + +func (x *OpaqueAddress) GetIsDefault() *wrapperspb.BoolValue { + if x != nil { + return x.xxx_hidden_IsDefault + } + return nil +} + +func (x *OpaqueAddress) GetMetadata() map[string]string { + if x != nil { + return x.xxx_hidden_Metadata + } + return nil +} + +func (x *OpaqueAddress) SetStreetLine1(v string) { + x.xxx_hidden_StreetLine1 = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 9) +} + +func (x *OpaqueAddress) SetStreetLine2(v string) { + x.xxx_hidden_StreetLine2 = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 9) +} + +func (x *OpaqueAddress) SetCity(v string) { + x.xxx_hidden_City = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 9) +} + +func (x *OpaqueAddress) SetState(v string) { + x.xxx_hidden_State = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 9) +} + +func (x *OpaqueAddress) SetCountry(v string) { + x.xxx_hidden_Country = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 4, 9) +} + +func (x *OpaqueAddress) SetPostalCode(v string) { + x.xxx_hidden_PostalCode = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 5, 9) +} + +func (x *OpaqueAddress) SetAddressType(v OpaqueAddress_OpaqueAddressType) { + x.xxx_hidden_AddressType = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 6, 9) +} + +func (x *OpaqueAddress) SetIsDefault(v *wrapperspb.BoolValue) { + x.xxx_hidden_IsDefault = v +} + +func (x *OpaqueAddress) SetMetadata(v map[string]string) { + x.xxx_hidden_Metadata = v +} + +func (x *OpaqueAddress) HasStreetLine1() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *OpaqueAddress) HasStreetLine2() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *OpaqueAddress) HasCity() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *OpaqueAddress) HasState() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *OpaqueAddress) HasCountry() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 4) +} + +func (x *OpaqueAddress) HasPostalCode() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 5) +} + +func (x *OpaqueAddress) HasAddressType() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 6) +} + +func (x *OpaqueAddress) HasIsDefault() bool { + if x == nil { + return false + } + return x.xxx_hidden_IsDefault != nil +} + +func (x *OpaqueAddress) ClearStreetLine1() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_StreetLine1 = nil +} + +func (x *OpaqueAddress) ClearStreetLine2() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_StreetLine2 = nil +} + +func (x *OpaqueAddress) ClearCity() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_City = nil +} + +func (x *OpaqueAddress) ClearState() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_State = nil +} + +func (x *OpaqueAddress) ClearCountry() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 4) + x.xxx_hidden_Country = nil +} + +func (x *OpaqueAddress) ClearPostalCode() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 5) + x.xxx_hidden_PostalCode = nil +} + +func (x *OpaqueAddress) ClearAddressType() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 6) + x.xxx_hidden_AddressType = OpaqueAddress_OPAQUE_ADDRESS_TYPE_UNSPECIFIED +} + +func (x *OpaqueAddress) ClearIsDefault() { + x.xxx_hidden_IsDefault = nil +} + +type OpaqueAddress_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + StreetLine1 *string + StreetLine2 *string + City *string + State *string + Country *string + PostalCode *string + AddressType *OpaqueAddress_OpaqueAddressType + IsDefault *wrapperspb.BoolValue + Metadata map[string]string +} + +func (b0 OpaqueAddress_builder) Build() *OpaqueAddress { + m0 := &OpaqueAddress{} + b, x := &b0, m0 + _, _ = b, x + if b.StreetLine1 != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 9) + x.xxx_hidden_StreetLine1 = b.StreetLine1 + } + if b.StreetLine2 != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 9) + x.xxx_hidden_StreetLine2 = b.StreetLine2 + } + if b.City != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 9) + x.xxx_hidden_City = b.City + } + if b.State != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 9) + x.xxx_hidden_State = b.State + } + if b.Country != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 4, 9) + x.xxx_hidden_Country = b.Country + } + if b.PostalCode != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 5, 9) + x.xxx_hidden_PostalCode = b.PostalCode + } + if b.AddressType != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 6, 9) + x.xxx_hidden_AddressType = *b.AddressType + } + x.xxx_hidden_IsDefault = b.IsDefault + x.xxx_hidden_Metadata = b.Metadata + return m0 +} + +// OpaquePrice represents a monetary value with currency +type OpaquePrice struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Amount float64 `protobuf:"fixed64,1,opt,name=amount"` + xxx_hidden_CurrencyCode *string `protobuf:"bytes,2,opt,name=currency_code,json=currencyCode"` + xxx_hidden_IsDiscounted bool `protobuf:"varint,3,opt,name=is_discounted,json=isDiscounted"` + xxx_hidden_OriginalAmount *wrapperspb.DoubleValue `protobuf:"bytes,4,opt,name=original_amount,json=originalAmount"` + xxx_hidden_PriceValidUntil *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=price_valid_until,json=priceValidUntil"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaquePrice) Reset() { + *x = OpaquePrice{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaquePrice) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaquePrice) ProtoMessage() {} + +func (x *OpaquePrice) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaquePrice) GetAmount() float64 { + if x != nil { + return x.xxx_hidden_Amount + } + return 0 +} + +func (x *OpaquePrice) GetCurrencyCode() string { + if x != nil { + if x.xxx_hidden_CurrencyCode != nil { + return *x.xxx_hidden_CurrencyCode + } + return "" + } + return "" +} + +func (x *OpaquePrice) GetIsDiscounted() bool { + if x != nil { + return x.xxx_hidden_IsDiscounted + } + return false +} + +func (x *OpaquePrice) GetOriginalAmount() *wrapperspb.DoubleValue { + if x != nil { + return x.xxx_hidden_OriginalAmount + } + return nil +} + +func (x *OpaquePrice) GetPriceValidUntil() *timestamppb.Timestamp { + if x != nil { + return x.xxx_hidden_PriceValidUntil + } + return nil +} + +func (x *OpaquePrice) SetAmount(v float64) { + x.xxx_hidden_Amount = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 5) +} + +func (x *OpaquePrice) SetCurrencyCode(v string) { + x.xxx_hidden_CurrencyCode = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 5) +} + +func (x *OpaquePrice) SetIsDiscounted(v bool) { + x.xxx_hidden_IsDiscounted = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 5) +} + +func (x *OpaquePrice) SetOriginalAmount(v *wrapperspb.DoubleValue) { + x.xxx_hidden_OriginalAmount = v +} + +func (x *OpaquePrice) SetPriceValidUntil(v *timestamppb.Timestamp) { + x.xxx_hidden_PriceValidUntil = v +} + +func (x *OpaquePrice) HasAmount() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *OpaquePrice) HasCurrencyCode() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *OpaquePrice) HasIsDiscounted() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *OpaquePrice) HasOriginalAmount() bool { + if x == nil { + return false + } + return x.xxx_hidden_OriginalAmount != nil +} + +func (x *OpaquePrice) HasPriceValidUntil() bool { + if x == nil { + return false + } + return x.xxx_hidden_PriceValidUntil != nil +} + +func (x *OpaquePrice) ClearAmount() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Amount = 0 +} + +func (x *OpaquePrice) ClearCurrencyCode() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_CurrencyCode = nil +} + +func (x *OpaquePrice) ClearIsDiscounted() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_IsDiscounted = false +} + +func (x *OpaquePrice) ClearOriginalAmount() { + x.xxx_hidden_OriginalAmount = nil +} + +func (x *OpaquePrice) ClearPriceValidUntil() { + x.xxx_hidden_PriceValidUntil = nil +} + +type OpaquePrice_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Amount *float64 + CurrencyCode *string + IsDiscounted *bool + OriginalAmount *wrapperspb.DoubleValue + PriceValidUntil *timestamppb.Timestamp +} + +func (b0 OpaquePrice_builder) Build() *OpaquePrice { + m0 := &OpaquePrice{} + b, x := &b0, m0 + _, _ = b, x + if b.Amount != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 5) + x.xxx_hidden_Amount = *b.Amount + } + if b.CurrencyCode != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 5) + x.xxx_hidden_CurrencyCode = b.CurrencyCode + } + if b.IsDiscounted != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 5) + x.xxx_hidden_IsDiscounted = *b.IsDiscounted + } + x.xxx_hidden_OriginalAmount = b.OriginalAmount + x.xxx_hidden_PriceValidUntil = b.PriceValidUntil + return m0 +} + +// OpaqueProductCategory represents a product category +type OpaqueProductCategory struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_CategoryId *string `protobuf:"bytes,1,opt,name=category_id,json=categoryId"` + xxx_hidden_Name *string `protobuf:"bytes,2,opt,name=name"` + xxx_hidden_Description *string `protobuf:"bytes,3,opt,name=description"` + xxx_hidden_ParentCategory *OpaqueProductCategory `protobuf:"bytes,4,opt,name=parent_category,json=parentCategory"` + xxx_hidden_Tags []string `protobuf:"bytes,5,rep,name=tags"` + xxx_hidden_CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt"` + xxx_hidden_UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueProductCategory) Reset() { + *x = OpaqueProductCategory{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueProductCategory) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueProductCategory) ProtoMessage() {} + +func (x *OpaqueProductCategory) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueProductCategory) GetCategoryId() string { + if x != nil { + if x.xxx_hidden_CategoryId != nil { + return *x.xxx_hidden_CategoryId + } + return "" + } + return "" +} + +func (x *OpaqueProductCategory) GetName() string { + if x != nil { + if x.xxx_hidden_Name != nil { + return *x.xxx_hidden_Name + } + return "" + } + return "" +} + +func (x *OpaqueProductCategory) GetDescription() string { + if x != nil { + if x.xxx_hidden_Description != nil { + return *x.xxx_hidden_Description + } + return "" + } + return "" +} + +func (x *OpaqueProductCategory) GetParentCategory() *OpaqueProductCategory { + if x != nil { + return x.xxx_hidden_ParentCategory + } + return nil +} + +func (x *OpaqueProductCategory) GetTags() []string { + if x != nil { + return x.xxx_hidden_Tags + } + return nil +} + +func (x *OpaqueProductCategory) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.xxx_hidden_CreatedAt + } + return nil +} + +func (x *OpaqueProductCategory) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.xxx_hidden_UpdatedAt + } + return nil +} + +func (x *OpaqueProductCategory) SetCategoryId(v string) { + x.xxx_hidden_CategoryId = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 7) +} + +func (x *OpaqueProductCategory) SetName(v string) { + x.xxx_hidden_Name = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 7) +} + +func (x *OpaqueProductCategory) SetDescription(v string) { + x.xxx_hidden_Description = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 7) +} + +func (x *OpaqueProductCategory) SetParentCategory(v *OpaqueProductCategory) { + x.xxx_hidden_ParentCategory = v +} + +func (x *OpaqueProductCategory) SetTags(v []string) { + x.xxx_hidden_Tags = v +} + +func (x *OpaqueProductCategory) SetCreatedAt(v *timestamppb.Timestamp) { + x.xxx_hidden_CreatedAt = v +} + +func (x *OpaqueProductCategory) SetUpdatedAt(v *timestamppb.Timestamp) { + x.xxx_hidden_UpdatedAt = v +} + +func (x *OpaqueProductCategory) HasCategoryId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *OpaqueProductCategory) HasName() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *OpaqueProductCategory) HasDescription() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *OpaqueProductCategory) HasParentCategory() bool { + if x == nil { + return false + } + return x.xxx_hidden_ParentCategory != nil +} + +func (x *OpaqueProductCategory) HasCreatedAt() bool { + if x == nil { + return false + } + return x.xxx_hidden_CreatedAt != nil +} + +func (x *OpaqueProductCategory) HasUpdatedAt() bool { + if x == nil { + return false + } + return x.xxx_hidden_UpdatedAt != nil +} + +func (x *OpaqueProductCategory) ClearCategoryId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_CategoryId = nil +} + +func (x *OpaqueProductCategory) ClearName() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Name = nil +} + +func (x *OpaqueProductCategory) ClearDescription() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Description = nil +} + +func (x *OpaqueProductCategory) ClearParentCategory() { + x.xxx_hidden_ParentCategory = nil +} + +func (x *OpaqueProductCategory) ClearCreatedAt() { + x.xxx_hidden_CreatedAt = nil +} + +func (x *OpaqueProductCategory) ClearUpdatedAt() { + x.xxx_hidden_UpdatedAt = nil +} + +type OpaqueProductCategory_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + CategoryId *string + Name *string + Description *string + ParentCategory *OpaqueProductCategory + Tags []string + CreatedAt *timestamppb.Timestamp + UpdatedAt *timestamppb.Timestamp +} + +func (b0 OpaqueProductCategory_builder) Build() *OpaqueProductCategory { + m0 := &OpaqueProductCategory{} + b, x := &b0, m0 + _, _ = b, x + if b.CategoryId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 7) + x.xxx_hidden_CategoryId = b.CategoryId + } + if b.Name != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 7) + x.xxx_hidden_Name = b.Name + } + if b.Description != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 7) + x.xxx_hidden_Description = b.Description + } + x.xxx_hidden_ParentCategory = b.ParentCategory + x.xxx_hidden_Tags = b.Tags + x.xxx_hidden_CreatedAt = b.CreatedAt + x.xxx_hidden_UpdatedAt = b.UpdatedAt + return m0 +} + +// OpaqueProductVariant represents a specific variant of a product +type OpaqueProductVariant struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_VariantId *string `protobuf:"bytes,1,opt,name=variant_id,json=variantId"` + xxx_hidden_Sku *string `protobuf:"bytes,2,opt,name=sku"` + xxx_hidden_Name *string `protobuf:"bytes,3,opt,name=name"` + xxx_hidden_Price *OpaquePrice `protobuf:"bytes,4,opt,name=price"` + xxx_hidden_InventoryCount int32 `protobuf:"varint,5,opt,name=inventory_count,json=inventoryCount"` + xxx_hidden_Attributes map[string]string `protobuf:"bytes,6,rep,name=attributes" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + xxx_hidden_ImageData []byte `protobuf:"bytes,7,opt,name=image_data,json=imageData"` + xxx_hidden_ImageUrls []string `protobuf:"bytes,8,rep,name=image_urls,json=imageUrls"` + xxx_hidden_IsAvailable *wrapperspb.BoolValue `protobuf:"bytes,9,opt,name=is_available,json=isAvailable"` + xxx_hidden_DiscountInfo isOpaqueProductVariant_DiscountInfo `protobuf_oneof:"discount_info"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueProductVariant) Reset() { + *x = OpaqueProductVariant{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueProductVariant) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueProductVariant) ProtoMessage() {} + +func (x *OpaqueProductVariant) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueProductVariant) GetVariantId() string { + if x != nil { + if x.xxx_hidden_VariantId != nil { + return *x.xxx_hidden_VariantId + } + return "" + } + return "" +} + +func (x *OpaqueProductVariant) GetSku() string { + if x != nil { + if x.xxx_hidden_Sku != nil { + return *x.xxx_hidden_Sku + } + return "" + } + return "" +} + +func (x *OpaqueProductVariant) GetName() string { + if x != nil { + if x.xxx_hidden_Name != nil { + return *x.xxx_hidden_Name + } + return "" + } + return "" +} + +func (x *OpaqueProductVariant) GetPrice() *OpaquePrice { + if x != nil { + return x.xxx_hidden_Price + } + return nil +} + +func (x *OpaqueProductVariant) GetInventoryCount() int32 { + if x != nil { + return x.xxx_hidden_InventoryCount + } + return 0 +} + +func (x *OpaqueProductVariant) GetAttributes() map[string]string { + if x != nil { + return x.xxx_hidden_Attributes + } + return nil +} + +func (x *OpaqueProductVariant) GetImageData() []byte { + if x != nil { + return x.xxx_hidden_ImageData + } + return nil +} + +func (x *OpaqueProductVariant) GetImageUrls() []string { + if x != nil { + return x.xxx_hidden_ImageUrls + } + return nil +} + +func (x *OpaqueProductVariant) GetIsAvailable() *wrapperspb.BoolValue { + if x != nil { + return x.xxx_hidden_IsAvailable + } + return nil +} + +func (x *OpaqueProductVariant) GetPercentageOff() float64 { + if x != nil { + if x, ok := x.xxx_hidden_DiscountInfo.(*opaqueProductVariant_PercentageOff); ok { + return x.PercentageOff + } + } + return 0 +} + +func (x *OpaqueProductVariant) GetFixedAmountOff() float64 { + if x != nil { + if x, ok := x.xxx_hidden_DiscountInfo.(*opaqueProductVariant_FixedAmountOff); ok { + return x.FixedAmountOff + } + } + return 0 +} + +func (x *OpaqueProductVariant) SetVariantId(v string) { + x.xxx_hidden_VariantId = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 10) +} + +func (x *OpaqueProductVariant) SetSku(v string) { + x.xxx_hidden_Sku = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 10) +} + +func (x *OpaqueProductVariant) SetName(v string) { + x.xxx_hidden_Name = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 10) +} + +func (x *OpaqueProductVariant) SetPrice(v *OpaquePrice) { + x.xxx_hidden_Price = v +} + +func (x *OpaqueProductVariant) SetInventoryCount(v int32) { + x.xxx_hidden_InventoryCount = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 4, 10) +} + +func (x *OpaqueProductVariant) SetAttributes(v map[string]string) { + x.xxx_hidden_Attributes = v +} + +func (x *OpaqueProductVariant) SetImageData(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_ImageData = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 6, 10) +} + +func (x *OpaqueProductVariant) SetImageUrls(v []string) { + x.xxx_hidden_ImageUrls = v +} + +func (x *OpaqueProductVariant) SetIsAvailable(v *wrapperspb.BoolValue) { + x.xxx_hidden_IsAvailable = v +} + +func (x *OpaqueProductVariant) SetPercentageOff(v float64) { + x.xxx_hidden_DiscountInfo = &opaqueProductVariant_PercentageOff{v} +} + +func (x *OpaqueProductVariant) SetFixedAmountOff(v float64) { + x.xxx_hidden_DiscountInfo = &opaqueProductVariant_FixedAmountOff{v} +} + +func (x *OpaqueProductVariant) HasVariantId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *OpaqueProductVariant) HasSku() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *OpaqueProductVariant) HasName() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *OpaqueProductVariant) HasPrice() bool { + if x == nil { + return false + } + return x.xxx_hidden_Price != nil +} + +func (x *OpaqueProductVariant) HasInventoryCount() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 4) +} + +func (x *OpaqueProductVariant) HasImageData() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 6) +} + +func (x *OpaqueProductVariant) HasIsAvailable() bool { + if x == nil { + return false + } + return x.xxx_hidden_IsAvailable != nil +} + +func (x *OpaqueProductVariant) HasDiscountInfo() bool { + if x == nil { + return false + } + return x.xxx_hidden_DiscountInfo != nil +} + +func (x *OpaqueProductVariant) HasPercentageOff() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_DiscountInfo.(*opaqueProductVariant_PercentageOff) + return ok +} + +func (x *OpaqueProductVariant) HasFixedAmountOff() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_DiscountInfo.(*opaqueProductVariant_FixedAmountOff) + return ok +} + +func (x *OpaqueProductVariant) ClearVariantId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_VariantId = nil +} + +func (x *OpaqueProductVariant) ClearSku() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Sku = nil +} + +func (x *OpaqueProductVariant) ClearName() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Name = nil +} + +func (x *OpaqueProductVariant) ClearPrice() { + x.xxx_hidden_Price = nil +} + +func (x *OpaqueProductVariant) ClearInventoryCount() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 4) + x.xxx_hidden_InventoryCount = 0 +} + +func (x *OpaqueProductVariant) ClearImageData() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 6) + x.xxx_hidden_ImageData = nil +} + +func (x *OpaqueProductVariant) ClearIsAvailable() { + x.xxx_hidden_IsAvailable = nil +} + +func (x *OpaqueProductVariant) ClearDiscountInfo() { + x.xxx_hidden_DiscountInfo = nil +} + +func (x *OpaqueProductVariant) ClearPercentageOff() { + if _, ok := x.xxx_hidden_DiscountInfo.(*opaqueProductVariant_PercentageOff); ok { + x.xxx_hidden_DiscountInfo = nil + } +} + +func (x *OpaqueProductVariant) ClearFixedAmountOff() { + if _, ok := x.xxx_hidden_DiscountInfo.(*opaqueProductVariant_FixedAmountOff); ok { + x.xxx_hidden_DiscountInfo = nil + } +} + +const OpaqueProductVariant_DiscountInfo_not_set_case case_OpaqueProductVariant_DiscountInfo = 0 +const OpaqueProductVariant_PercentageOff_case case_OpaqueProductVariant_DiscountInfo = 10 +const OpaqueProductVariant_FixedAmountOff_case case_OpaqueProductVariant_DiscountInfo = 11 + +func (x *OpaqueProductVariant) WhichDiscountInfo() case_OpaqueProductVariant_DiscountInfo { + if x == nil { + return OpaqueProductVariant_DiscountInfo_not_set_case + } + switch x.xxx_hidden_DiscountInfo.(type) { + case *opaqueProductVariant_PercentageOff: + return OpaqueProductVariant_PercentageOff_case + case *opaqueProductVariant_FixedAmountOff: + return OpaqueProductVariant_FixedAmountOff_case + default: + return OpaqueProductVariant_DiscountInfo_not_set_case + } +} + +type OpaqueProductVariant_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + VariantId *string + Sku *string + Name *string + Price *OpaquePrice + InventoryCount *int32 + Attributes map[string]string + ImageData []byte + ImageUrls []string + IsAvailable *wrapperspb.BoolValue + // Fields of oneof xxx_hidden_DiscountInfo: + PercentageOff *float64 + FixedAmountOff *float64 + // -- end of xxx_hidden_DiscountInfo +} + +func (b0 OpaqueProductVariant_builder) Build() *OpaqueProductVariant { + m0 := &OpaqueProductVariant{} + b, x := &b0, m0 + _, _ = b, x + if b.VariantId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 10) + x.xxx_hidden_VariantId = b.VariantId + } + if b.Sku != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 10) + x.xxx_hidden_Sku = b.Sku + } + if b.Name != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 10) + x.xxx_hidden_Name = b.Name + } + x.xxx_hidden_Price = b.Price + if b.InventoryCount != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 4, 10) + x.xxx_hidden_InventoryCount = *b.InventoryCount + } + x.xxx_hidden_Attributes = b.Attributes + if b.ImageData != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 6, 10) + x.xxx_hidden_ImageData = b.ImageData + } + x.xxx_hidden_ImageUrls = b.ImageUrls + x.xxx_hidden_IsAvailable = b.IsAvailable + if b.PercentageOff != nil { + x.xxx_hidden_DiscountInfo = &opaqueProductVariant_PercentageOff{*b.PercentageOff} + } + if b.FixedAmountOff != nil { + x.xxx_hidden_DiscountInfo = &opaqueProductVariant_FixedAmountOff{*b.FixedAmountOff} + } + return m0 +} + +type case_OpaqueProductVariant_DiscountInfo protoreflect.FieldNumber + +func (x case_OpaqueProductVariant_DiscountInfo) String() string { + md := file_examples_internal_proto_examplepb_opaque_proto_msgTypes[11].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isOpaqueProductVariant_DiscountInfo interface { + isOpaqueProductVariant_DiscountInfo() +} + +type opaqueProductVariant_PercentageOff struct { + PercentageOff float64 `protobuf:"fixed64,10,opt,name=percentage_off,json=percentageOff,oneof"` +} + +type opaqueProductVariant_FixedAmountOff struct { + FixedAmountOff float64 `protobuf:"fixed64,11,opt,name=fixed_amount_off,json=fixedAmountOff,oneof"` +} + +func (*opaqueProductVariant_PercentageOff) isOpaqueProductVariant_DiscountInfo() {} + +func (*opaqueProductVariant_FixedAmountOff) isOpaqueProductVariant_DiscountInfo() {} + +// OpaqueProduct represents a product in the e-commerce system +type OpaqueProduct struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_ProductId *string `protobuf:"bytes,1,opt,name=product_id,json=productId"` + xxx_hidden_Name *string `protobuf:"bytes,2,opt,name=name"` + xxx_hidden_Description *string `protobuf:"bytes,3,opt,name=description"` + xxx_hidden_Brand *string `protobuf:"bytes,4,opt,name=brand"` + xxx_hidden_BasePrice *OpaquePrice `protobuf:"bytes,5,opt,name=base_price,json=basePrice"` + xxx_hidden_Category *OpaqueProductCategory `protobuf:"bytes,6,opt,name=category"` + xxx_hidden_Variants *[]*OpaqueProductVariant `protobuf:"bytes,7,rep,name=variants"` + xxx_hidden_Tags []string `protobuf:"bytes,8,rep,name=tags"` + xxx_hidden_AverageRating float64 `protobuf:"fixed64,9,opt,name=average_rating,json=averageRating"` + xxx_hidden_ReviewCount int32 `protobuf:"varint,10,opt,name=review_count,json=reviewCount"` + xxx_hidden_IsFeatured *wrapperspb.BoolValue `protobuf:"bytes,11,opt,name=is_featured,json=isFeatured"` + xxx_hidden_CreatedAt *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=created_at,json=createdAt"` + xxx_hidden_UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,13,opt,name=updated_at,json=updatedAt"` + xxx_hidden_AverageShippingTime *durationpb.Duration `protobuf:"bytes,14,opt,name=average_shipping_time,json=averageShippingTime"` + xxx_hidden_Status OpaqueProduct_OpaqueProductStatus `protobuf:"varint,15,opt,name=status,enum=grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct_OpaqueProductStatus"` + xxx_hidden_Metadata map[string]string `protobuf:"bytes,16,rep,name=metadata" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + xxx_hidden_RegionalPrices map[string]*OpaquePrice `protobuf:"bytes,17,rep,name=regional_prices,json=regionalPrices" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + xxx_hidden_Dimensions *OpaqueProduct_OpaqueProductDimensions `protobuf:"bytes,18,opt,name=dimensions"` + xxx_hidden_TaxInfo isOpaqueProduct_TaxInfo `protobuf_oneof:"tax_info"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueProduct) Reset() { + *x = OpaqueProduct{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueProduct) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueProduct) ProtoMessage() {} + +func (x *OpaqueProduct) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueProduct) GetProductId() string { + if x != nil { + if x.xxx_hidden_ProductId != nil { + return *x.xxx_hidden_ProductId + } + return "" + } + return "" +} + +func (x *OpaqueProduct) GetName() string { + if x != nil { + if x.xxx_hidden_Name != nil { + return *x.xxx_hidden_Name + } + return "" + } + return "" +} + +func (x *OpaqueProduct) GetDescription() string { + if x != nil { + if x.xxx_hidden_Description != nil { + return *x.xxx_hidden_Description + } + return "" + } + return "" +} + +func (x *OpaqueProduct) GetBrand() string { + if x != nil { + if x.xxx_hidden_Brand != nil { + return *x.xxx_hidden_Brand + } + return "" + } + return "" +} + +func (x *OpaqueProduct) GetBasePrice() *OpaquePrice { + if x != nil { + return x.xxx_hidden_BasePrice + } + return nil +} + +func (x *OpaqueProduct) GetCategory() *OpaqueProductCategory { + if x != nil { + return x.xxx_hidden_Category + } + return nil +} + +func (x *OpaqueProduct) GetVariants() []*OpaqueProductVariant { + if x != nil { + if x.xxx_hidden_Variants != nil { + return *x.xxx_hidden_Variants + } + } + return nil +} + +func (x *OpaqueProduct) GetTags() []string { + if x != nil { + return x.xxx_hidden_Tags + } + return nil +} + +func (x *OpaqueProduct) GetAverageRating() float64 { + if x != nil { + return x.xxx_hidden_AverageRating + } + return 0 +} + +func (x *OpaqueProduct) GetReviewCount() int32 { + if x != nil { + return x.xxx_hidden_ReviewCount + } + return 0 +} + +func (x *OpaqueProduct) GetIsFeatured() *wrapperspb.BoolValue { + if x != nil { + return x.xxx_hidden_IsFeatured + } + return nil +} + +func (x *OpaqueProduct) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.xxx_hidden_CreatedAt + } + return nil +} + +func (x *OpaqueProduct) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.xxx_hidden_UpdatedAt + } + return nil +} + +func (x *OpaqueProduct) GetAverageShippingTime() *durationpb.Duration { + if x != nil { + return x.xxx_hidden_AverageShippingTime + } + return nil +} + +func (x *OpaqueProduct) GetStatus() OpaqueProduct_OpaqueProductStatus { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 14) { + return x.xxx_hidden_Status + } + } + return OpaqueProduct_OPAQUE_PRODUCT_STATUS_UNSPECIFIED +} + +func (x *OpaqueProduct) GetMetadata() map[string]string { + if x != nil { + return x.xxx_hidden_Metadata + } + return nil +} + +func (x *OpaqueProduct) GetRegionalPrices() map[string]*OpaquePrice { + if x != nil { + return x.xxx_hidden_RegionalPrices + } + return nil +} + +func (x *OpaqueProduct) GetDimensions() *OpaqueProduct_OpaqueProductDimensions { + if x != nil { + return x.xxx_hidden_Dimensions + } + return nil +} + +func (x *OpaqueProduct) GetTaxPercentage() float64 { + if x != nil { + if x, ok := x.xxx_hidden_TaxInfo.(*opaqueProduct_TaxPercentage); ok { + return x.TaxPercentage + } + } + return 0 +} + +func (x *OpaqueProduct) GetTaxExempt() bool { + if x != nil { + if x, ok := x.xxx_hidden_TaxInfo.(*opaqueProduct_TaxExempt); ok { + return x.TaxExempt + } + } + return false +} + +func (x *OpaqueProduct) SetProductId(v string) { + x.xxx_hidden_ProductId = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 19) +} + +func (x *OpaqueProduct) SetName(v string) { + x.xxx_hidden_Name = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 19) +} + +func (x *OpaqueProduct) SetDescription(v string) { + x.xxx_hidden_Description = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 19) +} + +func (x *OpaqueProduct) SetBrand(v string) { + x.xxx_hidden_Brand = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 19) +} + +func (x *OpaqueProduct) SetBasePrice(v *OpaquePrice) { + x.xxx_hidden_BasePrice = v +} + +func (x *OpaqueProduct) SetCategory(v *OpaqueProductCategory) { + x.xxx_hidden_Category = v +} + +func (x *OpaqueProduct) SetVariants(v []*OpaqueProductVariant) { + x.xxx_hidden_Variants = &v +} + +func (x *OpaqueProduct) SetTags(v []string) { + x.xxx_hidden_Tags = v +} + +func (x *OpaqueProduct) SetAverageRating(v float64) { + x.xxx_hidden_AverageRating = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 8, 19) +} + +func (x *OpaqueProduct) SetReviewCount(v int32) { + x.xxx_hidden_ReviewCount = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 9, 19) +} + +func (x *OpaqueProduct) SetIsFeatured(v *wrapperspb.BoolValue) { + x.xxx_hidden_IsFeatured = v +} + +func (x *OpaqueProduct) SetCreatedAt(v *timestamppb.Timestamp) { + x.xxx_hidden_CreatedAt = v +} + +func (x *OpaqueProduct) SetUpdatedAt(v *timestamppb.Timestamp) { + x.xxx_hidden_UpdatedAt = v +} + +func (x *OpaqueProduct) SetAverageShippingTime(v *durationpb.Duration) { + x.xxx_hidden_AverageShippingTime = v +} + +func (x *OpaqueProduct) SetStatus(v OpaqueProduct_OpaqueProductStatus) { + x.xxx_hidden_Status = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 14, 19) +} + +func (x *OpaqueProduct) SetMetadata(v map[string]string) { + x.xxx_hidden_Metadata = v +} + +func (x *OpaqueProduct) SetRegionalPrices(v map[string]*OpaquePrice) { + x.xxx_hidden_RegionalPrices = v +} + +func (x *OpaqueProduct) SetDimensions(v *OpaqueProduct_OpaqueProductDimensions) { + x.xxx_hidden_Dimensions = v +} + +func (x *OpaqueProduct) SetTaxPercentage(v float64) { + x.xxx_hidden_TaxInfo = &opaqueProduct_TaxPercentage{v} +} + +func (x *OpaqueProduct) SetTaxExempt(v bool) { + x.xxx_hidden_TaxInfo = &opaqueProduct_TaxExempt{v} +} + +func (x *OpaqueProduct) HasProductId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *OpaqueProduct) HasName() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *OpaqueProduct) HasDescription() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *OpaqueProduct) HasBrand() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *OpaqueProduct) HasBasePrice() bool { + if x == nil { + return false + } + return x.xxx_hidden_BasePrice != nil +} + +func (x *OpaqueProduct) HasCategory() bool { + if x == nil { + return false + } + return x.xxx_hidden_Category != nil +} + +func (x *OpaqueProduct) HasAverageRating() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 8) +} + +func (x *OpaqueProduct) HasReviewCount() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 9) +} + +func (x *OpaqueProduct) HasIsFeatured() bool { + if x == nil { + return false + } + return x.xxx_hidden_IsFeatured != nil +} + +func (x *OpaqueProduct) HasCreatedAt() bool { + if x == nil { + return false + } + return x.xxx_hidden_CreatedAt != nil +} + +func (x *OpaqueProduct) HasUpdatedAt() bool { + if x == nil { + return false + } + return x.xxx_hidden_UpdatedAt != nil +} + +func (x *OpaqueProduct) HasAverageShippingTime() bool { + if x == nil { + return false + } + return x.xxx_hidden_AverageShippingTime != nil +} + +func (x *OpaqueProduct) HasStatus() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 14) +} + +func (x *OpaqueProduct) HasDimensions() bool { + if x == nil { + return false + } + return x.xxx_hidden_Dimensions != nil +} + +func (x *OpaqueProduct) HasTaxInfo() bool { + if x == nil { + return false + } + return x.xxx_hidden_TaxInfo != nil +} + +func (x *OpaqueProduct) HasTaxPercentage() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_TaxInfo.(*opaqueProduct_TaxPercentage) + return ok +} + +func (x *OpaqueProduct) HasTaxExempt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_TaxInfo.(*opaqueProduct_TaxExempt) + return ok +} + +func (x *OpaqueProduct) ClearProductId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_ProductId = nil +} + +func (x *OpaqueProduct) ClearName() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Name = nil +} + +func (x *OpaqueProduct) ClearDescription() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Description = nil +} + +func (x *OpaqueProduct) ClearBrand() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_Brand = nil +} + +func (x *OpaqueProduct) ClearBasePrice() { + x.xxx_hidden_BasePrice = nil +} + +func (x *OpaqueProduct) ClearCategory() { + x.xxx_hidden_Category = nil +} + +func (x *OpaqueProduct) ClearAverageRating() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 8) + x.xxx_hidden_AverageRating = 0 +} + +func (x *OpaqueProduct) ClearReviewCount() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 9) + x.xxx_hidden_ReviewCount = 0 +} + +func (x *OpaqueProduct) ClearIsFeatured() { + x.xxx_hidden_IsFeatured = nil +} + +func (x *OpaqueProduct) ClearCreatedAt() { + x.xxx_hidden_CreatedAt = nil +} + +func (x *OpaqueProduct) ClearUpdatedAt() { + x.xxx_hidden_UpdatedAt = nil +} + +func (x *OpaqueProduct) ClearAverageShippingTime() { + x.xxx_hidden_AverageShippingTime = nil +} + +func (x *OpaqueProduct) ClearStatus() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 14) + x.xxx_hidden_Status = OpaqueProduct_OPAQUE_PRODUCT_STATUS_UNSPECIFIED +} + +func (x *OpaqueProduct) ClearDimensions() { + x.xxx_hidden_Dimensions = nil +} + +func (x *OpaqueProduct) ClearTaxInfo() { + x.xxx_hidden_TaxInfo = nil +} + +func (x *OpaqueProduct) ClearTaxPercentage() { + if _, ok := x.xxx_hidden_TaxInfo.(*opaqueProduct_TaxPercentage); ok { + x.xxx_hidden_TaxInfo = nil + } +} + +func (x *OpaqueProduct) ClearTaxExempt() { + if _, ok := x.xxx_hidden_TaxInfo.(*opaqueProduct_TaxExempt); ok { + x.xxx_hidden_TaxInfo = nil + } +} + +const OpaqueProduct_TaxInfo_not_set_case case_OpaqueProduct_TaxInfo = 0 +const OpaqueProduct_TaxPercentage_case case_OpaqueProduct_TaxInfo = 19 +const OpaqueProduct_TaxExempt_case case_OpaqueProduct_TaxInfo = 20 + +func (x *OpaqueProduct) WhichTaxInfo() case_OpaqueProduct_TaxInfo { + if x == nil { + return OpaqueProduct_TaxInfo_not_set_case + } + switch x.xxx_hidden_TaxInfo.(type) { + case *opaqueProduct_TaxPercentage: + return OpaqueProduct_TaxPercentage_case + case *opaqueProduct_TaxExempt: + return OpaqueProduct_TaxExempt_case + default: + return OpaqueProduct_TaxInfo_not_set_case + } +} + +type OpaqueProduct_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + ProductId *string + Name *string + Description *string + Brand *string + BasePrice *OpaquePrice + Category *OpaqueProductCategory + Variants []*OpaqueProductVariant + Tags []string + AverageRating *float64 + ReviewCount *int32 + IsFeatured *wrapperspb.BoolValue + CreatedAt *timestamppb.Timestamp + UpdatedAt *timestamppb.Timestamp + AverageShippingTime *durationpb.Duration + Status *OpaqueProduct_OpaqueProductStatus + Metadata map[string]string + RegionalPrices map[string]*OpaquePrice + Dimensions *OpaqueProduct_OpaqueProductDimensions + // Fields of oneof xxx_hidden_TaxInfo: + TaxPercentage *float64 + TaxExempt *bool + // -- end of xxx_hidden_TaxInfo +} + +func (b0 OpaqueProduct_builder) Build() *OpaqueProduct { + m0 := &OpaqueProduct{} + b, x := &b0, m0 + _, _ = b, x + if b.ProductId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 19) + x.xxx_hidden_ProductId = b.ProductId + } + if b.Name != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 19) + x.xxx_hidden_Name = b.Name + } + if b.Description != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 19) + x.xxx_hidden_Description = b.Description + } + if b.Brand != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 19) + x.xxx_hidden_Brand = b.Brand + } + x.xxx_hidden_BasePrice = b.BasePrice + x.xxx_hidden_Category = b.Category + x.xxx_hidden_Variants = &b.Variants + x.xxx_hidden_Tags = b.Tags + if b.AverageRating != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 8, 19) + x.xxx_hidden_AverageRating = *b.AverageRating + } + if b.ReviewCount != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 9, 19) + x.xxx_hidden_ReviewCount = *b.ReviewCount + } + x.xxx_hidden_IsFeatured = b.IsFeatured + x.xxx_hidden_CreatedAt = b.CreatedAt + x.xxx_hidden_UpdatedAt = b.UpdatedAt + x.xxx_hidden_AverageShippingTime = b.AverageShippingTime + if b.Status != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 14, 19) + x.xxx_hidden_Status = *b.Status + } + x.xxx_hidden_Metadata = b.Metadata + x.xxx_hidden_RegionalPrices = b.RegionalPrices + x.xxx_hidden_Dimensions = b.Dimensions + if b.TaxPercentage != nil { + x.xxx_hidden_TaxInfo = &opaqueProduct_TaxPercentage{*b.TaxPercentage} + } + if b.TaxExempt != nil { + x.xxx_hidden_TaxInfo = &opaqueProduct_TaxExempt{*b.TaxExempt} + } + return m0 +} + +type case_OpaqueProduct_TaxInfo protoreflect.FieldNumber + +func (x case_OpaqueProduct_TaxInfo) String() string { + md := file_examples_internal_proto_examplepb_opaque_proto_msgTypes[12].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isOpaqueProduct_TaxInfo interface { + isOpaqueProduct_TaxInfo() +} + +type opaqueProduct_TaxPercentage struct { + TaxPercentage float64 `protobuf:"fixed64,19,opt,name=tax_percentage,json=taxPercentage,oneof"` +} + +type opaqueProduct_TaxExempt struct { + TaxExempt bool `protobuf:"varint,20,opt,name=tax_exempt,json=taxExempt,oneof"` +} + +func (*opaqueProduct_TaxPercentage) isOpaqueProduct_TaxInfo() {} + +func (*opaqueProduct_TaxExempt) isOpaqueProduct_TaxInfo() {} + +// OpaqueCustomer represents a customer in the e-commerce system +type OpaqueCustomer struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_CustomerId *string `protobuf:"bytes,1,opt,name=customer_id,json=customerId"` + xxx_hidden_Email *string `protobuf:"bytes,2,opt,name=email"` + xxx_hidden_FirstName *string `protobuf:"bytes,3,opt,name=first_name,json=firstName"` + xxx_hidden_LastName *string `protobuf:"bytes,4,opt,name=last_name,json=lastName"` + xxx_hidden_PhoneNumber *string `protobuf:"bytes,5,opt,name=phone_number,json=phoneNumber"` + xxx_hidden_Addresses *[]*OpaqueAddress `protobuf:"bytes,6,rep,name=addresses"` + xxx_hidden_CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt"` + xxx_hidden_LastLogin *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=last_login,json=lastLogin"` + xxx_hidden_Status OpaqueCustomer_OpaqueCustomerStatus `protobuf:"varint,9,opt,name=status,enum=grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer_OpaqueCustomerStatus"` + xxx_hidden_LoyaltyInfo *OpaqueCustomer_OpaqueLoyaltyInfo `protobuf:"bytes,10,opt,name=loyalty_info,json=loyaltyInfo"` + xxx_hidden_Preferences map[string]string `protobuf:"bytes,11,rep,name=preferences" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + xxx_hidden_PaymentMethods *[]*OpaqueCustomer_OpaquePaymentMethod `protobuf:"bytes,12,rep,name=payment_methods,json=paymentMethods"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueCustomer) Reset() { + *x = OpaqueCustomer{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueCustomer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueCustomer) ProtoMessage() {} + +func (x *OpaqueCustomer) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueCustomer) GetCustomerId() string { + if x != nil { + if x.xxx_hidden_CustomerId != nil { + return *x.xxx_hidden_CustomerId + } + return "" + } + return "" +} + +func (x *OpaqueCustomer) GetEmail() string { + if x != nil { + if x.xxx_hidden_Email != nil { + return *x.xxx_hidden_Email + } + return "" + } + return "" +} + +func (x *OpaqueCustomer) GetFirstName() string { + if x != nil { + if x.xxx_hidden_FirstName != nil { + return *x.xxx_hidden_FirstName + } + return "" + } + return "" +} + +func (x *OpaqueCustomer) GetLastName() string { + if x != nil { + if x.xxx_hidden_LastName != nil { + return *x.xxx_hidden_LastName + } + return "" + } + return "" +} + +func (x *OpaqueCustomer) GetPhoneNumber() string { + if x != nil { + if x.xxx_hidden_PhoneNumber != nil { + return *x.xxx_hidden_PhoneNumber + } + return "" + } + return "" +} + +func (x *OpaqueCustomer) GetAddresses() []*OpaqueAddress { + if x != nil { + if x.xxx_hidden_Addresses != nil { + return *x.xxx_hidden_Addresses + } + } + return nil +} + +func (x *OpaqueCustomer) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.xxx_hidden_CreatedAt + } + return nil +} + +func (x *OpaqueCustomer) GetLastLogin() *timestamppb.Timestamp { + if x != nil { + return x.xxx_hidden_LastLogin + } + return nil +} + +func (x *OpaqueCustomer) GetStatus() OpaqueCustomer_OpaqueCustomerStatus { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 8) { + return x.xxx_hidden_Status + } + } + return OpaqueCustomer_OPAQUE_CUSTOMER_STATUS_UNSPECIFIED +} + +func (x *OpaqueCustomer) GetLoyaltyInfo() *OpaqueCustomer_OpaqueLoyaltyInfo { + if x != nil { + return x.xxx_hidden_LoyaltyInfo + } + return nil +} + +func (x *OpaqueCustomer) GetPreferences() map[string]string { + if x != nil { + return x.xxx_hidden_Preferences + } + return nil +} + +func (x *OpaqueCustomer) GetPaymentMethods() []*OpaqueCustomer_OpaquePaymentMethod { + if x != nil { + if x.xxx_hidden_PaymentMethods != nil { + return *x.xxx_hidden_PaymentMethods + } + } + return nil +} + +func (x *OpaqueCustomer) SetCustomerId(v string) { + x.xxx_hidden_CustomerId = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 12) +} + +func (x *OpaqueCustomer) SetEmail(v string) { + x.xxx_hidden_Email = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 12) +} + +func (x *OpaqueCustomer) SetFirstName(v string) { + x.xxx_hidden_FirstName = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 12) +} + +func (x *OpaqueCustomer) SetLastName(v string) { + x.xxx_hidden_LastName = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 12) +} + +func (x *OpaqueCustomer) SetPhoneNumber(v string) { + x.xxx_hidden_PhoneNumber = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 4, 12) +} + +func (x *OpaqueCustomer) SetAddresses(v []*OpaqueAddress) { + x.xxx_hidden_Addresses = &v +} + +func (x *OpaqueCustomer) SetCreatedAt(v *timestamppb.Timestamp) { + x.xxx_hidden_CreatedAt = v +} + +func (x *OpaqueCustomer) SetLastLogin(v *timestamppb.Timestamp) { + x.xxx_hidden_LastLogin = v +} + +func (x *OpaqueCustomer) SetStatus(v OpaqueCustomer_OpaqueCustomerStatus) { + x.xxx_hidden_Status = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 8, 12) +} + +func (x *OpaqueCustomer) SetLoyaltyInfo(v *OpaqueCustomer_OpaqueLoyaltyInfo) { + x.xxx_hidden_LoyaltyInfo = v +} + +func (x *OpaqueCustomer) SetPreferences(v map[string]string) { + x.xxx_hidden_Preferences = v +} + +func (x *OpaqueCustomer) SetPaymentMethods(v []*OpaqueCustomer_OpaquePaymentMethod) { + x.xxx_hidden_PaymentMethods = &v +} + +func (x *OpaqueCustomer) HasCustomerId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *OpaqueCustomer) HasEmail() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *OpaqueCustomer) HasFirstName() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *OpaqueCustomer) HasLastName() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *OpaqueCustomer) HasPhoneNumber() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 4) +} + +func (x *OpaqueCustomer) HasCreatedAt() bool { + if x == nil { + return false + } + return x.xxx_hidden_CreatedAt != nil +} + +func (x *OpaqueCustomer) HasLastLogin() bool { + if x == nil { + return false + } + return x.xxx_hidden_LastLogin != nil +} + +func (x *OpaqueCustomer) HasStatus() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 8) +} + +func (x *OpaqueCustomer) HasLoyaltyInfo() bool { + if x == nil { + return false + } + return x.xxx_hidden_LoyaltyInfo != nil +} + +func (x *OpaqueCustomer) ClearCustomerId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_CustomerId = nil +} + +func (x *OpaqueCustomer) ClearEmail() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Email = nil +} + +func (x *OpaqueCustomer) ClearFirstName() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_FirstName = nil +} + +func (x *OpaqueCustomer) ClearLastName() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_LastName = nil +} + +func (x *OpaqueCustomer) ClearPhoneNumber() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 4) + x.xxx_hidden_PhoneNumber = nil +} + +func (x *OpaqueCustomer) ClearCreatedAt() { + x.xxx_hidden_CreatedAt = nil +} + +func (x *OpaqueCustomer) ClearLastLogin() { + x.xxx_hidden_LastLogin = nil +} + +func (x *OpaqueCustomer) ClearStatus() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 8) + x.xxx_hidden_Status = OpaqueCustomer_OPAQUE_CUSTOMER_STATUS_UNSPECIFIED +} + +func (x *OpaqueCustomer) ClearLoyaltyInfo() { + x.xxx_hidden_LoyaltyInfo = nil +} + +type OpaqueCustomer_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + CustomerId *string + Email *string + FirstName *string + LastName *string + PhoneNumber *string + Addresses []*OpaqueAddress + CreatedAt *timestamppb.Timestamp + LastLogin *timestamppb.Timestamp + Status *OpaqueCustomer_OpaqueCustomerStatus + LoyaltyInfo *OpaqueCustomer_OpaqueLoyaltyInfo + Preferences map[string]string + PaymentMethods []*OpaqueCustomer_OpaquePaymentMethod +} + +func (b0 OpaqueCustomer_builder) Build() *OpaqueCustomer { + m0 := &OpaqueCustomer{} + b, x := &b0, m0 + _, _ = b, x + if b.CustomerId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 12) + x.xxx_hidden_CustomerId = b.CustomerId + } + if b.Email != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 12) + x.xxx_hidden_Email = b.Email + } + if b.FirstName != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 12) + x.xxx_hidden_FirstName = b.FirstName + } + if b.LastName != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 12) + x.xxx_hidden_LastName = b.LastName + } + if b.PhoneNumber != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 4, 12) + x.xxx_hidden_PhoneNumber = b.PhoneNumber + } + x.xxx_hidden_Addresses = &b.Addresses + x.xxx_hidden_CreatedAt = b.CreatedAt + x.xxx_hidden_LastLogin = b.LastLogin + if b.Status != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 8, 12) + x.xxx_hidden_Status = *b.Status + } + x.xxx_hidden_LoyaltyInfo = b.LoyaltyInfo + x.xxx_hidden_Preferences = b.Preferences + x.xxx_hidden_PaymentMethods = &b.PaymentMethods + return m0 +} + +// OpaqueOrderItem represents an item in an order +type OpaqueOrderItem struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_ProductId *string `protobuf:"bytes,1,opt,name=product_id,json=productId"` + xxx_hidden_VariantId *string `protobuf:"bytes,2,opt,name=variant_id,json=variantId"` + xxx_hidden_ProductName *string `protobuf:"bytes,3,opt,name=product_name,json=productName"` + xxx_hidden_Quantity int32 `protobuf:"varint,4,opt,name=quantity"` + xxx_hidden_UnitPrice *OpaquePrice `protobuf:"bytes,5,opt,name=unit_price,json=unitPrice"` + xxx_hidden_TotalPrice *OpaquePrice `protobuf:"bytes,6,opt,name=total_price,json=totalPrice"` + xxx_hidden_SelectedAttributes map[string]string `protobuf:"bytes,7,rep,name=selected_attributes,json=selectedAttributes" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + xxx_hidden_GiftWrapped *wrapperspb.BoolValue `protobuf:"bytes,8,opt,name=gift_wrapped,json=giftWrapped"` + xxx_hidden_GiftMessage *string `protobuf:"bytes,9,opt,name=gift_message,json=giftMessage"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueOrderItem) Reset() { + *x = OpaqueOrderItem{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueOrderItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueOrderItem) ProtoMessage() {} + +func (x *OpaqueOrderItem) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueOrderItem) GetProductId() string { + if x != nil { + if x.xxx_hidden_ProductId != nil { + return *x.xxx_hidden_ProductId + } + return "" + } + return "" +} + +func (x *OpaqueOrderItem) GetVariantId() string { + if x != nil { + if x.xxx_hidden_VariantId != nil { + return *x.xxx_hidden_VariantId + } + return "" + } + return "" +} + +func (x *OpaqueOrderItem) GetProductName() string { + if x != nil { + if x.xxx_hidden_ProductName != nil { + return *x.xxx_hidden_ProductName + } + return "" + } + return "" +} + +func (x *OpaqueOrderItem) GetQuantity() int32 { + if x != nil { + return x.xxx_hidden_Quantity + } + return 0 +} + +func (x *OpaqueOrderItem) GetUnitPrice() *OpaquePrice { + if x != nil { + return x.xxx_hidden_UnitPrice + } + return nil +} + +func (x *OpaqueOrderItem) GetTotalPrice() *OpaquePrice { + if x != nil { + return x.xxx_hidden_TotalPrice + } + return nil +} + +func (x *OpaqueOrderItem) GetSelectedAttributes() map[string]string { + if x != nil { + return x.xxx_hidden_SelectedAttributes + } + return nil +} + +func (x *OpaqueOrderItem) GetGiftWrapped() *wrapperspb.BoolValue { + if x != nil { + return x.xxx_hidden_GiftWrapped + } + return nil +} + +func (x *OpaqueOrderItem) GetGiftMessage() string { + if x != nil { + if x.xxx_hidden_GiftMessage != nil { + return *x.xxx_hidden_GiftMessage + } + return "" + } + return "" +} + +func (x *OpaqueOrderItem) SetProductId(v string) { + x.xxx_hidden_ProductId = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 9) +} + +func (x *OpaqueOrderItem) SetVariantId(v string) { + x.xxx_hidden_VariantId = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 9) +} + +func (x *OpaqueOrderItem) SetProductName(v string) { + x.xxx_hidden_ProductName = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 9) +} + +func (x *OpaqueOrderItem) SetQuantity(v int32) { + x.xxx_hidden_Quantity = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 9) +} + +func (x *OpaqueOrderItem) SetUnitPrice(v *OpaquePrice) { + x.xxx_hidden_UnitPrice = v +} + +func (x *OpaqueOrderItem) SetTotalPrice(v *OpaquePrice) { + x.xxx_hidden_TotalPrice = v +} + +func (x *OpaqueOrderItem) SetSelectedAttributes(v map[string]string) { + x.xxx_hidden_SelectedAttributes = v +} + +func (x *OpaqueOrderItem) SetGiftWrapped(v *wrapperspb.BoolValue) { + x.xxx_hidden_GiftWrapped = v +} + +func (x *OpaqueOrderItem) SetGiftMessage(v string) { + x.xxx_hidden_GiftMessage = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 8, 9) +} + +func (x *OpaqueOrderItem) HasProductId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *OpaqueOrderItem) HasVariantId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *OpaqueOrderItem) HasProductName() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *OpaqueOrderItem) HasQuantity() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *OpaqueOrderItem) HasUnitPrice() bool { + if x == nil { + return false + } + return x.xxx_hidden_UnitPrice != nil +} + +func (x *OpaqueOrderItem) HasTotalPrice() bool { + if x == nil { + return false + } + return x.xxx_hidden_TotalPrice != nil +} + +func (x *OpaqueOrderItem) HasGiftWrapped() bool { + if x == nil { + return false + } + return x.xxx_hidden_GiftWrapped != nil +} + +func (x *OpaqueOrderItem) HasGiftMessage() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 8) +} + +func (x *OpaqueOrderItem) ClearProductId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_ProductId = nil +} + +func (x *OpaqueOrderItem) ClearVariantId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_VariantId = nil +} + +func (x *OpaqueOrderItem) ClearProductName() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_ProductName = nil +} + +func (x *OpaqueOrderItem) ClearQuantity() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_Quantity = 0 +} + +func (x *OpaqueOrderItem) ClearUnitPrice() { + x.xxx_hidden_UnitPrice = nil +} + +func (x *OpaqueOrderItem) ClearTotalPrice() { + x.xxx_hidden_TotalPrice = nil +} + +func (x *OpaqueOrderItem) ClearGiftWrapped() { + x.xxx_hidden_GiftWrapped = nil +} + +func (x *OpaqueOrderItem) ClearGiftMessage() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 8) + x.xxx_hidden_GiftMessage = nil +} + +type OpaqueOrderItem_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + ProductId *string + VariantId *string + ProductName *string + Quantity *int32 + UnitPrice *OpaquePrice + TotalPrice *OpaquePrice + SelectedAttributes map[string]string + GiftWrapped *wrapperspb.BoolValue + GiftMessage *string +} + +func (b0 OpaqueOrderItem_builder) Build() *OpaqueOrderItem { + m0 := &OpaqueOrderItem{} + b, x := &b0, m0 + _, _ = b, x + if b.ProductId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 9) + x.xxx_hidden_ProductId = b.ProductId + } + if b.VariantId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 9) + x.xxx_hidden_VariantId = b.VariantId + } + if b.ProductName != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 9) + x.xxx_hidden_ProductName = b.ProductName + } + if b.Quantity != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 9) + x.xxx_hidden_Quantity = *b.Quantity + } + x.xxx_hidden_UnitPrice = b.UnitPrice + x.xxx_hidden_TotalPrice = b.TotalPrice + x.xxx_hidden_SelectedAttributes = b.SelectedAttributes + x.xxx_hidden_GiftWrapped = b.GiftWrapped + if b.GiftMessage != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 8, 9) + x.xxx_hidden_GiftMessage = b.GiftMessage + } + return m0 +} + +// OpaqueOrder represents a customer order +type OpaqueOrder struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_OrderId *string `protobuf:"bytes,1,opt,name=order_id,json=orderId"` + xxx_hidden_CustomerId *string `protobuf:"bytes,2,opt,name=customer_id,json=customerId"` + xxx_hidden_Items *[]*OpaqueOrderItem `protobuf:"bytes,3,rep,name=items"` + xxx_hidden_Subtotal *OpaquePrice `protobuf:"bytes,4,opt,name=subtotal"` + xxx_hidden_Tax *OpaquePrice `protobuf:"bytes,5,opt,name=tax"` + xxx_hidden_Shipping *OpaquePrice `protobuf:"bytes,6,opt,name=shipping"` + xxx_hidden_Total *OpaquePrice `protobuf:"bytes,7,opt,name=total"` + xxx_hidden_ShippingAddress *OpaqueAddress `protobuf:"bytes,8,opt,name=shipping_address,json=shippingAddress"` + xxx_hidden_BillingAddress *OpaqueAddress `protobuf:"bytes,9,opt,name=billing_address,json=billingAddress"` + xxx_hidden_Status OpaqueOrder_OpaqueOrderStatus `protobuf:"varint,10,opt,name=status,enum=grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder_OpaqueOrderStatus"` + xxx_hidden_PaymentMethodId *string `protobuf:"bytes,11,opt,name=payment_method_id,json=paymentMethodId"` + xxx_hidden_TrackingNumber *string `protobuf:"bytes,12,opt,name=tracking_number,json=trackingNumber"` + xxx_hidden_CreatedAt *timestamppb.Timestamp `protobuf:"bytes,13,opt,name=created_at,json=createdAt"` + xxx_hidden_UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,14,opt,name=updated_at,json=updatedAt"` + xxx_hidden_ShippedAt *timestamppb.Timestamp `protobuf:"bytes,15,opt,name=shipped_at,json=shippedAt"` + xxx_hidden_DeliveredAt *timestamppb.Timestamp `protobuf:"bytes,16,opt,name=delivered_at,json=deliveredAt"` + xxx_hidden_ShippingInfo *OpaqueOrder_OpaqueShippingInfo `protobuf:"bytes,17,opt,name=shipping_info,json=shippingInfo"` + xxx_hidden_Metadata map[string]string `protobuf:"bytes,18,rep,name=metadata" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + xxx_hidden_DiscountApplied isOpaqueOrder_DiscountApplied `protobuf_oneof:"discount_applied"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueOrder) Reset() { + *x = OpaqueOrder{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueOrder) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueOrder) ProtoMessage() {} + +func (x *OpaqueOrder) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueOrder) GetOrderId() string { + if x != nil { + if x.xxx_hidden_OrderId != nil { + return *x.xxx_hidden_OrderId + } + return "" + } + return "" +} + +func (x *OpaqueOrder) GetCustomerId() string { + if x != nil { + if x.xxx_hidden_CustomerId != nil { + return *x.xxx_hidden_CustomerId + } + return "" + } + return "" +} + +func (x *OpaqueOrder) GetItems() []*OpaqueOrderItem { + if x != nil { + if x.xxx_hidden_Items != nil { + return *x.xxx_hidden_Items + } + } + return nil +} + +func (x *OpaqueOrder) GetSubtotal() *OpaquePrice { + if x != nil { + return x.xxx_hidden_Subtotal + } + return nil +} + +func (x *OpaqueOrder) GetTax() *OpaquePrice { + if x != nil { + return x.xxx_hidden_Tax + } + return nil +} + +func (x *OpaqueOrder) GetShipping() *OpaquePrice { + if x != nil { + return x.xxx_hidden_Shipping + } + return nil +} + +func (x *OpaqueOrder) GetTotal() *OpaquePrice { + if x != nil { + return x.xxx_hidden_Total + } + return nil +} + +func (x *OpaqueOrder) GetShippingAddress() *OpaqueAddress { + if x != nil { + return x.xxx_hidden_ShippingAddress + } + return nil +} + +func (x *OpaqueOrder) GetBillingAddress() *OpaqueAddress { + if x != nil { + return x.xxx_hidden_BillingAddress + } + return nil +} + +func (x *OpaqueOrder) GetStatus() OpaqueOrder_OpaqueOrderStatus { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 9) { + return x.xxx_hidden_Status + } + } + return OpaqueOrder_OPAQUE_ORDER_STATUS_UNSPECIFIED +} + +func (x *OpaqueOrder) GetPaymentMethodId() string { + if x != nil { + if x.xxx_hidden_PaymentMethodId != nil { + return *x.xxx_hidden_PaymentMethodId + } + return "" + } + return "" +} + +func (x *OpaqueOrder) GetTrackingNumber() string { + if x != nil { + if x.xxx_hidden_TrackingNumber != nil { + return *x.xxx_hidden_TrackingNumber + } + return "" + } + return "" +} + +func (x *OpaqueOrder) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.xxx_hidden_CreatedAt + } + return nil +} + +func (x *OpaqueOrder) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.xxx_hidden_UpdatedAt + } + return nil +} + +func (x *OpaqueOrder) GetShippedAt() *timestamppb.Timestamp { + if x != nil { + return x.xxx_hidden_ShippedAt + } + return nil +} + +func (x *OpaqueOrder) GetDeliveredAt() *timestamppb.Timestamp { + if x != nil { + return x.xxx_hidden_DeliveredAt + } + return nil +} + +func (x *OpaqueOrder) GetShippingInfo() *OpaqueOrder_OpaqueShippingInfo { + if x != nil { + return x.xxx_hidden_ShippingInfo + } + return nil +} + +func (x *OpaqueOrder) GetMetadata() map[string]string { + if x != nil { + return x.xxx_hidden_Metadata + } + return nil +} + +func (x *OpaqueOrder) GetCouponCode() string { + if x != nil { + if x, ok := x.xxx_hidden_DiscountApplied.(*opaqueOrder_CouponCode); ok { + return x.CouponCode + } + } + return "" +} + +func (x *OpaqueOrder) GetPromotionId() string { + if x != nil { + if x, ok := x.xxx_hidden_DiscountApplied.(*opaqueOrder_PromotionId); ok { + return x.PromotionId + } + } + return "" +} + +func (x *OpaqueOrder) SetOrderId(v string) { + x.xxx_hidden_OrderId = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 19) +} + +func (x *OpaqueOrder) SetCustomerId(v string) { + x.xxx_hidden_CustomerId = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 19) +} + +func (x *OpaqueOrder) SetItems(v []*OpaqueOrderItem) { + x.xxx_hidden_Items = &v +} + +func (x *OpaqueOrder) SetSubtotal(v *OpaquePrice) { + x.xxx_hidden_Subtotal = v +} + +func (x *OpaqueOrder) SetTax(v *OpaquePrice) { + x.xxx_hidden_Tax = v +} + +func (x *OpaqueOrder) SetShipping(v *OpaquePrice) { + x.xxx_hidden_Shipping = v +} + +func (x *OpaqueOrder) SetTotal(v *OpaquePrice) { + x.xxx_hidden_Total = v +} + +func (x *OpaqueOrder) SetShippingAddress(v *OpaqueAddress) { + x.xxx_hidden_ShippingAddress = v +} + +func (x *OpaqueOrder) SetBillingAddress(v *OpaqueAddress) { + x.xxx_hidden_BillingAddress = v +} + +func (x *OpaqueOrder) SetStatus(v OpaqueOrder_OpaqueOrderStatus) { + x.xxx_hidden_Status = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 9, 19) +} + +func (x *OpaqueOrder) SetPaymentMethodId(v string) { + x.xxx_hidden_PaymentMethodId = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 10, 19) +} + +func (x *OpaqueOrder) SetTrackingNumber(v string) { + x.xxx_hidden_TrackingNumber = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 11, 19) +} + +func (x *OpaqueOrder) SetCreatedAt(v *timestamppb.Timestamp) { + x.xxx_hidden_CreatedAt = v +} + +func (x *OpaqueOrder) SetUpdatedAt(v *timestamppb.Timestamp) { + x.xxx_hidden_UpdatedAt = v +} + +func (x *OpaqueOrder) SetShippedAt(v *timestamppb.Timestamp) { + x.xxx_hidden_ShippedAt = v +} + +func (x *OpaqueOrder) SetDeliveredAt(v *timestamppb.Timestamp) { + x.xxx_hidden_DeliveredAt = v +} + +func (x *OpaqueOrder) SetShippingInfo(v *OpaqueOrder_OpaqueShippingInfo) { + x.xxx_hidden_ShippingInfo = v +} + +func (x *OpaqueOrder) SetMetadata(v map[string]string) { + x.xxx_hidden_Metadata = v +} + +func (x *OpaqueOrder) SetCouponCode(v string) { + x.xxx_hidden_DiscountApplied = &opaqueOrder_CouponCode{v} +} + +func (x *OpaqueOrder) SetPromotionId(v string) { + x.xxx_hidden_DiscountApplied = &opaqueOrder_PromotionId{v} +} + +func (x *OpaqueOrder) HasOrderId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *OpaqueOrder) HasCustomerId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *OpaqueOrder) HasSubtotal() bool { + if x == nil { + return false + } + return x.xxx_hidden_Subtotal != nil +} + +func (x *OpaqueOrder) HasTax() bool { + if x == nil { + return false + } + return x.xxx_hidden_Tax != nil +} + +func (x *OpaqueOrder) HasShipping() bool { + if x == nil { + return false + } + return x.xxx_hidden_Shipping != nil +} + +func (x *OpaqueOrder) HasTotal() bool { + if x == nil { + return false + } + return x.xxx_hidden_Total != nil +} + +func (x *OpaqueOrder) HasShippingAddress() bool { + if x == nil { + return false + } + return x.xxx_hidden_ShippingAddress != nil +} + +func (x *OpaqueOrder) HasBillingAddress() bool { + if x == nil { + return false + } + return x.xxx_hidden_BillingAddress != nil +} + +func (x *OpaqueOrder) HasStatus() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 9) +} + +func (x *OpaqueOrder) HasPaymentMethodId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 10) +} + +func (x *OpaqueOrder) HasTrackingNumber() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 11) +} + +func (x *OpaqueOrder) HasCreatedAt() bool { + if x == nil { + return false + } + return x.xxx_hidden_CreatedAt != nil +} + +func (x *OpaqueOrder) HasUpdatedAt() bool { + if x == nil { + return false + } + return x.xxx_hidden_UpdatedAt != nil +} + +func (x *OpaqueOrder) HasShippedAt() bool { + if x == nil { + return false + } + return x.xxx_hidden_ShippedAt != nil +} + +func (x *OpaqueOrder) HasDeliveredAt() bool { + if x == nil { + return false + } + return x.xxx_hidden_DeliveredAt != nil +} + +func (x *OpaqueOrder) HasShippingInfo() bool { + if x == nil { + return false + } + return x.xxx_hidden_ShippingInfo != nil +} + +func (x *OpaqueOrder) HasDiscountApplied() bool { + if x == nil { + return false + } + return x.xxx_hidden_DiscountApplied != nil +} + +func (x *OpaqueOrder) HasCouponCode() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_DiscountApplied.(*opaqueOrder_CouponCode) + return ok +} + +func (x *OpaqueOrder) HasPromotionId() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_DiscountApplied.(*opaqueOrder_PromotionId) + return ok +} + +func (x *OpaqueOrder) ClearOrderId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_OrderId = nil +} + +func (x *OpaqueOrder) ClearCustomerId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_CustomerId = nil +} + +func (x *OpaqueOrder) ClearSubtotal() { + x.xxx_hidden_Subtotal = nil +} + +func (x *OpaqueOrder) ClearTax() { + x.xxx_hidden_Tax = nil +} + +func (x *OpaqueOrder) ClearShipping() { + x.xxx_hidden_Shipping = nil +} + +func (x *OpaqueOrder) ClearTotal() { + x.xxx_hidden_Total = nil +} + +func (x *OpaqueOrder) ClearShippingAddress() { + x.xxx_hidden_ShippingAddress = nil +} + +func (x *OpaqueOrder) ClearBillingAddress() { + x.xxx_hidden_BillingAddress = nil +} + +func (x *OpaqueOrder) ClearStatus() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 9) + x.xxx_hidden_Status = OpaqueOrder_OPAQUE_ORDER_STATUS_UNSPECIFIED +} + +func (x *OpaqueOrder) ClearPaymentMethodId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 10) + x.xxx_hidden_PaymentMethodId = nil +} + +func (x *OpaqueOrder) ClearTrackingNumber() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 11) + x.xxx_hidden_TrackingNumber = nil +} + +func (x *OpaqueOrder) ClearCreatedAt() { + x.xxx_hidden_CreatedAt = nil +} + +func (x *OpaqueOrder) ClearUpdatedAt() { + x.xxx_hidden_UpdatedAt = nil +} + +func (x *OpaqueOrder) ClearShippedAt() { + x.xxx_hidden_ShippedAt = nil +} + +func (x *OpaqueOrder) ClearDeliveredAt() { + x.xxx_hidden_DeliveredAt = nil +} + +func (x *OpaqueOrder) ClearShippingInfo() { + x.xxx_hidden_ShippingInfo = nil +} + +func (x *OpaqueOrder) ClearDiscountApplied() { + x.xxx_hidden_DiscountApplied = nil +} + +func (x *OpaqueOrder) ClearCouponCode() { + if _, ok := x.xxx_hidden_DiscountApplied.(*opaqueOrder_CouponCode); ok { + x.xxx_hidden_DiscountApplied = nil + } +} + +func (x *OpaqueOrder) ClearPromotionId() { + if _, ok := x.xxx_hidden_DiscountApplied.(*opaqueOrder_PromotionId); ok { + x.xxx_hidden_DiscountApplied = nil + } +} + +const OpaqueOrder_DiscountApplied_not_set_case case_OpaqueOrder_DiscountApplied = 0 +const OpaqueOrder_CouponCode_case case_OpaqueOrder_DiscountApplied = 19 +const OpaqueOrder_PromotionId_case case_OpaqueOrder_DiscountApplied = 20 + +func (x *OpaqueOrder) WhichDiscountApplied() case_OpaqueOrder_DiscountApplied { + if x == nil { + return OpaqueOrder_DiscountApplied_not_set_case + } + switch x.xxx_hidden_DiscountApplied.(type) { + case *opaqueOrder_CouponCode: + return OpaqueOrder_CouponCode_case + case *opaqueOrder_PromotionId: + return OpaqueOrder_PromotionId_case + default: + return OpaqueOrder_DiscountApplied_not_set_case + } +} + +type OpaqueOrder_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + OrderId *string + CustomerId *string + Items []*OpaqueOrderItem + Subtotal *OpaquePrice + Tax *OpaquePrice + Shipping *OpaquePrice + Total *OpaquePrice + ShippingAddress *OpaqueAddress + BillingAddress *OpaqueAddress + Status *OpaqueOrder_OpaqueOrderStatus + PaymentMethodId *string + TrackingNumber *string + CreatedAt *timestamppb.Timestamp + UpdatedAt *timestamppb.Timestamp + ShippedAt *timestamppb.Timestamp + DeliveredAt *timestamppb.Timestamp + ShippingInfo *OpaqueOrder_OpaqueShippingInfo + Metadata map[string]string + // Fields of oneof xxx_hidden_DiscountApplied: + CouponCode *string + PromotionId *string + // -- end of xxx_hidden_DiscountApplied +} + +func (b0 OpaqueOrder_builder) Build() *OpaqueOrder { + m0 := &OpaqueOrder{} + b, x := &b0, m0 + _, _ = b, x + if b.OrderId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 19) + x.xxx_hidden_OrderId = b.OrderId + } + if b.CustomerId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 19) + x.xxx_hidden_CustomerId = b.CustomerId + } + x.xxx_hidden_Items = &b.Items + x.xxx_hidden_Subtotal = b.Subtotal + x.xxx_hidden_Tax = b.Tax + x.xxx_hidden_Shipping = b.Shipping + x.xxx_hidden_Total = b.Total + x.xxx_hidden_ShippingAddress = b.ShippingAddress + x.xxx_hidden_BillingAddress = b.BillingAddress + if b.Status != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 9, 19) + x.xxx_hidden_Status = *b.Status + } + if b.PaymentMethodId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 10, 19) + x.xxx_hidden_PaymentMethodId = b.PaymentMethodId + } + if b.TrackingNumber != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 11, 19) + x.xxx_hidden_TrackingNumber = b.TrackingNumber + } + x.xxx_hidden_CreatedAt = b.CreatedAt + x.xxx_hidden_UpdatedAt = b.UpdatedAt + x.xxx_hidden_ShippedAt = b.ShippedAt + x.xxx_hidden_DeliveredAt = b.DeliveredAt + x.xxx_hidden_ShippingInfo = b.ShippingInfo + x.xxx_hidden_Metadata = b.Metadata + if b.CouponCode != nil { + x.xxx_hidden_DiscountApplied = &opaqueOrder_CouponCode{*b.CouponCode} + } + if b.PromotionId != nil { + x.xxx_hidden_DiscountApplied = &opaqueOrder_PromotionId{*b.PromotionId} + } + return m0 +} + +type case_OpaqueOrder_DiscountApplied protoreflect.FieldNumber + +func (x case_OpaqueOrder_DiscountApplied) String() string { + md := file_examples_internal_proto_examplepb_opaque_proto_msgTypes[15].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isOpaqueOrder_DiscountApplied interface { + isOpaqueOrder_DiscountApplied() +} + +type opaqueOrder_CouponCode struct { + CouponCode string `protobuf:"bytes,19,opt,name=coupon_code,json=couponCode,oneof"` +} + +type opaqueOrder_PromotionId struct { + PromotionId string `protobuf:"bytes,20,opt,name=promotion_id,json=promotionId,oneof"` +} + +func (*opaqueOrder_CouponCode) isOpaqueOrder_DiscountApplied() {} + +func (*opaqueOrder_PromotionId) isOpaqueOrder_DiscountApplied() {} + +// OpaqueOrderSummary represents a summary of processed orders +type OpaqueOrderSummary struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_TotalOrdersProcessed int32 `protobuf:"varint,1,opt,name=total_orders_processed,json=totalOrdersProcessed"` + xxx_hidden_SuccessfulOrders int32 `protobuf:"varint,2,opt,name=successful_orders,json=successfulOrders"` + xxx_hidden_FailedOrders int32 `protobuf:"varint,3,opt,name=failed_orders,json=failedOrders"` + xxx_hidden_TotalValue *OpaquePrice `protobuf:"bytes,4,opt,name=total_value,json=totalValue"` + xxx_hidden_OrderIds []string `protobuf:"bytes,5,rep,name=order_ids,json=orderIds"` + xxx_hidden_ErrorDetails map[string]string `protobuf:"bytes,6,rep,name=error_details,json=errorDetails" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + xxx_hidden_ProcessingTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=processing_time,json=processingTime"` + xxx_hidden_Errors *[]*OpaqueOrderSummary_OpaqueOrderError `protobuf:"bytes,8,rep,name=errors"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueOrderSummary) Reset() { + *x = OpaqueOrderSummary{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueOrderSummary) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueOrderSummary) ProtoMessage() {} + +func (x *OpaqueOrderSummary) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueOrderSummary) GetTotalOrdersProcessed() int32 { + if x != nil { + return x.xxx_hidden_TotalOrdersProcessed + } + return 0 +} + +func (x *OpaqueOrderSummary) GetSuccessfulOrders() int32 { + if x != nil { + return x.xxx_hidden_SuccessfulOrders + } + return 0 +} + +func (x *OpaqueOrderSummary) GetFailedOrders() int32 { + if x != nil { + return x.xxx_hidden_FailedOrders + } + return 0 +} + +func (x *OpaqueOrderSummary) GetTotalValue() *OpaquePrice { + if x != nil { + return x.xxx_hidden_TotalValue + } + return nil +} + +func (x *OpaqueOrderSummary) GetOrderIds() []string { + if x != nil { + return x.xxx_hidden_OrderIds + } + return nil +} + +func (x *OpaqueOrderSummary) GetErrorDetails() map[string]string { + if x != nil { + return x.xxx_hidden_ErrorDetails + } + return nil +} + +func (x *OpaqueOrderSummary) GetProcessingTime() *timestamppb.Timestamp { + if x != nil { + return x.xxx_hidden_ProcessingTime + } + return nil +} + +func (x *OpaqueOrderSummary) GetErrors() []*OpaqueOrderSummary_OpaqueOrderError { + if x != nil { + if x.xxx_hidden_Errors != nil { + return *x.xxx_hidden_Errors + } + } + return nil +} + +func (x *OpaqueOrderSummary) SetTotalOrdersProcessed(v int32) { + x.xxx_hidden_TotalOrdersProcessed = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 8) +} + +func (x *OpaqueOrderSummary) SetSuccessfulOrders(v int32) { + x.xxx_hidden_SuccessfulOrders = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 8) +} + +func (x *OpaqueOrderSummary) SetFailedOrders(v int32) { + x.xxx_hidden_FailedOrders = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 8) +} + +func (x *OpaqueOrderSummary) SetTotalValue(v *OpaquePrice) { + x.xxx_hidden_TotalValue = v +} + +func (x *OpaqueOrderSummary) SetOrderIds(v []string) { + x.xxx_hidden_OrderIds = v +} + +func (x *OpaqueOrderSummary) SetErrorDetails(v map[string]string) { + x.xxx_hidden_ErrorDetails = v +} + +func (x *OpaqueOrderSummary) SetProcessingTime(v *timestamppb.Timestamp) { + x.xxx_hidden_ProcessingTime = v +} + +func (x *OpaqueOrderSummary) SetErrors(v []*OpaqueOrderSummary_OpaqueOrderError) { + x.xxx_hidden_Errors = &v +} + +func (x *OpaqueOrderSummary) HasTotalOrdersProcessed() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *OpaqueOrderSummary) HasSuccessfulOrders() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *OpaqueOrderSummary) HasFailedOrders() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *OpaqueOrderSummary) HasTotalValue() bool { + if x == nil { + return false + } + return x.xxx_hidden_TotalValue != nil +} + +func (x *OpaqueOrderSummary) HasProcessingTime() bool { + if x == nil { + return false + } + return x.xxx_hidden_ProcessingTime != nil +} + +func (x *OpaqueOrderSummary) ClearTotalOrdersProcessed() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_TotalOrdersProcessed = 0 +} + +func (x *OpaqueOrderSummary) ClearSuccessfulOrders() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_SuccessfulOrders = 0 +} + +func (x *OpaqueOrderSummary) ClearFailedOrders() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_FailedOrders = 0 +} + +func (x *OpaqueOrderSummary) ClearTotalValue() { + x.xxx_hidden_TotalValue = nil +} + +func (x *OpaqueOrderSummary) ClearProcessingTime() { + x.xxx_hidden_ProcessingTime = nil +} + +type OpaqueOrderSummary_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + TotalOrdersProcessed *int32 + SuccessfulOrders *int32 + FailedOrders *int32 + TotalValue *OpaquePrice + OrderIds []string + ErrorDetails map[string]string + ProcessingTime *timestamppb.Timestamp + Errors []*OpaqueOrderSummary_OpaqueOrderError +} + +func (b0 OpaqueOrderSummary_builder) Build() *OpaqueOrderSummary { + m0 := &OpaqueOrderSummary{} + b, x := &b0, m0 + _, _ = b, x + if b.TotalOrdersProcessed != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 8) + x.xxx_hidden_TotalOrdersProcessed = *b.TotalOrdersProcessed + } + if b.SuccessfulOrders != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 8) + x.xxx_hidden_SuccessfulOrders = *b.SuccessfulOrders + } + if b.FailedOrders != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 8) + x.xxx_hidden_FailedOrders = *b.FailedOrders + } + x.xxx_hidden_TotalValue = b.TotalValue + x.xxx_hidden_OrderIds = b.OrderIds + x.xxx_hidden_ErrorDetails = b.ErrorDetails + x.xxx_hidden_ProcessingTime = b.ProcessingTime + x.xxx_hidden_Errors = &b.Errors + return m0 +} + +// OpaqueCustomerEvent represents a customer activity event +type OpaqueCustomerEvent struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_CustomerId *string `protobuf:"bytes,1,opt,name=customer_id,json=customerId"` + xxx_hidden_SessionId *string `protobuf:"bytes,2,opt,name=session_id,json=sessionId"` + xxx_hidden_EventType OpaqueCustomerEvent_OpaqueEventType `protobuf:"varint,3,opt,name=event_type,json=eventType,enum=grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomerEvent_OpaqueEventType"` + xxx_hidden_Timestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=timestamp"` + xxx_hidden_ProductId *string `protobuf:"bytes,5,opt,name=product_id,json=productId"` + xxx_hidden_CategoryId *string `protobuf:"bytes,6,opt,name=category_id,json=categoryId"` + xxx_hidden_SearchQuery *string `protobuf:"bytes,7,opt,name=search_query,json=searchQuery"` + xxx_hidden_PageUrl *string `protobuf:"bytes,8,opt,name=page_url,json=pageUrl"` + xxx_hidden_Value int32 `protobuf:"varint,9,opt,name=value"` + xxx_hidden_EventData map[string]string `protobuf:"bytes,10,rep,name=event_data,json=eventData" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + xxx_hidden_DeviceType *string `protobuf:"bytes,11,opt,name=device_type,json=deviceType"` + xxx_hidden_IpAddress *string `protobuf:"bytes,12,opt,name=ip_address,json=ipAddress"` + xxx_hidden_UserAgent *string `protobuf:"bytes,13,opt,name=user_agent,json=userAgent"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueCustomerEvent) Reset() { + *x = OpaqueCustomerEvent{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueCustomerEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueCustomerEvent) ProtoMessage() {} + +func (x *OpaqueCustomerEvent) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueCustomerEvent) GetCustomerId() string { + if x != nil { + if x.xxx_hidden_CustomerId != nil { + return *x.xxx_hidden_CustomerId + } + return "" + } + return "" +} + +func (x *OpaqueCustomerEvent) GetSessionId() string { + if x != nil { + if x.xxx_hidden_SessionId != nil { + return *x.xxx_hidden_SessionId + } + return "" + } + return "" +} + +func (x *OpaqueCustomerEvent) GetEventType() OpaqueCustomerEvent_OpaqueEventType { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 2) { + return x.xxx_hidden_EventType + } + } + return OpaqueCustomerEvent_OPAQUE_EVENT_TYPE_UNSPECIFIED +} + +func (x *OpaqueCustomerEvent) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.xxx_hidden_Timestamp + } + return nil +} + +func (x *OpaqueCustomerEvent) GetProductId() string { + if x != nil { + if x.xxx_hidden_ProductId != nil { + return *x.xxx_hidden_ProductId + } + return "" + } + return "" +} + +func (x *OpaqueCustomerEvent) GetCategoryId() string { + if x != nil { + if x.xxx_hidden_CategoryId != nil { + return *x.xxx_hidden_CategoryId + } + return "" + } + return "" +} + +func (x *OpaqueCustomerEvent) GetSearchQuery() string { + if x != nil { + if x.xxx_hidden_SearchQuery != nil { + return *x.xxx_hidden_SearchQuery + } + return "" + } + return "" +} + +func (x *OpaqueCustomerEvent) GetPageUrl() string { + if x != nil { + if x.xxx_hidden_PageUrl != nil { + return *x.xxx_hidden_PageUrl + } + return "" + } + return "" +} + +func (x *OpaqueCustomerEvent) GetValue() int32 { + if x != nil { + return x.xxx_hidden_Value + } + return 0 +} + +func (x *OpaqueCustomerEvent) GetEventData() map[string]string { + if x != nil { + return x.xxx_hidden_EventData + } + return nil +} + +func (x *OpaqueCustomerEvent) GetDeviceType() string { + if x != nil { + if x.xxx_hidden_DeviceType != nil { + return *x.xxx_hidden_DeviceType + } + return "" + } + return "" +} + +func (x *OpaqueCustomerEvent) GetIpAddress() string { + if x != nil { + if x.xxx_hidden_IpAddress != nil { + return *x.xxx_hidden_IpAddress + } + return "" + } + return "" +} + +func (x *OpaqueCustomerEvent) GetUserAgent() string { + if x != nil { + if x.xxx_hidden_UserAgent != nil { + return *x.xxx_hidden_UserAgent + } + return "" + } + return "" +} + +func (x *OpaqueCustomerEvent) SetCustomerId(v string) { + x.xxx_hidden_CustomerId = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 13) +} + +func (x *OpaqueCustomerEvent) SetSessionId(v string) { + x.xxx_hidden_SessionId = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 13) +} + +func (x *OpaqueCustomerEvent) SetEventType(v OpaqueCustomerEvent_OpaqueEventType) { + x.xxx_hidden_EventType = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 13) +} + +func (x *OpaqueCustomerEvent) SetTimestamp(v *timestamppb.Timestamp) { + x.xxx_hidden_Timestamp = v +} + +func (x *OpaqueCustomerEvent) SetProductId(v string) { + x.xxx_hidden_ProductId = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 4, 13) +} + +func (x *OpaqueCustomerEvent) SetCategoryId(v string) { + x.xxx_hidden_CategoryId = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 5, 13) +} + +func (x *OpaqueCustomerEvent) SetSearchQuery(v string) { + x.xxx_hidden_SearchQuery = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 6, 13) +} + +func (x *OpaqueCustomerEvent) SetPageUrl(v string) { + x.xxx_hidden_PageUrl = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 7, 13) +} + +func (x *OpaqueCustomerEvent) SetValue(v int32) { + x.xxx_hidden_Value = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 8, 13) +} + +func (x *OpaqueCustomerEvent) SetEventData(v map[string]string) { + x.xxx_hidden_EventData = v +} + +func (x *OpaqueCustomerEvent) SetDeviceType(v string) { + x.xxx_hidden_DeviceType = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 10, 13) +} + +func (x *OpaqueCustomerEvent) SetIpAddress(v string) { + x.xxx_hidden_IpAddress = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 11, 13) +} + +func (x *OpaqueCustomerEvent) SetUserAgent(v string) { + x.xxx_hidden_UserAgent = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 12, 13) +} + +func (x *OpaqueCustomerEvent) HasCustomerId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *OpaqueCustomerEvent) HasSessionId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *OpaqueCustomerEvent) HasEventType() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *OpaqueCustomerEvent) HasTimestamp() bool { + if x == nil { + return false + } + return x.xxx_hidden_Timestamp != nil +} + +func (x *OpaqueCustomerEvent) HasProductId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 4) +} + +func (x *OpaqueCustomerEvent) HasCategoryId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 5) +} + +func (x *OpaqueCustomerEvent) HasSearchQuery() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 6) +} + +func (x *OpaqueCustomerEvent) HasPageUrl() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 7) +} + +func (x *OpaqueCustomerEvent) HasValue() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 8) +} + +func (x *OpaqueCustomerEvent) HasDeviceType() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 10) +} + +func (x *OpaqueCustomerEvent) HasIpAddress() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 11) +} + +func (x *OpaqueCustomerEvent) HasUserAgent() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 12) +} + +func (x *OpaqueCustomerEvent) ClearCustomerId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_CustomerId = nil +} + +func (x *OpaqueCustomerEvent) ClearSessionId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_SessionId = nil +} + +func (x *OpaqueCustomerEvent) ClearEventType() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_EventType = OpaqueCustomerEvent_OPAQUE_EVENT_TYPE_UNSPECIFIED +} + +func (x *OpaqueCustomerEvent) ClearTimestamp() { + x.xxx_hidden_Timestamp = nil +} + +func (x *OpaqueCustomerEvent) ClearProductId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 4) + x.xxx_hidden_ProductId = nil +} + +func (x *OpaqueCustomerEvent) ClearCategoryId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 5) + x.xxx_hidden_CategoryId = nil +} + +func (x *OpaqueCustomerEvent) ClearSearchQuery() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 6) + x.xxx_hidden_SearchQuery = nil +} + +func (x *OpaqueCustomerEvent) ClearPageUrl() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 7) + x.xxx_hidden_PageUrl = nil +} + +func (x *OpaqueCustomerEvent) ClearValue() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 8) + x.xxx_hidden_Value = 0 +} + +func (x *OpaqueCustomerEvent) ClearDeviceType() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 10) + x.xxx_hidden_DeviceType = nil +} + +func (x *OpaqueCustomerEvent) ClearIpAddress() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 11) + x.xxx_hidden_IpAddress = nil +} + +func (x *OpaqueCustomerEvent) ClearUserAgent() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 12) + x.xxx_hidden_UserAgent = nil +} + +type OpaqueCustomerEvent_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + CustomerId *string + SessionId *string + EventType *OpaqueCustomerEvent_OpaqueEventType + Timestamp *timestamppb.Timestamp + ProductId *string + CategoryId *string + SearchQuery *string + PageUrl *string + Value *int32 + EventData map[string]string + DeviceType *string + IpAddress *string + UserAgent *string +} + +func (b0 OpaqueCustomerEvent_builder) Build() *OpaqueCustomerEvent { + m0 := &OpaqueCustomerEvent{} + b, x := &b0, m0 + _, _ = b, x + if b.CustomerId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 13) + x.xxx_hidden_CustomerId = b.CustomerId + } + if b.SessionId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 13) + x.xxx_hidden_SessionId = b.SessionId + } + if b.EventType != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 13) + x.xxx_hidden_EventType = *b.EventType + } + x.xxx_hidden_Timestamp = b.Timestamp + if b.ProductId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 4, 13) + x.xxx_hidden_ProductId = b.ProductId + } + if b.CategoryId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 5, 13) + x.xxx_hidden_CategoryId = b.CategoryId + } + if b.SearchQuery != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 6, 13) + x.xxx_hidden_SearchQuery = b.SearchQuery + } + if b.PageUrl != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 7, 13) + x.xxx_hidden_PageUrl = b.PageUrl + } + if b.Value != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 8, 13) + x.xxx_hidden_Value = *b.Value + } + x.xxx_hidden_EventData = b.EventData + if b.DeviceType != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 10, 13) + x.xxx_hidden_DeviceType = b.DeviceType + } + if b.IpAddress != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 11, 13) + x.xxx_hidden_IpAddress = b.IpAddress + } + if b.UserAgent != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 12, 13) + x.xxx_hidden_UserAgent = b.UserAgent + } + return m0 +} + +// OpaqueActivityUpdate represents a server response to customer activity +type OpaqueActivityUpdate struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_CustomerId *string `protobuf:"bytes,1,opt,name=customer_id,json=customerId"` + xxx_hidden_SessionId *string `protobuf:"bytes,2,opt,name=session_id,json=sessionId"` + xxx_hidden_UpdateType OpaqueActivityUpdate_OpaqueUpdateType `protobuf:"varint,3,opt,name=update_type,json=updateType,enum=grpc.gateway.examples.internal.proto.examplepb.OpaqueActivityUpdate_OpaqueUpdateType"` + xxx_hidden_Timestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=timestamp"` + xxx_hidden_Message *string `protobuf:"bytes,5,opt,name=message"` + xxx_hidden_ProductIds []string `protobuf:"bytes,6,rep,name=product_ids,json=productIds"` + xxx_hidden_PriceUpdate *OpaquePrice `protobuf:"bytes,7,opt,name=price_update,json=priceUpdate"` + xxx_hidden_InventoryCount int32 `protobuf:"varint,8,opt,name=inventory_count,json=inventoryCount"` + xxx_hidden_OfferCode *string `protobuf:"bytes,9,opt,name=offer_code,json=offerCode"` + xxx_hidden_OfferExpiry *durationpb.Duration `protobuf:"bytes,10,opt,name=offer_expiry,json=offerExpiry"` + xxx_hidden_DiscountPercentage float64 `protobuf:"fixed64,11,opt,name=discount_percentage,json=discountPercentage"` + xxx_hidden_UpdateData map[string]string `protobuf:"bytes,12,rep,name=update_data,json=updateData" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + xxx_hidden_Priority int32 `protobuf:"varint,13,opt,name=priority"` + xxx_hidden_ActionData isOpaqueActivityUpdate_ActionData `protobuf_oneof:"action_data"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueActivityUpdate) Reset() { + *x = OpaqueActivityUpdate{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueActivityUpdate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueActivityUpdate) ProtoMessage() {} + +func (x *OpaqueActivityUpdate) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueActivityUpdate) GetCustomerId() string { + if x != nil { + if x.xxx_hidden_CustomerId != nil { + return *x.xxx_hidden_CustomerId + } + return "" + } + return "" +} + +func (x *OpaqueActivityUpdate) GetSessionId() string { + if x != nil { + if x.xxx_hidden_SessionId != nil { + return *x.xxx_hidden_SessionId + } + return "" + } + return "" +} + +func (x *OpaqueActivityUpdate) GetUpdateType() OpaqueActivityUpdate_OpaqueUpdateType { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 2) { + return x.xxx_hidden_UpdateType + } + } + return OpaqueActivityUpdate_OPAQUE_UPDATE_TYPE_UNSPECIFIED +} + +func (x *OpaqueActivityUpdate) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.xxx_hidden_Timestamp + } + return nil +} + +func (x *OpaqueActivityUpdate) GetMessage() string { + if x != nil { + if x.xxx_hidden_Message != nil { + return *x.xxx_hidden_Message + } + return "" + } + return "" +} + +func (x *OpaqueActivityUpdate) GetProductIds() []string { + if x != nil { + return x.xxx_hidden_ProductIds + } + return nil +} + +func (x *OpaqueActivityUpdate) GetPriceUpdate() *OpaquePrice { + if x != nil { + return x.xxx_hidden_PriceUpdate + } + return nil +} + +func (x *OpaqueActivityUpdate) GetInventoryCount() int32 { + if x != nil { + return x.xxx_hidden_InventoryCount + } + return 0 +} + +func (x *OpaqueActivityUpdate) GetOfferCode() string { + if x != nil { + if x.xxx_hidden_OfferCode != nil { + return *x.xxx_hidden_OfferCode + } + return "" + } + return "" +} + +func (x *OpaqueActivityUpdate) GetOfferExpiry() *durationpb.Duration { + if x != nil { + return x.xxx_hidden_OfferExpiry + } + return nil +} + +func (x *OpaqueActivityUpdate) GetDiscountPercentage() float64 { + if x != nil { + return x.xxx_hidden_DiscountPercentage + } + return 0 +} + +func (x *OpaqueActivityUpdate) GetUpdateData() map[string]string { + if x != nil { + return x.xxx_hidden_UpdateData + } + return nil +} + +func (x *OpaqueActivityUpdate) GetPriority() int32 { + if x != nil { + return x.xxx_hidden_Priority + } + return 0 +} + +func (x *OpaqueActivityUpdate) GetRedirectUrl() string { + if x != nil { + if x, ok := x.xxx_hidden_ActionData.(*opaqueActivityUpdate_RedirectUrl); ok { + return x.RedirectUrl + } + } + return "" +} + +func (x *OpaqueActivityUpdate) GetNotificationId() string { + if x != nil { + if x, ok := x.xxx_hidden_ActionData.(*opaqueActivityUpdate_NotificationId); ok { + return x.NotificationId + } + } + return "" +} + +func (x *OpaqueActivityUpdate) SetCustomerId(v string) { + x.xxx_hidden_CustomerId = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 14) +} + +func (x *OpaqueActivityUpdate) SetSessionId(v string) { + x.xxx_hidden_SessionId = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 14) +} + +func (x *OpaqueActivityUpdate) SetUpdateType(v OpaqueActivityUpdate_OpaqueUpdateType) { + x.xxx_hidden_UpdateType = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 14) +} + +func (x *OpaqueActivityUpdate) SetTimestamp(v *timestamppb.Timestamp) { + x.xxx_hidden_Timestamp = v +} + +func (x *OpaqueActivityUpdate) SetMessage(v string) { + x.xxx_hidden_Message = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 4, 14) +} + +func (x *OpaqueActivityUpdate) SetProductIds(v []string) { + x.xxx_hidden_ProductIds = v +} + +func (x *OpaqueActivityUpdate) SetPriceUpdate(v *OpaquePrice) { + x.xxx_hidden_PriceUpdate = v +} + +func (x *OpaqueActivityUpdate) SetInventoryCount(v int32) { + x.xxx_hidden_InventoryCount = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 7, 14) +} + +func (x *OpaqueActivityUpdate) SetOfferCode(v string) { + x.xxx_hidden_OfferCode = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 8, 14) +} + +func (x *OpaqueActivityUpdate) SetOfferExpiry(v *durationpb.Duration) { + x.xxx_hidden_OfferExpiry = v +} + +func (x *OpaqueActivityUpdate) SetDiscountPercentage(v float64) { + x.xxx_hidden_DiscountPercentage = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 10, 14) +} + +func (x *OpaqueActivityUpdate) SetUpdateData(v map[string]string) { + x.xxx_hidden_UpdateData = v +} + +func (x *OpaqueActivityUpdate) SetPriority(v int32) { + x.xxx_hidden_Priority = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 12, 14) +} + +func (x *OpaqueActivityUpdate) SetRedirectUrl(v string) { + x.xxx_hidden_ActionData = &opaqueActivityUpdate_RedirectUrl{v} +} + +func (x *OpaqueActivityUpdate) SetNotificationId(v string) { + x.xxx_hidden_ActionData = &opaqueActivityUpdate_NotificationId{v} +} + +func (x *OpaqueActivityUpdate) HasCustomerId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *OpaqueActivityUpdate) HasSessionId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *OpaqueActivityUpdate) HasUpdateType() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *OpaqueActivityUpdate) HasTimestamp() bool { + if x == nil { + return false + } + return x.xxx_hidden_Timestamp != nil +} + +func (x *OpaqueActivityUpdate) HasMessage() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 4) +} + +func (x *OpaqueActivityUpdate) HasPriceUpdate() bool { + if x == nil { + return false + } + return x.xxx_hidden_PriceUpdate != nil +} + +func (x *OpaqueActivityUpdate) HasInventoryCount() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 7) +} + +func (x *OpaqueActivityUpdate) HasOfferCode() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 8) +} + +func (x *OpaqueActivityUpdate) HasOfferExpiry() bool { + if x == nil { + return false + } + return x.xxx_hidden_OfferExpiry != nil +} + +func (x *OpaqueActivityUpdate) HasDiscountPercentage() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 10) +} + +func (x *OpaqueActivityUpdate) HasPriority() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 12) +} + +func (x *OpaqueActivityUpdate) HasActionData() bool { + if x == nil { + return false + } + return x.xxx_hidden_ActionData != nil +} + +func (x *OpaqueActivityUpdate) HasRedirectUrl() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_ActionData.(*opaqueActivityUpdate_RedirectUrl) + return ok +} + +func (x *OpaqueActivityUpdate) HasNotificationId() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_ActionData.(*opaqueActivityUpdate_NotificationId) + return ok +} + +func (x *OpaqueActivityUpdate) ClearCustomerId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_CustomerId = nil +} + +func (x *OpaqueActivityUpdate) ClearSessionId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_SessionId = nil +} + +func (x *OpaqueActivityUpdate) ClearUpdateType() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_UpdateType = OpaqueActivityUpdate_OPAQUE_UPDATE_TYPE_UNSPECIFIED +} + +func (x *OpaqueActivityUpdate) ClearTimestamp() { + x.xxx_hidden_Timestamp = nil +} + +func (x *OpaqueActivityUpdate) ClearMessage() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 4) + x.xxx_hidden_Message = nil +} + +func (x *OpaqueActivityUpdate) ClearPriceUpdate() { + x.xxx_hidden_PriceUpdate = nil +} + +func (x *OpaqueActivityUpdate) ClearInventoryCount() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 7) + x.xxx_hidden_InventoryCount = 0 +} + +func (x *OpaqueActivityUpdate) ClearOfferCode() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 8) + x.xxx_hidden_OfferCode = nil +} + +func (x *OpaqueActivityUpdate) ClearOfferExpiry() { + x.xxx_hidden_OfferExpiry = nil +} + +func (x *OpaqueActivityUpdate) ClearDiscountPercentage() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 10) + x.xxx_hidden_DiscountPercentage = 0 +} + +func (x *OpaqueActivityUpdate) ClearPriority() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 12) + x.xxx_hidden_Priority = 0 +} + +func (x *OpaqueActivityUpdate) ClearActionData() { + x.xxx_hidden_ActionData = nil +} + +func (x *OpaqueActivityUpdate) ClearRedirectUrl() { + if _, ok := x.xxx_hidden_ActionData.(*opaqueActivityUpdate_RedirectUrl); ok { + x.xxx_hidden_ActionData = nil + } +} + +func (x *OpaqueActivityUpdate) ClearNotificationId() { + if _, ok := x.xxx_hidden_ActionData.(*opaqueActivityUpdate_NotificationId); ok { + x.xxx_hidden_ActionData = nil + } +} + +const OpaqueActivityUpdate_ActionData_not_set_case case_OpaqueActivityUpdate_ActionData = 0 +const OpaqueActivityUpdate_RedirectUrl_case case_OpaqueActivityUpdate_ActionData = 14 +const OpaqueActivityUpdate_NotificationId_case case_OpaqueActivityUpdate_ActionData = 15 + +func (x *OpaqueActivityUpdate) WhichActionData() case_OpaqueActivityUpdate_ActionData { + if x == nil { + return OpaqueActivityUpdate_ActionData_not_set_case + } + switch x.xxx_hidden_ActionData.(type) { + case *opaqueActivityUpdate_RedirectUrl: + return OpaqueActivityUpdate_RedirectUrl_case + case *opaqueActivityUpdate_NotificationId: + return OpaqueActivityUpdate_NotificationId_case + default: + return OpaqueActivityUpdate_ActionData_not_set_case + } +} + +type OpaqueActivityUpdate_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + CustomerId *string + SessionId *string + UpdateType *OpaqueActivityUpdate_OpaqueUpdateType + Timestamp *timestamppb.Timestamp + Message *string + ProductIds []string + PriceUpdate *OpaquePrice + InventoryCount *int32 + OfferCode *string + OfferExpiry *durationpb.Duration + DiscountPercentage *float64 + UpdateData map[string]string + Priority *int32 + // Fields of oneof xxx_hidden_ActionData: + RedirectUrl *string + NotificationId *string + // -- end of xxx_hidden_ActionData +} + +func (b0 OpaqueActivityUpdate_builder) Build() *OpaqueActivityUpdate { + m0 := &OpaqueActivityUpdate{} + b, x := &b0, m0 + _, _ = b, x + if b.CustomerId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 14) + x.xxx_hidden_CustomerId = b.CustomerId + } + if b.SessionId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 14) + x.xxx_hidden_SessionId = b.SessionId + } + if b.UpdateType != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 14) + x.xxx_hidden_UpdateType = *b.UpdateType + } + x.xxx_hidden_Timestamp = b.Timestamp + if b.Message != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 4, 14) + x.xxx_hidden_Message = b.Message + } + x.xxx_hidden_ProductIds = b.ProductIds + x.xxx_hidden_PriceUpdate = b.PriceUpdate + if b.InventoryCount != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 7, 14) + x.xxx_hidden_InventoryCount = *b.InventoryCount + } + if b.OfferCode != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 8, 14) + x.xxx_hidden_OfferCode = b.OfferCode + } + x.xxx_hidden_OfferExpiry = b.OfferExpiry + if b.DiscountPercentage != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 10, 14) + x.xxx_hidden_DiscountPercentage = *b.DiscountPercentage + } + x.xxx_hidden_UpdateData = b.UpdateData + if b.Priority != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 12, 14) + x.xxx_hidden_Priority = *b.Priority + } + if b.RedirectUrl != nil { + x.xxx_hidden_ActionData = &opaqueActivityUpdate_RedirectUrl{*b.RedirectUrl} + } + if b.NotificationId != nil { + x.xxx_hidden_ActionData = &opaqueActivityUpdate_NotificationId{*b.NotificationId} + } + return m0 +} + +type case_OpaqueActivityUpdate_ActionData protoreflect.FieldNumber + +func (x case_OpaqueActivityUpdate_ActionData) String() string { + md := file_examples_internal_proto_examplepb_opaque_proto_msgTypes[18].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isOpaqueActivityUpdate_ActionData interface { + isOpaqueActivityUpdate_ActionData() +} + +type opaqueActivityUpdate_RedirectUrl struct { + RedirectUrl string `protobuf:"bytes,14,opt,name=redirect_url,json=redirectUrl,oneof"` +} + +type opaqueActivityUpdate_NotificationId struct { + NotificationId string `protobuf:"bytes,15,opt,name=notification_id,json=notificationId,oneof"` +} + +func (*opaqueActivityUpdate_RedirectUrl) isOpaqueActivityUpdate_ActionData() {} + +func (*opaqueActivityUpdate_NotificationId) isOpaqueActivityUpdate_ActionData() {} + +type OpaqueProduct_OpaqueProductDimensions struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Length float64 `protobuf:"fixed64,1,opt,name=length"` + xxx_hidden_Width float64 `protobuf:"fixed64,2,opt,name=width"` + xxx_hidden_Height float64 `protobuf:"fixed64,3,opt,name=height"` + xxx_hidden_Weight float64 `protobuf:"fixed64,4,opt,name=weight"` + xxx_hidden_Unit OpaqueProduct_OpaqueProductDimensions_OpaqueUnit `protobuf:"varint,5,opt,name=unit,enum=grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct_OpaqueProductDimensions_OpaqueUnit"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueProduct_OpaqueProductDimensions) Reset() { + *x = OpaqueProduct_OpaqueProductDimensions{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueProduct_OpaqueProductDimensions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueProduct_OpaqueProductDimensions) ProtoMessage() {} + +func (x *OpaqueProduct_OpaqueProductDimensions) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueProduct_OpaqueProductDimensions) GetLength() float64 { + if x != nil { + return x.xxx_hidden_Length + } + return 0 +} + +func (x *OpaqueProduct_OpaqueProductDimensions) GetWidth() float64 { + if x != nil { + return x.xxx_hidden_Width + } + return 0 +} + +func (x *OpaqueProduct_OpaqueProductDimensions) GetHeight() float64 { + if x != nil { + return x.xxx_hidden_Height + } + return 0 +} + +func (x *OpaqueProduct_OpaqueProductDimensions) GetWeight() float64 { + if x != nil { + return x.xxx_hidden_Weight + } + return 0 +} + +func (x *OpaqueProduct_OpaqueProductDimensions) GetUnit() OpaqueProduct_OpaqueProductDimensions_OpaqueUnit { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 4) { + return x.xxx_hidden_Unit + } + } + return OpaqueProduct_OpaqueProductDimensions_OPAQUE_UNIT_UNSPECIFIED +} + +func (x *OpaqueProduct_OpaqueProductDimensions) SetLength(v float64) { + x.xxx_hidden_Length = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 5) +} + +func (x *OpaqueProduct_OpaqueProductDimensions) SetWidth(v float64) { + x.xxx_hidden_Width = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 5) +} + +func (x *OpaqueProduct_OpaqueProductDimensions) SetHeight(v float64) { + x.xxx_hidden_Height = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 5) +} + +func (x *OpaqueProduct_OpaqueProductDimensions) SetWeight(v float64) { + x.xxx_hidden_Weight = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 5) +} + +func (x *OpaqueProduct_OpaqueProductDimensions) SetUnit(v OpaqueProduct_OpaqueProductDimensions_OpaqueUnit) { + x.xxx_hidden_Unit = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 4, 5) +} + +func (x *OpaqueProduct_OpaqueProductDimensions) HasLength() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *OpaqueProduct_OpaqueProductDimensions) HasWidth() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *OpaqueProduct_OpaqueProductDimensions) HasHeight() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *OpaqueProduct_OpaqueProductDimensions) HasWeight() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *OpaqueProduct_OpaqueProductDimensions) HasUnit() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 4) +} + +func (x *OpaqueProduct_OpaqueProductDimensions) ClearLength() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Length = 0 +} + +func (x *OpaqueProduct_OpaqueProductDimensions) ClearWidth() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Width = 0 +} + +func (x *OpaqueProduct_OpaqueProductDimensions) ClearHeight() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Height = 0 +} + +func (x *OpaqueProduct_OpaqueProductDimensions) ClearWeight() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_Weight = 0 +} + +func (x *OpaqueProduct_OpaqueProductDimensions) ClearUnit() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 4) + x.xxx_hidden_Unit = OpaqueProduct_OpaqueProductDimensions_OPAQUE_UNIT_UNSPECIFIED +} + +type OpaqueProduct_OpaqueProductDimensions_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Length *float64 + Width *float64 + Height *float64 + Weight *float64 + Unit *OpaqueProduct_OpaqueProductDimensions_OpaqueUnit +} + +func (b0 OpaqueProduct_OpaqueProductDimensions_builder) Build() *OpaqueProduct_OpaqueProductDimensions { + m0 := &OpaqueProduct_OpaqueProductDimensions{} + b, x := &b0, m0 + _, _ = b, x + if b.Length != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 5) + x.xxx_hidden_Length = *b.Length + } + if b.Width != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 5) + x.xxx_hidden_Width = *b.Width + } + if b.Height != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 5) + x.xxx_hidden_Height = *b.Height + } + if b.Weight != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 5) + x.xxx_hidden_Weight = *b.Weight + } + if b.Unit != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 4, 5) + x.xxx_hidden_Unit = *b.Unit + } + return m0 +} + +type OpaqueCustomer_OpaqueLoyaltyInfo struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Tier *string `protobuf:"bytes,1,opt,name=tier"` + xxx_hidden_Points int32 `protobuf:"varint,2,opt,name=points"` + xxx_hidden_TierExpiry *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=tier_expiry,json=tierExpiry"` + xxx_hidden_Rewards []string `protobuf:"bytes,4,rep,name=rewards"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueCustomer_OpaqueLoyaltyInfo) Reset() { + *x = OpaqueCustomer_OpaqueLoyaltyInfo{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueCustomer_OpaqueLoyaltyInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueCustomer_OpaqueLoyaltyInfo) ProtoMessage() {} + +func (x *OpaqueCustomer_OpaqueLoyaltyInfo) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueCustomer_OpaqueLoyaltyInfo) GetTier() string { + if x != nil { + if x.xxx_hidden_Tier != nil { + return *x.xxx_hidden_Tier + } + return "" + } + return "" +} + +func (x *OpaqueCustomer_OpaqueLoyaltyInfo) GetPoints() int32 { + if x != nil { + return x.xxx_hidden_Points + } + return 0 +} + +func (x *OpaqueCustomer_OpaqueLoyaltyInfo) GetTierExpiry() *timestamppb.Timestamp { + if x != nil { + return x.xxx_hidden_TierExpiry + } + return nil +} + +func (x *OpaqueCustomer_OpaqueLoyaltyInfo) GetRewards() []string { + if x != nil { + return x.xxx_hidden_Rewards + } + return nil +} + +func (x *OpaqueCustomer_OpaqueLoyaltyInfo) SetTier(v string) { + x.xxx_hidden_Tier = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 4) +} + +func (x *OpaqueCustomer_OpaqueLoyaltyInfo) SetPoints(v int32) { + x.xxx_hidden_Points = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 4) +} + +func (x *OpaqueCustomer_OpaqueLoyaltyInfo) SetTierExpiry(v *timestamppb.Timestamp) { + x.xxx_hidden_TierExpiry = v +} + +func (x *OpaqueCustomer_OpaqueLoyaltyInfo) SetRewards(v []string) { + x.xxx_hidden_Rewards = v +} + +func (x *OpaqueCustomer_OpaqueLoyaltyInfo) HasTier() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *OpaqueCustomer_OpaqueLoyaltyInfo) HasPoints() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *OpaqueCustomer_OpaqueLoyaltyInfo) HasTierExpiry() bool { + if x == nil { + return false + } + return x.xxx_hidden_TierExpiry != nil +} + +func (x *OpaqueCustomer_OpaqueLoyaltyInfo) ClearTier() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Tier = nil +} + +func (x *OpaqueCustomer_OpaqueLoyaltyInfo) ClearPoints() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Points = 0 +} + +func (x *OpaqueCustomer_OpaqueLoyaltyInfo) ClearTierExpiry() { + x.xxx_hidden_TierExpiry = nil +} + +type OpaqueCustomer_OpaqueLoyaltyInfo_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Tier *string + Points *int32 + TierExpiry *timestamppb.Timestamp + Rewards []string +} + +func (b0 OpaqueCustomer_OpaqueLoyaltyInfo_builder) Build() *OpaqueCustomer_OpaqueLoyaltyInfo { + m0 := &OpaqueCustomer_OpaqueLoyaltyInfo{} + b, x := &b0, m0 + _, _ = b, x + if b.Tier != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 4) + x.xxx_hidden_Tier = b.Tier + } + if b.Points != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 4) + x.xxx_hidden_Points = *b.Points + } + x.xxx_hidden_TierExpiry = b.TierExpiry + x.xxx_hidden_Rewards = b.Rewards + return m0 +} + +type OpaqueCustomer_OpaquePaymentMethod struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_PaymentId *string `protobuf:"bytes,1,opt,name=payment_id,json=paymentId"` + xxx_hidden_Type *string `protobuf:"bytes,2,opt,name=type"` + xxx_hidden_LastFour *string `protobuf:"bytes,3,opt,name=last_four,json=lastFour"` + xxx_hidden_Provider *string `protobuf:"bytes,4,opt,name=provider"` + xxx_hidden_ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=expires_at,json=expiresAt"` + xxx_hidden_IsDefault bool `protobuf:"varint,6,opt,name=is_default,json=isDefault"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) Reset() { + *x = OpaqueCustomer_OpaquePaymentMethod{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueCustomer_OpaquePaymentMethod) ProtoMessage() {} + +func (x *OpaqueCustomer_OpaquePaymentMethod) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) GetPaymentId() string { + if x != nil { + if x.xxx_hidden_PaymentId != nil { + return *x.xxx_hidden_PaymentId + } + return "" + } + return "" +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) GetType() string { + if x != nil { + if x.xxx_hidden_Type != nil { + return *x.xxx_hidden_Type + } + return "" + } + return "" +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) GetLastFour() string { + if x != nil { + if x.xxx_hidden_LastFour != nil { + return *x.xxx_hidden_LastFour + } + return "" + } + return "" +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) GetProvider() string { + if x != nil { + if x.xxx_hidden_Provider != nil { + return *x.xxx_hidden_Provider + } + return "" + } + return "" +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) GetExpiresAt() *timestamppb.Timestamp { + if x != nil { + return x.xxx_hidden_ExpiresAt + } + return nil +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) GetIsDefault() bool { + if x != nil { + return x.xxx_hidden_IsDefault + } + return false +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) SetPaymentId(v string) { + x.xxx_hidden_PaymentId = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 6) +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) SetType(v string) { + x.xxx_hidden_Type = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 6) +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) SetLastFour(v string) { + x.xxx_hidden_LastFour = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 6) +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) SetProvider(v string) { + x.xxx_hidden_Provider = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 6) +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) SetExpiresAt(v *timestamppb.Timestamp) { + x.xxx_hidden_ExpiresAt = v +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) SetIsDefault(v bool) { + x.xxx_hidden_IsDefault = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 5, 6) +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) HasPaymentId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) HasType() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) HasLastFour() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) HasProvider() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) HasExpiresAt() bool { + if x == nil { + return false + } + return x.xxx_hidden_ExpiresAt != nil +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) HasIsDefault() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 5) +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) ClearPaymentId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_PaymentId = nil +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) ClearType() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Type = nil +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) ClearLastFour() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_LastFour = nil +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) ClearProvider() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_Provider = nil +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) ClearExpiresAt() { + x.xxx_hidden_ExpiresAt = nil +} + +func (x *OpaqueCustomer_OpaquePaymentMethod) ClearIsDefault() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 5) + x.xxx_hidden_IsDefault = false +} + +type OpaqueCustomer_OpaquePaymentMethod_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + PaymentId *string + Type *string + LastFour *string + Provider *string + ExpiresAt *timestamppb.Timestamp + IsDefault *bool +} + +func (b0 OpaqueCustomer_OpaquePaymentMethod_builder) Build() *OpaqueCustomer_OpaquePaymentMethod { + m0 := &OpaqueCustomer_OpaquePaymentMethod{} + b, x := &b0, m0 + _, _ = b, x + if b.PaymentId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 6) + x.xxx_hidden_PaymentId = b.PaymentId + } + if b.Type != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 6) + x.xxx_hidden_Type = b.Type + } + if b.LastFour != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 6) + x.xxx_hidden_LastFour = b.LastFour + } + if b.Provider != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 6) + x.xxx_hidden_Provider = b.Provider + } + x.xxx_hidden_ExpiresAt = b.ExpiresAt + if b.IsDefault != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 5, 6) + x.xxx_hidden_IsDefault = *b.IsDefault + } + return m0 +} + +type OpaqueOrder_OpaqueShippingInfo struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Carrier *string `protobuf:"bytes,1,opt,name=carrier"` + xxx_hidden_Method *string `protobuf:"bytes,2,opt,name=method"` + xxx_hidden_EstimatedDeliveryTime *durationpb.Duration `protobuf:"bytes,3,opt,name=estimated_delivery_time,json=estimatedDeliveryTime"` + xxx_hidden_TrackingUrls []string `protobuf:"bytes,4,rep,name=tracking_urls,json=trackingUrls"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueOrder_OpaqueShippingInfo) Reset() { + *x = OpaqueOrder_OpaqueShippingInfo{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueOrder_OpaqueShippingInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueOrder_OpaqueShippingInfo) ProtoMessage() {} + +func (x *OpaqueOrder_OpaqueShippingInfo) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueOrder_OpaqueShippingInfo) GetCarrier() string { + if x != nil { + if x.xxx_hidden_Carrier != nil { + return *x.xxx_hidden_Carrier + } + return "" + } + return "" +} + +func (x *OpaqueOrder_OpaqueShippingInfo) GetMethod() string { + if x != nil { + if x.xxx_hidden_Method != nil { + return *x.xxx_hidden_Method + } + return "" + } + return "" +} + +func (x *OpaqueOrder_OpaqueShippingInfo) GetEstimatedDeliveryTime() *durationpb.Duration { + if x != nil { + return x.xxx_hidden_EstimatedDeliveryTime + } + return nil +} + +func (x *OpaqueOrder_OpaqueShippingInfo) GetTrackingUrls() []string { + if x != nil { + return x.xxx_hidden_TrackingUrls + } + return nil +} + +func (x *OpaqueOrder_OpaqueShippingInfo) SetCarrier(v string) { + x.xxx_hidden_Carrier = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 4) +} + +func (x *OpaqueOrder_OpaqueShippingInfo) SetMethod(v string) { + x.xxx_hidden_Method = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 4) +} + +func (x *OpaqueOrder_OpaqueShippingInfo) SetEstimatedDeliveryTime(v *durationpb.Duration) { + x.xxx_hidden_EstimatedDeliveryTime = v +} + +func (x *OpaqueOrder_OpaqueShippingInfo) SetTrackingUrls(v []string) { + x.xxx_hidden_TrackingUrls = v +} + +func (x *OpaqueOrder_OpaqueShippingInfo) HasCarrier() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *OpaqueOrder_OpaqueShippingInfo) HasMethod() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *OpaqueOrder_OpaqueShippingInfo) HasEstimatedDeliveryTime() bool { + if x == nil { + return false + } + return x.xxx_hidden_EstimatedDeliveryTime != nil +} + +func (x *OpaqueOrder_OpaqueShippingInfo) ClearCarrier() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Carrier = nil +} + +func (x *OpaqueOrder_OpaqueShippingInfo) ClearMethod() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Method = nil +} + +func (x *OpaqueOrder_OpaqueShippingInfo) ClearEstimatedDeliveryTime() { + x.xxx_hidden_EstimatedDeliveryTime = nil +} + +type OpaqueOrder_OpaqueShippingInfo_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Carrier *string + Method *string + EstimatedDeliveryTime *durationpb.Duration + TrackingUrls []string +} + +func (b0 OpaqueOrder_OpaqueShippingInfo_builder) Build() *OpaqueOrder_OpaqueShippingInfo { + m0 := &OpaqueOrder_OpaqueShippingInfo{} + b, x := &b0, m0 + _, _ = b, x + if b.Carrier != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 4) + x.xxx_hidden_Carrier = b.Carrier + } + if b.Method != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 4) + x.xxx_hidden_Method = b.Method + } + x.xxx_hidden_EstimatedDeliveryTime = b.EstimatedDeliveryTime + x.xxx_hidden_TrackingUrls = b.TrackingUrls + return m0 +} + +type OpaqueOrderSummary_OpaqueOrderError struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_OrderId *string `protobuf:"bytes,1,opt,name=order_id,json=orderId"` + xxx_hidden_ErrorCode *string `protobuf:"bytes,2,opt,name=error_code,json=errorCode"` + xxx_hidden_ErrorMessage *string `protobuf:"bytes,3,opt,name=error_message,json=errorMessage"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpaqueOrderSummary_OpaqueOrderError) Reset() { + *x = OpaqueOrderSummary_OpaqueOrderError{} + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpaqueOrderSummary_OpaqueOrderError) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpaqueOrderSummary_OpaqueOrderError) ProtoMessage() {} + +func (x *OpaqueOrderSummary_OpaqueOrderError) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_opaque_proto_msgTypes[32] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OpaqueOrderSummary_OpaqueOrderError) GetOrderId() string { + if x != nil { + if x.xxx_hidden_OrderId != nil { + return *x.xxx_hidden_OrderId + } + return "" + } + return "" +} + +func (x *OpaqueOrderSummary_OpaqueOrderError) GetErrorCode() string { + if x != nil { + if x.xxx_hidden_ErrorCode != nil { + return *x.xxx_hidden_ErrorCode + } + return "" + } + return "" +} + +func (x *OpaqueOrderSummary_OpaqueOrderError) GetErrorMessage() string { + if x != nil { + if x.xxx_hidden_ErrorMessage != nil { + return *x.xxx_hidden_ErrorMessage + } + return "" + } + return "" +} + +func (x *OpaqueOrderSummary_OpaqueOrderError) SetOrderId(v string) { + x.xxx_hidden_OrderId = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 3) +} + +func (x *OpaqueOrderSummary_OpaqueOrderError) SetErrorCode(v string) { + x.xxx_hidden_ErrorCode = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 3) +} + +func (x *OpaqueOrderSummary_OpaqueOrderError) SetErrorMessage(v string) { + x.xxx_hidden_ErrorMessage = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 3) +} + +func (x *OpaqueOrderSummary_OpaqueOrderError) HasOrderId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *OpaqueOrderSummary_OpaqueOrderError) HasErrorCode() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *OpaqueOrderSummary_OpaqueOrderError) HasErrorMessage() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *OpaqueOrderSummary_OpaqueOrderError) ClearOrderId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_OrderId = nil +} + +func (x *OpaqueOrderSummary_OpaqueOrderError) ClearErrorCode() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_ErrorCode = nil +} + +func (x *OpaqueOrderSummary_OpaqueOrderError) ClearErrorMessage() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_ErrorMessage = nil +} + +type OpaqueOrderSummary_OpaqueOrderError_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + OrderId *string + ErrorCode *string + ErrorMessage *string +} + +func (b0 OpaqueOrderSummary_OpaqueOrderError_builder) Build() *OpaqueOrderSummary_OpaqueOrderError { + m0 := &OpaqueOrderSummary_OpaqueOrderError{} + b, x := &b0, m0 + _, _ = b, x + if b.OrderId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 3) + x.xxx_hidden_OrderId = b.OrderId + } + if b.ErrorCode != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 3) + x.xxx_hidden_ErrorCode = b.ErrorCode + } + if b.ErrorMessage != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 3) + x.xxx_hidden_ErrorMessage = b.ErrorMessage + } + return m0 +} + +var File_examples_internal_proto_examplepb_opaque_proto protoreflect.FileDescriptor + +const file_examples_internal_proto_examplepb_opaque_proto_rawDesc = "" + + "\n" + + ".examples/internal/proto/examplepb/opaque.proto\x12.grpc.gateway.examples.internal.proto.examplepb\x1a\x1cgoogle/api/annotations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a google/protobuf/field_mask.proto\"\xe7\x01\n" + + "\x17OpaqueGetProductRequest\x12\x1d\n" + + "\n" + + "product_id\x18\x01 \x01(\tR\tproductId\x12)\n" + + "\x10include_variants\x18\x02 \x01(\bR\x0fincludeVariants\x128\n" + + "\x18include_related_products\x18\x03 \x01(\bR\x16includeRelatedProducts\x12#\n" + + "\rlanguage_code\x18\x04 \x01(\tR\flanguageCode\x12#\n" + + "\rcurrency_code\x18\x05 \x01(\tR\fcurrencyCode\"s\n" + + "\x18OpaqueGetProductResponse\x12W\n" + + "\aproduct\x18\x01 \x01(\v2=.grpc.gateway.examples.internal.proto.examplepb.OpaqueProductR\aproduct\"\xa0\b\n" + + "\x1bOpaqueSearchProductsRequest\x12\x14\n" + + "\x05query\x18\x01 \x01(\tR\x05query\x12!\n" + + "\fcategory_ids\x18\x02 \x03(\tR\vcategoryIds\x12\x16\n" + + "\x06brands\x18\x03 \x03(\tR\x06brands\x12X\n" + + "\tmin_price\x18\x04 \x01(\v2;.grpc.gateway.examples.internal.proto.examplepb.OpaquePriceR\bminPrice\x12X\n" + + "\tmax_price\x18\x05 \x01(\v2;.grpc.gateway.examples.internal.proto.examplepb.OpaquePriceR\bmaxPrice\x12\x12\n" + + "\x04tags\x18\x06 \x03(\tR\x04tags\x12t\n" + + "\asort_by\x18\a \x01(\x0e2[.grpc.gateway.examples.internal.proto.examplepb.OpaqueSearchProductsRequest.OpaqueSortOrderR\x06sortBy\x12\x12\n" + + "\x04page\x18\b \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\t \x01(\x05R\bpageSize\x12#\n" + + "\rlanguage_code\x18\n" + + " \x01(\tR\flanguageCode\x12#\n" + + "\rcurrency_code\x18\v \x01(\tR\fcurrencyCode\x129\n" + + "\n" + + "field_mask\x18\f \x01(\v2\x1a.google.protobuf.FieldMaskR\tfieldMask\x12r\n" + + "\afilters\x18\r \x03(\v2X.grpc.gateway.examples.internal.proto.examplepb.OpaqueSearchProductsRequest.FiltersEntryR\afilters\x1a:\n" + + "\fFiltersEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x8b\x02\n" + + "\x0fOpaqueSortOrder\x12!\n" + + "\x1dOPAQUE_SORT_ORDER_UNSPECIFIED\x10\x00\x12\x1f\n" + + "\x1bOPAQUE_SORT_ORDER_RELEVANCE\x10\x01\x12'\n" + + "#OPAQUE_SORT_ORDER_PRICE_LOW_TO_HIGH\x10\x02\x12'\n" + + "#OPAQUE_SORT_ORDER_PRICE_HIGH_TO_LOW\x10\x03\x12\"\n" + + "\x1eOPAQUE_SORT_ORDER_NEWEST_FIRST\x10\x04\x12\x1c\n" + + "\x18OPAQUE_SORT_ORDER_RATING\x10\x05\x12 \n" + + "\x1cOPAQUE_SORT_ORDER_POPULARITY\x10\x06\"w\n" + + "\x1cOpaqueSearchProductsResponse\x12W\n" + + "\aproduct\x18\x01 \x01(\v2=.grpc.gateway.examples.internal.proto.examplepb.OpaqueProductR\aproduct\"o\n" + + "\x1aOpaqueProcessOrdersRequest\x12Q\n" + + "\x05order\x18\x01 \x01(\v2;.grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderR\x05order\"{\n" + + "\x1bOpaqueProcessOrdersResponse\x12\\\n" + + "\asummary\x18\x01 \x01(\v2B.grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderSummaryR\asummary\"\x80\x01\n" + + "#OpaqueStreamCustomerActivityRequest\x12Y\n" + + "\x05event\x18\x01 \x01(\v2C.grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomerEventR\x05event\"\x82\x01\n" + + "$OpaqueStreamCustomerActivityResponse\x12Z\n" + + "\x05event\x18\x02 \x01(\v2D.grpc.gateway.examples.internal.proto.examplepb.OpaqueActivityUpdateR\x05event\"\xd4\x05\n" + + "\rOpaqueAddress\x12!\n" + + "\fstreet_line1\x18\x01 \x01(\tR\vstreetLine1\x12!\n" + + "\fstreet_line2\x18\x02 \x01(\tR\vstreetLine2\x12\x12\n" + + "\x04city\x18\x03 \x01(\tR\x04city\x12\x14\n" + + "\x05state\x18\x04 \x01(\tR\x05state\x12\x18\n" + + "\acountry\x18\x05 \x01(\tR\acountry\x12\x1f\n" + + "\vpostal_code\x18\x06 \x01(\tR\n" + + "postalCode\x12r\n" + + "\faddress_type\x18\a \x01(\x0e2O.grpc.gateway.examples.internal.proto.examplepb.OpaqueAddress.OpaqueAddressTypeR\vaddressType\x129\n" + + "\n" + + "is_default\x18\b \x01(\v2\x1a.google.protobuf.BoolValueR\tisDefault\x12g\n" + + "\bmetadata\x18\t \x03(\v2K.grpc.gateway.examples.internal.proto.examplepb.OpaqueAddress.MetadataEntryR\bmetadata\x1a;\n" + + "\rMetadataEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xc2\x01\n" + + "\x11OpaqueAddressType\x12#\n" + + "\x1fOPAQUE_ADDRESS_TYPE_UNSPECIFIED\x10\x00\x12#\n" + + "\x1fOPAQUE_ADDRESS_TYPE_RESIDENTIAL\x10\x01\x12 \n" + + "\x1cOPAQUE_ADDRESS_TYPE_BUSINESS\x10\x02\x12 \n" + + "\x1cOPAQUE_ADDRESS_TYPE_SHIPPING\x10\x03\x12\x1f\n" + + "\x1bOPAQUE_ADDRESS_TYPE_BILLING\x10\x04\"\xfe\x01\n" + + "\vOpaquePrice\x12\x16\n" + + "\x06amount\x18\x01 \x01(\x01R\x06amount\x12#\n" + + "\rcurrency_code\x18\x02 \x01(\tR\fcurrencyCode\x12#\n" + + "\ris_discounted\x18\x03 \x01(\bR\fisDiscounted\x12E\n" + + "\x0foriginal_amount\x18\x04 \x01(\v2\x1c.google.protobuf.DoubleValueR\x0eoriginalAmount\x12F\n" + + "\x11price_valid_until\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\x0fpriceValidUntil\"\xe8\x02\n" + + "\x15OpaqueProductCategory\x12\x1f\n" + + "\vcategory_id\x18\x01 \x01(\tR\n" + + "categoryId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12n\n" + + "\x0fparent_category\x18\x04 \x01(\v2E.grpc.gateway.examples.internal.proto.examplepb.OpaqueProductCategoryR\x0eparentCategory\x12\x12\n" + + "\x04tags\x18\x05 \x03(\tR\x04tags\x129\n" + + "\n" + + "created_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + + "\n" + + "updated_at\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"\xef\x04\n" + + "\x14OpaqueProductVariant\x12\x1d\n" + + "\n" + + "variant_id\x18\x01 \x01(\tR\tvariantId\x12\x10\n" + + "\x03sku\x18\x02 \x01(\tR\x03sku\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12Q\n" + + "\x05price\x18\x04 \x01(\v2;.grpc.gateway.examples.internal.proto.examplepb.OpaquePriceR\x05price\x12'\n" + + "\x0finventory_count\x18\x05 \x01(\x05R\x0einventoryCount\x12t\n" + + "\n" + + "attributes\x18\x06 \x03(\v2T.grpc.gateway.examples.internal.proto.examplepb.OpaqueProductVariant.AttributesEntryR\n" + + "attributes\x12\x1d\n" + + "\n" + + "image_data\x18\a \x01(\fR\timageData\x12\x1d\n" + + "\n" + + "image_urls\x18\b \x03(\tR\timageUrls\x12=\n" + + "\fis_available\x18\t \x01(\v2\x1a.google.protobuf.BoolValueR\visAvailable\x12'\n" + + "\x0epercentage_off\x18\n" + + " \x01(\x01H\x00R\rpercentageOff\x12*\n" + + "\x10fixed_amount_off\x18\v \x01(\x01H\x00R\x0efixedAmountOff\x1a=\n" + + "\x0fAttributesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01B\x0f\n" + + "\rdiscount_info\"\xf4\x0f\n" + + "\rOpaqueProduct\x12\x1d\n" + + "\n" + + "product_id\x18\x01 \x01(\tR\tproductId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x14\n" + + "\x05brand\x18\x04 \x01(\tR\x05brand\x12Z\n" + + "\n" + + "base_price\x18\x05 \x01(\v2;.grpc.gateway.examples.internal.proto.examplepb.OpaquePriceR\tbasePrice\x12a\n" + + "\bcategory\x18\x06 \x01(\v2E.grpc.gateway.examples.internal.proto.examplepb.OpaqueProductCategoryR\bcategory\x12`\n" + + "\bvariants\x18\a \x03(\v2D.grpc.gateway.examples.internal.proto.examplepb.OpaqueProductVariantR\bvariants\x12\x12\n" + + "\x04tags\x18\b \x03(\tR\x04tags\x12%\n" + + "\x0eaverage_rating\x18\t \x01(\x01R\raverageRating\x12!\n" + + "\freview_count\x18\n" + + " \x01(\x05R\vreviewCount\x12;\n" + + "\vis_featured\x18\v \x01(\v2\x1a.google.protobuf.BoolValueR\n" + + "isFeatured\x129\n" + + "\n" + + "created_at\x18\f \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + + "\n" + + "updated_at\x18\r \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\x12M\n" + + "\x15average_shipping_time\x18\x0e \x01(\v2\x19.google.protobuf.DurationR\x13averageShippingTime\x12i\n" + + "\x06status\x18\x0f \x01(\x0e2Q.grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.OpaqueProductStatusR\x06status\x12g\n" + + "\bmetadata\x18\x10 \x03(\v2K.grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.MetadataEntryR\bmetadata\x12z\n" + + "\x0fregional_prices\x18\x11 \x03(\v2Q.grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.RegionalPricesEntryR\x0eregionalPrices\x12u\n" + + "\n" + + "dimensions\x18\x12 \x01(\v2U.grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.OpaqueProductDimensionsR\n" + + "dimensions\x12'\n" + + "\x0etax_percentage\x18\x13 \x01(\x01H\x00R\rtaxPercentage\x12\x1f\n" + + "\n" + + "tax_exempt\x18\x14 \x01(\bH\x00R\ttaxExempt\x1a;\n" + + "\rMetadataEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a~\n" + + "\x13RegionalPricesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12Q\n" + + "\x05value\x18\x02 \x01(\v2;.grpc.gateway.examples.internal.proto.examplepb.OpaquePriceR\x05value:\x028\x01\x1a\xca\x02\n" + + "\x17OpaqueProductDimensions\x12\x16\n" + + "\x06length\x18\x01 \x01(\x01R\x06length\x12\x14\n" + + "\x05width\x18\x02 \x01(\x01R\x05width\x12\x16\n" + + "\x06height\x18\x03 \x01(\x01R\x06height\x12\x16\n" + + "\x06weight\x18\x04 \x01(\x01R\x06weight\x12t\n" + + "\x04unit\x18\x05 \x01(\x0e2`.grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.OpaqueProductDimensions.OpaqueUnitR\x04unit\"[\n" + + "\n" + + "OpaqueUnit\x12\x1b\n" + + "\x17OPAQUE_UNIT_UNSPECIFIED\x10\x00\x12\x16\n" + + "\x12OPAQUE_UNIT_METRIC\x10\x01\x12\x18\n" + + "\x14OPAQUE_UNIT_IMPERIAL\x10\x02\"\xcf\x01\n" + + "\x13OpaqueProductStatus\x12%\n" + + "!OPAQUE_PRODUCT_STATUS_UNSPECIFIED\x10\x00\x12\x1f\n" + + "\x1bOPAQUE_PRODUCT_STATUS_DRAFT\x10\x01\x12 \n" + + "\x1cOPAQUE_PRODUCT_STATUS_ACTIVE\x10\x02\x12&\n" + + "\"OPAQUE_PRODUCT_STATUS_OUT_OF_STOCK\x10\x03\x12&\n" + + "\"OPAQUE_PRODUCT_STATUS_DISCONTINUED\x10\x04B\n" + + "\n" + + "\btax_info\"\xd5\v\n" + + "\x0eOpaqueCustomer\x12\x1f\n" + + "\vcustomer_id\x18\x01 \x01(\tR\n" + + "customerId\x12\x14\n" + + "\x05email\x18\x02 \x01(\tR\x05email\x12\x1d\n" + + "\n" + + "first_name\x18\x03 \x01(\tR\tfirstName\x12\x1b\n" + + "\tlast_name\x18\x04 \x01(\tR\blastName\x12!\n" + + "\fphone_number\x18\x05 \x01(\tR\vphoneNumber\x12[\n" + + "\taddresses\x18\x06 \x03(\v2=.grpc.gateway.examples.internal.proto.examplepb.OpaqueAddressR\taddresses\x129\n" + + "\n" + + "created_at\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + + "\n" + + "last_login\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\tlastLogin\x12k\n" + + "\x06status\x18\t \x01(\x0e2S.grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer.OpaqueCustomerStatusR\x06status\x12s\n" + + "\floyalty_info\x18\n" + + " \x01(\v2P.grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer.OpaqueLoyaltyInfoR\vloyaltyInfo\x12q\n" + + "\vpreferences\x18\v \x03(\v2O.grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer.PreferencesEntryR\vpreferences\x12{\n" + + "\x0fpayment_methods\x18\f \x03(\v2R.grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer.OpaquePaymentMethodR\x0epaymentMethods\x1a\x96\x01\n" + + "\x11OpaqueLoyaltyInfo\x12\x12\n" + + "\x04tier\x18\x01 \x01(\tR\x04tier\x12\x16\n" + + "\x06points\x18\x02 \x01(\x05R\x06points\x12;\n" + + "\vtier_expiry\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "tierExpiry\x12\x18\n" + + "\arewards\x18\x04 \x03(\tR\arewards\x1a>\n" + + "\x10PreferencesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a\xdb\x01\n" + + "\x13OpaquePaymentMethod\x12\x1d\n" + + "\n" + + "payment_id\x18\x01 \x01(\tR\tpaymentId\x12\x12\n" + + "\x04type\x18\x02 \x01(\tR\x04type\x12\x1b\n" + + "\tlast_four\x18\x03 \x01(\tR\blastFour\x12\x1a\n" + + "\bprovider\x18\x04 \x01(\tR\bprovider\x129\n" + + "\n" + + "expires_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\texpiresAt\x12\x1d\n" + + "\n" + + "is_default\x18\x06 \x01(\bR\tisDefault\"\xd0\x01\n" + + "\x14OpaqueCustomerStatus\x12&\n" + + "\"OPAQUE_CUSTOMER_STATUS_UNSPECIFIED\x10\x00\x12!\n" + + "\x1dOPAQUE_CUSTOMER_STATUS_ACTIVE\x10\x01\x12#\n" + + "\x1fOPAQUE_CUSTOMER_STATUS_INACTIVE\x10\x02\x12$\n" + + " OPAQUE_CUSTOMER_STATUS_SUSPENDED\x10\x03\x12\"\n" + + "\x1eOPAQUE_CUSTOMER_STATUS_DELETED\x10\x04\"\xfc\x04\n" + + "\x0fOpaqueOrderItem\x12\x1d\n" + + "\n" + + "product_id\x18\x01 \x01(\tR\tproductId\x12\x1d\n" + + "\n" + + "variant_id\x18\x02 \x01(\tR\tvariantId\x12!\n" + + "\fproduct_name\x18\x03 \x01(\tR\vproductName\x12\x1a\n" + + "\bquantity\x18\x04 \x01(\x05R\bquantity\x12Z\n" + + "\n" + + "unit_price\x18\x05 \x01(\v2;.grpc.gateway.examples.internal.proto.examplepb.OpaquePriceR\tunitPrice\x12\\\n" + + "\vtotal_price\x18\x06 \x01(\v2;.grpc.gateway.examples.internal.proto.examplepb.OpaquePriceR\n" + + "totalPrice\x12\x88\x01\n" + + "\x13selected_attributes\x18\a \x03(\v2W.grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderItem.SelectedAttributesEntryR\x12selectedAttributes\x12=\n" + + "\fgift_wrapped\x18\b \x01(\v2\x1a.google.protobuf.BoolValueR\vgiftWrapped\x12!\n" + + "\fgift_message\x18\t \x01(\tR\vgiftMessage\x1aE\n" + + "\x17SelectedAttributesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xb1\x0f\n" + + "\vOpaqueOrder\x12\x19\n" + + "\border_id\x18\x01 \x01(\tR\aorderId\x12\x1f\n" + + "\vcustomer_id\x18\x02 \x01(\tR\n" + + "customerId\x12U\n" + + "\x05items\x18\x03 \x03(\v2?.grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderItemR\x05items\x12W\n" + + "\bsubtotal\x18\x04 \x01(\v2;.grpc.gateway.examples.internal.proto.examplepb.OpaquePriceR\bsubtotal\x12M\n" + + "\x03tax\x18\x05 \x01(\v2;.grpc.gateway.examples.internal.proto.examplepb.OpaquePriceR\x03tax\x12W\n" + + "\bshipping\x18\x06 \x01(\v2;.grpc.gateway.examples.internal.proto.examplepb.OpaquePriceR\bshipping\x12Q\n" + + "\x05total\x18\a \x01(\v2;.grpc.gateway.examples.internal.proto.examplepb.OpaquePriceR\x05total\x12h\n" + + "\x10shipping_address\x18\b \x01(\v2=.grpc.gateway.examples.internal.proto.examplepb.OpaqueAddressR\x0fshippingAddress\x12f\n" + + "\x0fbilling_address\x18\t \x01(\v2=.grpc.gateway.examples.internal.proto.examplepb.OpaqueAddressR\x0ebillingAddress\x12e\n" + + "\x06status\x18\n" + + " \x01(\x0e2M.grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.OpaqueOrderStatusR\x06status\x12*\n" + + "\x11payment_method_id\x18\v \x01(\tR\x0fpaymentMethodId\x12'\n" + + "\x0ftracking_number\x18\f \x01(\tR\x0etrackingNumber\x129\n" + + "\n" + + "created_at\x18\r \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + + "\n" + + "updated_at\x18\x0e \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\x129\n" + + "\n" + + "shipped_at\x18\x0f \x01(\v2\x1a.google.protobuf.TimestampR\tshippedAt\x12=\n" + + "\fdelivered_at\x18\x10 \x01(\v2\x1a.google.protobuf.TimestampR\vdeliveredAt\x12s\n" + + "\rshipping_info\x18\x11 \x01(\v2N.grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.OpaqueShippingInfoR\fshippingInfo\x12e\n" + + "\bmetadata\x18\x12 \x03(\v2I.grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.MetadataEntryR\bmetadata\x12!\n" + + "\vcoupon_code\x18\x13 \x01(\tH\x00R\n" + + "couponCode\x12#\n" + + "\fpromotion_id\x18\x14 \x01(\tH\x00R\vpromotionId\x1a\xbe\x01\n" + + "\x12OpaqueShippingInfo\x12\x18\n" + + "\acarrier\x18\x01 \x01(\tR\acarrier\x12\x16\n" + + "\x06method\x18\x02 \x01(\tR\x06method\x12Q\n" + + "\x17estimated_delivery_time\x18\x03 \x01(\v2\x19.google.protobuf.DurationR\x15estimatedDeliveryTime\x12#\n" + + "\rtracking_urls\x18\x04 \x03(\tR\ftrackingUrls\x1a;\n" + + "\rMetadataEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x86\x02\n" + + "\x11OpaqueOrderStatus\x12#\n" + + "\x1fOPAQUE_ORDER_STATUS_UNSPECIFIED\x10\x00\x12\x1f\n" + + "\x1bOPAQUE_ORDER_STATUS_PENDING\x10\x01\x12\"\n" + + "\x1eOPAQUE_ORDER_STATUS_PROCESSING\x10\x02\x12\x1f\n" + + "\x1bOPAQUE_ORDER_STATUS_SHIPPED\x10\x03\x12!\n" + + "\x1dOPAQUE_ORDER_STATUS_DELIVERED\x10\x04\x12!\n" + + "\x1dOPAQUE_ORDER_STATUS_CANCELLED\x10\x05\x12 \n" + + "\x1cOPAQUE_ORDER_STATUS_RETURNED\x10\x06B\x12\n" + + "\x10discount_applied\"\xf8\x05\n" + + "\x12OpaqueOrderSummary\x124\n" + + "\x16total_orders_processed\x18\x01 \x01(\x05R\x14totalOrdersProcessed\x12+\n" + + "\x11successful_orders\x18\x02 \x01(\x05R\x10successfulOrders\x12#\n" + + "\rfailed_orders\x18\x03 \x01(\x05R\ffailedOrders\x12\\\n" + + "\vtotal_value\x18\x04 \x01(\v2;.grpc.gateway.examples.internal.proto.examplepb.OpaquePriceR\n" + + "totalValue\x12\x1b\n" + + "\torder_ids\x18\x05 \x03(\tR\borderIds\x12y\n" + + "\rerror_details\x18\x06 \x03(\v2T.grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderSummary.ErrorDetailsEntryR\ferrorDetails\x12C\n" + + "\x0fprocessing_time\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\x0eprocessingTime\x12k\n" + + "\x06errors\x18\b \x03(\v2S.grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderSummary.OpaqueOrderErrorR\x06errors\x1a?\n" + + "\x11ErrorDetailsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1aq\n" + + "\x10OpaqueOrderError\x12\x19\n" + + "\border_id\x18\x01 \x01(\tR\aorderId\x12\x1d\n" + + "\n" + + "error_code\x18\x02 \x01(\tR\terrorCode\x12#\n" + + "\rerror_message\x18\x03 \x01(\tR\ferrorMessage\"\x81\b\n" + + "\x13OpaqueCustomerEvent\x12\x1f\n" + + "\vcustomer_id\x18\x01 \x01(\tR\n" + + "customerId\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\x12r\n" + + "\n" + + "event_type\x18\x03 \x01(\x0e2S.grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomerEvent.OpaqueEventTypeR\teventType\x128\n" + + "\ttimestamp\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\x12\x1d\n" + + "\n" + + "product_id\x18\x05 \x01(\tR\tproductId\x12\x1f\n" + + "\vcategory_id\x18\x06 \x01(\tR\n" + + "categoryId\x12!\n" + + "\fsearch_query\x18\a \x01(\tR\vsearchQuery\x12\x19\n" + + "\bpage_url\x18\b \x01(\tR\apageUrl\x12\x14\n" + + "\x05value\x18\t \x01(\x05R\x05value\x12q\n" + + "\n" + + "event_data\x18\n" + + " \x03(\v2R.grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomerEvent.EventDataEntryR\teventData\x12\x1f\n" + + "\vdevice_type\x18\v \x01(\tR\n" + + "deviceType\x12\x1d\n" + + "\n" + + "ip_address\x18\f \x01(\tR\tipAddress\x12\x1d\n" + + "\n" + + "user_agent\x18\r \x01(\tR\tuserAgent\x1a<\n" + + "\x0eEventDataEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xd7\x02\n" + + "\x0fOpaqueEventType\x12!\n" + + "\x1dOPAQUE_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x1f\n" + + "\x1bOPAQUE_EVENT_TYPE_PAGE_VIEW\x10\x01\x12\"\n" + + "\x1eOPAQUE_EVENT_TYPE_PRODUCT_VIEW\x10\x02\x12!\n" + + "\x1dOPAQUE_EVENT_TYPE_ADD_TO_CART\x10\x03\x12&\n" + + "\"OPAQUE_EVENT_TYPE_REMOVE_FROM_CART\x10\x04\x12$\n" + + " OPAQUE_EVENT_TYPE_CHECKOUT_START\x10\x05\x12'\n" + + "#OPAQUE_EVENT_TYPE_CHECKOUT_COMPLETE\x10\x06\x12\x1c\n" + + "\x18OPAQUE_EVENT_TYPE_SEARCH\x10\a\x12$\n" + + " OPAQUE_EVENT_TYPE_ACCOUNT_UPDATE\x10\b\"\xa2\t\n" + + "\x14OpaqueActivityUpdate\x12\x1f\n" + + "\vcustomer_id\x18\x01 \x01(\tR\n" + + "customerId\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\x12v\n" + + "\vupdate_type\x18\x03 \x01(\x0e2U.grpc.gateway.examples.internal.proto.examplepb.OpaqueActivityUpdate.OpaqueUpdateTypeR\n" + + "updateType\x128\n" + + "\ttimestamp\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\x12\x18\n" + + "\amessage\x18\x05 \x01(\tR\amessage\x12\x1f\n" + + "\vproduct_ids\x18\x06 \x03(\tR\n" + + "productIds\x12^\n" + + "\fprice_update\x18\a \x01(\v2;.grpc.gateway.examples.internal.proto.examplepb.OpaquePriceR\vpriceUpdate\x12'\n" + + "\x0finventory_count\x18\b \x01(\x05R\x0einventoryCount\x12\x1d\n" + + "\n" + + "offer_code\x18\t \x01(\tR\tofferCode\x12<\n" + + "\foffer_expiry\x18\n" + + " \x01(\v2\x19.google.protobuf.DurationR\vofferExpiry\x12/\n" + + "\x13discount_percentage\x18\v \x01(\x01R\x12discountPercentage\x12u\n" + + "\vupdate_data\x18\f \x03(\v2T.grpc.gateway.examples.internal.proto.examplepb.OpaqueActivityUpdate.UpdateDataEntryR\n" + + "updateData\x12\x1a\n" + + "\bpriority\x18\r \x01(\x05R\bpriority\x12#\n" + + "\fredirect_url\x18\x0e \x01(\tH\x00R\vredirectUrl\x12)\n" + + "\x0fnotification_id\x18\x0f \x01(\tH\x00R\x0enotificationId\x1a=\n" + + "\x0fUpdateDataEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x94\x02\n" + + "\x10OpaqueUpdateType\x12\"\n" + + "\x1eOPAQUE_UPDATE_TYPE_UNSPECIFIED\x10\x00\x12%\n" + + "!OPAQUE_UPDATE_TYPE_RECOMMENDATION\x10\x01\x12#\n" + + "\x1fOPAQUE_UPDATE_TYPE_NOTIFICATION\x10\x02\x12\x1c\n" + + "\x18OPAQUE_UPDATE_TYPE_OFFER\x10\x03\x12'\n" + + "#OPAQUE_UPDATE_TYPE_INVENTORY_UPDATE\x10\x04\x12#\n" + + "\x1fOPAQUE_UPDATE_TYPE_PRICE_CHANGE\x10\x05\x12$\n" + + " OPAQUE_UPDATE_TYPE_CART_REMINDER\x10\x06B\r\n" + + "\vaction_data2\xfa\x06\n" + + "\x16OpaqueEcommerceService\x12\xc8\x01\n" + + "\x10OpaqueGetProduct\x12G.grpc.gateway.examples.internal.proto.examplepb.OpaqueGetProductRequest\x1aH.grpc.gateway.examples.internal.proto.examplepb.OpaqueGetProductResponse\"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/v1/products/{product_id}\x12\xd0\x01\n" + + "\x14OpaqueSearchProducts\x12K.grpc.gateway.examples.internal.proto.examplepb.OpaqueSearchProductsRequest\x1aL.grpc.gateway.examples.internal.proto.examplepb.OpaqueSearchProductsResponse\"\x1b\x82\xd3\xe4\x93\x02\x15\x12\x13/v1/products/search0\x01\x12\xcf\x01\n" + + "\x13OpaqueProcessOrders\x12J.grpc.gateway.examples.internal.proto.examplepb.OpaqueProcessOrdersRequest\x1aK.grpc.gateway.examples.internal.proto.examplepb.OpaqueProcessOrdersResponse\"\x1d\x82\xd3\xe4\x93\x02\x17:\x01*\"\x12/v1/orders/process(\x01\x12\xef\x01\n" + + "\x1cOpaqueStreamCustomerActivity\x12S.grpc.gateway.examples.internal.proto.examplepb.OpaqueStreamCustomerActivityRequest\x1aT.grpc.gateway.examples.internal.proto.examplepb.OpaqueStreamCustomerActivityResponse\" \x82\xd3\xe4\x93\x02\x1a:\x01*\"\x15/v1/customer/activity(\x010\x01BMZKgithub.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepbb\beditionsp\xe8\a" + +var file_examples_internal_proto_examplepb_opaque_proto_enumTypes = make([]protoimpl.EnumInfo, 8) +var file_examples_internal_proto_examplepb_opaque_proto_msgTypes = make([]protoimpl.MessageInfo, 35) +var file_examples_internal_proto_examplepb_opaque_proto_goTypes = []any{ + (OpaqueSearchProductsRequest_OpaqueSortOrder)(0), // 0: grpc.gateway.examples.internal.proto.examplepb.OpaqueSearchProductsRequest.OpaqueSortOrder + (OpaqueAddress_OpaqueAddressType)(0), // 1: grpc.gateway.examples.internal.proto.examplepb.OpaqueAddress.OpaqueAddressType + (OpaqueProduct_OpaqueProductStatus)(0), // 2: grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.OpaqueProductStatus + (OpaqueProduct_OpaqueProductDimensions_OpaqueUnit)(0), // 3: grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.OpaqueProductDimensions.OpaqueUnit + (OpaqueCustomer_OpaqueCustomerStatus)(0), // 4: grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer.OpaqueCustomerStatus + (OpaqueOrder_OpaqueOrderStatus)(0), // 5: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.OpaqueOrderStatus + (OpaqueCustomerEvent_OpaqueEventType)(0), // 6: grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomerEvent.OpaqueEventType + (OpaqueActivityUpdate_OpaqueUpdateType)(0), // 7: grpc.gateway.examples.internal.proto.examplepb.OpaqueActivityUpdate.OpaqueUpdateType + (*OpaqueGetProductRequest)(nil), // 8: grpc.gateway.examples.internal.proto.examplepb.OpaqueGetProductRequest + (*OpaqueGetProductResponse)(nil), // 9: grpc.gateway.examples.internal.proto.examplepb.OpaqueGetProductResponse + (*OpaqueSearchProductsRequest)(nil), // 10: grpc.gateway.examples.internal.proto.examplepb.OpaqueSearchProductsRequest + (*OpaqueSearchProductsResponse)(nil), // 11: grpc.gateway.examples.internal.proto.examplepb.OpaqueSearchProductsResponse + (*OpaqueProcessOrdersRequest)(nil), // 12: grpc.gateway.examples.internal.proto.examplepb.OpaqueProcessOrdersRequest + (*OpaqueProcessOrdersResponse)(nil), // 13: grpc.gateway.examples.internal.proto.examplepb.OpaqueProcessOrdersResponse + (*OpaqueStreamCustomerActivityRequest)(nil), // 14: grpc.gateway.examples.internal.proto.examplepb.OpaqueStreamCustomerActivityRequest + (*OpaqueStreamCustomerActivityResponse)(nil), // 15: grpc.gateway.examples.internal.proto.examplepb.OpaqueStreamCustomerActivityResponse + (*OpaqueAddress)(nil), // 16: grpc.gateway.examples.internal.proto.examplepb.OpaqueAddress + (*OpaquePrice)(nil), // 17: grpc.gateway.examples.internal.proto.examplepb.OpaquePrice + (*OpaqueProductCategory)(nil), // 18: grpc.gateway.examples.internal.proto.examplepb.OpaqueProductCategory + (*OpaqueProductVariant)(nil), // 19: grpc.gateway.examples.internal.proto.examplepb.OpaqueProductVariant + (*OpaqueProduct)(nil), // 20: grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct + (*OpaqueCustomer)(nil), // 21: grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer + (*OpaqueOrderItem)(nil), // 22: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderItem + (*OpaqueOrder)(nil), // 23: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder + (*OpaqueOrderSummary)(nil), // 24: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderSummary + (*OpaqueCustomerEvent)(nil), // 25: grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomerEvent + (*OpaqueActivityUpdate)(nil), // 26: grpc.gateway.examples.internal.proto.examplepb.OpaqueActivityUpdate + nil, // 27: grpc.gateway.examples.internal.proto.examplepb.OpaqueSearchProductsRequest.FiltersEntry + nil, // 28: grpc.gateway.examples.internal.proto.examplepb.OpaqueAddress.MetadataEntry + nil, // 29: grpc.gateway.examples.internal.proto.examplepb.OpaqueProductVariant.AttributesEntry + nil, // 30: grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.MetadataEntry + nil, // 31: grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.RegionalPricesEntry + (*OpaqueProduct_OpaqueProductDimensions)(nil), // 32: grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.OpaqueProductDimensions + (*OpaqueCustomer_OpaqueLoyaltyInfo)(nil), // 33: grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer.OpaqueLoyaltyInfo + nil, // 34: grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer.PreferencesEntry + (*OpaqueCustomer_OpaquePaymentMethod)(nil), // 35: grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer.OpaquePaymentMethod + nil, // 36: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderItem.SelectedAttributesEntry + (*OpaqueOrder_OpaqueShippingInfo)(nil), // 37: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.OpaqueShippingInfo + nil, // 38: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.MetadataEntry + nil, // 39: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderSummary.ErrorDetailsEntry + (*OpaqueOrderSummary_OpaqueOrderError)(nil), // 40: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderSummary.OpaqueOrderError + nil, // 41: grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomerEvent.EventDataEntry + nil, // 42: grpc.gateway.examples.internal.proto.examplepb.OpaqueActivityUpdate.UpdateDataEntry + (*fieldmaskpb.FieldMask)(nil), // 43: google.protobuf.FieldMask + (*wrapperspb.BoolValue)(nil), // 44: google.protobuf.BoolValue + (*wrapperspb.DoubleValue)(nil), // 45: google.protobuf.DoubleValue + (*timestamppb.Timestamp)(nil), // 46: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 47: google.protobuf.Duration +} +var file_examples_internal_proto_examplepb_opaque_proto_depIdxs = []int32{ + 20, // 0: grpc.gateway.examples.internal.proto.examplepb.OpaqueGetProductResponse.product:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct + 17, // 1: grpc.gateway.examples.internal.proto.examplepb.OpaqueSearchProductsRequest.min_price:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaquePrice + 17, // 2: grpc.gateway.examples.internal.proto.examplepb.OpaqueSearchProductsRequest.max_price:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaquePrice + 0, // 3: grpc.gateway.examples.internal.proto.examplepb.OpaqueSearchProductsRequest.sort_by:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueSearchProductsRequest.OpaqueSortOrder + 43, // 4: grpc.gateway.examples.internal.proto.examplepb.OpaqueSearchProductsRequest.field_mask:type_name -> google.protobuf.FieldMask + 27, // 5: grpc.gateway.examples.internal.proto.examplepb.OpaqueSearchProductsRequest.filters:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueSearchProductsRequest.FiltersEntry + 20, // 6: grpc.gateway.examples.internal.proto.examplepb.OpaqueSearchProductsResponse.product:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct + 23, // 7: grpc.gateway.examples.internal.proto.examplepb.OpaqueProcessOrdersRequest.order:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder + 24, // 8: grpc.gateway.examples.internal.proto.examplepb.OpaqueProcessOrdersResponse.summary:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderSummary + 25, // 9: grpc.gateway.examples.internal.proto.examplepb.OpaqueStreamCustomerActivityRequest.event:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomerEvent + 26, // 10: grpc.gateway.examples.internal.proto.examplepb.OpaqueStreamCustomerActivityResponse.event:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueActivityUpdate + 1, // 11: grpc.gateway.examples.internal.proto.examplepb.OpaqueAddress.address_type:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueAddress.OpaqueAddressType + 44, // 12: grpc.gateway.examples.internal.proto.examplepb.OpaqueAddress.is_default:type_name -> google.protobuf.BoolValue + 28, // 13: grpc.gateway.examples.internal.proto.examplepb.OpaqueAddress.metadata:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueAddress.MetadataEntry + 45, // 14: grpc.gateway.examples.internal.proto.examplepb.OpaquePrice.original_amount:type_name -> google.protobuf.DoubleValue + 46, // 15: grpc.gateway.examples.internal.proto.examplepb.OpaquePrice.price_valid_until:type_name -> google.protobuf.Timestamp + 18, // 16: grpc.gateway.examples.internal.proto.examplepb.OpaqueProductCategory.parent_category:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueProductCategory + 46, // 17: grpc.gateway.examples.internal.proto.examplepb.OpaqueProductCategory.created_at:type_name -> google.protobuf.Timestamp + 46, // 18: grpc.gateway.examples.internal.proto.examplepb.OpaqueProductCategory.updated_at:type_name -> google.protobuf.Timestamp + 17, // 19: grpc.gateway.examples.internal.proto.examplepb.OpaqueProductVariant.price:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaquePrice + 29, // 20: grpc.gateway.examples.internal.proto.examplepb.OpaqueProductVariant.attributes:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueProductVariant.AttributesEntry + 44, // 21: grpc.gateway.examples.internal.proto.examplepb.OpaqueProductVariant.is_available:type_name -> google.protobuf.BoolValue + 17, // 22: grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.base_price:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaquePrice + 18, // 23: grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.category:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueProductCategory + 19, // 24: grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.variants:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueProductVariant + 44, // 25: grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.is_featured:type_name -> google.protobuf.BoolValue + 46, // 26: grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.created_at:type_name -> google.protobuf.Timestamp + 46, // 27: grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.updated_at:type_name -> google.protobuf.Timestamp + 47, // 28: grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.average_shipping_time:type_name -> google.protobuf.Duration + 2, // 29: grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.status:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.OpaqueProductStatus + 30, // 30: grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.metadata:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.MetadataEntry + 31, // 31: grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.regional_prices:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.RegionalPricesEntry + 32, // 32: grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.dimensions:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.OpaqueProductDimensions + 16, // 33: grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer.addresses:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueAddress + 46, // 34: grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer.created_at:type_name -> google.protobuf.Timestamp + 46, // 35: grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer.last_login:type_name -> google.protobuf.Timestamp + 4, // 36: grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer.status:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer.OpaqueCustomerStatus + 33, // 37: grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer.loyalty_info:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer.OpaqueLoyaltyInfo + 34, // 38: grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer.preferences:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer.PreferencesEntry + 35, // 39: grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer.payment_methods:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer.OpaquePaymentMethod + 17, // 40: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderItem.unit_price:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaquePrice + 17, // 41: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderItem.total_price:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaquePrice + 36, // 42: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderItem.selected_attributes:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderItem.SelectedAttributesEntry + 44, // 43: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderItem.gift_wrapped:type_name -> google.protobuf.BoolValue + 22, // 44: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.items:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderItem + 17, // 45: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.subtotal:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaquePrice + 17, // 46: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.tax:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaquePrice + 17, // 47: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.shipping:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaquePrice + 17, // 48: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.total:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaquePrice + 16, // 49: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.shipping_address:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueAddress + 16, // 50: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.billing_address:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueAddress + 5, // 51: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.status:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.OpaqueOrderStatus + 46, // 52: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.created_at:type_name -> google.protobuf.Timestamp + 46, // 53: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.updated_at:type_name -> google.protobuf.Timestamp + 46, // 54: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.shipped_at:type_name -> google.protobuf.Timestamp + 46, // 55: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.delivered_at:type_name -> google.protobuf.Timestamp + 37, // 56: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.shipping_info:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.OpaqueShippingInfo + 38, // 57: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.metadata:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.MetadataEntry + 17, // 58: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderSummary.total_value:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaquePrice + 39, // 59: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderSummary.error_details:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderSummary.ErrorDetailsEntry + 46, // 60: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderSummary.processing_time:type_name -> google.protobuf.Timestamp + 40, // 61: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderSummary.errors:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueOrderSummary.OpaqueOrderError + 6, // 62: grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomerEvent.event_type:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomerEvent.OpaqueEventType + 46, // 63: grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomerEvent.timestamp:type_name -> google.protobuf.Timestamp + 41, // 64: grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomerEvent.event_data:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomerEvent.EventDataEntry + 7, // 65: grpc.gateway.examples.internal.proto.examplepb.OpaqueActivityUpdate.update_type:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueActivityUpdate.OpaqueUpdateType + 46, // 66: grpc.gateway.examples.internal.proto.examplepb.OpaqueActivityUpdate.timestamp:type_name -> google.protobuf.Timestamp + 17, // 67: grpc.gateway.examples.internal.proto.examplepb.OpaqueActivityUpdate.price_update:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaquePrice + 47, // 68: grpc.gateway.examples.internal.proto.examplepb.OpaqueActivityUpdate.offer_expiry:type_name -> google.protobuf.Duration + 42, // 69: grpc.gateway.examples.internal.proto.examplepb.OpaqueActivityUpdate.update_data:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueActivityUpdate.UpdateDataEntry + 17, // 70: grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.RegionalPricesEntry.value:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaquePrice + 3, // 71: grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.OpaqueProductDimensions.unit:type_name -> grpc.gateway.examples.internal.proto.examplepb.OpaqueProduct.OpaqueProductDimensions.OpaqueUnit + 46, // 72: grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer.OpaqueLoyaltyInfo.tier_expiry:type_name -> google.protobuf.Timestamp + 46, // 73: grpc.gateway.examples.internal.proto.examplepb.OpaqueCustomer.OpaquePaymentMethod.expires_at:type_name -> google.protobuf.Timestamp + 47, // 74: grpc.gateway.examples.internal.proto.examplepb.OpaqueOrder.OpaqueShippingInfo.estimated_delivery_time:type_name -> google.protobuf.Duration + 8, // 75: grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService.OpaqueGetProduct:input_type -> grpc.gateway.examples.internal.proto.examplepb.OpaqueGetProductRequest + 10, // 76: grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService.OpaqueSearchProducts:input_type -> grpc.gateway.examples.internal.proto.examplepb.OpaqueSearchProductsRequest + 12, // 77: grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService.OpaqueProcessOrders:input_type -> grpc.gateway.examples.internal.proto.examplepb.OpaqueProcessOrdersRequest + 14, // 78: grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService.OpaqueStreamCustomerActivity:input_type -> grpc.gateway.examples.internal.proto.examplepb.OpaqueStreamCustomerActivityRequest + 9, // 79: grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService.OpaqueGetProduct:output_type -> grpc.gateway.examples.internal.proto.examplepb.OpaqueGetProductResponse + 11, // 80: grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService.OpaqueSearchProducts:output_type -> grpc.gateway.examples.internal.proto.examplepb.OpaqueSearchProductsResponse + 13, // 81: grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService.OpaqueProcessOrders:output_type -> grpc.gateway.examples.internal.proto.examplepb.OpaqueProcessOrdersResponse + 15, // 82: grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService.OpaqueStreamCustomerActivity:output_type -> grpc.gateway.examples.internal.proto.examplepb.OpaqueStreamCustomerActivityResponse + 79, // [79:83] is the sub-list for method output_type + 75, // [75:79] is the sub-list for method input_type + 75, // [75:75] is the sub-list for extension type_name + 75, // [75:75] is the sub-list for extension extendee + 0, // [0:75] is the sub-list for field type_name +} + +func init() { file_examples_internal_proto_examplepb_opaque_proto_init() } +func file_examples_internal_proto_examplepb_opaque_proto_init() { + if File_examples_internal_proto_examplepb_opaque_proto != nil { + return + } + file_examples_internal_proto_examplepb_opaque_proto_msgTypes[11].OneofWrappers = []any{ + (*opaqueProductVariant_PercentageOff)(nil), + (*opaqueProductVariant_FixedAmountOff)(nil), + } + file_examples_internal_proto_examplepb_opaque_proto_msgTypes[12].OneofWrappers = []any{ + (*opaqueProduct_TaxPercentage)(nil), + (*opaqueProduct_TaxExempt)(nil), + } + file_examples_internal_proto_examplepb_opaque_proto_msgTypes[15].OneofWrappers = []any{ + (*opaqueOrder_CouponCode)(nil), + (*opaqueOrder_PromotionId)(nil), + } + file_examples_internal_proto_examplepb_opaque_proto_msgTypes[18].OneofWrappers = []any{ + (*opaqueActivityUpdate_RedirectUrl)(nil), + (*opaqueActivityUpdate_NotificationId)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_examples_internal_proto_examplepb_opaque_proto_rawDesc), len(file_examples_internal_proto_examplepb_opaque_proto_rawDesc)), + NumEnums: 8, + NumMessages: 35, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_examples_internal_proto_examplepb_opaque_proto_goTypes, + DependencyIndexes: file_examples_internal_proto_examplepb_opaque_proto_depIdxs, + EnumInfos: file_examples_internal_proto_examplepb_opaque_proto_enumTypes, + MessageInfos: file_examples_internal_proto_examplepb_opaque_proto_msgTypes, + }.Build() + File_examples_internal_proto_examplepb_opaque_proto = out.File + file_examples_internal_proto_examplepb_opaque_proto_goTypes = nil + file_examples_internal_proto_examplepb_opaque_proto_depIdxs = nil +} diff --git a/examples/internal/proto/examplepb/opaque.pb.gw.go b/examples/internal/proto/examplepb/opaque.pb.gw.go new file mode 100644 index 00000000000..2cd4cc004fa --- /dev/null +++ b/examples/internal/proto/examplepb/opaque.pb.gw.go @@ -0,0 +1,375 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: examples/internal/proto/examplepb/opaque.proto + +/* +Package examplepb is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package examplepb + +import ( + "context" + "errors" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) + +var filter_OpaqueEcommerceService_OpaqueGetProduct_0 = &utilities.DoubleArray{Encoding: map[string]int{"product_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} + +func request_OpaqueEcommerceService_OpaqueGetProduct_0(ctx context.Context, marshaler runtime.Marshaler, client OpaqueEcommerceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq OpaqueGetProductRequest + metadata runtime.ServerMetadata + err error + ) + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } + val, ok := pathParams["product_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "product_id") + } + convertedProductId, err := runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "product_id", err) + } + protoReq.SetProductId(convertedProductId) + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_OpaqueEcommerceService_OpaqueGetProduct_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.OpaqueGetProduct(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_OpaqueEcommerceService_OpaqueGetProduct_0(ctx context.Context, marshaler runtime.Marshaler, server OpaqueEcommerceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq OpaqueGetProductRequest + metadata runtime.ServerMetadata + err error + ) + val, ok := pathParams["product_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "product_id") + } + convertedProductId, err := runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "product_id", err) + } + protoReq.SetProductId(convertedProductId) + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_OpaqueEcommerceService_OpaqueGetProduct_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.OpaqueGetProduct(ctx, &protoReq) + return msg, metadata, err +} + +var filter_OpaqueEcommerceService_OpaqueSearchProducts_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + +func request_OpaqueEcommerceService_OpaqueSearchProducts_0(ctx context.Context, marshaler runtime.Marshaler, client OpaqueEcommerceServiceClient, req *http.Request, pathParams map[string]string) (OpaqueEcommerceService_OpaqueSearchProductsClient, runtime.ServerMetadata, error) { + var ( + protoReq OpaqueSearchProductsRequest + metadata runtime.ServerMetadata + ) + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_OpaqueEcommerceService_OpaqueSearchProducts_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + stream, err := client.OpaqueSearchProducts(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil +} + +func request_OpaqueEcommerceService_OpaqueProcessOrders_0(ctx context.Context, marshaler runtime.Marshaler, client OpaqueEcommerceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var metadata runtime.ServerMetadata + stream, err := client.OpaqueProcessOrders(ctx) + if err != nil { + grpclog.Errorf("Failed to start streaming: %v", err) + return nil, metadata, err + } + dec := marshaler.NewDecoder(req.Body) + for { + var protoReq OpaqueProcessOrdersRequest + err = dec.Decode(&protoReq) + if errors.Is(err, io.EOF) { + break + } + if err != nil { + grpclog.Errorf("Failed to decode request: %v", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err = stream.Send(&protoReq); err != nil { + if errors.Is(err, io.EOF) { + break + } + grpclog.Errorf("Failed to send request: %v", err) + return nil, metadata, err + } + } + if err := stream.CloseSend(); err != nil { + grpclog.Errorf("Failed to terminate client stream: %v", err) + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + grpclog.Errorf("Failed to get header from client: %v", err) + return nil, metadata, err + } + metadata.HeaderMD = header + msg, err := stream.CloseAndRecv() + metadata.TrailerMD = stream.Trailer() + return msg, metadata, err +} + +func request_OpaqueEcommerceService_OpaqueStreamCustomerActivity_0(ctx context.Context, marshaler runtime.Marshaler, client OpaqueEcommerceServiceClient, req *http.Request, pathParams map[string]string) (OpaqueEcommerceService_OpaqueStreamCustomerActivityClient, runtime.ServerMetadata, error) { + var metadata runtime.ServerMetadata + stream, err := client.OpaqueStreamCustomerActivity(ctx) + if err != nil { + grpclog.Errorf("Failed to start streaming: %v", err) + return nil, metadata, err + } + dec := marshaler.NewDecoder(req.Body) + handleSend := func() error { + var protoReq OpaqueStreamCustomerActivityRequest + err := dec.Decode(&protoReq) + if errors.Is(err, io.EOF) { + return err + } + if err != nil { + grpclog.Errorf("Failed to decode request: %v", err) + return status.Errorf(codes.InvalidArgument, "Failed to decode request: %v", err) + } + if err := stream.Send(&protoReq); err != nil { + grpclog.Errorf("Failed to send request: %v", err) + return err + } + return nil + } + go func() { + for { + if err := handleSend(); err != nil { + break + } + } + if err := stream.CloseSend(); err != nil { + grpclog.Errorf("Failed to terminate client stream: %v", err) + } + }() + header, err := stream.Header() + if err != nil { + grpclog.Errorf("Failed to get header from client: %v", err) + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil +} + +// RegisterOpaqueEcommerceServiceHandlerServer registers the http handlers for service OpaqueEcommerceService to "mux". +// UnaryRPC :call OpaqueEcommerceServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterOpaqueEcommerceServiceHandlerFromEndpoint instead. +// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. +func RegisterOpaqueEcommerceServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OpaqueEcommerceServiceServer) error { + mux.Handle(http.MethodGet, pattern_OpaqueEcommerceService_OpaqueGetProduct_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService/OpaqueGetProduct", runtime.WithHTTPPathPattern("/v1/products/{product_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_OpaqueEcommerceService_OpaqueGetProduct_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_OpaqueEcommerceService_OpaqueGetProduct_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + + mux.Handle(http.MethodGet, pattern_OpaqueEcommerceService_OpaqueSearchProducts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") + _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + }) + + mux.Handle(http.MethodPost, pattern_OpaqueEcommerceService_OpaqueProcessOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") + _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + }) + + mux.Handle(http.MethodPost, pattern_OpaqueEcommerceService_OpaqueStreamCustomerActivity_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") + _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + }) + + return nil +} + +// RegisterOpaqueEcommerceServiceHandlerFromEndpoint is same as RegisterOpaqueEcommerceServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterOpaqueEcommerceServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.NewClient(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + return RegisterOpaqueEcommerceServiceHandler(ctx, mux, conn) +} + +// RegisterOpaqueEcommerceServiceHandler registers the http handlers for service OpaqueEcommerceService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterOpaqueEcommerceServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterOpaqueEcommerceServiceHandlerClient(ctx, mux, NewOpaqueEcommerceServiceClient(conn)) +} + +// RegisterOpaqueEcommerceServiceHandlerClient registers the http handlers for service OpaqueEcommerceService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "OpaqueEcommerceServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "OpaqueEcommerceServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "OpaqueEcommerceServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. +func RegisterOpaqueEcommerceServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OpaqueEcommerceServiceClient) error { + mux.Handle(http.MethodGet, pattern_OpaqueEcommerceService_OpaqueGetProduct_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService/OpaqueGetProduct", runtime.WithHTTPPathPattern("/v1/products/{product_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_OpaqueEcommerceService_OpaqueGetProduct_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_OpaqueEcommerceService_OpaqueGetProduct_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodGet, pattern_OpaqueEcommerceService_OpaqueSearchProducts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService/OpaqueSearchProducts", runtime.WithHTTPPathPattern("/v1/products/search")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_OpaqueEcommerceService_OpaqueSearchProducts_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_OpaqueEcommerceService_OpaqueSearchProducts_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_OpaqueEcommerceService_OpaqueProcessOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService/OpaqueProcessOrders", runtime.WithHTTPPathPattern("/v1/orders/process")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_OpaqueEcommerceService_OpaqueProcessOrders_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_OpaqueEcommerceService_OpaqueProcessOrders_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_OpaqueEcommerceService_OpaqueStreamCustomerActivity_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService/OpaqueStreamCustomerActivity", runtime.WithHTTPPathPattern("/v1/customer/activity")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_OpaqueEcommerceService_OpaqueStreamCustomerActivity_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_OpaqueEcommerceService_OpaqueStreamCustomerActivity_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + }) + return nil +} + +var ( + pattern_OpaqueEcommerceService_OpaqueGetProduct_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "products", "product_id"}, "")) + pattern_OpaqueEcommerceService_OpaqueSearchProducts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "products", "search"}, "")) + pattern_OpaqueEcommerceService_OpaqueProcessOrders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "orders", "process"}, "")) + pattern_OpaqueEcommerceService_OpaqueStreamCustomerActivity_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "customer", "activity"}, "")) +) + +var ( + forward_OpaqueEcommerceService_OpaqueGetProduct_0 = runtime.ForwardResponseMessage + forward_OpaqueEcommerceService_OpaqueSearchProducts_0 = runtime.ForwardResponseStream + forward_OpaqueEcommerceService_OpaqueProcessOrders_0 = runtime.ForwardResponseMessage + forward_OpaqueEcommerceService_OpaqueStreamCustomerActivity_0 = runtime.ForwardResponseStream +) diff --git a/examples/internal/proto/examplepb/opaque.proto b/examples/internal/proto/examplepb/opaque.proto new file mode 100644 index 00000000000..101f66a656b --- /dev/null +++ b/examples/internal/proto/examplepb/opaque.proto @@ -0,0 +1,405 @@ +edition = "2023"; + +package grpc.gateway.examples.internal.proto.examplepb; + +import "google/api/annotations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb"; + +// OpaqueEcommerceService provides a comprehensive e-commerce API with various request/response patterns +service OpaqueEcommerceService { + // OpaqueGetProduct - Unary request, unary response + // Retrieves detailed information about a specific product + rpc OpaqueGetProduct(OpaqueGetProductRequest) returns (OpaqueGetProductResponse) { + option (google.api.http) = { + get: "/v1/products/{product_id}" + }; + } + + // OpaqueSearchProducts - Unary request, stream response + // Searches for products based on criteria and streams results back + rpc OpaqueSearchProducts(OpaqueSearchProductsRequest) returns (stream OpaqueSearchProductsResponse) { + option (google.api.http) = { + get: "/v1/products/search" + }; + } + + // OpaqueProcessOrders - Stream request, unary response + // Processes multiple orders in a batch and returns a summary + rpc OpaqueProcessOrders(stream OpaqueProcessOrdersRequest) returns (OpaqueProcessOrdersResponse) { + option (google.api.http) = { + post: "/v1/orders/process" + body: "*" + }; + } + + // OpaqueStreamCustomerActivity - Stream request, stream response + // Bidirectional streaming for real-time customer activity monitoring + rpc OpaqueStreamCustomerActivity(stream OpaqueStreamCustomerActivityRequest) returns (stream OpaqueStreamCustomerActivityResponse) { + option (google.api.http) = { + post: "/v1/customer/activity" + body: "*" + }; + } +} + +// OpaqueGetProductRequest represents a request for product information +message OpaqueGetProductRequest { + string product_id = 1; + bool include_variants = 2; + bool include_related_products = 3; + string language_code = 4; + string currency_code = 5; +} + +// OpaqueGetProductResponse represents a response with product information +message OpaqueGetProductResponse { + OpaqueProduct product = 1; +} + +// OpaqueSearchProductsRequest represents a product search request +message OpaqueSearchProductsRequest { + string query = 1; + repeated string category_ids = 2; + repeated string brands = 3; + OpaquePrice min_price = 4; + OpaquePrice max_price = 5; + repeated string tags = 6; + + enum OpaqueSortOrder { + OPAQUE_SORT_ORDER_UNSPECIFIED = 0; + OPAQUE_SORT_ORDER_RELEVANCE = 1; + OPAQUE_SORT_ORDER_PRICE_LOW_TO_HIGH = 2; + OPAQUE_SORT_ORDER_PRICE_HIGH_TO_LOW = 3; + OPAQUE_SORT_ORDER_NEWEST_FIRST = 4; + OPAQUE_SORT_ORDER_RATING = 5; + OPAQUE_SORT_ORDER_POPULARITY = 6; + } + OpaqueSortOrder sort_by = 7; + + int32 page = 8; + int32 page_size = 9; + string language_code = 10; + string currency_code = 11; + google.protobuf.FieldMask field_mask = 12; + map filters = 13; +} + +// OpaqueSearchProductsResponse represents a single product in search results +message OpaqueSearchProductsResponse { + OpaqueProduct product = 1; +} + +// OpaqueProcessOrdersRequest represents a request to process order +message OpaqueProcessOrdersRequest { + OpaqueOrder order = 1; +} + +// OpaqueProcessOrdersResponse represents orders processing result +message OpaqueProcessOrdersResponse { + OpaqueOrderSummary summary = 1; +} + +// OpaqueStreamCustomerActivityRequest represents a report of user activity +message OpaqueStreamCustomerActivityRequest { + OpaqueCustomerEvent event = 1; +} + +// OpaqueStreamCustomerActivityRequest represents a report of server activity +message OpaqueStreamCustomerActivityResponse { + OpaqueActivityUpdate event = 2; +} + +// OpaqueAddress represents a physical address +message OpaqueAddress { + string street_line1 = 1; + string street_line2 = 2; + string city = 3; + string state = 4; + string country = 5; + string postal_code = 6; + enum OpaqueAddressType { + OPAQUE_ADDRESS_TYPE_UNSPECIFIED = 0; + OPAQUE_ADDRESS_TYPE_RESIDENTIAL = 1; + OPAQUE_ADDRESS_TYPE_BUSINESS = 2; + OPAQUE_ADDRESS_TYPE_SHIPPING = 3; + OPAQUE_ADDRESS_TYPE_BILLING = 4; + } + OpaqueAddressType address_type = 7; + google.protobuf.BoolValue is_default = 8; + map metadata = 9; +} + +// OpaquePrice represents a monetary value with currency +message OpaquePrice { + double amount = 1; + string currency_code = 2; + bool is_discounted = 3; + google.protobuf.DoubleValue original_amount = 4; + google.protobuf.Timestamp price_valid_until = 5; +} + +// OpaqueProductCategory represents a product category +message OpaqueProductCategory { + string category_id = 1; + string name = 2; + string description = 3; + OpaqueProductCategory parent_category = 4; + repeated string tags = 5; + google.protobuf.Timestamp created_at = 6; + google.protobuf.Timestamp updated_at = 7; +} + +// OpaqueProductVariant represents a specific variant of a product +message OpaqueProductVariant { + string variant_id = 1; + string sku = 2; + string name = 3; + OpaquePrice price = 4; + int32 inventory_count = 5; + map attributes = 6; + bytes image_data = 7; + repeated string image_urls = 8; + google.protobuf.BoolValue is_available = 9; + oneof discount_info { + double percentage_off = 10; + double fixed_amount_off = 11; + } +} + +// OpaqueProduct represents a product in the e-commerce system +message OpaqueProduct { + string product_id = 1; + string name = 2; + string description = 3; + string brand = 4; + OpaquePrice base_price = 5; + OpaqueProductCategory category = 6; + repeated OpaqueProductVariant variants = 7; + repeated string tags = 8; + double average_rating = 9; + int32 review_count = 10; + google.protobuf.BoolValue is_featured = 11; + google.protobuf.Timestamp created_at = 12; + google.protobuf.Timestamp updated_at = 13; + google.protobuf.Duration average_shipping_time = 14; + + enum OpaqueProductStatus { + OPAQUE_PRODUCT_STATUS_UNSPECIFIED = 0; + OPAQUE_PRODUCT_STATUS_DRAFT = 1; + OPAQUE_PRODUCT_STATUS_ACTIVE = 2; + OPAQUE_PRODUCT_STATUS_OUT_OF_STOCK = 3; + OPAQUE_PRODUCT_STATUS_DISCONTINUED = 4; + } + OpaqueProductStatus status = 15; + + map metadata = 16; + map regional_prices = 17; + + message OpaqueProductDimensions { + double length = 1; + double width = 2; + double height = 3; + double weight = 4; + enum OpaqueUnit { + OPAQUE_UNIT_UNSPECIFIED = 0; + OPAQUE_UNIT_METRIC = 1; + OPAQUE_UNIT_IMPERIAL = 2; + } + OpaqueUnit unit = 5; + } + + OpaqueProductDimensions dimensions = 18; + + oneof tax_info { + double tax_percentage = 19; + bool tax_exempt = 20; + } +} + +// OpaqueCustomer represents a customer in the e-commerce system +message OpaqueCustomer { + string customer_id = 1; + string email = 2; + string first_name = 3; + string last_name = 4; + string phone_number = 5; + repeated OpaqueAddress addresses = 6; + google.protobuf.Timestamp created_at = 7; + google.protobuf.Timestamp last_login = 8; + + enum OpaqueCustomerStatus { + OPAQUE_CUSTOMER_STATUS_UNSPECIFIED = 0; + OPAQUE_CUSTOMER_STATUS_ACTIVE = 1; + OPAQUE_CUSTOMER_STATUS_INACTIVE = 2; + OPAQUE_CUSTOMER_STATUS_SUSPENDED = 3; + OPAQUE_CUSTOMER_STATUS_DELETED = 4; + } + OpaqueCustomerStatus status = 9; + + message OpaqueLoyaltyInfo { + string tier = 1; + int32 points = 2; + google.protobuf.Timestamp tier_expiry = 3; + repeated string rewards = 4; + } + + OpaqueLoyaltyInfo loyalty_info = 10; + map preferences = 11; + + message OpaquePaymentMethod { + string payment_id = 1; + string type = 2; + string last_four = 3; + string provider = 4; + google.protobuf.Timestamp expires_at = 5; + bool is_default = 6; + } + + repeated OpaquePaymentMethod payment_methods = 12; +} + +// OpaqueOrderItem represents an item in an order +message OpaqueOrderItem { + string product_id = 1; + string variant_id = 2; + string product_name = 3; + int32 quantity = 4; + OpaquePrice unit_price = 5; + OpaquePrice total_price = 6; + map selected_attributes = 7; + google.protobuf.BoolValue gift_wrapped = 8; + string gift_message = 9; +} + +// OpaqueOrder represents a customer order +message OpaqueOrder { + string order_id = 1; + string customer_id = 2; + repeated OpaqueOrderItem items = 3; + OpaquePrice subtotal = 4; + OpaquePrice tax = 5; + OpaquePrice shipping = 6; + OpaquePrice total = 7; + OpaqueAddress shipping_address = 8; + OpaqueAddress billing_address = 9; + + enum OpaqueOrderStatus { + OPAQUE_ORDER_STATUS_UNSPECIFIED = 0; + OPAQUE_ORDER_STATUS_PENDING = 1; + OPAQUE_ORDER_STATUS_PROCESSING = 2; + OPAQUE_ORDER_STATUS_SHIPPED = 3; + OPAQUE_ORDER_STATUS_DELIVERED = 4; + OPAQUE_ORDER_STATUS_CANCELLED = 5; + OPAQUE_ORDER_STATUS_RETURNED = 6; + } + OpaqueOrderStatus status = 10; + + string payment_method_id = 11; + string tracking_number = 12; + google.protobuf.Timestamp created_at = 13; + google.protobuf.Timestamp updated_at = 14; + google.protobuf.Timestamp shipped_at = 15; + google.protobuf.Timestamp delivered_at = 16; + + message OpaqueShippingInfo { + string carrier = 1; + string method = 2; + google.protobuf.Duration estimated_delivery_time = 3; + repeated string tracking_urls = 4; + } + + OpaqueShippingInfo shipping_info = 17; + map metadata = 18; + + oneof discount_applied { + string coupon_code = 19; + string promotion_id = 20; + } +} + +// OpaqueOrderSummary represents a summary of processed orders +message OpaqueOrderSummary { + int32 total_orders_processed = 1; + int32 successful_orders = 2; + int32 failed_orders = 3; + OpaquePrice total_value = 4; + repeated string order_ids = 5; + map error_details = 6; + google.protobuf.Timestamp processing_time = 7; + + message OpaqueOrderError { + string order_id = 1; + string error_code = 2; + string error_message = 3; + } + + repeated OpaqueOrderError errors = 8; +} + +// OpaqueCustomerEvent represents a customer activity event +message OpaqueCustomerEvent { + string customer_id = 1; + string session_id = 2; + + enum OpaqueEventType { + OPAQUE_EVENT_TYPE_UNSPECIFIED = 0; + OPAQUE_EVENT_TYPE_PAGE_VIEW = 1; + OPAQUE_EVENT_TYPE_PRODUCT_VIEW = 2; + OPAQUE_EVENT_TYPE_ADD_TO_CART = 3; + OPAQUE_EVENT_TYPE_REMOVE_FROM_CART = 4; + OPAQUE_EVENT_TYPE_CHECKOUT_START = 5; + OPAQUE_EVENT_TYPE_CHECKOUT_COMPLETE = 6; + OPAQUE_EVENT_TYPE_SEARCH = 7; + OPAQUE_EVENT_TYPE_ACCOUNT_UPDATE = 8; + } + OpaqueEventType event_type = 3; + + google.protobuf.Timestamp timestamp = 4; + string product_id = 5; + string category_id = 6; + string search_query = 7; + string page_url = 8; + int32 value = 9; + map event_data = 10; + string device_type = 11; + string ip_address = 12; + string user_agent = 13; +} + +// OpaqueActivityUpdate represents a server response to customer activity +message OpaqueActivityUpdate { + string customer_id = 1; + string session_id = 2; + + enum OpaqueUpdateType { + OPAQUE_UPDATE_TYPE_UNSPECIFIED = 0; + OPAQUE_UPDATE_TYPE_RECOMMENDATION = 1; + OPAQUE_UPDATE_TYPE_NOTIFICATION = 2; + OPAQUE_UPDATE_TYPE_OFFER = 3; + OPAQUE_UPDATE_TYPE_INVENTORY_UPDATE = 4; + OPAQUE_UPDATE_TYPE_PRICE_CHANGE = 5; + OPAQUE_UPDATE_TYPE_CART_REMINDER = 6; + } + OpaqueUpdateType update_type = 3; + + google.protobuf.Timestamp timestamp = 4; + string message = 5; + repeated string product_ids = 6; + OpaquePrice price_update = 7; + int32 inventory_count = 8; + string offer_code = 9; + google.protobuf.Duration offer_expiry = 10; + double discount_percentage = 11; + map update_data = 12; + int32 priority = 13; + + oneof action_data { + string redirect_url = 14; + string notification_id = 15; + } +} diff --git a/examples/internal/proto/examplepb/opaque.swagger.json b/examples/internal/proto/examplepb/opaque.swagger.json new file mode 100644 index 00000000000..e82dbfdc3b3 --- /dev/null +++ b/examples/internal/proto/examplepb/opaque.swagger.json @@ -0,0 +1,1069 @@ +{ + "swagger": "2.0", + "info": { + "title": "examples/internal/proto/examplepb/opaque.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "OpaqueEcommerceService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/customer/activity": { + "post": { + "summary": "OpaqueStreamCustomerActivity - Stream request, stream response\nBidirectional streaming for real-time customer activity monitoring", + "operationId": "OpaqueEcommerceService_OpaqueStreamCustomerActivity", + "responses": { + "200": { + "description": "A successful response.(streaming responses)", + "schema": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/examplepbOpaqueStreamCustomerActivityResponse" + }, + "error": { + "$ref": "#/definitions/rpcStatus" + } + }, + "title": "Stream result of examplepbOpaqueStreamCustomerActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": " (streaming inputs)", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/examplepbOpaqueStreamCustomerActivityRequest" + } + } + ], + "tags": [ + "OpaqueEcommerceService" + ] + } + }, + "/v1/orders/process": { + "post": { + "summary": "OpaqueProcessOrders - Stream request, unary response\nProcesses multiple orders in a batch and returns a summary", + "operationId": "OpaqueEcommerceService_OpaqueProcessOrders", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/examplepbOpaqueProcessOrdersResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": " (streaming inputs)", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/examplepbOpaqueProcessOrdersRequest" + } + } + ], + "tags": [ + "OpaqueEcommerceService" + ] + } + }, + "/v1/products/search": { + "get": { + "summary": "OpaqueSearchProducts - Unary request, stream response\nSearches for products based on criteria and streams results back", + "operationId": "OpaqueEcommerceService_OpaqueSearchProducts", + "responses": { + "200": { + "description": "A successful response.(streaming responses)", + "schema": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/examplepbOpaqueSearchProductsResponse" + }, + "error": { + "$ref": "#/definitions/rpcStatus" + } + }, + "title": "Stream result of examplepbOpaqueSearchProductsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "query", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "categoryIds", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "brands", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "minPrice.amount", + "in": "query", + "required": false, + "type": "number", + "format": "double" + }, + { + "name": "minPrice.currencyCode", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "minPrice.isDiscounted", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "minPrice.originalAmount", + "in": "query", + "required": false, + "type": "number", + "format": "double" + }, + { + "name": "minPrice.priceValidUntil", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "maxPrice.amount", + "in": "query", + "required": false, + "type": "number", + "format": "double" + }, + { + "name": "maxPrice.currencyCode", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "maxPrice.isDiscounted", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "maxPrice.originalAmount", + "in": "query", + "required": false, + "type": "number", + "format": "double" + }, + { + "name": "maxPrice.priceValidUntil", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "tags", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "sortBy", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "OPAQUE_SORT_ORDER_UNSPECIFIED", + "OPAQUE_SORT_ORDER_RELEVANCE", + "OPAQUE_SORT_ORDER_PRICE_LOW_TO_HIGH", + "OPAQUE_SORT_ORDER_PRICE_HIGH_TO_LOW", + "OPAQUE_SORT_ORDER_NEWEST_FIRST", + "OPAQUE_SORT_ORDER_RATING", + "OPAQUE_SORT_ORDER_POPULARITY" + ], + "default": "OPAQUE_SORT_ORDER_UNSPECIFIED" + }, + { + "name": "page", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "pageSize", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "languageCode", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "currencyCode", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "fieldMask", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "filters", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "OpaqueEcommerceService" + ] + } + }, + "/v1/products/{productId}": { + "get": { + "summary": "OpaqueGetProduct - Unary request, unary response\nRetrieves detailed information about a specific product", + "operationId": "OpaqueEcommerceService_OpaqueGetProduct", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/examplepbOpaqueGetProductResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "productId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "includeVariants", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "includeRelatedProducts", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "languageCode", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "currencyCode", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "OpaqueEcommerceService" + ] + } + } + }, + "definitions": { + "OpaqueActivityUpdateOpaqueUpdateType": { + "type": "string", + "enum": [ + "OPAQUE_UPDATE_TYPE_UNSPECIFIED", + "OPAQUE_UPDATE_TYPE_RECOMMENDATION", + "OPAQUE_UPDATE_TYPE_NOTIFICATION", + "OPAQUE_UPDATE_TYPE_OFFER", + "OPAQUE_UPDATE_TYPE_INVENTORY_UPDATE", + "OPAQUE_UPDATE_TYPE_PRICE_CHANGE", + "OPAQUE_UPDATE_TYPE_CART_REMINDER" + ], + "default": "OPAQUE_UPDATE_TYPE_UNSPECIFIED" + }, + "OpaqueAddressOpaqueAddressType": { + "type": "string", + "enum": [ + "OPAQUE_ADDRESS_TYPE_UNSPECIFIED", + "OPAQUE_ADDRESS_TYPE_RESIDENTIAL", + "OPAQUE_ADDRESS_TYPE_BUSINESS", + "OPAQUE_ADDRESS_TYPE_SHIPPING", + "OPAQUE_ADDRESS_TYPE_BILLING" + ], + "default": "OPAQUE_ADDRESS_TYPE_UNSPECIFIED" + }, + "OpaqueCustomerEventOpaqueEventType": { + "type": "string", + "enum": [ + "OPAQUE_EVENT_TYPE_UNSPECIFIED", + "OPAQUE_EVENT_TYPE_PAGE_VIEW", + "OPAQUE_EVENT_TYPE_PRODUCT_VIEW", + "OPAQUE_EVENT_TYPE_ADD_TO_CART", + "OPAQUE_EVENT_TYPE_REMOVE_FROM_CART", + "OPAQUE_EVENT_TYPE_CHECKOUT_START", + "OPAQUE_EVENT_TYPE_CHECKOUT_COMPLETE", + "OPAQUE_EVENT_TYPE_SEARCH", + "OPAQUE_EVENT_TYPE_ACCOUNT_UPDATE" + ], + "default": "OPAQUE_EVENT_TYPE_UNSPECIFIED" + }, + "OpaqueOrderOpaqueOrderStatus": { + "type": "string", + "enum": [ + "OPAQUE_ORDER_STATUS_UNSPECIFIED", + "OPAQUE_ORDER_STATUS_PENDING", + "OPAQUE_ORDER_STATUS_PROCESSING", + "OPAQUE_ORDER_STATUS_SHIPPED", + "OPAQUE_ORDER_STATUS_DELIVERED", + "OPAQUE_ORDER_STATUS_CANCELLED", + "OPAQUE_ORDER_STATUS_RETURNED" + ], + "default": "OPAQUE_ORDER_STATUS_UNSPECIFIED" + }, + "OpaqueOrderOpaqueShippingInfo": { + "type": "object", + "properties": { + "carrier": { + "type": "string" + }, + "method": { + "type": "string" + }, + "estimatedDeliveryTime": { + "type": "string" + }, + "trackingUrls": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "OpaqueOrderSummaryOpaqueOrderError": { + "type": "object", + "properties": { + "orderId": { + "type": "string" + }, + "errorCode": { + "type": "string" + }, + "errorMessage": { + "type": "string" + } + } + }, + "OpaqueProductDimensionsOpaqueUnit": { + "type": "string", + "enum": [ + "OPAQUE_UNIT_UNSPECIFIED", + "OPAQUE_UNIT_METRIC", + "OPAQUE_UNIT_IMPERIAL" + ], + "default": "OPAQUE_UNIT_UNSPECIFIED" + }, + "OpaqueProductOpaqueProductDimensions": { + "type": "object", + "properties": { + "length": { + "type": "number", + "format": "double" + }, + "width": { + "type": "number", + "format": "double" + }, + "height": { + "type": "number", + "format": "double" + }, + "weight": { + "type": "number", + "format": "double" + }, + "unit": { + "$ref": "#/definitions/OpaqueProductDimensionsOpaqueUnit" + } + } + }, + "OpaqueProductOpaqueProductStatus": { + "type": "string", + "enum": [ + "OPAQUE_PRODUCT_STATUS_UNSPECIFIED", + "OPAQUE_PRODUCT_STATUS_DRAFT", + "OPAQUE_PRODUCT_STATUS_ACTIVE", + "OPAQUE_PRODUCT_STATUS_OUT_OF_STOCK", + "OPAQUE_PRODUCT_STATUS_DISCONTINUED" + ], + "default": "OPAQUE_PRODUCT_STATUS_UNSPECIFIED" + }, + "OpaqueSearchProductsRequestOpaqueSortOrder": { + "type": "string", + "enum": [ + "OPAQUE_SORT_ORDER_UNSPECIFIED", + "OPAQUE_SORT_ORDER_RELEVANCE", + "OPAQUE_SORT_ORDER_PRICE_LOW_TO_HIGH", + "OPAQUE_SORT_ORDER_PRICE_HIGH_TO_LOW", + "OPAQUE_SORT_ORDER_NEWEST_FIRST", + "OPAQUE_SORT_ORDER_RATING", + "OPAQUE_SORT_ORDER_POPULARITY" + ], + "default": "OPAQUE_SORT_ORDER_UNSPECIFIED" + }, + "examplepbOpaqueActivityUpdate": { + "type": "object", + "properties": { + "customerId": { + "type": "string" + }, + "sessionId": { + "type": "string" + }, + "updateType": { + "$ref": "#/definitions/OpaqueActivityUpdateOpaqueUpdateType" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "message": { + "type": "string" + }, + "productIds": { + "type": "array", + "items": { + "type": "string" + } + }, + "priceUpdate": { + "$ref": "#/definitions/examplepbOpaquePrice" + }, + "inventoryCount": { + "type": "integer", + "format": "int32" + }, + "offerCode": { + "type": "string" + }, + "offerExpiry": { + "type": "string" + }, + "discountPercentage": { + "type": "number", + "format": "double" + }, + "updateData": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "priority": { + "type": "integer", + "format": "int32" + }, + "redirectUrl": { + "type": "string" + }, + "notificationId": { + "type": "string" + } + }, + "title": "OpaqueActivityUpdate represents a server response to customer activity" + }, + "examplepbOpaqueAddress": { + "type": "object", + "properties": { + "streetLine1": { + "type": "string" + }, + "streetLine2": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "country": { + "type": "string" + }, + "postalCode": { + "type": "string" + }, + "addressType": { + "$ref": "#/definitions/OpaqueAddressOpaqueAddressType" + }, + "isDefault": { + "type": "boolean" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "title": "OpaqueAddress represents a physical address" + }, + "examplepbOpaqueCustomerEvent": { + "type": "object", + "properties": { + "customerId": { + "type": "string" + }, + "sessionId": { + "type": "string" + }, + "eventType": { + "$ref": "#/definitions/OpaqueCustomerEventOpaqueEventType" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "productId": { + "type": "string" + }, + "categoryId": { + "type": "string" + }, + "searchQuery": { + "type": "string" + }, + "pageUrl": { + "type": "string" + }, + "value": { + "type": "integer", + "format": "int32" + }, + "eventData": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "deviceType": { + "type": "string" + }, + "ipAddress": { + "type": "string" + }, + "userAgent": { + "type": "string" + } + }, + "title": "OpaqueCustomerEvent represents a customer activity event" + }, + "examplepbOpaqueGetProductResponse": { + "type": "object", + "properties": { + "product": { + "$ref": "#/definitions/examplepbOpaqueProduct" + } + }, + "title": "OpaqueGetProductResponse represents a response with product information" + }, + "examplepbOpaqueOrder": { + "type": "object", + "properties": { + "orderId": { + "type": "string" + }, + "customerId": { + "type": "string" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/examplepbOpaqueOrderItem" + } + }, + "subtotal": { + "$ref": "#/definitions/examplepbOpaquePrice" + }, + "tax": { + "$ref": "#/definitions/examplepbOpaquePrice" + }, + "shipping": { + "$ref": "#/definitions/examplepbOpaquePrice" + }, + "total": { + "$ref": "#/definitions/examplepbOpaquePrice" + }, + "shippingAddress": { + "$ref": "#/definitions/examplepbOpaqueAddress" + }, + "billingAddress": { + "$ref": "#/definitions/examplepbOpaqueAddress" + }, + "status": { + "$ref": "#/definitions/OpaqueOrderOpaqueOrderStatus" + }, + "paymentMethodId": { + "type": "string" + }, + "trackingNumber": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "shippedAt": { + "type": "string", + "format": "date-time" + }, + "deliveredAt": { + "type": "string", + "format": "date-time" + }, + "shippingInfo": { + "$ref": "#/definitions/OpaqueOrderOpaqueShippingInfo" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "couponCode": { + "type": "string" + }, + "promotionId": { + "type": "string" + } + }, + "title": "OpaqueOrder represents a customer order" + }, + "examplepbOpaqueOrderItem": { + "type": "object", + "properties": { + "productId": { + "type": "string" + }, + "variantId": { + "type": "string" + }, + "productName": { + "type": "string" + }, + "quantity": { + "type": "integer", + "format": "int32" + }, + "unitPrice": { + "$ref": "#/definitions/examplepbOpaquePrice" + }, + "totalPrice": { + "$ref": "#/definitions/examplepbOpaquePrice" + }, + "selectedAttributes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "giftWrapped": { + "type": "boolean" + }, + "giftMessage": { + "type": "string" + } + }, + "title": "OpaqueOrderItem represents an item in an order" + }, + "examplepbOpaqueOrderSummary": { + "type": "object", + "properties": { + "totalOrdersProcessed": { + "type": "integer", + "format": "int32" + }, + "successfulOrders": { + "type": "integer", + "format": "int32" + }, + "failedOrders": { + "type": "integer", + "format": "int32" + }, + "totalValue": { + "$ref": "#/definitions/examplepbOpaquePrice" + }, + "orderIds": { + "type": "array", + "items": { + "type": "string" + } + }, + "errorDetails": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "processingTime": { + "type": "string", + "format": "date-time" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/OpaqueOrderSummaryOpaqueOrderError" + } + } + }, + "title": "OpaqueOrderSummary represents a summary of processed orders" + }, + "examplepbOpaquePrice": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "format": "double" + }, + "currencyCode": { + "type": "string" + }, + "isDiscounted": { + "type": "boolean" + }, + "originalAmount": { + "type": "number", + "format": "double" + }, + "priceValidUntil": { + "type": "string", + "format": "date-time" + } + }, + "title": "OpaquePrice represents a monetary value with currency" + }, + "examplepbOpaqueProcessOrdersRequest": { + "type": "object", + "properties": { + "order": { + "$ref": "#/definitions/examplepbOpaqueOrder" + } + }, + "title": "OpaqueProcessOrdersRequest represents a request to process order" + }, + "examplepbOpaqueProcessOrdersResponse": { + "type": "object", + "properties": { + "summary": { + "$ref": "#/definitions/examplepbOpaqueOrderSummary" + } + }, + "title": "OpaqueProcessOrdersResponse represents orders processing result" + }, + "examplepbOpaqueProduct": { + "type": "object", + "properties": { + "productId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "brand": { + "type": "string" + }, + "basePrice": { + "$ref": "#/definitions/examplepbOpaquePrice" + }, + "category": { + "$ref": "#/definitions/examplepbOpaqueProductCategory" + }, + "variants": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/examplepbOpaqueProductVariant" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "averageRating": { + "type": "number", + "format": "double" + }, + "reviewCount": { + "type": "integer", + "format": "int32" + }, + "isFeatured": { + "type": "boolean" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "averageShippingTime": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/OpaqueProductOpaqueProductStatus" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "regionalPrices": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/examplepbOpaquePrice" + } + }, + "dimensions": { + "$ref": "#/definitions/OpaqueProductOpaqueProductDimensions" + }, + "taxPercentage": { + "type": "number", + "format": "double" + }, + "taxExempt": { + "type": "boolean" + } + }, + "title": "OpaqueProduct represents a product in the e-commerce system" + }, + "examplepbOpaqueProductCategory": { + "type": "object", + "properties": { + "categoryId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "parentCategory": { + "$ref": "#/definitions/examplepbOpaqueProductCategory" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + } + }, + "title": "OpaqueProductCategory represents a product category" + }, + "examplepbOpaqueProductVariant": { + "type": "object", + "properties": { + "variantId": { + "type": "string" + }, + "sku": { + "type": "string" + }, + "name": { + "type": "string" + }, + "price": { + "$ref": "#/definitions/examplepbOpaquePrice" + }, + "inventoryCount": { + "type": "integer", + "format": "int32" + }, + "attributes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "imageData": { + "type": "string", + "format": "byte" + }, + "imageUrls": { + "type": "array", + "items": { + "type": "string" + } + }, + "isAvailable": { + "type": "boolean" + }, + "percentageOff": { + "type": "number", + "format": "double" + }, + "fixedAmountOff": { + "type": "number", + "format": "double" + } + }, + "title": "OpaqueProductVariant represents a specific variant of a product" + }, + "examplepbOpaqueSearchProductsResponse": { + "type": "object", + "properties": { + "product": { + "$ref": "#/definitions/examplepbOpaqueProduct" + } + }, + "title": "OpaqueSearchProductsResponse represents a single product in search results" + }, + "examplepbOpaqueStreamCustomerActivityRequest": { + "type": "object", + "properties": { + "event": { + "$ref": "#/definitions/examplepbOpaqueCustomerEvent" + } + }, + "title": "OpaqueStreamCustomerActivityRequest represents a report of user activity" + }, + "examplepbOpaqueStreamCustomerActivityResponse": { + "type": "object", + "properties": { + "event": { + "$ref": "#/definitions/examplepbOpaqueActivityUpdate" + } + }, + "title": "OpaqueStreamCustomerActivityRequest represents a report of server activity" + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + } + }, + "additionalProperties": {}, + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." + }, + "message": { + "type": "string", + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + }, + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use." + } + }, + "description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)." + } + } +} diff --git a/examples/internal/proto/examplepb/opaque_grpc.pb.go b/examples/internal/proto/examplepb/opaque_grpc.pb.go new file mode 100644 index 00000000000..f23010eddf5 --- /dev/null +++ b/examples/internal/proto/examplepb/opaque_grpc.pb.go @@ -0,0 +1,244 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: examples/internal/proto/examplepb/opaque.proto + +package examplepb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + OpaqueEcommerceService_OpaqueGetProduct_FullMethodName = "/grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService/OpaqueGetProduct" + OpaqueEcommerceService_OpaqueSearchProducts_FullMethodName = "/grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService/OpaqueSearchProducts" + OpaqueEcommerceService_OpaqueProcessOrders_FullMethodName = "/grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService/OpaqueProcessOrders" + OpaqueEcommerceService_OpaqueStreamCustomerActivity_FullMethodName = "/grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService/OpaqueStreamCustomerActivity" +) + +// OpaqueEcommerceServiceClient is the client API for OpaqueEcommerceService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// OpaqueEcommerceService provides a comprehensive e-commerce API with various request/response patterns +type OpaqueEcommerceServiceClient interface { + // OpaqueGetProduct - Unary request, unary response + // Retrieves detailed information about a specific product + OpaqueGetProduct(ctx context.Context, in *OpaqueGetProductRequest, opts ...grpc.CallOption) (*OpaqueGetProductResponse, error) + // OpaqueSearchProducts - Unary request, stream response + // Searches for products based on criteria and streams results back + OpaqueSearchProducts(ctx context.Context, in *OpaqueSearchProductsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OpaqueSearchProductsResponse], error) + // OpaqueProcessOrders - Stream request, unary response + // Processes multiple orders in a batch and returns a summary + OpaqueProcessOrders(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[OpaqueProcessOrdersRequest, OpaqueProcessOrdersResponse], error) + // OpaqueStreamCustomerActivity - Stream request, stream response + // Bidirectional streaming for real-time customer activity monitoring + OpaqueStreamCustomerActivity(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[OpaqueStreamCustomerActivityRequest, OpaqueStreamCustomerActivityResponse], error) +} + +type opaqueEcommerceServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewOpaqueEcommerceServiceClient(cc grpc.ClientConnInterface) OpaqueEcommerceServiceClient { + return &opaqueEcommerceServiceClient{cc} +} + +func (c *opaqueEcommerceServiceClient) OpaqueGetProduct(ctx context.Context, in *OpaqueGetProductRequest, opts ...grpc.CallOption) (*OpaqueGetProductResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(OpaqueGetProductResponse) + err := c.cc.Invoke(ctx, OpaqueEcommerceService_OpaqueGetProduct_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *opaqueEcommerceServiceClient) OpaqueSearchProducts(ctx context.Context, in *OpaqueSearchProductsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OpaqueSearchProductsResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &OpaqueEcommerceService_ServiceDesc.Streams[0], OpaqueEcommerceService_OpaqueSearchProducts_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[OpaqueSearchProductsRequest, OpaqueSearchProductsResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type OpaqueEcommerceService_OpaqueSearchProductsClient = grpc.ServerStreamingClient[OpaqueSearchProductsResponse] + +func (c *opaqueEcommerceServiceClient) OpaqueProcessOrders(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[OpaqueProcessOrdersRequest, OpaqueProcessOrdersResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &OpaqueEcommerceService_ServiceDesc.Streams[1], OpaqueEcommerceService_OpaqueProcessOrders_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[OpaqueProcessOrdersRequest, OpaqueProcessOrdersResponse]{ClientStream: stream} + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type OpaqueEcommerceService_OpaqueProcessOrdersClient = grpc.ClientStreamingClient[OpaqueProcessOrdersRequest, OpaqueProcessOrdersResponse] + +func (c *opaqueEcommerceServiceClient) OpaqueStreamCustomerActivity(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[OpaqueStreamCustomerActivityRequest, OpaqueStreamCustomerActivityResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &OpaqueEcommerceService_ServiceDesc.Streams[2], OpaqueEcommerceService_OpaqueStreamCustomerActivity_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[OpaqueStreamCustomerActivityRequest, OpaqueStreamCustomerActivityResponse]{ClientStream: stream} + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type OpaqueEcommerceService_OpaqueStreamCustomerActivityClient = grpc.BidiStreamingClient[OpaqueStreamCustomerActivityRequest, OpaqueStreamCustomerActivityResponse] + +// OpaqueEcommerceServiceServer is the server API for OpaqueEcommerceService service. +// All implementations should embed UnimplementedOpaqueEcommerceServiceServer +// for forward compatibility. +// +// OpaqueEcommerceService provides a comprehensive e-commerce API with various request/response patterns +type OpaqueEcommerceServiceServer interface { + // OpaqueGetProduct - Unary request, unary response + // Retrieves detailed information about a specific product + OpaqueGetProduct(context.Context, *OpaqueGetProductRequest) (*OpaqueGetProductResponse, error) + // OpaqueSearchProducts - Unary request, stream response + // Searches for products based on criteria and streams results back + OpaqueSearchProducts(*OpaqueSearchProductsRequest, grpc.ServerStreamingServer[OpaqueSearchProductsResponse]) error + // OpaqueProcessOrders - Stream request, unary response + // Processes multiple orders in a batch and returns a summary + OpaqueProcessOrders(grpc.ClientStreamingServer[OpaqueProcessOrdersRequest, OpaqueProcessOrdersResponse]) error + // OpaqueStreamCustomerActivity - Stream request, stream response + // Bidirectional streaming for real-time customer activity monitoring + OpaqueStreamCustomerActivity(grpc.BidiStreamingServer[OpaqueStreamCustomerActivityRequest, OpaqueStreamCustomerActivityResponse]) error +} + +// UnimplementedOpaqueEcommerceServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedOpaqueEcommerceServiceServer struct{} + +func (UnimplementedOpaqueEcommerceServiceServer) OpaqueGetProduct(context.Context, *OpaqueGetProductRequest) (*OpaqueGetProductResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OpaqueGetProduct not implemented") +} +func (UnimplementedOpaqueEcommerceServiceServer) OpaqueSearchProducts(*OpaqueSearchProductsRequest, grpc.ServerStreamingServer[OpaqueSearchProductsResponse]) error { + return status.Errorf(codes.Unimplemented, "method OpaqueSearchProducts not implemented") +} +func (UnimplementedOpaqueEcommerceServiceServer) OpaqueProcessOrders(grpc.ClientStreamingServer[OpaqueProcessOrdersRequest, OpaqueProcessOrdersResponse]) error { + return status.Errorf(codes.Unimplemented, "method OpaqueProcessOrders not implemented") +} +func (UnimplementedOpaqueEcommerceServiceServer) OpaqueStreamCustomerActivity(grpc.BidiStreamingServer[OpaqueStreamCustomerActivityRequest, OpaqueStreamCustomerActivityResponse]) error { + return status.Errorf(codes.Unimplemented, "method OpaqueStreamCustomerActivity not implemented") +} +func (UnimplementedOpaqueEcommerceServiceServer) testEmbeddedByValue() {} + +// UnsafeOpaqueEcommerceServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to OpaqueEcommerceServiceServer will +// result in compilation errors. +type UnsafeOpaqueEcommerceServiceServer interface { + mustEmbedUnimplementedOpaqueEcommerceServiceServer() +} + +func RegisterOpaqueEcommerceServiceServer(s grpc.ServiceRegistrar, srv OpaqueEcommerceServiceServer) { + // If the following call pancis, it indicates UnimplementedOpaqueEcommerceServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&OpaqueEcommerceService_ServiceDesc, srv) +} + +func _OpaqueEcommerceService_OpaqueGetProduct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OpaqueGetProductRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OpaqueEcommerceServiceServer).OpaqueGetProduct(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: OpaqueEcommerceService_OpaqueGetProduct_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OpaqueEcommerceServiceServer).OpaqueGetProduct(ctx, req.(*OpaqueGetProductRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OpaqueEcommerceService_OpaqueSearchProducts_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(OpaqueSearchProductsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(OpaqueEcommerceServiceServer).OpaqueSearchProducts(m, &grpc.GenericServerStream[OpaqueSearchProductsRequest, OpaqueSearchProductsResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type OpaqueEcommerceService_OpaqueSearchProductsServer = grpc.ServerStreamingServer[OpaqueSearchProductsResponse] + +func _OpaqueEcommerceService_OpaqueProcessOrders_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(OpaqueEcommerceServiceServer).OpaqueProcessOrders(&grpc.GenericServerStream[OpaqueProcessOrdersRequest, OpaqueProcessOrdersResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type OpaqueEcommerceService_OpaqueProcessOrdersServer = grpc.ClientStreamingServer[OpaqueProcessOrdersRequest, OpaqueProcessOrdersResponse] + +func _OpaqueEcommerceService_OpaqueStreamCustomerActivity_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(OpaqueEcommerceServiceServer).OpaqueStreamCustomerActivity(&grpc.GenericServerStream[OpaqueStreamCustomerActivityRequest, OpaqueStreamCustomerActivityResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type OpaqueEcommerceService_OpaqueStreamCustomerActivityServer = grpc.BidiStreamingServer[OpaqueStreamCustomerActivityRequest, OpaqueStreamCustomerActivityResponse] + +// OpaqueEcommerceService_ServiceDesc is the grpc.ServiceDesc for OpaqueEcommerceService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var OpaqueEcommerceService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService", + HandlerType: (*OpaqueEcommerceServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "OpaqueGetProduct", + Handler: _OpaqueEcommerceService_OpaqueGetProduct_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "OpaqueSearchProducts", + Handler: _OpaqueEcommerceService_OpaqueSearchProducts_Handler, + ServerStreams: true, + }, + { + StreamName: "OpaqueProcessOrders", + Handler: _OpaqueEcommerceService_OpaqueProcessOrders_Handler, + ClientStreams: true, + }, + { + StreamName: "OpaqueStreamCustomerActivity", + Handler: _OpaqueEcommerceService_OpaqueStreamCustomerActivity_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "examples/internal/proto/examplepb/opaque.proto", +} From 78ec99ecc985b597a155ad9d18e782e778e39677 Mon Sep 17 00:00:00 2001 From: Ivan Koptiev Date: Wed, 16 Jul 2025 22:43:53 +0300 Subject: [PATCH 3/8] chore: restore original imports order --- protoc-gen-grpc-gateway/internal/gengateway/generator.go | 5 ++--- protoc-gen-grpc-gateway/internal/gengateway/template.go | 3 +-- .../internal/gengateway/template_test.go | 5 ++--- protoc-gen-grpc-gateway/main.go | 7 +++---- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/protoc-gen-grpc-gateway/internal/gengateway/generator.go b/protoc-gen-grpc-gateway/internal/gengateway/generator.go index e81e95c793b..5a58625c237 100644 --- a/protoc-gen-grpc-gateway/internal/gengateway/generator.go +++ b/protoc-gen-grpc-gateway/internal/gengateway/generator.go @@ -6,12 +6,11 @@ import ( "go/format" "path" + "github.com/grpc-ecosystem/grpc-gateway/v2/internal/descriptor" + gen "github.com/grpc-ecosystem/grpc-gateway/v2/internal/generator" "google.golang.org/grpc/grpclog" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/pluginpb" - - "github.com/grpc-ecosystem/grpc-gateway/v2/internal/descriptor" - gen "github.com/grpc-ecosystem/grpc-gateway/v2/internal/generator" ) var errNoTargetService = errors.New("no target service defined in the file") diff --git a/protoc-gen-grpc-gateway/internal/gengateway/template.go b/protoc-gen-grpc-gateway/internal/gengateway/template.go index f3ef4e89607..b647e1df1ea 100644 --- a/protoc-gen-grpc-gateway/internal/gengateway/template.go +++ b/protoc-gen-grpc-gateway/internal/gengateway/template.go @@ -8,11 +8,10 @@ import ( "strings" "text/template" - "google.golang.org/grpc/grpclog" - "github.com/grpc-ecosystem/grpc-gateway/v2/internal/casing" "github.com/grpc-ecosystem/grpc-gateway/v2/internal/descriptor" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc/grpclog" ) type param struct { diff --git a/protoc-gen-grpc-gateway/internal/gengateway/template_test.go b/protoc-gen-grpc-gateway/internal/gengateway/template_test.go index 0faa65ae31a..2ee159e4a93 100644 --- a/protoc-gen-grpc-gateway/internal/gengateway/template_test.go +++ b/protoc-gen-grpc-gateway/internal/gengateway/template_test.go @@ -4,11 +4,10 @@ import ( "strings" "testing" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/descriptorpb" - "github.com/grpc-ecosystem/grpc-gateway/v2/internal/descriptor" "github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/descriptorpb" ) func crossLinkFixture(f *descriptor.File) *descriptor.File { diff --git a/protoc-gen-grpc-gateway/main.go b/protoc-gen-grpc-gateway/main.go index 222e1fcfdfa..d62cbefd890 100644 --- a/protoc-gen-grpc-gateway/main.go +++ b/protoc-gen-grpc-gateway/main.go @@ -15,13 +15,12 @@ import ( "os" "runtime/debug" "strings" - - "google.golang.org/grpc/grpclog" - "google.golang.org/protobuf/compiler/protogen" - + "github.com/grpc-ecosystem/grpc-gateway/v2/internal/codegenerator" "github.com/grpc-ecosystem/grpc-gateway/v2/internal/descriptor" "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway/internal/gengateway" + "google.golang.org/grpc/grpclog" + "google.golang.org/protobuf/compiler/protogen" ) var ( From ec21db987c05d93ed0b91c361a6b652a1f11c372 Mon Sep 17 00:00:00 2001 From: Ivan Koptiev Date: Wed, 16 Jul 2025 22:46:16 +0300 Subject: [PATCH 4/8] chore: restore more formatting diffs --- protoc-gen-grpc-gateway/internal/gengateway/generator_test.go | 3 +-- protoc-gen-grpc-gateway/main.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/protoc-gen-grpc-gateway/internal/gengateway/generator_test.go b/protoc-gen-grpc-gateway/internal/gengateway/generator_test.go index 610c4ce5fa9..59f0fce1daf 100644 --- a/protoc-gen-grpc-gateway/internal/gengateway/generator_test.go +++ b/protoc-gen-grpc-gateway/internal/gengateway/generator_test.go @@ -3,10 +3,9 @@ package gengateway import ( "testing" + "github.com/grpc-ecosystem/grpc-gateway/v2/internal/descriptor" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/descriptorpb" - - "github.com/grpc-ecosystem/grpc-gateway/v2/internal/descriptor" ) func newExampleFileDescriptorWithGoPkg(gp *descriptor.GoPackage, filenamePrefix string) *descriptor.File { diff --git a/protoc-gen-grpc-gateway/main.go b/protoc-gen-grpc-gateway/main.go index d62cbefd890..862a8fc0dfd 100644 --- a/protoc-gen-grpc-gateway/main.go +++ b/protoc-gen-grpc-gateway/main.go @@ -15,7 +15,7 @@ import ( "os" "runtime/debug" "strings" - + "github.com/grpc-ecosystem/grpc-gateway/v2/internal/codegenerator" "github.com/grpc-ecosystem/grpc-gateway/v2/internal/descriptor" "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway/internal/gengateway" From 7211c3ea1ae0069d54b4ee5e0777ba3f756cb458 Mon Sep 17 00:00:00 2001 From: Ivan Koptiev Date: Tue, 22 Jul 2025 09:38:35 +0300 Subject: [PATCH 5/8] fix: add linter ignores where needed --- buf.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/buf.yaml b/buf.yaml index 025176faef3..80e405f6d80 100644 --- a/buf.yaml +++ b/buf.yaml @@ -18,6 +18,7 @@ lint: - examples/internal/proto/examplepb/generated_input.proto - examples/internal/proto/examplepb/excess_body.proto - examples/internal/proto/examplepb/non_standard_names.proto + - examples/internal/proto/examplepb/opaque.proto - examples/internal/proto/examplepb/openapi_merge_a.proto - examples/internal/proto/examplepb/openapi_merge_b.proto - examples/internal/proto/examplepb/response_body_service.proto @@ -58,6 +59,7 @@ lint: - examples/internal/proto/examplepb/generated_input.proto - examples/internal/proto/examplepb/excess_body.proto - examples/internal/proto/examplepb/non_standard_names.proto + - examples/internal/proto/examplepb/opaque.proto - examples/internal/proto/examplepb/openapi_merge_a.proto - examples/internal/proto/examplepb/openapi_merge_b.proto - examples/internal/proto/examplepb/response_body_service.proto @@ -89,6 +91,7 @@ lint: - examples/internal/proto/examplepb/generated_input.proto - examples/internal/proto/examplepb/excess_body.proto - examples/internal/proto/examplepb/non_standard_names.proto + - examples/internal/proto/examplepb/opaque.proto - examples/internal/proto/examplepb/response_body_service.proto - examples/internal/proto/examplepb/stream.proto - examples/internal/proto/examplepb/unannotated_echo_service.proto @@ -111,6 +114,7 @@ lint: - examples/internal/proto/examplepb/generated_input.proto - examples/internal/proto/examplepb/excess_body.proto - examples/internal/proto/examplepb/non_standard_names.proto + - examples/internal/proto/examplepb/opaque.proto - examples/internal/proto/examplepb/openapi_merge_a.proto - examples/internal/proto/examplepb/openapi_merge_b.proto - examples/internal/proto/examplepb/response_body_service.proto From c5566b089238438c3267ba3aac7b722ed64e599b Mon Sep 17 00:00:00 2001 From: Ivan Koptiev Date: Tue, 22 Jul 2025 09:43:04 +0300 Subject: [PATCH 6/8] fix: update BUILD files --- examples/internal/proto/examplepb/BUILD.bazel | 2 ++ internal/codegenerator/BUILD.bazel | 1 + 2 files changed, 3 insertions(+) diff --git a/examples/internal/proto/examplepb/BUILD.bazel b/examples/internal/proto/examplepb/BUILD.bazel index 3d652bc8d26..4bbe2ecc0c2 100644 --- a/examples/internal/proto/examplepb/BUILD.bazel +++ b/examples/internal/proto/examplepb/BUILD.bazel @@ -60,6 +60,7 @@ proto_library( "generated_output.proto", "ignore_comment.proto", "non_standard_names.proto", + "opaque.proto", "remove_internal_comment.proto", "response_body_service.proto", "stream.proto", @@ -129,6 +130,7 @@ go_proto_library( go_library( name = "examplepb", srcs = [ + "opaque.pb.gw.go", "openapi_merge_a.pb.go", "openapi_merge_a.pb.gw.go", "openapi_merge_a_grpc.pb.go", diff --git a/internal/codegenerator/BUILD.bazel b/internal/codegenerator/BUILD.bazel index 8766d38f5eb..475699b5da1 100644 --- a/internal/codegenerator/BUILD.bazel +++ b/internal/codegenerator/BUILD.bazel @@ -13,6 +13,7 @@ go_library( deps = [ "@org_golang_google_protobuf//compiler/protogen", "@org_golang_google_protobuf//proto", + "@org_golang_google_protobuf//types/descriptorpb", "@org_golang_google_protobuf//types/pluginpb", ], ) From 7dd9ca8412f8c0eb8902b6201f071c0f824ba43d Mon Sep 17 00:00:00 2001 From: Ivan Koptiev Date: Fri, 25 Jul 2025 12:21:52 +0300 Subject: [PATCH 7/8] chore: reformat proto file --- examples/internal/proto/examplepb/opaque.proto | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/examples/internal/proto/examplepb/opaque.proto b/examples/internal/proto/examplepb/opaque.proto index 101f66a656b..42152c0bdea 100644 --- a/examples/internal/proto/examplepb/opaque.proto +++ b/examples/internal/proto/examplepb/opaque.proto @@ -4,9 +4,9 @@ package grpc.gateway.examples.internal.proto.examplepb; import "google/api/annotations.proto"; import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; -import "google/protobuf/field_mask.proto"; option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb"; @@ -15,17 +15,13 @@ service OpaqueEcommerceService { // OpaqueGetProduct - Unary request, unary response // Retrieves detailed information about a specific product rpc OpaqueGetProduct(OpaqueGetProductRequest) returns (OpaqueGetProductResponse) { - option (google.api.http) = { - get: "/v1/products/{product_id}" - }; + option (google.api.http) = {get: "/v1/products/{product_id}"}; } // OpaqueSearchProducts - Unary request, stream response // Searches for products based on criteria and streams results back rpc OpaqueSearchProducts(OpaqueSearchProductsRequest) returns (stream OpaqueSearchProductsResponse) { - option (google.api.http) = { - get: "/v1/products/search" - }; + option (google.api.http) = {get: "/v1/products/search"}; } // OpaqueProcessOrders - Stream request, unary response @@ -96,22 +92,22 @@ message OpaqueSearchProductsResponse { // OpaqueProcessOrdersRequest represents a request to process order message OpaqueProcessOrdersRequest { - OpaqueOrder order = 1; + OpaqueOrder order = 1; } // OpaqueProcessOrdersResponse represents orders processing result message OpaqueProcessOrdersResponse { - OpaqueOrderSummary summary = 1; + OpaqueOrderSummary summary = 1; } // OpaqueStreamCustomerActivityRequest represents a report of user activity message OpaqueStreamCustomerActivityRequest { - OpaqueCustomerEvent event = 1; + OpaqueCustomerEvent event = 1; } // OpaqueStreamCustomerActivityRequest represents a report of server activity message OpaqueStreamCustomerActivityResponse { - OpaqueActivityUpdate event = 2; + OpaqueActivityUpdate event = 2; } // OpaqueAddress represents a physical address From 1167ac0c21585be992a45b393e7845a6f732d8f1 Mon Sep 17 00:00:00 2001 From: Ivan Koptiev Date: Fri, 25 Jul 2025 12:44:41 +0300 Subject: [PATCH 8/8] chore: update Bazel BUILD file --- examples/internal/proto/examplepb/BUILD.bazel | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/internal/proto/examplepb/BUILD.bazel b/examples/internal/proto/examplepb/BUILD.bazel index 4bbe2ecc0c2..e72807e574f 100644 --- a/examples/internal/proto/examplepb/BUILD.bazel +++ b/examples/internal/proto/examplepb/BUILD.bazel @@ -37,6 +37,8 @@ package(default_visibility = ["//visibility:public"]) # gazelle:exclude unannotated_echo_service_grpc.pb.go # gazelle:exclude visibility_rule_echo_service.pb.gw.go # gazelle:exclude visibility_rule_echo_service_grpc.pb.go +# gazelle:exclude opaque.pb.gw.go +# gazelle:exclude opaque_grpc.pb.go # gazelle:exclude openapi_merge_a.proto # gazelle:exclude openapi_merge_b.proto # gazelle:go_grpc_compilers //:go_apiv2, //:go_grpc, //protoc-gen-grpc-gateway:go_gen_grpc_gateway @@ -130,7 +132,6 @@ go_proto_library( go_library( name = "examplepb", srcs = [ - "opaque.pb.gw.go", "openapi_merge_a.pb.go", "openapi_merge_a.pb.gw.go", "openapi_merge_a_grpc.pb.go",