// Code generated by protoc-gen-go-hashpb. DO NOT EDIT.
// protoc-gen-go-hashpb v0.4.2

package telemetryv1

import (
	protowire "google.golang.org/protobuf/encoding/protowire"
	durationpb "google.golang.org/protobuf/types/known/durationpb"
	hash "hash"
	maps "maps"
	math "math"
	slices "slices"
	unsafe "unsafe"
)

func cerbos_telemetry_v1_Event_ApiActivity_hashpb_sum(m *Event_ApiActivity, hasher hash.Hash, ignore map[string]struct{}) {
	if _, ok := ignore["cerbos.telemetry.v1.Event.ApiActivity.version"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(m.GetVersion()))))
		_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(m.GetVersion()), len(m.GetVersion())))
	}
	if _, ok := ignore["cerbos.telemetry.v1.Event.ApiActivity.uptime"]; !ok {
		if m.GetUptime() != nil {
			google_protobuf_Duration_hashpb_sum(m.GetUptime(), hasher, ignore)
		}
	}
	if _, ok := ignore["cerbos.telemetry.v1.Event.ApiActivity.method_calls"]; !ok {
		if len(m.MethodCalls) > 0 {
			for _, v := range m.MethodCalls {
				if v != nil {
					cerbos_telemetry_v1_Event_CountStat_hashpb_sum(v, hasher, ignore)
				}
			}
		}
	}
	if _, ok := ignore["cerbos.telemetry.v1.Event.ApiActivity.user_agents"]; !ok {
		if len(m.UserAgents) > 0 {
			for _, v := range m.UserAgents {
				if v != nil {
					cerbos_telemetry_v1_Event_CountStat_hashpb_sum(v, hasher, ignore)
				}
			}
		}
	}
}

func cerbos_telemetry_v1_Event_CountStat_hashpb_sum(m *Event_CountStat, hasher hash.Hash, ignore map[string]struct{}) {
	if _, ok := ignore["cerbos.telemetry.v1.Event.CountStat.key"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(m.GetKey()))))
		_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(m.GetKey()), len(m.GetKey())))
	}
	if _, ok := ignore["cerbos.telemetry.v1.Event.CountStat.count"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, m.GetCount()))
	}
}

func cerbos_telemetry_v1_Event_hashpb_sum(m *Event, hasher hash.Hash, ignore map[string]struct{}) {
	if m.Data != nil {
		if _, ok := ignore["cerbos.telemetry.v1.Event.data"]; !ok {
			switch t := m.Data.(type) {
			case *Event_ApiActivity_:
				if t.ApiActivity != nil {
					cerbos_telemetry_v1_Event_ApiActivity_hashpb_sum(t.ApiActivity, hasher, ignore)
				}
			}
		}
	}
}

func cerbos_telemetry_v1_ServerLaunch_Cerbos_hashpb_sum(m *ServerLaunch_Cerbos, hasher hash.Hash, ignore map[string]struct{}) {
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Cerbos.version"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(m.GetVersion()))))
		_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(m.GetVersion()), len(m.GetVersion())))
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Cerbos.commit"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(m.GetCommit()))))
		_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(m.GetCommit()), len(m.GetCommit())))
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Cerbos.build_date"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(m.GetBuildDate()))))
		_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(m.GetBuildDate()), len(m.GetBuildDate())))
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Cerbos.module_version"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(m.GetModuleVersion()))))
		_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(m.GetModuleVersion()), len(m.GetModuleVersion())))
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Cerbos.module_checksum"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(m.GetModuleChecksum()))))
		_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(m.GetModuleChecksum()), len(m.GetModuleChecksum())))
	}
}

func cerbos_telemetry_v1_ServerLaunch_Features_AdminApi_hashpb_sum(m *ServerLaunch_Features_AdminApi, hasher hash.Hash, ignore map[string]struct{}) {
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Features.AdminApi.enabled"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, protowire.EncodeBool(m.GetEnabled())))
	}
}

func cerbos_telemetry_v1_ServerLaunch_Features_Audit_hashpb_sum(m *ServerLaunch_Features_Audit, hasher hash.Hash, ignore map[string]struct{}) {
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Features.Audit.enabled"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, protowire.EncodeBool(m.GetEnabled())))
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Features.Audit.backend"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(m.GetBackend()))))
		_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(m.GetBackend()), len(m.GetBackend())))
	}
}

func cerbos_telemetry_v1_ServerLaunch_Features_Schema_hashpb_sum(m *ServerLaunch_Features_Schema, hasher hash.Hash, ignore map[string]struct{}) {
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Features.Schema.enforcement"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(m.GetEnforcement()))))
		_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(m.GetEnforcement()), len(m.GetEnforcement())))
	}
}

