From 3aebb047ecc89ea02e167996a02a0e04b6efb4ce Mon Sep 17 00:00:00 2001 From: Praveenrajmani Date: Thu, 9 Oct 2025 22:42:46 +0530 Subject: [PATCH 1/2] Add audit log categorization and enhanced filtering options This commit introduces comprehensive audit log categorization and enhanced filtering capabilities for API, audit, and error logs: - Add AuditCategory enum with 15 categories (config, user, service-account, policy, group, bucket, lifecycle, replication, notification, encryption, cors, versioning, service, kms, site-replication, pool, idp, log-recorder) - Add AuditAction enum with common actions (create, update, delete, enable, disable, set, reset, restore, clear, start, stop, restart, attach, detach) - Extend Audit struct with Category, Action, and Details fields for richer audit event metadata - Add MaxPerNode field to APILogOpts, AuditLogOpts, and ErrorLogOpts to limit log entries retrieved per cluster node - Add Category filter to AuditLogOpts for filtering by audit category - Introduce detailed audit structures for different categories (ConfigAuditDetails, UserAuditDetails, ServiceAccountAuditDetails, PolicyAuditDetails, GroupAuditDetails, BucketConfigAuditDetails, ServiceAuditDetails) - Generate msgp serialization code for new audit types These changes enable more granular audit log queries and structured audit event tracking across MinIO admin operations. --- api-logs.go | 1 + audit-logs.go | 10 +- cgroup/linux.go | 1 - cgroup/linux_test.go | 1 - cgroup/nolinux.go | 1 - cpu_linux.go | 1 - cpu_nolinux.go | 1 - error-logs.go | 11 +- examples/accounting-info.go | 1 - examples/alive.go | 1 - examples/api-logs.go | 1 - examples/audit-logs.go | 1 - examples/bucket-bandwidth.go | 1 - examples/bucket-metadata.go | 1 - examples/bucket-quota.go | 1 - examples/bucket-target.go | 1 - examples/cluster-api.go | 1 - examples/cluster-health.go | 1 - examples/create-job.go | 1 - examples/data-usage-info.go | 1 - examples/drives-query.go | 1 - examples/error-logs.go | 1 - examples/force-unlock.go | 1 - examples/heal-manual.go | 1 - examples/heal-status.go | 1 - examples/iam-migrate.go | 1 - examples/kms-status.go | 1 - examples/list-pools.go | 1 - examples/log-config.go | 1 - examples/perf-object.go | 1 - examples/profiling.go | 1 - examples/query-api.go | 1 - examples/replicate-diff.go | 1 - examples/replicate-mrf.go | 1 - examples/server-info.go | 1 - examples/service-account.go | 1 - examples/service-restart.go | 1 - examples/service-trace.go | 1 - examples/storage-info.go | 1 - examples/top-locks.go | 1 - fips.go | 1 - kernel/kernel.go | 1 - kernel/kernel_other.go | 1 - kernel/kernel_test.go | 1 - kernel/kernel_utsname_int8.go | 1 - kernel/kernel_utsname_uint8.go | 1 - log/audit.go | 892 ++- log/audit_gen.go | 10546 ++++++++++++++++++++++++++++++- log/audit_gen_test.go | 2373 +++++++ net_linux.go | 1 - net_nolinux.go | 1 - no_fips.go | 1 - 52 files changed, 13725 insertions(+), 154 deletions(-) diff --git a/api-logs.go b/api-logs.go index 1d2472bd..0e1159d8 100644 --- a/api-logs.go +++ b/api-logs.go @@ -42,6 +42,7 @@ type APILogOpts struct { Interval time.Duration `json:"interval,omitempty"` Origin log.Origin `json:"origin,omitempty"` Type log.APIType `json:"type,omitempty"` + MaxPerNode int `json:"maxPerNode,omitempty"` } // GetAPILogs fetches the persisted API logs from MinIO diff --git a/audit-logs.go b/audit-logs.go index dc618d51..21500760 100644 --- a/audit-logs.go +++ b/audit-logs.go @@ -34,10 +34,12 @@ import ( // AuditLogOpts represents the options for the audit logs type AuditLogOpts struct { - Node string `json:"node,omitempty"` - API string `json:"api,omitempty"` - Bucket string `json:"bucket,omitempty"` - Interval time.Duration `json:"interval,omitempty"` + Node string `json:"node,omitempty"` + API string `json:"api,omitempty"` + Bucket string `json:"bucket,omitempty"` + Interval time.Duration `json:"interval,omitempty"` + Category log.AuditCategory `json:"category,omitempty"` + MaxPerNode int `json:"maxPerNode,omitempty"` } // GetAuditLogs fetches the persisted audit logs from MinIO diff --git a/cgroup/linux.go b/cgroup/linux.go index 4e3c8db6..8bfd89f4 100644 --- a/cgroup/linux.go +++ b/cgroup/linux.go @@ -1,5 +1,4 @@ //go:build linux -// +build linux // Copyright (c) 2015-2024 MinIO, Inc. // diff --git a/cgroup/linux_test.go b/cgroup/linux_test.go index e7ed2874..d9ce0f42 100644 --- a/cgroup/linux_test.go +++ b/cgroup/linux_test.go @@ -1,5 +1,4 @@ //go:build linux -// +build linux // // Copyright (c) 2015-2024 MinIO, Inc. diff --git a/cgroup/nolinux.go b/cgroup/nolinux.go index 42baa66f..3d791572 100644 --- a/cgroup/nolinux.go +++ b/cgroup/nolinux.go @@ -1,5 +1,4 @@ //go:build !linux -// +build !linux // // Copyright (c) 2015-2024 MinIO, Inc. diff --git a/cpu_linux.go b/cpu_linux.go index dbfef90a..0ed9057f 100644 --- a/cpu_linux.go +++ b/cpu_linux.go @@ -1,5 +1,4 @@ //go:build linux -// +build linux // // Copyright (c) 2015-2025 MinIO, Inc. diff --git a/cpu_nolinux.go b/cpu_nolinux.go index dbb632a3..ef3ae2bc 100644 --- a/cpu_nolinux.go +++ b/cpu_nolinux.go @@ -1,5 +1,4 @@ //go:build !linux -// +build !linux package madmin diff --git a/error-logs.go b/error-logs.go index 89457160..8632bbc5 100644 --- a/error-logs.go +++ b/error-logs.go @@ -34,11 +34,12 @@ import ( // ErrorLogOpts represents the options for the ErrorLogs type ErrorLogOpts struct { - Node string `json:"node,omitempty"` - API string `json:"api,omitempty"` - Bucket string `json:"bucket,omitempty"` - Prefix string `json:"prefix,omitempty"` - Interval time.Duration `json:"interval,omitempty"` + Node string `json:"node,omitempty"` + API string `json:"api,omitempty"` + Bucket string `json:"bucket,omitempty"` + Prefix string `json:"prefix,omitempty"` + Interval time.Duration `json:"interval,omitempty"` + MaxPerNode int `json:"maxPerNode,omitempty"` } // GetErrorLogs fetches the persisted error logs from MinIO diff --git a/examples/accounting-info.go b/examples/accounting-info.go index 28f8b71a..31ed08f8 100644 --- a/examples/accounting-info.go +++ b/examples/accounting-info.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/examples/alive.go b/examples/alive.go index 639cda14..a59e6a48 100644 --- a/examples/alive.go +++ b/examples/alive.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/examples/api-logs.go b/examples/api-logs.go index 61fec5e2..8b80d527 100644 --- a/examples/api-logs.go +++ b/examples/api-logs.go @@ -1,6 +1,5 @@ // //go:build ignore -// +build ignore // // Copyright (c) 2015-2022 MinIO, Inc. diff --git a/examples/audit-logs.go b/examples/audit-logs.go index 481cde42..37ed568c 100644 --- a/examples/audit-logs.go +++ b/examples/audit-logs.go @@ -1,6 +1,5 @@ // //go:build ignore -// +build ignore // // Copyright (c) 2015-2022 MinIO, Inc. diff --git a/examples/bucket-bandwidth.go b/examples/bucket-bandwidth.go index e393f31a..1cb9d608 100644 --- a/examples/bucket-bandwidth.go +++ b/examples/bucket-bandwidth.go @@ -1,6 +1,5 @@ // //go:build ignore -// +build ignore // // Copyright (c) 2015-2022 MinIO, Inc. diff --git a/examples/bucket-metadata.go b/examples/bucket-metadata.go index 046bf539..d484c179 100644 --- a/examples/bucket-metadata.go +++ b/examples/bucket-metadata.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/examples/bucket-quota.go b/examples/bucket-quota.go index adcb9815..956d491e 100644 --- a/examples/bucket-quota.go +++ b/examples/bucket-quota.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/examples/bucket-target.go b/examples/bucket-target.go index 028424bc..3c650b59 100644 --- a/examples/bucket-target.go +++ b/examples/bucket-target.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/examples/cluster-api.go b/examples/cluster-api.go index ec304b39..8c40bea3 100644 --- a/examples/cluster-api.go +++ b/examples/cluster-api.go @@ -1,6 +1,5 @@ // //go:build ignore -// +build ignore // // Copyright (c) 2015-2022 MinIO, Inc. diff --git a/examples/cluster-health.go b/examples/cluster-health.go index 182e07c0..9f9fe793 100644 --- a/examples/cluster-health.go +++ b/examples/cluster-health.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/examples/create-job.go b/examples/create-job.go index 8ca0bd40..9eb95906 100644 --- a/examples/create-job.go +++ b/examples/create-job.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/examples/data-usage-info.go b/examples/data-usage-info.go index 17966c45..7cd497d5 100644 --- a/examples/data-usage-info.go +++ b/examples/data-usage-info.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/examples/drives-query.go b/examples/drives-query.go index d7c391db..ef321c5f 100644 --- a/examples/drives-query.go +++ b/examples/drives-query.go @@ -1,6 +1,5 @@ // //go:build ignore -// +build ignore // // Copyright (c) 2015-2025 MinIO, Inc. diff --git a/examples/error-logs.go b/examples/error-logs.go index 4db81c93..b2c16a59 100644 --- a/examples/error-logs.go +++ b/examples/error-logs.go @@ -1,6 +1,5 @@ // //go:build ignore -// +build ignore // // Copyright (c) 2015-2022 MinIO, Inc. diff --git a/examples/force-unlock.go b/examples/force-unlock.go index 04c99ac4..e360cbfa 100644 --- a/examples/force-unlock.go +++ b/examples/force-unlock.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/examples/heal-manual.go b/examples/heal-manual.go index 2c3f46b4..262e125f 100644 --- a/examples/heal-manual.go +++ b/examples/heal-manual.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/examples/heal-status.go b/examples/heal-status.go index bc1c580a..79f04d25 100644 --- a/examples/heal-status.go +++ b/examples/heal-status.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/examples/iam-migrate.go b/examples/iam-migrate.go index a81a2b99..99a33c53 100644 --- a/examples/iam-migrate.go +++ b/examples/iam-migrate.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/examples/kms-status.go b/examples/kms-status.go index 5ccf647e..0bad0111 100644 --- a/examples/kms-status.go +++ b/examples/kms-status.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/examples/list-pools.go b/examples/list-pools.go index b61de2b7..57a598cd 100644 --- a/examples/list-pools.go +++ b/examples/list-pools.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/examples/log-config.go b/examples/log-config.go index e22f8d0e..23537431 100644 --- a/examples/log-config.go +++ b/examples/log-config.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // // Copyright (c) 2015-2025 MinIO, Inc. diff --git a/examples/perf-object.go b/examples/perf-object.go index 4cac90d1..c5101451 100644 --- a/examples/perf-object.go +++ b/examples/perf-object.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/examples/profiling.go b/examples/profiling.go index e67e4a81..f12cf7cb 100644 --- a/examples/profiling.go +++ b/examples/profiling.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/examples/query-api.go b/examples/query-api.go index 1adcee69..f180d9e8 100644 --- a/examples/query-api.go +++ b/examples/query-api.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // // Copyright (c) 2015-2025 MinIO, Inc. diff --git a/examples/replicate-diff.go b/examples/replicate-diff.go index a7ec293f..78e30480 100644 --- a/examples/replicate-diff.go +++ b/examples/replicate-diff.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/examples/replicate-mrf.go b/examples/replicate-mrf.go index 8f664dc0..db149ade 100644 --- a/examples/replicate-mrf.go +++ b/examples/replicate-mrf.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2023 MinIO, Inc. // diff --git a/examples/server-info.go b/examples/server-info.go index 65f6b610..73c5d194 100644 --- a/examples/server-info.go +++ b/examples/server-info.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/examples/service-account.go b/examples/service-account.go index a239869f..cd169e7a 100644 --- a/examples/service-account.go +++ b/examples/service-account.go @@ -1,6 +1,5 @@ // //go:build ignore -// +build ignore // // Copyright (c) 2015-2022 MinIO, Inc. diff --git a/examples/service-restart.go b/examples/service-restart.go index 0a651535..13d7f121 100644 --- a/examples/service-restart.go +++ b/examples/service-restart.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/examples/service-trace.go b/examples/service-trace.go index f796c142..66845573 100644 --- a/examples/service-trace.go +++ b/examples/service-trace.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/examples/storage-info.go b/examples/storage-info.go index 02bf2445..8aec5432 100644 --- a/examples/storage-info.go +++ b/examples/storage-info.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/examples/top-locks.go b/examples/top-locks.go index 849d11c0..0af3f287 100644 --- a/examples/top-locks.go +++ b/examples/top-locks.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // Copyright (c) 2015-2022 MinIO, Inc. // diff --git a/fips.go b/fips.go index e25507f2..a69b29eb 100644 --- a/fips.go +++ b/fips.go @@ -18,7 +18,6 @@ // //go:build fips -// +build fips package madmin diff --git a/kernel/kernel.go b/kernel/kernel.go index 8e23bcb5..c71809fc 100644 --- a/kernel/kernel.go +++ b/kernel/kernel.go @@ -18,7 +18,6 @@ // //go:build linux -// +build linux package kernel diff --git a/kernel/kernel_other.go b/kernel/kernel_other.go index 9dd4576c..90857e27 100644 --- a/kernel/kernel_other.go +++ b/kernel/kernel_other.go @@ -18,7 +18,6 @@ // //go:build !linux -// +build !linux package kernel diff --git a/kernel/kernel_test.go b/kernel/kernel_test.go index d42d1b2d..678bcb80 100644 --- a/kernel/kernel_test.go +++ b/kernel/kernel_test.go @@ -18,7 +18,6 @@ // //go:build linux -// +build linux package kernel diff --git a/kernel/kernel_utsname_int8.go b/kernel/kernel_utsname_int8.go index ca33a946..1186b5f0 100644 --- a/kernel/kernel_utsname_int8.go +++ b/kernel/kernel_utsname_int8.go @@ -18,7 +18,6 @@ // //go:build (linux && 386) || (linux && amd64) || (linux && arm64) || (linux && loong64) || (linux && mips64) || (linux && mips64le) || (linux && mips) -// +build linux,386 linux,amd64 linux,arm64 linux,loong64 linux,mips64 linux,mips64le linux,mips package kernel diff --git a/kernel/kernel_utsname_uint8.go b/kernel/kernel_utsname_uint8.go index 5f6399cd..b78b36e0 100644 --- a/kernel/kernel_utsname_uint8.go +++ b/kernel/kernel_utsname_uint8.go @@ -18,7 +18,6 @@ // //go:build (linux && arm) || (linux && ppc64) || (linux && ppc64le) || (linux && s390x) || (linux && riscv64) -// +build linux,arm linux,ppc64 linux,ppc64le linux,s390x linux,riscv64 package kernel diff --git a/log/audit.go b/log/audit.go index c1e0dc9a..b8c3d1bf 100644 --- a/log/audit.go +++ b/log/audit.go @@ -18,19 +18,108 @@ package log import ( + "fmt" "strings" "time" ) +var sensitiveFields = []string{"password", "secret", "secretkey", "accesskey", "token"} + +func redactIfSensitive(key, value string) string { + lowerKey := strings.ToLower(key) + for _, field := range sensitiveFields { + if strings.Contains(lowerKey, field) { + return "***REDACTED***" + } + } + return value +} + //msgp:tag json //go:generate msgp -d clearomitted -d "timezone utc" $GOFILE -// Audit represents the user triggered audit events +// AuditCategory represents the category of audit event +// +//msgp:shim AuditCategory as:string +type AuditCategory string + +const ( + AuditCategoryConfig AuditCategory = "config" + AuditCategoryUser AuditCategory = "user" + AuditCategoryServiceAccount AuditCategory = "service-account" + AuditCategoryPolicy AuditCategory = "policy" + AuditCategoryGroup AuditCategory = "group" + AuditCategoryBucket AuditCategory = "bucket" + AuditCategoryLifecycle AuditCategory = "lifecycle" + AuditCategoryReplication AuditCategory = "replication" + AuditCategoryNotification AuditCategory = "notification" + AuditCategoryEncryption AuditCategory = "encryption" + AuditCategoryCORS AuditCategory = "cors" + AuditCategoryVersioning AuditCategory = "versioning" + AuditCategoryService AuditCategory = "service" + AuditCategoryKMS AuditCategory = "kms" + AuditCategorySiteRepl AuditCategory = "site-replication" + AuditCategoryPool AuditCategory = "pool" + AuditCategoryIDP AuditCategory = "idp" + AuditCategoryLogRecorder AuditCategory = "log-recorder" + AuditCategoryHeal AuditCategory = "heal" + AuditCategoryBatch AuditCategory = "batch" +) + +// AuditAction represents the type of action performed +// +//msgp:shim AuditAction as:string +type AuditAction string + +const ( + AuditActionCreate AuditAction = "create" + AuditActionUpdate AuditAction = "update" + AuditActionDelete AuditAction = "delete" + AuditActionEnable AuditAction = "enable" + AuditActionDisable AuditAction = "disable" + AuditActionSet AuditAction = "set" + AuditActionReset AuditAction = "reset" + AuditActionRestore AuditAction = "restore" + AuditActionClear AuditAction = "clear" + AuditActionStart AuditAction = "start" + AuditActionStop AuditAction = "stop" + AuditActionRestart AuditAction = "restart" + AuditActionAttach AuditAction = "attach" + AuditActionDetach AuditAction = "detach" +) + +// AuditDetails is a union type containing category-specific audit details. +// Only one field should be populated based on the audit event category. +type AuditDetails struct { + Config *ConfigAuditDetails `json:"config,omitempty"` + User *UserAuditDetails `json:"user,omitempty"` + ServiceAccount *ServiceAccountAuditDetails `json:"serviceAccount,omitempty"` + Policy *PolicyAuditDetails `json:"policy,omitempty"` + Group *GroupAuditDetails `json:"group,omitempty"` + BucketConfig *BucketConfigAuditDetails `json:"bucketConfig,omitempty"` + BucketQuota *BucketQuotaAuditDetails `json:"bucketQuota,omitempty"` + BucketQOS *BucketQOSAuditDetails `json:"bucketQOS,omitempty"` + BucketInventory *BucketInventoryAuditDetails `json:"bucketInventory,omitempty"` + Tier *TierAuditDetails `json:"tier,omitempty"` + Service *ServiceAuditDetails `json:"service,omitempty"` + KMS *KMSAuditDetails `json:"kms,omitempty"` + Pool *PoolAuditDetails `json:"pool,omitempty"` + SiteRepl *SiteReplicationAuditDetails `json:"siteRepl,omitempty"` + IDP *IDPAuditDetails `json:"idp,omitempty"` + Recorder *RecorderAuditDetails `json:"recorder,omitempty"` + Heal *HealAuditDetails `json:"heal,omitempty"` + Batch *BatchAuditDetails `json:"batch,omitempty"` +} + +// Audit represents the user triggered audit events. +// It captures administrative operations performed on the MinIO cluster with contextual metadata. type Audit struct { Version string `json:"version"` Time time.Time `json:"time"` Node string `json:"node,omitempty"` APIName string `json:"apiName,omitempty"` + Category AuditCategory `json:"category,omitempty"` + Action AuditAction `json:"action,omitempty"` Bucket string `json:"bucket,omitempty"` Tags map[string]string `json:"tags,omitempty"` RequestID string `json:"requestID,omitempty"` @@ -38,23 +127,792 @@ type Audit struct { SourceHost string `json:"sourceHost,omitempty"` AccessKey string `json:"accessKey,omitempty"` ParentUser string `json:"parentUser,omitempty"` + Details *AuditDetails `json:"details,omitempty"` +} + +// ConfigAuditDetails captures config mutation details. +// It tracks changes to server configuration settings including subsystem, target, key, and value changes. +type ConfigAuditDetails struct { + SubSystem string `json:"subSystem,omitempty"` + Target string `json:"target,omitempty"` + Key string `json:"key,omitempty"` + OldValue string `json:"oldValue,omitempty"` + NewValue string `json:"newValue,omitempty"` +} + +// Redact redacts sensitive fields in ConfigAuditDetails +func (c *ConfigAuditDetails) Redact() { + c.OldValue = redactIfSensitive(c.Key, c.OldValue) + c.NewValue = redactIfSensitive(c.Key, c.NewValue) +} + +// UserAuditDetails captures user mutation details. +// It tracks changes to user accounts including status, credentials, policies, and group memberships. +type UserAuditDetails struct { + UserName string `json:"userName"` + UserType string `json:"userType,omitempty"` + Field string `json:"field,omitempty"` + OldValue string `json:"oldValue,omitempty"` + NewValue string `json:"newValue,omitempty"` + OldStatus string `json:"oldStatus,omitempty"` + NewStatus string `json:"newStatus,omitempty"` + Policies []string `json:"policies,omitempty"` + Groups []string `json:"groups,omitempty"` +} + +// Redact redacts sensitive fields in UserAuditDetails +func (u *UserAuditDetails) Redact() { + u.OldValue = redactIfSensitive(u.Field, u.OldValue) + u.NewValue = redactIfSensitive(u.Field, u.NewValue) +} + +// ServiceAccountAuditDetails captures service account details. +// It tracks changes to service accounts including parent user, policies, expiration, and secret key updates. +type ServiceAccountAuditDetails struct { + AccountName string `json:"accountName"` + ParentUser string `json:"parentUser,omitempty"` + Policies []string `json:"policies,omitempty"` + Expiration time.Time `json:"expiration,omitempty"` + UpdatedName string `json:"updatedName,omitempty"` + UpdatedStatus string `json:"updatedStatus,omitempty"` + UpdatedPolicy bool `json:"updatedPolicy,omitempty"` + UpdatedExpiry bool `json:"updatedExpiry,omitempty"` + UpdatedSecretKey bool `json:"updatedSecretKey,omitempty"` +} + +// Redact redacts sensitive fields in ServiceAccountAuditDetails +func (s *ServiceAccountAuditDetails) Redact() {} + +// PolicyAuditDetails captures policy mutation details. +// It tracks IAM policy changes including policy content, attachments, and detachments for users or groups. +type PolicyAuditDetails struct { + PolicyName string `json:"policyName"` + OldPolicy string `json:"oldPolicy,omitempty"` + NewPolicy string `json:"newPolicy,omitempty"` + Operation string `json:"operation,omitempty"` + User string `json:"user,omitempty"` + Group string `json:"group,omitempty"` + PoliciesAttached []string `json:"policiesAttached,omitempty"` + PoliciesDetached []string `json:"policiesDetached,omitempty"` +} + +// Redact redacts sensitive fields in PolicyAuditDetails +func (p *PolicyAuditDetails) Redact() {} + +// GroupAuditDetails captures group mutation details. +// It tracks changes to IAM groups including member additions, removals, and status changes. +type GroupAuditDetails struct { + GroupName string `json:"groupName"` + MembersAdded []string `json:"membersAdded,omitempty"` + MembersRemoved []string `json:"membersRemoved,omitempty"` + OldStatus string `json:"oldStatus,omitempty"` + NewStatus string `json:"newStatus,omitempty"` +} + +// Redact redacts sensitive fields in GroupAuditDetails +func (g *GroupAuditDetails) Redact() {} + +// BucketConfigAuditDetails captures bucket configuration changes. +// It tracks modifications to bucket settings like lifecycle, replication, encryption, versioning, and tags. +type BucketConfigAuditDetails struct { + BucketName string `json:"bucketName"` + ConfigType string `json:"configType,omitempty"` + OldConfig string `json:"oldConfig,omitempty"` + NewConfig string `json:"newConfig,omitempty"` + TargetBucket string `json:"targetBucket,omitempty"` + TagKeys []string `json:"tagKeys,omitempty"` + TagCount int `json:"tagCount,omitempty"` +} + +// Redact redacts sensitive fields in BucketConfigAuditDetails +func (b *BucketConfigAuditDetails) Redact() {} + +// ServiceAuditDetails captures service operation details. +// It tracks MinIO service operations like restart, update, IAM import/export, and cluster management actions. +type ServiceAuditDetails struct { + ServiceName string `json:"serviceName,omitempty"` + Operation string `json:"operation,omitempty"` + Status string `json:"status,omitempty"` + Legacy bool `json:"legacy,omitempty"` + IAMImport *IAMImportDetails `json:"iamImport,omitempty"` +} + +// Redact redacts sensitive fields in ServiceAuditDetails +func (s *ServiceAuditDetails) Redact() {} + +// IAMImportDetails captures IAM import operation counts. +// It tracks the number of users, policies, groups, and service accounts added, removed, skipped, or failed during IAM imports. +type IAMImportDetails struct { + UsersAdded int `json:"usersAdded,omitempty"` + PoliciesAdded int `json:"policiesAdded,omitempty"` + GroupsAdded int `json:"groupsAdded,omitempty"` + SvcAcctsAdded int `json:"svcAcctsAdded,omitempty"` + UsersRemoved int `json:"usersRemoved,omitempty"` + PoliciesRemoved int `json:"policiesRemoved,omitempty"` + GroupsRemoved int `json:"groupsRemoved,omitempty"` + SvcAcctsRemoved int `json:"svcAcctsRemoved,omitempty"` + UsersSkipped int `json:"usersSkipped,omitempty"` + PoliciesSkipped int `json:"policiesSkipped,omitempty"` + GroupsSkipped int `json:"groupsSkipped,omitempty"` + SvcAcctsSkipped int `json:"svcAcctsSkipped,omitempty"` + UsersFailed int `json:"usersFailed,omitempty"` + PoliciesFailed int `json:"policiesFailed,omitempty"` + GroupsFailed int `json:"groupsFailed,omitempty"` + SvcAcctsFailed int `json:"svcAcctsFailed,omitempty"` +} + +// KMSAuditDetails captures KMS operation details. +// It tracks Key Management Service operations like key creation, deletion, and encryption/decryption activities. +type KMSAuditDetails struct { + KeyID string `json:"keyId,omitempty"` + Operation string `json:"operation,omitempty"` +} + +// Redact redacts sensitive fields in KMSAuditDetails +func (k *KMSAuditDetails) Redact() {} + +// PoolAuditDetails captures pool operation details. +// It tracks storage pool operations like expansion, decommission, and rebalancing across multiple endpoints. +type PoolAuditDetails struct { + PoolIndex int `json:"poolIndex,omitempty"` + Endpoints []string `json:"endpoints,omitempty"` + Operation string `json:"operation,omitempty"` +} + +// Redact redacts sensitive fields in PoolAuditDetails +func (p *PoolAuditDetails) Redact() {} + +// SiteReplicationAuditDetails captures site replication details. +// It tracks multi-site replication operations including site additions, removals, and replication status changes. +type SiteReplicationAuditDetails struct { + SiteName string `json:"siteName,omitempty"` + Endpoint string `json:"endpoint,omitempty"` + Operation string `json:"operation,omitempty"` + Sites []string `json:"sites,omitempty"` +} + +// Redact redacts sensitive fields in SiteReplicationAuditDetails +func (s *SiteReplicationAuditDetails) Redact() {} + +// IDPAuditDetails captures identity provider configuration details. +// It tracks changes to IDP configurations like LDAP, OpenID, or SAML settings including credentials and endpoints. +type IDPAuditDetails struct { + IDPName string `json:"idpName,omitempty"` + IDPType string `json:"idpType,omitempty"` + ConfigKey string `json:"configKey,omitempty"` + OldValue string `json:"oldValue,omitempty"` + NewValue string `json:"newValue,omitempty"` +} + +// Redact redacts sensitive fields in IDPAuditDetails +func (i *IDPAuditDetails) Redact() { + i.OldValue = redactIfSensitive(i.ConfigKey, i.OldValue) + i.NewValue = redactIfSensitive(i.ConfigKey, i.NewValue) +} + +// RecorderAuditDetails captures log recorder configuration details. +// It tracks changes to audit/error log recorder settings including enable status, limits, flush intervals, and batch sizes. +type RecorderAuditDetails struct { + LogType string `json:"logType,omitempty"` + OldEnabled bool `json:"oldEnabled,omitempty"` + NewEnabled bool `json:"newEnabled,omitempty"` + OldLimit string `json:"oldLimit,omitempty"` + NewLimit string `json:"newLimit,omitempty"` + OldFlushCount int `json:"oldFlushCount,omitempty"` + NewFlushCount int `json:"newFlushCount,omitempty"` + OldFlushInterval string `json:"oldFlushInterval,omitempty"` + NewFlushInterval string `json:"newFlushInterval,omitempty"` +} + +// Redact redacts sensitive fields in RecorderAuditDetails +func (r *RecorderAuditDetails) Redact() {} + +// HealAuditDetails captures heal operation details. +// It tracks data healing operations that scan and repair inconsistent or missing objects in buckets. +type HealAuditDetails struct { + Operation string `json:"operation,omitempty"` + Bucket string `json:"bucket,omitempty"` + Prefix string `json:"prefix,omitempty"` +} + +// Redact redacts sensitive fields in HealAuditDetails +func (h *HealAuditDetails) Redact() {} + +// BatchAuditDetails captures batch job operation details. +// It tracks batch operations like replication jobs, key rotation, and object expiration tasks. +type BatchAuditDetails struct { + JobID string `json:"jobID,omitempty"` + JobType string `json:"jobType,omitempty"` + User string `json:"user,omitempty"` +} + +// Redact redacts sensitive fields in BatchAuditDetails +func (b *BatchAuditDetails) Redact() {} + +// Message returns a human-readable message for batch audit +func (b BatchAuditDetails) Message() string { + if b.JobType != "" && b.JobID != "" { + return "Batch job '" + b.JobType + "' (" + b.JobID + ")" + } + if b.JobID != "" { + return "Batch job " + b.JobID + } + return "Batch job operation" +} + +// Details returns specific parameter changes for batch audit +func (b BatchAuditDetails) Details() string { + var parts []string + if b.User != "" { + parts = append(parts, "user:"+b.User) + } + return strings.Join(parts, " ") +} + +// BucketQuotaAuditDetails captures bucket quota configuration changes. +// It tracks changes to bucket storage quotas including size limits and quota type (hard/FIFO). +type BucketQuotaAuditDetails struct { + BucketName string `json:"bucketName"` + QuotaSize uint64 `json:"quotaSize,omitempty"` + QuotaType string `json:"quotaType,omitempty"` +} + +// Redact redacts sensitive fields in BucketQuotaAuditDetails +func (q *BucketQuotaAuditDetails) Redact() {} + +// Message returns a human-readable message for bucket quota audit +func (q BucketQuotaAuditDetails) Message() string { + if q.BucketName != "" { + return "Bucket quota for '" + q.BucketName + "'" + } + return "Bucket quota modified" +} + +// Details returns specific parameter changes for bucket quota audit +func (q BucketQuotaAuditDetails) Details() string { + var parts []string + if q.QuotaSize > 0 { + parts = append(parts, fmt.Sprintf("size:%d", q.QuotaSize)) + } + if q.QuotaType != "" { + parts = append(parts, "type:"+q.QuotaType) + } + return strings.Join(parts, " ") +} + +// BucketQOSAuditDetails captures bucket QoS configuration changes. +// It tracks Quality of Service settings for buckets including rate limits, burst sizes, and priority rules for API operations. +type BucketQOSAuditDetails struct { + BucketName string `json:"bucketName"` + Enabled bool `json:"enabled"` + Rules []QOSRuleDetail `json:"rules,omitempty"` +} + +// QOSRuleDetail captures details of a single QoS rule. +// Each rule defines rate limiting for specific object prefixes or API operations with priority levels and burst capacities. +type QOSRuleDetail struct { + ID string `json:"id,omitempty"` + Label string `json:"label,omitempty"` + Priority int `json:"priority,omitempty"` + ObjectPrefix string `json:"objectPrefix,omitempty"` + API string `json:"api,omitempty"` + Rate int64 `json:"rate,omitempty"` + Burst int64 `json:"burst,omitempty"` + LimitType string `json:"limitType,omitempty"` +} + +// Redact redacts sensitive fields in BucketQOSAuditDetails +func (q *BucketQOSAuditDetails) Redact() {} + +// Message returns a human-readable message for bucket QoS audit +func (q BucketQOSAuditDetails) Message() string { + if q.BucketName != "" { + status := "disabled" + if q.Enabled { + status = "enabled" + } + return "Bucket QoS for '" + q.BucketName + "' " + status + } + return "Bucket QoS modified" +} + +// Details returns specific parameter changes for bucket QoS audit +func (q BucketQOSAuditDetails) Details() string { + if len(q.Rules) > 0 { + return fmt.Sprintf("rules:%d", len(q.Rules)) + } + return "" +} + +// BucketInventoryAuditDetails captures bucket inventory configuration changes. +// It tracks bucket inventory report settings including destination bucket, schedule, and inventory configuration IDs. +type BucketInventoryAuditDetails struct { + BucketName string `json:"bucketName"` + InventoryID string `json:"inventoryID,omitempty"` + DestinationBucket string `json:"destinationBucket,omitempty"` + Schedule string `json:"schedule,omitempty"` +} + +// Redact redacts sensitive fields in BucketInventoryAuditDetails +func (i *BucketInventoryAuditDetails) Redact() {} + +// Message returns a human-readable message for bucket inventory audit +func (i BucketInventoryAuditDetails) Message() string { + if i.BucketName != "" && i.InventoryID != "" { + return "Bucket inventory '" + i.InventoryID + "' for '" + i.BucketName + "'" + } + if i.BucketName != "" { + return "Bucket inventory for '" + i.BucketName + "'" + } + return "Bucket inventory modified" +} + +// Details returns specific parameter changes for bucket inventory audit +func (i BucketInventoryAuditDetails) Details() string { + var parts []string + if i.DestinationBucket != "" { + parts = append(parts, "dest:"+i.DestinationBucket) + } + if i.Schedule != "" { + parts = append(parts, "schedule:"+i.Schedule) + } + return strings.Join(parts, " ") +} + +// TierAuditDetails captures tier configuration changes. +// It tracks remote tier configurations for lifecycle transitions including S3, Azure, GCS, and MinIO tiers. +type TierAuditDetails struct { + TierName string `json:"tierName"` + TierType string `json:"tierType,omitempty"` } -// String returns a canonical string for Audit +// Redact redacts sensitive fields in TierAuditDetails +func (t *TierAuditDetails) Redact() {} + +// Message returns a human-readable message for tier audit +func (t TierAuditDetails) Message() string { + if t.TierName != "" && t.TierType != "" { + return "Tier '" + t.TierName + "' (" + t.TierType + ")" + } + if t.TierName != "" { + return "Tier '" + t.TierName + "'" + } + return "Tier configuration modified" +} + +// Details returns specific parameter changes for tier audit +func (t TierAuditDetails) Details() string { + return "" +} + +// String returns a simple string representation for Audit (required by eos LogEntry interface) func (a Audit) String() string { - values := []string{ - toString("version", a.Version), - toTime("time", a.Time), - toString("node", a.Node), - toString("apiName", a.APIName), - toString("bucket", a.Bucket), - toMap("tags", a.Tags), - toString("requestID", a.RequestID), - toInterfaceMap("requestClaims", a.ReqClaims), - toString("sourceHost", a.SourceHost), - toString("accessKey", a.AccessKey), - toString("parentUser", a.ParentUser), - } - values = filterAndSort(values) - return strings.Join(values, ",") + return fmt.Sprintf("audit: category=%s action=%s api=%s", a.Category, a.Action, a.APIName) +} + +// Message returns a short summary of the config mutation +func (c ConfigAuditDetails) Message() string { + if c.SubSystem == "" { + return "Configuration changed" + } + subsys := c.SubSystem + if len(subsys) > 0 { + subsys = strings.ToUpper(subsys[:1]) + subsys[1:] + } + if c.Target != "" { + return subsys + " target '" + c.Target + "' configuration changed" + } + return subsys + " configuration changed" +} + +// Details returns specific parameter changes for config audit +func (c ConfigAuditDetails) Details() string { + var parts []string + if c.Key != "" { + parts = append(parts, c.Key) + } + if c.OldValue != "" && c.NewValue != "" { + parts = append(parts, truncate(c.OldValue, 20)+" → "+truncate(c.NewValue, 20)) + } else if c.NewValue != "" { + parts = append(parts, "→ "+truncate(c.NewValue, 20)) + } + return strings.Join(parts, " ") +} + +// Message returns a short summary of the user mutation +func (u UserAuditDetails) Message() string { + if u.UserName == "" { + return "User modified" + } + userType := "" + if u.UserType != "" { + userType = " (" + u.UserType + ")" + } + if u.Field != "" { + return "User '" + u.UserName + "'" + userType + " " + u.Field + " changed" + } + if u.OldStatus != u.NewStatus && u.NewStatus != "" { + return "User '" + u.UserName + "'" + userType + " status changed to " + u.NewStatus + } + return "User '" + u.UserName + "'" + userType + " modified" +} + +// Details returns specific parameter changes for user audit +func (u UserAuditDetails) Details() string { + var parts []string + if u.OldValue != "" && u.NewValue != "" { + parts = append(parts, truncate(u.OldValue, 15)+" → "+truncate(u.NewValue, 15)) + } else if u.NewValue != "" { + parts = append(parts, "→ "+truncate(u.NewValue, 15)) + } + if u.OldStatus != "" && u.NewStatus != "" { + parts = append(parts, u.OldStatus+" → "+u.NewStatus) + } else if u.NewStatus != "" { + parts = append(parts, "→ "+u.NewStatus) + } + if len(u.Policies) > 0 { + parts = append(parts, "$"+strings.Join(u.Policies, ",")) + } + if len(u.Groups) > 0 { + parts = append(parts, "@"+strings.Join(u.Groups, ",")) + } + return strings.Join(parts, " ") +} + +// Message returns a short summary of the service account mutation +func (s ServiceAccountAuditDetails) Message() string { + if s.AccountName == "" { + return "Service account modified" + } + if s.ParentUser != "" { + return "Service account '" + s.AccountName + "' (parent: " + s.ParentUser + ") modified" + } + return "Service account '" + s.AccountName + "' modified" +} + +// Details returns specific parameter changes for service account audit +func (s ServiceAccountAuditDetails) Details() string { + var parts []string + if s.UpdatedStatus != "" { + parts = append(parts, "→ "+s.UpdatedStatus) + } + if s.UpdatedPolicy && len(s.Policies) > 0 { + parts = append(parts, "$"+strings.Join(s.Policies, ",")) + } + if s.UpdatedExpiry && !s.Expiration.IsZero() { + parts = append(parts, "⏱ "+s.Expiration.Format("2006-01-02")) + } + if s.UpdatedSecretKey { + parts = append(parts, "🔑") + } + return strings.Join(parts, " ") +} + +// Message returns a short summary of the policy mutation +func (p PolicyAuditDetails) Message() string { + if p.PolicyName == "" { + return "Policy modified" + } + if p.Operation != "" { + if p.User != "" { + return "Policy " + p.Operation + " for user '" + p.User + "'" + } + if p.Group != "" { + return "Policy " + p.Operation + " for group '" + p.Group + "'" + } + return "Policy '" + p.PolicyName + "' " + p.Operation + } + return "Policy '" + p.PolicyName + "' modified" +} + +// Details returns specific parameter changes for policy audit +func (p PolicyAuditDetails) Details() string { + var parts []string + if p.User != "" { + parts = append(parts, "@"+p.User) + } + if p.Group != "" { + parts = append(parts, "@@"+p.Group) + } + if len(p.PoliciesAttached) > 0 { + parts = append(parts, "+"+strings.Join(p.PoliciesAttached, ",")) + } + if len(p.PoliciesDetached) > 0 { + parts = append(parts, "-"+strings.Join(p.PoliciesDetached, ",")) + } + if p.OldPolicy != "" && p.NewPolicy != "" { + parts = append(parts, "{...} → {...}") + } else if p.NewPolicy != "" { + parts = append(parts, "→ {...}") + } + return strings.Join(parts, " ") +} + +// Message returns a short summary of the group mutation +func (g GroupAuditDetails) Message() string { + if g.GroupName == "" { + return "Group modified" + } + if len(g.MembersAdded) > 0 { + return "Group '" + g.GroupName + "' members added" + } + if len(g.MembersRemoved) > 0 { + return "Group '" + g.GroupName + "' members removed" + } + if g.OldStatus != g.NewStatus && g.NewStatus != "" { + return "Group '" + g.GroupName + "' status changed to " + g.NewStatus + } + return "Group '" + g.GroupName + "' modified" +} + +// Details returns specific parameter changes for group audit +func (g GroupAuditDetails) Details() string { + var parts []string + if len(g.MembersAdded) > 0 { + parts = append(parts, "+"+strings.Join(g.MembersAdded, ",")) + } + if len(g.MembersRemoved) > 0 { + parts = append(parts, "-"+strings.Join(g.MembersRemoved, ",")) + } + if g.OldStatus != "" && g.NewStatus != "" { + parts = append(parts, g.OldStatus+" → "+g.NewStatus) + } else if g.NewStatus != "" { + parts = append(parts, "→ "+g.NewStatus) + } + return strings.Join(parts, " ") +} + +// Message returns a short summary of the bucket config mutation +func (b BucketConfigAuditDetails) Message() string { + if b.BucketName == "" { + return "Bucket configuration changed" + } + if b.ConfigType != "" { + return "Bucket '" + b.BucketName + "' " + b.ConfigType + " configuration changed" + } + return "Bucket '" + b.BucketName + "' configuration changed" +} + +// Details returns specific parameter changes for bucket config audit +func (b BucketConfigAuditDetails) Details() string { + var parts []string + if b.TargetBucket != "" { + parts = append(parts, "→ "+b.TargetBucket) + } + if len(b.TagKeys) > 0 { + parts = append(parts, "#"+strings.Join(b.TagKeys, ",")) + } else if b.TagCount > 0 { + parts = append(parts, fmt.Sprintf("#%d", b.TagCount)) + } + if b.OldConfig != "" && b.NewConfig != "" { + parts = append(parts, truncate(b.OldConfig, 20)+" → "+truncate(b.NewConfig, 20)) + } else if b.NewConfig != "" { + parts = append(parts, "→ "+truncate(b.NewConfig, 20)) + } + return strings.Join(parts, " ") +} + +// Message returns a short summary of the service operation +func (s ServiceAuditDetails) Message() string { + prefix := "" + if s.Legacy { + prefix = "[legacy] " + } + if s.ServiceName != "" && s.Operation != "" { + return prefix + "Service '" + s.ServiceName + "' " + s.Operation + } + if s.Operation == "iam-import" && s.IAMImport != nil { + return prefix + "IAM import completed" + } + if s.Operation != "" { + return prefix + "Service " + s.Operation + } + return prefix + "Service operation performed" +} + +// Details returns specific parameter changes for service audit +func (s ServiceAuditDetails) Details() string { + var parts []string + if s.Legacy { + parts = append(parts, "⚠legacy") + } + if s.Status != "" { + parts = append(parts, s.Status) + } + if s.IAMImport != nil { + if s.IAMImport.UsersAdded > 0 { + parts = append(parts, fmt.Sprintf("@+%d", s.IAMImport.UsersAdded)) + } + if s.IAMImport.PoliciesAdded > 0 { + parts = append(parts, fmt.Sprintf("$+%d", s.IAMImport.PoliciesAdded)) + } + if s.IAMImport.GroupsAdded > 0 { + parts = append(parts, fmt.Sprintf("@@+%d", s.IAMImport.GroupsAdded)) + } + if s.IAMImport.SvcAcctsAdded > 0 { + parts = append(parts, fmt.Sprintf("svc+%d", s.IAMImport.SvcAcctsAdded)) + } + if s.IAMImport.UsersRemoved > 0 { + parts = append(parts, fmt.Sprintf("@-%d", s.IAMImport.UsersRemoved)) + } + if s.IAMImport.PoliciesRemoved > 0 { + parts = append(parts, fmt.Sprintf("$-%d", s.IAMImport.PoliciesRemoved)) + } + if s.IAMImport.GroupsRemoved > 0 { + parts = append(parts, fmt.Sprintf("@@-%d", s.IAMImport.GroupsRemoved)) + } + if s.IAMImport.SvcAcctsRemoved > 0 { + parts = append(parts, fmt.Sprintf("svc-%d", s.IAMImport.SvcAcctsRemoved)) + } + } + return strings.Join(parts, " ") +} + +// Message returns a short summary of the KMS operation +func (k KMSAuditDetails) Message() string { + if k.KeyID != "" && k.Operation != "" { + return "KMS key '" + k.KeyID + "' " + k.Operation + } + if k.Operation != "" { + return "KMS " + k.Operation + } + return "KMS operation performed" +} + +// Details returns specific parameter changes for KMS audit +func (k KMSAuditDetails) Details() string { + if k.KeyID != "" { + return truncate(k.KeyID, 30) + } + return "" +} + +// Message returns a short summary of the pool operation +func (p PoolAuditDetails) Message() string { + if p.Operation != "" { + return "Pool " + fmt.Sprintf("%d", p.PoolIndex) + " " + p.Operation + } + return "Pool " + fmt.Sprintf("%d", p.PoolIndex) + " modified" +} + +// Details returns specific parameter changes for pool audit +func (p PoolAuditDetails) Details() string { + if len(p.Endpoints) > 0 { + return fmt.Sprintf("⊙×%d", len(p.Endpoints)) + } + return "" +} + +// Message returns a short summary of the site replication operation +func (s SiteReplicationAuditDetails) Message() string { + if s.SiteName != "" && s.Operation != "" { + return "Site '" + s.SiteName + "' " + s.Operation + } + if s.Operation != "" { + return "Site replication " + s.Operation + } + return "Site replication operation performed" +} + +// Details returns specific parameter changes for site replication audit +func (s SiteReplicationAuditDetails) Details() string { + var parts []string + if s.Endpoint != "" { + parts = append(parts, truncate(s.Endpoint, 30)) + } + if len(s.Sites) > 0 { + parts = append(parts, fmt.Sprintf("⇄×%d", len(s.Sites))) + } + return strings.Join(parts, " ") +} + +// Message returns a short summary of the IDP configuration change +func (i IDPAuditDetails) Message() string { + if i.IDPName != "" && i.IDPType != "" { + return "IDP '" + i.IDPName + "' (" + i.IDPType + ") configuration changed" + } + if i.IDPName != "" { + return "IDP '" + i.IDPName + "' configuration changed" + } + return "IDP configuration changed" +} + +// Details returns specific parameter changes for IDP audit +func (i IDPAuditDetails) Details() string { + var parts []string + if i.ConfigKey != "" { + parts = append(parts, i.ConfigKey) + } + if i.OldValue != "" && i.NewValue != "" { + parts = append(parts, truncate(i.OldValue, 15)+" → "+truncate(i.NewValue, 15)) + } else if i.NewValue != "" { + parts = append(parts, "→ "+truncate(i.NewValue, 15)) + } + return strings.Join(parts, " ") +} + +// Message returns a short summary of the log recorder configuration change +func (r RecorderAuditDetails) Message() string { + if r.LogType != "" { + if r.OldEnabled != r.NewEnabled { + if r.NewEnabled { + return "Log recorder '" + r.LogType + "' enabled" + } + return "Log recorder '" + r.LogType + "' disabled" + } + return "Log recorder '" + r.LogType + "' configuration changed" + } + return "Log recorder configuration changed" +} + +// Details returns specific parameter changes for log recorder audit +func (r RecorderAuditDetails) Details() string { + var parts []string + if r.OldLimit != r.NewLimit && r.NewLimit != "" { + parts = append(parts, "↕"+r.NewLimit) + } + if r.OldFlushCount != r.NewFlushCount { + parts = append(parts, fmt.Sprintf("⊕%d", r.NewFlushCount)) + } + if r.OldFlushInterval != r.NewFlushInterval && r.NewFlushInterval != "" { + parts = append(parts, "⏲"+r.NewFlushInterval) + } + return strings.Join(parts, " ") +} + +// Message returns a short summary of the heal operation +func (h HealAuditDetails) Message() string { + if h.Bucket != "" && h.Prefix != "" { + return "Heal bucket '" + h.Bucket + "' prefix '" + h.Prefix + "'" + } + if h.Bucket != "" { + return "Heal bucket '" + h.Bucket + "'" + } + if h.Operation != "" { + return "Heal " + h.Operation + } + return "Heal operation performed" +} + +// Details returns specific parameter changes for heal audit +func (h HealAuditDetails) Details() string { + var parts []string + if h.Bucket != "" { + parts = append(parts, "♦"+h.Bucket) + } + if h.Prefix != "" { + parts = append(parts, truncate(h.Prefix, 30)) + } + return strings.Join(parts, " ") +} + +// truncate truncates a string to a maximum length, adding "..." if truncated +func truncate(s string, maxLen int) string { + if len(s) <= maxLen { + return s + } + if maxLen <= 3 { + return "..." + } + return s[:maxLen-3] + "..." } diff --git a/log/audit_gen.go b/log/audit_gen.go index 21d7be4c..8e0c17d2 100644 --- a/log/audit_gen.go +++ b/log/audit_gen.go @@ -3,6 +3,8 @@ package log import ( + "time" + "github.com/tinylib/msgp/msgp" ) @@ -16,7 +18,7 @@ func (z *Audit) DecodeMsg(dc *msgp.Reader) (err error) { err = msgp.WrapError(err) return } - var zb0001Mask uint16 /* 9 bits */ + var zb0001Mask uint16 /* 12 bits */ _ = zb0001Mask for zb0001 > 0 { zb0001-- @@ -52,27 +54,49 @@ func (z *Audit) DecodeMsg(dc *msgp.Reader) (err error) { return } zb0001Mask |= 0x2 + case "category": + { + var zb0002 string + zb0002, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Category") + return + } + z.Category = AuditCategory(zb0002) + } + zb0001Mask |= 0x4 + case "action": + { + var zb0003 string + zb0003, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Action") + return + } + z.Action = AuditAction(zb0003) + } + zb0001Mask |= 0x8 case "bucket": z.Bucket, err = dc.ReadString() if err != nil { err = msgp.WrapError(err, "Bucket") return } - zb0001Mask |= 0x4 + zb0001Mask |= 0x10 case "tags": - var zb0002 uint32 - zb0002, err = dc.ReadMapHeader() + var zb0004 uint32 + zb0004, err = dc.ReadMapHeader() if err != nil { err = msgp.WrapError(err, "Tags") return } if z.Tags == nil { - z.Tags = make(map[string]string, zb0002) + z.Tags = make(map[string]string, zb0004) } else if len(z.Tags) > 0 { clear(z.Tags) } - for zb0002 > 0 { - zb0002-- + for zb0004 > 0 { + zb0004-- var za0001 string za0001, err = dc.ReadString() if err != nil { @@ -87,28 +111,28 @@ func (z *Audit) DecodeMsg(dc *msgp.Reader) (err error) { } z.Tags[za0001] = za0002 } - zb0001Mask |= 0x8 + zb0001Mask |= 0x20 case "requestID": z.RequestID, err = dc.ReadString() if err != nil { err = msgp.WrapError(err, "RequestID") return } - zb0001Mask |= 0x10 + zb0001Mask |= 0x40 case "requestClaims": - var zb0003 uint32 - zb0003, err = dc.ReadMapHeader() + var zb0005 uint32 + zb0005, err = dc.ReadMapHeader() if err != nil { err = msgp.WrapError(err, "ReqClaims") return } if z.ReqClaims == nil { - z.ReqClaims = make(map[string]interface{}, zb0003) + z.ReqClaims = make(map[string]interface{}, zb0005) } else if len(z.ReqClaims) > 0 { clear(z.ReqClaims) } - for zb0003 > 0 { - zb0003-- + for zb0005 > 0 { + zb0005-- var za0003 string za0003, err = dc.ReadString() if err != nil { @@ -123,28 +147,47 @@ func (z *Audit) DecodeMsg(dc *msgp.Reader) (err error) { } z.ReqClaims[za0003] = za0004 } - zb0001Mask |= 0x20 + zb0001Mask |= 0x80 case "sourceHost": z.SourceHost, err = dc.ReadString() if err != nil { err = msgp.WrapError(err, "SourceHost") return } - zb0001Mask |= 0x40 + zb0001Mask |= 0x100 case "accessKey": z.AccessKey, err = dc.ReadString() if err != nil { err = msgp.WrapError(err, "AccessKey") return } - zb0001Mask |= 0x80 + zb0001Mask |= 0x200 case "parentUser": z.ParentUser, err = dc.ReadString() if err != nil { err = msgp.WrapError(err, "ParentUser") return } - zb0001Mask |= 0x100 + zb0001Mask |= 0x400 + case "details": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "Details") + return + } + z.Details = nil + } else { + if z.Details == nil { + z.Details = new(AuditDetails) + } + err = z.Details.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Details") + return + } + } + zb0001Mask |= 0x800 default: err = dc.Skip() if err != nil { @@ -154,7 +197,7 @@ func (z *Audit) DecodeMsg(dc *msgp.Reader) (err error) { } } // Clear omitted fields. - if zb0001Mask != 0x1ff { + if zb0001Mask != 0xfff { if (zb0001Mask & 0x1) == 0 { z.Node = "" } @@ -162,26 +205,35 @@ func (z *Audit) DecodeMsg(dc *msgp.Reader) (err error) { z.APIName = "" } if (zb0001Mask & 0x4) == 0 { - z.Bucket = "" + z.Category = "" } if (zb0001Mask & 0x8) == 0 { - z.Tags = nil + z.Action = "" } if (zb0001Mask & 0x10) == 0 { - z.RequestID = "" + z.Bucket = "" } if (zb0001Mask & 0x20) == 0 { - z.ReqClaims = nil + z.Tags = nil } if (zb0001Mask & 0x40) == 0 { - z.SourceHost = "" + z.RequestID = "" } if (zb0001Mask & 0x80) == 0 { - z.AccessKey = "" + z.ReqClaims = nil } if (zb0001Mask & 0x100) == 0 { + z.SourceHost = "" + } + if (zb0001Mask & 0x200) == 0 { + z.AccessKey = "" + } + if (zb0001Mask & 0x400) == 0 { z.ParentUser = "" } + if (zb0001Mask & 0x800) == 0 { + z.Details = nil + } } return } @@ -189,8 +241,8 @@ func (z *Audit) DecodeMsg(dc *msgp.Reader) (err error) { // EncodeMsg implements msgp.Encodable func (z *Audit) EncodeMsg(en *msgp.Writer) (err error) { // check for omitted fields - zb0001Len := uint32(11) - var zb0001Mask uint16 /* 11 bits */ + zb0001Len := uint32(14) + var zb0001Mask uint16 /* 14 bits */ _ = zb0001Mask if z.Node == "" { zb0001Len-- @@ -200,34 +252,46 @@ func (z *Audit) EncodeMsg(en *msgp.Writer) (err error) { zb0001Len-- zb0001Mask |= 0x8 } - if z.Bucket == "" { + if z.Category == "" { zb0001Len-- zb0001Mask |= 0x10 } - if z.Tags == nil { + if z.Action == "" { zb0001Len-- zb0001Mask |= 0x20 } - if z.RequestID == "" { + if z.Bucket == "" { zb0001Len-- zb0001Mask |= 0x40 } - if z.ReqClaims == nil { + if z.Tags == nil { zb0001Len-- zb0001Mask |= 0x80 } - if z.SourceHost == "" { + if z.RequestID == "" { zb0001Len-- zb0001Mask |= 0x100 } - if z.AccessKey == "" { + if z.ReqClaims == nil { zb0001Len-- zb0001Mask |= 0x200 } - if z.ParentUser == "" { + if z.SourceHost == "" { zb0001Len-- zb0001Mask |= 0x400 } + if z.AccessKey == "" { + zb0001Len-- + zb0001Mask |= 0x800 + } + if z.ParentUser == "" { + zb0001Len-- + zb0001Mask |= 0x1000 + } + if z.Details == nil { + zb0001Len-- + zb0001Mask |= 0x2000 + } // variable map header, size zb0001Len err = en.Append(0x80 | uint8(zb0001Len)) if err != nil { @@ -281,6 +345,30 @@ func (z *Audit) EncodeMsg(en *msgp.Writer) (err error) { } } if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "category" + err = en.Append(0xa8, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79) + if err != nil { + return + } + err = en.WriteString(string(z.Category)) + if err != nil { + err = msgp.WrapError(err, "Category") + return + } + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // write "action" + err = en.Append(0xa6, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e) + if err != nil { + return + } + err = en.WriteString(string(z.Action)) + if err != nil { + err = msgp.WrapError(err, "Action") + return + } + } + if (zb0001Mask & 0x40) == 0 { // if not omitted // write "bucket" err = en.Append(0xa6, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74) if err != nil { @@ -292,7 +380,7 @@ func (z *Audit) EncodeMsg(en *msgp.Writer) (err error) { return } } - if (zb0001Mask & 0x20) == 0 { // if not omitted + if (zb0001Mask & 0x80) == 0 { // if not omitted // write "tags" err = en.Append(0xa4, 0x74, 0x61, 0x67, 0x73) if err != nil { @@ -316,7 +404,7 @@ func (z *Audit) EncodeMsg(en *msgp.Writer) (err error) { } } } - if (zb0001Mask & 0x40) == 0 { // if not omitted + if (zb0001Mask & 0x100) == 0 { // if not omitted // write "requestID" err = en.Append(0xa9, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x44) if err != nil { @@ -328,7 +416,7 @@ func (z *Audit) EncodeMsg(en *msgp.Writer) (err error) { return } } - if (zb0001Mask & 0x80) == 0 { // if not omitted + if (zb0001Mask & 0x200) == 0 { // if not omitted // write "requestClaims" err = en.Append(0xad, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x73) if err != nil { @@ -352,7 +440,7 @@ func (z *Audit) EncodeMsg(en *msgp.Writer) (err error) { } } } - if (zb0001Mask & 0x100) == 0 { // if not omitted + if (zb0001Mask & 0x400) == 0 { // if not omitted // write "sourceHost" err = en.Append(0xaa, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x6f, 0x73, 0x74) if err != nil { @@ -364,7 +452,7 @@ func (z *Audit) EncodeMsg(en *msgp.Writer) (err error) { return } } - if (zb0001Mask & 0x200) == 0 { // if not omitted + if (zb0001Mask & 0x800) == 0 { // if not omitted // write "accessKey" err = en.Append(0xa9, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79) if err != nil { @@ -376,7 +464,7 @@ func (z *Audit) EncodeMsg(en *msgp.Writer) (err error) { return } } - if (zb0001Mask & 0x400) == 0 { // if not omitted + if (zb0001Mask & 0x1000) == 0 { // if not omitted // write "parentUser" err = en.Append(0xaa, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72) if err != nil { @@ -388,6 +476,25 @@ func (z *Audit) EncodeMsg(en *msgp.Writer) (err error) { return } } + if (zb0001Mask & 0x2000) == 0 { // if not omitted + // write "details" + err = en.Append(0xa7, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73) + if err != nil { + return + } + if z.Details == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.Details.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Details") + return + } + } + } } return } @@ -396,8 +503,8 @@ func (z *Audit) EncodeMsg(en *msgp.Writer) (err error) { func (z *Audit) MarshalMsg(b []byte) (o []byte, err error) { o = msgp.Require(b, z.Msgsize()) // check for omitted fields - zb0001Len := uint32(11) - var zb0001Mask uint16 /* 11 bits */ + zb0001Len := uint32(14) + var zb0001Mask uint16 /* 14 bits */ _ = zb0001Mask if z.Node == "" { zb0001Len-- @@ -407,34 +514,46 @@ func (z *Audit) MarshalMsg(b []byte) (o []byte, err error) { zb0001Len-- zb0001Mask |= 0x8 } - if z.Bucket == "" { + if z.Category == "" { zb0001Len-- zb0001Mask |= 0x10 } - if z.Tags == nil { + if z.Action == "" { zb0001Len-- zb0001Mask |= 0x20 } - if z.RequestID == "" { + if z.Bucket == "" { zb0001Len-- zb0001Mask |= 0x40 } - if z.ReqClaims == nil { + if z.Tags == nil { zb0001Len-- zb0001Mask |= 0x80 } - if z.SourceHost == "" { + if z.RequestID == "" { zb0001Len-- zb0001Mask |= 0x100 } - if z.AccessKey == "" { + if z.ReqClaims == nil { zb0001Len-- zb0001Mask |= 0x200 } - if z.ParentUser == "" { + if z.SourceHost == "" { zb0001Len-- zb0001Mask |= 0x400 } + if z.AccessKey == "" { + zb0001Len-- + zb0001Mask |= 0x800 + } + if z.ParentUser == "" { + zb0001Len-- + zb0001Mask |= 0x1000 + } + if z.Details == nil { + zb0001Len-- + zb0001Mask |= 0x2000 + } // variable map header, size zb0001Len o = append(o, 0x80|uint8(zb0001Len)) @@ -457,11 +576,21 @@ func (z *Audit) MarshalMsg(b []byte) (o []byte, err error) { o = msgp.AppendString(o, z.APIName) } if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "category" + o = append(o, 0xa8, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79) + o = msgp.AppendString(o, string(z.Category)) + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // string "action" + o = append(o, 0xa6, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e) + o = msgp.AppendString(o, string(z.Action)) + } + if (zb0001Mask & 0x40) == 0 { // if not omitted // string "bucket" o = append(o, 0xa6, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74) o = msgp.AppendString(o, z.Bucket) } - if (zb0001Mask & 0x20) == 0 { // if not omitted + if (zb0001Mask & 0x80) == 0 { // if not omitted // string "tags" o = append(o, 0xa4, 0x74, 0x61, 0x67, 0x73) o = msgp.AppendMapHeader(o, uint32(len(z.Tags))) @@ -470,12 +599,12 @@ func (z *Audit) MarshalMsg(b []byte) (o []byte, err error) { o = msgp.AppendString(o, za0002) } } - if (zb0001Mask & 0x40) == 0 { // if not omitted + if (zb0001Mask & 0x100) == 0 { // if not omitted // string "requestID" o = append(o, 0xa9, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x44) o = msgp.AppendString(o, z.RequestID) } - if (zb0001Mask & 0x80) == 0 { // if not omitted + if (zb0001Mask & 0x200) == 0 { // if not omitted // string "requestClaims" o = append(o, 0xad, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x73) o = msgp.AppendMapHeader(o, uint32(len(z.ReqClaims))) @@ -488,21 +617,34 @@ func (z *Audit) MarshalMsg(b []byte) (o []byte, err error) { } } } - if (zb0001Mask & 0x100) == 0 { // if not omitted + if (zb0001Mask & 0x400) == 0 { // if not omitted // string "sourceHost" o = append(o, 0xaa, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x6f, 0x73, 0x74) o = msgp.AppendString(o, z.SourceHost) } - if (zb0001Mask & 0x200) == 0 { // if not omitted + if (zb0001Mask & 0x800) == 0 { // if not omitted // string "accessKey" o = append(o, 0xa9, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79) o = msgp.AppendString(o, z.AccessKey) } - if (zb0001Mask & 0x400) == 0 { // if not omitted + if (zb0001Mask & 0x1000) == 0 { // if not omitted // string "parentUser" o = append(o, 0xaa, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72) o = msgp.AppendString(o, z.ParentUser) } + if (zb0001Mask & 0x2000) == 0 { // if not omitted + // string "details" + o = append(o, 0xa7, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73) + if z.Details == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.Details.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Details") + return + } + } + } } return } @@ -517,7 +659,7 @@ func (z *Audit) UnmarshalMsg(bts []byte) (o []byte, err error) { err = msgp.WrapError(err) return } - var zb0001Mask uint16 /* 9 bits */ + var zb0001Mask uint16 /* 12 bits */ _ = zb0001Mask for zb0001 > 0 { zb0001-- @@ -553,28 +695,50 @@ func (z *Audit) UnmarshalMsg(bts []byte) (o []byte, err error) { return } zb0001Mask |= 0x2 + case "category": + { + var zb0002 string + zb0002, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Category") + return + } + z.Category = AuditCategory(zb0002) + } + zb0001Mask |= 0x4 + case "action": + { + var zb0003 string + zb0003, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Action") + return + } + z.Action = AuditAction(zb0003) + } + zb0001Mask |= 0x8 case "bucket": z.Bucket, bts, err = msgp.ReadStringBytes(bts) if err != nil { err = msgp.WrapError(err, "Bucket") return } - zb0001Mask |= 0x4 + zb0001Mask |= 0x10 case "tags": - var zb0002 uint32 - zb0002, bts, err = msgp.ReadMapHeaderBytes(bts) + var zb0004 uint32 + zb0004, bts, err = msgp.ReadMapHeaderBytes(bts) if err != nil { err = msgp.WrapError(err, "Tags") return } if z.Tags == nil { - z.Tags = make(map[string]string, zb0002) + z.Tags = make(map[string]string, zb0004) } else if len(z.Tags) > 0 { clear(z.Tags) } - for zb0002 > 0 { + for zb0004 > 0 { var za0002 string - zb0002-- + zb0004-- var za0001 string za0001, bts, err = msgp.ReadStringBytes(bts) if err != nil { @@ -588,29 +752,29 @@ func (z *Audit) UnmarshalMsg(bts []byte) (o []byte, err error) { } z.Tags[za0001] = za0002 } - zb0001Mask |= 0x8 + zb0001Mask |= 0x20 case "requestID": z.RequestID, bts, err = msgp.ReadStringBytes(bts) if err != nil { err = msgp.WrapError(err, "RequestID") return } - zb0001Mask |= 0x10 + zb0001Mask |= 0x40 case "requestClaims": - var zb0003 uint32 - zb0003, bts, err = msgp.ReadMapHeaderBytes(bts) + var zb0005 uint32 + zb0005, bts, err = msgp.ReadMapHeaderBytes(bts) if err != nil { err = msgp.WrapError(err, "ReqClaims") return } if z.ReqClaims == nil { - z.ReqClaims = make(map[string]interface{}, zb0003) + z.ReqClaims = make(map[string]interface{}, zb0005) } else if len(z.ReqClaims) > 0 { clear(z.ReqClaims) } - for zb0003 > 0 { + for zb0005 > 0 { var za0004 interface{} - zb0003-- + zb0005-- var za0003 string za0003, bts, err = msgp.ReadStringBytes(bts) if err != nil { @@ -624,28 +788,46 @@ func (z *Audit) UnmarshalMsg(bts []byte) (o []byte, err error) { } z.ReqClaims[za0003] = za0004 } - zb0001Mask |= 0x20 + zb0001Mask |= 0x80 case "sourceHost": z.SourceHost, bts, err = msgp.ReadStringBytes(bts) if err != nil { err = msgp.WrapError(err, "SourceHost") return } - zb0001Mask |= 0x40 + zb0001Mask |= 0x100 case "accessKey": z.AccessKey, bts, err = msgp.ReadStringBytes(bts) if err != nil { err = msgp.WrapError(err, "AccessKey") return } - zb0001Mask |= 0x80 + zb0001Mask |= 0x200 case "parentUser": z.ParentUser, bts, err = msgp.ReadStringBytes(bts) if err != nil { err = msgp.WrapError(err, "ParentUser") return } - zb0001Mask |= 0x100 + zb0001Mask |= 0x400 + case "details": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.Details = nil + } else { + if z.Details == nil { + z.Details = new(AuditDetails) + } + bts, err = z.Details.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Details") + return + } + } + zb0001Mask |= 0x800 default: bts, err = msgp.Skip(bts) if err != nil { @@ -655,7 +837,7 @@ func (z *Audit) UnmarshalMsg(bts []byte) (o []byte, err error) { } } // Clear omitted fields. - if zb0001Mask != 0x1ff { + if zb0001Mask != 0xfff { if (zb0001Mask & 0x1) == 0 { z.Node = "" } @@ -663,26 +845,35 @@ func (z *Audit) UnmarshalMsg(bts []byte) (o []byte, err error) { z.APIName = "" } if (zb0001Mask & 0x4) == 0 { - z.Bucket = "" + z.Category = "" } if (zb0001Mask & 0x8) == 0 { - z.Tags = nil + z.Action = "" } if (zb0001Mask & 0x10) == 0 { - z.RequestID = "" + z.Bucket = "" } if (zb0001Mask & 0x20) == 0 { - z.ReqClaims = nil + z.Tags = nil } if (zb0001Mask & 0x40) == 0 { - z.SourceHost = "" + z.RequestID = "" } if (zb0001Mask & 0x80) == 0 { - z.AccessKey = "" + z.ReqClaims = nil } if (zb0001Mask & 0x100) == 0 { + z.SourceHost = "" + } + if (zb0001Mask & 0x200) == 0 { + z.AccessKey = "" + } + if (zb0001Mask & 0x400) == 0 { z.ParentUser = "" } + if (zb0001Mask & 0x800) == 0 { + z.Details = nil + } } o = bts return @@ -690,7 +881,7 @@ func (z *Audit) UnmarshalMsg(bts []byte) (o []byte, err error) { // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message func (z *Audit) Msgsize() (s int) { - s = 1 + 8 + msgp.StringPrefixSize + len(z.Version) + 5 + msgp.TimeSize + 5 + msgp.StringPrefixSize + len(z.Node) + 8 + msgp.StringPrefixSize + len(z.APIName) + 7 + msgp.StringPrefixSize + len(z.Bucket) + 5 + msgp.MapHeaderSize + s = 1 + 8 + msgp.StringPrefixSize + len(z.Version) + 5 + msgp.TimeSize + 5 + msgp.StringPrefixSize + len(z.Node) + 8 + msgp.StringPrefixSize + len(z.APIName) + 9 + msgp.StringPrefixSize + len(string(z.Category)) + 7 + msgp.StringPrefixSize + len(string(z.Action)) + 7 + msgp.StringPrefixSize + len(z.Bucket) + 5 + msgp.MapHeaderSize if z.Tags != nil { for za0001, za0002 := range z.Tags { _ = za0002 @@ -704,6 +895,10197 @@ func (z *Audit) Msgsize() (s int) { s += msgp.StringPrefixSize + len(za0003) + msgp.GuessSize(za0004) } } - s += 11 + msgp.StringPrefixSize + len(z.SourceHost) + 10 + msgp.StringPrefixSize + len(z.AccessKey) + 11 + msgp.StringPrefixSize + len(z.ParentUser) + s += 11 + msgp.StringPrefixSize + len(z.SourceHost) + 10 + msgp.StringPrefixSize + len(z.AccessKey) + 11 + msgp.StringPrefixSize + len(z.ParentUser) + 8 + if z.Details == nil { + s += msgp.NilSize + } else { + s += z.Details.Msgsize() + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *AuditAction) DecodeMsg(dc *msgp.Reader) (err error) { + { + var zb0001 string + zb0001, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err) + return + } + (*z) = AuditAction(zb0001) + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z AuditAction) EncodeMsg(en *msgp.Writer) (err error) { + err = en.WriteString(string(z)) + if err != nil { + err = msgp.WrapError(err) + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z AuditAction) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + o = msgp.AppendString(o, string(z)) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *AuditAction) UnmarshalMsg(bts []byte) (o []byte, err error) { + { + var zb0001 string + zb0001, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + (*z) = AuditAction(zb0001) + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z AuditAction) Msgsize() (s int) { + s = msgp.StringPrefixSize + len(string(z)) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *AuditCategory) DecodeMsg(dc *msgp.Reader) (err error) { + { + var zb0001 string + zb0001, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err) + return + } + (*z) = AuditCategory(zb0001) + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z AuditCategory) EncodeMsg(en *msgp.Writer) (err error) { + err = en.WriteString(string(z)) + if err != nil { + err = msgp.WrapError(err) + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z AuditCategory) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + o = msgp.AppendString(o, string(z)) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *AuditCategory) UnmarshalMsg(bts []byte) (o []byte, err error) { + { + var zb0001 string + zb0001, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + (*z) = AuditCategory(zb0001) + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z AuditCategory) Msgsize() (s int) { + s = msgp.StringPrefixSize + len(string(z)) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *AuditDetails) DecodeMsg(dc *msgp.Reader) (err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint32 /* 18 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "config": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "Config") + return + } + z.Config = nil + } else { + if z.Config == nil { + z.Config = new(ConfigAuditDetails) + } + err = z.Config.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Config") + return + } + } + zb0001Mask |= 0x1 + case "user": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "User") + return + } + z.User = nil + } else { + if z.User == nil { + z.User = new(UserAuditDetails) + } + err = z.User.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "User") + return + } + } + zb0001Mask |= 0x2 + case "serviceAccount": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "ServiceAccount") + return + } + z.ServiceAccount = nil + } else { + if z.ServiceAccount == nil { + z.ServiceAccount = new(ServiceAccountAuditDetails) + } + err = z.ServiceAccount.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "ServiceAccount") + return + } + } + zb0001Mask |= 0x4 + case "policy": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "Policy") + return + } + z.Policy = nil + } else { + if z.Policy == nil { + z.Policy = new(PolicyAuditDetails) + } + err = z.Policy.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Policy") + return + } + } + zb0001Mask |= 0x8 + case "group": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "Group") + return + } + z.Group = nil + } else { + if z.Group == nil { + z.Group = new(GroupAuditDetails) + } + err = z.Group.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Group") + return + } + } + zb0001Mask |= 0x10 + case "bucketConfig": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "BucketConfig") + return + } + z.BucketConfig = nil + } else { + if z.BucketConfig == nil { + z.BucketConfig = new(BucketConfigAuditDetails) + } + err = z.BucketConfig.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "BucketConfig") + return + } + } + zb0001Mask |= 0x20 + case "bucketQuota": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "BucketQuota") + return + } + z.BucketQuota = nil + } else { + if z.BucketQuota == nil { + z.BucketQuota = new(BucketQuotaAuditDetails) + } + var zb0002 uint32 + zb0002, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "BucketQuota") + return + } + var zb0002Mask uint8 /* 2 bits */ + _ = zb0002Mask + for zb0002 > 0 { + zb0002-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "BucketQuota") + return + } + switch msgp.UnsafeString(field) { + case "bucketName": + z.BucketQuota.BucketName, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "BucketQuota", "BucketName") + return + } + case "quotaSize": + z.BucketQuota.QuotaSize, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "BucketQuota", "QuotaSize") + return + } + zb0002Mask |= 0x1 + case "quotaType": + z.BucketQuota.QuotaType, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "BucketQuota", "QuotaType") + return + } + zb0002Mask |= 0x2 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "BucketQuota") + return + } + } + } + // Clear omitted fields. + if zb0002Mask != 0x3 { + if (zb0002Mask & 0x1) == 0 { + z.BucketQuota.QuotaSize = 0 + } + if (zb0002Mask & 0x2) == 0 { + z.BucketQuota.QuotaType = "" + } + } + } + zb0001Mask |= 0x40 + case "bucketQOS": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "BucketQOS") + return + } + z.BucketQOS = nil + } else { + if z.BucketQOS == nil { + z.BucketQOS = new(BucketQOSAuditDetails) + } + err = z.BucketQOS.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "BucketQOS") + return + } + } + zb0001Mask |= 0x80 + case "bucketInventory": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "BucketInventory") + return + } + z.BucketInventory = nil + } else { + if z.BucketInventory == nil { + z.BucketInventory = new(BucketInventoryAuditDetails) + } + err = z.BucketInventory.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "BucketInventory") + return + } + } + zb0001Mask |= 0x100 + case "tier": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "Tier") + return + } + z.Tier = nil + } else { + if z.Tier == nil { + z.Tier = new(TierAuditDetails) + } + var zb0003 uint32 + zb0003, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "Tier") + return + } + var zb0003Mask uint8 /* 1 bits */ + _ = zb0003Mask + for zb0003 > 0 { + zb0003-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "Tier") + return + } + switch msgp.UnsafeString(field) { + case "tierName": + z.Tier.TierName, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Tier", "TierName") + return + } + case "tierType": + z.Tier.TierType, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Tier", "TierType") + return + } + zb0003Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "Tier") + return + } + } + } + // Clear omitted fields. + if (zb0003Mask & 0x1) == 0 { + z.Tier.TierType = "" + } + + } + zb0001Mask |= 0x200 + case "service": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "Service") + return + } + z.Service = nil + } else { + if z.Service == nil { + z.Service = new(ServiceAuditDetails) + } + err = z.Service.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Service") + return + } + } + zb0001Mask |= 0x400 + case "kms": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "KMS") + return + } + z.KMS = nil + } else { + if z.KMS == nil { + z.KMS = new(KMSAuditDetails) + } + var zb0004 uint32 + zb0004, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "KMS") + return + } + var zb0004Mask uint8 /* 2 bits */ + _ = zb0004Mask + for zb0004 > 0 { + zb0004-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "KMS") + return + } + switch msgp.UnsafeString(field) { + case "keyId": + z.KMS.KeyID, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "KMS", "KeyID") + return + } + zb0004Mask |= 0x1 + case "operation": + z.KMS.Operation, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "KMS", "Operation") + return + } + zb0004Mask |= 0x2 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "KMS") + return + } + } + } + // Clear omitted fields. + if zb0004Mask != 0x3 { + if (zb0004Mask & 0x1) == 0 { + z.KMS.KeyID = "" + } + if (zb0004Mask & 0x2) == 0 { + z.KMS.Operation = "" + } + } + } + zb0001Mask |= 0x800 + case "pool": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "Pool") + return + } + z.Pool = nil + } else { + if z.Pool == nil { + z.Pool = new(PoolAuditDetails) + } + err = z.Pool.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Pool") + return + } + } + zb0001Mask |= 0x1000 + case "siteRepl": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "SiteRepl") + return + } + z.SiteRepl = nil + } else { + if z.SiteRepl == nil { + z.SiteRepl = new(SiteReplicationAuditDetails) + } + err = z.SiteRepl.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "SiteRepl") + return + } + } + zb0001Mask |= 0x2000 + case "idp": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "IDP") + return + } + z.IDP = nil + } else { + if z.IDP == nil { + z.IDP = new(IDPAuditDetails) + } + err = z.IDP.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "IDP") + return + } + } + zb0001Mask |= 0x4000 + case "recorder": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "Recorder") + return + } + z.Recorder = nil + } else { + if z.Recorder == nil { + z.Recorder = new(RecorderAuditDetails) + } + err = z.Recorder.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Recorder") + return + } + } + zb0001Mask |= 0x8000 + case "heal": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "Heal") + return + } + z.Heal = nil + } else { + if z.Heal == nil { + z.Heal = new(HealAuditDetails) + } + var zb0005 uint32 + zb0005, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "Heal") + return + } + var zb0005Mask uint8 /* 3 bits */ + _ = zb0005Mask + for zb0005 > 0 { + zb0005-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "Heal") + return + } + switch msgp.UnsafeString(field) { + case "operation": + z.Heal.Operation, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Heal", "Operation") + return + } + zb0005Mask |= 0x1 + case "bucket": + z.Heal.Bucket, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Heal", "Bucket") + return + } + zb0005Mask |= 0x2 + case "prefix": + z.Heal.Prefix, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Heal", "Prefix") + return + } + zb0005Mask |= 0x4 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "Heal") + return + } + } + } + // Clear omitted fields. + if zb0005Mask != 0x7 { + if (zb0005Mask & 0x1) == 0 { + z.Heal.Operation = "" + } + if (zb0005Mask & 0x2) == 0 { + z.Heal.Bucket = "" + } + if (zb0005Mask & 0x4) == 0 { + z.Heal.Prefix = "" + } + } + } + zb0001Mask |= 0x10000 + case "batch": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "Batch") + return + } + z.Batch = nil + } else { + if z.Batch == nil { + z.Batch = new(BatchAuditDetails) + } + var zb0006 uint32 + zb0006, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "Batch") + return + } + var zb0006Mask uint8 /* 3 bits */ + _ = zb0006Mask + for zb0006 > 0 { + zb0006-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "Batch") + return + } + switch msgp.UnsafeString(field) { + case "jobID": + z.Batch.JobID, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Batch", "JobID") + return + } + zb0006Mask |= 0x1 + case "jobType": + z.Batch.JobType, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Batch", "JobType") + return + } + zb0006Mask |= 0x2 + case "user": + z.Batch.User, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Batch", "User") + return + } + zb0006Mask |= 0x4 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "Batch") + return + } + } + } + // Clear omitted fields. + if zb0006Mask != 0x7 { + if (zb0006Mask & 0x1) == 0 { + z.Batch.JobID = "" + } + if (zb0006Mask & 0x2) == 0 { + z.Batch.JobType = "" + } + if (zb0006Mask & 0x4) == 0 { + z.Batch.User = "" + } + } + } + zb0001Mask |= 0x20000 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x3ffff { + if (zb0001Mask & 0x1) == 0 { + z.Config = nil + } + if (zb0001Mask & 0x2) == 0 { + z.User = nil + } + if (zb0001Mask & 0x4) == 0 { + z.ServiceAccount = nil + } + if (zb0001Mask & 0x8) == 0 { + z.Policy = nil + } + if (zb0001Mask & 0x10) == 0 { + z.Group = nil + } + if (zb0001Mask & 0x20) == 0 { + z.BucketConfig = nil + } + if (zb0001Mask & 0x40) == 0 { + z.BucketQuota = nil + } + if (zb0001Mask & 0x80) == 0 { + z.BucketQOS = nil + } + if (zb0001Mask & 0x100) == 0 { + z.BucketInventory = nil + } + if (zb0001Mask & 0x200) == 0 { + z.Tier = nil + } + if (zb0001Mask & 0x400) == 0 { + z.Service = nil + } + if (zb0001Mask & 0x800) == 0 { + z.KMS = nil + } + if (zb0001Mask & 0x1000) == 0 { + z.Pool = nil + } + if (zb0001Mask & 0x2000) == 0 { + z.SiteRepl = nil + } + if (zb0001Mask & 0x4000) == 0 { + z.IDP = nil + } + if (zb0001Mask & 0x8000) == 0 { + z.Recorder = nil + } + if (zb0001Mask & 0x10000) == 0 { + z.Heal = nil + } + if (zb0001Mask & 0x20000) == 0 { + z.Batch = nil + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *AuditDetails) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(18) + var zb0001Mask uint32 /* 18 bits */ + _ = zb0001Mask + if z.Config == nil { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.User == nil { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.ServiceAccount == nil { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Policy == nil { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.Group == nil { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.BucketConfig == nil { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.BucketQuota == nil { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.BucketQOS == nil { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.BucketInventory == nil { + zb0001Len-- + zb0001Mask |= 0x100 + } + if z.Tier == nil { + zb0001Len-- + zb0001Mask |= 0x200 + } + if z.Service == nil { + zb0001Len-- + zb0001Mask |= 0x400 + } + if z.KMS == nil { + zb0001Len-- + zb0001Mask |= 0x800 + } + if z.Pool == nil { + zb0001Len-- + zb0001Mask |= 0x1000 + } + if z.SiteRepl == nil { + zb0001Len-- + zb0001Mask |= 0x2000 + } + if z.IDP == nil { + zb0001Len-- + zb0001Mask |= 0x4000 + } + if z.Recorder == nil { + zb0001Len-- + zb0001Mask |= 0x8000 + } + if z.Heal == nil { + zb0001Len-- + zb0001Mask |= 0x10000 + } + if z.Batch == nil { + zb0001Len-- + zb0001Mask |= 0x20000 + } + // variable map header, size zb0001Len + err = en.WriteMapHeader(zb0001Len) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "config" + err = en.Append(0xa6, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67) + if err != nil { + return + } + if z.Config == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.Config.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Config") + return + } + } + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "user" + err = en.Append(0xa4, 0x75, 0x73, 0x65, 0x72) + if err != nil { + return + } + if z.User == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.User.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "User") + return + } + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "serviceAccount" + err = en.Append(0xae, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + if z.ServiceAccount == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.ServiceAccount.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "ServiceAccount") + return + } + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "policy" + err = en.Append(0xa6, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79) + if err != nil { + return + } + if z.Policy == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.Policy.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Policy") + return + } + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "group" + err = en.Append(0xa5, 0x67, 0x72, 0x6f, 0x75, 0x70) + if err != nil { + return + } + if z.Group == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.Group.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Group") + return + } + } + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // write "bucketConfig" + err = en.Append(0xac, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67) + if err != nil { + return + } + if z.BucketConfig == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.BucketConfig.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "BucketConfig") + return + } + } + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // write "bucketQuota" + err = en.Append(0xab, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x51, 0x75, 0x6f, 0x74, 0x61) + if err != nil { + return + } + if z.BucketQuota == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + // check for omitted fields + zb0002Len := uint32(3) + var zb0002Mask uint8 /* 3 bits */ + _ = zb0002Mask + if z.BucketQuota.QuotaSize == 0 { + zb0002Len-- + zb0002Mask |= 0x2 + } + if z.BucketQuota.QuotaType == "" { + zb0002Len-- + zb0002Mask |= 0x4 + } + // variable map header, size zb0002Len + err = en.Append(0x80 | uint8(zb0002Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0002Len != 0 { + // write "bucketName" + err = en.Append(0xaa, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteString(z.BucketQuota.BucketName) + if err != nil { + err = msgp.WrapError(err, "BucketQuota", "BucketName") + return + } + if (zb0002Mask & 0x2) == 0 { // if not omitted + // write "quotaSize" + err = en.Append(0xa9, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x53, 0x69, 0x7a, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.BucketQuota.QuotaSize) + if err != nil { + err = msgp.WrapError(err, "BucketQuota", "QuotaSize") + return + } + } + if (zb0002Mask & 0x4) == 0 { // if not omitted + // write "quotaType" + err = en.Append(0xa9, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65) + if err != nil { + return + } + err = en.WriteString(z.BucketQuota.QuotaType) + if err != nil { + err = msgp.WrapError(err, "BucketQuota", "QuotaType") + return + } + } + } + } + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // write "bucketQOS" + err = en.Append(0xa9, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x51, 0x4f, 0x53) + if err != nil { + return + } + if z.BucketQOS == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.BucketQOS.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "BucketQOS") + return + } + } + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // write "bucketInventory" + err = en.Append(0xaf, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79) + if err != nil { + return + } + if z.BucketInventory == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.BucketInventory.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "BucketInventory") + return + } + } + } + if (zb0001Mask & 0x200) == 0 { // if not omitted + // write "tier" + err = en.Append(0xa4, 0x74, 0x69, 0x65, 0x72) + if err != nil { + return + } + if z.Tier == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + // check for omitted fields + zb0003Len := uint32(2) + var zb0003Mask uint8 /* 2 bits */ + _ = zb0003Mask + if z.Tier.TierType == "" { + zb0003Len-- + zb0003Mask |= 0x2 + } + // variable map header, size zb0003Len + err = en.Append(0x80 | uint8(zb0003Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0003Len != 0 { + // write "tierName" + err = en.Append(0xa8, 0x74, 0x69, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteString(z.Tier.TierName) + if err != nil { + err = msgp.WrapError(err, "Tier", "TierName") + return + } + if (zb0003Mask & 0x2) == 0 { // if not omitted + // write "tierType" + err = en.Append(0xa8, 0x74, 0x69, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65) + if err != nil { + return + } + err = en.WriteString(z.Tier.TierType) + if err != nil { + err = msgp.WrapError(err, "Tier", "TierType") + return + } + } + } + } + } + if (zb0001Mask & 0x400) == 0 { // if not omitted + // write "service" + err = en.Append(0xa7, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65) + if err != nil { + return + } + if z.Service == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.Service.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Service") + return + } + } + } + if (zb0001Mask & 0x800) == 0 { // if not omitted + // write "kms" + err = en.Append(0xa3, 0x6b, 0x6d, 0x73) + if err != nil { + return + } + if z.KMS == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + // check for omitted fields + zb0004Len := uint32(2) + var zb0004Mask uint8 /* 2 bits */ + _ = zb0004Mask + if z.KMS.KeyID == "" { + zb0004Len-- + zb0004Mask |= 0x1 + } + if z.KMS.Operation == "" { + zb0004Len-- + zb0004Mask |= 0x2 + } + // variable map header, size zb0004Len + err = en.Append(0x80 | uint8(zb0004Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0004Len != 0 { + if (zb0004Mask & 0x1) == 0 { // if not omitted + // write "keyId" + err = en.Append(0xa5, 0x6b, 0x65, 0x79, 0x49, 0x64) + if err != nil { + return + } + err = en.WriteString(z.KMS.KeyID) + if err != nil { + err = msgp.WrapError(err, "KMS", "KeyID") + return + } + } + if (zb0004Mask & 0x2) == 0 { // if not omitted + // write "operation" + err = en.Append(0xa9, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) + if err != nil { + return + } + err = en.WriteString(z.KMS.Operation) + if err != nil { + err = msgp.WrapError(err, "KMS", "Operation") + return + } + } + } + } + } + if (zb0001Mask & 0x1000) == 0 { // if not omitted + // write "pool" + err = en.Append(0xa4, 0x70, 0x6f, 0x6f, 0x6c) + if err != nil { + return + } + if z.Pool == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.Pool.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Pool") + return + } + } + } + if (zb0001Mask & 0x2000) == 0 { // if not omitted + // write "siteRepl" + err = en.Append(0xa8, 0x73, 0x69, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6c) + if err != nil { + return + } + if z.SiteRepl == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.SiteRepl.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "SiteRepl") + return + } + } + } + if (zb0001Mask & 0x4000) == 0 { // if not omitted + // write "idp" + err = en.Append(0xa3, 0x69, 0x64, 0x70) + if err != nil { + return + } + if z.IDP == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.IDP.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "IDP") + return + } + } + } + if (zb0001Mask & 0x8000) == 0 { // if not omitted + // write "recorder" + err = en.Append(0xa8, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x65, 0x72) + if err != nil { + return + } + if z.Recorder == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.Recorder.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Recorder") + return + } + } + } + if (zb0001Mask & 0x10000) == 0 { // if not omitted + // write "heal" + err = en.Append(0xa4, 0x68, 0x65, 0x61, 0x6c) + if err != nil { + return + } + if z.Heal == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + // check for omitted fields + zb0005Len := uint32(3) + var zb0005Mask uint8 /* 3 bits */ + _ = zb0005Mask + if z.Heal.Operation == "" { + zb0005Len-- + zb0005Mask |= 0x1 + } + if z.Heal.Bucket == "" { + zb0005Len-- + zb0005Mask |= 0x2 + } + if z.Heal.Prefix == "" { + zb0005Len-- + zb0005Mask |= 0x4 + } + // variable map header, size zb0005Len + err = en.Append(0x80 | uint8(zb0005Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0005Len != 0 { + if (zb0005Mask & 0x1) == 0 { // if not omitted + // write "operation" + err = en.Append(0xa9, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) + if err != nil { + return + } + err = en.WriteString(z.Heal.Operation) + if err != nil { + err = msgp.WrapError(err, "Heal", "Operation") + return + } + } + if (zb0005Mask & 0x2) == 0 { // if not omitted + // write "bucket" + err = en.Append(0xa6, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Heal.Bucket) + if err != nil { + err = msgp.WrapError(err, "Heal", "Bucket") + return + } + } + if (zb0005Mask & 0x4) == 0 { // if not omitted + // write "prefix" + err = en.Append(0xa6, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78) + if err != nil { + return + } + err = en.WriteString(z.Heal.Prefix) + if err != nil { + err = msgp.WrapError(err, "Heal", "Prefix") + return + } + } + } + } + } + if (zb0001Mask & 0x20000) == 0 { // if not omitted + // write "batch" + err = en.Append(0xa5, 0x62, 0x61, 0x74, 0x63, 0x68) + if err != nil { + return + } + if z.Batch == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + // check for omitted fields + zb0006Len := uint32(3) + var zb0006Mask uint8 /* 3 bits */ + _ = zb0006Mask + if z.Batch.JobID == "" { + zb0006Len-- + zb0006Mask |= 0x1 + } + if z.Batch.JobType == "" { + zb0006Len-- + zb0006Mask |= 0x2 + } + if z.Batch.User == "" { + zb0006Len-- + zb0006Mask |= 0x4 + } + // variable map header, size zb0006Len + err = en.Append(0x80 | uint8(zb0006Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0006Len != 0 { + if (zb0006Mask & 0x1) == 0 { // if not omitted + // write "jobID" + err = en.Append(0xa5, 0x6a, 0x6f, 0x62, 0x49, 0x44) + if err != nil { + return + } + err = en.WriteString(z.Batch.JobID) + if err != nil { + err = msgp.WrapError(err, "Batch", "JobID") + return + } + } + if (zb0006Mask & 0x2) == 0 { // if not omitted + // write "jobType" + err = en.Append(0xa7, 0x6a, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65) + if err != nil { + return + } + err = en.WriteString(z.Batch.JobType) + if err != nil { + err = msgp.WrapError(err, "Batch", "JobType") + return + } + } + if (zb0006Mask & 0x4) == 0 { // if not omitted + // write "user" + err = en.Append(0xa4, 0x75, 0x73, 0x65, 0x72) + if err != nil { + return + } + err = en.WriteString(z.Batch.User) + if err != nil { + err = msgp.WrapError(err, "Batch", "User") + return + } + } + } + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *AuditDetails) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(18) + var zb0001Mask uint32 /* 18 bits */ + _ = zb0001Mask + if z.Config == nil { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.User == nil { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.ServiceAccount == nil { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Policy == nil { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.Group == nil { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.BucketConfig == nil { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.BucketQuota == nil { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.BucketQOS == nil { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.BucketInventory == nil { + zb0001Len-- + zb0001Mask |= 0x100 + } + if z.Tier == nil { + zb0001Len-- + zb0001Mask |= 0x200 + } + if z.Service == nil { + zb0001Len-- + zb0001Mask |= 0x400 + } + if z.KMS == nil { + zb0001Len-- + zb0001Mask |= 0x800 + } + if z.Pool == nil { + zb0001Len-- + zb0001Mask |= 0x1000 + } + if z.SiteRepl == nil { + zb0001Len-- + zb0001Mask |= 0x2000 + } + if z.IDP == nil { + zb0001Len-- + zb0001Mask |= 0x4000 + } + if z.Recorder == nil { + zb0001Len-- + zb0001Mask |= 0x8000 + } + if z.Heal == nil { + zb0001Len-- + zb0001Mask |= 0x10000 + } + if z.Batch == nil { + zb0001Len-- + zb0001Mask |= 0x20000 + } + // variable map header, size zb0001Len + o = msgp.AppendMapHeader(o, zb0001Len) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "config" + o = append(o, 0xa6, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67) + if z.Config == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.Config.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Config") + return + } + } + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "user" + o = append(o, 0xa4, 0x75, 0x73, 0x65, 0x72) + if z.User == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.User.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "User") + return + } + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "serviceAccount" + o = append(o, 0xae, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74) + if z.ServiceAccount == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.ServiceAccount.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "ServiceAccount") + return + } + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "policy" + o = append(o, 0xa6, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79) + if z.Policy == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.Policy.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Policy") + return + } + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "group" + o = append(o, 0xa5, 0x67, 0x72, 0x6f, 0x75, 0x70) + if z.Group == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.Group.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Group") + return + } + } + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // string "bucketConfig" + o = append(o, 0xac, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67) + if z.BucketConfig == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.BucketConfig.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "BucketConfig") + return + } + } + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // string "bucketQuota" + o = append(o, 0xab, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x51, 0x75, 0x6f, 0x74, 0x61) + if z.BucketQuota == nil { + o = msgp.AppendNil(o) + } else { + // check for omitted fields + zb0002Len := uint32(3) + var zb0002Mask uint8 /* 3 bits */ + _ = zb0002Mask + if z.BucketQuota.QuotaSize == 0 { + zb0002Len-- + zb0002Mask |= 0x2 + } + if z.BucketQuota.QuotaType == "" { + zb0002Len-- + zb0002Mask |= 0x4 + } + // variable map header, size zb0002Len + o = append(o, 0x80|uint8(zb0002Len)) + + // skip if no fields are to be emitted + if zb0002Len != 0 { + // string "bucketName" + o = append(o, 0xaa, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65) + o = msgp.AppendString(o, z.BucketQuota.BucketName) + if (zb0002Mask & 0x2) == 0 { // if not omitted + // string "quotaSize" + o = append(o, 0xa9, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x53, 0x69, 0x7a, 0x65) + o = msgp.AppendUint64(o, z.BucketQuota.QuotaSize) + } + if (zb0002Mask & 0x4) == 0 { // if not omitted + // string "quotaType" + o = append(o, 0xa9, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65) + o = msgp.AppendString(o, z.BucketQuota.QuotaType) + } + } + } + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // string "bucketQOS" + o = append(o, 0xa9, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x51, 0x4f, 0x53) + if z.BucketQOS == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.BucketQOS.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "BucketQOS") + return + } + } + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // string "bucketInventory" + o = append(o, 0xaf, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79) + if z.BucketInventory == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.BucketInventory.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "BucketInventory") + return + } + } + } + if (zb0001Mask & 0x200) == 0 { // if not omitted + // string "tier" + o = append(o, 0xa4, 0x74, 0x69, 0x65, 0x72) + if z.Tier == nil { + o = msgp.AppendNil(o) + } else { + // check for omitted fields + zb0003Len := uint32(2) + var zb0003Mask uint8 /* 2 bits */ + _ = zb0003Mask + if z.Tier.TierType == "" { + zb0003Len-- + zb0003Mask |= 0x2 + } + // variable map header, size zb0003Len + o = append(o, 0x80|uint8(zb0003Len)) + + // skip if no fields are to be emitted + if zb0003Len != 0 { + // string "tierName" + o = append(o, 0xa8, 0x74, 0x69, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65) + o = msgp.AppendString(o, z.Tier.TierName) + if (zb0003Mask & 0x2) == 0 { // if not omitted + // string "tierType" + o = append(o, 0xa8, 0x74, 0x69, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65) + o = msgp.AppendString(o, z.Tier.TierType) + } + } + } + } + if (zb0001Mask & 0x400) == 0 { // if not omitted + // string "service" + o = append(o, 0xa7, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65) + if z.Service == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.Service.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Service") + return + } + } + } + if (zb0001Mask & 0x800) == 0 { // if not omitted + // string "kms" + o = append(o, 0xa3, 0x6b, 0x6d, 0x73) + if z.KMS == nil { + o = msgp.AppendNil(o) + } else { + // check for omitted fields + zb0004Len := uint32(2) + var zb0004Mask uint8 /* 2 bits */ + _ = zb0004Mask + if z.KMS.KeyID == "" { + zb0004Len-- + zb0004Mask |= 0x1 + } + if z.KMS.Operation == "" { + zb0004Len-- + zb0004Mask |= 0x2 + } + // variable map header, size zb0004Len + o = append(o, 0x80|uint8(zb0004Len)) + + // skip if no fields are to be emitted + if zb0004Len != 0 { + if (zb0004Mask & 0x1) == 0 { // if not omitted + // string "keyId" + o = append(o, 0xa5, 0x6b, 0x65, 0x79, 0x49, 0x64) + o = msgp.AppendString(o, z.KMS.KeyID) + } + if (zb0004Mask & 0x2) == 0 { // if not omitted + // string "operation" + o = append(o, 0xa9, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) + o = msgp.AppendString(o, z.KMS.Operation) + } + } + } + } + if (zb0001Mask & 0x1000) == 0 { // if not omitted + // string "pool" + o = append(o, 0xa4, 0x70, 0x6f, 0x6f, 0x6c) + if z.Pool == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.Pool.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Pool") + return + } + } + } + if (zb0001Mask & 0x2000) == 0 { // if not omitted + // string "siteRepl" + o = append(o, 0xa8, 0x73, 0x69, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6c) + if z.SiteRepl == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.SiteRepl.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "SiteRepl") + return + } + } + } + if (zb0001Mask & 0x4000) == 0 { // if not omitted + // string "idp" + o = append(o, 0xa3, 0x69, 0x64, 0x70) + if z.IDP == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.IDP.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "IDP") + return + } + } + } + if (zb0001Mask & 0x8000) == 0 { // if not omitted + // string "recorder" + o = append(o, 0xa8, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x65, 0x72) + if z.Recorder == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.Recorder.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Recorder") + return + } + } + } + if (zb0001Mask & 0x10000) == 0 { // if not omitted + // string "heal" + o = append(o, 0xa4, 0x68, 0x65, 0x61, 0x6c) + if z.Heal == nil { + o = msgp.AppendNil(o) + } else { + // check for omitted fields + zb0005Len := uint32(3) + var zb0005Mask uint8 /* 3 bits */ + _ = zb0005Mask + if z.Heal.Operation == "" { + zb0005Len-- + zb0005Mask |= 0x1 + } + if z.Heal.Bucket == "" { + zb0005Len-- + zb0005Mask |= 0x2 + } + if z.Heal.Prefix == "" { + zb0005Len-- + zb0005Mask |= 0x4 + } + // variable map header, size zb0005Len + o = append(o, 0x80|uint8(zb0005Len)) + + // skip if no fields are to be emitted + if zb0005Len != 0 { + if (zb0005Mask & 0x1) == 0 { // if not omitted + // string "operation" + o = append(o, 0xa9, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) + o = msgp.AppendString(o, z.Heal.Operation) + } + if (zb0005Mask & 0x2) == 0 { // if not omitted + // string "bucket" + o = append(o, 0xa6, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74) + o = msgp.AppendString(o, z.Heal.Bucket) + } + if (zb0005Mask & 0x4) == 0 { // if not omitted + // string "prefix" + o = append(o, 0xa6, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78) + o = msgp.AppendString(o, z.Heal.Prefix) + } + } + } + } + if (zb0001Mask & 0x20000) == 0 { // if not omitted + // string "batch" + o = append(o, 0xa5, 0x62, 0x61, 0x74, 0x63, 0x68) + if z.Batch == nil { + o = msgp.AppendNil(o) + } else { + // check for omitted fields + zb0006Len := uint32(3) + var zb0006Mask uint8 /* 3 bits */ + _ = zb0006Mask + if z.Batch.JobID == "" { + zb0006Len-- + zb0006Mask |= 0x1 + } + if z.Batch.JobType == "" { + zb0006Len-- + zb0006Mask |= 0x2 + } + if z.Batch.User == "" { + zb0006Len-- + zb0006Mask |= 0x4 + } + // variable map header, size zb0006Len + o = append(o, 0x80|uint8(zb0006Len)) + + // skip if no fields are to be emitted + if zb0006Len != 0 { + if (zb0006Mask & 0x1) == 0 { // if not omitted + // string "jobID" + o = append(o, 0xa5, 0x6a, 0x6f, 0x62, 0x49, 0x44) + o = msgp.AppendString(o, z.Batch.JobID) + } + if (zb0006Mask & 0x2) == 0 { // if not omitted + // string "jobType" + o = append(o, 0xa7, 0x6a, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65) + o = msgp.AppendString(o, z.Batch.JobType) + } + if (zb0006Mask & 0x4) == 0 { // if not omitted + // string "user" + o = append(o, 0xa4, 0x75, 0x73, 0x65, 0x72) + o = msgp.AppendString(o, z.Batch.User) + } + } + } + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *AuditDetails) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint32 /* 18 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "config": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.Config = nil + } else { + if z.Config == nil { + z.Config = new(ConfigAuditDetails) + } + bts, err = z.Config.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Config") + return + } + } + zb0001Mask |= 0x1 + case "user": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.User = nil + } else { + if z.User == nil { + z.User = new(UserAuditDetails) + } + bts, err = z.User.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "User") + return + } + } + zb0001Mask |= 0x2 + case "serviceAccount": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.ServiceAccount = nil + } else { + if z.ServiceAccount == nil { + z.ServiceAccount = new(ServiceAccountAuditDetails) + } + bts, err = z.ServiceAccount.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "ServiceAccount") + return + } + } + zb0001Mask |= 0x4 + case "policy": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.Policy = nil + } else { + if z.Policy == nil { + z.Policy = new(PolicyAuditDetails) + } + bts, err = z.Policy.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Policy") + return + } + } + zb0001Mask |= 0x8 + case "group": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.Group = nil + } else { + if z.Group == nil { + z.Group = new(GroupAuditDetails) + } + bts, err = z.Group.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Group") + return + } + } + zb0001Mask |= 0x10 + case "bucketConfig": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.BucketConfig = nil + } else { + if z.BucketConfig == nil { + z.BucketConfig = new(BucketConfigAuditDetails) + } + bts, err = z.BucketConfig.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "BucketConfig") + return + } + } + zb0001Mask |= 0x20 + case "bucketQuota": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.BucketQuota = nil + } else { + if z.BucketQuota == nil { + z.BucketQuota = new(BucketQuotaAuditDetails) + } + var zb0002 uint32 + zb0002, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "BucketQuota") + return + } + var zb0002Mask uint8 /* 2 bits */ + _ = zb0002Mask + for zb0002 > 0 { + zb0002-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "BucketQuota") + return + } + switch msgp.UnsafeString(field) { + case "bucketName": + z.BucketQuota.BucketName, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "BucketQuota", "BucketName") + return + } + case "quotaSize": + z.BucketQuota.QuotaSize, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "BucketQuota", "QuotaSize") + return + } + zb0002Mask |= 0x1 + case "quotaType": + z.BucketQuota.QuotaType, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "BucketQuota", "QuotaType") + return + } + zb0002Mask |= 0x2 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "BucketQuota") + return + } + } + } + // Clear omitted fields. + if zb0002Mask != 0x3 { + if (zb0002Mask & 0x1) == 0 { + z.BucketQuota.QuotaSize = 0 + } + if (zb0002Mask & 0x2) == 0 { + z.BucketQuota.QuotaType = "" + } + } + } + zb0001Mask |= 0x40 + case "bucketQOS": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.BucketQOS = nil + } else { + if z.BucketQOS == nil { + z.BucketQOS = new(BucketQOSAuditDetails) + } + bts, err = z.BucketQOS.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "BucketQOS") + return + } + } + zb0001Mask |= 0x80 + case "bucketInventory": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.BucketInventory = nil + } else { + if z.BucketInventory == nil { + z.BucketInventory = new(BucketInventoryAuditDetails) + } + bts, err = z.BucketInventory.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "BucketInventory") + return + } + } + zb0001Mask |= 0x100 + case "tier": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.Tier = nil + } else { + if z.Tier == nil { + z.Tier = new(TierAuditDetails) + } + var zb0003 uint32 + zb0003, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Tier") + return + } + var zb0003Mask uint8 /* 1 bits */ + _ = zb0003Mask + for zb0003 > 0 { + zb0003-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "Tier") + return + } + switch msgp.UnsafeString(field) { + case "tierName": + z.Tier.TierName, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Tier", "TierName") + return + } + case "tierType": + z.Tier.TierType, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Tier", "TierType") + return + } + zb0003Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "Tier") + return + } + } + } + // Clear omitted fields. + if (zb0003Mask & 0x1) == 0 { + z.Tier.TierType = "" + } + + } + zb0001Mask |= 0x200 + case "service": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.Service = nil + } else { + if z.Service == nil { + z.Service = new(ServiceAuditDetails) + } + bts, err = z.Service.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Service") + return + } + } + zb0001Mask |= 0x400 + case "kms": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.KMS = nil + } else { + if z.KMS == nil { + z.KMS = new(KMSAuditDetails) + } + var zb0004 uint32 + zb0004, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "KMS") + return + } + var zb0004Mask uint8 /* 2 bits */ + _ = zb0004Mask + for zb0004 > 0 { + zb0004-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "KMS") + return + } + switch msgp.UnsafeString(field) { + case "keyId": + z.KMS.KeyID, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "KMS", "KeyID") + return + } + zb0004Mask |= 0x1 + case "operation": + z.KMS.Operation, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "KMS", "Operation") + return + } + zb0004Mask |= 0x2 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "KMS") + return + } + } + } + // Clear omitted fields. + if zb0004Mask != 0x3 { + if (zb0004Mask & 0x1) == 0 { + z.KMS.KeyID = "" + } + if (zb0004Mask & 0x2) == 0 { + z.KMS.Operation = "" + } + } + } + zb0001Mask |= 0x800 + case "pool": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.Pool = nil + } else { + if z.Pool == nil { + z.Pool = new(PoolAuditDetails) + } + bts, err = z.Pool.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Pool") + return + } + } + zb0001Mask |= 0x1000 + case "siteRepl": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.SiteRepl = nil + } else { + if z.SiteRepl == nil { + z.SiteRepl = new(SiteReplicationAuditDetails) + } + bts, err = z.SiteRepl.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "SiteRepl") + return + } + } + zb0001Mask |= 0x2000 + case "idp": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.IDP = nil + } else { + if z.IDP == nil { + z.IDP = new(IDPAuditDetails) + } + bts, err = z.IDP.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "IDP") + return + } + } + zb0001Mask |= 0x4000 + case "recorder": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.Recorder = nil + } else { + if z.Recorder == nil { + z.Recorder = new(RecorderAuditDetails) + } + bts, err = z.Recorder.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Recorder") + return + } + } + zb0001Mask |= 0x8000 + case "heal": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.Heal = nil + } else { + if z.Heal == nil { + z.Heal = new(HealAuditDetails) + } + var zb0005 uint32 + zb0005, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Heal") + return + } + var zb0005Mask uint8 /* 3 bits */ + _ = zb0005Mask + for zb0005 > 0 { + zb0005-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "Heal") + return + } + switch msgp.UnsafeString(field) { + case "operation": + z.Heal.Operation, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Heal", "Operation") + return + } + zb0005Mask |= 0x1 + case "bucket": + z.Heal.Bucket, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Heal", "Bucket") + return + } + zb0005Mask |= 0x2 + case "prefix": + z.Heal.Prefix, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Heal", "Prefix") + return + } + zb0005Mask |= 0x4 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "Heal") + return + } + } + } + // Clear omitted fields. + if zb0005Mask != 0x7 { + if (zb0005Mask & 0x1) == 0 { + z.Heal.Operation = "" + } + if (zb0005Mask & 0x2) == 0 { + z.Heal.Bucket = "" + } + if (zb0005Mask & 0x4) == 0 { + z.Heal.Prefix = "" + } + } + } + zb0001Mask |= 0x10000 + case "batch": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.Batch = nil + } else { + if z.Batch == nil { + z.Batch = new(BatchAuditDetails) + } + var zb0006 uint32 + zb0006, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Batch") + return + } + var zb0006Mask uint8 /* 3 bits */ + _ = zb0006Mask + for zb0006 > 0 { + zb0006-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "Batch") + return + } + switch msgp.UnsafeString(field) { + case "jobID": + z.Batch.JobID, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Batch", "JobID") + return + } + zb0006Mask |= 0x1 + case "jobType": + z.Batch.JobType, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Batch", "JobType") + return + } + zb0006Mask |= 0x2 + case "user": + z.Batch.User, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Batch", "User") + return + } + zb0006Mask |= 0x4 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "Batch") + return + } + } + } + // Clear omitted fields. + if zb0006Mask != 0x7 { + if (zb0006Mask & 0x1) == 0 { + z.Batch.JobID = "" + } + if (zb0006Mask & 0x2) == 0 { + z.Batch.JobType = "" + } + if (zb0006Mask & 0x4) == 0 { + z.Batch.User = "" + } + } + } + zb0001Mask |= 0x20000 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x3ffff { + if (zb0001Mask & 0x1) == 0 { + z.Config = nil + } + if (zb0001Mask & 0x2) == 0 { + z.User = nil + } + if (zb0001Mask & 0x4) == 0 { + z.ServiceAccount = nil + } + if (zb0001Mask & 0x8) == 0 { + z.Policy = nil + } + if (zb0001Mask & 0x10) == 0 { + z.Group = nil + } + if (zb0001Mask & 0x20) == 0 { + z.BucketConfig = nil + } + if (zb0001Mask & 0x40) == 0 { + z.BucketQuota = nil + } + if (zb0001Mask & 0x80) == 0 { + z.BucketQOS = nil + } + if (zb0001Mask & 0x100) == 0 { + z.BucketInventory = nil + } + if (zb0001Mask & 0x200) == 0 { + z.Tier = nil + } + if (zb0001Mask & 0x400) == 0 { + z.Service = nil + } + if (zb0001Mask & 0x800) == 0 { + z.KMS = nil + } + if (zb0001Mask & 0x1000) == 0 { + z.Pool = nil + } + if (zb0001Mask & 0x2000) == 0 { + z.SiteRepl = nil + } + if (zb0001Mask & 0x4000) == 0 { + z.IDP = nil + } + if (zb0001Mask & 0x8000) == 0 { + z.Recorder = nil + } + if (zb0001Mask & 0x10000) == 0 { + z.Heal = nil + } + if (zb0001Mask & 0x20000) == 0 { + z.Batch = nil + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *AuditDetails) Msgsize() (s int) { + s = 3 + 7 + if z.Config == nil { + s += msgp.NilSize + } else { + s += z.Config.Msgsize() + } + s += 5 + if z.User == nil { + s += msgp.NilSize + } else { + s += z.User.Msgsize() + } + s += 15 + if z.ServiceAccount == nil { + s += msgp.NilSize + } else { + s += z.ServiceAccount.Msgsize() + } + s += 7 + if z.Policy == nil { + s += msgp.NilSize + } else { + s += z.Policy.Msgsize() + } + s += 6 + if z.Group == nil { + s += msgp.NilSize + } else { + s += z.Group.Msgsize() + } + s += 13 + if z.BucketConfig == nil { + s += msgp.NilSize + } else { + s += z.BucketConfig.Msgsize() + } + s += 12 + if z.BucketQuota == nil { + s += msgp.NilSize + } else { + s += 1 + 11 + msgp.StringPrefixSize + len(z.BucketQuota.BucketName) + 10 + msgp.Uint64Size + 10 + msgp.StringPrefixSize + len(z.BucketQuota.QuotaType) + } + s += 10 + if z.BucketQOS == nil { + s += msgp.NilSize + } else { + s += z.BucketQOS.Msgsize() + } + s += 16 + if z.BucketInventory == nil { + s += msgp.NilSize + } else { + s += z.BucketInventory.Msgsize() + } + s += 5 + if z.Tier == nil { + s += msgp.NilSize + } else { + s += 1 + 9 + msgp.StringPrefixSize + len(z.Tier.TierName) + 9 + msgp.StringPrefixSize + len(z.Tier.TierType) + } + s += 8 + if z.Service == nil { + s += msgp.NilSize + } else { + s += z.Service.Msgsize() + } + s += 4 + if z.KMS == nil { + s += msgp.NilSize + } else { + s += 1 + 6 + msgp.StringPrefixSize + len(z.KMS.KeyID) + 10 + msgp.StringPrefixSize + len(z.KMS.Operation) + } + s += 5 + if z.Pool == nil { + s += msgp.NilSize + } else { + s += z.Pool.Msgsize() + } + s += 9 + if z.SiteRepl == nil { + s += msgp.NilSize + } else { + s += z.SiteRepl.Msgsize() + } + s += 4 + if z.IDP == nil { + s += msgp.NilSize + } else { + s += z.IDP.Msgsize() + } + s += 9 + if z.Recorder == nil { + s += msgp.NilSize + } else { + s += z.Recorder.Msgsize() + } + s += 5 + if z.Heal == nil { + s += msgp.NilSize + } else { + s += 1 + 10 + msgp.StringPrefixSize + len(z.Heal.Operation) + 7 + msgp.StringPrefixSize + len(z.Heal.Bucket) + 7 + msgp.StringPrefixSize + len(z.Heal.Prefix) + } + s += 6 + if z.Batch == nil { + s += msgp.NilSize + } else { + s += 1 + 6 + msgp.StringPrefixSize + len(z.Batch.JobID) + 8 + msgp.StringPrefixSize + len(z.Batch.JobType) + 5 + msgp.StringPrefixSize + len(z.Batch.User) + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *BatchAuditDetails) DecodeMsg(dc *msgp.Reader) (err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "jobID": + z.JobID, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "JobID") + return + } + zb0001Mask |= 0x1 + case "jobType": + z.JobType, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "JobType") + return + } + zb0001Mask |= 0x2 + case "user": + z.User, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "User") + return + } + zb0001Mask |= 0x4 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x7 { + if (zb0001Mask & 0x1) == 0 { + z.JobID = "" + } + if (zb0001Mask & 0x2) == 0 { + z.JobType = "" + } + if (zb0001Mask & 0x4) == 0 { + z.User = "" + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z BatchAuditDetails) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(3) + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + if z.JobID == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.JobType == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.User == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "jobID" + err = en.Append(0xa5, 0x6a, 0x6f, 0x62, 0x49, 0x44) + if err != nil { + return + } + err = en.WriteString(z.JobID) + if err != nil { + err = msgp.WrapError(err, "JobID") + return + } + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "jobType" + err = en.Append(0xa7, 0x6a, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65) + if err != nil { + return + } + err = en.WriteString(z.JobType) + if err != nil { + err = msgp.WrapError(err, "JobType") + return + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "user" + err = en.Append(0xa4, 0x75, 0x73, 0x65, 0x72) + if err != nil { + return + } + err = en.WriteString(z.User) + if err != nil { + err = msgp.WrapError(err, "User") + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z BatchAuditDetails) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(3) + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + if z.JobID == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.JobType == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.User == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "jobID" + o = append(o, 0xa5, 0x6a, 0x6f, 0x62, 0x49, 0x44) + o = msgp.AppendString(o, z.JobID) + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "jobType" + o = append(o, 0xa7, 0x6a, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65) + o = msgp.AppendString(o, z.JobType) + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "user" + o = append(o, 0xa4, 0x75, 0x73, 0x65, 0x72) + o = msgp.AppendString(o, z.User) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *BatchAuditDetails) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "jobID": + z.JobID, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "JobID") + return + } + zb0001Mask |= 0x1 + case "jobType": + z.JobType, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "JobType") + return + } + zb0001Mask |= 0x2 + case "user": + z.User, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "User") + return + } + zb0001Mask |= 0x4 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x7 { + if (zb0001Mask & 0x1) == 0 { + z.JobID = "" + } + if (zb0001Mask & 0x2) == 0 { + z.JobType = "" + } + if (zb0001Mask & 0x4) == 0 { + z.User = "" + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z BatchAuditDetails) Msgsize() (s int) { + s = 1 + 6 + msgp.StringPrefixSize + len(z.JobID) + 8 + msgp.StringPrefixSize + len(z.JobType) + 5 + msgp.StringPrefixSize + len(z.User) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *BucketConfigAuditDetails) DecodeMsg(dc *msgp.Reader) (err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 6 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "bucketName": + z.BucketName, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "BucketName") + return + } + case "configType": + z.ConfigType, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ConfigType") + return + } + zb0001Mask |= 0x1 + case "oldConfig": + z.OldConfig, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "OldConfig") + return + } + zb0001Mask |= 0x2 + case "newConfig": + z.NewConfig, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "NewConfig") + return + } + zb0001Mask |= 0x4 + case "targetBucket": + z.TargetBucket, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "TargetBucket") + return + } + zb0001Mask |= 0x8 + case "tagKeys": + var zb0002 uint32 + zb0002, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "TagKeys") + return + } + if cap(z.TagKeys) >= int(zb0002) { + z.TagKeys = (z.TagKeys)[:zb0002] + } else { + z.TagKeys = make([]string, zb0002) + } + for za0001 := range z.TagKeys { + z.TagKeys[za0001], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "TagKeys", za0001) + return + } + } + zb0001Mask |= 0x10 + case "tagCount": + z.TagCount, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "TagCount") + return + } + zb0001Mask |= 0x20 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x3f { + if (zb0001Mask & 0x1) == 0 { + z.ConfigType = "" + } + if (zb0001Mask & 0x2) == 0 { + z.OldConfig = "" + } + if (zb0001Mask & 0x4) == 0 { + z.NewConfig = "" + } + if (zb0001Mask & 0x8) == 0 { + z.TargetBucket = "" + } + if (zb0001Mask & 0x10) == 0 { + z.TagKeys = nil + } + if (zb0001Mask & 0x20) == 0 { + z.TagCount = 0 + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *BucketConfigAuditDetails) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(7) + var zb0001Mask uint8 /* 7 bits */ + _ = zb0001Mask + if z.ConfigType == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.OldConfig == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.NewConfig == "" { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.TargetBucket == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.TagKeys == nil { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.TagCount == 0 { + zb0001Len-- + zb0001Mask |= 0x40 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // write "bucketName" + err = en.Append(0xaa, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteString(z.BucketName) + if err != nil { + err = msgp.WrapError(err, "BucketName") + return + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "configType" + err = en.Append(0xaa, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x54, 0x79, 0x70, 0x65) + if err != nil { + return + } + err = en.WriteString(z.ConfigType) + if err != nil { + err = msgp.WrapError(err, "ConfigType") + return + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "oldConfig" + err = en.Append(0xa9, 0x6f, 0x6c, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67) + if err != nil { + return + } + err = en.WriteString(z.OldConfig) + if err != nil { + err = msgp.WrapError(err, "OldConfig") + return + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "newConfig" + err = en.Append(0xa9, 0x6e, 0x65, 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67) + if err != nil { + return + } + err = en.WriteString(z.NewConfig) + if err != nil { + err = msgp.WrapError(err, "NewConfig") + return + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "targetBucket" + err = en.Append(0xac, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74) + if err != nil { + return + } + err = en.WriteString(z.TargetBucket) + if err != nil { + err = msgp.WrapError(err, "TargetBucket") + return + } + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // write "tagKeys" + err = en.Append(0xa7, 0x74, 0x61, 0x67, 0x4b, 0x65, 0x79, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.TagKeys))) + if err != nil { + err = msgp.WrapError(err, "TagKeys") + return + } + for za0001 := range z.TagKeys { + err = en.WriteString(z.TagKeys[za0001]) + if err != nil { + err = msgp.WrapError(err, "TagKeys", za0001) + return + } + } + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // write "tagCount" + err = en.Append(0xa8, 0x74, 0x61, 0x67, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteInt(z.TagCount) + if err != nil { + err = msgp.WrapError(err, "TagCount") + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *BucketConfigAuditDetails) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(7) + var zb0001Mask uint8 /* 7 bits */ + _ = zb0001Mask + if z.ConfigType == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.OldConfig == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.NewConfig == "" { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.TargetBucket == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.TagKeys == nil { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.TagCount == 0 { + zb0001Len-- + zb0001Mask |= 0x40 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // string "bucketName" + o = append(o, 0xaa, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65) + o = msgp.AppendString(o, z.BucketName) + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "configType" + o = append(o, 0xaa, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x54, 0x79, 0x70, 0x65) + o = msgp.AppendString(o, z.ConfigType) + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "oldConfig" + o = append(o, 0xa9, 0x6f, 0x6c, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67) + o = msgp.AppendString(o, z.OldConfig) + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "newConfig" + o = append(o, 0xa9, 0x6e, 0x65, 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67) + o = msgp.AppendString(o, z.NewConfig) + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "targetBucket" + o = append(o, 0xac, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74) + o = msgp.AppendString(o, z.TargetBucket) + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // string "tagKeys" + o = append(o, 0xa7, 0x74, 0x61, 0x67, 0x4b, 0x65, 0x79, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.TagKeys))) + for za0001 := range z.TagKeys { + o = msgp.AppendString(o, z.TagKeys[za0001]) + } + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // string "tagCount" + o = append(o, 0xa8, 0x74, 0x61, 0x67, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendInt(o, z.TagCount) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *BucketConfigAuditDetails) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 6 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "bucketName": + z.BucketName, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "BucketName") + return + } + case "configType": + z.ConfigType, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ConfigType") + return + } + zb0001Mask |= 0x1 + case "oldConfig": + z.OldConfig, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OldConfig") + return + } + zb0001Mask |= 0x2 + case "newConfig": + z.NewConfig, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "NewConfig") + return + } + zb0001Mask |= 0x4 + case "targetBucket": + z.TargetBucket, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "TargetBucket") + return + } + zb0001Mask |= 0x8 + case "tagKeys": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "TagKeys") + return + } + if cap(z.TagKeys) >= int(zb0002) { + z.TagKeys = (z.TagKeys)[:zb0002] + } else { + z.TagKeys = make([]string, zb0002) + } + for za0001 := range z.TagKeys { + z.TagKeys[za0001], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "TagKeys", za0001) + return + } + } + zb0001Mask |= 0x10 + case "tagCount": + z.TagCount, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "TagCount") + return + } + zb0001Mask |= 0x20 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x3f { + if (zb0001Mask & 0x1) == 0 { + z.ConfigType = "" + } + if (zb0001Mask & 0x2) == 0 { + z.OldConfig = "" + } + if (zb0001Mask & 0x4) == 0 { + z.NewConfig = "" + } + if (zb0001Mask & 0x8) == 0 { + z.TargetBucket = "" + } + if (zb0001Mask & 0x10) == 0 { + z.TagKeys = nil + } + if (zb0001Mask & 0x20) == 0 { + z.TagCount = 0 + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *BucketConfigAuditDetails) Msgsize() (s int) { + s = 1 + 11 + msgp.StringPrefixSize + len(z.BucketName) + 11 + msgp.StringPrefixSize + len(z.ConfigType) + 10 + msgp.StringPrefixSize + len(z.OldConfig) + 10 + msgp.StringPrefixSize + len(z.NewConfig) + 13 + msgp.StringPrefixSize + len(z.TargetBucket) + 8 + msgp.ArrayHeaderSize + for za0001 := range z.TagKeys { + s += msgp.StringPrefixSize + len(z.TagKeys[za0001]) + } + s += 9 + msgp.IntSize + return +} + +// DecodeMsg implements msgp.Decodable +func (z *BucketInventoryAuditDetails) DecodeMsg(dc *msgp.Reader) (err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "bucketName": + z.BucketName, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "BucketName") + return + } + case "inventoryID": + z.InventoryID, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "InventoryID") + return + } + zb0001Mask |= 0x1 + case "destinationBucket": + z.DestinationBucket, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "DestinationBucket") + return + } + zb0001Mask |= 0x2 + case "schedule": + z.Schedule, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Schedule") + return + } + zb0001Mask |= 0x4 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x7 { + if (zb0001Mask & 0x1) == 0 { + z.InventoryID = "" + } + if (zb0001Mask & 0x2) == 0 { + z.DestinationBucket = "" + } + if (zb0001Mask & 0x4) == 0 { + z.Schedule = "" + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *BucketInventoryAuditDetails) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(4) + var zb0001Mask uint8 /* 4 bits */ + _ = zb0001Mask + if z.InventoryID == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.DestinationBucket == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Schedule == "" { + zb0001Len-- + zb0001Mask |= 0x8 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // write "bucketName" + err = en.Append(0xaa, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteString(z.BucketName) + if err != nil { + err = msgp.WrapError(err, "BucketName") + return + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "inventoryID" + err = en.Append(0xab, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x44) + if err != nil { + return + } + err = en.WriteString(z.InventoryID) + if err != nil { + err = msgp.WrapError(err, "InventoryID") + return + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "destinationBucket" + err = en.Append(0xb1, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74) + if err != nil { + return + } + err = en.WriteString(z.DestinationBucket) + if err != nil { + err = msgp.WrapError(err, "DestinationBucket") + return + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "schedule" + err = en.Append(0xa8, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65) + if err != nil { + return + } + err = en.WriteString(z.Schedule) + if err != nil { + err = msgp.WrapError(err, "Schedule") + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *BucketInventoryAuditDetails) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(4) + var zb0001Mask uint8 /* 4 bits */ + _ = zb0001Mask + if z.InventoryID == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.DestinationBucket == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Schedule == "" { + zb0001Len-- + zb0001Mask |= 0x8 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // string "bucketName" + o = append(o, 0xaa, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65) + o = msgp.AppendString(o, z.BucketName) + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "inventoryID" + o = append(o, 0xab, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x44) + o = msgp.AppendString(o, z.InventoryID) + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "destinationBucket" + o = append(o, 0xb1, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74) + o = msgp.AppendString(o, z.DestinationBucket) + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "schedule" + o = append(o, 0xa8, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65) + o = msgp.AppendString(o, z.Schedule) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *BucketInventoryAuditDetails) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "bucketName": + z.BucketName, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "BucketName") + return + } + case "inventoryID": + z.InventoryID, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "InventoryID") + return + } + zb0001Mask |= 0x1 + case "destinationBucket": + z.DestinationBucket, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "DestinationBucket") + return + } + zb0001Mask |= 0x2 + case "schedule": + z.Schedule, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Schedule") + return + } + zb0001Mask |= 0x4 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x7 { + if (zb0001Mask & 0x1) == 0 { + z.InventoryID = "" + } + if (zb0001Mask & 0x2) == 0 { + z.DestinationBucket = "" + } + if (zb0001Mask & 0x4) == 0 { + z.Schedule = "" + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *BucketInventoryAuditDetails) Msgsize() (s int) { + s = 1 + 11 + msgp.StringPrefixSize + len(z.BucketName) + 12 + msgp.StringPrefixSize + len(z.InventoryID) + 18 + msgp.StringPrefixSize + len(z.DestinationBucket) + 9 + msgp.StringPrefixSize + len(z.Schedule) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *BucketQOSAuditDetails) DecodeMsg(dc *msgp.Reader) (err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 1 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "bucketName": + z.BucketName, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "BucketName") + return + } + case "enabled": + z.Enabled, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "Enabled") + return + } + case "rules": + var zb0002 uint32 + zb0002, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Rules") + return + } + if cap(z.Rules) >= int(zb0002) { + z.Rules = (z.Rules)[:zb0002] + } else { + z.Rules = make([]QOSRuleDetail, zb0002) + } + for za0001 := range z.Rules { + err = z.Rules[za0001].DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Rules", za0001) + return + } + } + zb0001Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if (zb0001Mask & 0x1) == 0 { + z.Rules = nil + } + + return +} + +// EncodeMsg implements msgp.Encodable +func (z *BucketQOSAuditDetails) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(3) + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + if z.Rules == nil { + zb0001Len-- + zb0001Mask |= 0x4 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // write "bucketName" + err = en.Append(0xaa, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteString(z.BucketName) + if err != nil { + err = msgp.WrapError(err, "BucketName") + return + } + // write "enabled" + err = en.Append(0xa7, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteBool(z.Enabled) + if err != nil { + err = msgp.WrapError(err, "Enabled") + return + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "rules" + err = en.Append(0xa5, 0x72, 0x75, 0x6c, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Rules))) + if err != nil { + err = msgp.WrapError(err, "Rules") + return + } + for za0001 := range z.Rules { + err = z.Rules[za0001].EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Rules", za0001) + return + } + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *BucketQOSAuditDetails) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(3) + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + if z.Rules == nil { + zb0001Len-- + zb0001Mask |= 0x4 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // string "bucketName" + o = append(o, 0xaa, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65) + o = msgp.AppendString(o, z.BucketName) + // string "enabled" + o = append(o, 0xa7, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64) + o = msgp.AppendBool(o, z.Enabled) + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "rules" + o = append(o, 0xa5, 0x72, 0x75, 0x6c, 0x65, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Rules))) + for za0001 := range z.Rules { + o, err = z.Rules[za0001].MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Rules", za0001) + return + } + } + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *BucketQOSAuditDetails) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 1 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "bucketName": + z.BucketName, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "BucketName") + return + } + case "enabled": + z.Enabled, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Enabled") + return + } + case "rules": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Rules") + return + } + if cap(z.Rules) >= int(zb0002) { + z.Rules = (z.Rules)[:zb0002] + } else { + z.Rules = make([]QOSRuleDetail, zb0002) + } + for za0001 := range z.Rules { + bts, err = z.Rules[za0001].UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Rules", za0001) + return + } + } + zb0001Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if (zb0001Mask & 0x1) == 0 { + z.Rules = nil + } + + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *BucketQOSAuditDetails) Msgsize() (s int) { + s = 1 + 11 + msgp.StringPrefixSize + len(z.BucketName) + 8 + msgp.BoolSize + 6 + msgp.ArrayHeaderSize + for za0001 := range z.Rules { + s += z.Rules[za0001].Msgsize() + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *BucketQuotaAuditDetails) DecodeMsg(dc *msgp.Reader) (err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 2 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "bucketName": + z.BucketName, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "BucketName") + return + } + case "quotaSize": + z.QuotaSize, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "QuotaSize") + return + } + zb0001Mask |= 0x1 + case "quotaType": + z.QuotaType, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "QuotaType") + return + } + zb0001Mask |= 0x2 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x3 { + if (zb0001Mask & 0x1) == 0 { + z.QuotaSize = 0 + } + if (zb0001Mask & 0x2) == 0 { + z.QuotaType = "" + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z BucketQuotaAuditDetails) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(3) + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + if z.QuotaSize == 0 { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.QuotaType == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // write "bucketName" + err = en.Append(0xaa, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteString(z.BucketName) + if err != nil { + err = msgp.WrapError(err, "BucketName") + return + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "quotaSize" + err = en.Append(0xa9, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x53, 0x69, 0x7a, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.QuotaSize) + if err != nil { + err = msgp.WrapError(err, "QuotaSize") + return + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "quotaType" + err = en.Append(0xa9, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65) + if err != nil { + return + } + err = en.WriteString(z.QuotaType) + if err != nil { + err = msgp.WrapError(err, "QuotaType") + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z BucketQuotaAuditDetails) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(3) + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + if z.QuotaSize == 0 { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.QuotaType == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // string "bucketName" + o = append(o, 0xaa, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65) + o = msgp.AppendString(o, z.BucketName) + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "quotaSize" + o = append(o, 0xa9, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x53, 0x69, 0x7a, 0x65) + o = msgp.AppendUint64(o, z.QuotaSize) + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "quotaType" + o = append(o, 0xa9, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65) + o = msgp.AppendString(o, z.QuotaType) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *BucketQuotaAuditDetails) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 2 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "bucketName": + z.BucketName, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "BucketName") + return + } + case "quotaSize": + z.QuotaSize, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "QuotaSize") + return + } + zb0001Mask |= 0x1 + case "quotaType": + z.QuotaType, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "QuotaType") + return + } + zb0001Mask |= 0x2 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x3 { + if (zb0001Mask & 0x1) == 0 { + z.QuotaSize = 0 + } + if (zb0001Mask & 0x2) == 0 { + z.QuotaType = "" + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z BucketQuotaAuditDetails) Msgsize() (s int) { + s = 1 + 11 + msgp.StringPrefixSize + len(z.BucketName) + 10 + msgp.Uint64Size + 10 + msgp.StringPrefixSize + len(z.QuotaType) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *ConfigAuditDetails) DecodeMsg(dc *msgp.Reader) (err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 5 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "subSystem": + z.SubSystem, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "SubSystem") + return + } + zb0001Mask |= 0x1 + case "target": + z.Target, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Target") + return + } + zb0001Mask |= 0x2 + case "key": + z.Key, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Key") + return + } + zb0001Mask |= 0x4 + case "oldValue": + z.OldValue, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "OldValue") + return + } + zb0001Mask |= 0x8 + case "newValue": + z.NewValue, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "NewValue") + return + } + zb0001Mask |= 0x10 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1f { + if (zb0001Mask & 0x1) == 0 { + z.SubSystem = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Target = "" + } + if (zb0001Mask & 0x4) == 0 { + z.Key = "" + } + if (zb0001Mask & 0x8) == 0 { + z.OldValue = "" + } + if (zb0001Mask & 0x10) == 0 { + z.NewValue = "" + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *ConfigAuditDetails) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(5) + var zb0001Mask uint8 /* 5 bits */ + _ = zb0001Mask + if z.SubSystem == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Target == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Key == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.OldValue == "" { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.NewValue == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "subSystem" + err = en.Append(0xa9, 0x73, 0x75, 0x62, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d) + if err != nil { + return + } + err = en.WriteString(z.SubSystem) + if err != nil { + err = msgp.WrapError(err, "SubSystem") + return + } + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "target" + err = en.Append(0xa6, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Target) + if err != nil { + err = msgp.WrapError(err, "Target") + return + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "key" + err = en.Append(0xa3, 0x6b, 0x65, 0x79) + if err != nil { + return + } + err = en.WriteString(z.Key) + if err != nil { + err = msgp.WrapError(err, "Key") + return + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "oldValue" + err = en.Append(0xa8, 0x6f, 0x6c, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65) + if err != nil { + return + } + err = en.WriteString(z.OldValue) + if err != nil { + err = msgp.WrapError(err, "OldValue") + return + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "newValue" + err = en.Append(0xa8, 0x6e, 0x65, 0x77, 0x56, 0x61, 0x6c, 0x75, 0x65) + if err != nil { + return + } + err = en.WriteString(z.NewValue) + if err != nil { + err = msgp.WrapError(err, "NewValue") + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *ConfigAuditDetails) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(5) + var zb0001Mask uint8 /* 5 bits */ + _ = zb0001Mask + if z.SubSystem == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Target == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Key == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.OldValue == "" { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.NewValue == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "subSystem" + o = append(o, 0xa9, 0x73, 0x75, 0x62, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d) + o = msgp.AppendString(o, z.SubSystem) + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "target" + o = append(o, 0xa6, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74) + o = msgp.AppendString(o, z.Target) + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "key" + o = append(o, 0xa3, 0x6b, 0x65, 0x79) + o = msgp.AppendString(o, z.Key) + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "oldValue" + o = append(o, 0xa8, 0x6f, 0x6c, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65) + o = msgp.AppendString(o, z.OldValue) + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "newValue" + o = append(o, 0xa8, 0x6e, 0x65, 0x77, 0x56, 0x61, 0x6c, 0x75, 0x65) + o = msgp.AppendString(o, z.NewValue) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *ConfigAuditDetails) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 5 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "subSystem": + z.SubSystem, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "SubSystem") + return + } + zb0001Mask |= 0x1 + case "target": + z.Target, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Target") + return + } + zb0001Mask |= 0x2 + case "key": + z.Key, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Key") + return + } + zb0001Mask |= 0x4 + case "oldValue": + z.OldValue, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OldValue") + return + } + zb0001Mask |= 0x8 + case "newValue": + z.NewValue, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "NewValue") + return + } + zb0001Mask |= 0x10 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1f { + if (zb0001Mask & 0x1) == 0 { + z.SubSystem = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Target = "" + } + if (zb0001Mask & 0x4) == 0 { + z.Key = "" + } + if (zb0001Mask & 0x8) == 0 { + z.OldValue = "" + } + if (zb0001Mask & 0x10) == 0 { + z.NewValue = "" + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *ConfigAuditDetails) Msgsize() (s int) { + s = 1 + 10 + msgp.StringPrefixSize + len(z.SubSystem) + 7 + msgp.StringPrefixSize + len(z.Target) + 4 + msgp.StringPrefixSize + len(z.Key) + 9 + msgp.StringPrefixSize + len(z.OldValue) + 9 + msgp.StringPrefixSize + len(z.NewValue) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *GroupAuditDetails) DecodeMsg(dc *msgp.Reader) (err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 4 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "groupName": + z.GroupName, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "GroupName") + return + } + case "membersAdded": + var zb0002 uint32 + zb0002, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "MembersAdded") + return + } + if cap(z.MembersAdded) >= int(zb0002) { + z.MembersAdded = (z.MembersAdded)[:zb0002] + } else { + z.MembersAdded = make([]string, zb0002) + } + for za0001 := range z.MembersAdded { + z.MembersAdded[za0001], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "MembersAdded", za0001) + return + } + } + zb0001Mask |= 0x1 + case "membersRemoved": + var zb0003 uint32 + zb0003, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "MembersRemoved") + return + } + if cap(z.MembersRemoved) >= int(zb0003) { + z.MembersRemoved = (z.MembersRemoved)[:zb0003] + } else { + z.MembersRemoved = make([]string, zb0003) + } + for za0002 := range z.MembersRemoved { + z.MembersRemoved[za0002], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "MembersRemoved", za0002) + return + } + } + zb0001Mask |= 0x2 + case "oldStatus": + z.OldStatus, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "OldStatus") + return + } + zb0001Mask |= 0x4 + case "newStatus": + z.NewStatus, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "NewStatus") + return + } + zb0001Mask |= 0x8 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0xf { + if (zb0001Mask & 0x1) == 0 { + z.MembersAdded = nil + } + if (zb0001Mask & 0x2) == 0 { + z.MembersRemoved = nil + } + if (zb0001Mask & 0x4) == 0 { + z.OldStatus = "" + } + if (zb0001Mask & 0x8) == 0 { + z.NewStatus = "" + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *GroupAuditDetails) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(5) + var zb0001Mask uint8 /* 5 bits */ + _ = zb0001Mask + if z.MembersAdded == nil { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.MembersRemoved == nil { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.OldStatus == "" { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.NewStatus == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // write "groupName" + err = en.Append(0xa9, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteString(z.GroupName) + if err != nil { + err = msgp.WrapError(err, "GroupName") + return + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "membersAdded" + err = en.Append(0xac, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x41, 0x64, 0x64, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.MembersAdded))) + if err != nil { + err = msgp.WrapError(err, "MembersAdded") + return + } + for za0001 := range z.MembersAdded { + err = en.WriteString(z.MembersAdded[za0001]) + if err != nil { + err = msgp.WrapError(err, "MembersAdded", za0001) + return + } + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "membersRemoved" + err = en.Append(0xae, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.MembersRemoved))) + if err != nil { + err = msgp.WrapError(err, "MembersRemoved") + return + } + for za0002 := range z.MembersRemoved { + err = en.WriteString(z.MembersRemoved[za0002]) + if err != nil { + err = msgp.WrapError(err, "MembersRemoved", za0002) + return + } + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "oldStatus" + err = en.Append(0xa9, 0x6f, 0x6c, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73) + if err != nil { + return + } + err = en.WriteString(z.OldStatus) + if err != nil { + err = msgp.WrapError(err, "OldStatus") + return + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "newStatus" + err = en.Append(0xa9, 0x6e, 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73) + if err != nil { + return + } + err = en.WriteString(z.NewStatus) + if err != nil { + err = msgp.WrapError(err, "NewStatus") + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *GroupAuditDetails) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(5) + var zb0001Mask uint8 /* 5 bits */ + _ = zb0001Mask + if z.MembersAdded == nil { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.MembersRemoved == nil { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.OldStatus == "" { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.NewStatus == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // string "groupName" + o = append(o, 0xa9, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65) + o = msgp.AppendString(o, z.GroupName) + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "membersAdded" + o = append(o, 0xac, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x41, 0x64, 0x64, 0x65, 0x64) + o = msgp.AppendArrayHeader(o, uint32(len(z.MembersAdded))) + for za0001 := range z.MembersAdded { + o = msgp.AppendString(o, z.MembersAdded[za0001]) + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "membersRemoved" + o = append(o, 0xae, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64) + o = msgp.AppendArrayHeader(o, uint32(len(z.MembersRemoved))) + for za0002 := range z.MembersRemoved { + o = msgp.AppendString(o, z.MembersRemoved[za0002]) + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "oldStatus" + o = append(o, 0xa9, 0x6f, 0x6c, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73) + o = msgp.AppendString(o, z.OldStatus) + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "newStatus" + o = append(o, 0xa9, 0x6e, 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73) + o = msgp.AppendString(o, z.NewStatus) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *GroupAuditDetails) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 4 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "groupName": + z.GroupName, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "GroupName") + return + } + case "membersAdded": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "MembersAdded") + return + } + if cap(z.MembersAdded) >= int(zb0002) { + z.MembersAdded = (z.MembersAdded)[:zb0002] + } else { + z.MembersAdded = make([]string, zb0002) + } + for za0001 := range z.MembersAdded { + z.MembersAdded[za0001], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "MembersAdded", za0001) + return + } + } + zb0001Mask |= 0x1 + case "membersRemoved": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "MembersRemoved") + return + } + if cap(z.MembersRemoved) >= int(zb0003) { + z.MembersRemoved = (z.MembersRemoved)[:zb0003] + } else { + z.MembersRemoved = make([]string, zb0003) + } + for za0002 := range z.MembersRemoved { + z.MembersRemoved[za0002], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "MembersRemoved", za0002) + return + } + } + zb0001Mask |= 0x2 + case "oldStatus": + z.OldStatus, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OldStatus") + return + } + zb0001Mask |= 0x4 + case "newStatus": + z.NewStatus, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "NewStatus") + return + } + zb0001Mask |= 0x8 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0xf { + if (zb0001Mask & 0x1) == 0 { + z.MembersAdded = nil + } + if (zb0001Mask & 0x2) == 0 { + z.MembersRemoved = nil + } + if (zb0001Mask & 0x4) == 0 { + z.OldStatus = "" + } + if (zb0001Mask & 0x8) == 0 { + z.NewStatus = "" + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *GroupAuditDetails) Msgsize() (s int) { + s = 1 + 10 + msgp.StringPrefixSize + len(z.GroupName) + 13 + msgp.ArrayHeaderSize + for za0001 := range z.MembersAdded { + s += msgp.StringPrefixSize + len(z.MembersAdded[za0001]) + } + s += 15 + msgp.ArrayHeaderSize + for za0002 := range z.MembersRemoved { + s += msgp.StringPrefixSize + len(z.MembersRemoved[za0002]) + } + s += 10 + msgp.StringPrefixSize + len(z.OldStatus) + 10 + msgp.StringPrefixSize + len(z.NewStatus) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *HealAuditDetails) DecodeMsg(dc *msgp.Reader) (err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "operation": + z.Operation, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Operation") + return + } + zb0001Mask |= 0x1 + case "bucket": + z.Bucket, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Bucket") + return + } + zb0001Mask |= 0x2 + case "prefix": + z.Prefix, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Prefix") + return + } + zb0001Mask |= 0x4 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x7 { + if (zb0001Mask & 0x1) == 0 { + z.Operation = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Bucket = "" + } + if (zb0001Mask & 0x4) == 0 { + z.Prefix = "" + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z HealAuditDetails) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(3) + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + if z.Operation == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Bucket == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Prefix == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "operation" + err = en.Append(0xa9, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) + if err != nil { + return + } + err = en.WriteString(z.Operation) + if err != nil { + err = msgp.WrapError(err, "Operation") + return + } + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "bucket" + err = en.Append(0xa6, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Bucket) + if err != nil { + err = msgp.WrapError(err, "Bucket") + return + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "prefix" + err = en.Append(0xa6, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78) + if err != nil { + return + } + err = en.WriteString(z.Prefix) + if err != nil { + err = msgp.WrapError(err, "Prefix") + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z HealAuditDetails) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(3) + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + if z.Operation == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Bucket == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Prefix == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "operation" + o = append(o, 0xa9, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) + o = msgp.AppendString(o, z.Operation) + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "bucket" + o = append(o, 0xa6, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74) + o = msgp.AppendString(o, z.Bucket) + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "prefix" + o = append(o, 0xa6, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78) + o = msgp.AppendString(o, z.Prefix) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *HealAuditDetails) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "operation": + z.Operation, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Operation") + return + } + zb0001Mask |= 0x1 + case "bucket": + z.Bucket, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Bucket") + return + } + zb0001Mask |= 0x2 + case "prefix": + z.Prefix, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Prefix") + return + } + zb0001Mask |= 0x4 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x7 { + if (zb0001Mask & 0x1) == 0 { + z.Operation = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Bucket = "" + } + if (zb0001Mask & 0x4) == 0 { + z.Prefix = "" + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z HealAuditDetails) Msgsize() (s int) { + s = 1 + 10 + msgp.StringPrefixSize + len(z.Operation) + 7 + msgp.StringPrefixSize + len(z.Bucket) + 7 + msgp.StringPrefixSize + len(z.Prefix) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *IAMImportDetails) DecodeMsg(dc *msgp.Reader) (err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint16 /* 16 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "usersAdded": + z.UsersAdded, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "UsersAdded") + return + } + zb0001Mask |= 0x1 + case "policiesAdded": + z.PoliciesAdded, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "PoliciesAdded") + return + } + zb0001Mask |= 0x2 + case "groupsAdded": + z.GroupsAdded, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "GroupsAdded") + return + } + zb0001Mask |= 0x4 + case "svcAcctsAdded": + z.SvcAcctsAdded, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "SvcAcctsAdded") + return + } + zb0001Mask |= 0x8 + case "usersRemoved": + z.UsersRemoved, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "UsersRemoved") + return + } + zb0001Mask |= 0x10 + case "policiesRemoved": + z.PoliciesRemoved, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "PoliciesRemoved") + return + } + zb0001Mask |= 0x20 + case "groupsRemoved": + z.GroupsRemoved, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "GroupsRemoved") + return + } + zb0001Mask |= 0x40 + case "svcAcctsRemoved": + z.SvcAcctsRemoved, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "SvcAcctsRemoved") + return + } + zb0001Mask |= 0x80 + case "usersSkipped": + z.UsersSkipped, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "UsersSkipped") + return + } + zb0001Mask |= 0x100 + case "policiesSkipped": + z.PoliciesSkipped, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "PoliciesSkipped") + return + } + zb0001Mask |= 0x200 + case "groupsSkipped": + z.GroupsSkipped, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "GroupsSkipped") + return + } + zb0001Mask |= 0x400 + case "svcAcctsSkipped": + z.SvcAcctsSkipped, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "SvcAcctsSkipped") + return + } + zb0001Mask |= 0x800 + case "usersFailed": + z.UsersFailed, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "UsersFailed") + return + } + zb0001Mask |= 0x1000 + case "policiesFailed": + z.PoliciesFailed, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "PoliciesFailed") + return + } + zb0001Mask |= 0x2000 + case "groupsFailed": + z.GroupsFailed, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "GroupsFailed") + return + } + zb0001Mask |= 0x4000 + case "svcAcctsFailed": + z.SvcAcctsFailed, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "SvcAcctsFailed") + return + } + zb0001Mask |= 0x8000 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0xffff { + if (zb0001Mask & 0x1) == 0 { + z.UsersAdded = 0 + } + if (zb0001Mask & 0x2) == 0 { + z.PoliciesAdded = 0 + } + if (zb0001Mask & 0x4) == 0 { + z.GroupsAdded = 0 + } + if (zb0001Mask & 0x8) == 0 { + z.SvcAcctsAdded = 0 + } + if (zb0001Mask & 0x10) == 0 { + z.UsersRemoved = 0 + } + if (zb0001Mask & 0x20) == 0 { + z.PoliciesRemoved = 0 + } + if (zb0001Mask & 0x40) == 0 { + z.GroupsRemoved = 0 + } + if (zb0001Mask & 0x80) == 0 { + z.SvcAcctsRemoved = 0 + } + if (zb0001Mask & 0x100) == 0 { + z.UsersSkipped = 0 + } + if (zb0001Mask & 0x200) == 0 { + z.PoliciesSkipped = 0 + } + if (zb0001Mask & 0x400) == 0 { + z.GroupsSkipped = 0 + } + if (zb0001Mask & 0x800) == 0 { + z.SvcAcctsSkipped = 0 + } + if (zb0001Mask & 0x1000) == 0 { + z.UsersFailed = 0 + } + if (zb0001Mask & 0x2000) == 0 { + z.PoliciesFailed = 0 + } + if (zb0001Mask & 0x4000) == 0 { + z.GroupsFailed = 0 + } + if (zb0001Mask & 0x8000) == 0 { + z.SvcAcctsFailed = 0 + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *IAMImportDetails) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(16) + var zb0001Mask uint16 /* 16 bits */ + _ = zb0001Mask + if z.UsersAdded == 0 { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.PoliciesAdded == 0 { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.GroupsAdded == 0 { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.SvcAcctsAdded == 0 { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.UsersRemoved == 0 { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.PoliciesRemoved == 0 { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.GroupsRemoved == 0 { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.SvcAcctsRemoved == 0 { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.UsersSkipped == 0 { + zb0001Len-- + zb0001Mask |= 0x100 + } + if z.PoliciesSkipped == 0 { + zb0001Len-- + zb0001Mask |= 0x200 + } + if z.GroupsSkipped == 0 { + zb0001Len-- + zb0001Mask |= 0x400 + } + if z.SvcAcctsSkipped == 0 { + zb0001Len-- + zb0001Mask |= 0x800 + } + if z.UsersFailed == 0 { + zb0001Len-- + zb0001Mask |= 0x1000 + } + if z.PoliciesFailed == 0 { + zb0001Len-- + zb0001Mask |= 0x2000 + } + if z.GroupsFailed == 0 { + zb0001Len-- + zb0001Mask |= 0x4000 + } + if z.SvcAcctsFailed == 0 { + zb0001Len-- + zb0001Mask |= 0x8000 + } + // variable map header, size zb0001Len + err = en.WriteMapHeader(zb0001Len) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "usersAdded" + err = en.Append(0xaa, 0x75, 0x73, 0x65, 0x72, 0x73, 0x41, 0x64, 0x64, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt(z.UsersAdded) + if err != nil { + err = msgp.WrapError(err, "UsersAdded") + return + } + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "policiesAdded" + err = en.Append(0xad, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x41, 0x64, 0x64, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt(z.PoliciesAdded) + if err != nil { + err = msgp.WrapError(err, "PoliciesAdded") + return + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "groupsAdded" + err = en.Append(0xab, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x41, 0x64, 0x64, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt(z.GroupsAdded) + if err != nil { + err = msgp.WrapError(err, "GroupsAdded") + return + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "svcAcctsAdded" + err = en.Append(0xad, 0x73, 0x76, 0x63, 0x41, 0x63, 0x63, 0x74, 0x73, 0x41, 0x64, 0x64, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt(z.SvcAcctsAdded) + if err != nil { + err = msgp.WrapError(err, "SvcAcctsAdded") + return + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "usersRemoved" + err = en.Append(0xac, 0x75, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt(z.UsersRemoved) + if err != nil { + err = msgp.WrapError(err, "UsersRemoved") + return + } + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // write "policiesRemoved" + err = en.Append(0xaf, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt(z.PoliciesRemoved) + if err != nil { + err = msgp.WrapError(err, "PoliciesRemoved") + return + } + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // write "groupsRemoved" + err = en.Append(0xad, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt(z.GroupsRemoved) + if err != nil { + err = msgp.WrapError(err, "GroupsRemoved") + return + } + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // write "svcAcctsRemoved" + err = en.Append(0xaf, 0x73, 0x76, 0x63, 0x41, 0x63, 0x63, 0x74, 0x73, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt(z.SvcAcctsRemoved) + if err != nil { + err = msgp.WrapError(err, "SvcAcctsRemoved") + return + } + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // write "usersSkipped" + err = en.Append(0xac, 0x75, 0x73, 0x65, 0x72, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt(z.UsersSkipped) + if err != nil { + err = msgp.WrapError(err, "UsersSkipped") + return + } + } + if (zb0001Mask & 0x200) == 0 { // if not omitted + // write "policiesSkipped" + err = en.Append(0xaf, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt(z.PoliciesSkipped) + if err != nil { + err = msgp.WrapError(err, "PoliciesSkipped") + return + } + } + if (zb0001Mask & 0x400) == 0 { // if not omitted + // write "groupsSkipped" + err = en.Append(0xad, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt(z.GroupsSkipped) + if err != nil { + err = msgp.WrapError(err, "GroupsSkipped") + return + } + } + if (zb0001Mask & 0x800) == 0 { // if not omitted + // write "svcAcctsSkipped" + err = en.Append(0xaf, 0x73, 0x76, 0x63, 0x41, 0x63, 0x63, 0x74, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt(z.SvcAcctsSkipped) + if err != nil { + err = msgp.WrapError(err, "SvcAcctsSkipped") + return + } + } + if (zb0001Mask & 0x1000) == 0 { // if not omitted + // write "usersFailed" + err = en.Append(0xab, 0x75, 0x73, 0x65, 0x72, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt(z.UsersFailed) + if err != nil { + err = msgp.WrapError(err, "UsersFailed") + return + } + } + if (zb0001Mask & 0x2000) == 0 { // if not omitted + // write "policiesFailed" + err = en.Append(0xae, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt(z.PoliciesFailed) + if err != nil { + err = msgp.WrapError(err, "PoliciesFailed") + return + } + } + if (zb0001Mask & 0x4000) == 0 { // if not omitted + // write "groupsFailed" + err = en.Append(0xac, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt(z.GroupsFailed) + if err != nil { + err = msgp.WrapError(err, "GroupsFailed") + return + } + } + if (zb0001Mask & 0x8000) == 0 { // if not omitted + // write "svcAcctsFailed" + err = en.Append(0xae, 0x73, 0x76, 0x63, 0x41, 0x63, 0x63, 0x74, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt(z.SvcAcctsFailed) + if err != nil { + err = msgp.WrapError(err, "SvcAcctsFailed") + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *IAMImportDetails) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(16) + var zb0001Mask uint16 /* 16 bits */ + _ = zb0001Mask + if z.UsersAdded == 0 { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.PoliciesAdded == 0 { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.GroupsAdded == 0 { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.SvcAcctsAdded == 0 { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.UsersRemoved == 0 { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.PoliciesRemoved == 0 { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.GroupsRemoved == 0 { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.SvcAcctsRemoved == 0 { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.UsersSkipped == 0 { + zb0001Len-- + zb0001Mask |= 0x100 + } + if z.PoliciesSkipped == 0 { + zb0001Len-- + zb0001Mask |= 0x200 + } + if z.GroupsSkipped == 0 { + zb0001Len-- + zb0001Mask |= 0x400 + } + if z.SvcAcctsSkipped == 0 { + zb0001Len-- + zb0001Mask |= 0x800 + } + if z.UsersFailed == 0 { + zb0001Len-- + zb0001Mask |= 0x1000 + } + if z.PoliciesFailed == 0 { + zb0001Len-- + zb0001Mask |= 0x2000 + } + if z.GroupsFailed == 0 { + zb0001Len-- + zb0001Mask |= 0x4000 + } + if z.SvcAcctsFailed == 0 { + zb0001Len-- + zb0001Mask |= 0x8000 + } + // variable map header, size zb0001Len + o = msgp.AppendMapHeader(o, zb0001Len) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "usersAdded" + o = append(o, 0xaa, 0x75, 0x73, 0x65, 0x72, 0x73, 0x41, 0x64, 0x64, 0x65, 0x64) + o = msgp.AppendInt(o, z.UsersAdded) + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "policiesAdded" + o = append(o, 0xad, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x41, 0x64, 0x64, 0x65, 0x64) + o = msgp.AppendInt(o, z.PoliciesAdded) + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "groupsAdded" + o = append(o, 0xab, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x41, 0x64, 0x64, 0x65, 0x64) + o = msgp.AppendInt(o, z.GroupsAdded) + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "svcAcctsAdded" + o = append(o, 0xad, 0x73, 0x76, 0x63, 0x41, 0x63, 0x63, 0x74, 0x73, 0x41, 0x64, 0x64, 0x65, 0x64) + o = msgp.AppendInt(o, z.SvcAcctsAdded) + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "usersRemoved" + o = append(o, 0xac, 0x75, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64) + o = msgp.AppendInt(o, z.UsersRemoved) + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // string "policiesRemoved" + o = append(o, 0xaf, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64) + o = msgp.AppendInt(o, z.PoliciesRemoved) + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // string "groupsRemoved" + o = append(o, 0xad, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64) + o = msgp.AppendInt(o, z.GroupsRemoved) + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // string "svcAcctsRemoved" + o = append(o, 0xaf, 0x73, 0x76, 0x63, 0x41, 0x63, 0x63, 0x74, 0x73, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64) + o = msgp.AppendInt(o, z.SvcAcctsRemoved) + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // string "usersSkipped" + o = append(o, 0xac, 0x75, 0x73, 0x65, 0x72, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64) + o = msgp.AppendInt(o, z.UsersSkipped) + } + if (zb0001Mask & 0x200) == 0 { // if not omitted + // string "policiesSkipped" + o = append(o, 0xaf, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64) + o = msgp.AppendInt(o, z.PoliciesSkipped) + } + if (zb0001Mask & 0x400) == 0 { // if not omitted + // string "groupsSkipped" + o = append(o, 0xad, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64) + o = msgp.AppendInt(o, z.GroupsSkipped) + } + if (zb0001Mask & 0x800) == 0 { // if not omitted + // string "svcAcctsSkipped" + o = append(o, 0xaf, 0x73, 0x76, 0x63, 0x41, 0x63, 0x63, 0x74, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64) + o = msgp.AppendInt(o, z.SvcAcctsSkipped) + } + if (zb0001Mask & 0x1000) == 0 { // if not omitted + // string "usersFailed" + o = append(o, 0xab, 0x75, 0x73, 0x65, 0x72, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64) + o = msgp.AppendInt(o, z.UsersFailed) + } + if (zb0001Mask & 0x2000) == 0 { // if not omitted + // string "policiesFailed" + o = append(o, 0xae, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64) + o = msgp.AppendInt(o, z.PoliciesFailed) + } + if (zb0001Mask & 0x4000) == 0 { // if not omitted + // string "groupsFailed" + o = append(o, 0xac, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64) + o = msgp.AppendInt(o, z.GroupsFailed) + } + if (zb0001Mask & 0x8000) == 0 { // if not omitted + // string "svcAcctsFailed" + o = append(o, 0xae, 0x73, 0x76, 0x63, 0x41, 0x63, 0x63, 0x74, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64) + o = msgp.AppendInt(o, z.SvcAcctsFailed) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *IAMImportDetails) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint16 /* 16 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "usersAdded": + z.UsersAdded, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "UsersAdded") + return + } + zb0001Mask |= 0x1 + case "policiesAdded": + z.PoliciesAdded, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PoliciesAdded") + return + } + zb0001Mask |= 0x2 + case "groupsAdded": + z.GroupsAdded, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "GroupsAdded") + return + } + zb0001Mask |= 0x4 + case "svcAcctsAdded": + z.SvcAcctsAdded, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "SvcAcctsAdded") + return + } + zb0001Mask |= 0x8 + case "usersRemoved": + z.UsersRemoved, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "UsersRemoved") + return + } + zb0001Mask |= 0x10 + case "policiesRemoved": + z.PoliciesRemoved, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PoliciesRemoved") + return + } + zb0001Mask |= 0x20 + case "groupsRemoved": + z.GroupsRemoved, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "GroupsRemoved") + return + } + zb0001Mask |= 0x40 + case "svcAcctsRemoved": + z.SvcAcctsRemoved, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "SvcAcctsRemoved") + return + } + zb0001Mask |= 0x80 + case "usersSkipped": + z.UsersSkipped, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "UsersSkipped") + return + } + zb0001Mask |= 0x100 + case "policiesSkipped": + z.PoliciesSkipped, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PoliciesSkipped") + return + } + zb0001Mask |= 0x200 + case "groupsSkipped": + z.GroupsSkipped, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "GroupsSkipped") + return + } + zb0001Mask |= 0x400 + case "svcAcctsSkipped": + z.SvcAcctsSkipped, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "SvcAcctsSkipped") + return + } + zb0001Mask |= 0x800 + case "usersFailed": + z.UsersFailed, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "UsersFailed") + return + } + zb0001Mask |= 0x1000 + case "policiesFailed": + z.PoliciesFailed, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PoliciesFailed") + return + } + zb0001Mask |= 0x2000 + case "groupsFailed": + z.GroupsFailed, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "GroupsFailed") + return + } + zb0001Mask |= 0x4000 + case "svcAcctsFailed": + z.SvcAcctsFailed, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "SvcAcctsFailed") + return + } + zb0001Mask |= 0x8000 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0xffff { + if (zb0001Mask & 0x1) == 0 { + z.UsersAdded = 0 + } + if (zb0001Mask & 0x2) == 0 { + z.PoliciesAdded = 0 + } + if (zb0001Mask & 0x4) == 0 { + z.GroupsAdded = 0 + } + if (zb0001Mask & 0x8) == 0 { + z.SvcAcctsAdded = 0 + } + if (zb0001Mask & 0x10) == 0 { + z.UsersRemoved = 0 + } + if (zb0001Mask & 0x20) == 0 { + z.PoliciesRemoved = 0 + } + if (zb0001Mask & 0x40) == 0 { + z.GroupsRemoved = 0 + } + if (zb0001Mask & 0x80) == 0 { + z.SvcAcctsRemoved = 0 + } + if (zb0001Mask & 0x100) == 0 { + z.UsersSkipped = 0 + } + if (zb0001Mask & 0x200) == 0 { + z.PoliciesSkipped = 0 + } + if (zb0001Mask & 0x400) == 0 { + z.GroupsSkipped = 0 + } + if (zb0001Mask & 0x800) == 0 { + z.SvcAcctsSkipped = 0 + } + if (zb0001Mask & 0x1000) == 0 { + z.UsersFailed = 0 + } + if (zb0001Mask & 0x2000) == 0 { + z.PoliciesFailed = 0 + } + if (zb0001Mask & 0x4000) == 0 { + z.GroupsFailed = 0 + } + if (zb0001Mask & 0x8000) == 0 { + z.SvcAcctsFailed = 0 + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *IAMImportDetails) Msgsize() (s int) { + s = 3 + 11 + msgp.IntSize + 14 + msgp.IntSize + 12 + msgp.IntSize + 14 + msgp.IntSize + 13 + msgp.IntSize + 16 + msgp.IntSize + 14 + msgp.IntSize + 16 + msgp.IntSize + 13 + msgp.IntSize + 16 + msgp.IntSize + 14 + msgp.IntSize + 16 + msgp.IntSize + 12 + msgp.IntSize + 15 + msgp.IntSize + 13 + msgp.IntSize + 15 + msgp.IntSize + return +} + +// DecodeMsg implements msgp.Decodable +func (z *IDPAuditDetails) DecodeMsg(dc *msgp.Reader) (err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 5 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "idpName": + z.IDPName, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "IDPName") + return + } + zb0001Mask |= 0x1 + case "idpType": + z.IDPType, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "IDPType") + return + } + zb0001Mask |= 0x2 + case "configKey": + z.ConfigKey, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ConfigKey") + return + } + zb0001Mask |= 0x4 + case "oldValue": + z.OldValue, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "OldValue") + return + } + zb0001Mask |= 0x8 + case "newValue": + z.NewValue, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "NewValue") + return + } + zb0001Mask |= 0x10 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1f { + if (zb0001Mask & 0x1) == 0 { + z.IDPName = "" + } + if (zb0001Mask & 0x2) == 0 { + z.IDPType = "" + } + if (zb0001Mask & 0x4) == 0 { + z.ConfigKey = "" + } + if (zb0001Mask & 0x8) == 0 { + z.OldValue = "" + } + if (zb0001Mask & 0x10) == 0 { + z.NewValue = "" + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *IDPAuditDetails) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(5) + var zb0001Mask uint8 /* 5 bits */ + _ = zb0001Mask + if z.IDPName == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.IDPType == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.ConfigKey == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.OldValue == "" { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.NewValue == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "idpName" + err = en.Append(0xa7, 0x69, 0x64, 0x70, 0x4e, 0x61, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteString(z.IDPName) + if err != nil { + err = msgp.WrapError(err, "IDPName") + return + } + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "idpType" + err = en.Append(0xa7, 0x69, 0x64, 0x70, 0x54, 0x79, 0x70, 0x65) + if err != nil { + return + } + err = en.WriteString(z.IDPType) + if err != nil { + err = msgp.WrapError(err, "IDPType") + return + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "configKey" + err = en.Append(0xa9, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4b, 0x65, 0x79) + if err != nil { + return + } + err = en.WriteString(z.ConfigKey) + if err != nil { + err = msgp.WrapError(err, "ConfigKey") + return + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "oldValue" + err = en.Append(0xa8, 0x6f, 0x6c, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65) + if err != nil { + return + } + err = en.WriteString(z.OldValue) + if err != nil { + err = msgp.WrapError(err, "OldValue") + return + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "newValue" + err = en.Append(0xa8, 0x6e, 0x65, 0x77, 0x56, 0x61, 0x6c, 0x75, 0x65) + if err != nil { + return + } + err = en.WriteString(z.NewValue) + if err != nil { + err = msgp.WrapError(err, "NewValue") + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *IDPAuditDetails) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(5) + var zb0001Mask uint8 /* 5 bits */ + _ = zb0001Mask + if z.IDPName == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.IDPType == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.ConfigKey == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.OldValue == "" { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.NewValue == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "idpName" + o = append(o, 0xa7, 0x69, 0x64, 0x70, 0x4e, 0x61, 0x6d, 0x65) + o = msgp.AppendString(o, z.IDPName) + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "idpType" + o = append(o, 0xa7, 0x69, 0x64, 0x70, 0x54, 0x79, 0x70, 0x65) + o = msgp.AppendString(o, z.IDPType) + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "configKey" + o = append(o, 0xa9, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4b, 0x65, 0x79) + o = msgp.AppendString(o, z.ConfigKey) + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "oldValue" + o = append(o, 0xa8, 0x6f, 0x6c, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65) + o = msgp.AppendString(o, z.OldValue) + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "newValue" + o = append(o, 0xa8, 0x6e, 0x65, 0x77, 0x56, 0x61, 0x6c, 0x75, 0x65) + o = msgp.AppendString(o, z.NewValue) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *IDPAuditDetails) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 5 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "idpName": + z.IDPName, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "IDPName") + return + } + zb0001Mask |= 0x1 + case "idpType": + z.IDPType, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "IDPType") + return + } + zb0001Mask |= 0x2 + case "configKey": + z.ConfigKey, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ConfigKey") + return + } + zb0001Mask |= 0x4 + case "oldValue": + z.OldValue, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OldValue") + return + } + zb0001Mask |= 0x8 + case "newValue": + z.NewValue, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "NewValue") + return + } + zb0001Mask |= 0x10 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1f { + if (zb0001Mask & 0x1) == 0 { + z.IDPName = "" + } + if (zb0001Mask & 0x2) == 0 { + z.IDPType = "" + } + if (zb0001Mask & 0x4) == 0 { + z.ConfigKey = "" + } + if (zb0001Mask & 0x8) == 0 { + z.OldValue = "" + } + if (zb0001Mask & 0x10) == 0 { + z.NewValue = "" + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *IDPAuditDetails) Msgsize() (s int) { + s = 1 + 8 + msgp.StringPrefixSize + len(z.IDPName) + 8 + msgp.StringPrefixSize + len(z.IDPType) + 10 + msgp.StringPrefixSize + len(z.ConfigKey) + 9 + msgp.StringPrefixSize + len(z.OldValue) + 9 + msgp.StringPrefixSize + len(z.NewValue) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *KMSAuditDetails) DecodeMsg(dc *msgp.Reader) (err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 2 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "keyId": + z.KeyID, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "KeyID") + return + } + zb0001Mask |= 0x1 + case "operation": + z.Operation, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Operation") + return + } + zb0001Mask |= 0x2 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x3 { + if (zb0001Mask & 0x1) == 0 { + z.KeyID = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Operation = "" + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z KMSAuditDetails) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(2) + var zb0001Mask uint8 /* 2 bits */ + _ = zb0001Mask + if z.KeyID == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Operation == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "keyId" + err = en.Append(0xa5, 0x6b, 0x65, 0x79, 0x49, 0x64) + if err != nil { + return + } + err = en.WriteString(z.KeyID) + if err != nil { + err = msgp.WrapError(err, "KeyID") + return + } + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "operation" + err = en.Append(0xa9, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) + if err != nil { + return + } + err = en.WriteString(z.Operation) + if err != nil { + err = msgp.WrapError(err, "Operation") + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z KMSAuditDetails) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(2) + var zb0001Mask uint8 /* 2 bits */ + _ = zb0001Mask + if z.KeyID == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Operation == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "keyId" + o = append(o, 0xa5, 0x6b, 0x65, 0x79, 0x49, 0x64) + o = msgp.AppendString(o, z.KeyID) + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "operation" + o = append(o, 0xa9, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) + o = msgp.AppendString(o, z.Operation) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *KMSAuditDetails) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 2 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "keyId": + z.KeyID, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "KeyID") + return + } + zb0001Mask |= 0x1 + case "operation": + z.Operation, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Operation") + return + } + zb0001Mask |= 0x2 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x3 { + if (zb0001Mask & 0x1) == 0 { + z.KeyID = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Operation = "" + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z KMSAuditDetails) Msgsize() (s int) { + s = 1 + 6 + msgp.StringPrefixSize + len(z.KeyID) + 10 + msgp.StringPrefixSize + len(z.Operation) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *PolicyAuditDetails) DecodeMsg(dc *msgp.Reader) (err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 7 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "policyName": + z.PolicyName, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "PolicyName") + return + } + case "oldPolicy": + z.OldPolicy, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "OldPolicy") + return + } + zb0001Mask |= 0x1 + case "newPolicy": + z.NewPolicy, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "NewPolicy") + return + } + zb0001Mask |= 0x2 + case "operation": + z.Operation, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Operation") + return + } + zb0001Mask |= 0x4 + case "user": + z.User, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "User") + return + } + zb0001Mask |= 0x8 + case "group": + z.Group, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Group") + return + } + zb0001Mask |= 0x10 + case "policiesAttached": + var zb0002 uint32 + zb0002, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "PoliciesAttached") + return + } + if cap(z.PoliciesAttached) >= int(zb0002) { + z.PoliciesAttached = (z.PoliciesAttached)[:zb0002] + } else { + z.PoliciesAttached = make([]string, zb0002) + } + for za0001 := range z.PoliciesAttached { + z.PoliciesAttached[za0001], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "PoliciesAttached", za0001) + return + } + } + zb0001Mask |= 0x20 + case "policiesDetached": + var zb0003 uint32 + zb0003, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "PoliciesDetached") + return + } + if cap(z.PoliciesDetached) >= int(zb0003) { + z.PoliciesDetached = (z.PoliciesDetached)[:zb0003] + } else { + z.PoliciesDetached = make([]string, zb0003) + } + for za0002 := range z.PoliciesDetached { + z.PoliciesDetached[za0002], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "PoliciesDetached", za0002) + return + } + } + zb0001Mask |= 0x40 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x7f { + if (zb0001Mask & 0x1) == 0 { + z.OldPolicy = "" + } + if (zb0001Mask & 0x2) == 0 { + z.NewPolicy = "" + } + if (zb0001Mask & 0x4) == 0 { + z.Operation = "" + } + if (zb0001Mask & 0x8) == 0 { + z.User = "" + } + if (zb0001Mask & 0x10) == 0 { + z.Group = "" + } + if (zb0001Mask & 0x20) == 0 { + z.PoliciesAttached = nil + } + if (zb0001Mask & 0x40) == 0 { + z.PoliciesDetached = nil + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *PolicyAuditDetails) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(8) + var zb0001Mask uint8 /* 8 bits */ + _ = zb0001Mask + if z.OldPolicy == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.NewPolicy == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Operation == "" { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.User == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.Group == "" { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.PoliciesAttached == nil { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.PoliciesDetached == nil { + zb0001Len-- + zb0001Mask |= 0x80 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // write "policyName" + err = en.Append(0xaa, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4e, 0x61, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteString(z.PolicyName) + if err != nil { + err = msgp.WrapError(err, "PolicyName") + return + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "oldPolicy" + err = en.Append(0xa9, 0x6f, 0x6c, 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79) + if err != nil { + return + } + err = en.WriteString(z.OldPolicy) + if err != nil { + err = msgp.WrapError(err, "OldPolicy") + return + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "newPolicy" + err = en.Append(0xa9, 0x6e, 0x65, 0x77, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79) + if err != nil { + return + } + err = en.WriteString(z.NewPolicy) + if err != nil { + err = msgp.WrapError(err, "NewPolicy") + return + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "operation" + err = en.Append(0xa9, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) + if err != nil { + return + } + err = en.WriteString(z.Operation) + if err != nil { + err = msgp.WrapError(err, "Operation") + return + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "user" + err = en.Append(0xa4, 0x75, 0x73, 0x65, 0x72) + if err != nil { + return + } + err = en.WriteString(z.User) + if err != nil { + err = msgp.WrapError(err, "User") + return + } + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // write "group" + err = en.Append(0xa5, 0x67, 0x72, 0x6f, 0x75, 0x70) + if err != nil { + return + } + err = en.WriteString(z.Group) + if err != nil { + err = msgp.WrapError(err, "Group") + return + } + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // write "policiesAttached" + err = en.Append(0xb0, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.PoliciesAttached))) + if err != nil { + err = msgp.WrapError(err, "PoliciesAttached") + return + } + for za0001 := range z.PoliciesAttached { + err = en.WriteString(z.PoliciesAttached[za0001]) + if err != nil { + err = msgp.WrapError(err, "PoliciesAttached", za0001) + return + } + } + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // write "policiesDetached" + err = en.Append(0xb0, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.PoliciesDetached))) + if err != nil { + err = msgp.WrapError(err, "PoliciesDetached") + return + } + for za0002 := range z.PoliciesDetached { + err = en.WriteString(z.PoliciesDetached[za0002]) + if err != nil { + err = msgp.WrapError(err, "PoliciesDetached", za0002) + return + } + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *PolicyAuditDetails) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(8) + var zb0001Mask uint8 /* 8 bits */ + _ = zb0001Mask + if z.OldPolicy == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.NewPolicy == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Operation == "" { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.User == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.Group == "" { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.PoliciesAttached == nil { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.PoliciesDetached == nil { + zb0001Len-- + zb0001Mask |= 0x80 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // string "policyName" + o = append(o, 0xaa, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4e, 0x61, 0x6d, 0x65) + o = msgp.AppendString(o, z.PolicyName) + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "oldPolicy" + o = append(o, 0xa9, 0x6f, 0x6c, 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79) + o = msgp.AppendString(o, z.OldPolicy) + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "newPolicy" + o = append(o, 0xa9, 0x6e, 0x65, 0x77, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79) + o = msgp.AppendString(o, z.NewPolicy) + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "operation" + o = append(o, 0xa9, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) + o = msgp.AppendString(o, z.Operation) + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "user" + o = append(o, 0xa4, 0x75, 0x73, 0x65, 0x72) + o = msgp.AppendString(o, z.User) + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // string "group" + o = append(o, 0xa5, 0x67, 0x72, 0x6f, 0x75, 0x70) + o = msgp.AppendString(o, z.Group) + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // string "policiesAttached" + o = append(o, 0xb0, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64) + o = msgp.AppendArrayHeader(o, uint32(len(z.PoliciesAttached))) + for za0001 := range z.PoliciesAttached { + o = msgp.AppendString(o, z.PoliciesAttached[za0001]) + } + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // string "policiesDetached" + o = append(o, 0xb0, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64) + o = msgp.AppendArrayHeader(o, uint32(len(z.PoliciesDetached))) + for za0002 := range z.PoliciesDetached { + o = msgp.AppendString(o, z.PoliciesDetached[za0002]) + } + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *PolicyAuditDetails) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 7 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "policyName": + z.PolicyName, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PolicyName") + return + } + case "oldPolicy": + z.OldPolicy, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OldPolicy") + return + } + zb0001Mask |= 0x1 + case "newPolicy": + z.NewPolicy, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "NewPolicy") + return + } + zb0001Mask |= 0x2 + case "operation": + z.Operation, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Operation") + return + } + zb0001Mask |= 0x4 + case "user": + z.User, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "User") + return + } + zb0001Mask |= 0x8 + case "group": + z.Group, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Group") + return + } + zb0001Mask |= 0x10 + case "policiesAttached": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PoliciesAttached") + return + } + if cap(z.PoliciesAttached) >= int(zb0002) { + z.PoliciesAttached = (z.PoliciesAttached)[:zb0002] + } else { + z.PoliciesAttached = make([]string, zb0002) + } + for za0001 := range z.PoliciesAttached { + z.PoliciesAttached[za0001], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PoliciesAttached", za0001) + return + } + } + zb0001Mask |= 0x20 + case "policiesDetached": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PoliciesDetached") + return + } + if cap(z.PoliciesDetached) >= int(zb0003) { + z.PoliciesDetached = (z.PoliciesDetached)[:zb0003] + } else { + z.PoliciesDetached = make([]string, zb0003) + } + for za0002 := range z.PoliciesDetached { + z.PoliciesDetached[za0002], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PoliciesDetached", za0002) + return + } + } + zb0001Mask |= 0x40 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x7f { + if (zb0001Mask & 0x1) == 0 { + z.OldPolicy = "" + } + if (zb0001Mask & 0x2) == 0 { + z.NewPolicy = "" + } + if (zb0001Mask & 0x4) == 0 { + z.Operation = "" + } + if (zb0001Mask & 0x8) == 0 { + z.User = "" + } + if (zb0001Mask & 0x10) == 0 { + z.Group = "" + } + if (zb0001Mask & 0x20) == 0 { + z.PoliciesAttached = nil + } + if (zb0001Mask & 0x40) == 0 { + z.PoliciesDetached = nil + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *PolicyAuditDetails) Msgsize() (s int) { + s = 1 + 11 + msgp.StringPrefixSize + len(z.PolicyName) + 10 + msgp.StringPrefixSize + len(z.OldPolicy) + 10 + msgp.StringPrefixSize + len(z.NewPolicy) + 10 + msgp.StringPrefixSize + len(z.Operation) + 5 + msgp.StringPrefixSize + len(z.User) + 6 + msgp.StringPrefixSize + len(z.Group) + 17 + msgp.ArrayHeaderSize + for za0001 := range z.PoliciesAttached { + s += msgp.StringPrefixSize + len(z.PoliciesAttached[za0001]) + } + s += 17 + msgp.ArrayHeaderSize + for za0002 := range z.PoliciesDetached { + s += msgp.StringPrefixSize + len(z.PoliciesDetached[za0002]) + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *PoolAuditDetails) DecodeMsg(dc *msgp.Reader) (err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "poolIndex": + z.PoolIndex, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "PoolIndex") + return + } + zb0001Mask |= 0x1 + case "endpoints": + var zb0002 uint32 + zb0002, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Endpoints") + return + } + if cap(z.Endpoints) >= int(zb0002) { + z.Endpoints = (z.Endpoints)[:zb0002] + } else { + z.Endpoints = make([]string, zb0002) + } + for za0001 := range z.Endpoints { + z.Endpoints[za0001], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Endpoints", za0001) + return + } + } + zb0001Mask |= 0x2 + case "operation": + z.Operation, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Operation") + return + } + zb0001Mask |= 0x4 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x7 { + if (zb0001Mask & 0x1) == 0 { + z.PoolIndex = 0 + } + if (zb0001Mask & 0x2) == 0 { + z.Endpoints = nil + } + if (zb0001Mask & 0x4) == 0 { + z.Operation = "" + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *PoolAuditDetails) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(3) + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + if z.PoolIndex == 0 { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Endpoints == nil { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Operation == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "poolIndex" + err = en.Append(0xa9, 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78) + if err != nil { + return + } + err = en.WriteInt(z.PoolIndex) + if err != nil { + err = msgp.WrapError(err, "PoolIndex") + return + } + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "endpoints" + err = en.Append(0xa9, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Endpoints))) + if err != nil { + err = msgp.WrapError(err, "Endpoints") + return + } + for za0001 := range z.Endpoints { + err = en.WriteString(z.Endpoints[za0001]) + if err != nil { + err = msgp.WrapError(err, "Endpoints", za0001) + return + } + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "operation" + err = en.Append(0xa9, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) + if err != nil { + return + } + err = en.WriteString(z.Operation) + if err != nil { + err = msgp.WrapError(err, "Operation") + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *PoolAuditDetails) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(3) + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + if z.PoolIndex == 0 { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Endpoints == nil { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Operation == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "poolIndex" + o = append(o, 0xa9, 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78) + o = msgp.AppendInt(o, z.PoolIndex) + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "endpoints" + o = append(o, 0xa9, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Endpoints))) + for za0001 := range z.Endpoints { + o = msgp.AppendString(o, z.Endpoints[za0001]) + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "operation" + o = append(o, 0xa9, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) + o = msgp.AppendString(o, z.Operation) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *PoolAuditDetails) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "poolIndex": + z.PoolIndex, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PoolIndex") + return + } + zb0001Mask |= 0x1 + case "endpoints": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Endpoints") + return + } + if cap(z.Endpoints) >= int(zb0002) { + z.Endpoints = (z.Endpoints)[:zb0002] + } else { + z.Endpoints = make([]string, zb0002) + } + for za0001 := range z.Endpoints { + z.Endpoints[za0001], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Endpoints", za0001) + return + } + } + zb0001Mask |= 0x2 + case "operation": + z.Operation, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Operation") + return + } + zb0001Mask |= 0x4 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x7 { + if (zb0001Mask & 0x1) == 0 { + z.PoolIndex = 0 + } + if (zb0001Mask & 0x2) == 0 { + z.Endpoints = nil + } + if (zb0001Mask & 0x4) == 0 { + z.Operation = "" + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *PoolAuditDetails) Msgsize() (s int) { + s = 1 + 10 + msgp.IntSize + 10 + msgp.ArrayHeaderSize + for za0001 := range z.Endpoints { + s += msgp.StringPrefixSize + len(z.Endpoints[za0001]) + } + s += 10 + msgp.StringPrefixSize + len(z.Operation) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *QOSRuleDetail) DecodeMsg(dc *msgp.Reader) (err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 8 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "id": + z.ID, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ID") + return + } + zb0001Mask |= 0x1 + case "label": + z.Label, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Label") + return + } + zb0001Mask |= 0x2 + case "priority": + z.Priority, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "Priority") + return + } + zb0001Mask |= 0x4 + case "objectPrefix": + z.ObjectPrefix, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ObjectPrefix") + return + } + zb0001Mask |= 0x8 + case "api": + z.API, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "API") + return + } + zb0001Mask |= 0x10 + case "rate": + z.Rate, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "Rate") + return + } + zb0001Mask |= 0x20 + case "burst": + z.Burst, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "Burst") + return + } + zb0001Mask |= 0x40 + case "limitType": + z.LimitType, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "LimitType") + return + } + zb0001Mask |= 0x80 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0xff { + if (zb0001Mask & 0x1) == 0 { + z.ID = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Label = "" + } + if (zb0001Mask & 0x4) == 0 { + z.Priority = 0 + } + if (zb0001Mask & 0x8) == 0 { + z.ObjectPrefix = "" + } + if (zb0001Mask & 0x10) == 0 { + z.API = "" + } + if (zb0001Mask & 0x20) == 0 { + z.Rate = 0 + } + if (zb0001Mask & 0x40) == 0 { + z.Burst = 0 + } + if (zb0001Mask & 0x80) == 0 { + z.LimitType = "" + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *QOSRuleDetail) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(8) + var zb0001Mask uint8 /* 8 bits */ + _ = zb0001Mask + if z.ID == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Label == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Priority == 0 { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.ObjectPrefix == "" { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.API == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.Rate == 0 { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.Burst == 0 { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.LimitType == "" { + zb0001Len-- + zb0001Mask |= 0x80 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "id" + err = en.Append(0xa2, 0x69, 0x64) + if err != nil { + return + } + err = en.WriteString(z.ID) + if err != nil { + err = msgp.WrapError(err, "ID") + return + } + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "label" + err = en.Append(0xa5, 0x6c, 0x61, 0x62, 0x65, 0x6c) + if err != nil { + return + } + err = en.WriteString(z.Label) + if err != nil { + err = msgp.WrapError(err, "Label") + return + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "priority" + err = en.Append(0xa8, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79) + if err != nil { + return + } + err = en.WriteInt(z.Priority) + if err != nil { + err = msgp.WrapError(err, "Priority") + return + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "objectPrefix" + err = en.Append(0xac, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78) + if err != nil { + return + } + err = en.WriteString(z.ObjectPrefix) + if err != nil { + err = msgp.WrapError(err, "ObjectPrefix") + return + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "api" + err = en.Append(0xa3, 0x61, 0x70, 0x69) + if err != nil { + return + } + err = en.WriteString(z.API) + if err != nil { + err = msgp.WrapError(err, "API") + return + } + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // write "rate" + err = en.Append(0xa4, 0x72, 0x61, 0x74, 0x65) + if err != nil { + return + } + err = en.WriteInt64(z.Rate) + if err != nil { + err = msgp.WrapError(err, "Rate") + return + } + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // write "burst" + err = en.Append(0xa5, 0x62, 0x75, 0x72, 0x73, 0x74) + if err != nil { + return + } + err = en.WriteInt64(z.Burst) + if err != nil { + err = msgp.WrapError(err, "Burst") + return + } + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // write "limitType" + err = en.Append(0xa9, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65) + if err != nil { + return + } + err = en.WriteString(z.LimitType) + if err != nil { + err = msgp.WrapError(err, "LimitType") + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *QOSRuleDetail) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(8) + var zb0001Mask uint8 /* 8 bits */ + _ = zb0001Mask + if z.ID == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Label == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Priority == 0 { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.ObjectPrefix == "" { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.API == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.Rate == 0 { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.Burst == 0 { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.LimitType == "" { + zb0001Len-- + zb0001Mask |= 0x80 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "id" + o = append(o, 0xa2, 0x69, 0x64) + o = msgp.AppendString(o, z.ID) + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "label" + o = append(o, 0xa5, 0x6c, 0x61, 0x62, 0x65, 0x6c) + o = msgp.AppendString(o, z.Label) + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "priority" + o = append(o, 0xa8, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79) + o = msgp.AppendInt(o, z.Priority) + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "objectPrefix" + o = append(o, 0xac, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78) + o = msgp.AppendString(o, z.ObjectPrefix) + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "api" + o = append(o, 0xa3, 0x61, 0x70, 0x69) + o = msgp.AppendString(o, z.API) + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // string "rate" + o = append(o, 0xa4, 0x72, 0x61, 0x74, 0x65) + o = msgp.AppendInt64(o, z.Rate) + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // string "burst" + o = append(o, 0xa5, 0x62, 0x75, 0x72, 0x73, 0x74) + o = msgp.AppendInt64(o, z.Burst) + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // string "limitType" + o = append(o, 0xa9, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65) + o = msgp.AppendString(o, z.LimitType) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *QOSRuleDetail) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 8 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "id": + z.ID, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ID") + return + } + zb0001Mask |= 0x1 + case "label": + z.Label, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Label") + return + } + zb0001Mask |= 0x2 + case "priority": + z.Priority, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Priority") + return + } + zb0001Mask |= 0x4 + case "objectPrefix": + z.ObjectPrefix, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ObjectPrefix") + return + } + zb0001Mask |= 0x8 + case "api": + z.API, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "API") + return + } + zb0001Mask |= 0x10 + case "rate": + z.Rate, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Rate") + return + } + zb0001Mask |= 0x20 + case "burst": + z.Burst, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Burst") + return + } + zb0001Mask |= 0x40 + case "limitType": + z.LimitType, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LimitType") + return + } + zb0001Mask |= 0x80 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0xff { + if (zb0001Mask & 0x1) == 0 { + z.ID = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Label = "" + } + if (zb0001Mask & 0x4) == 0 { + z.Priority = 0 + } + if (zb0001Mask & 0x8) == 0 { + z.ObjectPrefix = "" + } + if (zb0001Mask & 0x10) == 0 { + z.API = "" + } + if (zb0001Mask & 0x20) == 0 { + z.Rate = 0 + } + if (zb0001Mask & 0x40) == 0 { + z.Burst = 0 + } + if (zb0001Mask & 0x80) == 0 { + z.LimitType = "" + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *QOSRuleDetail) Msgsize() (s int) { + s = 1 + 3 + msgp.StringPrefixSize + len(z.ID) + 6 + msgp.StringPrefixSize + len(z.Label) + 9 + msgp.IntSize + 13 + msgp.StringPrefixSize + len(z.ObjectPrefix) + 4 + msgp.StringPrefixSize + len(z.API) + 5 + msgp.Int64Size + 6 + msgp.Int64Size + 10 + msgp.StringPrefixSize + len(z.LimitType) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *RecorderAuditDetails) DecodeMsg(dc *msgp.Reader) (err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint16 /* 9 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "logType": + z.LogType, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "LogType") + return + } + zb0001Mask |= 0x1 + case "oldEnabled": + z.OldEnabled, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "OldEnabled") + return + } + zb0001Mask |= 0x2 + case "newEnabled": + z.NewEnabled, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "NewEnabled") + return + } + zb0001Mask |= 0x4 + case "oldLimit": + z.OldLimit, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "OldLimit") + return + } + zb0001Mask |= 0x8 + case "newLimit": + z.NewLimit, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "NewLimit") + return + } + zb0001Mask |= 0x10 + case "oldFlushCount": + z.OldFlushCount, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "OldFlushCount") + return + } + zb0001Mask |= 0x20 + case "newFlushCount": + z.NewFlushCount, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "NewFlushCount") + return + } + zb0001Mask |= 0x40 + case "oldFlushInterval": + z.OldFlushInterval, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "OldFlushInterval") + return + } + zb0001Mask |= 0x80 + case "newFlushInterval": + z.NewFlushInterval, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "NewFlushInterval") + return + } + zb0001Mask |= 0x100 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1ff { + if (zb0001Mask & 0x1) == 0 { + z.LogType = "" + } + if (zb0001Mask & 0x2) == 0 { + z.OldEnabled = false + } + if (zb0001Mask & 0x4) == 0 { + z.NewEnabled = false + } + if (zb0001Mask & 0x8) == 0 { + z.OldLimit = "" + } + if (zb0001Mask & 0x10) == 0 { + z.NewLimit = "" + } + if (zb0001Mask & 0x20) == 0 { + z.OldFlushCount = 0 + } + if (zb0001Mask & 0x40) == 0 { + z.NewFlushCount = 0 + } + if (zb0001Mask & 0x80) == 0 { + z.OldFlushInterval = "" + } + if (zb0001Mask & 0x100) == 0 { + z.NewFlushInterval = "" + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *RecorderAuditDetails) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(9) + var zb0001Mask uint16 /* 9 bits */ + _ = zb0001Mask + if z.LogType == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.OldEnabled == false { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.NewEnabled == false { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.OldLimit == "" { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.NewLimit == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.OldFlushCount == 0 { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.NewFlushCount == 0 { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.OldFlushInterval == "" { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.NewFlushInterval == "" { + zb0001Len-- + zb0001Mask |= 0x100 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "logType" + err = en.Append(0xa7, 0x6c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65) + if err != nil { + return + } + err = en.WriteString(z.LogType) + if err != nil { + err = msgp.WrapError(err, "LogType") + return + } + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "oldEnabled" + err = en.Append(0xaa, 0x6f, 0x6c, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteBool(z.OldEnabled) + if err != nil { + err = msgp.WrapError(err, "OldEnabled") + return + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "newEnabled" + err = en.Append(0xaa, 0x6e, 0x65, 0x77, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteBool(z.NewEnabled) + if err != nil { + err = msgp.WrapError(err, "NewEnabled") + return + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "oldLimit" + err = en.Append(0xa8, 0x6f, 0x6c, 0x64, 0x4c, 0x69, 0x6d, 0x69, 0x74) + if err != nil { + return + } + err = en.WriteString(z.OldLimit) + if err != nil { + err = msgp.WrapError(err, "OldLimit") + return + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "newLimit" + err = en.Append(0xa8, 0x6e, 0x65, 0x77, 0x4c, 0x69, 0x6d, 0x69, 0x74) + if err != nil { + return + } + err = en.WriteString(z.NewLimit) + if err != nil { + err = msgp.WrapError(err, "NewLimit") + return + } + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // write "oldFlushCount" + err = en.Append(0xad, 0x6f, 0x6c, 0x64, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteInt(z.OldFlushCount) + if err != nil { + err = msgp.WrapError(err, "OldFlushCount") + return + } + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // write "newFlushCount" + err = en.Append(0xad, 0x6e, 0x65, 0x77, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteInt(z.NewFlushCount) + if err != nil { + err = msgp.WrapError(err, "NewFlushCount") + return + } + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // write "oldFlushInterval" + err = en.Append(0xb0, 0x6f, 0x6c, 0x64, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c) + if err != nil { + return + } + err = en.WriteString(z.OldFlushInterval) + if err != nil { + err = msgp.WrapError(err, "OldFlushInterval") + return + } + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // write "newFlushInterval" + err = en.Append(0xb0, 0x6e, 0x65, 0x77, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c) + if err != nil { + return + } + err = en.WriteString(z.NewFlushInterval) + if err != nil { + err = msgp.WrapError(err, "NewFlushInterval") + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *RecorderAuditDetails) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(9) + var zb0001Mask uint16 /* 9 bits */ + _ = zb0001Mask + if z.LogType == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.OldEnabled == false { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.NewEnabled == false { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.OldLimit == "" { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.NewLimit == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.OldFlushCount == 0 { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.NewFlushCount == 0 { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.OldFlushInterval == "" { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.NewFlushInterval == "" { + zb0001Len-- + zb0001Mask |= 0x100 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "logType" + o = append(o, 0xa7, 0x6c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65) + o = msgp.AppendString(o, z.LogType) + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "oldEnabled" + o = append(o, 0xaa, 0x6f, 0x6c, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64) + o = msgp.AppendBool(o, z.OldEnabled) + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "newEnabled" + o = append(o, 0xaa, 0x6e, 0x65, 0x77, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64) + o = msgp.AppendBool(o, z.NewEnabled) + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "oldLimit" + o = append(o, 0xa8, 0x6f, 0x6c, 0x64, 0x4c, 0x69, 0x6d, 0x69, 0x74) + o = msgp.AppendString(o, z.OldLimit) + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "newLimit" + o = append(o, 0xa8, 0x6e, 0x65, 0x77, 0x4c, 0x69, 0x6d, 0x69, 0x74) + o = msgp.AppendString(o, z.NewLimit) + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // string "oldFlushCount" + o = append(o, 0xad, 0x6f, 0x6c, 0x64, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendInt(o, z.OldFlushCount) + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // string "newFlushCount" + o = append(o, 0xad, 0x6e, 0x65, 0x77, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendInt(o, z.NewFlushCount) + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // string "oldFlushInterval" + o = append(o, 0xb0, 0x6f, 0x6c, 0x64, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c) + o = msgp.AppendString(o, z.OldFlushInterval) + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // string "newFlushInterval" + o = append(o, 0xb0, 0x6e, 0x65, 0x77, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c) + o = msgp.AppendString(o, z.NewFlushInterval) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *RecorderAuditDetails) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint16 /* 9 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "logType": + z.LogType, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LogType") + return + } + zb0001Mask |= 0x1 + case "oldEnabled": + z.OldEnabled, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OldEnabled") + return + } + zb0001Mask |= 0x2 + case "newEnabled": + z.NewEnabled, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "NewEnabled") + return + } + zb0001Mask |= 0x4 + case "oldLimit": + z.OldLimit, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OldLimit") + return + } + zb0001Mask |= 0x8 + case "newLimit": + z.NewLimit, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "NewLimit") + return + } + zb0001Mask |= 0x10 + case "oldFlushCount": + z.OldFlushCount, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OldFlushCount") + return + } + zb0001Mask |= 0x20 + case "newFlushCount": + z.NewFlushCount, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "NewFlushCount") + return + } + zb0001Mask |= 0x40 + case "oldFlushInterval": + z.OldFlushInterval, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OldFlushInterval") + return + } + zb0001Mask |= 0x80 + case "newFlushInterval": + z.NewFlushInterval, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "NewFlushInterval") + return + } + zb0001Mask |= 0x100 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1ff { + if (zb0001Mask & 0x1) == 0 { + z.LogType = "" + } + if (zb0001Mask & 0x2) == 0 { + z.OldEnabled = false + } + if (zb0001Mask & 0x4) == 0 { + z.NewEnabled = false + } + if (zb0001Mask & 0x8) == 0 { + z.OldLimit = "" + } + if (zb0001Mask & 0x10) == 0 { + z.NewLimit = "" + } + if (zb0001Mask & 0x20) == 0 { + z.OldFlushCount = 0 + } + if (zb0001Mask & 0x40) == 0 { + z.NewFlushCount = 0 + } + if (zb0001Mask & 0x80) == 0 { + z.OldFlushInterval = "" + } + if (zb0001Mask & 0x100) == 0 { + z.NewFlushInterval = "" + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *RecorderAuditDetails) Msgsize() (s int) { + s = 1 + 8 + msgp.StringPrefixSize + len(z.LogType) + 11 + msgp.BoolSize + 11 + msgp.BoolSize + 9 + msgp.StringPrefixSize + len(z.OldLimit) + 9 + msgp.StringPrefixSize + len(z.NewLimit) + 14 + msgp.IntSize + 14 + msgp.IntSize + 17 + msgp.StringPrefixSize + len(z.OldFlushInterval) + 17 + msgp.StringPrefixSize + len(z.NewFlushInterval) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *ServiceAccountAuditDetails) DecodeMsg(dc *msgp.Reader) (err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 8 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "accountName": + z.AccountName, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "AccountName") + return + } + case "parentUser": + z.ParentUser, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ParentUser") + return + } + zb0001Mask |= 0x1 + case "policies": + var zb0002 uint32 + zb0002, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Policies") + return + } + if cap(z.Policies) >= int(zb0002) { + z.Policies = (z.Policies)[:zb0002] + } else { + z.Policies = make([]string, zb0002) + } + for za0001 := range z.Policies { + z.Policies[za0001], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Policies", za0001) + return + } + } + zb0001Mask |= 0x2 + case "expiration": + z.Expiration, err = dc.ReadTimeUTC() + if err != nil { + err = msgp.WrapError(err, "Expiration") + return + } + zb0001Mask |= 0x4 + case "updatedName": + z.UpdatedName, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "UpdatedName") + return + } + zb0001Mask |= 0x8 + case "updatedStatus": + z.UpdatedStatus, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "UpdatedStatus") + return + } + zb0001Mask |= 0x10 + case "updatedPolicy": + z.UpdatedPolicy, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "UpdatedPolicy") + return + } + zb0001Mask |= 0x20 + case "updatedExpiry": + z.UpdatedExpiry, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "UpdatedExpiry") + return + } + zb0001Mask |= 0x40 + case "updatedSecretKey": + z.UpdatedSecretKey, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "UpdatedSecretKey") + return + } + zb0001Mask |= 0x80 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0xff { + if (zb0001Mask & 0x1) == 0 { + z.ParentUser = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Policies = nil + } + if (zb0001Mask & 0x4) == 0 { + z.Expiration = (time.Time{}) + } + if (zb0001Mask & 0x8) == 0 { + z.UpdatedName = "" + } + if (zb0001Mask & 0x10) == 0 { + z.UpdatedStatus = "" + } + if (zb0001Mask & 0x20) == 0 { + z.UpdatedPolicy = false + } + if (zb0001Mask & 0x40) == 0 { + z.UpdatedExpiry = false + } + if (zb0001Mask & 0x80) == 0 { + z.UpdatedSecretKey = false + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *ServiceAccountAuditDetails) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(9) + var zb0001Mask uint16 /* 9 bits */ + _ = zb0001Mask + if z.ParentUser == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Policies == nil { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Expiration == (time.Time{}) { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.UpdatedName == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.UpdatedStatus == "" { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.UpdatedPolicy == false { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.UpdatedExpiry == false { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.UpdatedSecretKey == false { + zb0001Len-- + zb0001Mask |= 0x100 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // write "accountName" + err = en.Append(0xab, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteString(z.AccountName) + if err != nil { + err = msgp.WrapError(err, "AccountName") + return + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "parentUser" + err = en.Append(0xaa, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72) + if err != nil { + return + } + err = en.WriteString(z.ParentUser) + if err != nil { + err = msgp.WrapError(err, "ParentUser") + return + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "policies" + err = en.Append(0xa8, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Policies))) + if err != nil { + err = msgp.WrapError(err, "Policies") + return + } + for za0001 := range z.Policies { + err = en.WriteString(z.Policies[za0001]) + if err != nil { + err = msgp.WrapError(err, "Policies", za0001) + return + } + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "expiration" + err = en.Append(0xaa, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) + if err != nil { + return + } + err = en.WriteTime(z.Expiration) + if err != nil { + err = msgp.WrapError(err, "Expiration") + return + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "updatedName" + err = en.Append(0xab, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x4e, 0x61, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteString(z.UpdatedName) + if err != nil { + err = msgp.WrapError(err, "UpdatedName") + return + } + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // write "updatedStatus" + err = en.Append(0xad, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73) + if err != nil { + return + } + err = en.WriteString(z.UpdatedStatus) + if err != nil { + err = msgp.WrapError(err, "UpdatedStatus") + return + } + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // write "updatedPolicy" + err = en.Append(0xad, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79) + if err != nil { + return + } + err = en.WriteBool(z.UpdatedPolicy) + if err != nil { + err = msgp.WrapError(err, "UpdatedPolicy") + return + } + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // write "updatedExpiry" + err = en.Append(0xad, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79) + if err != nil { + return + } + err = en.WriteBool(z.UpdatedExpiry) + if err != nil { + err = msgp.WrapError(err, "UpdatedExpiry") + return + } + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // write "updatedSecretKey" + err = en.Append(0xb0, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4b, 0x65, 0x79) + if err != nil { + return + } + err = en.WriteBool(z.UpdatedSecretKey) + if err != nil { + err = msgp.WrapError(err, "UpdatedSecretKey") + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *ServiceAccountAuditDetails) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(9) + var zb0001Mask uint16 /* 9 bits */ + _ = zb0001Mask + if z.ParentUser == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Policies == nil { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Expiration == (time.Time{}) { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.UpdatedName == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.UpdatedStatus == "" { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.UpdatedPolicy == false { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.UpdatedExpiry == false { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.UpdatedSecretKey == false { + zb0001Len-- + zb0001Mask |= 0x100 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // string "accountName" + o = append(o, 0xab, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65) + o = msgp.AppendString(o, z.AccountName) + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "parentUser" + o = append(o, 0xaa, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72) + o = msgp.AppendString(o, z.ParentUser) + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "policies" + o = append(o, 0xa8, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Policies))) + for za0001 := range z.Policies { + o = msgp.AppendString(o, z.Policies[za0001]) + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "expiration" + o = append(o, 0xaa, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) + o = msgp.AppendTime(o, z.Expiration) + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "updatedName" + o = append(o, 0xab, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x4e, 0x61, 0x6d, 0x65) + o = msgp.AppendString(o, z.UpdatedName) + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // string "updatedStatus" + o = append(o, 0xad, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73) + o = msgp.AppendString(o, z.UpdatedStatus) + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // string "updatedPolicy" + o = append(o, 0xad, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79) + o = msgp.AppendBool(o, z.UpdatedPolicy) + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // string "updatedExpiry" + o = append(o, 0xad, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79) + o = msgp.AppendBool(o, z.UpdatedExpiry) + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // string "updatedSecretKey" + o = append(o, 0xb0, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4b, 0x65, 0x79) + o = msgp.AppendBool(o, z.UpdatedSecretKey) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *ServiceAccountAuditDetails) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 8 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "accountName": + z.AccountName, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "AccountName") + return + } + case "parentUser": + z.ParentUser, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ParentUser") + return + } + zb0001Mask |= 0x1 + case "policies": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Policies") + return + } + if cap(z.Policies) >= int(zb0002) { + z.Policies = (z.Policies)[:zb0002] + } else { + z.Policies = make([]string, zb0002) + } + for za0001 := range z.Policies { + z.Policies[za0001], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Policies", za0001) + return + } + } + zb0001Mask |= 0x2 + case "expiration": + z.Expiration, bts, err = msgp.ReadTimeUTCBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Expiration") + return + } + zb0001Mask |= 0x4 + case "updatedName": + z.UpdatedName, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "UpdatedName") + return + } + zb0001Mask |= 0x8 + case "updatedStatus": + z.UpdatedStatus, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "UpdatedStatus") + return + } + zb0001Mask |= 0x10 + case "updatedPolicy": + z.UpdatedPolicy, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "UpdatedPolicy") + return + } + zb0001Mask |= 0x20 + case "updatedExpiry": + z.UpdatedExpiry, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "UpdatedExpiry") + return + } + zb0001Mask |= 0x40 + case "updatedSecretKey": + z.UpdatedSecretKey, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "UpdatedSecretKey") + return + } + zb0001Mask |= 0x80 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0xff { + if (zb0001Mask & 0x1) == 0 { + z.ParentUser = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Policies = nil + } + if (zb0001Mask & 0x4) == 0 { + z.Expiration = (time.Time{}) + } + if (zb0001Mask & 0x8) == 0 { + z.UpdatedName = "" + } + if (zb0001Mask & 0x10) == 0 { + z.UpdatedStatus = "" + } + if (zb0001Mask & 0x20) == 0 { + z.UpdatedPolicy = false + } + if (zb0001Mask & 0x40) == 0 { + z.UpdatedExpiry = false + } + if (zb0001Mask & 0x80) == 0 { + z.UpdatedSecretKey = false + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *ServiceAccountAuditDetails) Msgsize() (s int) { + s = 1 + 12 + msgp.StringPrefixSize + len(z.AccountName) + 11 + msgp.StringPrefixSize + len(z.ParentUser) + 9 + msgp.ArrayHeaderSize + for za0001 := range z.Policies { + s += msgp.StringPrefixSize + len(z.Policies[za0001]) + } + s += 11 + msgp.TimeSize + 12 + msgp.StringPrefixSize + len(z.UpdatedName) + 14 + msgp.StringPrefixSize + len(z.UpdatedStatus) + 14 + msgp.BoolSize + 14 + msgp.BoolSize + 17 + msgp.BoolSize + return +} + +// DecodeMsg implements msgp.Decodable +func (z *ServiceAuditDetails) DecodeMsg(dc *msgp.Reader) (err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 5 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "serviceName": + z.ServiceName, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ServiceName") + return + } + zb0001Mask |= 0x1 + case "operation": + z.Operation, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Operation") + return + } + zb0001Mask |= 0x2 + case "status": + z.Status, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Status") + return + } + zb0001Mask |= 0x4 + case "legacy": + z.Legacy, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "Legacy") + return + } + zb0001Mask |= 0x8 + case "iamImport": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "IAMImport") + return + } + z.IAMImport = nil + } else { + if z.IAMImport == nil { + z.IAMImport = new(IAMImportDetails) + } + err = z.IAMImport.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "IAMImport") + return + } + } + zb0001Mask |= 0x10 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1f { + if (zb0001Mask & 0x1) == 0 { + z.ServiceName = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Operation = "" + } + if (zb0001Mask & 0x4) == 0 { + z.Status = "" + } + if (zb0001Mask & 0x8) == 0 { + z.Legacy = false + } + if (zb0001Mask & 0x10) == 0 { + z.IAMImport = nil + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *ServiceAuditDetails) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(5) + var zb0001Mask uint8 /* 5 bits */ + _ = zb0001Mask + if z.ServiceName == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Operation == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Status == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Legacy == false { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.IAMImport == nil { + zb0001Len-- + zb0001Mask |= 0x10 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "serviceName" + err = en.Append(0xab, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteString(z.ServiceName) + if err != nil { + err = msgp.WrapError(err, "ServiceName") + return + } + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "operation" + err = en.Append(0xa9, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) + if err != nil { + return + } + err = en.WriteString(z.Operation) + if err != nil { + err = msgp.WrapError(err, "Operation") + return + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "status" + err = en.Append(0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + if err != nil { + return + } + err = en.WriteString(z.Status) + if err != nil { + err = msgp.WrapError(err, "Status") + return + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "legacy" + err = en.Append(0xa6, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79) + if err != nil { + return + } + err = en.WriteBool(z.Legacy) + if err != nil { + err = msgp.WrapError(err, "Legacy") + return + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "iamImport" + err = en.Append(0xa9, 0x69, 0x61, 0x6d, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74) + if err != nil { + return + } + if z.IAMImport == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.IAMImport.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "IAMImport") + return + } + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *ServiceAuditDetails) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(5) + var zb0001Mask uint8 /* 5 bits */ + _ = zb0001Mask + if z.ServiceName == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Operation == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Status == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Legacy == false { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.IAMImport == nil { + zb0001Len-- + zb0001Mask |= 0x10 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "serviceName" + o = append(o, 0xab, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65) + o = msgp.AppendString(o, z.ServiceName) + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "operation" + o = append(o, 0xa9, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) + o = msgp.AppendString(o, z.Operation) + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "status" + o = append(o, 0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + o = msgp.AppendString(o, z.Status) + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "legacy" + o = append(o, 0xa6, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79) + o = msgp.AppendBool(o, z.Legacy) + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "iamImport" + o = append(o, 0xa9, 0x69, 0x61, 0x6d, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74) + if z.IAMImport == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.IAMImport.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "IAMImport") + return + } + } + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *ServiceAuditDetails) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 5 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "serviceName": + z.ServiceName, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ServiceName") + return + } + zb0001Mask |= 0x1 + case "operation": + z.Operation, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Operation") + return + } + zb0001Mask |= 0x2 + case "status": + z.Status, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Status") + return + } + zb0001Mask |= 0x4 + case "legacy": + z.Legacy, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Legacy") + return + } + zb0001Mask |= 0x8 + case "iamImport": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.IAMImport = nil + } else { + if z.IAMImport == nil { + z.IAMImport = new(IAMImportDetails) + } + bts, err = z.IAMImport.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "IAMImport") + return + } + } + zb0001Mask |= 0x10 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1f { + if (zb0001Mask & 0x1) == 0 { + z.ServiceName = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Operation = "" + } + if (zb0001Mask & 0x4) == 0 { + z.Status = "" + } + if (zb0001Mask & 0x8) == 0 { + z.Legacy = false + } + if (zb0001Mask & 0x10) == 0 { + z.IAMImport = nil + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *ServiceAuditDetails) Msgsize() (s int) { + s = 1 + 12 + msgp.StringPrefixSize + len(z.ServiceName) + 10 + msgp.StringPrefixSize + len(z.Operation) + 7 + msgp.StringPrefixSize + len(z.Status) + 7 + msgp.BoolSize + 10 + if z.IAMImport == nil { + s += msgp.NilSize + } else { + s += z.IAMImport.Msgsize() + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *SiteReplicationAuditDetails) DecodeMsg(dc *msgp.Reader) (err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 4 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "siteName": + z.SiteName, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "SiteName") + return + } + zb0001Mask |= 0x1 + case "endpoint": + z.Endpoint, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Endpoint") + return + } + zb0001Mask |= 0x2 + case "operation": + z.Operation, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Operation") + return + } + zb0001Mask |= 0x4 + case "sites": + var zb0002 uint32 + zb0002, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Sites") + return + } + if cap(z.Sites) >= int(zb0002) { + z.Sites = (z.Sites)[:zb0002] + } else { + z.Sites = make([]string, zb0002) + } + for za0001 := range z.Sites { + z.Sites[za0001], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Sites", za0001) + return + } + } + zb0001Mask |= 0x8 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0xf { + if (zb0001Mask & 0x1) == 0 { + z.SiteName = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Endpoint = "" + } + if (zb0001Mask & 0x4) == 0 { + z.Operation = "" + } + if (zb0001Mask & 0x8) == 0 { + z.Sites = nil + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *SiteReplicationAuditDetails) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(4) + var zb0001Mask uint8 /* 4 bits */ + _ = zb0001Mask + if z.SiteName == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Endpoint == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Operation == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Sites == nil { + zb0001Len-- + zb0001Mask |= 0x8 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "siteName" + err = en.Append(0xa8, 0x73, 0x69, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteString(z.SiteName) + if err != nil { + err = msgp.WrapError(err, "SiteName") + return + } + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "endpoint" + err = en.Append(0xa8, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Endpoint) + if err != nil { + err = msgp.WrapError(err, "Endpoint") + return + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "operation" + err = en.Append(0xa9, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) + if err != nil { + return + } + err = en.WriteString(z.Operation) + if err != nil { + err = msgp.WrapError(err, "Operation") + return + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "sites" + err = en.Append(0xa5, 0x73, 0x69, 0x74, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Sites))) + if err != nil { + err = msgp.WrapError(err, "Sites") + return + } + for za0001 := range z.Sites { + err = en.WriteString(z.Sites[za0001]) + if err != nil { + err = msgp.WrapError(err, "Sites", za0001) + return + } + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *SiteReplicationAuditDetails) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(4) + var zb0001Mask uint8 /* 4 bits */ + _ = zb0001Mask + if z.SiteName == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Endpoint == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Operation == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Sites == nil { + zb0001Len-- + zb0001Mask |= 0x8 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "siteName" + o = append(o, 0xa8, 0x73, 0x69, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65) + o = msgp.AppendString(o, z.SiteName) + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "endpoint" + o = append(o, 0xa8, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74) + o = msgp.AppendString(o, z.Endpoint) + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "operation" + o = append(o, 0xa9, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) + o = msgp.AppendString(o, z.Operation) + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "sites" + o = append(o, 0xa5, 0x73, 0x69, 0x74, 0x65, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Sites))) + for za0001 := range z.Sites { + o = msgp.AppendString(o, z.Sites[za0001]) + } + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *SiteReplicationAuditDetails) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 4 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "siteName": + z.SiteName, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "SiteName") + return + } + zb0001Mask |= 0x1 + case "endpoint": + z.Endpoint, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Endpoint") + return + } + zb0001Mask |= 0x2 + case "operation": + z.Operation, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Operation") + return + } + zb0001Mask |= 0x4 + case "sites": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Sites") + return + } + if cap(z.Sites) >= int(zb0002) { + z.Sites = (z.Sites)[:zb0002] + } else { + z.Sites = make([]string, zb0002) + } + for za0001 := range z.Sites { + z.Sites[za0001], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Sites", za0001) + return + } + } + zb0001Mask |= 0x8 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0xf { + if (zb0001Mask & 0x1) == 0 { + z.SiteName = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Endpoint = "" + } + if (zb0001Mask & 0x4) == 0 { + z.Operation = "" + } + if (zb0001Mask & 0x8) == 0 { + z.Sites = nil + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *SiteReplicationAuditDetails) Msgsize() (s int) { + s = 1 + 9 + msgp.StringPrefixSize + len(z.SiteName) + 9 + msgp.StringPrefixSize + len(z.Endpoint) + 10 + msgp.StringPrefixSize + len(z.Operation) + 6 + msgp.ArrayHeaderSize + for za0001 := range z.Sites { + s += msgp.StringPrefixSize + len(z.Sites[za0001]) + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *TierAuditDetails) DecodeMsg(dc *msgp.Reader) (err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 1 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "tierName": + z.TierName, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "TierName") + return + } + case "tierType": + z.TierType, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "TierType") + return + } + zb0001Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if (zb0001Mask & 0x1) == 0 { + z.TierType = "" + } + + return +} + +// EncodeMsg implements msgp.Encodable +func (z TierAuditDetails) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(2) + var zb0001Mask uint8 /* 2 bits */ + _ = zb0001Mask + if z.TierType == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // write "tierName" + err = en.Append(0xa8, 0x74, 0x69, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteString(z.TierName) + if err != nil { + err = msgp.WrapError(err, "TierName") + return + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "tierType" + err = en.Append(0xa8, 0x74, 0x69, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65) + if err != nil { + return + } + err = en.WriteString(z.TierType) + if err != nil { + err = msgp.WrapError(err, "TierType") + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z TierAuditDetails) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(2) + var zb0001Mask uint8 /* 2 bits */ + _ = zb0001Mask + if z.TierType == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // string "tierName" + o = append(o, 0xa8, 0x74, 0x69, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65) + o = msgp.AppendString(o, z.TierName) + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "tierType" + o = append(o, 0xa8, 0x74, 0x69, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65) + o = msgp.AppendString(o, z.TierType) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *TierAuditDetails) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 1 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "tierName": + z.TierName, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "TierName") + return + } + case "tierType": + z.TierType, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "TierType") + return + } + zb0001Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if (zb0001Mask & 0x1) == 0 { + z.TierType = "" + } + + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z TierAuditDetails) Msgsize() (s int) { + s = 1 + 9 + msgp.StringPrefixSize + len(z.TierName) + 9 + msgp.StringPrefixSize + len(z.TierType) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *UserAuditDetails) DecodeMsg(dc *msgp.Reader) (err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 8 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "userName": + z.UserName, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "UserName") + return + } + case "userType": + z.UserType, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "UserType") + return + } + zb0001Mask |= 0x1 + case "field": + z.Field, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Field") + return + } + zb0001Mask |= 0x2 + case "oldValue": + z.OldValue, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "OldValue") + return + } + zb0001Mask |= 0x4 + case "newValue": + z.NewValue, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "NewValue") + return + } + zb0001Mask |= 0x8 + case "oldStatus": + z.OldStatus, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "OldStatus") + return + } + zb0001Mask |= 0x10 + case "newStatus": + z.NewStatus, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "NewStatus") + return + } + zb0001Mask |= 0x20 + case "policies": + var zb0002 uint32 + zb0002, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Policies") + return + } + if cap(z.Policies) >= int(zb0002) { + z.Policies = (z.Policies)[:zb0002] + } else { + z.Policies = make([]string, zb0002) + } + for za0001 := range z.Policies { + z.Policies[za0001], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Policies", za0001) + return + } + } + zb0001Mask |= 0x40 + case "groups": + var zb0003 uint32 + zb0003, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Groups") + return + } + if cap(z.Groups) >= int(zb0003) { + z.Groups = (z.Groups)[:zb0003] + } else { + z.Groups = make([]string, zb0003) + } + for za0002 := range z.Groups { + z.Groups[za0002], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Groups", za0002) + return + } + } + zb0001Mask |= 0x80 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0xff { + if (zb0001Mask & 0x1) == 0 { + z.UserType = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Field = "" + } + if (zb0001Mask & 0x4) == 0 { + z.OldValue = "" + } + if (zb0001Mask & 0x8) == 0 { + z.NewValue = "" + } + if (zb0001Mask & 0x10) == 0 { + z.OldStatus = "" + } + if (zb0001Mask & 0x20) == 0 { + z.NewStatus = "" + } + if (zb0001Mask & 0x40) == 0 { + z.Policies = nil + } + if (zb0001Mask & 0x80) == 0 { + z.Groups = nil + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *UserAuditDetails) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(9) + var zb0001Mask uint16 /* 9 bits */ + _ = zb0001Mask + if z.UserType == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Field == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.OldValue == "" { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.NewValue == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.OldStatus == "" { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.NewStatus == "" { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.Policies == nil { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.Groups == nil { + zb0001Len-- + zb0001Mask |= 0x100 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // write "userName" + err = en.Append(0xa8, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteString(z.UserName) + if err != nil { + err = msgp.WrapError(err, "UserName") + return + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "userType" + err = en.Append(0xa8, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65) + if err != nil { + return + } + err = en.WriteString(z.UserType) + if err != nil { + err = msgp.WrapError(err, "UserType") + return + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "field" + err = en.Append(0xa5, 0x66, 0x69, 0x65, 0x6c, 0x64) + if err != nil { + return + } + err = en.WriteString(z.Field) + if err != nil { + err = msgp.WrapError(err, "Field") + return + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "oldValue" + err = en.Append(0xa8, 0x6f, 0x6c, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65) + if err != nil { + return + } + err = en.WriteString(z.OldValue) + if err != nil { + err = msgp.WrapError(err, "OldValue") + return + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "newValue" + err = en.Append(0xa8, 0x6e, 0x65, 0x77, 0x56, 0x61, 0x6c, 0x75, 0x65) + if err != nil { + return + } + err = en.WriteString(z.NewValue) + if err != nil { + err = msgp.WrapError(err, "NewValue") + return + } + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // write "oldStatus" + err = en.Append(0xa9, 0x6f, 0x6c, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73) + if err != nil { + return + } + err = en.WriteString(z.OldStatus) + if err != nil { + err = msgp.WrapError(err, "OldStatus") + return + } + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // write "newStatus" + err = en.Append(0xa9, 0x6e, 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73) + if err != nil { + return + } + err = en.WriteString(z.NewStatus) + if err != nil { + err = msgp.WrapError(err, "NewStatus") + return + } + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // write "policies" + err = en.Append(0xa8, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Policies))) + if err != nil { + err = msgp.WrapError(err, "Policies") + return + } + for za0001 := range z.Policies { + err = en.WriteString(z.Policies[za0001]) + if err != nil { + err = msgp.WrapError(err, "Policies", za0001) + return + } + } + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // write "groups" + err = en.Append(0xa6, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Groups))) + if err != nil { + err = msgp.WrapError(err, "Groups") + return + } + for za0002 := range z.Groups { + err = en.WriteString(z.Groups[za0002]) + if err != nil { + err = msgp.WrapError(err, "Groups", za0002) + return + } + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *UserAuditDetails) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(9) + var zb0001Mask uint16 /* 9 bits */ + _ = zb0001Mask + if z.UserType == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Field == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.OldValue == "" { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.NewValue == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.OldStatus == "" { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.NewStatus == "" { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.Policies == nil { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.Groups == nil { + zb0001Len-- + zb0001Mask |= 0x100 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // string "userName" + o = append(o, 0xa8, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65) + o = msgp.AppendString(o, z.UserName) + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "userType" + o = append(o, 0xa8, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65) + o = msgp.AppendString(o, z.UserType) + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "field" + o = append(o, 0xa5, 0x66, 0x69, 0x65, 0x6c, 0x64) + o = msgp.AppendString(o, z.Field) + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "oldValue" + o = append(o, 0xa8, 0x6f, 0x6c, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65) + o = msgp.AppendString(o, z.OldValue) + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "newValue" + o = append(o, 0xa8, 0x6e, 0x65, 0x77, 0x56, 0x61, 0x6c, 0x75, 0x65) + o = msgp.AppendString(o, z.NewValue) + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // string "oldStatus" + o = append(o, 0xa9, 0x6f, 0x6c, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73) + o = msgp.AppendString(o, z.OldStatus) + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // string "newStatus" + o = append(o, 0xa9, 0x6e, 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73) + o = msgp.AppendString(o, z.NewStatus) + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // string "policies" + o = append(o, 0xa8, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Policies))) + for za0001 := range z.Policies { + o = msgp.AppendString(o, z.Policies[za0001]) + } + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // string "groups" + o = append(o, 0xa6, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Groups))) + for za0002 := range z.Groups { + o = msgp.AppendString(o, z.Groups[za0002]) + } + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *UserAuditDetails) UnmarshalMsg(bts []byte) (o []byte, err error) { + var field []byte + _ = field + var zb0001 uint32 + zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0001Mask uint8 /* 8 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "userName": + z.UserName, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "UserName") + return + } + case "userType": + z.UserType, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "UserType") + return + } + zb0001Mask |= 0x1 + case "field": + z.Field, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Field") + return + } + zb0001Mask |= 0x2 + case "oldValue": + z.OldValue, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OldValue") + return + } + zb0001Mask |= 0x4 + case "newValue": + z.NewValue, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "NewValue") + return + } + zb0001Mask |= 0x8 + case "oldStatus": + z.OldStatus, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OldStatus") + return + } + zb0001Mask |= 0x10 + case "newStatus": + z.NewStatus, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "NewStatus") + return + } + zb0001Mask |= 0x20 + case "policies": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Policies") + return + } + if cap(z.Policies) >= int(zb0002) { + z.Policies = (z.Policies)[:zb0002] + } else { + z.Policies = make([]string, zb0002) + } + for za0001 := range z.Policies { + z.Policies[za0001], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Policies", za0001) + return + } + } + zb0001Mask |= 0x40 + case "groups": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Groups") + return + } + if cap(z.Groups) >= int(zb0003) { + z.Groups = (z.Groups)[:zb0003] + } else { + z.Groups = make([]string, zb0003) + } + for za0002 := range z.Groups { + z.Groups[za0002], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Groups", za0002) + return + } + } + zb0001Mask |= 0x80 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0xff { + if (zb0001Mask & 0x1) == 0 { + z.UserType = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Field = "" + } + if (zb0001Mask & 0x4) == 0 { + z.OldValue = "" + } + if (zb0001Mask & 0x8) == 0 { + z.NewValue = "" + } + if (zb0001Mask & 0x10) == 0 { + z.OldStatus = "" + } + if (zb0001Mask & 0x20) == 0 { + z.NewStatus = "" + } + if (zb0001Mask & 0x40) == 0 { + z.Policies = nil + } + if (zb0001Mask & 0x80) == 0 { + z.Groups = nil + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *UserAuditDetails) Msgsize() (s int) { + s = 1 + 9 + msgp.StringPrefixSize + len(z.UserName) + 9 + msgp.StringPrefixSize + len(z.UserType) + 6 + msgp.StringPrefixSize + len(z.Field) + 9 + msgp.StringPrefixSize + len(z.OldValue) + 9 + msgp.StringPrefixSize + len(z.NewValue) + 10 + msgp.StringPrefixSize + len(z.OldStatus) + 10 + msgp.StringPrefixSize + len(z.NewStatus) + 9 + msgp.ArrayHeaderSize + for za0001 := range z.Policies { + s += msgp.StringPrefixSize + len(z.Policies[za0001]) + } + s += 7 + msgp.ArrayHeaderSize + for za0002 := range z.Groups { + s += msgp.StringPrefixSize + len(z.Groups[za0002]) + } return } diff --git a/log/audit_gen_test.go b/log/audit_gen_test.go index b4942db6..ddc5ad9a 100644 --- a/log/audit_gen_test.go +++ b/log/audit_gen_test.go @@ -121,3 +121,2376 @@ func BenchmarkDecodeAudit(b *testing.B) { } } } + +func TestMarshalUnmarshalAuditDetails(t *testing.T) { + v := AuditDetails{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgAuditDetails(b *testing.B) { + v := AuditDetails{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgAuditDetails(b *testing.B) { + v := AuditDetails{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalAuditDetails(b *testing.B) { + v := AuditDetails{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeAuditDetails(t *testing.T) { + v := AuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeAuditDetails Msgsize() is inaccurate") + } + + vn := AuditDetails{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeAuditDetails(b *testing.B) { + v := AuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeAuditDetails(b *testing.B) { + v := AuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalBatchAuditDetails(t *testing.T) { + v := BatchAuditDetails{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgBatchAuditDetails(b *testing.B) { + v := BatchAuditDetails{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgBatchAuditDetails(b *testing.B) { + v := BatchAuditDetails{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalBatchAuditDetails(b *testing.B) { + v := BatchAuditDetails{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeBatchAuditDetails(t *testing.T) { + v := BatchAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeBatchAuditDetails Msgsize() is inaccurate") + } + + vn := BatchAuditDetails{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeBatchAuditDetails(b *testing.B) { + v := BatchAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeBatchAuditDetails(b *testing.B) { + v := BatchAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalBucketConfigAuditDetails(t *testing.T) { + v := BucketConfigAuditDetails{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgBucketConfigAuditDetails(b *testing.B) { + v := BucketConfigAuditDetails{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgBucketConfigAuditDetails(b *testing.B) { + v := BucketConfigAuditDetails{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalBucketConfigAuditDetails(b *testing.B) { + v := BucketConfigAuditDetails{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeBucketConfigAuditDetails(t *testing.T) { + v := BucketConfigAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeBucketConfigAuditDetails Msgsize() is inaccurate") + } + + vn := BucketConfigAuditDetails{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeBucketConfigAuditDetails(b *testing.B) { + v := BucketConfigAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeBucketConfigAuditDetails(b *testing.B) { + v := BucketConfigAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalBucketInventoryAuditDetails(t *testing.T) { + v := BucketInventoryAuditDetails{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgBucketInventoryAuditDetails(b *testing.B) { + v := BucketInventoryAuditDetails{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgBucketInventoryAuditDetails(b *testing.B) { + v := BucketInventoryAuditDetails{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalBucketInventoryAuditDetails(b *testing.B) { + v := BucketInventoryAuditDetails{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeBucketInventoryAuditDetails(t *testing.T) { + v := BucketInventoryAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeBucketInventoryAuditDetails Msgsize() is inaccurate") + } + + vn := BucketInventoryAuditDetails{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeBucketInventoryAuditDetails(b *testing.B) { + v := BucketInventoryAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeBucketInventoryAuditDetails(b *testing.B) { + v := BucketInventoryAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalBucketQOSAuditDetails(t *testing.T) { + v := BucketQOSAuditDetails{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgBucketQOSAuditDetails(b *testing.B) { + v := BucketQOSAuditDetails{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgBucketQOSAuditDetails(b *testing.B) { + v := BucketQOSAuditDetails{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalBucketQOSAuditDetails(b *testing.B) { + v := BucketQOSAuditDetails{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeBucketQOSAuditDetails(t *testing.T) { + v := BucketQOSAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeBucketQOSAuditDetails Msgsize() is inaccurate") + } + + vn := BucketQOSAuditDetails{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeBucketQOSAuditDetails(b *testing.B) { + v := BucketQOSAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeBucketQOSAuditDetails(b *testing.B) { + v := BucketQOSAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalBucketQuotaAuditDetails(t *testing.T) { + v := BucketQuotaAuditDetails{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgBucketQuotaAuditDetails(b *testing.B) { + v := BucketQuotaAuditDetails{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgBucketQuotaAuditDetails(b *testing.B) { + v := BucketQuotaAuditDetails{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalBucketQuotaAuditDetails(b *testing.B) { + v := BucketQuotaAuditDetails{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeBucketQuotaAuditDetails(t *testing.T) { + v := BucketQuotaAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeBucketQuotaAuditDetails Msgsize() is inaccurate") + } + + vn := BucketQuotaAuditDetails{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeBucketQuotaAuditDetails(b *testing.B) { + v := BucketQuotaAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeBucketQuotaAuditDetails(b *testing.B) { + v := BucketQuotaAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalConfigAuditDetails(t *testing.T) { + v := ConfigAuditDetails{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgConfigAuditDetails(b *testing.B) { + v := ConfigAuditDetails{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgConfigAuditDetails(b *testing.B) { + v := ConfigAuditDetails{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalConfigAuditDetails(b *testing.B) { + v := ConfigAuditDetails{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeConfigAuditDetails(t *testing.T) { + v := ConfigAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeConfigAuditDetails Msgsize() is inaccurate") + } + + vn := ConfigAuditDetails{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeConfigAuditDetails(b *testing.B) { + v := ConfigAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeConfigAuditDetails(b *testing.B) { + v := ConfigAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalGroupAuditDetails(t *testing.T) { + v := GroupAuditDetails{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgGroupAuditDetails(b *testing.B) { + v := GroupAuditDetails{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgGroupAuditDetails(b *testing.B) { + v := GroupAuditDetails{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalGroupAuditDetails(b *testing.B) { + v := GroupAuditDetails{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeGroupAuditDetails(t *testing.T) { + v := GroupAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeGroupAuditDetails Msgsize() is inaccurate") + } + + vn := GroupAuditDetails{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeGroupAuditDetails(b *testing.B) { + v := GroupAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeGroupAuditDetails(b *testing.B) { + v := GroupAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalHealAuditDetails(t *testing.T) { + v := HealAuditDetails{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgHealAuditDetails(b *testing.B) { + v := HealAuditDetails{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgHealAuditDetails(b *testing.B) { + v := HealAuditDetails{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalHealAuditDetails(b *testing.B) { + v := HealAuditDetails{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeHealAuditDetails(t *testing.T) { + v := HealAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeHealAuditDetails Msgsize() is inaccurate") + } + + vn := HealAuditDetails{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeHealAuditDetails(b *testing.B) { + v := HealAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeHealAuditDetails(b *testing.B) { + v := HealAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalIAMImportDetails(t *testing.T) { + v := IAMImportDetails{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgIAMImportDetails(b *testing.B) { + v := IAMImportDetails{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgIAMImportDetails(b *testing.B) { + v := IAMImportDetails{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalIAMImportDetails(b *testing.B) { + v := IAMImportDetails{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeIAMImportDetails(t *testing.T) { + v := IAMImportDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeIAMImportDetails Msgsize() is inaccurate") + } + + vn := IAMImportDetails{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeIAMImportDetails(b *testing.B) { + v := IAMImportDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeIAMImportDetails(b *testing.B) { + v := IAMImportDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalIDPAuditDetails(t *testing.T) { + v := IDPAuditDetails{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgIDPAuditDetails(b *testing.B) { + v := IDPAuditDetails{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgIDPAuditDetails(b *testing.B) { + v := IDPAuditDetails{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalIDPAuditDetails(b *testing.B) { + v := IDPAuditDetails{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeIDPAuditDetails(t *testing.T) { + v := IDPAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeIDPAuditDetails Msgsize() is inaccurate") + } + + vn := IDPAuditDetails{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeIDPAuditDetails(b *testing.B) { + v := IDPAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeIDPAuditDetails(b *testing.B) { + v := IDPAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalKMSAuditDetails(t *testing.T) { + v := KMSAuditDetails{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgKMSAuditDetails(b *testing.B) { + v := KMSAuditDetails{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgKMSAuditDetails(b *testing.B) { + v := KMSAuditDetails{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalKMSAuditDetails(b *testing.B) { + v := KMSAuditDetails{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeKMSAuditDetails(t *testing.T) { + v := KMSAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeKMSAuditDetails Msgsize() is inaccurate") + } + + vn := KMSAuditDetails{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeKMSAuditDetails(b *testing.B) { + v := KMSAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeKMSAuditDetails(b *testing.B) { + v := KMSAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalPolicyAuditDetails(t *testing.T) { + v := PolicyAuditDetails{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgPolicyAuditDetails(b *testing.B) { + v := PolicyAuditDetails{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgPolicyAuditDetails(b *testing.B) { + v := PolicyAuditDetails{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalPolicyAuditDetails(b *testing.B) { + v := PolicyAuditDetails{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodePolicyAuditDetails(t *testing.T) { + v := PolicyAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodePolicyAuditDetails Msgsize() is inaccurate") + } + + vn := PolicyAuditDetails{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodePolicyAuditDetails(b *testing.B) { + v := PolicyAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodePolicyAuditDetails(b *testing.B) { + v := PolicyAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalPoolAuditDetails(t *testing.T) { + v := PoolAuditDetails{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgPoolAuditDetails(b *testing.B) { + v := PoolAuditDetails{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgPoolAuditDetails(b *testing.B) { + v := PoolAuditDetails{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalPoolAuditDetails(b *testing.B) { + v := PoolAuditDetails{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodePoolAuditDetails(t *testing.T) { + v := PoolAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodePoolAuditDetails Msgsize() is inaccurate") + } + + vn := PoolAuditDetails{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodePoolAuditDetails(b *testing.B) { + v := PoolAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodePoolAuditDetails(b *testing.B) { + v := PoolAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalQOSRuleDetail(t *testing.T) { + v := QOSRuleDetail{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgQOSRuleDetail(b *testing.B) { + v := QOSRuleDetail{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgQOSRuleDetail(b *testing.B) { + v := QOSRuleDetail{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalQOSRuleDetail(b *testing.B) { + v := QOSRuleDetail{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeQOSRuleDetail(t *testing.T) { + v := QOSRuleDetail{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeQOSRuleDetail Msgsize() is inaccurate") + } + + vn := QOSRuleDetail{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeQOSRuleDetail(b *testing.B) { + v := QOSRuleDetail{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeQOSRuleDetail(b *testing.B) { + v := QOSRuleDetail{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalRecorderAuditDetails(t *testing.T) { + v := RecorderAuditDetails{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgRecorderAuditDetails(b *testing.B) { + v := RecorderAuditDetails{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgRecorderAuditDetails(b *testing.B) { + v := RecorderAuditDetails{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalRecorderAuditDetails(b *testing.B) { + v := RecorderAuditDetails{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeRecorderAuditDetails(t *testing.T) { + v := RecorderAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeRecorderAuditDetails Msgsize() is inaccurate") + } + + vn := RecorderAuditDetails{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeRecorderAuditDetails(b *testing.B) { + v := RecorderAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeRecorderAuditDetails(b *testing.B) { + v := RecorderAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalServiceAccountAuditDetails(t *testing.T) { + v := ServiceAccountAuditDetails{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgServiceAccountAuditDetails(b *testing.B) { + v := ServiceAccountAuditDetails{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgServiceAccountAuditDetails(b *testing.B) { + v := ServiceAccountAuditDetails{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalServiceAccountAuditDetails(b *testing.B) { + v := ServiceAccountAuditDetails{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeServiceAccountAuditDetails(t *testing.T) { + v := ServiceAccountAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeServiceAccountAuditDetails Msgsize() is inaccurate") + } + + vn := ServiceAccountAuditDetails{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeServiceAccountAuditDetails(b *testing.B) { + v := ServiceAccountAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeServiceAccountAuditDetails(b *testing.B) { + v := ServiceAccountAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalServiceAuditDetails(t *testing.T) { + v := ServiceAuditDetails{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgServiceAuditDetails(b *testing.B) { + v := ServiceAuditDetails{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgServiceAuditDetails(b *testing.B) { + v := ServiceAuditDetails{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalServiceAuditDetails(b *testing.B) { + v := ServiceAuditDetails{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeServiceAuditDetails(t *testing.T) { + v := ServiceAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeServiceAuditDetails Msgsize() is inaccurate") + } + + vn := ServiceAuditDetails{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeServiceAuditDetails(b *testing.B) { + v := ServiceAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeServiceAuditDetails(b *testing.B) { + v := ServiceAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalSiteReplicationAuditDetails(t *testing.T) { + v := SiteReplicationAuditDetails{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgSiteReplicationAuditDetails(b *testing.B) { + v := SiteReplicationAuditDetails{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgSiteReplicationAuditDetails(b *testing.B) { + v := SiteReplicationAuditDetails{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalSiteReplicationAuditDetails(b *testing.B) { + v := SiteReplicationAuditDetails{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeSiteReplicationAuditDetails(t *testing.T) { + v := SiteReplicationAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeSiteReplicationAuditDetails Msgsize() is inaccurate") + } + + vn := SiteReplicationAuditDetails{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeSiteReplicationAuditDetails(b *testing.B) { + v := SiteReplicationAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeSiteReplicationAuditDetails(b *testing.B) { + v := SiteReplicationAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalTierAuditDetails(t *testing.T) { + v := TierAuditDetails{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgTierAuditDetails(b *testing.B) { + v := TierAuditDetails{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgTierAuditDetails(b *testing.B) { + v := TierAuditDetails{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalTierAuditDetails(b *testing.B) { + v := TierAuditDetails{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeTierAuditDetails(t *testing.T) { + v := TierAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeTierAuditDetails Msgsize() is inaccurate") + } + + vn := TierAuditDetails{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeTierAuditDetails(b *testing.B) { + v := TierAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeTierAuditDetails(b *testing.B) { + v := TierAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalUserAuditDetails(t *testing.T) { + v := UserAuditDetails{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgUserAuditDetails(b *testing.B) { + v := UserAuditDetails{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgUserAuditDetails(b *testing.B) { + v := UserAuditDetails{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalUserAuditDetails(b *testing.B) { + v := UserAuditDetails{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeUserAuditDetails(t *testing.T) { + v := UserAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeUserAuditDetails Msgsize() is inaccurate") + } + + vn := UserAuditDetails{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeUserAuditDetails(b *testing.B) { + v := UserAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeUserAuditDetails(b *testing.B) { + v := UserAuditDetails{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} diff --git a/net_linux.go b/net_linux.go index 3d2eb8c9..1ebf8c96 100644 --- a/net_linux.go +++ b/net_linux.go @@ -1,5 +1,4 @@ //go:build linux -// +build linux // // Copyright (c) 2015-2024 MinIO, Inc. diff --git a/net_nolinux.go b/net_nolinux.go index 18bb0948..665f3ac6 100644 --- a/net_nolinux.go +++ b/net_nolinux.go @@ -1,5 +1,4 @@ //go:build !linux -// +build !linux // // Copyright (c) 2015-2024 MinIO, Inc. diff --git a/no_fips.go b/no_fips.go index aba1a020..494d8e71 100644 --- a/no_fips.go +++ b/no_fips.go @@ -18,7 +18,6 @@ // //go:build !fips -// +build !fips package madmin From 764855253763e33a1282f20e452798aff946b79f Mon Sep 17 00:00:00 2001 From: Praveenrajmani Date: Tue, 4 Nov 2025 18:32:51 +0530 Subject: [PATCH 2/2] Move Message() and Details() to mc --- log/audit.go | 506 --------------------------------------------------- 1 file changed, 506 deletions(-) diff --git a/log/audit.go b/log/audit.go index b8c3d1bf..d2c22550 100644 --- a/log/audit.go +++ b/log/audit.go @@ -349,26 +349,6 @@ type BatchAuditDetails struct { // Redact redacts sensitive fields in BatchAuditDetails func (b *BatchAuditDetails) Redact() {} -// Message returns a human-readable message for batch audit -func (b BatchAuditDetails) Message() string { - if b.JobType != "" && b.JobID != "" { - return "Batch job '" + b.JobType + "' (" + b.JobID + ")" - } - if b.JobID != "" { - return "Batch job " + b.JobID - } - return "Batch job operation" -} - -// Details returns specific parameter changes for batch audit -func (b BatchAuditDetails) Details() string { - var parts []string - if b.User != "" { - parts = append(parts, "user:"+b.User) - } - return strings.Join(parts, " ") -} - // BucketQuotaAuditDetails captures bucket quota configuration changes. // It tracks changes to bucket storage quotas including size limits and quota type (hard/FIFO). type BucketQuotaAuditDetails struct { @@ -380,26 +360,6 @@ type BucketQuotaAuditDetails struct { // Redact redacts sensitive fields in BucketQuotaAuditDetails func (q *BucketQuotaAuditDetails) Redact() {} -// Message returns a human-readable message for bucket quota audit -func (q BucketQuotaAuditDetails) Message() string { - if q.BucketName != "" { - return "Bucket quota for '" + q.BucketName + "'" - } - return "Bucket quota modified" -} - -// Details returns specific parameter changes for bucket quota audit -func (q BucketQuotaAuditDetails) Details() string { - var parts []string - if q.QuotaSize > 0 { - parts = append(parts, fmt.Sprintf("size:%d", q.QuotaSize)) - } - if q.QuotaType != "" { - parts = append(parts, "type:"+q.QuotaType) - } - return strings.Join(parts, " ") -} - // BucketQOSAuditDetails captures bucket QoS configuration changes. // It tracks Quality of Service settings for buckets including rate limits, burst sizes, and priority rules for API operations. type BucketQOSAuditDetails struct { @@ -424,26 +384,6 @@ type QOSRuleDetail struct { // Redact redacts sensitive fields in BucketQOSAuditDetails func (q *BucketQOSAuditDetails) Redact() {} -// Message returns a human-readable message for bucket QoS audit -func (q BucketQOSAuditDetails) Message() string { - if q.BucketName != "" { - status := "disabled" - if q.Enabled { - status = "enabled" - } - return "Bucket QoS for '" + q.BucketName + "' " + status - } - return "Bucket QoS modified" -} - -// Details returns specific parameter changes for bucket QoS audit -func (q BucketQOSAuditDetails) Details() string { - if len(q.Rules) > 0 { - return fmt.Sprintf("rules:%d", len(q.Rules)) - } - return "" -} - // BucketInventoryAuditDetails captures bucket inventory configuration changes. // It tracks bucket inventory report settings including destination bucket, schedule, and inventory configuration IDs. type BucketInventoryAuditDetails struct { @@ -456,29 +396,6 @@ type BucketInventoryAuditDetails struct { // Redact redacts sensitive fields in BucketInventoryAuditDetails func (i *BucketInventoryAuditDetails) Redact() {} -// Message returns a human-readable message for bucket inventory audit -func (i BucketInventoryAuditDetails) Message() string { - if i.BucketName != "" && i.InventoryID != "" { - return "Bucket inventory '" + i.InventoryID + "' for '" + i.BucketName + "'" - } - if i.BucketName != "" { - return "Bucket inventory for '" + i.BucketName + "'" - } - return "Bucket inventory modified" -} - -// Details returns specific parameter changes for bucket inventory audit -func (i BucketInventoryAuditDetails) Details() string { - var parts []string - if i.DestinationBucket != "" { - parts = append(parts, "dest:"+i.DestinationBucket) - } - if i.Schedule != "" { - parts = append(parts, "schedule:"+i.Schedule) - } - return strings.Join(parts, " ") -} - // TierAuditDetails captures tier configuration changes. // It tracks remote tier configurations for lifecycle transitions including S3, Azure, GCS, and MinIO tiers. type TierAuditDetails struct { @@ -489,430 +406,7 @@ type TierAuditDetails struct { // Redact redacts sensitive fields in TierAuditDetails func (t *TierAuditDetails) Redact() {} -// Message returns a human-readable message for tier audit -func (t TierAuditDetails) Message() string { - if t.TierName != "" && t.TierType != "" { - return "Tier '" + t.TierName + "' (" + t.TierType + ")" - } - if t.TierName != "" { - return "Tier '" + t.TierName + "'" - } - return "Tier configuration modified" -} - -// Details returns specific parameter changes for tier audit -func (t TierAuditDetails) Details() string { - return "" -} - // String returns a simple string representation for Audit (required by eos LogEntry interface) func (a Audit) String() string { return fmt.Sprintf("audit: category=%s action=%s api=%s", a.Category, a.Action, a.APIName) } - -// Message returns a short summary of the config mutation -func (c ConfigAuditDetails) Message() string { - if c.SubSystem == "" { - return "Configuration changed" - } - subsys := c.SubSystem - if len(subsys) > 0 { - subsys = strings.ToUpper(subsys[:1]) + subsys[1:] - } - if c.Target != "" { - return subsys + " target '" + c.Target + "' configuration changed" - } - return subsys + " configuration changed" -} - -// Details returns specific parameter changes for config audit -func (c ConfigAuditDetails) Details() string { - var parts []string - if c.Key != "" { - parts = append(parts, c.Key) - } - if c.OldValue != "" && c.NewValue != "" { - parts = append(parts, truncate(c.OldValue, 20)+" → "+truncate(c.NewValue, 20)) - } else if c.NewValue != "" { - parts = append(parts, "→ "+truncate(c.NewValue, 20)) - } - return strings.Join(parts, " ") -} - -// Message returns a short summary of the user mutation -func (u UserAuditDetails) Message() string { - if u.UserName == "" { - return "User modified" - } - userType := "" - if u.UserType != "" { - userType = " (" + u.UserType + ")" - } - if u.Field != "" { - return "User '" + u.UserName + "'" + userType + " " + u.Field + " changed" - } - if u.OldStatus != u.NewStatus && u.NewStatus != "" { - return "User '" + u.UserName + "'" + userType + " status changed to " + u.NewStatus - } - return "User '" + u.UserName + "'" + userType + " modified" -} - -// Details returns specific parameter changes for user audit -func (u UserAuditDetails) Details() string { - var parts []string - if u.OldValue != "" && u.NewValue != "" { - parts = append(parts, truncate(u.OldValue, 15)+" → "+truncate(u.NewValue, 15)) - } else if u.NewValue != "" { - parts = append(parts, "→ "+truncate(u.NewValue, 15)) - } - if u.OldStatus != "" && u.NewStatus != "" { - parts = append(parts, u.OldStatus+" → "+u.NewStatus) - } else if u.NewStatus != "" { - parts = append(parts, "→ "+u.NewStatus) - } - if len(u.Policies) > 0 { - parts = append(parts, "$"+strings.Join(u.Policies, ",")) - } - if len(u.Groups) > 0 { - parts = append(parts, "@"+strings.Join(u.Groups, ",")) - } - return strings.Join(parts, " ") -} - -// Message returns a short summary of the service account mutation -func (s ServiceAccountAuditDetails) Message() string { - if s.AccountName == "" { - return "Service account modified" - } - if s.ParentUser != "" { - return "Service account '" + s.AccountName + "' (parent: " + s.ParentUser + ") modified" - } - return "Service account '" + s.AccountName + "' modified" -} - -// Details returns specific parameter changes for service account audit -func (s ServiceAccountAuditDetails) Details() string { - var parts []string - if s.UpdatedStatus != "" { - parts = append(parts, "→ "+s.UpdatedStatus) - } - if s.UpdatedPolicy && len(s.Policies) > 0 { - parts = append(parts, "$"+strings.Join(s.Policies, ",")) - } - if s.UpdatedExpiry && !s.Expiration.IsZero() { - parts = append(parts, "⏱ "+s.Expiration.Format("2006-01-02")) - } - if s.UpdatedSecretKey { - parts = append(parts, "🔑") - } - return strings.Join(parts, " ") -} - -// Message returns a short summary of the policy mutation -func (p PolicyAuditDetails) Message() string { - if p.PolicyName == "" { - return "Policy modified" - } - if p.Operation != "" { - if p.User != "" { - return "Policy " + p.Operation + " for user '" + p.User + "'" - } - if p.Group != "" { - return "Policy " + p.Operation + " for group '" + p.Group + "'" - } - return "Policy '" + p.PolicyName + "' " + p.Operation - } - return "Policy '" + p.PolicyName + "' modified" -} - -// Details returns specific parameter changes for policy audit -func (p PolicyAuditDetails) Details() string { - var parts []string - if p.User != "" { - parts = append(parts, "@"+p.User) - } - if p.Group != "" { - parts = append(parts, "@@"+p.Group) - } - if len(p.PoliciesAttached) > 0 { - parts = append(parts, "+"+strings.Join(p.PoliciesAttached, ",")) - } - if len(p.PoliciesDetached) > 0 { - parts = append(parts, "-"+strings.Join(p.PoliciesDetached, ",")) - } - if p.OldPolicy != "" && p.NewPolicy != "" { - parts = append(parts, "{...} → {...}") - } else if p.NewPolicy != "" { - parts = append(parts, "→ {...}") - } - return strings.Join(parts, " ") -} - -// Message returns a short summary of the group mutation -func (g GroupAuditDetails) Message() string { - if g.GroupName == "" { - return "Group modified" - } - if len(g.MembersAdded) > 0 { - return "Group '" + g.GroupName + "' members added" - } - if len(g.MembersRemoved) > 0 { - return "Group '" + g.GroupName + "' members removed" - } - if g.OldStatus != g.NewStatus && g.NewStatus != "" { - return "Group '" + g.GroupName + "' status changed to " + g.NewStatus - } - return "Group '" + g.GroupName + "' modified" -} - -// Details returns specific parameter changes for group audit -func (g GroupAuditDetails) Details() string { - var parts []string - if len(g.MembersAdded) > 0 { - parts = append(parts, "+"+strings.Join(g.MembersAdded, ",")) - } - if len(g.MembersRemoved) > 0 { - parts = append(parts, "-"+strings.Join(g.MembersRemoved, ",")) - } - if g.OldStatus != "" && g.NewStatus != "" { - parts = append(parts, g.OldStatus+" → "+g.NewStatus) - } else if g.NewStatus != "" { - parts = append(parts, "→ "+g.NewStatus) - } - return strings.Join(parts, " ") -} - -// Message returns a short summary of the bucket config mutation -func (b BucketConfigAuditDetails) Message() string { - if b.BucketName == "" { - return "Bucket configuration changed" - } - if b.ConfigType != "" { - return "Bucket '" + b.BucketName + "' " + b.ConfigType + " configuration changed" - } - return "Bucket '" + b.BucketName + "' configuration changed" -} - -// Details returns specific parameter changes for bucket config audit -func (b BucketConfigAuditDetails) Details() string { - var parts []string - if b.TargetBucket != "" { - parts = append(parts, "→ "+b.TargetBucket) - } - if len(b.TagKeys) > 0 { - parts = append(parts, "#"+strings.Join(b.TagKeys, ",")) - } else if b.TagCount > 0 { - parts = append(parts, fmt.Sprintf("#%d", b.TagCount)) - } - if b.OldConfig != "" && b.NewConfig != "" { - parts = append(parts, truncate(b.OldConfig, 20)+" → "+truncate(b.NewConfig, 20)) - } else if b.NewConfig != "" { - parts = append(parts, "→ "+truncate(b.NewConfig, 20)) - } - return strings.Join(parts, " ") -} - -// Message returns a short summary of the service operation -func (s ServiceAuditDetails) Message() string { - prefix := "" - if s.Legacy { - prefix = "[legacy] " - } - if s.ServiceName != "" && s.Operation != "" { - return prefix + "Service '" + s.ServiceName + "' " + s.Operation - } - if s.Operation == "iam-import" && s.IAMImport != nil { - return prefix + "IAM import completed" - } - if s.Operation != "" { - return prefix + "Service " + s.Operation - } - return prefix + "Service operation performed" -} - -// Details returns specific parameter changes for service audit -func (s ServiceAuditDetails) Details() string { - var parts []string - if s.Legacy { - parts = append(parts, "⚠legacy") - } - if s.Status != "" { - parts = append(parts, s.Status) - } - if s.IAMImport != nil { - if s.IAMImport.UsersAdded > 0 { - parts = append(parts, fmt.Sprintf("@+%d", s.IAMImport.UsersAdded)) - } - if s.IAMImport.PoliciesAdded > 0 { - parts = append(parts, fmt.Sprintf("$+%d", s.IAMImport.PoliciesAdded)) - } - if s.IAMImport.GroupsAdded > 0 { - parts = append(parts, fmt.Sprintf("@@+%d", s.IAMImport.GroupsAdded)) - } - if s.IAMImport.SvcAcctsAdded > 0 { - parts = append(parts, fmt.Sprintf("svc+%d", s.IAMImport.SvcAcctsAdded)) - } - if s.IAMImport.UsersRemoved > 0 { - parts = append(parts, fmt.Sprintf("@-%d", s.IAMImport.UsersRemoved)) - } - if s.IAMImport.PoliciesRemoved > 0 { - parts = append(parts, fmt.Sprintf("$-%d", s.IAMImport.PoliciesRemoved)) - } - if s.IAMImport.GroupsRemoved > 0 { - parts = append(parts, fmt.Sprintf("@@-%d", s.IAMImport.GroupsRemoved)) - } - if s.IAMImport.SvcAcctsRemoved > 0 { - parts = append(parts, fmt.Sprintf("svc-%d", s.IAMImport.SvcAcctsRemoved)) - } - } - return strings.Join(parts, " ") -} - -// Message returns a short summary of the KMS operation -func (k KMSAuditDetails) Message() string { - if k.KeyID != "" && k.Operation != "" { - return "KMS key '" + k.KeyID + "' " + k.Operation - } - if k.Operation != "" { - return "KMS " + k.Operation - } - return "KMS operation performed" -} - -// Details returns specific parameter changes for KMS audit -func (k KMSAuditDetails) Details() string { - if k.KeyID != "" { - return truncate(k.KeyID, 30) - } - return "" -} - -// Message returns a short summary of the pool operation -func (p PoolAuditDetails) Message() string { - if p.Operation != "" { - return "Pool " + fmt.Sprintf("%d", p.PoolIndex) + " " + p.Operation - } - return "Pool " + fmt.Sprintf("%d", p.PoolIndex) + " modified" -} - -// Details returns specific parameter changes for pool audit -func (p PoolAuditDetails) Details() string { - if len(p.Endpoints) > 0 { - return fmt.Sprintf("⊙×%d", len(p.Endpoints)) - } - return "" -} - -// Message returns a short summary of the site replication operation -func (s SiteReplicationAuditDetails) Message() string { - if s.SiteName != "" && s.Operation != "" { - return "Site '" + s.SiteName + "' " + s.Operation - } - if s.Operation != "" { - return "Site replication " + s.Operation - } - return "Site replication operation performed" -} - -// Details returns specific parameter changes for site replication audit -func (s SiteReplicationAuditDetails) Details() string { - var parts []string - if s.Endpoint != "" { - parts = append(parts, truncate(s.Endpoint, 30)) - } - if len(s.Sites) > 0 { - parts = append(parts, fmt.Sprintf("⇄×%d", len(s.Sites))) - } - return strings.Join(parts, " ") -} - -// Message returns a short summary of the IDP configuration change -func (i IDPAuditDetails) Message() string { - if i.IDPName != "" && i.IDPType != "" { - return "IDP '" + i.IDPName + "' (" + i.IDPType + ") configuration changed" - } - if i.IDPName != "" { - return "IDP '" + i.IDPName + "' configuration changed" - } - return "IDP configuration changed" -} - -// Details returns specific parameter changes for IDP audit -func (i IDPAuditDetails) Details() string { - var parts []string - if i.ConfigKey != "" { - parts = append(parts, i.ConfigKey) - } - if i.OldValue != "" && i.NewValue != "" { - parts = append(parts, truncate(i.OldValue, 15)+" → "+truncate(i.NewValue, 15)) - } else if i.NewValue != "" { - parts = append(parts, "→ "+truncate(i.NewValue, 15)) - } - return strings.Join(parts, " ") -} - -// Message returns a short summary of the log recorder configuration change -func (r RecorderAuditDetails) Message() string { - if r.LogType != "" { - if r.OldEnabled != r.NewEnabled { - if r.NewEnabled { - return "Log recorder '" + r.LogType + "' enabled" - } - return "Log recorder '" + r.LogType + "' disabled" - } - return "Log recorder '" + r.LogType + "' configuration changed" - } - return "Log recorder configuration changed" -} - -// Details returns specific parameter changes for log recorder audit -func (r RecorderAuditDetails) Details() string { - var parts []string - if r.OldLimit != r.NewLimit && r.NewLimit != "" { - parts = append(parts, "↕"+r.NewLimit) - } - if r.OldFlushCount != r.NewFlushCount { - parts = append(parts, fmt.Sprintf("⊕%d", r.NewFlushCount)) - } - if r.OldFlushInterval != r.NewFlushInterval && r.NewFlushInterval != "" { - parts = append(parts, "⏲"+r.NewFlushInterval) - } - return strings.Join(parts, " ") -} - -// Message returns a short summary of the heal operation -func (h HealAuditDetails) Message() string { - if h.Bucket != "" && h.Prefix != "" { - return "Heal bucket '" + h.Bucket + "' prefix '" + h.Prefix + "'" - } - if h.Bucket != "" { - return "Heal bucket '" + h.Bucket + "'" - } - if h.Operation != "" { - return "Heal " + h.Operation - } - return "Heal operation performed" -} - -// Details returns specific parameter changes for heal audit -func (h HealAuditDetails) Details() string { - var parts []string - if h.Bucket != "" { - parts = append(parts, "♦"+h.Bucket) - } - if h.Prefix != "" { - parts = append(parts, truncate(h.Prefix, 30)) - } - return strings.Join(parts, " ") -} - -// truncate truncates a string to a maximum length, adding "..." if truncated -func truncate(s string, maxLen int) string { - if len(s) <= maxLen { - return s - } - if maxLen <= 3 { - return "..." - } - return s[:maxLen-3] + "..." -}