consul/proto-public/pbmulticluster/v2beta1/computed_exported_services_json.gen.go
Nathan Coleman 8233303876
Adjust type + field names for ComputedExportedServices (#20030)
Adjust type + field names for ComputedExportedServices

The existing type and field names in `ComputedExportedServices` are confusing to work with.

For example, the mechanics of looping through services and their consumers wind up being:
```go
// The field name here doesn't reflect what is actually at each index of the list
for _, service := range exportedServices.Consumers {
    for _, consumer := range service.Consumers {
        // The prefix matching the type here causes stutter when reading and
        // isn't consistent with naming conventions for tenancy in pbresource
        tenancy := consumer.ConsumerTenancy
    }
}
```
2024-01-08 21:56:45 +00:00

45 lines
1.6 KiB
Go

// Code generated by protoc-json-shim. DO NOT EDIT.
package multiclusterv2beta1
import (
protojson "google.golang.org/protobuf/encoding/protojson"
)
// MarshalJSON is a custom marshaler for ComputedExportedServices
func (this *ComputedExportedServices) MarshalJSON() ([]byte, error) {
str, err := ComputedExportedServicesMarshaler.Marshal(this)
return []byte(str), err
}
// UnmarshalJSON is a custom unmarshaler for ComputedExportedServices
func (this *ComputedExportedServices) UnmarshalJSON(b []byte) error {
return ComputedExportedServicesUnmarshaler.Unmarshal(b, this)
}
// MarshalJSON is a custom marshaler for ComputedExportedService
func (this *ComputedExportedService) MarshalJSON() ([]byte, error) {
str, err := ComputedExportedServicesMarshaler.Marshal(this)
return []byte(str), err
}
// UnmarshalJSON is a custom unmarshaler for ComputedExportedService
func (this *ComputedExportedService) UnmarshalJSON(b []byte) error {
return ComputedExportedServicesUnmarshaler.Unmarshal(b, this)
}
// MarshalJSON is a custom marshaler for ComputedExportedServiceConsumer
func (this *ComputedExportedServiceConsumer) MarshalJSON() ([]byte, error) {
str, err := ComputedExportedServicesMarshaler.Marshal(this)
return []byte(str), err
}
// UnmarshalJSON is a custom unmarshaler for ComputedExportedServiceConsumer
func (this *ComputedExportedServiceConsumer) UnmarshalJSON(b []byte) error {
return ComputedExportedServicesUnmarshaler.Unmarshal(b, this)
}
var (
ComputedExportedServicesMarshaler = &protojson.MarshalOptions{}
ComputedExportedServicesUnmarshaler = &protojson.UnmarshalOptions{DiscardUnknown: false}
)