func cerbos_telemetry_v1_ServerLaunch_Features_Storage_Blob_hashpb_sum(m *ServerLaunch_Features_Storage_Blob, hasher hash.Hash, ignore map[string]struct{}) {
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Features.Storage.Blob.provider"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(m.GetProvider()))))
		_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(m.GetProvider()), len(m.GetProvider())))
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Features.Storage.Blob.poll_interval"]; !ok {
		if m.GetPollInterval() != nil {
			google_protobuf_Duration_hashpb_sum(m.GetPollInterval(), hasher, ignore)
		}
	}
}

func cerbos_telemetry_v1_ServerLaunch_Features_Storage_Bundle_hashpb_sum(m *ServerLaunch_Features_Storage_Bundle, hasher hash.Hash, ignore map[string]struct{}) {
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Features.Storage.Bundle.pdp_id"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(m.GetPdpId()))))
		_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(m.GetPdpId()), len(m.GetPdpId())))
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Features.Storage.Bundle.bundle_source"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(m.GetBundleSource()))))
		_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(m.GetBundleSource()), len(m.GetBundleSource())))
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Features.Storage.Bundle.client_id"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(m.GetClientId()))))
		_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(m.GetClientId()), len(m.GetClientId())))
	}
}

func cerbos_telemetry_v1_ServerLaunch_Features_Storage_Disk_hashpb_sum(m *ServerLaunch_Features_Storage_Disk, hasher hash.Hash, ignore map[string]struct{}) {
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Features.Storage.Disk.watch"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, protowire.EncodeBool(m.GetWatch())))
	}
}

func cerbos_telemetry_v1_ServerLaunch_Features_Storage_Git_hashpb_sum(m *ServerLaunch_Features_Storage_Git, hasher hash.Hash, ignore map[string]struct{}) {
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Features.Storage.Git.protocol"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(m.GetProtocol()))))
		_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(m.GetProtocol()), len(m.GetProtocol())))
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Features.Storage.Git.auth"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, protowire.EncodeBool(m.GetAuth())))
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Features.Storage.Git.poll_interval"]; !ok {
		if m.GetPollInterval() != nil {
			google_protobuf_Duration_hashpb_sum(m.GetPollInterval(), hasher, ignore)
		}
	}
}

func cerbos_telemetry_v1_ServerLaunch_Features_Storage_hashpb_sum(m *ServerLaunch_Features_Storage, hasher hash.Hash, ignore map[string]struct{}) {
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Features.Storage.driver"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(m.GetDriver()))))
		_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(m.GetDriver()), len(m.GetDriver())))
	}
	if m.Store != nil {
		if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Features.Storage.store"]; !ok {
			switch t := m.Store.(type) {
			case *ServerLaunch_Features_Storage_Disk_:
				if t.Disk != nil {
					cerbos_telemetry_v1_ServerLaunch_Features_Storage_Disk_hashpb_sum(t.Disk, hasher, ignore)
				}
			case *ServerLaunch_Features_Storage_Git_:
				if t.Git != nil {
					cerbos_telemetry_v1_ServerLaunch_Features_Storage_Git_hashpb_sum(t.Git, hasher, ignore)
				}
			case *ServerLaunch_Features_Storage_Blob_:
				if t.Blob != nil {
					cerbos_telemetry_v1_ServerLaunch_Features_Storage_Blob_hashpb_sum(t.Blob, hasher, ignore)
				}
			case *ServerLaunch_Features_Storage_Bundle_:
				if t.Bundle != nil {
					cerbos_telemetry_v1_ServerLaunch_Features_Storage_Bundle_hashpb_sum(t.Bundle, hasher, ignore)
				}
			}
		}
	}
}

func cerbos_telemetry_v1_ServerLaunch_Features_hashpb_sum(m *ServerLaunch_Features, hasher hash.Hash, ignore map[string]struct{}) {
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Features.audit"]; !ok {
		if m.GetAudit() != nil {
			cerbos_telemetry_v1_ServerLaunch_Features_Audit_hashpb_sum(m.GetAudit(), hasher, ignore)
		}
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Features.schema"]; !ok {
		if m.GetSchema() != nil {
			cerbos_telemetry_v1_ServerLaunch_Features_Schema_hashpb_sum(m.GetSchema(), hasher, ignore)
		}
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Features.admin_api"]; !ok {
		if m.GetAdminApi() != nil {
			cerbos_telemetry_v1_ServerLaunch_Features_AdminApi_hashpb_sum(m.GetAdminApi(), hasher, ignore)
		}
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Features.storage"]; !ok {
		if m.GetStorage() != nil {
			cerbos_telemetry_v1_ServerLaunch_Features_Storage_hashpb_sum(m.GetStorage(), hasher, ignore)
		}
	}
}

func cerbos_telemetry_v1_ServerLaunch_Source_hashpb_sum(m *ServerLaunch_Source, hasher hash.Hash, ignore map[string]struct{}) {
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Source.cerbos"]; !ok {
		if m.GetCerbos() != nil {
			cerbos_telemetry_v1_ServerLaunch_Cerbos_hashpb_sum(m.GetCerbos(), hasher, ignore)
		}
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Source.os"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(m.GetOs()))))
		_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(m.GetOs()), len(m.GetOs())))
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Source.arch"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(m.GetArch()))))
		_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(m.GetArch()), len(m.GetArch())))
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Source.num_cpus"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(m.GetNumCpus())))
	}
}

func cerbos_telemetry_v1_ServerLaunch_Stats_Policy_hashpb_sum(m *ServerLaunch_Stats_Policy, hasher hash.Hash, ignore map[string]struct{}) {
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Stats.Policy.count"]; !ok {
		if len(m.Count) > 0 {
			for _, k := range slices.Sorted(maps.Keys(m.Count)) {
				_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(k))))
				_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(k), len(k)))
				_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(m.Count[k])))
			}
		}
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Stats.Policy.avg_rule_count"]; !ok {
		if len(m.AvgRuleCount) > 0 {
			for _, k := range slices.Sorted(maps.Keys(m.AvgRuleCount)) {
				_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(k))))
				_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(k), len(k)))
				_, _ = hasher.Write(protowire.AppendFixed64(nil, math.Float64bits(m.AvgRuleCount[k])))
			}
		}
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Stats.Policy.avg_condition_count"]; !ok {
		if len(m.AvgConditionCount) > 0 {
			for _, k := range slices.Sorted(maps.Keys(m.AvgConditionCount)) {
				_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(k))))
				_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(k), len(k)))
				_, _ = hasher.Write(protowire.AppendFixed64(nil, math.Float64bits(m.AvgConditionCount[k])))
			}
		}
	}
}

func cerbos_telemetry_v1_ServerLaunch_Stats_Schema_hashpb_sum(m *ServerLaunch_Stats_Schema, hasher hash.Hash, ignore map[string]struct{}) {
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Stats.Schema.count"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(m.GetCount())))
	}
}

func cerbos_telemetry_v1_ServerLaunch_Stats_hashpb_sum(m *ServerLaunch_Stats, hasher hash.Hash, ignore map[string]struct{}) {
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Stats.policy"]; !ok {
		if m.GetPolicy() != nil {
			cerbos_telemetry_v1_ServerLaunch_Stats_Policy_hashpb_sum(m.GetPolicy(), hasher, ignore)
		}
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.Stats.schema"]; !ok {
		if m.GetSchema() != nil {
			cerbos_telemetry_v1_ServerLaunch_Stats_Schema_hashpb_sum(m.GetSchema(), hasher, ignore)
		}
	}
}

func cerbos_telemetry_v1_ServerLaunch_hashpb_sum(m *ServerLaunch, hasher hash.Hash, ignore map[string]struct{}) {
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.version"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(m.GetVersion()))))
		_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(m.GetVersion()), len(m.GetVersion())))
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.source"]; !ok {
		if m.GetSource() != nil {
			cerbos_telemetry_v1_ServerLaunch_Source_hashpb_sum(m.GetSource(), hasher, ignore)
		}
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.features"]; !ok {
		if m.GetFeatures() != nil {
			cerbos_telemetry_v1_ServerLaunch_Features_hashpb_sum(m.GetFeatures(), hasher, ignore)
		}
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerLaunch.stats"]; !ok {
		if m.GetStats() != nil {
			cerbos_telemetry_v1_ServerLaunch_Stats_hashpb_sum(m.GetStats(), hasher, ignore)
		}
	}
}

func cerbos_telemetry_v1_ServerStop_hashpb_sum(m *ServerStop, hasher hash.Hash, ignore map[string]struct{}) {
	if _, ok := ignore["cerbos.telemetry.v1.ServerStop.version"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(len(m.GetVersion()))))
		_, _ = hasher.Write(unsafe.Slice(unsafe.StringData(m.GetVersion()), len(m.GetVersion())))
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerStop.uptime"]; !ok {
		if m.GetUptime() != nil {
			google_protobuf_Duration_hashpb_sum(m.GetUptime(), hasher, ignore)
		}
	}
	if _, ok := ignore["cerbos.telemetry.v1.ServerStop.requests_total"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, m.GetRequestsTotal()))
	}
}

func google_protobuf_Duration_hashpb_sum(m *durationpb.Duration, hasher hash.Hash, ignore map[string]struct{}) {
	if _, ok := ignore["google.protobuf.Duration.seconds"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(m.GetSeconds())))
	}
	if _, ok := ignore["google.protobuf.Duration.nanos"]; !ok {
		_, _ = hasher.Write(protowire.AppendVarint(nil, uint64(m.GetNanos())))
	}
}
