diff --git a/go.mod b/go.mod
index d729306db7..d6a2f2d76c 100644
--- a/go.mod
+++ b/go.mod
@@ -5,8 +5,8 @@ go 1.24.6
godebug default=go1.24.6
require (
- github.com/Azure/azure-sdk-for-go/sdk/azcore v1.19.0
- github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.11.0
+ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0
+ github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6 v6.4.0
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6 v6.2.0
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns v1.3.0
@@ -15,35 +15,35 @@ require (
github.com/fsnotify/fsnotify v1.9.0
github.com/go-logr/logr v1.4.3
github.com/google/uuid v1.6.0
- github.com/prometheus/client_golang v1.23.0
- github.com/samber/lo v1.51.0
- github.com/spf13/cobra v1.9.1
- github.com/spf13/pflag v1.0.7
+ github.com/prometheus/client_golang v1.23.2
+ github.com/samber/lo v1.52.0
+ github.com/spf13/cobra v1.10.1
+ github.com/spf13/pflag v1.0.9
github.com/stretchr/testify v1.11.1
- go.opentelemetry.io/otel v1.37.0
- go.opentelemetry.io/otel/exporters/prometheus v0.59.1
- go.opentelemetry.io/otel/metric v1.37.0
- go.opentelemetry.io/otel/sdk v1.37.0
- go.opentelemetry.io/otel/sdk/metric v1.37.0
- go.opentelemetry.io/otel/trace v1.37.0
+ go.opentelemetry.io/otel v1.38.0
+ go.opentelemetry.io/otel/exporters/prometheus v0.60.0
+ go.opentelemetry.io/otel/metric v1.38.0
+ go.opentelemetry.io/otel/sdk v1.38.0
+ go.opentelemetry.io/otel/sdk/metric v1.38.0
+ go.opentelemetry.io/otel/trace v1.38.0
go.uber.org/mock v0.6.0
- golang.org/x/sync v0.16.0
- golang.org/x/sys v0.35.0
- golang.org/x/text v0.28.0
- k8s.io/api v0.34.0
- k8s.io/apimachinery v0.34.0
- k8s.io/apiserver v0.34.0
- k8s.io/client-go v0.34.0
- k8s.io/cloud-provider v0.34.0
- k8s.io/component-base v0.34.0
- k8s.io/component-helpers v0.34.0
- k8s.io/controller-manager v0.34.0
+ golang.org/x/sync v0.18.0
+ golang.org/x/sys v0.38.0
+ golang.org/x/text v0.31.0
+ k8s.io/api v0.34.2
+ k8s.io/apimachinery v0.34.2
+ k8s.io/apiserver v0.34.2
+ k8s.io/client-go v0.34.2
+ k8s.io/cloud-provider v0.34.2
+ k8s.io/component-base v0.34.2
+ k8s.io/component-helpers v0.34.2
+ k8s.io/controller-manager v0.34.2
k8s.io/klog/v2 v2.130.1
- k8s.io/kubelet v0.34.0
+ k8s.io/kubelet v0.34.2
k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d
- sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.9.2
- sigs.k8s.io/cloud-provider-azure/pkg/azclient/cache v0.8.3
- sigs.k8s.io/cloud-provider-azure/pkg/azclient/configloader v0.8.4
+ sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.11.0
+ sigs.k8s.io/cloud-provider-azure/pkg/azclient/cache v0.9.1
+ sigs.k8s.io/cloud-provider-azure/pkg/azclient/configloader v0.10.3
sigs.k8s.io/yaml v1.6.0
)
@@ -56,11 +56,12 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.5.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/msi/armmsi v1.3.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 // indirect
+ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2 v2.0.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.4.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
github.com/Azure/msi-dataplane v0.4.3 // indirect
- github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect
+ github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
@@ -99,8 +100,8 @@ require (
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
- github.com/prometheus/common v0.65.0 // indirect
- github.com/prometheus/otlptranslator v0.0.0-20250717125610-8549f4ab4f8f // indirect
+ github.com/prometheus/common v0.66.1 // indirect
+ github.com/prometheus/otlptranslator v0.0.2 // indirect
github.com/prometheus/procfs v0.17.0 // indirect
github.com/stoewer/go-strcase v1.3.1 // indirect
github.com/x448/float16 v0.8.4 // indirect
@@ -117,12 +118,12 @@ require (
go.uber.org/zap v1.27.0 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
- golang.org/x/crypto v0.41.0 // indirect
+ golang.org/x/crypto v0.45.0 // indirect
golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b // indirect
- golang.org/x/net v0.43.0 // indirect
+ golang.org/x/net v0.47.0 // indirect
golang.org/x/oauth2 v0.30.0 // indirect
- golang.org/x/term v0.34.0 // indirect
- golang.org/x/time v0.12.0 // indirect
+ golang.org/x/term v0.37.0 // indirect
+ golang.org/x/time v0.14.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250826171959-ef028d996bc1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250826171959-ef028d996bc1 // indirect
google.golang.org/grpc v1.75.0 // indirect
@@ -131,7 +132,7 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
- k8s.io/kms v0.34.0 // indirect
+ k8s.io/kms v0.34.2 // indirect
k8s.io/kube-openapi v0.0.0-20250814151709-d7b6acb124c3 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.33.0 // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
diff --git a/go.sum b/go.sum
index af340348e4..a4e5de3867 100644
--- a/go.sum
+++ b/go.sum
@@ -1,9 +1,9 @@
cel.dev/expr v0.24.0 h1:56OvJKSH3hDGL0ml5uSxZmz3/3Pq4tJ+fb1unVLAFcY=
cel.dev/expr v0.24.0/go.mod h1:hLPLo1W4QUmuYdA72RBX06QTs6MXw941piREPl3Yfiw=
-github.com/Azure/azure-sdk-for-go/sdk/azcore v1.19.0 h1:ci6Yd6nysBRLEodoziB6ah1+YOzZbZk+NYneoA6q+6E=
-github.com/Azure/azure-sdk-for-go/sdk/azcore v1.19.0/go.mod h1:QyVsSSN64v5TGltphKLQ2sQxe4OBQg0J1eKRcVBnfgE=
-github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.11.0 h1:MhRfI58HblXzCtWEZCO0feHs8LweePB3s90r7WaR1KU=
-github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.11.0/go.mod h1:okZ+ZURbArNdlJ+ptXoyHNuOETzOl1Oww19rm8I2WLA=
+github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 h1:JXg2dwJUmPB9JmtVmdEB16APJ7jurfbY5jnfXpJoRMc=
+github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0/go.mod h1:YD5h/ldMsG0XiIw7PdyNhLxaM317eFh5yNLccNfGdyw=
+github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 h1:Hk5QBxZQC1jb2Fwj6mpzme37xbCDdNTxU7O9eb5+LB4=
+github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1/go.mod h1:IYus9qsFobWIc2YVwe/WPjcnyCkPKtnHAqUYeebc8z0=
github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY=
github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 h1:9iefClla7iYpfYWdzPCRDozdmndjTm8DXdpCzPajMgA=
@@ -36,6 +36,8 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0/go.mod h1:5kakwfW5CjC9KK+Q4wjXAg+ShuIm2mBMua0ZFj2C8PE=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.1 h1:/Zt+cDPnpC3OVDm/JKLOs7M2DKmLRIIp3XIx9pHHiig=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.1/go.mod h1:Ng3urmn6dYe8gnbCMoHHVl5APYz2txho3koEkV2o2HA=
+github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2 v2.0.0 h1:+vh02EiRx2UmL9NDoA36U18Bgwl9luxs6ia0GAI9Rzg=
+github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2 v2.0.0/go.mod h1:iKOtU3WyuNvNc4L1Z4IxHaoO0dGq5tg+uhLix/KRmzE=
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.4.0 h1:/g8S6wk65vfC6m3FIxJ+i5QDyN9JWwXI8Hb0Img10hU=
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.4.0/go.mod h1:gpl+q95AzZlKVI3xSoseF9QPrypk0hQqBiJYeB/cR/I=
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0 h1:nCYfgcSyHZXJI8J0IWE5MsCGlb2xp9fJiXyxWgmOFg4=
@@ -46,8 +48,8 @@ github.com/Azure/msi-dataplane v0.4.3 h1:dWPWzY4b54tLIR9T1Q014Xxd/1DxOsMIp6EjRFA
github.com/Azure/msi-dataplane v0.4.3/go.mod h1:yAfxdJyvcnvSDfSyOFV9qm4fReEQDl+nZLGeH2ZWSmw=
github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM=
github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE=
-github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 h1:oygO0locgZJe7PpYPXT5A29ZkwJaPqcva7BVeemZOZs=
-github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
+github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 h1:XRzhVemXdgvJqCH0sFfrBUTnUJSBrBf7++ypk+twtRs=
+github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0/go.mod h1:HKpQxkWaGLJ+D/5H8QRpyQXA1eKjxkFlOMwck5+33Jk=
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
@@ -85,8 +87,8 @@ github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM=
github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
-github.com/go-faker/faker/v4 v4.6.1 h1:xUyVpAjEtB04l6XFY0V/29oR332rOSPWV4lU8RwDt4k=
-github.com/go-faker/faker/v4 v4.6.1/go.mod h1:arSdxNCSt7mOhdk8tEolvHeIJ7eX4OX80wXjKKvkKBY=
+github.com/go-faker/faker/v4 v4.7.0 h1:VboC02cXHl/NuQh5lM2W8b87yp4iFXIu59x4w0RZi4E=
+github.com/go-faker/faker/v4 v4.7.0/go.mod h1:u1dIRP5neLB6kTzgyVjdBOV5R1uP7BdxkcWk7tiKQXk=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
@@ -165,39 +167,38 @@ github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFd
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
-github.com/onsi/ginkgo/v2 v2.25.1 h1:Fwp6crTREKM+oA6Cz4MsO8RhKQzs2/gOIVOUscMAfZY=
-github.com/onsi/ginkgo/v2 v2.25.1/go.mod h1:ppTWQ1dh9KM/F1XgpeRqelR+zHVwV81DGRSDnFxK7Sk=
-github.com/onsi/gomega v1.38.1 h1:FaLA8GlcpXDwsb7m0h2A9ew2aTk3vnZMlzFgg5tz/pk=
-github.com/onsi/gomega v1.38.1/go.mod h1:LfcV8wZLvwcYRwPiJysphKAEsmcFnLMK/9c+PjvlX8g=
+github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns=
+github.com/onsi/ginkgo/v2 v2.27.2/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
+github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A=
+github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v1.23.0 h1:ust4zpdl9r4trLY/gSjlm07PuiBq2ynaXXlptpfy8Uc=
-github.com/prometheus/client_golang v1.23.0/go.mod h1:i/o0R9ByOnHX0McrTMTyhYvKE4haaf2mW08I+jGAjEE=
+github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
+github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
-github.com/prometheus/common v0.65.0 h1:QDwzd+G1twt//Kwj/Ww6E9FQq1iVMmODnILtW1t2VzE=
-github.com/prometheus/common v0.65.0/go.mod h1:0gZns+BLRQ3V6NdaerOhMbwwRbNh9hkGINtQAsP5GS8=
-github.com/prometheus/otlptranslator v0.0.0-20250717125610-8549f4ab4f8f h1:QQB6SuvGZjK8kdc2YaLJpYhV8fxauOsjE6jgcL6YJ8Q=
-github.com/prometheus/otlptranslator v0.0.0-20250717125610-8549f4ab4f8f/go.mod h1:P8AwMgdD7XEr6QRUJ2QWLpiAZTgTE2UYgjlu3svompI=
+github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9ZoGs=
+github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA=
+github.com/prometheus/otlptranslator v0.0.2 h1:+1CdeLVrRQ6Psmhnobldo0kTp96Rj80DRXRd5OSnMEQ=
+github.com/prometheus/otlptranslator v0.0.2/go.mod h1:P8AwMgdD7XEr6QRUJ2QWLpiAZTgTE2UYgjlu3svompI=
github.com/prometheus/procfs v0.17.0 h1:FuLQ+05u4ZI+SS/w9+BWEM2TXiHKsUQ9TADiRH7DuK0=
github.com/prometheus/procfs v0.17.0/go.mod h1:oPQLaDAMRbA+u8H5Pbfq+dl3VDAvHxMUOVhe0wYB2zw=
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
-github.com/samber/lo v1.51.0 h1:kysRYLbHy/MB7kQZf5DSN50JHmMsNEdeY24VzJFu7wI=
-github.com/samber/lo v1.51.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0=
+github.com/samber/lo v1.52.0 h1:Rvi+3BFHES3A8meP33VPAxiBZX/Aws5RxrschYGjomw=
+github.com/samber/lo v1.52.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js=
github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0=
-github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
-github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
-github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
-github.com/spf13/pflag v1.0.7 h1:vN6T9TfwStFPFM5XzjsvmzZkLuaLX+HS+0SeFLRgU6M=
-github.com/spf13/pflag v1.0.7/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
+github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=
+github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=
+github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY=
+github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stoewer/go-strcase v1.3.1 h1:iS0MdW+kVTxgMoE1LAZyMiYJFKlOzLooE4MxjirtkAs=
github.com/stoewer/go-strcase v1.3.1/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
@@ -239,26 +240,24 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.6
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.62.0/go.mod h1:ru6KHrNtNHxM4nD/vd6QrLVWgKhxPYgblq4VAtNawTQ=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 h1:Hf9xI/XLML9ElpiHVDNwvqI0hIFlzV8dgIr35kV1kRU=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0/go.mod h1:NfchwuyNoMcZ5MLHwPrODwUF1HWCXWrL31s8gSAdIKY=
-go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ=
-go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I=
+go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=
+go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.37.0 h1:Ahq7pZmv87yiyn3jeFz/LekZmPLLdKejuO3NcK9MssM=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.37.0/go.mod h1:MJTqhM0im3mRLw1i8uGHnCvUEeS7VwRyxlLC78PA18M=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.37.0 h1:EtFWSnwW9hGObjkIdmlnWSydO+Qs8OwzfzXLUPg4xOc=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.37.0/go.mod h1:QjUEoiGCPkvFZ/MjK6ZZfNOS6mfVEVKYE99dFhuN2LI=
-go.opentelemetry.io/otel/exporters/prometheus v0.59.1 h1:HcpSkTkJbggT8bjYP+BjyqPWlD17BH9C5CYNKeDzmcA=
-go.opentelemetry.io/otel/exporters/prometheus v0.59.1/go.mod h1:0FJL+gjuUoM07xzik3KPBaN+nz/CoB15kV6WLMiXZag=
-go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE=
-go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E=
-go.opentelemetry.io/otel/sdk v1.37.0 h1:ItB0QUqnjesGRvNcmAcU0LyvkVyGJ2xftD29bWdDvKI=
-go.opentelemetry.io/otel/sdk v1.37.0/go.mod h1:VredYzxUvuo2q3WRcDnKDjbdvmO0sCzOvVAiY+yUkAg=
-go.opentelemetry.io/otel/sdk/metric v1.37.0 h1:90lI228XrB9jCMuSdA0673aubgRobVZFhbjxHHspCPc=
-go.opentelemetry.io/otel/sdk/metric v1.37.0/go.mod h1:cNen4ZWfiD37l5NhS+Keb5RXVWZWpRE+9WyVCpbo5ps=
-go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4=
-go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0=
+go.opentelemetry.io/otel/exporters/prometheus v0.60.0 h1:cGtQxGvZbnrWdC2GyjZi0PDKVSLWP/Jocix3QWfXtbo=
+go.opentelemetry.io/otel/exporters/prometheus v0.60.0/go.mod h1:hkd1EekxNo69PTV4OWFGZcKQiIqg0RfuWExcPKFvepk=
+go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=
+go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI=
+go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=
+go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg=
+go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=
+go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA=
+go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=
+go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs=
go.opentelemetry.io/proto/otlp v1.7.1 h1:gTOMpGDb0WTBOP8JaO72iL3auEZhVmAQg4ipjOVAtj4=
go.opentelemetry.io/proto/otlp v1.7.1/go.mod h1:b2rVh6rfI/s2pHWNlB7ILJcRALpcNDzKhACevjI+ZnE=
-go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
-go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y=
@@ -274,46 +273,48 @@ go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4=
-golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
+golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q=
+golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4=
golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b h1:DXr+pvt3nC887026GRP39Ej11UATqWDmWuS99x26cD0=
golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b/go.mod h1:4QTo5u+SEIbbKW1RacMZq1YEfOBqeXa19JeshGi+zc4=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA=
+golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE=
-golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg=
+golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
+golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI=
golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
-golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
+golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
+golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
-golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
-golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4=
-golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw=
+golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
+golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
+golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU=
+golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
-golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
-golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=
-golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
+golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
+golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
+golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
+golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg=
-golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s=
+golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ=
+golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -342,40 +343,40 @@ gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYs
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-k8s.io/api v0.34.0 h1:L+JtP2wDbEYPUeNGbeSa/5GwFtIA662EmT2YSLOkAVE=
-k8s.io/api v0.34.0/go.mod h1:YzgkIzOOlhl9uwWCZNqpw6RJy9L2FK4dlJeayUoydug=
-k8s.io/apimachinery v0.34.0 h1:eR1WO5fo0HyoQZt1wdISpFDffnWOvFLOOeJ7MgIv4z0=
-k8s.io/apimachinery v0.34.0/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw=
-k8s.io/apiserver v0.34.0 h1:Z51fw1iGMqN7uJ1kEaynf2Aec1Y774PqU+FVWCFV3Jg=
-k8s.io/apiserver v0.34.0/go.mod h1:52ti5YhxAvewmmpVRqlASvaqxt0gKJxvCeW7ZrwgazQ=
-k8s.io/client-go v0.34.0 h1:YoWv5r7bsBfb0Hs2jh8SOvFbKzzxyNo0nSb0zC19KZo=
-k8s.io/client-go v0.34.0/go.mod h1:ozgMnEKXkRjeMvBZdV1AijMHLTh3pbACPvK7zFR+QQY=
-k8s.io/cloud-provider v0.34.0 h1:OgrNE+WSgfvDBQf6WS9qFM7Xr37bc0Og5kkL4hyWDmU=
-k8s.io/cloud-provider v0.34.0/go.mod h1:JbMa0t6JIGDMLI7Py6bdp9TN6cfuHrWGq+E/X+Ljkmo=
-k8s.io/component-base v0.34.0 h1:bS8Ua3zlJzapklsB1dZgjEJuJEeHjj8yTu1gxE2zQX8=
-k8s.io/component-base v0.34.0/go.mod h1:RSCqUdvIjjrEm81epPcjQ/DS+49fADvGSCkIP3IC6vg=
-k8s.io/component-helpers v0.34.0 h1:5T7P9XGMoUy1JDNKzHf0p/upYbeUf8ZaSf9jbx0QlIo=
-k8s.io/component-helpers v0.34.0/go.mod h1:kaOyl5tdtnymriYcVZg4uwDBe2d1wlIpXyDkt6sVnt4=
-k8s.io/controller-manager v0.34.0 h1:oCHoqS8dcFp7zDSu7HUvTpakq3isSxil3GprGGlJMsE=
-k8s.io/controller-manager v0.34.0/go.mod h1:XFto21U+Mm9BT8r/Jd5E4tHCGtwjKAUFOuDcqaj2VK0=
+k8s.io/api v0.34.2 h1:fsSUNZhV+bnL6Aqrp6O7lMTy6o5x2C4XLjnh//8SLYY=
+k8s.io/api v0.34.2/go.mod h1:MMBPaWlED2a8w4RSeanD76f7opUoypY8TFYkSM+3XHw=
+k8s.io/apimachinery v0.34.2 h1:zQ12Uk3eMHPxrsbUJgNF8bTauTVR2WgqJsTmwTE/NW4=
+k8s.io/apimachinery v0.34.2/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw=
+k8s.io/apiserver v0.34.2 h1:2/yu8suwkmES7IzwlehAovo8dDE07cFRC7KMDb1+MAE=
+k8s.io/apiserver v0.34.2/go.mod h1:gqJQy2yDOB50R3JUReHSFr+cwJnL8G1dzTA0YLEqAPI=
+k8s.io/client-go v0.34.2 h1:Co6XiknN+uUZqiddlfAjT68184/37PS4QAzYvQvDR8M=
+k8s.io/client-go v0.34.2/go.mod h1:2VYDl1XXJsdcAxw7BenFslRQX28Dxz91U9MWKjX97fE=
+k8s.io/cloud-provider v0.34.2 h1:tNxZ6c+3cJdpNHvurzUdVvKNbB0pDxx3jE1AcZ8pMKA=
+k8s.io/cloud-provider v0.34.2/go.mod h1:8XqzAplSoVLZzqut82sWHusz6X00C1Djk3BpeKAjfHY=
+k8s.io/component-base v0.34.2 h1:HQRqK9x2sSAsd8+R4xxRirlTjowsg6fWCPwWYeSvogQ=
+k8s.io/component-base v0.34.2/go.mod h1:9xw2FHJavUHBFpiGkZoKuYZ5pdtLKe97DEByaA+hHbM=
+k8s.io/component-helpers v0.34.2 h1:RIUGDdU+QFzeVKLZ9f05sXTNAtJrRJ3bnbMLrogCrvM=
+k8s.io/component-helpers v0.34.2/go.mod h1:pLi+GByuRTeFjjcezln8gHL7LcT6HImkwVQ3A2SQaEE=
+k8s.io/controller-manager v0.34.2 h1:bjdSLh5nnSde5jfRW/rdPDOSYbwUMxs+9JUcbyL6LP8=
+k8s.io/controller-manager v0.34.2/go.mod h1:sR6wSdANfbdXBTtg2Fwp1ruo/1TJgSilooT6FDxZj4A=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
-k8s.io/kms v0.34.0 h1:u+/rcxQ3Jr7gC9AY5nXuEnBcGEB7ZOIJ9cdLdyHyEjQ=
-k8s.io/kms v0.34.0/go.mod h1:s1CFkLG7w9eaTYvctOxosx88fl4spqmixnNpys0JAtM=
+k8s.io/kms v0.34.2 h1:91rj4MDZLyIT9KxG8J5/CcMH666Z88CF/xJQeuPfJc8=
+k8s.io/kms v0.34.2/go.mod h1:s1CFkLG7w9eaTYvctOxosx88fl4spqmixnNpys0JAtM=
k8s.io/kube-openapi v0.0.0-20250814151709-d7b6acb124c3 h1:liMHz39T5dJO1aOKHLvwaCjDbf07wVh6yaUlTpunnkE=
k8s.io/kube-openapi v0.0.0-20250814151709-d7b6acb124c3/go.mod h1:UZ2yyWbFTpuhSbFhv24aGNOdoRdJZgsIObGBUaYVsts=
-k8s.io/kubelet v0.34.0 h1:1nZt1Q6Kfx7xCaTS9vnqR9sjZDxf3cRSQkAFCczULmc=
-k8s.io/kubelet v0.34.0/go.mod h1:NqbF8ViVettlZbf9hw9DJhubaWn7rGvDDTcLMDm6tQ0=
+k8s.io/kubelet v0.34.2 h1:Dl+1uh7xwJr70r+SHKyIpvu6XvzuoPu0uDIC4cqgJUs=
+k8s.io/kubelet v0.34.2/go.mod h1:RfwR03iuKeVV7Z1qD9XKH98c3tlPImJpQ3qHIW40htM=
k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d h1:wAhiDyZ4Tdtt7e46e9M5ZSAJ/MnPGPs+Ki1gHw4w1R0=
k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.33.0 h1:qPrZsv1cwQiFeieFlRqT627fVZ+tyfou/+S5S0H5ua0=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.33.0/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=
-sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.9.2 h1:7vEaYwdsvOz1OBAtEm6vyc4KCTsIZ8P9WN9OFfTAlTg=
-sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.9.2/go.mod h1:BgPOvGEdPTyaIWREF7pywm6teBhO3fNVQ+CTPYyr/5w=
-sigs.k8s.io/cloud-provider-azure/pkg/azclient/cache v0.8.3 h1:GJxqN57Lu3iJxXbq3aGi9Ln6k6B7i2cJzMG4W8vPl0M=
-sigs.k8s.io/cloud-provider-azure/pkg/azclient/cache v0.8.3/go.mod h1:XZQ+JqKiGB9y5rE6OBnyqGXKQl7/iMMosT5021tYraA=
-sigs.k8s.io/cloud-provider-azure/pkg/azclient/configloader v0.8.4 h1:Sy+dyfxemdQaz/UfJYWzALlbLdEaZ7IoKn93JXTqWYs=
-sigs.k8s.io/cloud-provider-azure/pkg/azclient/configloader v0.8.4/go.mod h1:RgIi9n/PhULbvPjYZGsjP2zWJf1ZEd1qyA0CYUuSgcE=
+sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.11.0 h1:T2iD6X4g3avDGT2AQs0+wP4TK/TIM53CqUsIeuP0abM=
+sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.11.0/go.mod h1:uhhSgqxV0q8uZpLI1PkDDDQ404B52/g7U0RaHVA4XnI=
+sigs.k8s.io/cloud-provider-azure/pkg/azclient/cache v0.9.1 h1:gbkreB1bGZHfpzeY45pCt0BNgonOez5x4LIV4a6fTdQ=
+sigs.k8s.io/cloud-provider-azure/pkg/azclient/cache v0.9.1/go.mod h1:isPJpAvuooAy0HAB/XFHkgF4dEZfDsWB3nF9lYMLCw4=
+sigs.k8s.io/cloud-provider-azure/pkg/azclient/configloader v0.10.3 h1:DkKu4Y8ikBKA/zRNM/93upRxJAneEOy/w+CcboVi0g8=
+sigs.k8s.io/cloud-provider-azure/pkg/azclient/configloader v0.10.3/go.mod h1:CrrSkc6SdkPs2mmMmg0n7Cw1qliR62dg8iSArBvQrnE=
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg=
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=
diff --git a/pkg/provider/storage/azure_storageaccount.go b/pkg/provider/storage/azure_storageaccount.go
index 0ea10eb39f..fd92011ad9 100644
--- a/pkg/provider/storage/azure_storageaccount.go
+++ b/pkg/provider/storage/azure_storageaccount.go
@@ -29,7 +29,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6"
privatedns "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
- "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
"github.com/google/uuid"
"k8s.io/klog/v2"
"k8s.io/utils/ptr"
diff --git a/pkg/provider/storage/azure_storageaccount_test.go b/pkg/provider/storage/azure_storageaccount_test.go
index 643c881c8a..45cd722676 100644
--- a/pkg/provider/storage/azure_storageaccount_test.go
+++ b/pkg/provider/storage/azure_storageaccount_test.go
@@ -28,7 +28,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6"
privatedns "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
- "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"
"k8s.io/utils/ptr"
diff --git a/pkg/provider/storage/consts.go b/pkg/provider/storage/consts.go
index 5cf52a5fb7..5edca42401 100644
--- a/pkg/provider/storage/consts.go
+++ b/pkg/provider/storage/consts.go
@@ -17,7 +17,7 @@ limitations under the License.
package storage
import (
- "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
)
const (
diff --git a/pkg/provider/storage/fileservice/fileservice_repo.go b/pkg/provider/storage/fileservice/fileservice_repo.go
index 80f68ee1b3..be37cfe937 100644
--- a/pkg/provider/storage/fileservice/fileservice_repo.go
+++ b/pkg/provider/storage/fileservice/fileservice_repo.go
@@ -22,7 +22,7 @@ import (
"fmt"
"time"
- "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
"k8s.io/klog/v2"
"sigs.k8s.io/cloud-provider-azure/pkg/azclient"
diff --git a/pkg/provider/storage/fileservice/fileservice_repo_test.go b/pkg/provider/storage/fileservice/fileservice_repo_test.go
index 07277a2437..045b8fb288 100644
--- a/pkg/provider/storage/fileservice/fileservice_repo_test.go
+++ b/pkg/provider/storage/fileservice/fileservice_repo_test.go
@@ -22,7 +22,7 @@ import (
"testing"
"time"
- "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"
diff --git a/pkg/provider/storage/fileservice/mock_fileservice/interface.go b/pkg/provider/storage/fileservice/mock_fileservice/interface.go
index 8ee35b2b09..49a2d11756 100644
--- a/pkg/provider/storage/fileservice/mock_fileservice/interface.go
+++ b/pkg/provider/storage/fileservice/mock_fileservice/interface.go
@@ -30,7 +30,7 @@ import (
context "context"
reflect "reflect"
- armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
gomock "go.uber.org/mock/gomock"
)
diff --git a/pkg/provider/storage/storage_account_test.go b/pkg/provider/storage/storage_account_test.go
index ccc620876f..5720f65e9b 100644
--- a/pkg/provider/storage/storage_account_test.go
+++ b/pkg/provider/storage/storage_account_test.go
@@ -22,7 +22,7 @@ import (
"testing"
"time"
- "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
"go.uber.org/mock/gomock"
"sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient/mock_accountclient"
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md
index c73744e230..47d2b85fa8 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md
@@ -1,5 +1,27 @@
# Release History
+## 1.20.0 (2025-11-06)
+
+### Features Added
+
+* Added `runtime.FetcherForNextLinkOptions.HTTPVerb` to specify the HTTP verb when fetching the next page via next link. Defaults to `http.MethodGet`.
+
+### Bugs Fixed
+
+* Fixed potential panic when decoding base64 strings.
+* Fixed an issue in resource identifier parsing which prevented it from returning an error for malformed resource IDs.
+
+## 1.19.1 (2025-09-11)
+
+### Bugs Fixed
+
+* Fixed resource identifier parsing for provider-specific resource hierarchies containing "resourceGroups" segments.
+
+### Other Changes
+
+* Improved error fall-back for improperly authored long-running operations.
+* Upgraded dependencies.
+
## 1.19.0 (2025-08-21)
### Features Added
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go
index a08d3d0ffa..8a40ebe4d2 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go
@@ -123,9 +123,9 @@ func newResourceIDWithProvider(parent *ResourceID, providerNamespace, resourceTy
}
func chooseResourceType(resourceTypeName string, parent *ResourceID) ResourceType {
- if strings.EqualFold(resourceTypeName, resourceGroupsLowerKey) {
+ if strings.EqualFold(resourceTypeName, resourceGroupsLowerKey) && isSubscriptionResource(parent) {
return ResourceGroupResourceType
- } else if strings.EqualFold(resourceTypeName, subscriptionsKey) && parent != nil && parent.ResourceType.String() == TenantResourceType.String() {
+ } else if strings.EqualFold(resourceTypeName, subscriptionsKey) && isTenantResource(parent) {
return SubscriptionResourceType
}
@@ -182,12 +182,12 @@ func appendNext(parent *ResourceID, parts []string, id string) (*ResourceID, err
if len(parts) == 1 {
// subscriptions and resourceGroups are not valid ids without their names
- if strings.EqualFold(parts[0], subscriptionsKey) || strings.EqualFold(parts[0], resourceGroupsLowerKey) {
+ if strings.EqualFold(parts[0], subscriptionsKey) && isTenantResource(parent) || strings.EqualFold(parts[0], resourceGroupsLowerKey) && isSubscriptionResource(parent) {
return nil, fmt.Errorf("invalid resource ID: %s", id)
}
// resourceGroup must contain either child or provider resource type
- if parent.ResourceType.String() == ResourceGroupResourceType.String() {
+ if isResourceGroupResource(parent) {
return nil, fmt.Errorf("invalid resource ID: %s", id)
}
@@ -196,7 +196,7 @@ func appendNext(parent *ResourceID, parts []string, id string) (*ResourceID, err
if strings.EqualFold(parts[0], providersKey) && (len(parts) == 2 || strings.EqualFold(parts[2], providersKey)) {
// provider resource can only be on a tenant or a subscription parent
- if parent.ResourceType.String() != SubscriptionResourceType.String() && parent.ResourceType.String() != TenantResourceType.String() {
+ if !isSubscriptionResource(parent) && !isTenantResource(parent) {
return nil, fmt.Errorf("invalid resource ID: %s", id)
}
@@ -217,6 +217,7 @@ func appendNext(parent *ResourceID, parts []string, id string) (*ResourceID, err
func splitStringAndOmitEmpty(v, sep string) []string {
r := make([]string, 0)
for _, s := range strings.Split(v, sep) {
+ s = strings.TrimSpace(s)
if len(s) == 0 {
continue
}
@@ -225,3 +226,18 @@ func splitStringAndOmitEmpty(v, sep string) []string {
return r
}
+
+// isTenantResource returns true if the resourceID represents a tenant resource. The condition is resource ID matched with TenantResourceType and has no parent.
+func isTenantResource(resourceID *ResourceID) bool {
+ return resourceID != nil && strings.EqualFold(resourceID.ResourceType.String(), TenantResourceType.String()) && resourceID.Parent == nil
+}
+
+// isSubscriptionResource returns true if the resourceID represents a subscription resource. The condition is resource ID matched with SubscriptionResourceType and its parent is a tenant resource.
+func isSubscriptionResource(resourceID *ResourceID) bool {
+ return resourceID != nil && strings.EqualFold(resourceID.ResourceType.String(), SubscriptionResourceType.String()) && isTenantResource(resourceID.Parent)
+}
+
+// isResourceGroupResource returns true if the resourceID represents a resource group resource. The condition is resource ID matched with ResourceGroupResourceType and its parent is a subscription resource.
+func isResourceGroupResource(resourceID *ResourceID) bool {
+ return resourceID != nil && strings.EqualFold(resourceID.ResourceType.String(), ResourceGroupResourceType.String()) && isSubscriptionResource(resourceID.Parent)
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/exported.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/exported.go
index 460170034a..612af11ac6 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/exported.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/exported.go
@@ -92,7 +92,7 @@ func DecodeByteArray(s string, v *[]byte, format Base64Encoding) error {
return nil
}
payload := string(s)
- if payload[0] == '"' {
+ if len(payload) >= 2 && payload[0] == '"' && payload[len(payload)-1] == '"' {
// remove surrounding quotes
payload = payload[1 : len(payload)-1]
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go
index 9fb41a405a..f152000913 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go
@@ -40,5 +40,5 @@ const (
Module = "azcore"
// Version is the semantic version (see http://semver.org) of this module.
- Version = "v1.19.0"
+ Version = "v1.20.0"
)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pager.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pager.go
index c66fc0a90a..edb4a3cd44 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pager.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pager.go
@@ -99,6 +99,11 @@ type FetcherForNextLinkOptions struct {
// StatusCodes contains additional HTTP status codes indicating success.
// The default value is http.StatusOK.
StatusCodes []int
+
+ // HTTPVerb specifies the HTTP verb to use when fetching the next page.
+ // The default value is http.MethodGet.
+ // This field is only used when NextReq is not specified.
+ HTTPVerb string
}
// FetcherForNextLink is a helper containing boilerplate code to simplify creating a PagingHandler[T].Fetcher from a next link URL.
@@ -119,7 +124,11 @@ func FetcherForNextLink(ctx context.Context, pl Pipeline, nextLink string, first
if options.NextReq != nil {
req, err = options.NextReq(ctx, nextLink)
} else {
- req, err = NewRequest(ctx, http.MethodGet, nextLink)
+ verb := http.MethodGet
+ if options.HTTPVerb != "" {
+ verb = options.HTTPVerb
+ }
+ req, err = NewRequest(ctx, verb, nextLink)
}
}
if err != nil {
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/poller.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/poller.go
index 4f90e44743..a89ae9b7b9 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/poller.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/poller.go
@@ -91,7 +91,7 @@ func NewPoller[T any](resp *http.Response, pl exported.Pipeline, options *NewPol
// this is a back-stop in case the swagger is incorrect (i.e. missing one or more status codes for success).
// ideally the codegen should return an error if the initial response failed and not even create a poller.
if !poller.StatusCodeValid(resp) {
- return nil, errors.New("the operation failed or was cancelled")
+ return nil, exported.NewResponseError(resp)
}
// determine the polling method
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md
index 9e68cf6701..4a6349e167 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md
@@ -1,5 +1,46 @@
# Release History
+## 1.13.1 (2025-11-10)
+
+### Bugs Fixed
+
+- `AzureCLICredential` quoted arguments incorrectly on Windows
+
+## 1.13.0 (2025-10-07)
+
+### Features Added
+
+- Added `AzurePowerShellCredential`, which authenticates as the identity logged in to Azure PowerShell
+ (thanks [ArmaanMcleod](https://github.com/ArmaanMcleod))
+- When `AZURE_TOKEN_CREDENTIALS` is set to `ManagedIdentityCredential`, `DefaultAzureCredential` behaves the same as
+ does `ManagedIdentityCredential` when used directly. It doesn't apply special retry configuration or attempt to
+ determine whether IMDS is available. ([#25265](https://github.com/Azure/azure-sdk-for-go/issues/25265))
+
+### Breaking Changes
+
+* Removed the `WorkloadIdentityCredential` support for identity binding mode added in v1.13.0-beta.1.
+ It will return in v1.14.0-beta.1
+
+## 1.13.0-beta.1 (2025-09-17)
+
+### Features Added
+
+- Added `AzurePowerShellCredential`, which authenticates as the identity logged in to Azure PowerShell
+ (thanks [ArmaanMcleod](https://github.com/ArmaanMcleod))
+- `WorkloadIdentityCredential` supports identity binding mode ([#25056](https://github.com/Azure/azure-sdk-for-go/issues/25056))
+
+## 1.12.0 (2025-09-16)
+
+### Features Added
+- Added `DefaultAzureCredentialOptions.RequireAzureTokenCredentials`. `NewDefaultAzureCredential` returns an
+ error when this option is true and the environment variable `AZURE_TOKEN_CREDENTIALS` has no value.
+
+### Other Changes
+- `AzureDeveloperCLICredential` no longer hangs when AZD_DEBUG is set
+- `GetToken` methods of `AzureCLICredential` and `AzureDeveloperCLICredential` return an error when
+ `TokenRequestOptions.Claims` has a value because these credentials can't acquire a token in that
+ case. The error messages describe the action required to get a token.
+
## 1.11.0 (2025-08-05)
### Other Changes
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md
index 069bc688d5..127c25b72c 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md
@@ -1,6 +1,6 @@
# Azure Identity Client Module for Go
-The Azure Identity module provides Microsoft Entra ID ([formerly Azure Active Directory](https://learn.microsoft.com/entra/fundamentals/new-name)) token authentication support across the Azure SDK. It includes a set of `TokenCredential` implementations, which can be used with Azure SDK clients supporting token authentication.
+The Azure Identity module provides [Microsoft Entra ID](https://learn.microsoft.com/entra/fundamentals/whatis) token-based authentication support across the Azure SDK. It includes a set of `TokenCredential` implementations, which can be used with Azure SDK clients supporting token authentication.
[](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity)
| [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity/)
@@ -153,6 +153,7 @@ client := armresources.NewResourceGroupsClient("subscription ID", chain, nil)
|-|-
|[AzureCLICredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#AzureCLICredential)|Authenticate as the user signed in to the Azure CLI
|[AzureDeveloperCLICredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#AzureDeveloperCLICredential)|Authenticates as the user signed in to the Azure Developer CLI
+|[AzurePowerShellCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#AzurePowerShellCredential)|Authenticates as the user signed in to Azure PowerShell
## Environment Variables
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD
index da2094e36b..8bdaf81651 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD
@@ -40,6 +40,7 @@ The following table indicates the state of in-memory and persistent caching in e
| ------------------------------ | ------------------------------------------------------------------- | ------------------------ |
| `AzureCLICredential` | Not Supported | Not Supported |
| `AzureDeveloperCLICredential` | Not Supported | Not Supported |
+| `AzurePowerShellCredential` | Not Supported | Not Supported |
| `AzurePipelinesCredential` | Supported | Supported |
| `ClientAssertionCredential` | Supported | Supported |
| `ClientCertificateCredential` | Supported | Supported |
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md
index 6ac513846d..517006a424 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md
@@ -12,13 +12,13 @@ This troubleshooting guide covers failure investigation techniques, common error
- [Troubleshoot AzureCLICredential authentication issues](#troubleshoot-azureclicredential-authentication-issues)
- [Troubleshoot AzureDeveloperCLICredential authentication issues](#troubleshoot-azuredeveloperclicredential-authentication-issues)
- [Troubleshoot AzurePipelinesCredential authentication issues](#troubleshoot-azurepipelinescredential-authentication-issues)
+- [Troubleshoot AzurePowerShellCredential authentication issues](#troubleshoot-azurepowershellcredential-authentication-issues)
- [Troubleshoot ClientCertificateCredential authentication issues](#troubleshoot-clientcertificatecredential-authentication-issues)
- [Troubleshoot ClientSecretCredential authentication issues](#troubleshoot-clientsecretcredential-authentication-issues)
- [Troubleshoot DefaultAzureCredential authentication issues](#troubleshoot-defaultazurecredential-authentication-issues)
- [Troubleshoot EnvironmentCredential authentication issues](#troubleshoot-environmentcredential-authentication-issues)
- [Troubleshoot ManagedIdentityCredential authentication issues](#troubleshoot-managedidentitycredential-authentication-issues)
- [Azure App Service and Azure Functions managed identity](#azure-app-service-and-azure-functions-managed-identity)
- - [Azure Kubernetes Service managed identity](#azure-kubernetes-service-managed-identity)
- [Azure Virtual Machine managed identity](#azure-virtual-machine-managed-identity)
- [Troubleshoot WorkloadIdentityCredential authentication issues](#troubleshoot-workloadidentitycredential-authentication-issues)
- [Get additional help](#get-additional-help)
@@ -120,7 +120,6 @@ azlog.SetEvents(azidentity.EventAuthentication)
|---|---|---|
|Azure Virtual Machines and Scale Sets|[Configuration](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm)|[Troubleshooting](#azure-virtual-machine-managed-identity)|
|Azure App Service and Azure Functions|[Configuration](https://learn.microsoft.com/azure/app-service/overview-managed-identity)|[Troubleshooting](#azure-app-service-and-azure-functions-managed-identity)|
-|Azure Kubernetes Service|[Configuration](https://azure.github.io/aad-pod-identity/docs/)|[Troubleshooting](#azure-kubernetes-service-managed-identity)|
|Azure Arc|[Configuration](https://learn.microsoft.com/azure/azure-arc/servers/managed-identity-authentication)||
|Azure Service Fabric|[Configuration](https://learn.microsoft.com/azure/service-fabric/concepts-managed-identity)||
@@ -159,14 +158,6 @@ curl "$IDENTITY_ENDPOINT?resource=https://management.core.windows.net&api-versio
> This command's output will contain an access token and SHOULD NOT BE SHARED, to avoid compromising account security.
-### Azure Kubernetes Service managed identity
-
-#### Pod Identity
-
-| Error Message |Description| Mitigation |
-|---|---|---|
-|"no azure identity found for request clientID"|The application attempted to authenticate before an identity was assigned to its pod|Verify the pod is labeled correctly. This also occurs when a correctly labeled pod authenticates before the identity is ready. To prevent initialization races, configure NMI to set the Retry-After header in its responses as described in [Pod Identity documentation](https://azure.github.io/aad-pod-identity/docs/configure/feature_flags/#set-retry-after-header-in-nmi-response).
-
## Troubleshoot AzureCLICredential authentication issues
@@ -215,6 +206,34 @@ azd auth token --output json --scope https://management.core.windows.net/.defaul
```
>Note that output of this command will contain a valid access token, and SHOULD NOT BE SHARED to avoid compromising account security.
+
+## Troubleshoot `AzurePowerShellCredential` authentication issues
+
+| Error Message |Description| Mitigation |
+|---|---|---|
+|executable not found on path|No local installation of PowerShell was found.|Ensure that PowerShell is properly installed on the machine. Instructions for installing PowerShell can be found [here](https://learn.microsoft.com/powershell/scripting/install/installing-powershell).|
+|Az.Accounts module not found|The Az.Account module needed for authentication in Azure PowerShell isn't installed.|Install the latest Az.Account module. Installation instructions can be found [here](https://learn.microsoft.com/powershell/azure/install-az-ps).|
+|Please run "Connect-AzAccount" to set up account.|No account is currently logged into Azure PowerShell.|
- Log in to Azure PowerShell using the `Connect-AzAccount` command. More instructions for authenticating Azure PowerShell can be found at [Sign in with Azure PowerShell](https://learn.microsoft.com/powershell/azure/authenticate-azureps).
- Validate that Azure PowerShell can obtain tokens. For instructions, see [Verify Azure PowerShell can obtain tokens](#verify-azure-powershell-can-obtain-tokens).
|
+
+#### __Verify Azure PowerShell can obtain tokens__
+
+You can manually verify that Azure PowerShell is authenticated and can obtain tokens. First, use the `Get-AzContext` command to verify the account that is currently logged in to Azure PowerShell.
+
+```
+PS C:\> Get-AzContext
+
+Name Account SubscriptionName Environment TenantId
+---- ------- ---------------- ----------- --------
+Subscription1 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription1 AzureCloud xxxxxxxx-x...
+```
+
+Once you've verified Azure PowerShell is using correct account, validate that it's able to obtain tokens for this account:
+
+```bash
+Get-AzAccessToken -ResourceUrl "https://management.core.windows.net"
+```
+>Note that output of this command will contain a valid access token, and SHOULD NOT BE SHARED to avoid compromising account security.
+
## Troubleshoot `WorkloadIdentityCredential` authentication issues
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json
index 4118f99ef2..1646ff9116 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json
@@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "go",
"TagPrefix": "go/azidentity",
- "Tag": "go/azidentity_191110b0dd"
+ "Tag": "go/azidentity_530ea4279b"
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go
index 0fd03f4563..6944152c96 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go
@@ -7,14 +7,11 @@
package azidentity
import (
- "bytes"
"context"
+ "encoding/base64"
"encoding/json"
"errors"
"fmt"
- "os"
- "os/exec"
- "runtime"
"strings"
"sync"
"time"
@@ -26,8 +23,6 @@ import (
const credNameAzureCLI = "AzureCLICredential"
-type azTokenProvider func(ctx context.Context, scopes []string, tenant, subscription string) ([]byte, error)
-
// AzureCLICredentialOptions contains optional parameters for AzureCLICredential.
type AzureCLICredentialOptions struct {
// AdditionallyAllowedTenants specifies tenants to which the credential may authenticate, in addition to
@@ -45,15 +40,8 @@ type AzureCLICredentialOptions struct {
// inDefaultChain is true when the credential is part of DefaultAzureCredential
inDefaultChain bool
- // tokenProvider is used by tests to fake invoking az
- tokenProvider azTokenProvider
-}
-
-// init returns an instance of AzureCLICredentialOptions initialized with default values.
-func (o *AzureCLICredentialOptions) init() {
- if o.tokenProvider == nil {
- o.tokenProvider = defaultAzTokenProvider
- }
+ // exec is used by tests to fake invoking az
+ exec executor
}
// AzureCLICredential authenticates as the identity logged in to the Azure CLI.
@@ -80,7 +68,9 @@ func NewAzureCLICredential(options *AzureCLICredentialOptions) (*AzureCLICredent
if cp.TenantID != "" && !validTenantID(cp.TenantID) {
return nil, errInvalidTenantID
}
- cp.init()
+ if cp.exec == nil {
+ cp.exec = shellExec
+ }
cp.AdditionallyAllowedTenants = resolveAdditionalTenants(cp.AdditionallyAllowedTenants)
return &AzureCLICredential{mu: &sync.Mutex{}, opts: cp}, nil
}
@@ -99,14 +89,37 @@ func (c *AzureCLICredential) GetToken(ctx context.Context, opts policy.TokenRequ
if err != nil {
return at, err
}
+ // pass the CLI a Microsoft Entra ID v1 resource because we don't know which CLI version is installed and older ones don't support v2 scopes
+ resource := strings.TrimSuffix(opts.Scopes[0], defaultSuffix)
+ command := "az account get-access-token -o json --resource " + resource
+ tenantArg := ""
+ if tenant != "" {
+ tenantArg = " --tenant " + tenant
+ command += tenantArg
+ }
+ if c.opts.Subscription != "" {
+ // subscription needs quotes because it may contain spaces
+ command += ` --subscription "` + c.opts.Subscription + `"`
+ }
+ if opts.Claims != "" {
+ encoded := base64.StdEncoding.EncodeToString([]byte(opts.Claims))
+ return at, fmt.Errorf(
+ "%s.GetToken(): Azure CLI requires multifactor authentication or additional claims. Run this command then retry the operation: az login%s --claims-challenge %s",
+ credNameAzureCLI,
+ tenantArg,
+ encoded,
+ )
+ }
+
c.mu.Lock()
defer c.mu.Unlock()
- b, err := c.opts.tokenProvider(ctx, opts.Scopes, tenant, c.opts.Subscription)
+
+ b, err := c.opts.exec(ctx, credNameAzureCLI, command)
if err == nil {
at, err = c.createAccessToken(b)
}
if err != nil {
- err = unavailableIfInChain(err, c.opts.inDefaultChain)
+ err = unavailableIfInDAC(err, c.opts.inDefaultChain)
return at, err
}
msg := fmt.Sprintf("%s.GetToken() acquired a token for scope %q", credNameAzureCLI, strings.Join(opts.Scopes, ", "))
@@ -114,63 +127,6 @@ func (c *AzureCLICredential) GetToken(ctx context.Context, opts policy.TokenRequ
return at, nil
}
-// defaultAzTokenProvider invokes the Azure CLI to acquire a token. It assumes
-// callers have verified that all string arguments are safe to pass to the CLI.
-var defaultAzTokenProvider azTokenProvider = func(ctx context.Context, scopes []string, tenantID, subscription string) ([]byte, error) {
- // pass the CLI a Microsoft Entra ID v1 resource because we don't know which CLI version is installed and older ones don't support v2 scopes
- resource := strings.TrimSuffix(scopes[0], defaultSuffix)
- // set a default timeout for this authentication iff the application hasn't done so already
- var cancel context.CancelFunc
- if _, hasDeadline := ctx.Deadline(); !hasDeadline {
- ctx, cancel = context.WithTimeout(ctx, cliTimeout)
- defer cancel()
- }
- commandLine := "az account get-access-token -o json --resource " + resource
- if tenantID != "" {
- commandLine += " --tenant " + tenantID
- }
- if subscription != "" {
- // subscription needs quotes because it may contain spaces
- commandLine += ` --subscription "` + subscription + `"`
- }
- var cliCmd *exec.Cmd
- if runtime.GOOS == "windows" {
- dir := os.Getenv("SYSTEMROOT")
- if dir == "" {
- return nil, newCredentialUnavailableError(credNameAzureCLI, "environment variable 'SYSTEMROOT' has no value")
- }
- cliCmd = exec.CommandContext(ctx, "cmd.exe", "/c", commandLine)
- cliCmd.Dir = dir
- } else {
- cliCmd = exec.CommandContext(ctx, "/bin/sh", "-c", commandLine)
- cliCmd.Dir = "/bin"
- }
- cliCmd.Env = os.Environ()
- var stderr bytes.Buffer
- cliCmd.Stderr = &stderr
- cliCmd.WaitDelay = 100 * time.Millisecond
-
- stdout, err := cliCmd.Output()
- if errors.Is(err, exec.ErrWaitDelay) && len(stdout) > 0 {
- // The child process wrote to stdout and exited without closing it.
- // Swallow this error and return stdout because it may contain a token.
- return stdout, nil
- }
- if err != nil {
- msg := stderr.String()
- var exErr *exec.ExitError
- if errors.As(err, &exErr) && exErr.ExitCode() == 127 || strings.HasPrefix(msg, "'az' is not recognized") {
- msg = "Azure CLI not found on path"
- }
- if msg == "" {
- msg = err.Error()
- }
- return nil, newCredentialUnavailableError(credNameAzureCLI, msg)
- }
-
- return stdout, nil
-}
-
func (c *AzureCLICredential) createAccessToken(tk []byte) (azcore.AccessToken, error) {
t := struct {
AccessToken string `json:"accessToken"`
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_developer_cli_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_developer_cli_credential.go
index 1bd3720b64..f97bf95df9 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_developer_cli_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_developer_cli_credential.go
@@ -7,14 +7,11 @@
package azidentity
import (
- "bytes"
"context"
+ "encoding/base64"
"encoding/json"
"errors"
"fmt"
- "os"
- "os/exec"
- "runtime"
"strings"
"sync"
"time"
@@ -24,9 +21,10 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/internal/log"
)
-const credNameAzureDeveloperCLI = "AzureDeveloperCLICredential"
-
-type azdTokenProvider func(ctx context.Context, scopes []string, tenant string) ([]byte, error)
+const (
+ credNameAzureDeveloperCLI = "AzureDeveloperCLICredential"
+ mfaRequired = "Azure Developer CLI requires multifactor authentication or additional claims"
+)
// AzureDeveloperCLICredentialOptions contains optional parameters for AzureDeveloperCLICredential.
type AzureDeveloperCLICredentialOptions struct {
@@ -41,8 +39,8 @@ type AzureDeveloperCLICredentialOptions struct {
// inDefaultChain is true when the credential is part of DefaultAzureCredential
inDefaultChain bool
- // tokenProvider is used by tests to fake invoking azd
- tokenProvider azdTokenProvider
+ // exec is used by tests to fake invoking azd
+ exec executor
}
// AzureDeveloperCLICredential authenticates as the identity logged in to the [Azure Developer CLI].
@@ -62,8 +60,8 @@ func NewAzureDeveloperCLICredential(options *AzureDeveloperCLICredentialOptions)
if cp.TenantID != "" && !validTenantID(cp.TenantID) {
return nil, errInvalidTenantID
}
- if cp.tokenProvider == nil {
- cp.tokenProvider = defaultAzdTokenProvider
+ if cp.exec == nil {
+ cp.exec = shellExec
}
return &AzureDeveloperCLICredential{mu: &sync.Mutex{}, opts: cp}, nil
}
@@ -75,23 +73,52 @@ func (c *AzureDeveloperCLICredential) GetToken(ctx context.Context, opts policy.
if len(opts.Scopes) == 0 {
return at, errors.New(credNameAzureDeveloperCLI + ": GetToken() requires at least one scope")
}
+ command := "azd auth token -o json --no-prompt"
for _, scope := range opts.Scopes {
if !validScope(scope) {
return at, fmt.Errorf("%s.GetToken(): invalid scope %q", credNameAzureDeveloperCLI, scope)
}
+ command += " --scope " + scope
}
tenant, err := resolveTenant(c.opts.TenantID, opts.TenantID, credNameAzureDeveloperCLI, c.opts.AdditionallyAllowedTenants)
if err != nil {
return at, err
}
+ if tenant != "" {
+ command += " --tenant-id " + tenant
+ }
+ commandNoClaims := command
+ if opts.Claims != "" {
+ encoded := base64.StdEncoding.EncodeToString([]byte(opts.Claims))
+ command += " --claims " + encoded
+ }
+
c.mu.Lock()
defer c.mu.Unlock()
- b, err := c.opts.tokenProvider(ctx, opts.Scopes, tenant)
+
+ b, err := c.opts.exec(ctx, credNameAzureDeveloperCLI, command)
if err == nil {
at, err = c.createAccessToken(b)
}
if err != nil {
- err = unavailableIfInChain(err, c.opts.inDefaultChain)
+ msg := err.Error()
+ switch {
+ case strings.Contains(msg, "unknown flag: --claims"):
+ err = newAuthenticationFailedError(
+ credNameAzureDeveloperCLI,
+ mfaRequired+", however the installed version doesn't support this. Upgrade to version 1.18.1 or later",
+ nil,
+ )
+ case opts.Claims != "":
+ err = newAuthenticationFailedError(
+ credNameAzureDeveloperCLI,
+ mfaRequired+". Run this command then retry the operation: "+commandNoClaims,
+ nil,
+ )
+ case strings.Contains(msg, "azd auth login"):
+ err = newCredentialUnavailableError(credNameAzureDeveloperCLI, `please run "azd auth login" from a command prompt to authenticate before using this credential`)
+ }
+ err = unavailableIfInDAC(err, c.opts.inDefaultChain)
return at, err
}
msg := fmt.Sprintf("%s.GetToken() acquired a token for scope %q", credNameAzureDeveloperCLI, strings.Join(opts.Scopes, ", "))
@@ -99,61 +126,6 @@ func (c *AzureDeveloperCLICredential) GetToken(ctx context.Context, opts policy.
return at, nil
}
-// defaultAzTokenProvider invokes the Azure Developer CLI to acquire a token. It assumes
-// callers have verified that all string arguments are safe to pass to the CLI.
-var defaultAzdTokenProvider azdTokenProvider = func(ctx context.Context, scopes []string, tenant string) ([]byte, error) {
- // set a default timeout for this authentication iff the application hasn't done so already
- var cancel context.CancelFunc
- if _, hasDeadline := ctx.Deadline(); !hasDeadline {
- ctx, cancel = context.WithTimeout(ctx, cliTimeout)
- defer cancel()
- }
- commandLine := "azd auth token -o json"
- if tenant != "" {
- commandLine += " --tenant-id " + tenant
- }
- for _, scope := range scopes {
- commandLine += " --scope " + scope
- }
- var cliCmd *exec.Cmd
- if runtime.GOOS == "windows" {
- dir := os.Getenv("SYSTEMROOT")
- if dir == "" {
- return nil, newCredentialUnavailableError(credNameAzureDeveloperCLI, "environment variable 'SYSTEMROOT' has no value")
- }
- cliCmd = exec.CommandContext(ctx, "cmd.exe", "/c", commandLine)
- cliCmd.Dir = dir
- } else {
- cliCmd = exec.CommandContext(ctx, "/bin/sh", "-c", commandLine)
- cliCmd.Dir = "/bin"
- }
- cliCmd.Env = os.Environ()
- var stderr bytes.Buffer
- cliCmd.Stderr = &stderr
- cliCmd.WaitDelay = 100 * time.Millisecond
-
- stdout, err := cliCmd.Output()
- if errors.Is(err, exec.ErrWaitDelay) && len(stdout) > 0 {
- // The child process wrote to stdout and exited without closing it.
- // Swallow this error and return stdout because it may contain a token.
- return stdout, nil
- }
- if err != nil {
- msg := stderr.String()
- var exErr *exec.ExitError
- if errors.As(err, &exErr) && exErr.ExitCode() == 127 || strings.HasPrefix(msg, "'azd' is not recognized") {
- msg = "Azure Developer CLI not found on path"
- } else if strings.Contains(msg, "azd auth login") {
- msg = `please run "azd auth login" from a command prompt to authenticate before using this credential`
- }
- if msg == "" {
- msg = err.Error()
- }
- return nil, newCredentialUnavailableError(credNameAzureDeveloperCLI, msg)
- }
- return stdout, nil
-}
-
func (c *AzureDeveloperCLICredential) createAccessToken(tk []byte) (azcore.AccessToken, error) {
t := struct {
AccessToken string `json:"token"`
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_powershell_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_powershell_credential.go
new file mode 100644
index 0000000000..0829655545
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_powershell_credential.go
@@ -0,0 +1,234 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import (
+ "context"
+ "encoding/base64"
+ "encoding/binary"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "os/exec"
+ "runtime"
+ "strings"
+ "sync"
+ "time"
+ "unicode/utf16"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/internal/log"
+)
+
+const (
+ credNameAzurePowerShell = "AzurePowerShellCredential"
+ noAzAccountModule = "Az.Accounts module not found"
+)
+
+// AzurePowerShellCredentialOptions contains optional parameters for AzurePowerShellCredential.
+type AzurePowerShellCredentialOptions struct {
+ // AdditionallyAllowedTenants specifies tenants to which the credential may authenticate, in addition to
+ // TenantID. When TenantID is empty, this option has no effect and the credential will authenticate to
+ // any requested tenant. Add the wildcard value "*" to allow the credential to authenticate to any tenant.
+ AdditionallyAllowedTenants []string
+
+ // TenantID identifies the tenant the credential should authenticate in.
+ // Defaults to Azure PowerShell's default tenant, which is typically the home tenant of the logged in user.
+ TenantID string
+
+ // inDefaultChain is true when the credential is part of DefaultAzureCredential
+ inDefaultChain bool
+
+ // exec is used by tests to fake invoking Azure PowerShell
+ exec executor
+}
+
+// AzurePowerShellCredential authenticates as the identity logged in to Azure PowerShell.
+type AzurePowerShellCredential struct {
+ mu *sync.Mutex
+ opts AzurePowerShellCredentialOptions
+}
+
+// NewAzurePowerShellCredential constructs an AzurePowerShellCredential. Pass nil to accept default options.
+func NewAzurePowerShellCredential(options *AzurePowerShellCredentialOptions) (*AzurePowerShellCredential, error) {
+ cp := AzurePowerShellCredentialOptions{}
+
+ if options != nil {
+ cp = *options
+ }
+
+ if cp.TenantID != "" && !validTenantID(cp.TenantID) {
+ return nil, errInvalidTenantID
+ }
+
+ if cp.exec == nil {
+ cp.exec = shellExec
+ }
+
+ cp.AdditionallyAllowedTenants = resolveAdditionalTenants(cp.AdditionallyAllowedTenants)
+
+ return &AzurePowerShellCredential{mu: &sync.Mutex{}, opts: cp}, nil
+}
+
+// GetToken requests a token from Azure PowerShell. This credential doesn't cache tokens, so every call invokes Azure PowerShell.
+// This method is called automatically by Azure SDK clients.
+func (c *AzurePowerShellCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) {
+ at := azcore.AccessToken{}
+
+ if len(opts.Scopes) != 1 {
+ return at, errors.New(credNameAzurePowerShell + ": GetToken() requires exactly one scope")
+ }
+
+ if !validScope(opts.Scopes[0]) {
+ return at, fmt.Errorf("%s.GetToken(): invalid scope %q", credNameAzurePowerShell, opts.Scopes[0])
+ }
+
+ tenant, err := resolveTenant(c.opts.TenantID, opts.TenantID, credNameAzurePowerShell, c.opts.AdditionallyAllowedTenants)
+ if err != nil {
+ return at, err
+ }
+
+ // Always pass a Microsoft Entra ID v1 resource URI (not a v2 scope) because Get-AzAccessToken only supports v1 resource URIs.
+ resource := strings.TrimSuffix(opts.Scopes[0], defaultSuffix)
+
+ tenantArg := ""
+ if tenant != "" {
+ tenantArg = fmt.Sprintf(" -TenantId '%s'", tenant)
+ }
+
+ if opts.Claims != "" {
+ encoded := base64.StdEncoding.EncodeToString([]byte(opts.Claims))
+ return at, fmt.Errorf(
+ "%s.GetToken(): Azure PowerShell requires multifactor authentication or additional claims. Run this command then retry the operation: Connect-AzAccount%s -ClaimsChallenge '%s'",
+ credNameAzurePowerShell,
+ tenantArg,
+ encoded,
+ )
+ }
+
+ // Inline script to handle Get-AzAccessToken differences between Az.Accounts versions with SecureString handling and minimum version requirement
+ script := fmt.Sprintf(`
+$ErrorActionPreference = 'Stop'
+[version]$minimumVersion = '2.2.0'
+
+$mod = Import-Module Az.Accounts -MinimumVersion $minimumVersion -PassThru -ErrorAction SilentlyContinue
+
+if (-not $mod) {
+ Write-Error '%s'
+}
+
+$params = @{
+ ResourceUrl = '%s'
+ WarningAction = 'Ignore'
+}
+
+# Only force AsSecureString for Az.Accounts versions > 2.17.0 and < 5.0.0 which return plain text token by default.
+# Newer Az.Accounts versions return SecureString token by default and no longer use AsSecureString parameter.
+if ($mod.Version -ge [version]'2.17.0' -and $mod.Version -lt [version]'5.0.0') {
+ $params['AsSecureString'] = $true
+}
+
+$tenantId = '%s'
+if ($tenantId.Length -gt 0) {
+ $params['TenantId'] = '%s'
+}
+
+$token = Get-AzAccessToken @params
+
+$customToken = New-Object -TypeName psobject
+
+# The following .NET interop pattern is supported in all PowerShell versions and safely converts SecureString to plain text.
+if ($token.Token -is [System.Security.SecureString]) {
+ $ssPtr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($token.Token)
+ try {
+ $plainToken = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($ssPtr)
+ } finally {
+ [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ssPtr)
+ }
+ $customToken | Add-Member -MemberType NoteProperty -Name Token -Value $plainToken
+} else {
+ $customToken | Add-Member -MemberType NoteProperty -Name Token -Value $token.Token
+}
+$customToken | Add-Member -MemberType NoteProperty -Name ExpiresOn -Value $token.ExpiresOn.ToUnixTimeSeconds()
+
+$jsonToken = $customToken | ConvertTo-Json
+return $jsonToken
+`, noAzAccountModule, resource, tenant, tenant)
+
+ // Windows: prefer pwsh.exe (PowerShell Core), fallback to powershell.exe (Windows PowerShell)
+ // Unix: only support pwsh (PowerShell Core)
+ exe := "pwsh"
+ if runtime.GOOS == "windows" {
+ if _, err := exec.LookPath("pwsh.exe"); err == nil {
+ exe = "pwsh.exe"
+ } else {
+ exe = "powershell.exe"
+ }
+ }
+
+ command := exe + " -NoProfile -NonInteractive -OutputFormat Text -EncodedCommand " + base64EncodeUTF16LE(script)
+
+ c.mu.Lock()
+ defer c.mu.Unlock()
+
+ b, err := c.opts.exec(ctx, credNameAzurePowerShell, command)
+ if err == nil {
+ at, err = c.createAccessToken(b)
+ }
+
+ if err != nil {
+ err = unavailableIfInDAC(err, c.opts.inDefaultChain)
+ return at, err
+ }
+
+ msg := fmt.Sprintf("%s.GetToken() acquired a token for scope %q", credNameAzurePowerShell, strings.Join(opts.Scopes, ", "))
+ log.Write(EventAuthentication, msg)
+
+ return at, nil
+}
+
+func (c *AzurePowerShellCredential) createAccessToken(tk []byte) (azcore.AccessToken, error) {
+ t := struct {
+ Token string `json:"Token"`
+ ExpiresOn int64 `json:"ExpiresOn"`
+ }{}
+
+ err := json.Unmarshal(tk, &t)
+ if err != nil {
+ return azcore.AccessToken{}, err
+ }
+
+ converted := azcore.AccessToken{
+ Token: t.Token,
+ ExpiresOn: time.Unix(t.ExpiresOn, 0).UTC(),
+ }
+
+ return converted, nil
+}
+
+// Encodes a string to Base64 using UTF-16LE encoding
+func base64EncodeUTF16LE(text string) string {
+ u16 := utf16.Encode([]rune(text))
+ buf := make([]byte, len(u16)*2)
+ for i, v := range u16 {
+ binary.LittleEndian.PutUint16(buf[i*2:], v)
+ }
+ return base64.StdEncoding.EncodeToString(buf)
+}
+
+// Decodes a Base64 UTF-16LE string back to string
+func base64DecodeUTF16LE(encoded string) (string, error) {
+ data, err := base64.StdEncoding.DecodeString(encoded)
+ if err != nil {
+ return "", err
+ }
+ u16 := make([]uint16, len(data)/2)
+ for i := range u16 {
+ u16[i] = binary.LittleEndian.Uint16(data[i*2:])
+ }
+ return string(utf16.Decode(u16)), nil
+}
+
+var _ azcore.TokenCredential = (*AzurePowerShellCredential)(nil)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml
index 38445e8536..51dd979390 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml
@@ -41,6 +41,3 @@ extends:
GenerateVMJobs: true
Path: sdk/azidentity/managed-identity-matrix.json
Selection: sparse
- MatrixReplace:
- - Pool=.*LINUXPOOL.*/azsdk-pool-mms-ubuntu-2204-identitymsi
- - OSVmImage=.*LINUXVMIMAGE.*/azsdk-pool-mms-ubuntu-2204-1espt
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go
index 2b94270a8c..aaaabc5c2f 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go
@@ -26,6 +26,7 @@ const (
managedIdentity
az
azd
+ azurePowerShell
)
// DefaultAzureCredentialOptions contains optional parameters for DefaultAzureCredential.
@@ -48,6 +49,10 @@ type DefaultAzureCredentialOptions struct {
// the application responsible for ensuring the configured authority is valid and trustworthy.
DisableInstanceDiscovery bool
+ // RequireAzureTokenCredentials determines whether NewDefaultAzureCredential returns an error when the environment
+ // variable AZURE_TOKEN_CREDENTIALS has no value.
+ RequireAzureTokenCredentials bool
+
// TenantID sets the default tenant for authentication via the Azure CLI, Azure Developer CLI, and workload identity.
TenantID string
}
@@ -67,6 +72,7 @@ type DefaultAzureCredentialOptions struct {
// - [ManagedIdentityCredential]
// - [AzureCLICredential]
// - [AzureDeveloperCLICredential]
+// - [AzurePowerShellCredential]
//
// Consult the documentation for these credential types for more information on how they authenticate.
// Once a credential has successfully authenticated, DefaultAzureCredential will use that credential for
@@ -79,9 +85,13 @@ type DefaultAzureCredentialOptions struct {
// Valid values for AZURE_TOKEN_CREDENTIALS are the name of any single type in the above chain, for example
// "EnvironmentCredential" or "AzureCLICredential", and these special values:
//
-// - "dev": try [AzureCLICredential] and [AzureDeveloperCLICredential], in that order
+// - "dev": try [AzureCLICredential], [AzureDeveloperCLICredential], and [AzurePowerShellCredential], in that order
// - "prod": try [EnvironmentCredential], [WorkloadIdentityCredential], and [ManagedIdentityCredential], in that order
//
+// [DefaultAzureCredentialOptions].RequireAzureTokenCredentials controls whether AZURE_TOKEN_CREDENTIALS must be set.
+// NewDefaultAzureCredential returns an error when RequireAzureTokenCredentials is true and AZURE_TOKEN_CREDENTIALS
+// has no value.
+//
// [DefaultAzureCredential overview]: https://aka.ms/azsdk/go/identity/credential-chains#defaultazurecredential-overview
type DefaultAzureCredential struct {
chain *ChainedTokenCredential
@@ -89,16 +99,20 @@ type DefaultAzureCredential struct {
// NewDefaultAzureCredential creates a DefaultAzureCredential. Pass nil for options to accept defaults.
func NewDefaultAzureCredential(options *DefaultAzureCredentialOptions) (*DefaultAzureCredential, error) {
+ if options == nil {
+ options = &DefaultAzureCredentialOptions{}
+ }
+
var (
creds []azcore.TokenCredential
errorMessages []string
- selected = env | workloadIdentity | managedIdentity | az | azd
+ selected = env | workloadIdentity | managedIdentity | az | azd | azurePowerShell
)
if atc, ok := os.LookupEnv(azureTokenCredentials); ok {
switch {
case atc == "dev":
- selected = az | azd
+ selected = az | azd | azurePowerShell
case atc == "prod":
selected = env | workloadIdentity | managedIdentity
case strings.EqualFold(atc, credNameEnvironment):
@@ -111,14 +125,15 @@ func NewDefaultAzureCredential(options *DefaultAzureCredentialOptions) (*Default
selected = az
case strings.EqualFold(atc, credNameAzureDeveloperCLI):
selected = azd
+ case strings.EqualFold(atc, credNameAzurePowerShell):
+ selected = azurePowerShell
default:
return nil, fmt.Errorf(`invalid %s value %q. Valid values are "dev", "prod", or the name of any credential type in the default chain. See https://aka.ms/azsdk/go/identity/docs#DefaultAzureCredential for more information`, azureTokenCredentials, atc)
}
+ } else if options.RequireAzureTokenCredentials {
+ return nil, fmt.Errorf("%s must be set when RequireAzureTokenCredentials is true. See https://aka.ms/azsdk/go/identity/docs#DefaultAzureCredential for more information", azureTokenCredentials)
}
- if options == nil {
- options = &DefaultAzureCredentialOptions{}
- }
additionalTenants := options.AdditionallyAllowedTenants
if len(additionalTenants) == 0 {
if tenants := os.Getenv(azureAdditionallyAllowedTenants); tenants != "" {
@@ -153,7 +168,11 @@ func NewDefaultAzureCredential(options *DefaultAzureCredentialOptions) (*Default
}
}
if selected&managedIdentity != 0 {
- o := &ManagedIdentityCredentialOptions{ClientOptions: options.ClientOptions, dac: true}
+ o := &ManagedIdentityCredentialOptions{
+ ClientOptions: options.ClientOptions,
+ // enable special DefaultAzureCredential behavior (IMDS probing) only when the chain contains another credential
+ dac: selected^managedIdentity != 0,
+ }
if ID, ok := os.LookupEnv(azureClientID); ok {
o.ID = ClientID(ID)
}
@@ -191,6 +210,19 @@ func NewDefaultAzureCredential(options *DefaultAzureCredentialOptions) (*Default
creds = append(creds, &defaultCredentialErrorReporter{credType: credNameAzureDeveloperCLI, err: err})
}
}
+ if selected&azurePowerShell != 0 {
+ azurePowerShellCred, err := NewAzurePowerShellCredential(&AzurePowerShellCredentialOptions{
+ AdditionallyAllowedTenants: additionalTenants,
+ TenantID: options.TenantID,
+ inDefaultChain: true,
+ })
+ if err == nil {
+ creds = append(creds, azurePowerShellCred)
+ } else {
+ errorMessages = append(errorMessages, credNameAzurePowerShell+": "+err.Error())
+ creds = append(creds, &defaultCredentialErrorReporter{credType: credNameAzurePowerShell, err: err})
+ }
+ }
if len(errorMessages) > 0 {
log.Writef(EventAuthentication, "NewDefaultAzureCredential failed to initialize some credentials:\n\t%s", strings.Join(errorMessages, "\n\t"))
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go
index be963d3a2a..cb7dbe2e4b 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go
@@ -7,22 +7,72 @@
package azidentity
import (
+ "bytes"
+ "context"
"errors"
+ "os"
+ "os/exec"
+ "strings"
"time"
)
// cliTimeout is the default timeout for authentication attempts via CLI tools
const cliTimeout = 10 * time.Second
-// unavailableIfInChain returns err or, if the credential was invoked by DefaultAzureCredential, a
+// executor runs a command and returns its output or an error
+type executor func(ctx context.Context, credName, command string) ([]byte, error)
+
+var shellExec = func(ctx context.Context, credName, command string) ([]byte, error) {
+ // set a default timeout for this authentication iff the caller hasn't done so already
+ var cancel context.CancelFunc
+ if _, hasDeadline := ctx.Deadline(); !hasDeadline {
+ ctx, cancel = context.WithTimeout(ctx, cliTimeout)
+ defer cancel()
+ }
+ cmd, err := buildCmd(ctx, credName, command)
+ if err != nil {
+ return nil, err
+ }
+ cmd.Env = os.Environ()
+ stderr := bytes.Buffer{}
+ cmd.Stderr = &stderr
+ cmd.WaitDelay = 100 * time.Millisecond
+
+ stdout, err := cmd.Output()
+ if errors.Is(err, exec.ErrWaitDelay) && len(stdout) > 0 {
+ // The child process wrote to stdout and exited without closing it.
+ // Swallow this error and return stdout because it may contain a token.
+ return stdout, nil
+ }
+ if err != nil {
+ msg := stderr.String()
+ var exErr *exec.ExitError
+ if errors.As(err, &exErr) && exErr.ExitCode() == 127 || strings.Contains(msg, "' is not recognized") {
+ return nil, newCredentialUnavailableError(credName, "executable not found on path")
+ }
+ if credName == credNameAzurePowerShell {
+ if strings.Contains(msg, "Connect-AzAccount") {
+ msg = `Please run "Connect-AzAccount" to set up an account`
+ }
+ if strings.Contains(msg, noAzAccountModule) {
+ msg = noAzAccountModule
+ }
+ }
+ if msg == "" {
+ msg = err.Error()
+ }
+ return nil, newAuthenticationFailedError(credName, msg, nil)
+ }
+
+ return stdout, nil
+}
+
+// unavailableIfInDAC returns err or, if the credential was invoked by DefaultAzureCredential, a
// credentialUnavailableError having the same message. This ensures DefaultAzureCredential will try
// the next credential in its chain (another developer credential).
-func unavailableIfInChain(err error, inDefaultChain bool) error {
- if err != nil && inDefaultChain {
- var unavailableErr credentialUnavailable
- if !errors.As(err, &unavailableErr) {
- err = newCredentialUnavailableError(credNameAzureDeveloperCLI, err.Error())
- }
+func unavailableIfInDAC(err error, inDefaultChain bool) error {
+ if err != nil && inDefaultChain && !errors.As(err, new(credentialUnavailable)) {
+ err = NewCredentialUnavailableError(err.Error())
}
return err
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util_nonwindows.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util_nonwindows.go
new file mode 100644
index 0000000000..681fcd0cf9
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util_nonwindows.go
@@ -0,0 +1,17 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//go:build !windows
+
+package azidentity
+
+import (
+ "context"
+ "os/exec"
+)
+
+func buildCmd(ctx context.Context, _, command string) (*exec.Cmd, error) {
+ cmd := exec.CommandContext(ctx, "/bin/sh", "-c", command)
+ cmd.Dir = "/bin"
+ return cmd, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util_windows.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util_windows.go
new file mode 100644
index 0000000000..09c7a1a977
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util_windows.go
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import (
+ "context"
+ "os"
+ "os/exec"
+ "syscall"
+)
+
+func buildCmd(ctx context.Context, credName, command string) (*exec.Cmd, error) {
+ dir := os.Getenv("SYSTEMROOT")
+ if dir == "" {
+ return nil, newCredentialUnavailableError(credName, `environment variable "SYSTEMROOT" has no value`)
+ }
+ cmd := exec.CommandContext(ctx, "cmd.exe")
+ cmd.Dir = dir
+ cmd.SysProcAttr = &syscall.SysProcAttr{CmdLine: "/c " + command}
+ return cmd, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go
index a6d7c6cbc7..33cb63be09 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go
@@ -99,6 +99,8 @@ func (e *AuthenticationFailedError) Error() string {
anchor = "apc"
case credNameCert:
anchor = "client-cert"
+ case credNameAzurePowerShell:
+ anchor = "azure-pwsh"
case credNameSecret:
anchor = "client-secret"
case credNameManagedIdentity:
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed-identity-matrix.json b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed-identity-matrix.json
index f92245533f..063325c69d 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed-identity-matrix.json
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed-identity-matrix.json
@@ -10,8 +10,7 @@
},
"GoVersion": [
"env:GO_VERSION_PREVIOUS"
- ],
- "IDENTITY_IMDS_AVAILABLE": "1"
+ ]
}
]
-}
+}
\ No newline at end of file
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-post.ps1 b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-post.ps1
index 874d4ef37d..c5634cd21d 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-post.ps1
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-post.ps1
@@ -41,7 +41,7 @@ if ($CI) {
az account set --subscription $SubscriptionId
}
-Write-Host "Building container"
+Write-Host "##[group]Building container"
$image = "$($DeploymentOutputs['AZIDENTITY_ACR_LOGIN_SERVER'])/azidentity-managed-id-test"
Set-Content -Path "$PSScriptRoot/Dockerfile" -Value @"
FROM mcr.microsoft.com/oss/go/microsoft/golang:latest AS builder
@@ -62,11 +62,34 @@ CMD ["./managed-id-test"]
docker build -t $image "$PSScriptRoot"
az acr login -n $DeploymentOutputs['AZIDENTITY_ACR_NAME']
docker push $image
+Write-Host "##[endgroup]"
$rg = $DeploymentOutputs['AZIDENTITY_RESOURCE_GROUP']
+Write-Host "##[group]Deploying to VM"
+# az will return 0 when the script fails on the VM, so the script prints a UUID to indicate all commands succeeded
+$uuid = [guid]::NewGuid().ToString()
+$vmScript = @"
+az acr login -n $($DeploymentOutputs['AZIDENTITY_ACR_NAME']) && \
+sudo docker run \
+-e AZIDENTITY_STORAGE_NAME=$($DeploymentOutputs['AZIDENTITY_STORAGE_NAME']) \
+-e AZIDENTITY_STORAGE_NAME_USER_ASSIGNED=$($DeploymentOutputs['AZIDENTITY_STORAGE_NAME_USER_ASSIGNED']) \
+-e AZIDENTITY_USER_ASSIGNED_IDENTITY=$($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY']) \
+-e AZIDENTITY_USER_ASSIGNED_IDENTITY_CLIENT_ID=$($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY_CLIENT_ID']) \
+-e AZIDENTITY_USER_ASSIGNED_IDENTITY_OBJECT_ID=$($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY_OBJECT_ID']) \
+-p 80:8080 -d \
+$image && \
+/usr/bin/echo $uuid
+"@
+$output = az vm run-command invoke -g $rg -n $DeploymentOutputs['AZIDENTITY_VM_NAME'] --command-id RunShellScript --scripts "$vmScript" | Out-String
+Write-Host $output
+if (-not $output.Contains($uuid)) {
+ throw "couldn't start container on VM"
+}
+Write-Host "##[endgroup]"
+
# ACI is easier to provision here than in the bicep file because the image isn't available before now
-Write-Host "Deploying Azure Container Instance"
+Write-Host "##[group]Deploying Azure Container Instance"
$aciName = "azidentity-test"
az container create -g $rg -n $aciName --image $image `
--acr-identity $($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY']) `
@@ -85,23 +108,27 @@ az container create -g $rg -n $aciName --image $image `
FUNCTIONS_CUSTOMHANDLER_PORT=80
$aciIP = az container show -g $rg -n $aciName --query ipAddress.ip --output tsv
Write-Host "##vso[task.setvariable variable=AZIDENTITY_ACI_IP;]$aciIP"
+Write-Host "##[endgroup]"
# Azure Functions deployment: copy the Windows binary from the Docker image, deploy it in a zip
-Write-Host "Deploying to Azure Functions"
+Write-Host "##[group]Deploying to Azure Functions"
$container = docker create $image
docker cp ${container}:managed-id-test.exe "$PSScriptRoot/testdata/managed-id-test/"
docker rm -v $container
Compress-Archive -Path "$PSScriptRoot/testdata/managed-id-test/*" -DestinationPath func.zip -Force
az functionapp deploy -g $rg -n $DeploymentOutputs['AZIDENTITY_FUNCTION_NAME'] --src-path func.zip --type zip
+Write-Host "##[endgroup]"
-Write-Host "Creating federated identity"
+Write-Host "##[group]Creating federated identity"
$aksName = $DeploymentOutputs['AZIDENTITY_AKS_NAME']
$idName = $DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY_NAME']
$issuer = az aks show -g $rg -n $aksName --query "oidcIssuerProfile.issuerUrl" -otsv
$podName = "azidentity-test"
$serviceAccountName = "workload-identity-sa"
az identity federated-credential create -g $rg --identity-name $idName --issuer $issuer --name $idName --subject system:serviceaccount:default:$serviceAccountName --audiences api://AzureADTokenExchange
-Write-Host "Deploying to AKS"
+Write-Host "##[endgroup]"
+
+Write-Host "##[group]Deploying to AKS"
az aks get-credentials -g $rg -n $aksName
az aks update --attach-acr $DeploymentOutputs['AZIDENTITY_ACR_NAME'] -g $rg -n $aksName
Set-Content -Path "$PSScriptRoot/k8s.yaml" -Value @"
@@ -138,3 +165,4 @@ spec:
"@
kubectl apply -f "$PSScriptRoot/k8s.yaml"
Write-Host "##vso[task.setvariable variable=AZIDENTITY_POD_NAME;]$podName"
+Write-Host "##[endgroup]"
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources.bicep b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources.bicep
index 135feb0178..cb3b5f4df4 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources.bicep
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources.bicep
@@ -19,7 +19,10 @@ param location string = resourceGroup().location
// https://learn.microsoft.com/azure/role-based-access-control/built-in-roles
var acrPull = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7f951dda-4ed3-4680-a7ca-43fe172d538d')
-var blobReader = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '2a2b9908-6ea1-4ae2-8e65-a410df84e7d1')
+var blobReader = subscriptionResourceId(
+ 'Microsoft.Authorization/roleDefinitions',
+ '2a2b9908-6ea1-4ae2-8e65-a410df84e7d1'
+)
resource sa 'Microsoft.Storage/storageAccounts@2021-08-01' = if (deployResources) {
kind: 'StorageV2'
@@ -60,6 +63,16 @@ resource acrPullContainerInstance 'Microsoft.Authorization/roleAssignments@2022-
scope: containerRegistry
}
+resource acrPullVM 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (deployResources) {
+ name: guid(resourceGroup().id, acrPull, 'vm')
+ properties: {
+ principalId: deployResources ? vm.identity.principalId : ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionId: acrPull
+ }
+ scope: containerRegistry
+}
+
resource blobRoleUserAssigned 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (deployResources) {
scope: saUserAssigned
name: guid(resourceGroup().id, blobReader, usermgdid.id)
@@ -80,6 +93,16 @@ resource blobRoleFunc 'Microsoft.Authorization/roleAssignments@2022-04-01' = if
scope: sa
}
+resource blobRoleVM 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (deployResources) {
+ scope: sa
+ name: guid(resourceGroup().id, blobReader, 'vm')
+ properties: {
+ principalId: deployResources ? vm.identity.principalId : ''
+ roleDefinitionId: blobReader
+ principalType: 'ServicePrincipal'
+ }
+}
+
resource containerRegistry 'Microsoft.ContainerRegistry/registries@2023-01-01-preview' = if (deployResources) {
location: location
name: uniqueString(resourceGroup().id)
@@ -215,6 +238,143 @@ resource aks 'Microsoft.ContainerService/managedClusters@2023-06-01' = if (deplo
}
}
+resource publicIP 'Microsoft.Network/publicIPAddresses@2023-05-01' = if (deployResources) {
+ name: '${baseName}PublicIP'
+ location: location
+ sku: {
+ name: 'Standard'
+ }
+ properties: {
+ publicIPAllocationMethod: 'Static'
+ }
+}
+
+resource nsg 'Microsoft.Network/networkSecurityGroups@2024-07-01' = if (deployResources) {
+ name: '${baseName}NSG'
+ location: location
+ properties: {
+ securityRules: [
+ {
+ name: 'AllowHTTP'
+ properties: {
+ description: 'Allow HTTP traffic on port 80'
+ protocol: 'Tcp'
+ sourcePortRange: '*'
+ destinationPortRange: '80'
+ sourceAddressPrefix: '*'
+ destinationAddressPrefix: '*'
+ access: 'Allow'
+ priority: 1000
+ direction: 'Inbound'
+ }
+ }
+ ]
+ }
+}
+
+resource vnet 'Microsoft.Network/virtualNetworks@2024-07-01' = if (deployResources) {
+ name: '${baseName}vnet'
+ location: location
+ properties: {
+ addressSpace: {
+ addressPrefixes: [
+ '10.0.0.0/16'
+ ]
+ }
+ subnets: [
+ {
+ name: '${baseName}subnet'
+ properties: {
+ addressPrefix: '10.0.0.0/24'
+ defaultOutboundAccess: false
+ networkSecurityGroup: {
+ id: deployResources ? nsg.id : ''
+ }
+ }
+ }
+ ]
+ }
+}
+
+resource nic 'Microsoft.Network/networkInterfaces@2024-07-01' = if (deployResources) {
+ name: '${baseName}NIC'
+ location: location
+ properties: {
+ ipConfigurations: [
+ {
+ name: 'myIPConfig'
+ properties: {
+ privateIPAllocationMethod: 'Dynamic'
+ publicIPAddress: {
+ id: deployResources ? publicIP.id : ''
+ }
+ subnet: {
+ id: deployResources ? vnet.properties.subnets[0].id : ''
+ }
+ }
+ }
+ ]
+ }
+}
+
+resource vm 'Microsoft.Compute/virtualMachines@2024-07-01' = if (deployResources) {
+ name: '${baseName}vm'
+ location: location
+ identity: {
+ type: 'SystemAssigned, UserAssigned'
+ userAssignedIdentities: {
+ '${deployResources ? usermgdid.id: ''}': {}
+ }
+ }
+ properties: {
+ hardwareProfile: {
+ vmSize: 'Standard_DS1_v2'
+ }
+ osProfile: {
+ adminUsername: adminUser
+ computerName: '${baseName}vm'
+ customData: base64('''
+#cloud-config
+package_update: true
+packages:
+ - docker.io
+runcmd:
+ - curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
+ - az login --identity --allow-no-subscriptions
+''')
+ linuxConfiguration: {
+ disablePasswordAuthentication: true
+ ssh: {
+ publicKeys: [
+ {
+ path: '/home/${adminUser}/.ssh/authorized_keys'
+ keyData: sshPubKey
+ }
+ ]
+ }
+ }
+ }
+ networkProfile: {
+ networkInterfaces: [
+ {
+ id: deployResources ? nic.id : ''
+ }
+ ]
+ }
+ storageProfile: {
+ imageReference: {
+ publisher: 'Canonical'
+ offer: 'ubuntu-24_04-lts'
+ sku: 'server'
+ version: 'latest'
+ }
+ osDisk: {
+ createOption: 'FromImage'
+ }
+ }
+ }
+}
+
output AZIDENTITY_ACR_LOGIN_SERVER string = deployResources ? containerRegistry.properties.loginServer : ''
output AZIDENTITY_ACR_NAME string = deployResources ? containerRegistry.name : ''
output AZIDENTITY_AKS_NAME string = deployResources ? aks.name : ''
@@ -226,3 +386,5 @@ output AZIDENTITY_USER_ASSIGNED_IDENTITY string = deployResources ? usermgdid.id
output AZIDENTITY_USER_ASSIGNED_IDENTITY_CLIENT_ID string = deployResources ? usermgdid.properties.clientId : ''
output AZIDENTITY_USER_ASSIGNED_IDENTITY_NAME string = deployResources ? usermgdid.name : ''
output AZIDENTITY_USER_ASSIGNED_IDENTITY_OBJECT_ID string = deployResources ? usermgdid.properties.principalId : ''
+output AZIDENTITY_VM_NAME string = deployResources ? vm.name : ''
+output AZIDENTITY_VM_IP string = deployResources ? publicIP.properties.ipAddress : ''
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go
index c3a70c4f2e..041f11658d 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go
@@ -14,5 +14,5 @@ const (
module = "github.com/Azure/azure-sdk-for-go/sdk/" + component
// Version is the semantic version (see http://semver.org) of this module.
- version = "v1.11.0"
+ version = "v1.13.1"
)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/CHANGELOG.md
new file mode 100644
index 0000000000..9b6ea54406
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/CHANGELOG.md
@@ -0,0 +1,204 @@
+# Release History
+
+## 2.0.0 (2025-09-25)
+### Breaking Changes
+
+- Type of `TriggerParameters.IntervalUnit` has been changed from `*string` to `*IntervalUnit`
+- Type of `TriggerParametersUpdate.IntervalUnit` has been changed from `*string` to `*IntervalUnit`
+
+### Features Added
+
+- New enum type `IntervalUnit` with values `IntervalUnitDays`
+- New enum type `ZonePlacementPolicy` with values `ZonePlacementPolicyAny`, `ZonePlacementPolicyNone`
+- New struct `AccountIPv6Endpoints`
+- New struct `DualStackEndpointPreference`
+- New struct `EncryptionInTransit`
+- New struct `NfsSetting`
+- New struct `Placement`
+- New struct `SKUInformationLocationInfoItem`
+- New struct `SmbOAuthSettings`
+- New field `Placement`, `Zones` in struct `Account`
+- New field `Placement`, `Zones` in struct `AccountCreateParameters`
+- New field `DualStackEndpointPreference` in struct `AccountProperties`
+- New field `DualStackEndpointPreference` in struct `AccountPropertiesCreateParameters`
+- New field `DualStackEndpointPreference` in struct `AccountPropertiesUpdateParameters`
+- New field `Placement`, `Zones` in struct `AccountUpdateParameters`
+- New field `SmbOAuthSettings` in struct `AzureFilesIdentityBasedAuthentication`
+- New field `IPv6Endpoints` in struct `Endpoints`
+- New field `IPv6Rules` in struct `NetworkRuleSet`
+- New field `Nfs` in struct `ProtocolSettings`
+- New field `LocationInfo` in struct `SKUInformation`
+- New field `EncryptionInTransit` in struct `SmbSetting`
+
+
+## 1.8.1 (2025-06-30)
+### Other Changes
+
+- Field `StartOn` of struct `TriggerParameters` changed to `required`
+
+## 1.8.0 (2025-04-08)
+### Features Added
+
+- New value `ProvisioningStateAccepted` added to enum type `ProvisioningState`
+
+
+## 1.7.0 (2025-02-27)
+### Features Added
+
+- New value `SKUNamePremiumV2LRS`, `SKUNamePremiumV2ZRS`, `SKUNameStandardV2GRS`, `SKUNameStandardV2GZRS`, `SKUNameStandardV2LRS`, `SKUNameStandardV2ZRS` added to enum type `SKUName`
+- New function `*FileServicesClient.GetServiceUsage(context.Context, string, string, *FileServicesClientGetServiceUsageOptions) (FileServicesClientGetServiceUsageResponse, error)`
+- New function `*FileServicesClient.NewListServiceUsagesPager(string, string, *FileServicesClientListServiceUsagesOptions) *runtime.Pager[FileServicesClientListServiceUsagesResponse]`
+- New struct `AccountLimits`
+- New struct `AccountUsage`
+- New struct `AccountUsageElements`
+- New struct `BurstingConstants`
+- New struct `FileServiceUsage`
+- New struct `FileServiceUsageProperties`
+- New struct `FileServiceUsages`
+- New struct `FileShareLimits`
+- New struct `FileSharePropertiesFileSharePaidBursting`
+- New struct `FileShareRecommendations`
+- New struct `ObjectReplicationPolicyPropertiesMetrics`
+- New field `FileSharePaidBursting`, `IncludedBurstIops`, `MaxBurstCreditsForIops`, `NextAllowedProvisionedBandwidthDowngradeTime`, `NextAllowedProvisionedIopsDowngradeTime`, `NextAllowedQuotaDowngradeTime`, `ProvisionedBandwidthMibps`, `ProvisionedIops` in struct `FileShareProperties`
+- New field `Metrics` in struct `ObjectReplicationPolicyProperties`
+
+
+## 1.6.0 (2024-06-28)
+### Features Added
+
+- New value `AccessTierCold` added to enum type `AccessTier`
+- New value `ExpirationActionBlock` added to enum type `ExpirationAction`
+- New value `MinimumTLSVersionTLS13` added to enum type `MinimumTLSVersion`
+- New value `ProvisioningStateCanceled`, `ProvisioningStateDeleting`, `ProvisioningStateFailed`, `ProvisioningStateValidateSubscriptionQuotaBegin`, `ProvisioningStateValidateSubscriptionQuotaEnd` added to enum type `ProvisioningState`
+- New value `PublicNetworkAccessSecuredByPerimeter` added to enum type `PublicNetworkAccess`
+- New enum type `IssueType` with values `IssueTypeConfigurationPropagationFailure`, `IssueTypeUnknown`
+- New enum type `ListLocalUserIncludeParam` with values `ListLocalUserIncludeParamNfsv3`
+- New enum type `NetworkSecurityPerimeterConfigurationProvisioningState` with values `NetworkSecurityPerimeterConfigurationProvisioningStateAccepted`, `NetworkSecurityPerimeterConfigurationProvisioningStateCanceled`, `NetworkSecurityPerimeterConfigurationProvisioningStateDeleting`, `NetworkSecurityPerimeterConfigurationProvisioningStateFailed`, `NetworkSecurityPerimeterConfigurationProvisioningStateSucceeded`
+- New enum type `NspAccessRuleDirection` with values `NspAccessRuleDirectionInbound`, `NspAccessRuleDirectionOutbound`
+- New enum type `ResourceAssociationAccessMode` with values `ResourceAssociationAccessModeAudit`, `ResourceAssociationAccessModeEnforced`, `ResourceAssociationAccessModeLearning`
+- New enum type `RunResult` with values `RunResultFailed`, `RunResultSucceeded`
+- New enum type `RunStatusEnum` with values `RunStatusEnumFinished`, `RunStatusEnumInProgress`
+- New enum type `Severity` with values `SeverityError`, `SeverityWarning`
+- New enum type `TriggerType` with values `TriggerTypeOnSchedule`, `TriggerTypeRunOnce`
+- New function `*ClientFactory.NewNetworkSecurityPerimeterConfigurationsClient() *NetworkSecurityPerimeterConfigurationsClient`
+- New function `*ClientFactory.NewTaskAssignmentInstancesReportClient() *TaskAssignmentInstancesReportClient`
+- New function `*ClientFactory.NewTaskAssignmentsClient() *TaskAssignmentsClient`
+- New function `*ClientFactory.NewTaskAssignmentsInstancesReportClient() *TaskAssignmentsInstancesReportClient`
+- New function `NewTaskAssignmentInstancesReportClient(string, azcore.TokenCredential, *arm.ClientOptions) (*TaskAssignmentInstancesReportClient, error)`
+- New function `*TaskAssignmentInstancesReportClient.NewListPager(string, string, string, *TaskAssignmentInstancesReportClientListOptions) *runtime.Pager[TaskAssignmentInstancesReportClientListResponse]`
+- New function `NewTaskAssignmentsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*TaskAssignmentsClient, error)`
+- New function `*TaskAssignmentsClient.BeginCreate(context.Context, string, string, string, TaskAssignment, *TaskAssignmentsClientBeginCreateOptions) (*runtime.Poller[TaskAssignmentsClientCreateResponse], error)`
+- New function `*TaskAssignmentsClient.BeginDelete(context.Context, string, string, string, *TaskAssignmentsClientBeginDeleteOptions) (*runtime.Poller[TaskAssignmentsClientDeleteResponse], error)`
+- New function `*TaskAssignmentsClient.Get(context.Context, string, string, string, *TaskAssignmentsClientGetOptions) (TaskAssignmentsClientGetResponse, error)`
+- New function `*TaskAssignmentsClient.NewListPager(string, string, *TaskAssignmentsClientListOptions) *runtime.Pager[TaskAssignmentsClientListResponse]`
+- New function `*TaskAssignmentsClient.BeginUpdate(context.Context, string, string, string, TaskAssignmentUpdateParameters, *TaskAssignmentsClientBeginUpdateOptions) (*runtime.Poller[TaskAssignmentsClientUpdateResponse], error)`
+- New function `NewTaskAssignmentsInstancesReportClient(string, azcore.TokenCredential, *arm.ClientOptions) (*TaskAssignmentsInstancesReportClient, error)`
+- New function `*TaskAssignmentsInstancesReportClient.NewListPager(string, string, *TaskAssignmentsInstancesReportClientListOptions) *runtime.Pager[TaskAssignmentsInstancesReportClientListResponse]`
+- New function `NewNetworkSecurityPerimeterConfigurationsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NetworkSecurityPerimeterConfigurationsClient, error)`
+- New function `*NetworkSecurityPerimeterConfigurationsClient.Get(context.Context, string, string, string, *NetworkSecurityPerimeterConfigurationsClientGetOptions) (NetworkSecurityPerimeterConfigurationsClientGetResponse, error)`
+- New function `*NetworkSecurityPerimeterConfigurationsClient.NewListPager(string, string, *NetworkSecurityPerimeterConfigurationsClientListOptions) *runtime.Pager[NetworkSecurityPerimeterConfigurationsClientListResponse]`
+- New function `*NetworkSecurityPerimeterConfigurationsClient.BeginReconcile(context.Context, string, string, string, *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*runtime.Poller[NetworkSecurityPerimeterConfigurationsClientReconcileResponse], error)`
+- New struct `ExecutionTarget`
+- New struct `ExecutionTrigger`
+- New struct `ExecutionTriggerUpdate`
+- New struct `NetworkSecurityPerimeter`
+- New struct `NetworkSecurityPerimeterConfiguration`
+- New struct `NetworkSecurityPerimeterConfigurationList`
+- New struct `NetworkSecurityPerimeterConfigurationProperties`
+- New struct `NetworkSecurityPerimeterConfigurationPropertiesProfile`
+- New struct `NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation`
+- New struct `NspAccessRule`
+- New struct `NspAccessRuleProperties`
+- New struct `NspAccessRulePropertiesSubscriptionsItem`
+- New struct `ProvisioningIssue`
+- New struct `ProvisioningIssueProperties`
+- New struct `ProxyResourceAutoGenerated`
+- New struct `ResourceAutoGenerated`
+- New struct `TaskAssignment`
+- New struct `TaskAssignmentExecutionContext`
+- New struct `TaskAssignmentProperties`
+- New struct `TaskAssignmentReport`
+- New struct `TaskAssignmentUpdateExecutionContext`
+- New struct `TaskAssignmentUpdateParameters`
+- New struct `TaskAssignmentUpdateProperties`
+- New struct `TaskAssignmentUpdateReport`
+- New struct `TaskAssignmentsList`
+- New struct `TaskReportInstance`
+- New struct `TaskReportProperties`
+- New struct `TaskReportSummary`
+- New struct `TriggerParameters`
+- New struct `TriggerParametersUpdate`
+- New field `EnableExtendedGroups` in struct `AccountProperties`
+- New field `EnableExtendedGroups` in struct `AccountPropertiesCreateParameters`
+- New field `EnableExtendedGroups` in struct `AccountPropertiesUpdateParameters`
+- New field `AllowACLAuthorization`, `ExtendedGroups`, `GroupID`, `IsNFSv3Enabled`, `UserID` in struct `LocalUserProperties`
+- New field `NextLink` in struct `LocalUsers`
+- New field `Filter`, `Include`, `Maxpagesize` in struct `LocalUsersClientListOptions`
+
+
+## 1.5.0 (2023-11-24)
+### Features Added
+
+- Support for test fakes and OpenTelemetry trace spans.
+
+
+## 1.5.0-beta.1 (2023-10-09)
+### Features Added
+
+- Support for test fakes and OpenTelemetry trace spans.
+
+## 1.4.0 (2023-08-25)
+### Features Added
+
+- New value `CorsRuleAllowedMethodsItemCONNECT`, `CorsRuleAllowedMethodsItemTRACE` added to enum type `CorsRuleAllowedMethodsItem`
+- New enum type `MigrationName` with values `MigrationNameDefault`
+- New enum type `MigrationStatus` with values `MigrationStatusComplete`, `MigrationStatusFailed`, `MigrationStatusInProgress`, `MigrationStatusInvalid`, `MigrationStatusSubmittedForConversion`
+- New enum type `PostFailoverRedundancy` with values `PostFailoverRedundancyStandardLRS`, `PostFailoverRedundancyStandardZRS`
+- New enum type `PostPlannedFailoverRedundancy` with values `PostPlannedFailoverRedundancyStandardGRS`, `PostPlannedFailoverRedundancyStandardGZRS`, `PostPlannedFailoverRedundancyStandardRAGRS`, `PostPlannedFailoverRedundancyStandardRAGZRS`
+- New function `*AccountsClient.BeginCustomerInitiatedMigration(context.Context, string, string, AccountMigration, *AccountsClientBeginCustomerInitiatedMigrationOptions) (*runtime.Poller[AccountsClientCustomerInitiatedMigrationResponse], error)`
+- New function `*AccountsClient.GetCustomerInitiatedMigration(context.Context, string, string, MigrationName, *AccountsClientGetCustomerInitiatedMigrationOptions) (AccountsClientGetCustomerInitiatedMigrationResponse, error)`
+- New struct `AccountMigration`
+- New struct `AccountMigrationProperties`
+- New struct `BlobInventoryCreationTime`
+- New struct `ErrorAdditionalInfo`
+- New struct `ErrorDetail`
+- New struct `ErrorResponseAutoGenerated`
+- New field `AccountMigrationInProgress`, `IsSKUConversionBlocked` in struct `AccountProperties`
+- New field `CreationTime` in struct `BlobInventoryPolicyFilter`
+- New field `CanPlannedFailover`, `PostFailoverRedundancy`, `PostPlannedFailoverRedundancy` in struct `GeoReplicationStats`
+
+
+## 1.3.0 (2023-03-27)
+### Features Added
+
+- New struct `ClientFactory` which is a client factory used to create any client in this module
+
+## 1.2.0 (2022-12-23)
+### Features Added
+
+- New type alias `ListEncryptionScopesInclude`
+- New field `FailoverType` in struct `AccountsClientBeginFailoverOptions`
+- New field `TierToCold` in struct `ManagementPolicyBaseBlob`
+- New field `TierToHot` in struct `ManagementPolicyBaseBlob`
+- New field `Filter` in struct `EncryptionScopesClientListOptions`
+- New field `Include` in struct `EncryptionScopesClientListOptions`
+- New field `Maxpagesize` in struct `EncryptionScopesClientListOptions`
+- New field `TierToHot` in struct `ManagementPolicyVersion`
+- New field `TierToCold` in struct `ManagementPolicyVersion`
+- New field `TierToCold` in struct `ManagementPolicySnapShot`
+- New field `TierToHot` in struct `ManagementPolicySnapShot`
+
+
+## 1.1.0 (2022-08-10)
+### Features Added
+
+- New const `DirectoryServiceOptionsAADKERB`
+
+
+## 1.0.0 (2022-05-16)
+
+The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes.
+
+To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/azsdk/go/mgmt/migration).
+
+To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt).
\ No newline at end of file
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/LICENSE.txt b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/LICENSE.txt
new file mode 100644
index 0000000000..dc0c2ffb3d
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/LICENSE.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) Microsoft Corporation. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/README.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/README.md
new file mode 100644
index 0000000000..913f0d30d9
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/README.md
@@ -0,0 +1,100 @@
+# Azure Storage Module for Go
+
+The `armstorage` module provides operations for working with Azure Storage.
+
+[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/storage/armstorage)
+
+# Getting started
+
+## Prerequisites
+
+- an [Azure subscription](https://azure.microsoft.com/free/)
+- [Supported](https://aka.ms/azsdk/go/supported-versions) version of Go (You could download and install the latest version of Go from [here](https://go.dev/doc/install). It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this [doc](https://go.dev/doc/manage-install).)
+
+## Install the package
+
+This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management.
+
+Install the Azure Storage module:
+
+```sh
+go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2
+```
+
+## Authorization
+
+When creating a client, you will need to provide a credential for authenticating with Azure Storage. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.
+
+```go
+cred, err := azidentity.NewDefaultAzureCredential(nil)
+```
+
+For more information on authentication, please see the documentation for `azidentity` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity).
+
+## Client Factory
+
+Azure Storage module consists of one or more clients. We provide a client factory which could be used to create any client in this module.
+
+```go
+clientFactory, err := armstorage.NewClientFactory(, cred, nil)
+```
+
+You can use `ClientOptions` in package `github.com/Azure/azure-sdk-for-go/sdk/azcore/arm` to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for `azcore` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore).
+
+```go
+options := arm.ClientOptions {
+ ClientOptions: azcore.ClientOptions {
+ Cloud: cloud.AzureChina,
+ },
+}
+clientFactory, err := armstorage.NewClientFactory(, cred, &options)
+```
+
+## Clients
+
+A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.
+
+```go
+client := clientFactory.NewAccountsClient()
+```
+
+## Fakes
+
+The fake package contains types used for constructing in-memory fake servers used in unit tests.
+This allows writing tests to cover various success/error conditions without the need for connecting to a live service.
+
+Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes.
+
+## More sample code
+
+- [Blob](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/storage/blob)
+- [Creating a Fake](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/resourcemanager/storage/armstorage/fake_example_test.go)
+- [File](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/storage/file)
+- [Management Policy](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/storage/managementpolicy)
+- [Queue](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/storage/queue)
+- [Storage Account](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/storage/storageaccount)
+- [Table](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/storage/table)
+
+## Provide Feedback
+
+If you encounter bugs or have suggestions, please
+[open an issue](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `Storage` label.
+
+# Contributing
+
+This project welcomes contributions and suggestions. Most contributions require
+you to agree to a Contributor License Agreement (CLA) declaring that you have
+the right to, and actually do, grant us the rights to use your contribution.
+For details, visit [https://cla.microsoft.com](https://cla.microsoft.com).
+
+When you submit a pull request, a CLA-bot will automatically determine whether
+you need to provide a CLA and decorate the PR appropriately (e.g., label,
+comment). Simply follow the instructions provided by the bot. You will only
+need to do this once across all repos using our CLA.
+
+This project has adopted the
+[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
+For more information, see the
+[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
+or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any
+additional questions or comments.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/accounts_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/accounts_client.go
new file mode 100644
index 0000000000..f8a54413ff
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/accounts_client.go
@@ -0,0 +1,1327 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// AccountsClient contains the methods for the StorageAccounts group.
+// Don't use this type directly, use NewAccountsClient() instead.
+type AccountsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewAccountsClient creates a new instance of AccountsClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewAccountsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AccountsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &AccountsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginAbortHierarchicalNamespaceMigration - Abort live Migration of storage account to enable Hns
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions contains the optional parameters for the AccountsClient.BeginAbortHierarchicalNamespaceMigration
+// method.
+func (client *AccountsClient) BeginAbortHierarchicalNamespaceMigration(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions) (*runtime.Poller[AccountsClientAbortHierarchicalNamespaceMigrationResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.abortHierarchicalNamespaceMigration(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientAbortHierarchicalNamespaceMigrationResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AccountsClientAbortHierarchicalNamespaceMigrationResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// AbortHierarchicalNamespaceMigration - Abort live Migration of storage account to enable Hns
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+func (client *AccountsClient) abortHierarchicalNamespaceMigration(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions) (*http.Response, error) {
+ var err error
+ const operationName = "AccountsClient.BeginAbortHierarchicalNamespaceMigration"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.abortHierarchicalNamespaceMigrationCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// abortHierarchicalNamespaceMigrationCreateRequest creates the AbortHierarchicalNamespaceMigration request.
+func (client *AccountsClient) abortHierarchicalNamespaceMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/aborthnsonmigration"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// CheckNameAvailability - Checks that the storage account name is valid and is not already in use.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - AccountsClientCheckNameAvailabilityOptions contains the optional parameters for the AccountsClient.CheckNameAvailability
+// method.
+func (client *AccountsClient) CheckNameAvailability(ctx context.Context, accountName AccountCheckNameAvailabilityParameters, options *AccountsClientCheckNameAvailabilityOptions) (AccountsClientCheckNameAvailabilityResponse, error) {
+ var err error
+ const operationName = "AccountsClient.CheckNameAvailability"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.checkNameAvailabilityCreateRequest(ctx, accountName, options)
+ if err != nil {
+ return AccountsClientCheckNameAvailabilityResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AccountsClientCheckNameAvailabilityResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AccountsClientCheckNameAvailabilityResponse{}, err
+ }
+ resp, err := client.checkNameAvailabilityHandleResponse(httpResp)
+ return resp, err
+}
+
+// checkNameAvailabilityCreateRequest creates the CheckNameAvailability request.
+func (client *AccountsClient) checkNameAvailabilityCreateRequest(ctx context.Context, accountName AccountCheckNameAvailabilityParameters, _ *AccountsClientCheckNameAvailabilityOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, accountName); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// checkNameAvailabilityHandleResponse handles the CheckNameAvailability response.
+func (client *AccountsClient) checkNameAvailabilityHandleResponse(resp *http.Response) (AccountsClientCheckNameAvailabilityResponse, error) {
+ result := AccountsClientCheckNameAvailabilityResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CheckNameAvailabilityResult); err != nil {
+ return AccountsClientCheckNameAvailabilityResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginCreate - Asynchronously creates a new storage account with the specified parameters. If an account is already created
+// and a subsequent create request is issued with different properties, the account properties
+// will be updated. If an account is already created and a subsequent create or update request is issued with the exact same
+// set of properties, the request will succeed.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The parameters to provide for the created account.
+// - options - AccountsClientBeginCreateOptions contains the optional parameters for the AccountsClient.BeginCreate method.
+func (client *AccountsClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters, options *AccountsClientBeginCreateOptions) (*runtime.Poller[AccountsClientCreateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.create(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientCreateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AccountsClientCreateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Create - Asynchronously creates a new storage account with the specified parameters. If an account is already created and
+// a subsequent create request is issued with different properties, the account properties
+// will be updated. If an account is already created and a subsequent create or update request is issued with the exact same
+// set of properties, the request will succeed.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+func (client *AccountsClient) create(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters, options *AccountsClientBeginCreateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "AccountsClient.BeginCreate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createCreateRequest creates the Create request.
+func (client *AccountsClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters, _ *AccountsClientBeginCreateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginCustomerInitiatedMigration - Account Migration request can be triggered for a storage account to change its redundancy
+// level. The migration updates the non-zonal redundant storage account to a zonal redundant account or
+// vice-versa in order to have better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account
+// synchronously across three Azure availability zones in the primary region.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The request parameters required to perform storage account migration.
+// - options - AccountsClientBeginCustomerInitiatedMigrationOptions contains the optional parameters for the AccountsClient.BeginCustomerInitiatedMigration
+// method.
+func (client *AccountsClient) BeginCustomerInitiatedMigration(ctx context.Context, resourceGroupName string, accountName string, parameters AccountMigration, options *AccountsClientBeginCustomerInitiatedMigrationOptions) (*runtime.Poller[AccountsClientCustomerInitiatedMigrationResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.customerInitiatedMigration(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientCustomerInitiatedMigrationResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AccountsClientCustomerInitiatedMigrationResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CustomerInitiatedMigration - Account Migration request can be triggered for a storage account to change its redundancy
+// level. The migration updates the non-zonal redundant storage account to a zonal redundant account or
+// vice-versa in order to have better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account
+// synchronously across three Azure availability zones in the primary region.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+func (client *AccountsClient) customerInitiatedMigration(ctx context.Context, resourceGroupName string, accountName string, parameters AccountMigration, options *AccountsClientBeginCustomerInitiatedMigrationOptions) (*http.Response, error) {
+ var err error
+ const operationName = "AccountsClient.BeginCustomerInitiatedMigration"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.customerInitiatedMigrationCreateRequest(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// customerInitiatedMigrationCreateRequest creates the CustomerInitiatedMigration request.
+func (client *AccountsClient) customerInitiatedMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountMigration, _ *AccountsClientBeginCustomerInitiatedMigrationOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/startAccountMigration"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// Delete - Deletes a storage account in Microsoft Azure.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - AccountsClientDeleteOptions contains the optional parameters for the AccountsClient.Delete method.
+func (client *AccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientDeleteOptions) (AccountsClientDeleteResponse, error) {
+ var err error
+ const operationName = "AccountsClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return AccountsClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AccountsClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return AccountsClientDeleteResponse{}, err
+ }
+ return AccountsClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *AccountsClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ return req, nil
+}
+
+// BeginFailover - A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable
+// for any reason. The failover occurs from the storage account's primary cluster to the
+// secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover and the account is converted
+// to LRS. In the case of a Planned Failover, the primary and secondary
+// clusters are swapped after failover and the account remains geo-replicated. Failover should continue to be used in the
+// event of availability issues as Planned failover is only available while the
+// primary and secondary endpoints are available. The primary use case of a Planned Failover is disaster recovery testing
+// drills. This type of failover is invoked by setting FailoverType parameter to
+// 'Planned'. Learn more about the failover options here- https://learn.microsoft.com/azure/storage/common/storage-disaster-recovery-guidance
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - AccountsClientBeginFailoverOptions contains the optional parameters for the AccountsClient.BeginFailover method.
+func (client *AccountsClient) BeginFailover(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginFailoverOptions) (*runtime.Poller[AccountsClientFailoverResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.failover(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientFailoverResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AccountsClientFailoverResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Failover - A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable
+// for any reason. The failover occurs from the storage account's primary cluster to the
+// secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover and the account is converted
+// to LRS. In the case of a Planned Failover, the primary and secondary
+// clusters are swapped after failover and the account remains geo-replicated. Failover should continue to be used in the
+// event of availability issues as Planned failover is only available while the
+// primary and secondary endpoints are available. The primary use case of a Planned Failover is disaster recovery testing
+// drills. This type of failover is invoked by setting FailoverType parameter to
+// 'Planned'. Learn more about the failover options here- https://learn.microsoft.com/azure/storage/common/storage-disaster-recovery-guidance
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+func (client *AccountsClient) failover(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginFailoverOptions) (*http.Response, error) {
+ var err error
+ const operationName = "AccountsClient.BeginFailover"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.failoverCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// failoverCreateRequest creates the Failover request.
+func (client *AccountsClient) failoverCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginFailoverOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ if options != nil && options.FailoverType != nil {
+ reqQP.Set("failoverType", "Planned")
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ return req, nil
+}
+
+// GetCustomerInitiatedMigration - Gets the status of the ongoing migration for the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - migrationName - The name of the Storage Account Migration. It should always be 'default'
+// - options - AccountsClientGetCustomerInitiatedMigrationOptions contains the optional parameters for the AccountsClient.GetCustomerInitiatedMigration
+// method.
+func (client *AccountsClient) GetCustomerInitiatedMigration(ctx context.Context, resourceGroupName string, accountName string, migrationName MigrationName, options *AccountsClientGetCustomerInitiatedMigrationOptions) (AccountsClientGetCustomerInitiatedMigrationResponse, error) {
+ var err error
+ const operationName = "AccountsClient.GetCustomerInitiatedMigration"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCustomerInitiatedMigrationCreateRequest(ctx, resourceGroupName, accountName, migrationName, options)
+ if err != nil {
+ return AccountsClientGetCustomerInitiatedMigrationResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AccountsClientGetCustomerInitiatedMigrationResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AccountsClientGetCustomerInitiatedMigrationResponse{}, err
+ }
+ resp, err := client.getCustomerInitiatedMigrationHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCustomerInitiatedMigrationCreateRequest creates the GetCustomerInitiatedMigration request.
+func (client *AccountsClient) getCustomerInitiatedMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, migrationName MigrationName, _ *AccountsClientGetCustomerInitiatedMigrationOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/accountMigrations/{migrationName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if migrationName == "" {
+ return nil, errors.New("parameter migrationName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{migrationName}", url.PathEscape(string(migrationName)))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getCustomerInitiatedMigrationHandleResponse handles the GetCustomerInitiatedMigration response.
+func (client *AccountsClient) getCustomerInitiatedMigrationHandleResponse(resp *http.Response) (AccountsClientGetCustomerInitiatedMigrationResponse, error) {
+ result := AccountsClientGetCustomerInitiatedMigrationResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.AccountMigration); err != nil {
+ return AccountsClientGetCustomerInitiatedMigrationResponse{}, err
+ }
+ return result, nil
+}
+
+// GetProperties - Returns the properties for the specified storage account including but not limited to name, SKU name, location,
+// and account status. The ListKeys operation should be used to retrieve storage keys.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - AccountsClientGetPropertiesOptions contains the optional parameters for the AccountsClient.GetProperties method.
+func (client *AccountsClient) GetProperties(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientGetPropertiesOptions) (AccountsClientGetPropertiesResponse, error) {
+ var err error
+ const operationName = "AccountsClient.GetProperties"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getPropertiesCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return AccountsClientGetPropertiesResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AccountsClientGetPropertiesResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AccountsClientGetPropertiesResponse{}, err
+ }
+ resp, err := client.getPropertiesHandleResponse(httpResp)
+ return resp, err
+}
+
+// getPropertiesCreateRequest creates the GetProperties request.
+func (client *AccountsClient) getPropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientGetPropertiesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", string(*options.Expand))
+ }
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getPropertiesHandleResponse handles the GetProperties response.
+func (client *AccountsClient) getPropertiesHandleResponse(resp *http.Response) (AccountsClientGetPropertiesResponse, error) {
+ result := AccountsClientGetPropertiesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Account); err != nil {
+ return AccountsClientGetPropertiesResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginHierarchicalNamespaceMigration - Live Migration of storage account to enable Hns
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - requestType - Required. Hierarchical namespace migration type can either be a hierarchical namespace validation request
+// 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation
+// request will validate the migration whereas the hydration request will migrate the account.
+// - options - AccountsClientBeginHierarchicalNamespaceMigrationOptions contains the optional parameters for the AccountsClient.BeginHierarchicalNamespaceMigration
+// method.
+func (client *AccountsClient) BeginHierarchicalNamespaceMigration(ctx context.Context, resourceGroupName string, accountName string, requestType string, options *AccountsClientBeginHierarchicalNamespaceMigrationOptions) (*runtime.Poller[AccountsClientHierarchicalNamespaceMigrationResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.hierarchicalNamespaceMigration(ctx, resourceGroupName, accountName, requestType, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientHierarchicalNamespaceMigrationResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AccountsClientHierarchicalNamespaceMigrationResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// HierarchicalNamespaceMigration - Live Migration of storage account to enable Hns
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+func (client *AccountsClient) hierarchicalNamespaceMigration(ctx context.Context, resourceGroupName string, accountName string, requestType string, options *AccountsClientBeginHierarchicalNamespaceMigrationOptions) (*http.Response, error) {
+ var err error
+ const operationName = "AccountsClient.BeginHierarchicalNamespaceMigration"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.hierarchicalNamespaceMigrationCreateRequest(ctx, resourceGroupName, accountName, requestType, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// hierarchicalNamespaceMigrationCreateRequest creates the HierarchicalNamespaceMigration request.
+func (client *AccountsClient) hierarchicalNamespaceMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, requestType string, _ *AccountsClientBeginHierarchicalNamespaceMigrationOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/hnsonmigration"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ reqQP.Set("requestType", requestType)
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// NewListPager - Lists all the storage accounts available under the subscription. Note that storage keys are not returned;
+// use the ListKeys operation for this.
+//
+// Generated from API version 2025-01-01
+// - options - AccountsClientListOptions contains the optional parameters for the AccountsClient.NewListPager method.
+func (client *AccountsClient) NewListPager(options *AccountsClientListOptions) *runtime.Pager[AccountsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[AccountsClientListResponse]{
+ More: func(page AccountsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *AccountsClientListResponse) (AccountsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AccountsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return AccountsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *AccountsClient) listCreateRequest(ctx context.Context, _ *AccountsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *AccountsClient) listHandleResponse(resp *http.Response) (AccountsClientListResponse, error) {
+ result := AccountsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.AccountListResult); err != nil {
+ return AccountsClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// ListAccountSAS - List SAS credentials of a storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The parameters to provide to list SAS credentials for the storage account.
+// - options - AccountsClientListAccountSASOptions contains the optional parameters for the AccountsClient.ListAccountSAS method.
+func (client *AccountsClient) ListAccountSAS(ctx context.Context, resourceGroupName string, accountName string, parameters AccountSasParameters, options *AccountsClientListAccountSASOptions) (AccountsClientListAccountSASResponse, error) {
+ var err error
+ const operationName = "AccountsClient.ListAccountSAS"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listAccountSASCreateRequest(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return AccountsClientListAccountSASResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AccountsClientListAccountSASResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AccountsClientListAccountSASResponse{}, err
+ }
+ resp, err := client.listAccountSASHandleResponse(httpResp)
+ return resp, err
+}
+
+// listAccountSASCreateRequest creates the ListAccountSAS request.
+func (client *AccountsClient) listAccountSASCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountSasParameters, _ *AccountsClientListAccountSASOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// listAccountSASHandleResponse handles the ListAccountSAS response.
+func (client *AccountsClient) listAccountSASHandleResponse(resp *http.Response) (AccountsClientListAccountSASResponse, error) {
+ result := AccountsClientListAccountSASResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ListAccountSasResponse); err != nil {
+ return AccountsClientListAccountSASResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByResourceGroupPager - Lists all the storage accounts available under the given resource group. Note that storage
+// keys are not returned; use the ListKeys operation for this.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - options - AccountsClientListByResourceGroupOptions contains the optional parameters for the AccountsClient.NewListByResourceGroupPager
+// method.
+func (client *AccountsClient) NewListByResourceGroupPager(resourceGroupName string, options *AccountsClientListByResourceGroupOptions) *runtime.Pager[AccountsClientListByResourceGroupResponse] {
+ return runtime.NewPager(runtime.PagingHandler[AccountsClientListByResourceGroupResponse]{
+ More: func(page AccountsClientListByResourceGroupResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *AccountsClientListByResourceGroupResponse) (AccountsClientListByResourceGroupResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AccountsClient.NewListByResourceGroupPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options)
+ }, nil)
+ if err != nil {
+ return AccountsClientListByResourceGroupResponse{}, err
+ }
+ return client.listByResourceGroupHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByResourceGroupCreateRequest creates the ListByResourceGroup request.
+func (client *AccountsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *AccountsClientListByResourceGroupOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByResourceGroupHandleResponse handles the ListByResourceGroup response.
+func (client *AccountsClient) listByResourceGroupHandleResponse(resp *http.Response) (AccountsClientListByResourceGroupResponse, error) {
+ result := AccountsClientListByResourceGroupResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.AccountListResult); err != nil {
+ return AccountsClientListByResourceGroupResponse{}, err
+ }
+ return result, nil
+}
+
+// ListKeys - Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - AccountsClientListKeysOptions contains the optional parameters for the AccountsClient.ListKeys method.
+func (client *AccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientListKeysOptions) (AccountsClientListKeysResponse, error) {
+ var err error
+ const operationName = "AccountsClient.ListKeys"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listKeysCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return AccountsClientListKeysResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AccountsClientListKeysResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AccountsClientListKeysResponse{}, err
+ }
+ resp, err := client.listKeysHandleResponse(httpResp)
+ return resp, err
+}
+
+// listKeysCreateRequest creates the ListKeys request.
+func (client *AccountsClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientListKeysOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", "kerb")
+ }
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listKeysHandleResponse handles the ListKeys response.
+func (client *AccountsClient) listKeysHandleResponse(resp *http.Response) (AccountsClientListKeysResponse, error) {
+ result := AccountsClientListKeysResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.AccountListKeysResult); err != nil {
+ return AccountsClientListKeysResponse{}, err
+ }
+ return result, nil
+}
+
+// ListServiceSAS - List service SAS credentials of a specific resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The parameters to provide to list service SAS credentials.
+// - options - AccountsClientListServiceSASOptions contains the optional parameters for the AccountsClient.ListServiceSAS method.
+func (client *AccountsClient) ListServiceSAS(ctx context.Context, resourceGroupName string, accountName string, parameters ServiceSasParameters, options *AccountsClientListServiceSASOptions) (AccountsClientListServiceSASResponse, error) {
+ var err error
+ const operationName = "AccountsClient.ListServiceSAS"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listServiceSASCreateRequest(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return AccountsClientListServiceSASResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AccountsClientListServiceSASResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AccountsClientListServiceSASResponse{}, err
+ }
+ resp, err := client.listServiceSASHandleResponse(httpResp)
+ return resp, err
+}
+
+// listServiceSASCreateRequest creates the ListServiceSAS request.
+func (client *AccountsClient) listServiceSASCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters ServiceSasParameters, _ *AccountsClientListServiceSASOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// listServiceSASHandleResponse handles the ListServiceSAS response.
+func (client *AccountsClient) listServiceSASHandleResponse(resp *http.Response) (AccountsClientListServiceSASResponse, error) {
+ result := AccountsClientListServiceSASResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ListServiceSasResponse); err != nil {
+ return AccountsClientListServiceSASResponse{}, err
+ }
+ return result, nil
+}
+
+// RegenerateKey - Regenerates one of the access keys or Kerberos keys for the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - regenerateKey - Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2.
+// - options - AccountsClientRegenerateKeyOptions contains the optional parameters for the AccountsClient.RegenerateKey method.
+func (client *AccountsClient) RegenerateKey(ctx context.Context, resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters, options *AccountsClientRegenerateKeyOptions) (AccountsClientRegenerateKeyResponse, error) {
+ var err error
+ const operationName = "AccountsClient.RegenerateKey"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.regenerateKeyCreateRequest(ctx, resourceGroupName, accountName, regenerateKey, options)
+ if err != nil {
+ return AccountsClientRegenerateKeyResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AccountsClientRegenerateKeyResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AccountsClientRegenerateKeyResponse{}, err
+ }
+ resp, err := client.regenerateKeyHandleResponse(httpResp)
+ return resp, err
+}
+
+// regenerateKeyCreateRequest creates the RegenerateKey request.
+func (client *AccountsClient) regenerateKeyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters, _ *AccountsClientRegenerateKeyOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, regenerateKey); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// regenerateKeyHandleResponse handles the RegenerateKey response.
+func (client *AccountsClient) regenerateKeyHandleResponse(resp *http.Response) (AccountsClientRegenerateKeyResponse, error) {
+ result := AccountsClientRegenerateKeyResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.AccountListKeysResult); err != nil {
+ return AccountsClientRegenerateKeyResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginRestoreBlobRanges - Restore blobs in the specified blob ranges
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The parameters to provide for restore blob ranges.
+// - options - AccountsClientBeginRestoreBlobRangesOptions contains the optional parameters for the AccountsClient.BeginRestoreBlobRanges
+// method.
+func (client *AccountsClient) BeginRestoreBlobRanges(ctx context.Context, resourceGroupName string, accountName string, parameters BlobRestoreParameters, options *AccountsClientBeginRestoreBlobRangesOptions) (*runtime.Poller[AccountsClientRestoreBlobRangesResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.restoreBlobRanges(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientRestoreBlobRangesResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AccountsClientRestoreBlobRangesResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// RestoreBlobRanges - Restore blobs in the specified blob ranges
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+func (client *AccountsClient) restoreBlobRanges(ctx context.Context, resourceGroupName string, accountName string, parameters BlobRestoreParameters, options *AccountsClientBeginRestoreBlobRangesOptions) (*http.Response, error) {
+ var err error
+ const operationName = "AccountsClient.BeginRestoreBlobRanges"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.restoreBlobRangesCreateRequest(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// restoreBlobRangesCreateRequest creates the RestoreBlobRanges request.
+func (client *AccountsClient) restoreBlobRangesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters BlobRestoreParameters, _ *AccountsClientBeginRestoreBlobRangesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// RevokeUserDelegationKeys - Revoke user delegation keys.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - AccountsClientRevokeUserDelegationKeysOptions contains the optional parameters for the AccountsClient.RevokeUserDelegationKeys
+// method.
+func (client *AccountsClient) RevokeUserDelegationKeys(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientRevokeUserDelegationKeysOptions) (AccountsClientRevokeUserDelegationKeysResponse, error) {
+ var err error
+ const operationName = "AccountsClient.RevokeUserDelegationKeys"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.revokeUserDelegationKeysCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return AccountsClientRevokeUserDelegationKeysResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AccountsClientRevokeUserDelegationKeysResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AccountsClientRevokeUserDelegationKeysResponse{}, err
+ }
+ return AccountsClientRevokeUserDelegationKeysResponse{}, nil
+}
+
+// revokeUserDelegationKeysCreateRequest creates the RevokeUserDelegationKeys request.
+func (client *AccountsClient) revokeUserDelegationKeysCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *AccountsClientRevokeUserDelegationKeysOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ return req, nil
+}
+
+// Update - The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It
+// can also be used to map the account to a custom domain. Only one custom domain is
+// supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom
+// domain, the old value must be cleared/unregistered before a new value can be
+// set. The update of multiple properties is supported. This call does not change the storage keys for the account. If you
+// want to change the storage account keys, use the regenerate keys operation. The
+// location and name of the storage account cannot be changed after creation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The parameters to provide for the updated account.
+// - options - AccountsClientUpdateOptions contains the optional parameters for the AccountsClient.Update method.
+func (client *AccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, parameters AccountUpdateParameters, options *AccountsClientUpdateOptions) (AccountsClientUpdateResponse, error) {
+ var err error
+ const operationName = "AccountsClient.Update"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return AccountsClientUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AccountsClientUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AccountsClientUpdateResponse{}, err
+ }
+ resp, err := client.updateHandleResponse(httpResp)
+ return resp, err
+}
+
+// updateCreateRequest creates the Update request.
+func (client *AccountsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountUpdateParameters, _ *AccountsClientUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// updateHandleResponse handles the Update response.
+func (client *AccountsClient) updateHandleResponse(resp *http.Response) (AccountsClientUpdateResponse, error) {
+ result := AccountsClientUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Account); err != nil {
+ return AccountsClientUpdateResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/assets.json b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/assets.json
new file mode 100644
index 0000000000..00fd5e2b2a
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/assets.json
@@ -0,0 +1,6 @@
+{
+ "AssetsRepo": "Azure/azure-sdk-assets",
+ "AssetsRepoPrefixPath": "go",
+ "TagPrefix": "go/resourcemanager/storage/armstorage",
+ "Tag": "go/resourcemanager/storage/armstorage_0044a0eabf"
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/autorest.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/autorest.md
new file mode 100644
index 0000000000..6bbac5a2cf
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/autorest.md
@@ -0,0 +1,15 @@
+### AutoRest Configuration
+
+> see https://aka.ms/autorest
+
+``` yaml
+azure-arm: true
+require:
+- https://github.com/Azure/azure-rest-api-specs/blob/260ed6a52537921f53a18ffaf4020e3b4d510367/specification/storage/resource-manager/readme.md
+- https://github.com/Azure/azure-rest-api-specs/blob/260ed6a52537921f53a18ffaf4020e3b4d510367/specification/storage/resource-manager/readme.go.md
+license-header: MICROSOFT_MIT_NO_VERSION
+module-version: 2.0.0
+modelerfour:
+ seal-single-value-enum-by-default: true
+tag: package-2025-01
+```
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/blobcontainers_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/blobcontainers_client.go
new file mode 100644
index 0000000000..f60a79d586
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/blobcontainers_client.go
@@ -0,0 +1,1148 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// BlobContainersClient contains the methods for the BlobContainers group.
+// Don't use this type directly, use NewBlobContainersClient() instead.
+type BlobContainersClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewBlobContainersClient creates a new instance of BlobContainersClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewBlobContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BlobContainersClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &BlobContainersClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// ClearLegalHold - Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold
+// clears out only the specified tags in the request.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - legalHold - The LegalHold property that will be clear from a blob container.
+// - options - BlobContainersClientClearLegalHoldOptions contains the optional parameters for the BlobContainersClient.ClearLegalHold
+// method.
+func (client *BlobContainersClient) ClearLegalHold(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold LegalHold, options *BlobContainersClientClearLegalHoldOptions) (BlobContainersClientClearLegalHoldResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.ClearLegalHold"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.clearLegalHoldCreateRequest(ctx, resourceGroupName, accountName, containerName, legalHold, options)
+ if err != nil {
+ return BlobContainersClientClearLegalHoldResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientClearLegalHoldResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientClearLegalHoldResponse{}, err
+ }
+ resp, err := client.clearLegalHoldHandleResponse(httpResp)
+ return resp, err
+}
+
+// clearLegalHoldCreateRequest creates the ClearLegalHold request.
+func (client *BlobContainersClient) clearLegalHoldCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold LegalHold, _ *BlobContainersClientClearLegalHoldOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, legalHold); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// clearLegalHoldHandleResponse handles the ClearLegalHold response.
+func (client *BlobContainersClient) clearLegalHoldHandleResponse(resp *http.Response) (BlobContainersClientClearLegalHoldResponse, error) {
+ result := BlobContainersClientClearLegalHoldResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.LegalHold); err != nil {
+ return BlobContainersClientClearLegalHoldResponse{}, err
+ }
+ return result, nil
+}
+
+// Create - Creates a new container under the specified account as described by request body. The container resource includes
+// metadata and properties for that container. It does not include a list of the blobs
+// contained by the container.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - blobContainer - Properties of the blob container to create.
+// - options - BlobContainersClientCreateOptions contains the optional parameters for the BlobContainersClient.Create method.
+func (client *BlobContainersClient) Create(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer BlobContainer, options *BlobContainersClientCreateOptions) (BlobContainersClientCreateResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.Create"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, containerName, blobContainer, options)
+ if err != nil {
+ return BlobContainersClientCreateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientCreateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientCreateResponse{}, err
+ }
+ resp, err := client.createHandleResponse(httpResp)
+ return resp, err
+}
+
+// createCreateRequest creates the Create request.
+func (client *BlobContainersClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer BlobContainer, _ *BlobContainersClientCreateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, blobContainer); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createHandleResponse handles the Create response.
+func (client *BlobContainersClient) createHandleResponse(resp *http.Response) (BlobContainersClientCreateResponse, error) {
+ result := BlobContainersClientCreateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.BlobContainer); err != nil {
+ return BlobContainersClientCreateResponse{}, err
+ }
+ return result, nil
+}
+
+// CreateOrUpdateImmutabilityPolicy - Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given
+// but not required for this operation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - options - BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.CreateOrUpdateImmutabilityPolicy
+// method.
+func (client *BlobContainersClient) CreateOrUpdateImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions) (BlobContainersClientCreateOrUpdateImmutabilityPolicyResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.CreateOrUpdateImmutabilityPolicy"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateImmutabilityPolicyCreateRequest(ctx, resourceGroupName, accountName, containerName, options)
+ if err != nil {
+ return BlobContainersClientCreateOrUpdateImmutabilityPolicyResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientCreateOrUpdateImmutabilityPolicyResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientCreateOrUpdateImmutabilityPolicyResponse{}, err
+ }
+ resp, err := client.createOrUpdateImmutabilityPolicyHandleResponse(httpResp)
+ return resp, err
+}
+
+// createOrUpdateImmutabilityPolicyCreateRequest creates the CreateOrUpdateImmutabilityPolicy request.
+func (client *BlobContainersClient) createOrUpdateImmutabilityPolicyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ urlPath = strings.ReplaceAll(urlPath, "{immutabilityPolicyName}", url.PathEscape("default"))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.IfMatch != nil {
+ req.Raw().Header["If-Match"] = []string{*options.IfMatch}
+ }
+ if options != nil && options.Parameters != nil {
+ if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// createOrUpdateImmutabilityPolicyHandleResponse handles the CreateOrUpdateImmutabilityPolicy response.
+func (client *BlobContainersClient) createOrUpdateImmutabilityPolicyHandleResponse(resp *http.Response) (BlobContainersClientCreateOrUpdateImmutabilityPolicyResponse, error) {
+ result := BlobContainersClientCreateOrUpdateImmutabilityPolicyResponse{}
+ if val := resp.Header.Get("ETag"); val != "" {
+ result.ETag = &val
+ }
+ if err := runtime.UnmarshalAsJSON(resp, &result.ImmutabilityPolicy); err != nil {
+ return BlobContainersClientCreateOrUpdateImmutabilityPolicyResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Deletes specified container under its account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - options - BlobContainersClientDeleteOptions contains the optional parameters for the BlobContainersClient.Delete method.
+func (client *BlobContainersClient) Delete(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientDeleteOptions) (BlobContainersClientDeleteResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, containerName, options)
+ if err != nil {
+ return BlobContainersClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientDeleteResponse{}, err
+ }
+ return BlobContainersClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *BlobContainersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, _ *BlobContainersClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ return req, nil
+}
+
+// DeleteImmutabilityPolicy - Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays
+// set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability
+// policy is not allowed, the only way is to delete the container after deleting all expired blobs inside the policy locked
+// container.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - ifMatch - The entity state (ETag) version of the immutability policy to update must be returned to the server for all update
+// operations. The ETag value must include the leading and trailing double quotes as
+// returned by the service.
+// - options - BlobContainersClientDeleteImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.DeleteImmutabilityPolicy
+// method.
+func (client *BlobContainersClient) DeleteImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, options *BlobContainersClientDeleteImmutabilityPolicyOptions) (BlobContainersClientDeleteImmutabilityPolicyResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.DeleteImmutabilityPolicy"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteImmutabilityPolicyCreateRequest(ctx, resourceGroupName, accountName, containerName, ifMatch, options)
+ if err != nil {
+ return BlobContainersClientDeleteImmutabilityPolicyResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientDeleteImmutabilityPolicyResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientDeleteImmutabilityPolicyResponse{}, err
+ }
+ resp, err := client.deleteImmutabilityPolicyHandleResponse(httpResp)
+ return resp, err
+}
+
+// deleteImmutabilityPolicyCreateRequest creates the DeleteImmutabilityPolicy request.
+func (client *BlobContainersClient) deleteImmutabilityPolicyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, _ *BlobContainersClientDeleteImmutabilityPolicyOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ urlPath = strings.ReplaceAll(urlPath, "{immutabilityPolicyName}", url.PathEscape("default"))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ req.Raw().Header["If-Match"] = []string{ifMatch}
+ return req, nil
+}
+
+// deleteImmutabilityPolicyHandleResponse handles the DeleteImmutabilityPolicy response.
+func (client *BlobContainersClient) deleteImmutabilityPolicyHandleResponse(resp *http.Response) (BlobContainersClientDeleteImmutabilityPolicyResponse, error) {
+ result := BlobContainersClientDeleteImmutabilityPolicyResponse{}
+ if val := resp.Header.Get("ETag"); val != "" {
+ result.ETag = &val
+ }
+ if err := runtime.UnmarshalAsJSON(resp, &result.ImmutabilityPolicy); err != nil {
+ return BlobContainersClientDeleteImmutabilityPolicyResponse{}, err
+ }
+ return result, nil
+}
+
+// ExtendImmutabilityPolicy - Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action
+// allowed on a Locked policy will be this action. ETag in If-Match is required for this operation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - ifMatch - The entity state (ETag) version of the immutability policy to update must be returned to the server for all update
+// operations. The ETag value must include the leading and trailing double quotes as
+// returned by the service.
+// - options - BlobContainersClientExtendImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.ExtendImmutabilityPolicy
+// method.
+func (client *BlobContainersClient) ExtendImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, options *BlobContainersClientExtendImmutabilityPolicyOptions) (BlobContainersClientExtendImmutabilityPolicyResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.ExtendImmutabilityPolicy"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.extendImmutabilityPolicyCreateRequest(ctx, resourceGroupName, accountName, containerName, ifMatch, options)
+ if err != nil {
+ return BlobContainersClientExtendImmutabilityPolicyResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientExtendImmutabilityPolicyResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientExtendImmutabilityPolicyResponse{}, err
+ }
+ resp, err := client.extendImmutabilityPolicyHandleResponse(httpResp)
+ return resp, err
+}
+
+// extendImmutabilityPolicyCreateRequest creates the ExtendImmutabilityPolicy request.
+func (client *BlobContainersClient) extendImmutabilityPolicyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, options *BlobContainersClientExtendImmutabilityPolicyOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ req.Raw().Header["If-Match"] = []string{ifMatch}
+ if options != nil && options.Parameters != nil {
+ if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// extendImmutabilityPolicyHandleResponse handles the ExtendImmutabilityPolicy response.
+func (client *BlobContainersClient) extendImmutabilityPolicyHandleResponse(resp *http.Response) (BlobContainersClientExtendImmutabilityPolicyResponse, error) {
+ result := BlobContainersClientExtendImmutabilityPolicyResponse{}
+ if val := resp.Header.Get("ETag"); val != "" {
+ result.ETag = &val
+ }
+ if err := runtime.UnmarshalAsJSON(resp, &result.ImmutabilityPolicy); err != nil {
+ return BlobContainersClientExtendImmutabilityPolicyResponse{}, err
+ }
+ return result, nil
+}
+
+// Get - Gets properties of a specified container.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - options - BlobContainersClientGetOptions contains the optional parameters for the BlobContainersClient.Get method.
+func (client *BlobContainersClient) Get(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientGetOptions) (BlobContainersClientGetResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, containerName, options)
+ if err != nil {
+ return BlobContainersClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *BlobContainersClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, _ *BlobContainersClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *BlobContainersClient) getHandleResponse(resp *http.Response) (BlobContainersClientGetResponse, error) {
+ result := BlobContainersClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.BlobContainer); err != nil {
+ return BlobContainersClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// GetImmutabilityPolicy - Gets the existing immutability policy along with the corresponding ETag in response headers and
+// body.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - options - BlobContainersClientGetImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.GetImmutabilityPolicy
+// method.
+func (client *BlobContainersClient) GetImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientGetImmutabilityPolicyOptions) (BlobContainersClientGetImmutabilityPolicyResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.GetImmutabilityPolicy"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getImmutabilityPolicyCreateRequest(ctx, resourceGroupName, accountName, containerName, options)
+ if err != nil {
+ return BlobContainersClientGetImmutabilityPolicyResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientGetImmutabilityPolicyResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientGetImmutabilityPolicyResponse{}, err
+ }
+ resp, err := client.getImmutabilityPolicyHandleResponse(httpResp)
+ return resp, err
+}
+
+// getImmutabilityPolicyCreateRequest creates the GetImmutabilityPolicy request.
+func (client *BlobContainersClient) getImmutabilityPolicyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientGetImmutabilityPolicyOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ urlPath = strings.ReplaceAll(urlPath, "{immutabilityPolicyName}", url.PathEscape("default"))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.IfMatch != nil {
+ req.Raw().Header["If-Match"] = []string{*options.IfMatch}
+ }
+ return req, nil
+}
+
+// getImmutabilityPolicyHandleResponse handles the GetImmutabilityPolicy response.
+func (client *BlobContainersClient) getImmutabilityPolicyHandleResponse(resp *http.Response) (BlobContainersClientGetImmutabilityPolicyResponse, error) {
+ result := BlobContainersClientGetImmutabilityPolicyResponse{}
+ if val := resp.Header.Get("ETag"); val != "" {
+ result.ETag = &val
+ }
+ if err := runtime.UnmarshalAsJSON(resp, &result.ImmutabilityPolicy); err != nil {
+ return BlobContainersClientGetImmutabilityPolicyResponse{}, err
+ }
+ return result, nil
+}
+
+// Lease - The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration
+// can be 15 to 60 seconds, or can be infinite.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - options - BlobContainersClientLeaseOptions contains the optional parameters for the BlobContainersClient.Lease method.
+func (client *BlobContainersClient) Lease(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientLeaseOptions) (BlobContainersClientLeaseResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.Lease"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.leaseCreateRequest(ctx, resourceGroupName, accountName, containerName, options)
+ if err != nil {
+ return BlobContainersClientLeaseResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientLeaseResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientLeaseResponse{}, err
+ }
+ resp, err := client.leaseHandleResponse(httpResp)
+ return resp, err
+}
+
+// leaseCreateRequest creates the Lease request.
+func (client *BlobContainersClient) leaseCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientLeaseOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.Parameters != nil {
+ if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// leaseHandleResponse handles the Lease response.
+func (client *BlobContainersClient) leaseHandleResponse(resp *http.Response) (BlobContainersClientLeaseResponse, error) {
+ result := BlobContainersClientLeaseResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.LeaseContainerResponse); err != nil {
+ return BlobContainersClientLeaseResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation
+// token.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - BlobContainersClientListOptions contains the optional parameters for the BlobContainersClient.NewListPager method.
+func (client *BlobContainersClient) NewListPager(resourceGroupName string, accountName string, options *BlobContainersClientListOptions) *runtime.Pager[BlobContainersClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[BlobContainersClientListResponse]{
+ More: func(page BlobContainersClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *BlobContainersClientListResponse) (BlobContainersClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "BlobContainersClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ }, nil)
+ if err != nil {
+ return BlobContainersClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *BlobContainersClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *BlobContainersClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Include != nil {
+ reqQP.Set("$include", string(*options.Include))
+ }
+ if options != nil && options.Maxpagesize != nil {
+ reqQP.Set("$maxpagesize", *options.Maxpagesize)
+ }
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *BlobContainersClient) listHandleResponse(resp *http.Response) (BlobContainersClientListResponse, error) {
+ result := BlobContainersClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ListContainerItems); err != nil {
+ return BlobContainersClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// LockImmutabilityPolicy - Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy
+// action. ETag in If-Match is required for this operation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - ifMatch - The entity state (ETag) version of the immutability policy to update must be returned to the server for all update
+// operations. The ETag value must include the leading and trailing double quotes as
+// returned by the service.
+// - options - BlobContainersClientLockImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.LockImmutabilityPolicy
+// method.
+func (client *BlobContainersClient) LockImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, options *BlobContainersClientLockImmutabilityPolicyOptions) (BlobContainersClientLockImmutabilityPolicyResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.LockImmutabilityPolicy"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.lockImmutabilityPolicyCreateRequest(ctx, resourceGroupName, accountName, containerName, ifMatch, options)
+ if err != nil {
+ return BlobContainersClientLockImmutabilityPolicyResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientLockImmutabilityPolicyResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientLockImmutabilityPolicyResponse{}, err
+ }
+ resp, err := client.lockImmutabilityPolicyHandleResponse(httpResp)
+ return resp, err
+}
+
+// lockImmutabilityPolicyCreateRequest creates the LockImmutabilityPolicy request.
+func (client *BlobContainersClient) lockImmutabilityPolicyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, _ *BlobContainersClientLockImmutabilityPolicyOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ req.Raw().Header["If-Match"] = []string{ifMatch}
+ return req, nil
+}
+
+// lockImmutabilityPolicyHandleResponse handles the LockImmutabilityPolicy response.
+func (client *BlobContainersClient) lockImmutabilityPolicyHandleResponse(resp *http.Response) (BlobContainersClientLockImmutabilityPolicyResponse, error) {
+ result := BlobContainersClientLockImmutabilityPolicyResponse{}
+ if val := resp.Header.Get("ETag"); val != "" {
+ result.ETag = &val
+ }
+ if err := runtime.UnmarshalAsJSON(resp, &result.ImmutabilityPolicy); err != nil {
+ return BlobContainersClientLockImmutabilityPolicyResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginObjectLevelWorm - This operation migrates a blob container from container level WORM to object level immutability
+// enabled container. Prerequisites require a container level immutability policy either in locked or
+// unlocked state, Account level versioning must be enabled and there should be no Legal hold on the container.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - options - BlobContainersClientBeginObjectLevelWormOptions contains the optional parameters for the BlobContainersClient.BeginObjectLevelWorm
+// method.
+func (client *BlobContainersClient) BeginObjectLevelWorm(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientBeginObjectLevelWormOptions) (*runtime.Poller[BlobContainersClientObjectLevelWormResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.objectLevelWorm(ctx, resourceGroupName, accountName, containerName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BlobContainersClientObjectLevelWormResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BlobContainersClientObjectLevelWormResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// ObjectLevelWorm - This operation migrates a blob container from container level WORM to object level immutability enabled
+// container. Prerequisites require a container level immutability policy either in locked or
+// unlocked state, Account level versioning must be enabled and there should be no Legal hold on the container.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+func (client *BlobContainersClient) objectLevelWorm(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientBeginObjectLevelWormOptions) (*http.Response, error) {
+ var err error
+ const operationName = "BlobContainersClient.BeginObjectLevelWorm"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.objectLevelWormCreateRequest(ctx, resourceGroupName, accountName, containerName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// objectLevelWormCreateRequest creates the ObjectLevelWorm request.
+func (client *BlobContainersClient) objectLevelWormCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, _ *BlobContainersClientBeginObjectLevelWormOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// SetLegalHold - Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append
+// pattern and does not clear out the existing tags that are not specified in the request.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - legalHold - The LegalHold property that will be set to a blob container.
+// - options - BlobContainersClientSetLegalHoldOptions contains the optional parameters for the BlobContainersClient.SetLegalHold
+// method.
+func (client *BlobContainersClient) SetLegalHold(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold LegalHold, options *BlobContainersClientSetLegalHoldOptions) (BlobContainersClientSetLegalHoldResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.SetLegalHold"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.setLegalHoldCreateRequest(ctx, resourceGroupName, accountName, containerName, legalHold, options)
+ if err != nil {
+ return BlobContainersClientSetLegalHoldResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientSetLegalHoldResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientSetLegalHoldResponse{}, err
+ }
+ resp, err := client.setLegalHoldHandleResponse(httpResp)
+ return resp, err
+}
+
+// setLegalHoldCreateRequest creates the SetLegalHold request.
+func (client *BlobContainersClient) setLegalHoldCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold LegalHold, _ *BlobContainersClientSetLegalHoldOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, legalHold); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// setLegalHoldHandleResponse handles the SetLegalHold response.
+func (client *BlobContainersClient) setLegalHoldHandleResponse(resp *http.Response) (BlobContainersClientSetLegalHoldResponse, error) {
+ result := BlobContainersClientSetLegalHoldResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.LegalHold); err != nil {
+ return BlobContainersClientSetLegalHoldResponse{}, err
+ }
+ return result, nil
+}
+
+// Update - Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged.
+// Update fails if the specified container doesn't already exist.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - blobContainer - Properties to update for the blob container.
+// - options - BlobContainersClientUpdateOptions contains the optional parameters for the BlobContainersClient.Update method.
+func (client *BlobContainersClient) Update(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer BlobContainer, options *BlobContainersClientUpdateOptions) (BlobContainersClientUpdateResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.Update"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, containerName, blobContainer, options)
+ if err != nil {
+ return BlobContainersClientUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientUpdateResponse{}, err
+ }
+ resp, err := client.updateHandleResponse(httpResp)
+ return resp, err
+}
+
+// updateCreateRequest creates the Update request.
+func (client *BlobContainersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer BlobContainer, _ *BlobContainersClientUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, blobContainer); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// updateHandleResponse handles the Update response.
+func (client *BlobContainersClient) updateHandleResponse(resp *http.Response) (BlobContainersClientUpdateResponse, error) {
+ result := BlobContainersClientUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.BlobContainer); err != nil {
+ return BlobContainersClientUpdateResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/blobinventorypolicies_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/blobinventorypolicies_client.go
new file mode 100644
index 0000000000..e2842b82cc
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/blobinventorypolicies_client.go
@@ -0,0 +1,315 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// BlobInventoryPoliciesClient contains the methods for the BlobInventoryPolicies group.
+// Don't use this type directly, use NewBlobInventoryPoliciesClient() instead.
+type BlobInventoryPoliciesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewBlobInventoryPoliciesClient creates a new instance of BlobInventoryPoliciesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewBlobInventoryPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BlobInventoryPoliciesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &BlobInventoryPoliciesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// CreateOrUpdate - Sets the blob inventory policy to the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - blobInventoryPolicyName - The name of the storage account blob inventory policy. It should always be 'default'
+// - properties - The blob inventory policy set to a storage account.
+// - options - BlobInventoryPoliciesClientCreateOrUpdateOptions contains the optional parameters for the BlobInventoryPoliciesClient.CreateOrUpdate
+// method.
+func (client *BlobInventoryPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, properties BlobInventoryPolicy, options *BlobInventoryPoliciesClientCreateOrUpdateOptions) (BlobInventoryPoliciesClientCreateOrUpdateResponse, error) {
+ var err error
+ const operationName = "BlobInventoryPoliciesClient.CreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, blobInventoryPolicyName, properties, options)
+ if err != nil {
+ return BlobInventoryPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobInventoryPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobInventoryPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ resp, err := client.createOrUpdateHandleResponse(httpResp)
+ return resp, err
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *BlobInventoryPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, properties BlobInventoryPolicy, _ *BlobInventoryPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if blobInventoryPolicyName == "" {
+ return nil, errors.New("parameter blobInventoryPolicyName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{blobInventoryPolicyName}", url.PathEscape(string(blobInventoryPolicyName)))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, properties); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createOrUpdateHandleResponse handles the CreateOrUpdate response.
+func (client *BlobInventoryPoliciesClient) createOrUpdateHandleResponse(resp *http.Response) (BlobInventoryPoliciesClientCreateOrUpdateResponse, error) {
+ result := BlobInventoryPoliciesClientCreateOrUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.BlobInventoryPolicy); err != nil {
+ return BlobInventoryPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Deletes the blob inventory policy associated with the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - blobInventoryPolicyName - The name of the storage account blob inventory policy. It should always be 'default'
+// - options - BlobInventoryPoliciesClientDeleteOptions contains the optional parameters for the BlobInventoryPoliciesClient.Delete
+// method.
+func (client *BlobInventoryPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, options *BlobInventoryPoliciesClientDeleteOptions) (BlobInventoryPoliciesClientDeleteResponse, error) {
+ var err error
+ const operationName = "BlobInventoryPoliciesClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, blobInventoryPolicyName, options)
+ if err != nil {
+ return BlobInventoryPoliciesClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobInventoryPoliciesClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobInventoryPoliciesClientDeleteResponse{}, err
+ }
+ return BlobInventoryPoliciesClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *BlobInventoryPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, _ *BlobInventoryPoliciesClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if blobInventoryPolicyName == "" {
+ return nil, errors.New("parameter blobInventoryPolicyName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{blobInventoryPolicyName}", url.PathEscape(string(blobInventoryPolicyName)))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Gets the blob inventory policy associated with the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - blobInventoryPolicyName - The name of the storage account blob inventory policy. It should always be 'default'
+// - options - BlobInventoryPoliciesClientGetOptions contains the optional parameters for the BlobInventoryPoliciesClient.Get
+// method.
+func (client *BlobInventoryPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, options *BlobInventoryPoliciesClientGetOptions) (BlobInventoryPoliciesClientGetResponse, error) {
+ var err error
+ const operationName = "BlobInventoryPoliciesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, blobInventoryPolicyName, options)
+ if err != nil {
+ return BlobInventoryPoliciesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobInventoryPoliciesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobInventoryPoliciesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *BlobInventoryPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, _ *BlobInventoryPoliciesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if blobInventoryPolicyName == "" {
+ return nil, errors.New("parameter blobInventoryPolicyName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{blobInventoryPolicyName}", url.PathEscape(string(blobInventoryPolicyName)))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *BlobInventoryPoliciesClient) getHandleResponse(resp *http.Response) (BlobInventoryPoliciesClientGetResponse, error) {
+ result := BlobInventoryPoliciesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.BlobInventoryPolicy); err != nil {
+ return BlobInventoryPoliciesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Gets the blob inventory policy associated with the specified storage account.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - BlobInventoryPoliciesClientListOptions contains the optional parameters for the BlobInventoryPoliciesClient.NewListPager
+// method.
+func (client *BlobInventoryPoliciesClient) NewListPager(resourceGroupName string, accountName string, options *BlobInventoryPoliciesClientListOptions) *runtime.Pager[BlobInventoryPoliciesClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[BlobInventoryPoliciesClientListResponse]{
+ More: func(page BlobInventoryPoliciesClientListResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *BlobInventoryPoliciesClientListResponse) (BlobInventoryPoliciesClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "BlobInventoryPoliciesClient.NewListPager")
+ req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return BlobInventoryPoliciesClientListResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobInventoryPoliciesClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return BlobInventoryPoliciesClientListResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *BlobInventoryPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *BlobInventoryPoliciesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *BlobInventoryPoliciesClient) listHandleResponse(resp *http.Response) (BlobInventoryPoliciesClientListResponse, error) {
+ result := BlobInventoryPoliciesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ListBlobInventoryPolicy); err != nil {
+ return BlobInventoryPoliciesClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/blobservices_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/blobservices_client.go
new file mode 100644
index 0000000000..0092739858
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/blobservices_client.go
@@ -0,0 +1,248 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// BlobServicesClient contains the methods for the BlobServices group.
+// Don't use this type directly, use NewBlobServicesClient() instead.
+type BlobServicesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewBlobServicesClient creates a new instance of BlobServicesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewBlobServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BlobServicesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &BlobServicesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// GetServiceProperties - Gets the properties of a storage account’s Blob service, including properties for Storage Analytics
+// and CORS (Cross-Origin Resource Sharing) rules.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - BlobServicesClientGetServicePropertiesOptions contains the optional parameters for the BlobServicesClient.GetServiceProperties
+// method.
+func (client *BlobServicesClient) GetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, options *BlobServicesClientGetServicePropertiesOptions) (BlobServicesClientGetServicePropertiesResponse, error) {
+ var err error
+ const operationName = "BlobServicesClient.GetServiceProperties"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getServicePropertiesCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return BlobServicesClientGetServicePropertiesResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobServicesClientGetServicePropertiesResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobServicesClientGetServicePropertiesResponse{}, err
+ }
+ resp, err := client.getServicePropertiesHandleResponse(httpResp)
+ return resp, err
+}
+
+// getServicePropertiesCreateRequest creates the GetServiceProperties request.
+func (client *BlobServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *BlobServicesClientGetServicePropertiesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ urlPath = strings.ReplaceAll(urlPath, "{BlobServicesName}", url.PathEscape("default"))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getServicePropertiesHandleResponse handles the GetServiceProperties response.
+func (client *BlobServicesClient) getServicePropertiesHandleResponse(resp *http.Response) (BlobServicesClientGetServicePropertiesResponse, error) {
+ result := BlobServicesClientGetServicePropertiesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.BlobServiceProperties); err != nil {
+ return BlobServicesClientGetServicePropertiesResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - List blob services of storage account. It returns a collection of one object named default.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - BlobServicesClientListOptions contains the optional parameters for the BlobServicesClient.NewListPager method.
+func (client *BlobServicesClient) NewListPager(resourceGroupName string, accountName string, options *BlobServicesClientListOptions) *runtime.Pager[BlobServicesClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[BlobServicesClientListResponse]{
+ More: func(page BlobServicesClientListResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *BlobServicesClientListResponse) (BlobServicesClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "BlobServicesClient.NewListPager")
+ req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return BlobServicesClientListResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobServicesClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return BlobServicesClientListResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *BlobServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *BlobServicesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *BlobServicesClient) listHandleResponse(resp *http.Response) (BlobServicesClientListResponse, error) {
+ result := BlobServicesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.BlobServiceItems); err != nil {
+ return BlobServicesClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// SetServiceProperties - Sets the properties of a storage account’s Blob service, including properties for Storage Analytics
+// and CORS (Cross-Origin Resource Sharing) rules.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin
+// Resource Sharing) rules.
+// - options - BlobServicesClientSetServicePropertiesOptions contains the optional parameters for the BlobServicesClient.SetServiceProperties
+// method.
+func (client *BlobServicesClient) SetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, parameters BlobServiceProperties, options *BlobServicesClientSetServicePropertiesOptions) (BlobServicesClientSetServicePropertiesResponse, error) {
+ var err error
+ const operationName = "BlobServicesClient.SetServiceProperties"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.setServicePropertiesCreateRequest(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return BlobServicesClientSetServicePropertiesResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobServicesClientSetServicePropertiesResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobServicesClientSetServicePropertiesResponse{}, err
+ }
+ resp, err := client.setServicePropertiesHandleResponse(httpResp)
+ return resp, err
+}
+
+// setServicePropertiesCreateRequest creates the SetServiceProperties request.
+func (client *BlobServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters BlobServiceProperties, _ *BlobServicesClientSetServicePropertiesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ urlPath = strings.ReplaceAll(urlPath, "{BlobServicesName}", url.PathEscape("default"))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// setServicePropertiesHandleResponse handles the SetServiceProperties response.
+func (client *BlobServicesClient) setServicePropertiesHandleResponse(resp *http.Response) (BlobServicesClientSetServicePropertiesResponse, error) {
+ result := BlobServicesClientSetServicePropertiesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.BlobServiceProperties); err != nil {
+ return BlobServicesClientSetServicePropertiesResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/build.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/build.go
new file mode 100644
index 0000000000..9c22bcd53e
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/build.go
@@ -0,0 +1,7 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+
+// This file enables 'go generate' to regenerate this specific SDK
+//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/storage/armstorage
+
+package armstorage
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/ci.yml b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/ci.yml
new file mode 100644
index 0000000000..f65cf92472
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/ci.yml
@@ -0,0 +1,28 @@
+# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
+trigger:
+ branches:
+ include:
+ - main
+ - feature/*
+ - hotfix/*
+ - release/*
+ paths:
+ include:
+ - sdk/resourcemanager/storage/armstorage/
+
+pr:
+ branches:
+ include:
+ - main
+ - feature/*
+ - hotfix/*
+ - release/*
+ paths:
+ include:
+ - sdk/resourcemanager/storage/armstorage/
+
+extends:
+ template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml
+ parameters:
+ ServiceDirectory: 'resourcemanager/storage/armstorage'
+ UsePipelineProxy: false
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/client_factory.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/client_factory.go
new file mode 100644
index 0000000000..5cb8306294
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/client_factory.go
@@ -0,0 +1,225 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+)
+
+// ClientFactory is a client factory used to create any client in this module.
+// Don't use this type directly, use NewClientFactory instead.
+type ClientFactory struct {
+ subscriptionID string
+ internal *arm.Client
+}
+
+// NewClientFactory creates a new instance of ClientFactory with the specified values.
+// The parameter values will be propagated to any client created from this factory.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) {
+ internal, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ return &ClientFactory{
+ subscriptionID: subscriptionID,
+ internal: internal,
+ }, nil
+}
+
+// NewAccountsClient creates a new instance of AccountsClient.
+func (c *ClientFactory) NewAccountsClient() *AccountsClient {
+ return &AccountsClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewBlobContainersClient creates a new instance of BlobContainersClient.
+func (c *ClientFactory) NewBlobContainersClient() *BlobContainersClient {
+ return &BlobContainersClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewBlobInventoryPoliciesClient creates a new instance of BlobInventoryPoliciesClient.
+func (c *ClientFactory) NewBlobInventoryPoliciesClient() *BlobInventoryPoliciesClient {
+ return &BlobInventoryPoliciesClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewBlobServicesClient creates a new instance of BlobServicesClient.
+func (c *ClientFactory) NewBlobServicesClient() *BlobServicesClient {
+ return &BlobServicesClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewDeletedAccountsClient creates a new instance of DeletedAccountsClient.
+func (c *ClientFactory) NewDeletedAccountsClient() *DeletedAccountsClient {
+ return &DeletedAccountsClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewEncryptionScopesClient creates a new instance of EncryptionScopesClient.
+func (c *ClientFactory) NewEncryptionScopesClient() *EncryptionScopesClient {
+ return &EncryptionScopesClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewFileServicesClient creates a new instance of FileServicesClient.
+func (c *ClientFactory) NewFileServicesClient() *FileServicesClient {
+ return &FileServicesClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewFileSharesClient creates a new instance of FileSharesClient.
+func (c *ClientFactory) NewFileSharesClient() *FileSharesClient {
+ return &FileSharesClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewLocalUsersClient creates a new instance of LocalUsersClient.
+func (c *ClientFactory) NewLocalUsersClient() *LocalUsersClient {
+ return &LocalUsersClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewManagementPoliciesClient creates a new instance of ManagementPoliciesClient.
+func (c *ClientFactory) NewManagementPoliciesClient() *ManagementPoliciesClient {
+ return &ManagementPoliciesClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewNetworkSecurityPerimeterConfigurationsClient creates a new instance of NetworkSecurityPerimeterConfigurationsClient.
+func (c *ClientFactory) NewNetworkSecurityPerimeterConfigurationsClient() *NetworkSecurityPerimeterConfigurationsClient {
+ return &NetworkSecurityPerimeterConfigurationsClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewObjectReplicationPoliciesClient creates a new instance of ObjectReplicationPoliciesClient.
+func (c *ClientFactory) NewObjectReplicationPoliciesClient() *ObjectReplicationPoliciesClient {
+ return &ObjectReplicationPoliciesClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewOperationsClient creates a new instance of OperationsClient.
+func (c *ClientFactory) NewOperationsClient() *OperationsClient {
+ return &OperationsClient{
+ internal: c.internal,
+ }
+}
+
+// NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient.
+func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient {
+ return &PrivateEndpointConnectionsClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient.
+func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient {
+ return &PrivateLinkResourcesClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewQueueClient creates a new instance of QueueClient.
+func (c *ClientFactory) NewQueueClient() *QueueClient {
+ return &QueueClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewQueueServicesClient creates a new instance of QueueServicesClient.
+func (c *ClientFactory) NewQueueServicesClient() *QueueServicesClient {
+ return &QueueServicesClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewSKUsClient creates a new instance of SKUsClient.
+func (c *ClientFactory) NewSKUsClient() *SKUsClient {
+ return &SKUsClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewTableClient creates a new instance of TableClient.
+func (c *ClientFactory) NewTableClient() *TableClient {
+ return &TableClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewTableServicesClient creates a new instance of TableServicesClient.
+func (c *ClientFactory) NewTableServicesClient() *TableServicesClient {
+ return &TableServicesClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewTaskAssignmentInstancesReportClient creates a new instance of TaskAssignmentInstancesReportClient.
+func (c *ClientFactory) NewTaskAssignmentInstancesReportClient() *TaskAssignmentInstancesReportClient {
+ return &TaskAssignmentInstancesReportClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewTaskAssignmentsClient creates a new instance of TaskAssignmentsClient.
+func (c *ClientFactory) NewTaskAssignmentsClient() *TaskAssignmentsClient {
+ return &TaskAssignmentsClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewTaskAssignmentsInstancesReportClient creates a new instance of TaskAssignmentsInstancesReportClient.
+func (c *ClientFactory) NewTaskAssignmentsInstancesReportClient() *TaskAssignmentsInstancesReportClient {
+ return &TaskAssignmentsInstancesReportClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
+
+// NewUsagesClient creates a new instance of UsagesClient.
+func (c *ClientFactory) NewUsagesClient() *UsagesClient {
+ return &UsagesClient{
+ subscriptionID: c.subscriptionID,
+ internal: c.internal,
+ }
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/constants.go
new file mode 100644
index 0000000000..c9aa130a56
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/constants.go
@@ -0,0 +1,1486 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+// AccessTier - Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium'
+// access tier is the default value for premium block blobs storage account type and it cannot
+// be changed for the premium block blobs storage account type.
+type AccessTier string
+
+const (
+ AccessTierCold AccessTier = "Cold"
+ AccessTierCool AccessTier = "Cool"
+ AccessTierHot AccessTier = "Hot"
+ AccessTierPremium AccessTier = "Premium"
+)
+
+// PossibleAccessTierValues returns the possible values for the AccessTier const type.
+func PossibleAccessTierValues() []AccessTier {
+ return []AccessTier{
+ AccessTierCold,
+ AccessTierCool,
+ AccessTierHot,
+ AccessTierPremium,
+ }
+}
+
+// AccountImmutabilityPolicyState - The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the
+// policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling
+// allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A policy
+// can only be created in a Disabled or Unlocked state and can be toggled between
+// the two states. Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted.
+type AccountImmutabilityPolicyState string
+
+const (
+ AccountImmutabilityPolicyStateDisabled AccountImmutabilityPolicyState = "Disabled"
+ AccountImmutabilityPolicyStateLocked AccountImmutabilityPolicyState = "Locked"
+ AccountImmutabilityPolicyStateUnlocked AccountImmutabilityPolicyState = "Unlocked"
+)
+
+// PossibleAccountImmutabilityPolicyStateValues returns the possible values for the AccountImmutabilityPolicyState const type.
+func PossibleAccountImmutabilityPolicyStateValues() []AccountImmutabilityPolicyState {
+ return []AccountImmutabilityPolicyState{
+ AccountImmutabilityPolicyStateDisabled,
+ AccountImmutabilityPolicyStateLocked,
+ AccountImmutabilityPolicyStateUnlocked,
+ }
+}
+
+// AccountStatus - Gets the status indicating whether the primary location of the storage account is available or unavailable.
+type AccountStatus string
+
+const (
+ AccountStatusAvailable AccountStatus = "available"
+ AccountStatusUnavailable AccountStatus = "unavailable"
+)
+
+// PossibleAccountStatusValues returns the possible values for the AccountStatus const type.
+func PossibleAccountStatusValues() []AccountStatus {
+ return []AccountStatus{
+ AccountStatusAvailable,
+ AccountStatusUnavailable,
+ }
+}
+
+// ActiveDirectoryPropertiesAccountType - Specifies the Active Directory account type for Azure Storage. If directoryServiceOptions
+// is set to AD (AD DS authentication), this property is optional. If provided, samAccountName should also be
+// provided. For directoryServiceOptions AADDS (Entra DS authentication) or AADKERB (Entra authentication), this property
+// can be omitted.
+type ActiveDirectoryPropertiesAccountType string
+
+const (
+ ActiveDirectoryPropertiesAccountTypeComputer ActiveDirectoryPropertiesAccountType = "Computer"
+ ActiveDirectoryPropertiesAccountTypeUser ActiveDirectoryPropertiesAccountType = "User"
+)
+
+// PossibleActiveDirectoryPropertiesAccountTypeValues returns the possible values for the ActiveDirectoryPropertiesAccountType const type.
+func PossibleActiveDirectoryPropertiesAccountTypeValues() []ActiveDirectoryPropertiesAccountType {
+ return []ActiveDirectoryPropertiesAccountType{
+ ActiveDirectoryPropertiesAccountTypeComputer,
+ ActiveDirectoryPropertiesAccountTypeUser,
+ }
+}
+
+// AllowedCopyScope - Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet.
+type AllowedCopyScope string
+
+const (
+ AllowedCopyScopeAAD AllowedCopyScope = "AAD"
+ AllowedCopyScopePrivateLink AllowedCopyScope = "PrivateLink"
+)
+
+// PossibleAllowedCopyScopeValues returns the possible values for the AllowedCopyScope const type.
+func PossibleAllowedCopyScopeValues() []AllowedCopyScope {
+ return []AllowedCopyScope{
+ AllowedCopyScopeAAD,
+ AllowedCopyScopePrivateLink,
+ }
+}
+
+type BlobInventoryPolicyName string
+
+const (
+ BlobInventoryPolicyNameDefault BlobInventoryPolicyName = "default"
+)
+
+// PossibleBlobInventoryPolicyNameValues returns the possible values for the BlobInventoryPolicyName const type.
+func PossibleBlobInventoryPolicyNameValues() []BlobInventoryPolicyName {
+ return []BlobInventoryPolicyName{
+ BlobInventoryPolicyNameDefault,
+ }
+}
+
+// BlobRestoreProgressStatus - The status of blob restore progress. Possible values are: - InProgress: Indicates that blob
+// restore is ongoing. - Complete: Indicates that blob restore has been completed successfully. - Failed:
+// Indicates that blob restore is failed.
+type BlobRestoreProgressStatus string
+
+const (
+ BlobRestoreProgressStatusComplete BlobRestoreProgressStatus = "Complete"
+ BlobRestoreProgressStatusFailed BlobRestoreProgressStatus = "Failed"
+ BlobRestoreProgressStatusInProgress BlobRestoreProgressStatus = "InProgress"
+)
+
+// PossibleBlobRestoreProgressStatusValues returns the possible values for the BlobRestoreProgressStatus const type.
+func PossibleBlobRestoreProgressStatusValues() []BlobRestoreProgressStatus {
+ return []BlobRestoreProgressStatus{
+ BlobRestoreProgressStatusComplete,
+ BlobRestoreProgressStatusFailed,
+ BlobRestoreProgressStatusInProgress,
+ }
+}
+
+// Bypass - Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of
+// Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none
+// of those traffics.
+type Bypass string
+
+const (
+ BypassAzureServices Bypass = "AzureServices"
+ BypassLogging Bypass = "Logging"
+ BypassMetrics Bypass = "Metrics"
+ BypassNone Bypass = "None"
+)
+
+// PossibleBypassValues returns the possible values for the Bypass const type.
+func PossibleBypassValues() []Bypass {
+ return []Bypass{
+ BypassAzureServices,
+ BypassLogging,
+ BypassMetrics,
+ BypassNone,
+ }
+}
+
+type CorsRuleAllowedMethodsItem string
+
+const (
+ CorsRuleAllowedMethodsItemCONNECT CorsRuleAllowedMethodsItem = "CONNECT"
+ CorsRuleAllowedMethodsItemDELETE CorsRuleAllowedMethodsItem = "DELETE"
+ CorsRuleAllowedMethodsItemGET CorsRuleAllowedMethodsItem = "GET"
+ CorsRuleAllowedMethodsItemHEAD CorsRuleAllowedMethodsItem = "HEAD"
+ CorsRuleAllowedMethodsItemMERGE CorsRuleAllowedMethodsItem = "MERGE"
+ CorsRuleAllowedMethodsItemOPTIONS CorsRuleAllowedMethodsItem = "OPTIONS"
+ CorsRuleAllowedMethodsItemPATCH CorsRuleAllowedMethodsItem = "PATCH"
+ CorsRuleAllowedMethodsItemPOST CorsRuleAllowedMethodsItem = "POST"
+ CorsRuleAllowedMethodsItemPUT CorsRuleAllowedMethodsItem = "PUT"
+ CorsRuleAllowedMethodsItemTRACE CorsRuleAllowedMethodsItem = "TRACE"
+)
+
+// PossibleCorsRuleAllowedMethodsItemValues returns the possible values for the CorsRuleAllowedMethodsItem const type.
+func PossibleCorsRuleAllowedMethodsItemValues() []CorsRuleAllowedMethodsItem {
+ return []CorsRuleAllowedMethodsItem{
+ CorsRuleAllowedMethodsItemCONNECT,
+ CorsRuleAllowedMethodsItemDELETE,
+ CorsRuleAllowedMethodsItemGET,
+ CorsRuleAllowedMethodsItemHEAD,
+ CorsRuleAllowedMethodsItemMERGE,
+ CorsRuleAllowedMethodsItemOPTIONS,
+ CorsRuleAllowedMethodsItemPATCH,
+ CorsRuleAllowedMethodsItemPOST,
+ CorsRuleAllowedMethodsItemPUT,
+ CorsRuleAllowedMethodsItemTRACE,
+ }
+}
+
+// CreatedByType - The type of identity that created the resource.
+type CreatedByType string
+
+const (
+ CreatedByTypeApplication CreatedByType = "Application"
+ CreatedByTypeKey CreatedByType = "Key"
+ CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
+ CreatedByTypeUser CreatedByType = "User"
+)
+
+// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.
+func PossibleCreatedByTypeValues() []CreatedByType {
+ return []CreatedByType{
+ CreatedByTypeApplication,
+ CreatedByTypeKey,
+ CreatedByTypeManagedIdentity,
+ CreatedByTypeUser,
+ }
+}
+
+// DNSEndpointType - Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts
+// in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL
+// will have an alphanumeric DNS Zone identifier.
+type DNSEndpointType string
+
+const (
+ DNSEndpointTypeAzureDNSZone DNSEndpointType = "AzureDnsZone"
+ DNSEndpointTypeStandard DNSEndpointType = "Standard"
+)
+
+// PossibleDNSEndpointTypeValues returns the possible values for the DNSEndpointType const type.
+func PossibleDNSEndpointTypeValues() []DNSEndpointType {
+ return []DNSEndpointType{
+ DNSEndpointTypeAzureDNSZone,
+ DNSEndpointTypeStandard,
+ }
+}
+
+// DefaultAction - Specifies the default action of allow or deny when no other rules match.
+type DefaultAction string
+
+const (
+ DefaultActionAllow DefaultAction = "Allow"
+ DefaultActionDeny DefaultAction = "Deny"
+)
+
+// PossibleDefaultActionValues returns the possible values for the DefaultAction const type.
+func PossibleDefaultActionValues() []DefaultAction {
+ return []DefaultAction{
+ DefaultActionAllow,
+ DefaultActionDeny,
+ }
+}
+
+// DefaultSharePermission - Default share permission for users using Kerberos authentication if RBAC role is not assigned.
+type DefaultSharePermission string
+
+const (
+ DefaultSharePermissionNone DefaultSharePermission = "None"
+ DefaultSharePermissionStorageFileDataSmbShareContributor DefaultSharePermission = "StorageFileDataSmbShareContributor"
+ DefaultSharePermissionStorageFileDataSmbShareElevatedContributor DefaultSharePermission = "StorageFileDataSmbShareElevatedContributor"
+ DefaultSharePermissionStorageFileDataSmbShareReader DefaultSharePermission = "StorageFileDataSmbShareReader"
+)
+
+// PossibleDefaultSharePermissionValues returns the possible values for the DefaultSharePermission const type.
+func PossibleDefaultSharePermissionValues() []DefaultSharePermission {
+ return []DefaultSharePermission{
+ DefaultSharePermissionNone,
+ DefaultSharePermissionStorageFileDataSmbShareContributor,
+ DefaultSharePermissionStorageFileDataSmbShareElevatedContributor,
+ DefaultSharePermissionStorageFileDataSmbShareReader,
+ }
+}
+
+// DirectoryServiceOptions - Indicates the directory service used. Note that this enum may be extended in the future.
+type DirectoryServiceOptions string
+
+const (
+ DirectoryServiceOptionsAADDS DirectoryServiceOptions = "AADDS"
+ DirectoryServiceOptionsAADKERB DirectoryServiceOptions = "AADKERB"
+ DirectoryServiceOptionsAD DirectoryServiceOptions = "AD"
+ DirectoryServiceOptionsNone DirectoryServiceOptions = "None"
+)
+
+// PossibleDirectoryServiceOptionsValues returns the possible values for the DirectoryServiceOptions const type.
+func PossibleDirectoryServiceOptionsValues() []DirectoryServiceOptions {
+ return []DirectoryServiceOptions{
+ DirectoryServiceOptionsAADDS,
+ DirectoryServiceOptionsAADKERB,
+ DirectoryServiceOptionsAD,
+ DirectoryServiceOptionsNone,
+ }
+}
+
+// EnabledProtocols - The authentication protocol that is used for the file share. Can only be specified when creating a share.
+type EnabledProtocols string
+
+const (
+ EnabledProtocolsNFS EnabledProtocols = "NFS"
+ EnabledProtocolsSMB EnabledProtocols = "SMB"
+)
+
+// PossibleEnabledProtocolsValues returns the possible values for the EnabledProtocols const type.
+func PossibleEnabledProtocolsValues() []EnabledProtocols {
+ return []EnabledProtocols{
+ EnabledProtocolsNFS,
+ EnabledProtocolsSMB,
+ }
+}
+
+// EncryptionScopeSource - The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault.
+type EncryptionScopeSource string
+
+const (
+ EncryptionScopeSourceMicrosoftKeyVault EncryptionScopeSource = "Microsoft.KeyVault"
+ EncryptionScopeSourceMicrosoftStorage EncryptionScopeSource = "Microsoft.Storage"
+)
+
+// PossibleEncryptionScopeSourceValues returns the possible values for the EncryptionScopeSource const type.
+func PossibleEncryptionScopeSourceValues() []EncryptionScopeSource {
+ return []EncryptionScopeSource{
+ EncryptionScopeSourceMicrosoftKeyVault,
+ EncryptionScopeSourceMicrosoftStorage,
+ }
+}
+
+// EncryptionScopeState - The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled.
+type EncryptionScopeState string
+
+const (
+ EncryptionScopeStateDisabled EncryptionScopeState = "Disabled"
+ EncryptionScopeStateEnabled EncryptionScopeState = "Enabled"
+)
+
+// PossibleEncryptionScopeStateValues returns the possible values for the EncryptionScopeState const type.
+func PossibleEncryptionScopeStateValues() []EncryptionScopeState {
+ return []EncryptionScopeState{
+ EncryptionScopeStateDisabled,
+ EncryptionScopeStateEnabled,
+ }
+}
+
+// ExpirationAction - The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated.
+// The 'Log' action can be used for audit purposes and the 'Block' action can be used to block
+// and deny the usage of SAS tokens that do not adhere to the sas policy expiration period.
+type ExpirationAction string
+
+const (
+ ExpirationActionBlock ExpirationAction = "Block"
+ ExpirationActionLog ExpirationAction = "Log"
+)
+
+// PossibleExpirationActionValues returns the possible values for the ExpirationAction const type.
+func PossibleExpirationActionValues() []ExpirationAction {
+ return []ExpirationAction{
+ ExpirationActionBlock,
+ ExpirationActionLog,
+ }
+}
+
+// ExtendedLocationTypes - The type of extendedLocation.
+type ExtendedLocationTypes string
+
+const (
+ ExtendedLocationTypesEdgeZone ExtendedLocationTypes = "EdgeZone"
+)
+
+// PossibleExtendedLocationTypesValues returns the possible values for the ExtendedLocationTypes const type.
+func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes {
+ return []ExtendedLocationTypes{
+ ExtendedLocationTypesEdgeZone,
+ }
+}
+
+// Format - This is a required field, it specifies the format for the inventory files.
+type Format string
+
+const (
+ FormatCSV Format = "Csv"
+ FormatParquet Format = "Parquet"
+)
+
+// PossibleFormatValues returns the possible values for the Format const type.
+func PossibleFormatValues() []Format {
+ return []Format{
+ FormatCSV,
+ FormatParquet,
+ }
+}
+
+// GeoReplicationStatus - The status of the secondary location. Possible values are: - Live: Indicates that the secondary
+// location is active and operational. - Bootstrap: Indicates initial synchronization from the primary
+// location to the secondary location is in progress.This typically occurs when replication is first enabled. - Unavailable:
+// Indicates that the secondary location is temporarily unavailable.
+type GeoReplicationStatus string
+
+const (
+ GeoReplicationStatusBootstrap GeoReplicationStatus = "Bootstrap"
+ GeoReplicationStatusLive GeoReplicationStatus = "Live"
+ GeoReplicationStatusUnavailable GeoReplicationStatus = "Unavailable"
+)
+
+// PossibleGeoReplicationStatusValues returns the possible values for the GeoReplicationStatus const type.
+func PossibleGeoReplicationStatusValues() []GeoReplicationStatus {
+ return []GeoReplicationStatus{
+ GeoReplicationStatusBootstrap,
+ GeoReplicationStatusLive,
+ GeoReplicationStatusUnavailable,
+ }
+}
+
+// HTTPProtocol - The protocol permitted for a request made with the account SAS.
+type HTTPProtocol string
+
+const (
+ HTTPProtocolHTTPS HTTPProtocol = "https"
+ HTTPProtocolHTTPSHTTP HTTPProtocol = "https,http"
+)
+
+// PossibleHTTPProtocolValues returns the possible values for the HTTPProtocol const type.
+func PossibleHTTPProtocolValues() []HTTPProtocol {
+ return []HTTPProtocol{
+ HTTPProtocolHTTPS,
+ HTTPProtocolHTTPSHTTP,
+ }
+}
+
+// IdentityType - The identity type.
+type IdentityType string
+
+const (
+ IdentityTypeNone IdentityType = "None"
+ IdentityTypeSystemAssigned IdentityType = "SystemAssigned"
+ IdentityTypeSystemAssignedUserAssigned IdentityType = "SystemAssigned,UserAssigned"
+ IdentityTypeUserAssigned IdentityType = "UserAssigned"
+)
+
+// PossibleIdentityTypeValues returns the possible values for the IdentityType const type.
+func PossibleIdentityTypeValues() []IdentityType {
+ return []IdentityType{
+ IdentityTypeNone,
+ IdentityTypeSystemAssigned,
+ IdentityTypeSystemAssignedUserAssigned,
+ IdentityTypeUserAssigned,
+ }
+}
+
+// ImmutabilityPolicyState - The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked.
+type ImmutabilityPolicyState string
+
+const (
+ ImmutabilityPolicyStateLocked ImmutabilityPolicyState = "Locked"
+ ImmutabilityPolicyStateUnlocked ImmutabilityPolicyState = "Unlocked"
+)
+
+// PossibleImmutabilityPolicyStateValues returns the possible values for the ImmutabilityPolicyState const type.
+func PossibleImmutabilityPolicyStateValues() []ImmutabilityPolicyState {
+ return []ImmutabilityPolicyState{
+ ImmutabilityPolicyStateLocked,
+ ImmutabilityPolicyStateUnlocked,
+ }
+}
+
+// ImmutabilityPolicyUpdateType - The ImmutabilityPolicy update type of a blob container, possible values include: put, lock
+// and extend.
+type ImmutabilityPolicyUpdateType string
+
+const (
+ ImmutabilityPolicyUpdateTypeExtend ImmutabilityPolicyUpdateType = "extend"
+ ImmutabilityPolicyUpdateTypeLock ImmutabilityPolicyUpdateType = "lock"
+ ImmutabilityPolicyUpdateTypePut ImmutabilityPolicyUpdateType = "put"
+)
+
+// PossibleImmutabilityPolicyUpdateTypeValues returns the possible values for the ImmutabilityPolicyUpdateType const type.
+func PossibleImmutabilityPolicyUpdateTypeValues() []ImmutabilityPolicyUpdateType {
+ return []ImmutabilityPolicyUpdateType{
+ ImmutabilityPolicyUpdateTypeExtend,
+ ImmutabilityPolicyUpdateTypeLock,
+ ImmutabilityPolicyUpdateTypePut,
+ }
+}
+
+// IntervalUnit - Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule';
+// this property should not be present when ExecutionTrigger.properties.type is
+// 'RunOnce'
+type IntervalUnit string
+
+const (
+ IntervalUnitDays IntervalUnit = "Days"
+)
+
+// PossibleIntervalUnitValues returns the possible values for the IntervalUnit const type.
+func PossibleIntervalUnitValues() []IntervalUnit {
+ return []IntervalUnit{
+ IntervalUnitDays,
+ }
+}
+
+// InventoryRuleType - The valid value is Inventory
+type InventoryRuleType string
+
+const (
+ InventoryRuleTypeInventory InventoryRuleType = "Inventory"
+)
+
+// PossibleInventoryRuleTypeValues returns the possible values for the InventoryRuleType const type.
+func PossibleInventoryRuleTypeValues() []InventoryRuleType {
+ return []InventoryRuleType{
+ InventoryRuleTypeInventory,
+ }
+}
+
+// IssueType - Type of issue
+type IssueType string
+
+const (
+ IssueTypeConfigurationPropagationFailure IssueType = "ConfigurationPropagationFailure"
+ IssueTypeUnknown IssueType = "Unknown"
+)
+
+// PossibleIssueTypeValues returns the possible values for the IssueType const type.
+func PossibleIssueTypeValues() []IssueType {
+ return []IssueType{
+ IssueTypeConfigurationPropagationFailure,
+ IssueTypeUnknown,
+ }
+}
+
+// KeyPermission - Permissions for the key -- read-only or full permissions.
+type KeyPermission string
+
+const (
+ KeyPermissionFull KeyPermission = "Full"
+ KeyPermissionRead KeyPermission = "Read"
+)
+
+// PossibleKeyPermissionValues returns the possible values for the KeyPermission const type.
+func PossibleKeyPermissionValues() []KeyPermission {
+ return []KeyPermission{
+ KeyPermissionFull,
+ KeyPermissionRead,
+ }
+}
+
+// KeySource - The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault
+type KeySource string
+
+const (
+ KeySourceMicrosoftKeyvault KeySource = "Microsoft.Keyvault"
+ KeySourceMicrosoftStorage KeySource = "Microsoft.Storage"
+)
+
+// PossibleKeySourceValues returns the possible values for the KeySource const type.
+func PossibleKeySourceValues() []KeySource {
+ return []KeySource{
+ KeySourceMicrosoftKeyvault,
+ KeySourceMicrosoftStorage,
+ }
+}
+
+// KeyType - Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped
+// encryption key will be used. 'Service' key type implies that a default service key is used.
+type KeyType string
+
+const (
+ KeyTypeAccount KeyType = "Account"
+ KeyTypeService KeyType = "Service"
+)
+
+// PossibleKeyTypeValues returns the possible values for the KeyType const type.
+func PossibleKeyTypeValues() []KeyType {
+ return []KeyType{
+ KeyTypeAccount,
+ KeyTypeService,
+ }
+}
+
+// Kind - Indicates the type of storage account.
+type Kind string
+
+const (
+ KindBlobStorage Kind = "BlobStorage"
+ KindBlockBlobStorage Kind = "BlockBlobStorage"
+ KindFileStorage Kind = "FileStorage"
+ KindStorage Kind = "Storage"
+ KindStorageV2 Kind = "StorageV2"
+)
+
+// PossibleKindValues returns the possible values for the Kind const type.
+func PossibleKindValues() []Kind {
+ return []Kind{
+ KindBlobStorage,
+ KindBlockBlobStorage,
+ KindFileStorage,
+ KindStorage,
+ KindStorageV2,
+ }
+}
+
+// LargeFileSharesState - Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled.
+type LargeFileSharesState string
+
+const (
+ LargeFileSharesStateDisabled LargeFileSharesState = "Disabled"
+ LargeFileSharesStateEnabled LargeFileSharesState = "Enabled"
+)
+
+// PossibleLargeFileSharesStateValues returns the possible values for the LargeFileSharesState const type.
+func PossibleLargeFileSharesStateValues() []LargeFileSharesState {
+ return []LargeFileSharesState{
+ LargeFileSharesStateDisabled,
+ LargeFileSharesStateEnabled,
+ }
+}
+
+// LeaseContainerRequestAction - Specifies the lease action. Can be one of the available actions.
+type LeaseContainerRequestAction string
+
+const (
+ LeaseContainerRequestActionAcquire LeaseContainerRequestAction = "Acquire"
+ LeaseContainerRequestActionBreak LeaseContainerRequestAction = "Break"
+ LeaseContainerRequestActionChange LeaseContainerRequestAction = "Change"
+ LeaseContainerRequestActionRelease LeaseContainerRequestAction = "Release"
+ LeaseContainerRequestActionRenew LeaseContainerRequestAction = "Renew"
+)
+
+// PossibleLeaseContainerRequestActionValues returns the possible values for the LeaseContainerRequestAction const type.
+func PossibleLeaseContainerRequestActionValues() []LeaseContainerRequestAction {
+ return []LeaseContainerRequestAction{
+ LeaseContainerRequestActionAcquire,
+ LeaseContainerRequestActionBreak,
+ LeaseContainerRequestActionChange,
+ LeaseContainerRequestActionRelease,
+ LeaseContainerRequestActionRenew,
+ }
+}
+
+// LeaseDuration - Specifies whether the lease on a container is of infinite or fixed duration, only when the container is
+// leased.
+type LeaseDuration string
+
+const (
+ LeaseDurationFixed LeaseDuration = "Fixed"
+ LeaseDurationInfinite LeaseDuration = "Infinite"
+)
+
+// PossibleLeaseDurationValues returns the possible values for the LeaseDuration const type.
+func PossibleLeaseDurationValues() []LeaseDuration {
+ return []LeaseDuration{
+ LeaseDurationFixed,
+ LeaseDurationInfinite,
+ }
+}
+
+// LeaseShareAction - Specifies the lease action. Can be one of the available actions.
+type LeaseShareAction string
+
+const (
+ LeaseShareActionAcquire LeaseShareAction = "Acquire"
+ LeaseShareActionBreak LeaseShareAction = "Break"
+ LeaseShareActionChange LeaseShareAction = "Change"
+ LeaseShareActionRelease LeaseShareAction = "Release"
+ LeaseShareActionRenew LeaseShareAction = "Renew"
+)
+
+// PossibleLeaseShareActionValues returns the possible values for the LeaseShareAction const type.
+func PossibleLeaseShareActionValues() []LeaseShareAction {
+ return []LeaseShareAction{
+ LeaseShareActionAcquire,
+ LeaseShareActionBreak,
+ LeaseShareActionChange,
+ LeaseShareActionRelease,
+ LeaseShareActionRenew,
+ }
+}
+
+// LeaseState - Lease state of the container.
+type LeaseState string
+
+const (
+ LeaseStateAvailable LeaseState = "Available"
+ LeaseStateBreaking LeaseState = "Breaking"
+ LeaseStateBroken LeaseState = "Broken"
+ LeaseStateExpired LeaseState = "Expired"
+ LeaseStateLeased LeaseState = "Leased"
+)
+
+// PossibleLeaseStateValues returns the possible values for the LeaseState const type.
+func PossibleLeaseStateValues() []LeaseState {
+ return []LeaseState{
+ LeaseStateAvailable,
+ LeaseStateBreaking,
+ LeaseStateBroken,
+ LeaseStateExpired,
+ LeaseStateLeased,
+ }
+}
+
+// LeaseStatus - The lease status of the container.
+type LeaseStatus string
+
+const (
+ LeaseStatusLocked LeaseStatus = "Locked"
+ LeaseStatusUnlocked LeaseStatus = "Unlocked"
+)
+
+// PossibleLeaseStatusValues returns the possible values for the LeaseStatus const type.
+func PossibleLeaseStatusValues() []LeaseStatus {
+ return []LeaseStatus{
+ LeaseStatusLocked,
+ LeaseStatusUnlocked,
+ }
+}
+
+type ListContainersInclude string
+
+const (
+ ListContainersIncludeDeleted ListContainersInclude = "deleted"
+)
+
+// PossibleListContainersIncludeValues returns the possible values for the ListContainersInclude const type.
+func PossibleListContainersIncludeValues() []ListContainersInclude {
+ return []ListContainersInclude{
+ ListContainersIncludeDeleted,
+ }
+}
+
+type ListEncryptionScopesInclude string
+
+const (
+ ListEncryptionScopesIncludeAll ListEncryptionScopesInclude = "All"
+ ListEncryptionScopesIncludeDisabled ListEncryptionScopesInclude = "Disabled"
+ ListEncryptionScopesIncludeEnabled ListEncryptionScopesInclude = "Enabled"
+)
+
+// PossibleListEncryptionScopesIncludeValues returns the possible values for the ListEncryptionScopesInclude const type.
+func PossibleListEncryptionScopesIncludeValues() []ListEncryptionScopesInclude {
+ return []ListEncryptionScopesInclude{
+ ListEncryptionScopesIncludeAll,
+ ListEncryptionScopesIncludeDisabled,
+ ListEncryptionScopesIncludeEnabled,
+ }
+}
+
+type ListLocalUserIncludeParam string
+
+const (
+ ListLocalUserIncludeParamNfsv3 ListLocalUserIncludeParam = "nfsv3"
+)
+
+// PossibleListLocalUserIncludeParamValues returns the possible values for the ListLocalUserIncludeParam const type.
+func PossibleListLocalUserIncludeParamValues() []ListLocalUserIncludeParam {
+ return []ListLocalUserIncludeParam{
+ ListLocalUserIncludeParamNfsv3,
+ }
+}
+
+type ManagementPolicyName string
+
+const (
+ ManagementPolicyNameDefault ManagementPolicyName = "default"
+)
+
+// PossibleManagementPolicyNameValues returns the possible values for the ManagementPolicyName const type.
+func PossibleManagementPolicyNameValues() []ManagementPolicyName {
+ return []ManagementPolicyName{
+ ManagementPolicyNameDefault,
+ }
+}
+
+type MigrationName string
+
+const (
+ MigrationNameDefault MigrationName = "default"
+)
+
+// PossibleMigrationNameValues returns the possible values for the MigrationName const type.
+func PossibleMigrationNameValues() []MigrationName {
+ return []MigrationName{
+ MigrationNameDefault,
+ }
+}
+
+// MigrationState - This property denotes the container level immutability to object level immutability migration state.
+type MigrationState string
+
+const (
+ MigrationStateCompleted MigrationState = "Completed"
+ MigrationStateInProgress MigrationState = "InProgress"
+)
+
+// PossibleMigrationStateValues returns the possible values for the MigrationState const type.
+func PossibleMigrationStateValues() []MigrationState {
+ return []MigrationState{
+ MigrationStateCompleted,
+ MigrationStateInProgress,
+ }
+}
+
+// MigrationStatus - Current status of migration
+type MigrationStatus string
+
+const (
+ MigrationStatusComplete MigrationStatus = "Complete"
+ MigrationStatusFailed MigrationStatus = "Failed"
+ MigrationStatusInProgress MigrationStatus = "InProgress"
+ MigrationStatusInvalid MigrationStatus = "Invalid"
+ MigrationStatusSubmittedForConversion MigrationStatus = "SubmittedForConversion"
+)
+
+// PossibleMigrationStatusValues returns the possible values for the MigrationStatus const type.
+func PossibleMigrationStatusValues() []MigrationStatus {
+ return []MigrationStatus{
+ MigrationStatusComplete,
+ MigrationStatusFailed,
+ MigrationStatusInProgress,
+ MigrationStatusInvalid,
+ MigrationStatusSubmittedForConversion,
+ }
+}
+
+// MinimumTLSVersion - Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS
+// 1.0 for this property.
+type MinimumTLSVersion string
+
+const (
+ MinimumTLSVersionTLS10 MinimumTLSVersion = "TLS1_0"
+ MinimumTLSVersionTLS11 MinimumTLSVersion = "TLS1_1"
+ MinimumTLSVersionTLS12 MinimumTLSVersion = "TLS1_2"
+ MinimumTLSVersionTLS13 MinimumTLSVersion = "TLS1_3"
+)
+
+// PossibleMinimumTLSVersionValues returns the possible values for the MinimumTLSVersion const type.
+func PossibleMinimumTLSVersionValues() []MinimumTLSVersion {
+ return []MinimumTLSVersion{
+ MinimumTLSVersionTLS10,
+ MinimumTLSVersionTLS11,
+ MinimumTLSVersionTLS12,
+ MinimumTLSVersionTLS13,
+ }
+}
+
+// Name - Name of the policy. The valid value is AccessTimeTracking. This field is currently read only
+type Name string
+
+const (
+ NameAccessTimeTracking Name = "AccessTimeTracking"
+)
+
+// PossibleNameValues returns the possible values for the Name const type.
+func PossibleNameValues() []Name {
+ return []Name{
+ NameAccessTimeTracking,
+ }
+}
+
+// NetworkSecurityPerimeterConfigurationProvisioningState - Provisioning state of Network Security Perimeter configuration
+// propagation
+type NetworkSecurityPerimeterConfigurationProvisioningState string
+
+const (
+ NetworkSecurityPerimeterConfigurationProvisioningStateAccepted NetworkSecurityPerimeterConfigurationProvisioningState = "Accepted"
+ NetworkSecurityPerimeterConfigurationProvisioningStateCanceled NetworkSecurityPerimeterConfigurationProvisioningState = "Canceled"
+ NetworkSecurityPerimeterConfigurationProvisioningStateDeleting NetworkSecurityPerimeterConfigurationProvisioningState = "Deleting"
+ NetworkSecurityPerimeterConfigurationProvisioningStateFailed NetworkSecurityPerimeterConfigurationProvisioningState = "Failed"
+ NetworkSecurityPerimeterConfigurationProvisioningStateSucceeded NetworkSecurityPerimeterConfigurationProvisioningState = "Succeeded"
+)
+
+// PossibleNetworkSecurityPerimeterConfigurationProvisioningStateValues returns the possible values for the NetworkSecurityPerimeterConfigurationProvisioningState const type.
+func PossibleNetworkSecurityPerimeterConfigurationProvisioningStateValues() []NetworkSecurityPerimeterConfigurationProvisioningState {
+ return []NetworkSecurityPerimeterConfigurationProvisioningState{
+ NetworkSecurityPerimeterConfigurationProvisioningStateAccepted,
+ NetworkSecurityPerimeterConfigurationProvisioningStateCanceled,
+ NetworkSecurityPerimeterConfigurationProvisioningStateDeleting,
+ NetworkSecurityPerimeterConfigurationProvisioningStateFailed,
+ NetworkSecurityPerimeterConfigurationProvisioningStateSucceeded,
+ }
+}
+
+// NspAccessRuleDirection - Direction of Access Rule
+type NspAccessRuleDirection string
+
+const (
+ NspAccessRuleDirectionInbound NspAccessRuleDirection = "Inbound"
+ NspAccessRuleDirectionOutbound NspAccessRuleDirection = "Outbound"
+)
+
+// PossibleNspAccessRuleDirectionValues returns the possible values for the NspAccessRuleDirection const type.
+func PossibleNspAccessRuleDirectionValues() []NspAccessRuleDirection {
+ return []NspAccessRuleDirection{
+ NspAccessRuleDirectionInbound,
+ NspAccessRuleDirectionOutbound,
+ }
+}
+
+// ObjectType - This is a required field. This field specifies the scope of the inventory created either at the blob or container
+// level.
+type ObjectType string
+
+const (
+ ObjectTypeBlob ObjectType = "Blob"
+ ObjectTypeContainer ObjectType = "Container"
+)
+
+// PossibleObjectTypeValues returns the possible values for the ObjectType const type.
+func PossibleObjectTypeValues() []ObjectType {
+ return []ObjectType{
+ ObjectTypeBlob,
+ ObjectTypeContainer,
+ }
+}
+
+// Permissions - The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List
+// (l), Add (a), Create (c), Update (u) and Process (p).
+type Permissions string
+
+const (
+ PermissionsA Permissions = "a"
+ PermissionsC Permissions = "c"
+ PermissionsD Permissions = "d"
+ PermissionsL Permissions = "l"
+ PermissionsP Permissions = "p"
+ PermissionsR Permissions = "r"
+ PermissionsU Permissions = "u"
+ PermissionsW Permissions = "w"
+)
+
+// PossiblePermissionsValues returns the possible values for the Permissions const type.
+func PossiblePermissionsValues() []Permissions {
+ return []Permissions{
+ PermissionsA,
+ PermissionsC,
+ PermissionsD,
+ PermissionsL,
+ PermissionsP,
+ PermissionsR,
+ PermissionsU,
+ PermissionsW,
+ }
+}
+
+// PostFailoverRedundancy - The redundancy type of the account after an account failover is performed.
+type PostFailoverRedundancy string
+
+const (
+ PostFailoverRedundancyStandardLRS PostFailoverRedundancy = "Standard_LRS"
+ PostFailoverRedundancyStandardZRS PostFailoverRedundancy = "Standard_ZRS"
+)
+
+// PossiblePostFailoverRedundancyValues returns the possible values for the PostFailoverRedundancy const type.
+func PossiblePostFailoverRedundancyValues() []PostFailoverRedundancy {
+ return []PostFailoverRedundancy{
+ PostFailoverRedundancyStandardLRS,
+ PostFailoverRedundancyStandardZRS,
+ }
+}
+
+// PostPlannedFailoverRedundancy - The redundancy type of the account after a planned account failover is performed.
+type PostPlannedFailoverRedundancy string
+
+const (
+ PostPlannedFailoverRedundancyStandardGRS PostPlannedFailoverRedundancy = "Standard_GRS"
+ PostPlannedFailoverRedundancyStandardGZRS PostPlannedFailoverRedundancy = "Standard_GZRS"
+ PostPlannedFailoverRedundancyStandardRAGRS PostPlannedFailoverRedundancy = "Standard_RAGRS"
+ PostPlannedFailoverRedundancyStandardRAGZRS PostPlannedFailoverRedundancy = "Standard_RAGZRS"
+)
+
+// PossiblePostPlannedFailoverRedundancyValues returns the possible values for the PostPlannedFailoverRedundancy const type.
+func PossiblePostPlannedFailoverRedundancyValues() []PostPlannedFailoverRedundancy {
+ return []PostPlannedFailoverRedundancy{
+ PostPlannedFailoverRedundancyStandardGRS,
+ PostPlannedFailoverRedundancyStandardGZRS,
+ PostPlannedFailoverRedundancyStandardRAGRS,
+ PostPlannedFailoverRedundancyStandardRAGZRS,
+ }
+}
+
+// PrivateEndpointConnectionProvisioningState - The current provisioning state.
+type PrivateEndpointConnectionProvisioningState string
+
+const (
+ PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating"
+ PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting"
+ PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed"
+ PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded"
+)
+
+// PossiblePrivateEndpointConnectionProvisioningStateValues returns the possible values for the PrivateEndpointConnectionProvisioningState const type.
+func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState {
+ return []PrivateEndpointConnectionProvisioningState{
+ PrivateEndpointConnectionProvisioningStateCreating,
+ PrivateEndpointConnectionProvisioningStateDeleting,
+ PrivateEndpointConnectionProvisioningStateFailed,
+ PrivateEndpointConnectionProvisioningStateSucceeded,
+ }
+}
+
+// PrivateEndpointServiceConnectionStatus - The private endpoint connection status.
+type PrivateEndpointServiceConnectionStatus string
+
+const (
+ PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved"
+ PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending"
+ PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected"
+)
+
+// PossiblePrivateEndpointServiceConnectionStatusValues returns the possible values for the PrivateEndpointServiceConnectionStatus const type.
+func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus {
+ return []PrivateEndpointServiceConnectionStatus{
+ PrivateEndpointServiceConnectionStatusApproved,
+ PrivateEndpointServiceConnectionStatusPending,
+ PrivateEndpointServiceConnectionStatusRejected,
+ }
+}
+
+// ProvisioningState - Gets the status of the storage account at the time the operation was called.
+type ProvisioningState string
+
+const (
+ ProvisioningStateAccepted ProvisioningState = "Accepted"
+ ProvisioningStateCanceled ProvisioningState = "Canceled"
+ ProvisioningStateCreating ProvisioningState = "Creating"
+ ProvisioningStateDeleting ProvisioningState = "Deleting"
+ ProvisioningStateFailed ProvisioningState = "Failed"
+ ProvisioningStateResolvingDNS ProvisioningState = "ResolvingDNS"
+ ProvisioningStateSucceeded ProvisioningState = "Succeeded"
+ ProvisioningStateValidateSubscriptionQuotaBegin ProvisioningState = "ValidateSubscriptionQuotaBegin"
+ ProvisioningStateValidateSubscriptionQuotaEnd ProvisioningState = "ValidateSubscriptionQuotaEnd"
+)
+
+// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.
+func PossibleProvisioningStateValues() []ProvisioningState {
+ return []ProvisioningState{
+ ProvisioningStateAccepted,
+ ProvisioningStateCanceled,
+ ProvisioningStateCreating,
+ ProvisioningStateDeleting,
+ ProvisioningStateFailed,
+ ProvisioningStateResolvingDNS,
+ ProvisioningStateSucceeded,
+ ProvisioningStateValidateSubscriptionQuotaBegin,
+ ProvisioningStateValidateSubscriptionQuotaEnd,
+ }
+}
+
+// PublicAccess - Specifies whether data in the container may be accessed publicly and the level of access.
+type PublicAccess string
+
+const (
+ PublicAccessBlob PublicAccess = "Blob"
+ PublicAccessContainer PublicAccess = "Container"
+ PublicAccessNone PublicAccess = "None"
+)
+
+// PossiblePublicAccessValues returns the possible values for the PublicAccess const type.
+func PossiblePublicAccessValues() []PublicAccess {
+ return []PublicAccess{
+ PublicAccessBlob,
+ PublicAccessContainer,
+ PublicAccessNone,
+ }
+}
+
+// PublicNetworkAccess - Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access
+// to Storage Account. Value is optional but if passed in, must be 'Enabled', 'Disabled' or
+// 'SecuredByPerimeter'.
+type PublicNetworkAccess string
+
+const (
+ PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled"
+ PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled"
+ PublicNetworkAccessSecuredByPerimeter PublicNetworkAccess = "SecuredByPerimeter"
+)
+
+// PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type.
+func PossiblePublicNetworkAccessValues() []PublicNetworkAccess {
+ return []PublicNetworkAccess{
+ PublicNetworkAccessDisabled,
+ PublicNetworkAccessEnabled,
+ PublicNetworkAccessSecuredByPerimeter,
+ }
+}
+
+// Reason - Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable
+// is false.
+type Reason string
+
+const (
+ ReasonAccountNameInvalid Reason = "AccountNameInvalid"
+ ReasonAlreadyExists Reason = "AlreadyExists"
+)
+
+// PossibleReasonValues returns the possible values for the Reason const type.
+func PossibleReasonValues() []Reason {
+ return []Reason{
+ ReasonAccountNameInvalid,
+ ReasonAlreadyExists,
+ }
+}
+
+// ReasonCode - The reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id
+// is set when the SKU has requiredQuotas parameter as the subscription does not belong to that
+// quota. The "NotAvailableForSubscription" is related to capacity at DC.
+type ReasonCode string
+
+const (
+ ReasonCodeNotAvailableForSubscription ReasonCode = "NotAvailableForSubscription"
+ ReasonCodeQuotaID ReasonCode = "QuotaId"
+)
+
+// PossibleReasonCodeValues returns the possible values for the ReasonCode const type.
+func PossibleReasonCodeValues() []ReasonCode {
+ return []ReasonCode{
+ ReasonCodeNotAvailableForSubscription,
+ ReasonCodeQuotaID,
+ }
+}
+
+// ResourceAssociationAccessMode - Access Mode of the resource association
+type ResourceAssociationAccessMode string
+
+const (
+ ResourceAssociationAccessModeAudit ResourceAssociationAccessMode = "Audit"
+ ResourceAssociationAccessModeEnforced ResourceAssociationAccessMode = "Enforced"
+ ResourceAssociationAccessModeLearning ResourceAssociationAccessMode = "Learning"
+)
+
+// PossibleResourceAssociationAccessModeValues returns the possible values for the ResourceAssociationAccessMode const type.
+func PossibleResourceAssociationAccessModeValues() []ResourceAssociationAccessMode {
+ return []ResourceAssociationAccessMode{
+ ResourceAssociationAccessModeAudit,
+ ResourceAssociationAccessModeEnforced,
+ ResourceAssociationAccessModeLearning,
+ }
+}
+
+// RootSquashType - The property is for NFS share only. The default is NoRootSquash.
+type RootSquashType string
+
+const (
+ RootSquashTypeAllSquash RootSquashType = "AllSquash"
+ RootSquashTypeNoRootSquash RootSquashType = "NoRootSquash"
+ RootSquashTypeRootSquash RootSquashType = "RootSquash"
+)
+
+// PossibleRootSquashTypeValues returns the possible values for the RootSquashType const type.
+func PossibleRootSquashTypeValues() []RootSquashType {
+ return []RootSquashType{
+ RootSquashTypeAllSquash,
+ RootSquashTypeNoRootSquash,
+ RootSquashTypeRootSquash,
+ }
+}
+
+// RoutingChoice - Routing Choice defines the kind of network routing opted by the user.
+type RoutingChoice string
+
+const (
+ RoutingChoiceInternetRouting RoutingChoice = "InternetRouting"
+ RoutingChoiceMicrosoftRouting RoutingChoice = "MicrosoftRouting"
+)
+
+// PossibleRoutingChoiceValues returns the possible values for the RoutingChoice const type.
+func PossibleRoutingChoiceValues() []RoutingChoice {
+ return []RoutingChoice{
+ RoutingChoiceInternetRouting,
+ RoutingChoiceMicrosoftRouting,
+ }
+}
+
+// RuleType - The valid value is Lifecycle
+type RuleType string
+
+const (
+ RuleTypeLifecycle RuleType = "Lifecycle"
+)
+
+// PossibleRuleTypeValues returns the possible values for the RuleType const type.
+func PossibleRuleTypeValues() []RuleType {
+ return []RuleType{
+ RuleTypeLifecycle,
+ }
+}
+
+// RunResult - Represents the overall result of the execution for the run instance
+type RunResult string
+
+const (
+ RunResultFailed RunResult = "Failed"
+ RunResultSucceeded RunResult = "Succeeded"
+)
+
+// PossibleRunResultValues returns the possible values for the RunResult const type.
+func PossibleRunResultValues() []RunResult {
+ return []RunResult{
+ RunResultFailed,
+ RunResultSucceeded,
+ }
+}
+
+// RunStatusEnum - Represents the status of the execution.
+type RunStatusEnum string
+
+const (
+ RunStatusEnumFinished RunStatusEnum = "Finished"
+ RunStatusEnumInProgress RunStatusEnum = "InProgress"
+)
+
+// PossibleRunStatusEnumValues returns the possible values for the RunStatusEnum const type.
+func PossibleRunStatusEnumValues() []RunStatusEnum {
+ return []RunStatusEnum{
+ RunStatusEnumFinished,
+ RunStatusEnumInProgress,
+ }
+}
+
+// SKUConversionStatus - This property indicates the current sku conversion status.
+type SKUConversionStatus string
+
+const (
+ SKUConversionStatusFailed SKUConversionStatus = "Failed"
+ SKUConversionStatusInProgress SKUConversionStatus = "InProgress"
+ SKUConversionStatusSucceeded SKUConversionStatus = "Succeeded"
+)
+
+// PossibleSKUConversionStatusValues returns the possible values for the SKUConversionStatus const type.
+func PossibleSKUConversionStatusValues() []SKUConversionStatus {
+ return []SKUConversionStatus{
+ SKUConversionStatusFailed,
+ SKUConversionStatusInProgress,
+ SKUConversionStatusSucceeded,
+ }
+}
+
+// SKUName - The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called
+// accountType.
+type SKUName string
+
+const (
+ SKUNamePremiumLRS SKUName = "Premium_LRS"
+ SKUNamePremiumV2LRS SKUName = "PremiumV2_LRS"
+ SKUNamePremiumV2ZRS SKUName = "PremiumV2_ZRS"
+ SKUNamePremiumZRS SKUName = "Premium_ZRS"
+ SKUNameStandardGRS SKUName = "Standard_GRS"
+ SKUNameStandardGZRS SKUName = "Standard_GZRS"
+ SKUNameStandardLRS SKUName = "Standard_LRS"
+ SKUNameStandardRAGRS SKUName = "Standard_RAGRS"
+ SKUNameStandardRAGZRS SKUName = "Standard_RAGZRS"
+ SKUNameStandardV2GRS SKUName = "StandardV2_GRS"
+ SKUNameStandardV2GZRS SKUName = "StandardV2_GZRS"
+ SKUNameStandardV2LRS SKUName = "StandardV2_LRS"
+ SKUNameStandardV2ZRS SKUName = "StandardV2_ZRS"
+ SKUNameStandardZRS SKUName = "Standard_ZRS"
+)
+
+// PossibleSKUNameValues returns the possible values for the SKUName const type.
+func PossibleSKUNameValues() []SKUName {
+ return []SKUName{
+ SKUNamePremiumLRS,
+ SKUNamePremiumV2LRS,
+ SKUNamePremiumV2ZRS,
+ SKUNamePremiumZRS,
+ SKUNameStandardGRS,
+ SKUNameStandardGZRS,
+ SKUNameStandardLRS,
+ SKUNameStandardRAGRS,
+ SKUNameStandardRAGZRS,
+ SKUNameStandardV2GRS,
+ SKUNameStandardV2GZRS,
+ SKUNameStandardV2LRS,
+ SKUNameStandardV2ZRS,
+ SKUNameStandardZRS,
+ }
+}
+
+// SKUTier - The SKU tier. This is based on the SKU name.
+type SKUTier string
+
+const (
+ SKUTierPremium SKUTier = "Premium"
+ SKUTierStandard SKUTier = "Standard"
+)
+
+// PossibleSKUTierValues returns the possible values for the SKUTier const type.
+func PossibleSKUTierValues() []SKUTier {
+ return []SKUTier{
+ SKUTierPremium,
+ SKUTierStandard,
+ }
+}
+
+// Schedule - This is a required field. This field is used to schedule an inventory formation.
+type Schedule string
+
+const (
+ ScheduleDaily Schedule = "Daily"
+ ScheduleWeekly Schedule = "Weekly"
+)
+
+// PossibleScheduleValues returns the possible values for the Schedule const type.
+func PossibleScheduleValues() []Schedule {
+ return []Schedule{
+ ScheduleDaily,
+ ScheduleWeekly,
+ }
+}
+
+// Services - The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t),
+// File (f).
+type Services string
+
+const (
+ ServicesB Services = "b"
+ ServicesF Services = "f"
+ ServicesQ Services = "q"
+ ServicesT Services = "t"
+)
+
+// PossibleServicesValues returns the possible values for the Services const type.
+func PossibleServicesValues() []Services {
+ return []Services{
+ ServicesB,
+ ServicesF,
+ ServicesQ,
+ ServicesT,
+ }
+}
+
+// Severity - Severity of the issue.
+type Severity string
+
+const (
+ SeverityError Severity = "Error"
+ SeverityWarning Severity = "Warning"
+)
+
+// PossibleSeverityValues returns the possible values for the Severity const type.
+func PossibleSeverityValues() []Severity {
+ return []Severity{
+ SeverityError,
+ SeverityWarning,
+ }
+}
+
+// ShareAccessTier - Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot,
+// and Cool. FileStorage account can choose Premium.
+type ShareAccessTier string
+
+const (
+ ShareAccessTierCool ShareAccessTier = "Cool"
+ ShareAccessTierHot ShareAccessTier = "Hot"
+ ShareAccessTierPremium ShareAccessTier = "Premium"
+ ShareAccessTierTransactionOptimized ShareAccessTier = "TransactionOptimized"
+)
+
+// PossibleShareAccessTierValues returns the possible values for the ShareAccessTier const type.
+func PossibleShareAccessTierValues() []ShareAccessTier {
+ return []ShareAccessTier{
+ ShareAccessTierCool,
+ ShareAccessTierHot,
+ ShareAccessTierPremium,
+ ShareAccessTierTransactionOptimized,
+ }
+}
+
+// SignedResource - The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c),
+// File (f), Share (s).
+type SignedResource string
+
+const (
+ SignedResourceB SignedResource = "b"
+ SignedResourceC SignedResource = "c"
+ SignedResourceF SignedResource = "f"
+ SignedResourceS SignedResource = "s"
+)
+
+// PossibleSignedResourceValues returns the possible values for the SignedResource const type.
+func PossibleSignedResourceValues() []SignedResource {
+ return []SignedResource{
+ SignedResourceB,
+ SignedResourceC,
+ SignedResourceF,
+ SignedResourceS,
+ }
+}
+
+// SignedResourceTypes - The signed resource types that are accessible with the account SAS. Service (s): Access to service-level
+// APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs
+// for blobs, queue messages, table entities, and files.
+type SignedResourceTypes string
+
+const (
+ SignedResourceTypesC SignedResourceTypes = "c"
+ SignedResourceTypesO SignedResourceTypes = "o"
+ SignedResourceTypesS SignedResourceTypes = "s"
+)
+
+// PossibleSignedResourceTypesValues returns the possible values for the SignedResourceTypes const type.
+func PossibleSignedResourceTypesValues() []SignedResourceTypes {
+ return []SignedResourceTypes{
+ SignedResourceTypesC,
+ SignedResourceTypesO,
+ SignedResourceTypesS,
+ }
+}
+
+// State - Gets the state of virtual network rule.
+type State string
+
+const (
+ StateDeprovisioning State = "Deprovisioning"
+ StateFailed State = "Failed"
+ StateNetworkSourceDeleted State = "NetworkSourceDeleted"
+ StateProvisioning State = "Provisioning"
+ StateSucceeded State = "Succeeded"
+)
+
+// PossibleStateValues returns the possible values for the State const type.
+func PossibleStateValues() []State {
+ return []State{
+ StateDeprovisioning,
+ StateFailed,
+ StateNetworkSourceDeleted,
+ StateProvisioning,
+ StateSucceeded,
+ }
+}
+
+type StorageAccountExpand string
+
+const (
+ StorageAccountExpandBlobRestoreStatus StorageAccountExpand = "blobRestoreStatus"
+ StorageAccountExpandGeoReplicationStats StorageAccountExpand = "geoReplicationStats"
+)
+
+// PossibleStorageAccountExpandValues returns the possible values for the StorageAccountExpand const type.
+func PossibleStorageAccountExpandValues() []StorageAccountExpand {
+ return []StorageAccountExpand{
+ StorageAccountExpandBlobRestoreStatus,
+ StorageAccountExpandGeoReplicationStats,
+ }
+}
+
+// TriggerType - The trigger type of the storage task assignment execution
+type TriggerType string
+
+const (
+ TriggerTypeOnSchedule TriggerType = "OnSchedule"
+ TriggerTypeRunOnce TriggerType = "RunOnce"
+)
+
+// PossibleTriggerTypeValues returns the possible values for the TriggerType const type.
+func PossibleTriggerTypeValues() []TriggerType {
+ return []TriggerType{
+ TriggerTypeOnSchedule,
+ TriggerTypeRunOnce,
+ }
+}
+
+// UsageUnit - Gets the unit of measurement.
+type UsageUnit string
+
+const (
+ UsageUnitBytes UsageUnit = "Bytes"
+ UsageUnitBytesPerSecond UsageUnit = "BytesPerSecond"
+ UsageUnitCount UsageUnit = "Count"
+ UsageUnitCountsPerSecond UsageUnit = "CountsPerSecond"
+ UsageUnitPercent UsageUnit = "Percent"
+ UsageUnitSeconds UsageUnit = "Seconds"
+)
+
+// PossibleUsageUnitValues returns the possible values for the UsageUnit const type.
+func PossibleUsageUnitValues() []UsageUnit {
+ return []UsageUnit{
+ UsageUnitBytes,
+ UsageUnitBytesPerSecond,
+ UsageUnitCount,
+ UsageUnitCountsPerSecond,
+ UsageUnitPercent,
+ UsageUnitSeconds,
+ }
+}
+
+// ZonePlacementPolicy - The availability zone pinning policy for the storage account.
+type ZonePlacementPolicy string
+
+const (
+ ZonePlacementPolicyAny ZonePlacementPolicy = "Any"
+ ZonePlacementPolicyNone ZonePlacementPolicy = "None"
+)
+
+// PossibleZonePlacementPolicyValues returns the possible values for the ZonePlacementPolicy const type.
+func PossibleZonePlacementPolicyValues() []ZonePlacementPolicy {
+ return []ZonePlacementPolicy{
+ ZonePlacementPolicyAny,
+ ZonePlacementPolicyNone,
+ }
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/deletedaccounts_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/deletedaccounts_client.go
new file mode 100644
index 0000000000..a5d6216e17
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/deletedaccounts_client.go
@@ -0,0 +1,160 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// DeletedAccountsClient contains the methods for the DeletedAccounts group.
+// Don't use this type directly, use NewDeletedAccountsClient() instead.
+type DeletedAccountsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewDeletedAccountsClient creates a new instance of DeletedAccountsClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewDeletedAccountsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeletedAccountsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &DeletedAccountsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Get - Get properties of specified deleted account resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - deletedAccountName - Name of the deleted storage account.
+// - location - The location of the deleted storage account.
+// - options - DeletedAccountsClientGetOptions contains the optional parameters for the DeletedAccountsClient.Get method.
+func (client *DeletedAccountsClient) Get(ctx context.Context, deletedAccountName string, location string, options *DeletedAccountsClientGetOptions) (DeletedAccountsClientGetResponse, error) {
+ var err error
+ const operationName = "DeletedAccountsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, deletedAccountName, location, options)
+ if err != nil {
+ return DeletedAccountsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeletedAccountsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DeletedAccountsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *DeletedAccountsClient) getCreateRequest(ctx context.Context, deletedAccountName string, location string, _ *DeletedAccountsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts/{deletedAccountName}"
+ if deletedAccountName == "" {
+ return nil, errors.New("parameter deletedAccountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deletedAccountName}", url.PathEscape(deletedAccountName))
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *DeletedAccountsClient) getHandleResponse(resp *http.Response) (DeletedAccountsClientGetResponse, error) {
+ result := DeletedAccountsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeletedAccount); err != nil {
+ return DeletedAccountsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Lists deleted accounts under the subscription.
+//
+// Generated from API version 2025-01-01
+// - options - DeletedAccountsClientListOptions contains the optional parameters for the DeletedAccountsClient.NewListPager
+// method.
+func (client *DeletedAccountsClient) NewListPager(options *DeletedAccountsClientListOptions) *runtime.Pager[DeletedAccountsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DeletedAccountsClientListResponse]{
+ More: func(page DeletedAccountsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DeletedAccountsClientListResponse) (DeletedAccountsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DeletedAccountsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return DeletedAccountsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *DeletedAccountsClient) listCreateRequest(ctx context.Context, _ *DeletedAccountsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/deletedAccounts"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *DeletedAccountsClient) listHandleResponse(resp *http.Response) (DeletedAccountsClientListResponse, error) {
+ result := DeletedAccountsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeletedAccountListResult); err != nil {
+ return DeletedAccountsClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/encryptionscopes_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/encryptionscopes_client.go
new file mode 100644
index 0000000000..f1dd4fdc56
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/encryptionscopes_client.go
@@ -0,0 +1,344 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// EncryptionScopesClient contains the methods for the EncryptionScopes group.
+// Don't use this type directly, use NewEncryptionScopesClient() instead.
+type EncryptionScopesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewEncryptionScopesClient creates a new instance of EncryptionScopesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewEncryptionScopesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EncryptionScopesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &EncryptionScopesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Get - Returns the properties for the specified encryption scope.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - encryptionScopeName - The name of the encryption scope within the specified storage account. Encryption scope names must
+// be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - options - EncryptionScopesClientGetOptions contains the optional parameters for the EncryptionScopesClient.Get method.
+func (client *EncryptionScopesClient) Get(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, options *EncryptionScopesClientGetOptions) (EncryptionScopesClientGetResponse, error) {
+ var err error
+ const operationName = "EncryptionScopesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, encryptionScopeName, options)
+ if err != nil {
+ return EncryptionScopesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return EncryptionScopesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return EncryptionScopesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *EncryptionScopesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, _ *EncryptionScopesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if encryptionScopeName == "" {
+ return nil, errors.New("parameter encryptionScopeName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{encryptionScopeName}", url.PathEscape(encryptionScopeName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *EncryptionScopesClient) getHandleResponse(resp *http.Response) (EncryptionScopesClientGetResponse, error) {
+ result := EncryptionScopesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.EncryptionScope); err != nil {
+ return EncryptionScopesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Lists all the encryption scopes available under the specified storage account.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - EncryptionScopesClientListOptions contains the optional parameters for the EncryptionScopesClient.NewListPager
+// method.
+func (client *EncryptionScopesClient) NewListPager(resourceGroupName string, accountName string, options *EncryptionScopesClientListOptions) *runtime.Pager[EncryptionScopesClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[EncryptionScopesClientListResponse]{
+ More: func(page EncryptionScopesClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *EncryptionScopesClientListResponse) (EncryptionScopesClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "EncryptionScopesClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ }, nil)
+ if err != nil {
+ return EncryptionScopesClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *EncryptionScopesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *EncryptionScopesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Include != nil {
+ reqQP.Set("$include", string(*options.Include))
+ }
+ if options != nil && options.Maxpagesize != nil {
+ reqQP.Set("$maxpagesize", strconv.FormatInt(int64(*options.Maxpagesize), 10))
+ }
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *EncryptionScopesClient) listHandleResponse(resp *http.Response) (EncryptionScopesClientListResponse, error) {
+ result := EncryptionScopesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.EncryptionScopeListResult); err != nil {
+ return EncryptionScopesClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// Patch - Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope
+// does not already exist.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - encryptionScopeName - The name of the encryption scope within the specified storage account. Encryption scope names must
+// be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - encryptionScope - Encryption scope properties to be used for the update.
+// - options - EncryptionScopesClientPatchOptions contains the optional parameters for the EncryptionScopesClient.Patch method.
+func (client *EncryptionScopesClient) Patch(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, encryptionScope EncryptionScope, options *EncryptionScopesClientPatchOptions) (EncryptionScopesClientPatchResponse, error) {
+ var err error
+ const operationName = "EncryptionScopesClient.Patch"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.patchCreateRequest(ctx, resourceGroupName, accountName, encryptionScopeName, encryptionScope, options)
+ if err != nil {
+ return EncryptionScopesClientPatchResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return EncryptionScopesClientPatchResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return EncryptionScopesClientPatchResponse{}, err
+ }
+ resp, err := client.patchHandleResponse(httpResp)
+ return resp, err
+}
+
+// patchCreateRequest creates the Patch request.
+func (client *EncryptionScopesClient) patchCreateRequest(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, encryptionScope EncryptionScope, _ *EncryptionScopesClientPatchOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if encryptionScopeName == "" {
+ return nil, errors.New("parameter encryptionScopeName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{encryptionScopeName}", url.PathEscape(encryptionScopeName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, encryptionScope); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// patchHandleResponse handles the Patch response.
+func (client *EncryptionScopesClient) patchHandleResponse(resp *http.Response) (EncryptionScopesClientPatchResponse, error) {
+ result := EncryptionScopesClientPatchResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.EncryptionScope); err != nil {
+ return EncryptionScopesClientPatchResponse{}, err
+ }
+ return result, nil
+}
+
+// Put - Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope
+// is already created and a subsequent request is issued with different properties, the
+// encryption scope properties will be updated per the specified request.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - encryptionScopeName - The name of the encryption scope within the specified storage account. Encryption scope names must
+// be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - encryptionScope - Encryption scope properties to be used for the create or update.
+// - options - EncryptionScopesClientPutOptions contains the optional parameters for the EncryptionScopesClient.Put method.
+func (client *EncryptionScopesClient) Put(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, encryptionScope EncryptionScope, options *EncryptionScopesClientPutOptions) (EncryptionScopesClientPutResponse, error) {
+ var err error
+ const operationName = "EncryptionScopesClient.Put"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.putCreateRequest(ctx, resourceGroupName, accountName, encryptionScopeName, encryptionScope, options)
+ if err != nil {
+ return EncryptionScopesClientPutResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return EncryptionScopesClientPutResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return EncryptionScopesClientPutResponse{}, err
+ }
+ resp, err := client.putHandleResponse(httpResp)
+ return resp, err
+}
+
+// putCreateRequest creates the Put request.
+func (client *EncryptionScopesClient) putCreateRequest(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, encryptionScope EncryptionScope, _ *EncryptionScopesClientPutOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if encryptionScopeName == "" {
+ return nil, errors.New("parameter encryptionScopeName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{encryptionScopeName}", url.PathEscape(encryptionScopeName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, encryptionScope); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// putHandleResponse handles the Put response.
+func (client *EncryptionScopesClient) putHandleResponse(resp *http.Response) (EncryptionScopesClientPutResponse, error) {
+ result := EncryptionScopesClientPutResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.EncryptionScope); err != nil {
+ return EncryptionScopesClientPutResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/fileservices_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/fileservices_client.go
new file mode 100644
index 0000000000..3a3ed1d428
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/fileservices_client.go
@@ -0,0 +1,386 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// FileServicesClient contains the methods for the FileServices group.
+// Don't use this type directly, use NewFileServicesClient() instead.
+type FileServicesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewFileServicesClient creates a new instance of FileServicesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewFileServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FileServicesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &FileServicesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// GetServiceProperties - Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource
+// Sharing) rules.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - FileServicesClientGetServicePropertiesOptions contains the optional parameters for the FileServicesClient.GetServiceProperties
+// method.
+func (client *FileServicesClient) GetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, options *FileServicesClientGetServicePropertiesOptions) (FileServicesClientGetServicePropertiesResponse, error) {
+ var err error
+ const operationName = "FileServicesClient.GetServiceProperties"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getServicePropertiesCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return FileServicesClientGetServicePropertiesResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FileServicesClientGetServicePropertiesResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return FileServicesClientGetServicePropertiesResponse{}, err
+ }
+ resp, err := client.getServicePropertiesHandleResponse(httpResp)
+ return resp, err
+}
+
+// getServicePropertiesCreateRequest creates the GetServiceProperties request.
+func (client *FileServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *FileServicesClientGetServicePropertiesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ urlPath = strings.ReplaceAll(urlPath, "{FileServicesName}", url.PathEscape("default"))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getServicePropertiesHandleResponse handles the GetServiceProperties response.
+func (client *FileServicesClient) getServicePropertiesHandleResponse(resp *http.Response) (FileServicesClientGetServicePropertiesResponse, error) {
+ result := FileServicesClientGetServicePropertiesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FileServiceProperties); err != nil {
+ return FileServicesClientGetServicePropertiesResponse{}, err
+ }
+ return result, nil
+}
+
+// GetServiceUsage - Gets the usage of file service in storage account including account limits, file share limits and constants
+// used in recommendations and bursting formula.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - FileServicesClientGetServiceUsageOptions contains the optional parameters for the FileServicesClient.GetServiceUsage
+// method.
+func (client *FileServicesClient) GetServiceUsage(ctx context.Context, resourceGroupName string, accountName string, options *FileServicesClientGetServiceUsageOptions) (FileServicesClientGetServiceUsageResponse, error) {
+ var err error
+ const operationName = "FileServicesClient.GetServiceUsage"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getServiceUsageCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return FileServicesClientGetServiceUsageResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FileServicesClientGetServiceUsageResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return FileServicesClientGetServiceUsageResponse{}, err
+ }
+ resp, err := client.getServiceUsageHandleResponse(httpResp)
+ return resp, err
+}
+
+// getServiceUsageCreateRequest creates the GetServiceUsage request.
+func (client *FileServicesClient) getServiceUsageCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *FileServicesClientGetServiceUsageOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}/usages/{fileServiceUsagesName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ urlPath = strings.ReplaceAll(urlPath, "{FileServicesName}", url.PathEscape("default"))
+ urlPath = strings.ReplaceAll(urlPath, "{fileServiceUsagesName}", url.PathEscape("default"))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getServiceUsageHandleResponse handles the GetServiceUsage response.
+func (client *FileServicesClient) getServiceUsageHandleResponse(resp *http.Response) (FileServicesClientGetServiceUsageResponse, error) {
+ result := FileServicesClientGetServiceUsageResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FileServiceUsage); err != nil {
+ return FileServicesClientGetServiceUsageResponse{}, err
+ }
+ return result, nil
+}
+
+// List - List all file services in storage accounts
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - FileServicesClientListOptions contains the optional parameters for the FileServicesClient.List method.
+func (client *FileServicesClient) List(ctx context.Context, resourceGroupName string, accountName string, options *FileServicesClientListOptions) (FileServicesClientListResponse, error) {
+ var err error
+ const operationName = "FileServicesClient.List"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return FileServicesClientListResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FileServicesClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return FileServicesClientListResponse{}, err
+ }
+ resp, err := client.listHandleResponse(httpResp)
+ return resp, err
+}
+
+// listCreateRequest creates the List request.
+func (client *FileServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *FileServicesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *FileServicesClient) listHandleResponse(resp *http.Response) (FileServicesClientListResponse, error) {
+ result := FileServicesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FileServiceItems); err != nil {
+ return FileServicesClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListServiceUsagesPager - Gets the usages of file service in storage account.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - FileServicesClientListServiceUsagesOptions contains the optional parameters for the FileServicesClient.NewListServiceUsagesPager
+// method.
+func (client *FileServicesClient) NewListServiceUsagesPager(resourceGroupName string, accountName string, options *FileServicesClientListServiceUsagesOptions) *runtime.Pager[FileServicesClientListServiceUsagesResponse] {
+ return runtime.NewPager(runtime.PagingHandler[FileServicesClientListServiceUsagesResponse]{
+ More: func(page FileServicesClientListServiceUsagesResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *FileServicesClientListServiceUsagesResponse) (FileServicesClientListServiceUsagesResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FileServicesClient.NewListServiceUsagesPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listServiceUsagesCreateRequest(ctx, resourceGroupName, accountName, options)
+ }, nil)
+ if err != nil {
+ return FileServicesClientListServiceUsagesResponse{}, err
+ }
+ return client.listServiceUsagesHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listServiceUsagesCreateRequest creates the ListServiceUsages request.
+func (client *FileServicesClient) listServiceUsagesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *FileServicesClientListServiceUsagesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}/usages"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ urlPath = strings.ReplaceAll(urlPath, "{FileServicesName}", url.PathEscape("default"))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Maxpagesize != nil {
+ reqQP.Set("$maxpagesize", strconv.FormatInt(int64(*options.Maxpagesize), 10))
+ }
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listServiceUsagesHandleResponse handles the ListServiceUsages response.
+func (client *FileServicesClient) listServiceUsagesHandleResponse(resp *http.Response) (FileServicesClientListServiceUsagesResponse, error) {
+ result := FileServicesClientListServiceUsagesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FileServiceUsages); err != nil {
+ return FileServicesClientListServiceUsagesResponse{}, err
+ }
+ return result, nil
+}
+
+// SetServiceProperties - Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource
+// Sharing) rules.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules.
+// - options - FileServicesClientSetServicePropertiesOptions contains the optional parameters for the FileServicesClient.SetServiceProperties
+// method.
+func (client *FileServicesClient) SetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, parameters FileServiceProperties, options *FileServicesClientSetServicePropertiesOptions) (FileServicesClientSetServicePropertiesResponse, error) {
+ var err error
+ const operationName = "FileServicesClient.SetServiceProperties"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.setServicePropertiesCreateRequest(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return FileServicesClientSetServicePropertiesResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FileServicesClientSetServicePropertiesResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return FileServicesClientSetServicePropertiesResponse{}, err
+ }
+ resp, err := client.setServicePropertiesHandleResponse(httpResp)
+ return resp, err
+}
+
+// setServicePropertiesCreateRequest creates the SetServiceProperties request.
+func (client *FileServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters FileServiceProperties, _ *FileServicesClientSetServicePropertiesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ urlPath = strings.ReplaceAll(urlPath, "{FileServicesName}", url.PathEscape("default"))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// setServicePropertiesHandleResponse handles the SetServiceProperties response.
+func (client *FileServicesClient) setServicePropertiesHandleResponse(resp *http.Response) (FileServicesClientSetServicePropertiesResponse, error) {
+ result := FileServicesClientSetServicePropertiesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FileServiceProperties); err != nil {
+ return FileServicesClientSetServicePropertiesResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/fileshares_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/fileshares_client.go
new file mode 100644
index 0000000000..17a7589977
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/fileshares_client.go
@@ -0,0 +1,569 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// FileSharesClient contains the methods for the FileShares group.
+// Don't use this type directly, use NewFileSharesClient() instead.
+type FileSharesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewFileSharesClient creates a new instance of FileSharesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewFileSharesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FileSharesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &FileSharesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Create - Creates a new share under the specified account as described by request body. The share resource includes metadata
+// and properties for that share. It does not include a list of the files contained by
+// the share.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - shareName - The name of the file share within the specified storage account. File share names must be between 3 and 63
+// characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
+// character must be immediately preceded and followed by a letter or number.
+// - fileShare - Properties of the file share to create.
+// - options - FileSharesClientCreateOptions contains the optional parameters for the FileSharesClient.Create method.
+func (client *FileSharesClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare, options *FileSharesClientCreateOptions) (FileSharesClientCreateResponse, error) {
+ var err error
+ const operationName = "FileSharesClient.Create"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, shareName, fileShare, options)
+ if err != nil {
+ return FileSharesClientCreateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FileSharesClientCreateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return FileSharesClientCreateResponse{}, err
+ }
+ resp, err := client.createHandleResponse(httpResp)
+ return resp, err
+}
+
+// createCreateRequest creates the Create request.
+func (client *FileSharesClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare, options *FileSharesClientCreateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if shareName == "" {
+ return nil, errors.New("parameter shareName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{shareName}", url.PathEscape(shareName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, fileShare); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createHandleResponse handles the Create response.
+func (client *FileSharesClient) createHandleResponse(resp *http.Response) (FileSharesClientCreateResponse, error) {
+ result := FileSharesClientCreateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FileShare); err != nil {
+ return FileSharesClientCreateResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Deletes specified share under its account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - shareName - The name of the file share within the specified storage account. File share names must be between 3 and 63
+// characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
+// character must be immediately preceded and followed by a letter or number.
+// - options - FileSharesClientDeleteOptions contains the optional parameters for the FileSharesClient.Delete method.
+func (client *FileSharesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareName string, options *FileSharesClientDeleteOptions) (FileSharesClientDeleteResponse, error) {
+ var err error
+ const operationName = "FileSharesClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, shareName, options)
+ if err != nil {
+ return FileSharesClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FileSharesClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return FileSharesClientDeleteResponse{}, err
+ }
+ return FileSharesClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *FileSharesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, shareName string, options *FileSharesClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if shareName == "" {
+ return nil, errors.New("parameter shareName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{shareName}", url.PathEscape(shareName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Include != nil {
+ reqQP.Set("$include", *options.Include)
+ }
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.XMSSnapshot != nil {
+ req.Raw().Header["x-ms-snapshot"] = []string{*options.XMSSnapshot}
+ }
+ return req, nil
+}
+
+// Get - Gets properties of a specified share.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - shareName - The name of the file share within the specified storage account. File share names must be between 3 and 63
+// characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
+// character must be immediately preceded and followed by a letter or number.
+// - options - FileSharesClientGetOptions contains the optional parameters for the FileSharesClient.Get method.
+func (client *FileSharesClient) Get(ctx context.Context, resourceGroupName string, accountName string, shareName string, options *FileSharesClientGetOptions) (FileSharesClientGetResponse, error) {
+ var err error
+ const operationName = "FileSharesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, shareName, options)
+ if err != nil {
+ return FileSharesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FileSharesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return FileSharesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *FileSharesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, shareName string, options *FileSharesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if shareName == "" {
+ return nil, errors.New("parameter shareName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{shareName}", url.PathEscape(shareName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.XMSSnapshot != nil {
+ req.Raw().Header["x-ms-snapshot"] = []string{*options.XMSSnapshot}
+ }
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *FileSharesClient) getHandleResponse(resp *http.Response) (FileSharesClientGetResponse, error) {
+ result := FileSharesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FileShare); err != nil {
+ return FileSharesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// Lease - The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can
+// be 15 to 60 seconds, or can be infinite.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - shareName - The name of the file share within the specified storage account. File share names must be between 3 and 63
+// characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
+// character must be immediately preceded and followed by a letter or number.
+// - options - FileSharesClientLeaseOptions contains the optional parameters for the FileSharesClient.Lease method.
+func (client *FileSharesClient) Lease(ctx context.Context, resourceGroupName string, accountName string, shareName string, options *FileSharesClientLeaseOptions) (FileSharesClientLeaseResponse, error) {
+ var err error
+ const operationName = "FileSharesClient.Lease"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.leaseCreateRequest(ctx, resourceGroupName, accountName, shareName, options)
+ if err != nil {
+ return FileSharesClientLeaseResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FileSharesClientLeaseResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return FileSharesClientLeaseResponse{}, err
+ }
+ resp, err := client.leaseHandleResponse(httpResp)
+ return resp, err
+}
+
+// leaseCreateRequest creates the Lease request.
+func (client *FileSharesClient) leaseCreateRequest(ctx context.Context, resourceGroupName string, accountName string, shareName string, options *FileSharesClientLeaseOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/lease"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if shareName == "" {
+ return nil, errors.New("parameter shareName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{shareName}", url.PathEscape(shareName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.XMSSnapshot != nil {
+ req.Raw().Header["x-ms-snapshot"] = []string{*options.XMSSnapshot}
+ }
+ if options != nil && options.Parameters != nil {
+ if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// leaseHandleResponse handles the Lease response.
+func (client *FileSharesClient) leaseHandleResponse(resp *http.Response) (FileSharesClientLeaseResponse, error) {
+ result := FileSharesClientLeaseResponse{}
+ if val := resp.Header.Get("ETag"); val != "" {
+ result.ETag = &val
+ }
+ if err := runtime.UnmarshalAsJSON(resp, &result.LeaseShareResponse); err != nil {
+ return FileSharesClientLeaseResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Lists all shares.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - FileSharesClientListOptions contains the optional parameters for the FileSharesClient.NewListPager method.
+func (client *FileSharesClient) NewListPager(resourceGroupName string, accountName string, options *FileSharesClientListOptions) *runtime.Pager[FileSharesClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[FileSharesClientListResponse]{
+ More: func(page FileSharesClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *FileSharesClientListResponse) (FileSharesClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FileSharesClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ }, nil)
+ if err != nil {
+ return FileSharesClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *FileSharesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *FileSharesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Maxpagesize != nil {
+ reqQP.Set("$maxpagesize", *options.Maxpagesize)
+ }
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *FileSharesClient) listHandleResponse(resp *http.Response) (FileSharesClientListResponse, error) {
+ result := FileSharesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FileShareItems); err != nil {
+ return FileSharesClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// Restore - Restore a file share within a valid retention days if share soft delete is enabled
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - shareName - The name of the file share within the specified storage account. File share names must be between 3 and 63
+// characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
+// character must be immediately preceded and followed by a letter or number.
+// - options - FileSharesClientRestoreOptions contains the optional parameters for the FileSharesClient.Restore method.
+func (client *FileSharesClient) Restore(ctx context.Context, resourceGroupName string, accountName string, shareName string, deletedShare DeletedShare, options *FileSharesClientRestoreOptions) (FileSharesClientRestoreResponse, error) {
+ var err error
+ const operationName = "FileSharesClient.Restore"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.restoreCreateRequest(ctx, resourceGroupName, accountName, shareName, deletedShare, options)
+ if err != nil {
+ return FileSharesClientRestoreResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FileSharesClientRestoreResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return FileSharesClientRestoreResponse{}, err
+ }
+ return FileSharesClientRestoreResponse{}, nil
+}
+
+// restoreCreateRequest creates the Restore request.
+func (client *FileSharesClient) restoreCreateRequest(ctx context.Context, resourceGroupName string, accountName string, shareName string, deletedShare DeletedShare, _ *FileSharesClientRestoreOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if shareName == "" {
+ return nil, errors.New("parameter shareName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{shareName}", url.PathEscape(shareName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, deletedShare); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// Update - Updates share properties as specified in request body. Properties not mentioned in the request will not be changed.
+// Update fails if the specified share does not already exist.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - shareName - The name of the file share within the specified storage account. File share names must be between 3 and 63
+// characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
+// character must be immediately preceded and followed by a letter or number.
+// - fileShare - Properties to update for the file share.
+// - options - FileSharesClientUpdateOptions contains the optional parameters for the FileSharesClient.Update method.
+func (client *FileSharesClient) Update(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare, options *FileSharesClientUpdateOptions) (FileSharesClientUpdateResponse, error) {
+ var err error
+ const operationName = "FileSharesClient.Update"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, shareName, fileShare, options)
+ if err != nil {
+ return FileSharesClientUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FileSharesClientUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return FileSharesClientUpdateResponse{}, err
+ }
+ resp, err := client.updateHandleResponse(httpResp)
+ return resp, err
+}
+
+// updateCreateRequest creates the Update request.
+func (client *FileSharesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare, _ *FileSharesClientUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if shareName == "" {
+ return nil, errors.New("parameter shareName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{shareName}", url.PathEscape(shareName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, fileShare); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// updateHandleResponse handles the Update response.
+func (client *FileSharesClient) updateHandleResponse(resp *http.Response) (FileSharesClientUpdateResponse, error) {
+ result := FileSharesClientUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FileShare); err != nil {
+ return FileSharesClientUpdateResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/localusers_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/localusers_client.go
new file mode 100644
index 0000000000..2201e3eccc
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/localusers_client.go
@@ -0,0 +1,469 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// LocalUsersClient contains the methods for the LocalUsers group.
+// Don't use this type directly, use NewLocalUsersClient() instead.
+type LocalUsersClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewLocalUsersClient creates a new instance of LocalUsersClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewLocalUsersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocalUsersClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &LocalUsersClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// CreateOrUpdate - Create or update the properties of a local user associated with the storage account. Properties for NFSv3
+// enablement and extended groups cannot be set with other properties.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - username - The name of local user. The username must contain lowercase letters and numbers only. It must be unique only
+// within the storage account.
+// - properties - The local user associated with a storage account.
+// - options - LocalUsersClientCreateOrUpdateOptions contains the optional parameters for the LocalUsersClient.CreateOrUpdate
+// method.
+func (client *LocalUsersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, username string, properties LocalUser, options *LocalUsersClientCreateOrUpdateOptions) (LocalUsersClientCreateOrUpdateResponse, error) {
+ var err error
+ const operationName = "LocalUsersClient.CreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, username, properties, options)
+ if err != nil {
+ return LocalUsersClientCreateOrUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return LocalUsersClientCreateOrUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return LocalUsersClientCreateOrUpdateResponse{}, err
+ }
+ resp, err := client.createOrUpdateHandleResponse(httpResp)
+ return resp, err
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *LocalUsersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, properties LocalUser, _ *LocalUsersClientCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if username == "" {
+ return nil, errors.New("parameter username cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{username}", url.PathEscape(username))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, properties); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createOrUpdateHandleResponse handles the CreateOrUpdate response.
+func (client *LocalUsersClient) createOrUpdateHandleResponse(resp *http.Response) (LocalUsersClientCreateOrUpdateResponse, error) {
+ result := LocalUsersClientCreateOrUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.LocalUser); err != nil {
+ return LocalUsersClientCreateOrUpdateResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Deletes the local user associated with the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - username - The name of local user. The username must contain lowercase letters and numbers only. It must be unique only
+// within the storage account.
+// - options - LocalUsersClientDeleteOptions contains the optional parameters for the LocalUsersClient.Delete method.
+func (client *LocalUsersClient) Delete(ctx context.Context, resourceGroupName string, accountName string, username string, options *LocalUsersClientDeleteOptions) (LocalUsersClientDeleteResponse, error) {
+ var err error
+ const operationName = "LocalUsersClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, username, options)
+ if err != nil {
+ return LocalUsersClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return LocalUsersClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return LocalUsersClientDeleteResponse{}, err
+ }
+ return LocalUsersClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *LocalUsersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, _ *LocalUsersClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if username == "" {
+ return nil, errors.New("parameter username cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{username}", url.PathEscape(username))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Get the local user of the storage account by username.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - username - The name of local user. The username must contain lowercase letters and numbers only. It must be unique only
+// within the storage account.
+// - options - LocalUsersClientGetOptions contains the optional parameters for the LocalUsersClient.Get method.
+func (client *LocalUsersClient) Get(ctx context.Context, resourceGroupName string, accountName string, username string, options *LocalUsersClientGetOptions) (LocalUsersClientGetResponse, error) {
+ var err error
+ const operationName = "LocalUsersClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, username, options)
+ if err != nil {
+ return LocalUsersClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return LocalUsersClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return LocalUsersClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *LocalUsersClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, _ *LocalUsersClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if username == "" {
+ return nil, errors.New("parameter username cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{username}", url.PathEscape(username))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *LocalUsersClient) getHandleResponse(resp *http.Response) (LocalUsersClientGetResponse, error) {
+ result := LocalUsersClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.LocalUser); err != nil {
+ return LocalUsersClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - List the local users associated with the storage account.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - LocalUsersClientListOptions contains the optional parameters for the LocalUsersClient.NewListPager method.
+func (client *LocalUsersClient) NewListPager(resourceGroupName string, accountName string, options *LocalUsersClientListOptions) *runtime.Pager[LocalUsersClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[LocalUsersClientListResponse]{
+ More: func(page LocalUsersClientListResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *LocalUsersClientListResponse) (LocalUsersClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "LocalUsersClient.NewListPager")
+ req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return LocalUsersClientListResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return LocalUsersClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return LocalUsersClientListResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *LocalUsersClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *LocalUsersClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Include != nil {
+ reqQP.Set("$include", string(*options.Include))
+ }
+ if options != nil && options.Maxpagesize != nil {
+ reqQP.Set("$maxpagesize", strconv.FormatInt(int64(*options.Maxpagesize), 10))
+ }
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *LocalUsersClient) listHandleResponse(resp *http.Response) (LocalUsersClientListResponse, error) {
+ result := LocalUsersClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.LocalUsers); err != nil {
+ return LocalUsersClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// ListKeys - List SSH authorized keys and shared key of the local user.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - username - The name of local user. The username must contain lowercase letters and numbers only. It must be unique only
+// within the storage account.
+// - options - LocalUsersClientListKeysOptions contains the optional parameters for the LocalUsersClient.ListKeys method.
+func (client *LocalUsersClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string, username string, options *LocalUsersClientListKeysOptions) (LocalUsersClientListKeysResponse, error) {
+ var err error
+ const operationName = "LocalUsersClient.ListKeys"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listKeysCreateRequest(ctx, resourceGroupName, accountName, username, options)
+ if err != nil {
+ return LocalUsersClientListKeysResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return LocalUsersClientListKeysResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return LocalUsersClientListKeysResponse{}, err
+ }
+ resp, err := client.listKeysHandleResponse(httpResp)
+ return resp, err
+}
+
+// listKeysCreateRequest creates the ListKeys request.
+func (client *LocalUsersClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, _ *LocalUsersClientListKeysOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/listKeys"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if username == "" {
+ return nil, errors.New("parameter username cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{username}", url.PathEscape(username))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listKeysHandleResponse handles the ListKeys response.
+func (client *LocalUsersClient) listKeysHandleResponse(resp *http.Response) (LocalUsersClientListKeysResponse, error) {
+ result := LocalUsersClientListKeysResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.LocalUserKeys); err != nil {
+ return LocalUsersClientListKeysResponse{}, err
+ }
+ return result, nil
+}
+
+// RegeneratePassword - Regenerate the local user SSH password.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - username - The name of local user. The username must contain lowercase letters and numbers only. It must be unique only
+// within the storage account.
+// - options - LocalUsersClientRegeneratePasswordOptions contains the optional parameters for the LocalUsersClient.RegeneratePassword
+// method.
+func (client *LocalUsersClient) RegeneratePassword(ctx context.Context, resourceGroupName string, accountName string, username string, options *LocalUsersClientRegeneratePasswordOptions) (LocalUsersClientRegeneratePasswordResponse, error) {
+ var err error
+ const operationName = "LocalUsersClient.RegeneratePassword"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.regeneratePasswordCreateRequest(ctx, resourceGroupName, accountName, username, options)
+ if err != nil {
+ return LocalUsersClientRegeneratePasswordResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return LocalUsersClientRegeneratePasswordResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return LocalUsersClientRegeneratePasswordResponse{}, err
+ }
+ resp, err := client.regeneratePasswordHandleResponse(httpResp)
+ return resp, err
+}
+
+// regeneratePasswordCreateRequest creates the RegeneratePassword request.
+func (client *LocalUsersClient) regeneratePasswordCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, _ *LocalUsersClientRegeneratePasswordOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/regeneratePassword"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if username == "" {
+ return nil, errors.New("parameter username cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{username}", url.PathEscape(username))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// regeneratePasswordHandleResponse handles the RegeneratePassword response.
+func (client *LocalUsersClient) regeneratePasswordHandleResponse(resp *http.Response) (LocalUsersClientRegeneratePasswordResponse, error) {
+ result := LocalUsersClientRegeneratePasswordResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.LocalUserRegeneratePasswordResult); err != nil {
+ return LocalUsersClientRegeneratePasswordResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/managementpolicies_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/managementpolicies_client.go
new file mode 100644
index 0000000000..f4715d4785
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/managementpolicies_client.go
@@ -0,0 +1,246 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// ManagementPoliciesClient contains the methods for the ManagementPolicies group.
+// Don't use this type directly, use NewManagementPoliciesClient() instead.
+type ManagementPoliciesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewManagementPoliciesClient creates a new instance of ManagementPoliciesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewManagementPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagementPoliciesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &ManagementPoliciesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// CreateOrUpdate - Sets the managementpolicy to the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - managementPolicyName - The name of the Storage Account Management Policy. It should always be 'default'
+// - properties - The ManagementPolicy set to a storage account.
+// - options - ManagementPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ManagementPoliciesClient.CreateOrUpdate
+// method.
+func (client *ManagementPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, properties ManagementPolicy, options *ManagementPoliciesClientCreateOrUpdateOptions) (ManagementPoliciesClientCreateOrUpdateResponse, error) {
+ var err error
+ const operationName = "ManagementPoliciesClient.CreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, managementPolicyName, properties, options)
+ if err != nil {
+ return ManagementPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ManagementPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ManagementPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ resp, err := client.createOrUpdateHandleResponse(httpResp)
+ return resp, err
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *ManagementPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, properties ManagementPolicy, _ *ManagementPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if managementPolicyName == "" {
+ return nil, errors.New("parameter managementPolicyName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{managementPolicyName}", url.PathEscape(string(managementPolicyName)))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, properties); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createOrUpdateHandleResponse handles the CreateOrUpdate response.
+func (client *ManagementPoliciesClient) createOrUpdateHandleResponse(resp *http.Response) (ManagementPoliciesClientCreateOrUpdateResponse, error) {
+ result := ManagementPoliciesClientCreateOrUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ManagementPolicy); err != nil {
+ return ManagementPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Deletes the managementpolicy associated with the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - managementPolicyName - The name of the Storage Account Management Policy. It should always be 'default'
+// - options - ManagementPoliciesClientDeleteOptions contains the optional parameters for the ManagementPoliciesClient.Delete
+// method.
+func (client *ManagementPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, options *ManagementPoliciesClientDeleteOptions) (ManagementPoliciesClientDeleteResponse, error) {
+ var err error
+ const operationName = "ManagementPoliciesClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, managementPolicyName, options)
+ if err != nil {
+ return ManagementPoliciesClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ManagementPoliciesClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return ManagementPoliciesClientDeleteResponse{}, err
+ }
+ return ManagementPoliciesClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *ManagementPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, _ *ManagementPoliciesClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if managementPolicyName == "" {
+ return nil, errors.New("parameter managementPolicyName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{managementPolicyName}", url.PathEscape(string(managementPolicyName)))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ return req, nil
+}
+
+// Get - Gets the managementpolicy associated with the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - managementPolicyName - The name of the Storage Account Management Policy. It should always be 'default'
+// - options - ManagementPoliciesClientGetOptions contains the optional parameters for the ManagementPoliciesClient.Get method.
+func (client *ManagementPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, options *ManagementPoliciesClientGetOptions) (ManagementPoliciesClientGetResponse, error) {
+ var err error
+ const operationName = "ManagementPoliciesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, managementPolicyName, options)
+ if err != nil {
+ return ManagementPoliciesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ManagementPoliciesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ManagementPoliciesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *ManagementPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, _ *ManagementPoliciesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if managementPolicyName == "" {
+ return nil, errors.New("parameter managementPolicyName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{managementPolicyName}", url.PathEscape(string(managementPolicyName)))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *ManagementPoliciesClient) getHandleResponse(resp *http.Response) (ManagementPoliciesClientGetResponse, error) {
+ result := ManagementPoliciesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ManagementPolicy); err != nil {
+ return ManagementPoliciesClientGetResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/models.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/models.go
new file mode 100644
index 0000000000..4eed2d7ef7
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/models.go
@@ -0,0 +1,3634 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import "time"
+
+type AccessPolicy struct {
+ // Expiry time of the access policy
+ ExpiryTime *time.Time
+
+ // List of abbreviated permissions.
+ Permission *string
+
+ // Start time of the access policy
+ StartTime *time.Time
+}
+
+// Account - The storage account.
+type Account struct {
+ // REQUIRED; The geo-location where the resource lives
+ Location *string
+
+ // The extendedLocation of the resource.
+ ExtendedLocation *ExtendedLocation
+
+ // The identity of the resource.
+ Identity *Identity
+
+ // Optional. Gets or sets the zonal placement details for the storage account.
+ Placement *Placement
+
+ // Properties of the storage account.
+ Properties *AccountProperties
+
+ // Resource tags.
+ Tags map[string]*string
+
+ // Optional. Gets or sets the pinned logical availability zone for the storage account.
+ Zones []*string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; Gets the Kind.
+ Kind *Kind
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; Gets the SKU.
+ SKU *SKU
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// AccountCheckNameAvailabilityParameters - The parameters used to check the availability of the storage account name.
+type AccountCheckNameAvailabilityParameters struct {
+ // REQUIRED; The storage account name.
+ Name *string
+
+ // CONSTANT; The type of resource, Microsoft.Storage/storageAccounts
+ // Field has constant value "Microsoft.Storage/storageAccounts", any specified value is ignored.
+ Type *string
+}
+
+// AccountCreateParameters - The parameters used when creating a storage account.
+type AccountCreateParameters struct {
+ // REQUIRED; Required. Indicates the type of storage account.
+ Kind *Kind
+
+ // REQUIRED; Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo
+ // Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource
+ // cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed.
+ Location *string
+
+ // REQUIRED; Required. Gets or sets the SKU name.
+ SKU *SKU
+
+ // Optional. Set the extended location of the resource. If not set, the storage account will be created in Azure main region.
+ // Otherwise it will be created in the specified extended location
+ ExtendedLocation *ExtendedLocation
+
+ // The identity of the resource.
+ Identity *Identity
+
+ // Optional. Gets or sets the zonal placement details for the storage account.
+ Placement *Placement
+
+ // The parameters used to create the storage account.
+ Properties *AccountPropertiesCreateParameters
+
+ // Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this
+ // resource (across resource groups). A maximum of 15 tags can be provided for a
+ // resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than
+ // 256 characters.
+ Tags map[string]*string
+
+ // Optional. Gets or sets the pinned logical availability zone for the storage account.
+ Zones []*string
+}
+
+// AccountIPv6Endpoints - The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object
+// via an IPv6 endpoint.
+type AccountIPv6Endpoints struct {
+ // Gets the internet routing storage endpoints
+ InternetEndpoints *AccountInternetEndpoints
+
+ // Gets the microsoft routing storage endpoints.
+ MicrosoftEndpoints *AccountMicrosoftEndpoints
+
+ // READ-ONLY; Gets the blob endpoint.
+ Blob *string
+
+ // READ-ONLY; Gets the dfs endpoint.
+ Dfs *string
+
+ // READ-ONLY; Gets the file endpoint.
+ File *string
+
+ // READ-ONLY; Gets the queue endpoint.
+ Queue *string
+
+ // READ-ONLY; Gets the table endpoint.
+ Table *string
+
+ // READ-ONLY; Gets the web endpoint.
+ Web *string
+}
+
+// AccountImmutabilityPolicyProperties - This defines account-level immutability policy properties.
+type AccountImmutabilityPolicyProperties struct {
+ // This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can
+ // be written to an append blob while maintaining immutability protection and
+ // compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.
+ AllowProtectedAppendWrites *bool
+
+ // The immutability period for the blobs in the container since the policy creation, in days.
+ ImmutabilityPeriodSinceCreationInDays *int32
+
+ // The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows
+ // increase and decrease of immutability retention time and also allows toggling
+ // allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A policy
+ // can only be created in a Disabled or Unlocked state and can be toggled between
+ // the two states. Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted.
+ State *AccountImmutabilityPolicyState
+}
+
+// AccountInternetEndpoints - The URIs that are used to perform a retrieval of a public blob, file, web or dfs object via
+// a internet routing endpoint.
+type AccountInternetEndpoints struct {
+ // READ-ONLY; Gets the blob endpoint.
+ Blob *string
+
+ // READ-ONLY; Gets the dfs endpoint.
+ Dfs *string
+
+ // READ-ONLY; Gets the file endpoint.
+ File *string
+
+ // READ-ONLY; Gets the web endpoint.
+ Web *string
+}
+
+// AccountKey - An access key for the storage account.
+type AccountKey struct {
+ // READ-ONLY; Creation time of the key, in round trip date format.
+ CreationTime *time.Time
+
+ // READ-ONLY; Name of the key.
+ KeyName *string
+
+ // READ-ONLY; Permissions for the key -- read-only or full permissions.
+ Permissions *KeyPermission
+
+ // READ-ONLY; Base 64-encoded value of the key.
+ Value *string
+}
+
+// AccountLimits - Maximum provisioned storage, IOPS, bandwidth and number of file shares limits for the storage account.
+type AccountLimits struct {
+ // READ-ONLY; The maximum number of file shares limit for the storage account.
+ MaxFileShares *int32
+
+ // READ-ONLY; The maximum provisioned bandwidth limit in mebibytes per second for the storage account.
+ MaxProvisionedBandwidthMiBPerSec *int32
+
+ // READ-ONLY; The maximum provisioned IOPS limit for the storage account.
+ MaxProvisionedIOPS *int32
+
+ // READ-ONLY; The maximum provisioned storage quota limit in gibibytes for the storage account.
+ MaxProvisionedStorageGiB *int32
+}
+
+// AccountListKeysResult - The response from the ListKeys operation.
+type AccountListKeysResult struct {
+ // READ-ONLY; Gets the list of storage account keys and their properties for the specified storage account.
+ Keys []*AccountKey
+}
+
+// AccountListResult - The response from the List Storage Accounts operation.
+type AccountListResult struct {
+ // READ-ONLY; Request URL that can be used to query next page of storage accounts. Returned when total number of requested
+ // storage accounts exceed maximum page size.
+ NextLink *string
+
+ // READ-ONLY; Gets the list of storage accounts and their properties.
+ Value []*Account
+}
+
+// AccountMicrosoftEndpoints - The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object
+// via a microsoft routing endpoint.
+type AccountMicrosoftEndpoints struct {
+ // READ-ONLY; Gets the blob endpoint.
+ Blob *string
+
+ // READ-ONLY; Gets the dfs endpoint.
+ Dfs *string
+
+ // READ-ONLY; Gets the file endpoint.
+ File *string
+
+ // READ-ONLY; Gets the queue endpoint.
+ Queue *string
+
+ // READ-ONLY; Gets the table endpoint.
+ Table *string
+
+ // READ-ONLY; Gets the web endpoint.
+ Web *string
+}
+
+// AccountMigration - The parameters or status associated with an ongoing or enqueued storage account migration in order to
+// update its current SKU or region.
+type AccountMigration struct {
+ // REQUIRED; The properties of a storage account's ongoing or enqueued migration.
+ StorageAccountMigrationDetails *AccountMigrationProperties
+
+ // current value is 'default' for customer initiated migration
+ Name *string
+
+ // SrpAccountMigrationType in ARM contract which is 'accountMigrations'
+ Type *string
+
+ // READ-ONLY; Migration Resource Id
+ ID *string
+}
+
+// AccountMigrationProperties - The properties of a storage account's ongoing or enqueued migration.
+type AccountMigrationProperties struct {
+ // REQUIRED; Target sku name for the account
+ TargetSKUName *SKUName
+
+ // READ-ONLY; Reason for migration failure
+ MigrationFailedDetailedReason *string
+
+ // READ-ONLY; Error code for migration failure
+ MigrationFailedReason *string
+
+ // READ-ONLY; Current status of migration
+ MigrationStatus *MigrationStatus
+}
+
+// AccountProperties - Properties of the storage account.
+type AccountProperties struct {
+ // Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is false
+ // for this property.
+ AllowBlobPublicAccess *bool
+
+ // Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if object
+ // replication policies will involve storage accounts in different AAD
+ // tenants. The default interpretation is false for new accounts to follow best security practices by default.
+ AllowCrossTenantReplication *bool
+
+ // Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If
+ // false, then all requests, including shared access signatures, must be authorized
+ // with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true.
+ AllowSharedKeyAccess *bool
+
+ // Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet.
+ AllowedCopyScope *AllowedCopyScope
+
+ // Provides the identity based authentication settings for Azure Files.
+ AzureFilesIdentityBasedAuthentication *AzureFilesIdentityBasedAuthentication
+
+ // Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single subscription,
+ // which creates accounts in an Azure DNS Zone and the endpoint URL
+ // will have an alphanumeric DNS Zone identifier.
+ DNSEndpointType *DNSEndpointType
+
+ // A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false
+ // for this property.
+ DefaultToOAuthAuthentication *bool
+
+ // Maintains information about the Internet protocol opted by the user.
+ DualStackEndpointPreference *DualStackEndpointPreference
+
+ // Enables extended group support with local users feature, if set to true
+ EnableExtendedGroups *bool
+
+ // Allows https traffic only to storage service if sets to true.
+ EnableHTTPSTrafficOnly *bool
+
+ // NFS 3.0 protocol support enabled if set to true.
+ EnableNfsV3 *bool
+
+ // The property is immutable and can only be set to true at the account creation time. When set to true, it enables object
+ // level immutability for all the containers in the account by default.
+ ImmutableStorageWithVersioning *ImmutableStorageAccount
+
+ // Account HierarchicalNamespace enabled if sets to true.
+ IsHnsEnabled *bool
+
+ // Enables local users feature, if set to true
+ IsLocalUserEnabled *bool
+
+ // Enables Secure File Transfer Protocol, if set to true
+ IsSftpEnabled *bool
+
+ // Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled.
+ LargeFileSharesState *LargeFileSharesState
+
+ // Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property.
+ MinimumTLSVersion *MinimumTLSVersion
+
+ // Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account.
+ PublicNetworkAccess *PublicNetworkAccess
+
+ // Maintains information about the network routing choice opted by the user for data transfer
+ RoutingPreference *RoutingPreference
+
+ // This property is readOnly and is set by server during asynchronous storage account sku conversion operations.
+ StorageAccountSKUConversionStatus *AccountSKUConversionStatus
+
+ // READ-ONLY; Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access
+ // tier is the default value for premium block blobs storage account type and it cannot
+ // be changed for the premium block blobs storage account type.
+ AccessTier *AccessTier
+
+ // READ-ONLY; If customer initiated account migration is in progress, the value will be true else it will be null.
+ AccountMigrationInProgress *bool
+
+ // READ-ONLY; Blob restore status
+ BlobRestoreStatus *BlobRestoreStatus
+
+ // READ-ONLY; Gets the creation date and time of the storage account in UTC.
+ CreationTime *time.Time
+
+ // READ-ONLY; Gets the custom domain the user assigned to this storage account.
+ CustomDomain *CustomDomain
+
+ // READ-ONLY; Encryption settings to be used for server-side encryption for the storage account.
+ Encryption *Encryption
+
+ // READ-ONLY; If the failover is in progress, the value will be true, otherwise, it will be null.
+ FailoverInProgress *bool
+
+ // READ-ONLY; Geo Replication Stats
+ GeoReplicationStats *GeoReplicationStats
+
+ // READ-ONLY; This property will be set to true or false on an event of ongoing migration. Default value is null.
+ IsSKUConversionBlocked *bool
+
+ // READ-ONLY; Storage account keys creation time.
+ KeyCreationTime *KeyCreationTime
+
+ // READ-ONLY; KeyPolicy assigned to the storage account.
+ KeyPolicy *KeyPolicy
+
+ // READ-ONLY; Gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent
+ // timestamp is retained. This element is not returned if there has never been a failover
+ // instance. Only available if the accountType is StandardGRS or StandardRAGRS.
+ LastGeoFailoverTime *time.Time
+
+ // READ-ONLY; Network rule set
+ NetworkRuleSet *NetworkRuleSet
+
+ // READ-ONLY; Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that StandardZRS
+ // and PremiumLRS accounts only return the blob endpoint.
+ PrimaryEndpoints *Endpoints
+
+ // READ-ONLY; Gets the location of the primary data center for the storage account.
+ PrimaryLocation *string
+
+ // READ-ONLY; List of private endpoint connection associated with the specified storage account
+ PrivateEndpointConnections []*PrivateEndpointConnection
+
+ // READ-ONLY; Gets the status of the storage account at the time the operation was called.
+ ProvisioningState *ProvisioningState
+
+ // READ-ONLY; SasPolicy assigned to the storage account.
+ SasPolicy *SasPolicy
+
+ // READ-ONLY; Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary
+ // location of the storage account. Only available if the SKU name is Standard_RAGRS.
+ SecondaryEndpoints *Endpoints
+
+ // READ-ONLY; Gets the location of the geo-replicated secondary for the storage account. Only available if the accountType
+ // is StandardGRS or StandardRAGRS.
+ SecondaryLocation *string
+
+ // READ-ONLY; Gets the status indicating whether the primary location of the storage account is available or unavailable.
+ StatusOfPrimary *AccountStatus
+
+ // READ-ONLY; Gets the status indicating whether the secondary location of the storage account is available or unavailable.
+ // Only available if the SKU name is StandardGRS or StandardRAGRS.
+ StatusOfSecondary *AccountStatus
+}
+
+// AccountPropertiesCreateParameters - The parameters used to create the storage account.
+type AccountPropertiesCreateParameters struct {
+ // Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier
+ // is the default value for premium block blobs storage account type and it cannot
+ // be changed for the premium block blobs storage account type.
+ AccessTier *AccessTier
+
+ // Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is false
+ // for this property.
+ AllowBlobPublicAccess *bool
+
+ // Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if object
+ // replication policies will involve storage accounts in different AAD
+ // tenants. The default interpretation is false for new accounts to follow best security practices by default.
+ AllowCrossTenantReplication *bool
+
+ // Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If
+ // false, then all requests, including shared access signatures, must be authorized
+ // with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true.
+ AllowSharedKeyAccess *bool
+
+ // Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet.
+ AllowedCopyScope *AllowedCopyScope
+
+ // Provides the identity based authentication settings for Azure Files.
+ AzureFilesIdentityBasedAuthentication *AzureFilesIdentityBasedAuthentication
+
+ // User domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage
+ // account at this time. To clear the existing custom domain, use an empty string
+ // for the custom domain name property.
+ CustomDomain *CustomDomain
+
+ // Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single subscription,
+ // which creates accounts in an Azure DNS Zone and the endpoint URL
+ // will have an alphanumeric DNS Zone identifier.
+ DNSEndpointType *DNSEndpointType
+
+ // A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false
+ // for this property.
+ DefaultToOAuthAuthentication *bool
+
+ // Maintains information about the Internet protocol opted by the user.
+ DualStackEndpointPreference *DualStackEndpointPreference
+
+ // Enables extended group support with local users feature, if set to true
+ EnableExtendedGroups *bool
+
+ // Allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01.
+ EnableHTTPSTrafficOnly *bool
+
+ // NFS 3.0 protocol support enabled if set to true.
+ EnableNfsV3 *bool
+
+ // Encryption settings to be used for server-side encryption for the storage account.
+ Encryption *Encryption
+
+ // The property is immutable and can only be set to true at the account creation time. When set to true, it enables object
+ // level immutability for all the new containers in the account by default.
+ ImmutableStorageWithVersioning *ImmutableStorageAccount
+
+ // Account HierarchicalNamespace enabled if sets to true.
+ IsHnsEnabled *bool
+
+ // Enables local users feature, if set to true
+ IsLocalUserEnabled *bool
+
+ // Enables Secure File Transfer Protocol, if set to true
+ IsSftpEnabled *bool
+
+ // KeyPolicy assigned to the storage account.
+ KeyPolicy *KeyPolicy
+
+ // Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled.
+ LargeFileSharesState *LargeFileSharesState
+
+ // Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property.
+ MinimumTLSVersion *MinimumTLSVersion
+
+ // Network rule set
+ NetworkRuleSet *NetworkRuleSet
+
+ // Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account.
+ // Value is optional but if passed in, must be 'Enabled', 'Disabled' or
+ // 'SecuredByPerimeter'.
+ PublicNetworkAccess *PublicNetworkAccess
+
+ // Maintains information about the network routing choice opted by the user for data transfer
+ RoutingPreference *RoutingPreference
+
+ // SasPolicy assigned to the storage account.
+ SasPolicy *SasPolicy
+}
+
+// AccountPropertiesUpdateParameters - The parameters used when updating a storage account.
+type AccountPropertiesUpdateParameters struct {
+ // Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier
+ // is the default value for premium block blobs storage account type and it cannot
+ // be changed for the premium block blobs storage account type.
+ AccessTier *AccessTier
+
+ // Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is false
+ // for this property.
+ AllowBlobPublicAccess *bool
+
+ // Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if object
+ // replication policies will involve storage accounts in different AAD
+ // tenants. The default interpretation is false for new accounts to follow best security practices by default.
+ AllowCrossTenantReplication *bool
+
+ // Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If
+ // false, then all requests, including shared access signatures, must be authorized
+ // with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true.
+ AllowSharedKeyAccess *bool
+
+ // Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet.
+ AllowedCopyScope *AllowedCopyScope
+
+ // Provides the identity based authentication settings for Azure Files.
+ AzureFilesIdentityBasedAuthentication *AzureFilesIdentityBasedAuthentication
+
+ // Custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported
+ // per storage account at this time. To clear the existing custom domain, use an
+ // empty string for the custom domain name property.
+ CustomDomain *CustomDomain
+
+ // Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single subscription,
+ // which creates accounts in an Azure DNS Zone and the endpoint URL
+ // will have an alphanumeric DNS Zone identifier.
+ DNSEndpointType *DNSEndpointType
+
+ // A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false
+ // for this property.
+ DefaultToOAuthAuthentication *bool
+
+ // Maintains information about the Internet protocol opted by the user.
+ DualStackEndpointPreference *DualStackEndpointPreference
+
+ // Enables extended group support with local users feature, if set to true
+ EnableExtendedGroups *bool
+
+ // Allows https traffic only to storage service if sets to true.
+ EnableHTTPSTrafficOnly *bool
+
+ // Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled.
+ Encryption *Encryption
+
+ // The property is immutable and can only be set to true at the account creation time. When set to true, it enables object
+ // level immutability for all the containers in the account by default.
+ ImmutableStorageWithVersioning *ImmutableStorageAccount
+
+ // Enables local users feature, if set to true
+ IsLocalUserEnabled *bool
+
+ // Enables Secure File Transfer Protocol, if set to true
+ IsSftpEnabled *bool
+
+ // KeyPolicy assigned to the storage account.
+ KeyPolicy *KeyPolicy
+
+ // Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled.
+ LargeFileSharesState *LargeFileSharesState
+
+ // Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property.
+ MinimumTLSVersion *MinimumTLSVersion
+
+ // Network rule set
+ NetworkRuleSet *NetworkRuleSet
+
+ // Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage Account.
+ // Value is optional but if passed in, must be 'Enabled', 'Disabled' or
+ // 'SecuredByPerimeter'.
+ PublicNetworkAccess *PublicNetworkAccess
+
+ // Maintains information about the network routing choice opted by the user for data transfer
+ RoutingPreference *RoutingPreference
+
+ // SasPolicy assigned to the storage account.
+ SasPolicy *SasPolicy
+}
+
+// AccountRegenerateKeyParameters - The parameters used to regenerate the storage account key.
+type AccountRegenerateKeyParameters struct {
+ // REQUIRED; The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2.
+ KeyName *string
+}
+
+// AccountSKUConversionStatus - This defines the sku conversion status object for asynchronous sku conversions.
+type AccountSKUConversionStatus struct {
+ // This property represents the target sku name to which the account sku is being converted asynchronously.
+ TargetSKUName *SKUName
+
+ // READ-ONLY; This property represents the sku conversion end time.
+ EndTime *string
+
+ // READ-ONLY; This property indicates the current sku conversion status.
+ SKUConversionStatus *SKUConversionStatus
+
+ // READ-ONLY; This property represents the sku conversion start time.
+ StartTime *string
+}
+
+// AccountSasParameters - The parameters to list SAS credentials of a storage account.
+type AccountSasParameters struct {
+ // REQUIRED; The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l),
+ // Add (a), Create (c), Update (u) and Process (p).
+ Permissions *Permissions
+
+ // REQUIRED; The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs;
+ // Container (c): Access to container-level APIs; Object (o): Access to object-level APIs
+ // for blobs, queue messages, table entities, and files.
+ ResourceTypes *SignedResourceTypes
+
+ // REQUIRED; The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t),
+ // File (f).
+ Services *Services
+
+ // REQUIRED; The time at which the shared access signature becomes invalid.
+ SharedAccessExpiryTime *time.Time
+
+ // An IP address or a range of IP addresses from which to accept requests.
+ IPAddressOrRange *string
+
+ // The key to sign the account SAS token with.
+ KeyToSign *string
+
+ // The protocol permitted for a request made with the account SAS.
+ Protocols *HTTPProtocol
+
+ // The time at which the SAS becomes valid.
+ SharedAccessStartTime *time.Time
+}
+
+// AccountUpdateParameters - The parameters that can be provided when updating the storage account properties.
+type AccountUpdateParameters struct {
+ // The identity of the resource.
+ Identity *Identity
+
+ // Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server.
+ Kind *Kind
+
+ // Optional. Gets or sets the zonal placement details for the storage account.
+ Placement *Placement
+
+ // The parameters used when updating a storage account.
+ Properties *AccountPropertiesUpdateParameters
+
+ // Gets or sets the SKU name. Note that the SKU name cannot be updated to StandardZRS, PremiumLRS or Premium_ZRS, nor can
+ // accounts of those SKU names be updated to any other value.
+ SKU *SKU
+
+ // Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this
+ // resource (across resource groups). A maximum of 15 tags can be provided for a
+ // resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters.
+ Tags map[string]*string
+
+ // Optional. Gets or sets the pinned logical availability zone for the storage account.
+ Zones []*string
+}
+
+// AccountUsage - Usage of provisioned storage, IOPS, bandwidth and number of file shares across all live shares and soft-deleted
+// shares in the account.
+type AccountUsage struct {
+ // READ-ONLY; Usage of provisioned storage, IOPS, bandwidth and number of file shares across all live shares or soft-deleted
+ // shares in the account.
+ LiveShares *AccountUsageElements
+
+ // READ-ONLY; Usage of provisioned storage, IOPS, bandwidth and number of file shares across all live shares or soft-deleted
+ // shares in the account.
+ SoftDeletedShares *AccountUsageElements
+}
+
+// AccountUsageElements - Usage of provisioned storage, IOPS, bandwidth and number of file shares across all live shares or
+// soft-deleted shares in the account.
+type AccountUsageElements struct {
+ // READ-ONLY; The total number of file shares.
+ FileShareCount *int32
+
+ // READ-ONLY; The total provisioned bandwidth in mebibytes per second.
+ ProvisionedBandwidthMiBPerSec *int32
+
+ // READ-ONLY; The total provisioned IOPS.
+ ProvisionedIOPS *int32
+
+ // READ-ONLY; The total provisioned storage quota in gibibytes.
+ ProvisionedStorageGiB *int32
+}
+
+// ActiveDirectoryProperties - Settings properties for Active Directory (AD).
+type ActiveDirectoryProperties struct {
+ // Specifies the Active Directory account type for Azure Storage. If directoryServiceOptions is set to AD (AD DS authentication),
+ // this property is optional. If provided, samAccountName should also be
+ // provided. For directoryServiceOptions AADDS (Entra DS authentication) or AADKERB (Entra authentication), this property
+ // can be omitted.
+ AccountType *ActiveDirectoryPropertiesAccountType
+
+ // Specifies the security identifier (SID) for Azure Storage. If directoryServiceOptions is set to AD (AD DS authentication),
+ // this property is required. Otherwise, it can be omitted.
+ AzureStorageSid *string
+
+ // Specifies the domain GUID. If directoryServiceOptions is set to AD (AD DS authentication), this property is required. If
+ // directoryServiceOptions is set to AADDS (Entra DS authentication), this
+ // property can be omitted. If directoryServiceOptions is set to AADKERB (Entra authentication), this property is optional;
+ // it is needed to support configuration of directory- and file-level permissions
+ // via Windows File Explorer, but is not required for authentication.
+ DomainGUID *string
+
+ // Specifies the primary domain that the AD DNS server is authoritative for. This property is required if directoryServiceOptions
+ // is set to AD (AD DS authentication). If directoryServiceOptions is set to
+ // AADDS (Entra DS authentication), providing this property is optional, as it will be inferred automatically if omitted.
+ // If directoryServiceOptions is set to AADKERB (Entra authentication), this
+ // property is optional; it is needed to support configuration of directory- and file-level permissions via Windows File Explorer,
+ // but is not required for authentication.
+ DomainName *string
+
+ // Specifies the security identifier (SID) of the AD domain. If directoryServiceOptions is set to AD (AD DS authentication),
+ // this property is required. Otherwise, it can be omitted.
+ DomainSid *string
+
+ // Specifies the Active Directory forest to get. If directoryServiceOptions is set to AD (AD DS authentication), this property
+ // is required. Otherwise, it can be omitted.
+ ForestName *string
+
+ // Specifies the NetBIOS domain name. If directoryServiceOptions is set to AD (AD DS authentication), this property is required.
+ // Otherwise, it can be omitted.
+ NetBiosDomainName *string
+
+ // Specifies the Active Directory SAMAccountName for Azure Storage. If directoryServiceOptions is set to AD (AD DS authentication),
+ // this property is optional. If provided, accountType should also be
+ // provided. For directoryServiceOptions AADDS (Entra DS authentication) or AADKERB (Entra authentication), this property
+ // can be omitted.
+ SamAccountName *string
+}
+
+// AzureEntityResource - The resource model definition for an Azure Resource Manager resource with an etag.
+type AzureEntityResource struct {
+ // READ-ONLY; Resource Etag.
+ Etag *string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// AzureFilesIdentityBasedAuthentication - Settings for Azure Files identity based authentication.
+type AzureFilesIdentityBasedAuthentication struct {
+ // REQUIRED; Indicates the directory service used. Note that this enum may be extended in the future.
+ DirectoryServiceOptions *DirectoryServiceOptions
+
+ // Additional information about the directory service. Required if directoryServiceOptions is AD (AD DS authentication). Optional
+ // for directoryServiceOptions AADDS (Entra DS authentication) and AADKERB
+ // (Entra authentication).
+ ActiveDirectoryProperties *ActiveDirectoryProperties
+
+ // Default share permission for users using Kerberos authentication if RBAC role is not assigned.
+ DefaultSharePermission *DefaultSharePermission
+
+ // Required for Managed Identities access using OAuth over SMB.
+ SmbOAuthSettings *SmbOAuthSettings
+}
+
+// BlobContainer - Properties of the blob container, including Id, resource name, resource type, Etag.
+type BlobContainer struct {
+ // Properties of the blob container.
+ ContainerProperties *ContainerProperties
+
+ // READ-ONLY; Resource Etag.
+ Etag *string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// BlobInventoryCreationTime - This property defines the creation time based filtering condition. Blob Inventory schema parameter
+// 'Creation-Time' is mandatory with this filter.
+type BlobInventoryCreationTime struct {
+ // When set the policy filters the objects that are created in the last N days. Where N is an integer value between 1 to 36500.
+ LastNDays *int32
+}
+
+// BlobInventoryPolicy - The storage account blob inventory policy.
+type BlobInventoryPolicy struct {
+ // Returns the storage account blob inventory policy rules.
+ Properties *BlobInventoryPolicyProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; Metadata pertaining to creation and last modification of the resource.
+ SystemData *SystemData
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// BlobInventoryPolicyDefinition - An object that defines the blob inventory rule.
+type BlobInventoryPolicyDefinition struct {
+ // REQUIRED; This is a required field, it specifies the format for the inventory files.
+ Format *Format
+
+ // REQUIRED; This is a required field. This field specifies the scope of the inventory created either at the blob or container
+ // level.
+ ObjectType *ObjectType
+
+ // REQUIRED; This is a required field. This field is used to schedule an inventory formation.
+ Schedule *Schedule
+
+ // REQUIRED; This is a required field. This field specifies the fields and properties of the object to be included in the
+ // inventory. The Schema field value 'Name' is always required. The valid values for this
+ // field for the 'Blob' definition.objectType include 'Name, Creation-Time, Last-Modified, Content-Length, Content-MD5, BlobType,
+ // AccessTier, AccessTierChangeTime, AccessTierInferred, Tags, Expiry-Time,
+ // hdiisfolder, Owner, Group, Permissions, Acl, Snapshot, VersionId, IsCurrentVersion, Metadata, LastAccessTime, Tags, Etag,
+ // ContentType, ContentEncoding, ContentLanguage, ContentCRC64, CacheControl,
+ // ContentDisposition, LeaseStatus, LeaseState, LeaseDuration, ServerEncrypted, Deleted, DeletionId, DeletedTime, RemainingRetentionDays,
+ // ImmutabilityPolicyUntilDate, ImmutabilityPolicyMode, LegalHold,
+ // CopyId, CopyStatus, CopySource, CopyProgress, CopyCompletionTime, CopyStatusDescription, CustomerProvidedKeySha256, RehydratePriority,
+ // ArchiveStatus, XmsBlobSequenceNumber, EncryptionScope,
+ // IncrementalCopy, TagCount'. For Blob object type schema field value 'DeletedTime' is applicable only for Hns enabled accounts.
+ // The valid values for 'Container' definition.objectType include 'Name,
+ // Last-Modified, Metadata, LeaseStatus, LeaseState, LeaseDuration, PublicAccess, HasImmutabilityPolicy, HasLegalHold, Etag,
+ // DefaultEncryptionScope, DenyEncryptionScopeOverride,
+ // ImmutableStorageWithVersioningEnabled, Deleted, Version, DeletedTime, RemainingRetentionDays'. Schema field values 'Expiry-Time,
+ // hdiisfolder, Owner, Group, Permissions, Acl, DeletionId' are valid only
+ // for Hns enabled accounts.Schema field values 'Tags, TagCount' are only valid for Non-Hns accounts.
+ SchemaFields []*string
+
+ // An object that defines the filter set.
+ Filters *BlobInventoryPolicyFilter
+}
+
+// BlobInventoryPolicyFilter - An object that defines the blob inventory rule filter conditions. For 'Blob' definition.objectType
+// all filter properties are applicable, 'blobTypes' is required and others are optional. For
+// 'Container' definition.objectType only prefixMatch is applicable and is optional.
+type BlobInventoryPolicyFilter struct {
+ // An array of predefined enum values. Valid values include blockBlob, appendBlob, pageBlob. Hns accounts does not support
+ // pageBlobs. This field is required when definition.objectType property is set to
+ // 'Blob'.
+ BlobTypes []*string
+
+ // This property is used to filter objects based on the object creation time
+ CreationTime *BlobInventoryCreationTime
+
+ // An array of strings with maximum 10 blob prefixes to be excluded from the inventory.
+ ExcludePrefix []*string
+
+ // Includes blob versions in blob inventory when value is set to true. The definition.schemaFields values 'VersionId and IsCurrentVersion'
+ // are required if this property is set to true, else they must be
+ // excluded.
+ IncludeBlobVersions *bool
+
+ // For 'Container' definition.objectType the definition.schemaFields must include 'Deleted, Version, DeletedTime and RemainingRetentionDays'.
+ // For 'Blob' definition.objectType and HNS enabled storage
+ // accounts the definition.schemaFields must include 'DeletionId, Deleted, DeletedTime and RemainingRetentionDays' and for
+ // Hns disabled accounts the definition.schemaFields must include 'Deleted and
+ // RemainingRetentionDays', else it must be excluded.
+ IncludeDeleted *bool
+
+ // Includes blob snapshots in blob inventory when value is set to true. The definition.schemaFields value 'Snapshot' is required
+ // if this property is set to true, else it must be excluded.
+ IncludeSnapshots *bool
+
+ // An array of strings with maximum 10 blob prefixes to be included in the inventory.
+ PrefixMatch []*string
+}
+
+// BlobInventoryPolicyProperties - The storage account blob inventory policy properties.
+type BlobInventoryPolicyProperties struct {
+ // REQUIRED; The storage account blob inventory policy object. It is composed of policy rules.
+ Policy *BlobInventoryPolicySchema
+
+ // READ-ONLY; Returns the last modified date and time of the blob inventory policy.
+ LastModifiedTime *time.Time
+}
+
+// BlobInventoryPolicyRule - An object that wraps the blob inventory rule. Each rule is uniquely defined by name.
+type BlobInventoryPolicyRule struct {
+ // REQUIRED; An object that defines the blob inventory policy rule.
+ Definition *BlobInventoryPolicyDefinition
+
+ // REQUIRED; Container name where blob inventory files are stored. Must be pre-created.
+ Destination *string
+
+ // REQUIRED; Rule is enabled when set to true.
+ Enabled *bool
+
+ // REQUIRED; A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be
+ // unique within a policy.
+ Name *string
+}
+
+// BlobInventoryPolicySchema - The storage account blob inventory policy rules.
+type BlobInventoryPolicySchema struct {
+ // REQUIRED; Policy is enabled if set to true.
+ Enabled *bool
+
+ // REQUIRED; The storage account blob inventory policy rules. The rule is applied when it is enabled.
+ Rules []*BlobInventoryPolicyRule
+
+ // REQUIRED; The valid value is Inventory
+ Type *InventoryRuleType
+
+ // READ-ONLY; Deprecated Property from API version 2021-04-01 onwards, the required destination container name must be specified
+ // at the rule level 'policy.rule.destination'
+ Destination *string
+}
+
+// BlobRestoreParameters - Blob restore parameters
+type BlobRestoreParameters struct {
+ // REQUIRED; Blob ranges to restore.
+ BlobRanges []*BlobRestoreRange
+
+ // REQUIRED; Restore blob to the specified time.
+ TimeToRestore *time.Time
+}
+
+// BlobRestoreRange - Blob range
+type BlobRestoreRange struct {
+ // REQUIRED; Blob end range. This is exclusive. Empty means account end.
+ EndRange *string
+
+ // REQUIRED; Blob start range. This is inclusive. Empty means account start.
+ StartRange *string
+}
+
+// BlobRestoreStatus - Blob restore status.
+type BlobRestoreStatus struct {
+ // READ-ONLY; Failure reason when blob restore is failed.
+ FailureReason *string
+
+ // READ-ONLY; Blob restore request parameters.
+ Parameters *BlobRestoreParameters
+
+ // READ-ONLY; Id for tracking blob restore request.
+ RestoreID *string
+
+ // READ-ONLY; The status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing.
+ // - Complete: Indicates that blob restore has been completed successfully. - Failed:
+ // Indicates that blob restore is failed.
+ Status *BlobRestoreProgressStatus
+}
+
+type BlobServiceItems struct {
+ // READ-ONLY; List of blob services returned.
+ Value []*BlobServiceProperties
+}
+
+// BlobServiceProperties - The properties of a storage account’s Blob service.
+type BlobServiceProperties struct {
+ // The properties of a storage account’s Blob service.
+ BlobServiceProperties *BlobServicePropertiesProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; Sku name and tier.
+ SKU *SKU
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// BlobServicePropertiesProperties - The properties of a storage account’s Blob service.
+type BlobServicePropertiesProperties struct {
+ // Deprecated in favor of isVersioningEnabled property.
+ AutomaticSnapshotPolicyEnabled *bool
+
+ // The blob service properties for change feed events.
+ ChangeFeed *ChangeFeed
+
+ // The blob service properties for container soft delete.
+ ContainerDeleteRetentionPolicy *DeleteRetentionPolicy
+
+ // Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule
+ // elements are included in the request body, all CORS rules will be deleted, and
+ // CORS will be disabled for the Blob service.
+ Cors *CorsRules
+
+ // DefaultServiceVersion indicates the default version to use for requests to the Blob service if an incoming request’s version
+ // is not specified. Possible values include version 2008-10-27 and all more
+ // recent versions.
+ DefaultServiceVersion *string
+
+ // The blob service properties for blob soft delete.
+ DeleteRetentionPolicy *DeleteRetentionPolicy
+
+ // Versioning is enabled if set to true.
+ IsVersioningEnabled *bool
+
+ // The blob service property to configure last access time based tracking policy.
+ LastAccessTimeTrackingPolicy *LastAccessTimeTrackingPolicy
+
+ // The blob service properties for blob restore policy.
+ RestorePolicy *RestorePolicyProperties
+}
+
+// BurstingConstants - Constants used for calculating included burst IOPS and maximum burst credits for IOPS for a file share
+// in the storage account.
+type BurstingConstants struct {
+ // READ-ONLY; The guaranteed floor of burst IOPS for small file shares.
+ BurstFloorIOPS *int32
+
+ // READ-ONLY; The scalar against provisioned IOPS in the file share included burst IOPS formula.
+ BurstIOScalar *float64
+
+ // READ-ONLY; The time frame for bursting in seconds in the file share maximum burst credits for IOPS formula.
+ BurstTimeframeSeconds *int32
+}
+
+// ChangeFeed - The blob service properties for change feed events.
+type ChangeFeed struct {
+ // Indicates whether change feed event logging is enabled for the Blob service.
+ Enabled *bool
+
+ // Indicates the duration of changeFeed retention in days. Minimum value is 1 day and maximum value is 146000 days (400 years).
+ // A null value indicates an infinite retention of the change feed.
+ RetentionInDays *int32
+}
+
+// CheckNameAvailabilityResult - The CheckNameAvailability operation response.
+type CheckNameAvailabilityResult struct {
+ // READ-ONLY; Gets an error message explaining the Reason value in more detail.
+ Message *string
+
+ // READ-ONLY; Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available.
+ // If false, the name has already been taken or is invalid and cannot be used.
+ NameAvailable *bool
+
+ // READ-ONLY; Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable
+ // is false.
+ Reason *Reason
+}
+
+// ContainerProperties - The properties of a container.
+type ContainerProperties struct {
+ // Default the container to use specified encryption scope for all writes.
+ DefaultEncryptionScope *string
+
+ // Block override of encryption scope from the container default.
+ DenyEncryptionScopeOverride *bool
+
+ // Enable NFSv3 all squash on blob container.
+ EnableNfsV3AllSquash *bool
+
+ // Enable NFSv3 root squash on blob container.
+ EnableNfsV3RootSquash *bool
+
+ // The object level immutability property of the container. The property is immutable and can only be set to true at the container
+ // creation time. Existing containers must undergo a migration process.
+ ImmutableStorageWithVersioning *ImmutableStorageWithVersioning
+
+ // A name-value pair to associate with the container as metadata.
+ Metadata map[string]*string
+
+ // Specifies whether data in the container may be accessed publicly and the level of access.
+ PublicAccess *PublicAccess
+
+ // READ-ONLY; Indicates whether the blob container was deleted.
+ Deleted *bool
+
+ // READ-ONLY; Blob container deletion time.
+ DeletedTime *time.Time
+
+ // READ-ONLY; The hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this
+ // container. The hasImmutabilityPolicy public property is set to false by SRP if
+ // ImmutabilityPolicy has not been created for this container.
+ HasImmutabilityPolicy *bool
+
+ // READ-ONLY; The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold
+ // public property is set to false by SRP if all existing legal hold tags are cleared out.
+ // There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account.
+ HasLegalHold *bool
+
+ // READ-ONLY; The ImmutabilityPolicy property of the container.
+ ImmutabilityPolicy *ImmutabilityPolicyProperties
+
+ // READ-ONLY; Returns the date and time the container was last modified.
+ LastModifiedTime *time.Time
+
+ // READ-ONLY; Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased.
+ LeaseDuration *LeaseDuration
+
+ // READ-ONLY; Lease state of the container.
+ LeaseState *LeaseState
+
+ // READ-ONLY; The lease status of the container.
+ LeaseStatus *LeaseStatus
+
+ // READ-ONLY; The LegalHold property of the container.
+ LegalHold *LegalHoldProperties
+
+ // READ-ONLY; Remaining retention days for soft deleted blob container.
+ RemainingRetentionDays *int32
+
+ // READ-ONLY; The version of the deleted blob container.
+ Version *string
+}
+
+// CorsRule - Specifies a CORS rule for the Blob service.
+type CorsRule struct {
+ // REQUIRED; Required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request.
+ AllowedHeaders []*string
+
+ // REQUIRED; Required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin.
+ AllowedMethods []*CorsRuleAllowedMethodsItem
+
+ // REQUIRED; Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow
+ // all domains
+ AllowedOrigins []*string
+
+ // REQUIRED; Required if CorsRule element is present. A list of response headers to expose to CORS clients.
+ ExposedHeaders []*string
+
+ // REQUIRED; Required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight
+ // response.
+ MaxAgeInSeconds *int32
+}
+
+// CorsRules - Sets the CORS rules. You can include up to five CorsRule elements in the request.
+type CorsRules struct {
+ // The List of CORS rules. You can include up to five CorsRule elements in the request.
+ CorsRules []*CorsRule
+}
+
+// CustomDomain - The custom domain assigned to this storage account. This can be set via Update.
+type CustomDomain struct {
+ // REQUIRED; Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source.
+ Name *string
+
+ // Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates.
+ UseSubDomainName *bool
+}
+
+// DateAfterCreation - Object to define snapshot and version action conditions.
+type DateAfterCreation struct {
+ // REQUIRED; Value indicating the age in days after creation
+ DaysAfterCreationGreaterThan *float32
+
+ // Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions
+ // and requires daysAfterCreationGreaterThan to be set for snapshots and blob
+ // version based actions. The blob will be archived if both the conditions are satisfied.
+ DaysAfterLastTierChangeGreaterThan *float32
+}
+
+// DateAfterModification - Object to define the base blob action conditions. Properties daysAfterModificationGreaterThan,
+// daysAfterLastAccessTimeGreaterThan and daysAfterCreationGreaterThan are mutually exclusive. The
+// daysAfterLastTierChangeGreaterThan property is only applicable for tierToArchive actions which requires daysAfterModificationGreaterThan
+// to be set, also it cannot be used in conjunction with
+// daysAfterLastAccessTimeGreaterThan or daysAfterCreationGreaterThan.
+type DateAfterModification struct {
+ // Value indicating the age in days after blob creation.
+ DaysAfterCreationGreaterThan *float32
+
+ // Value indicating the age in days after last blob access. This property can only be used in conjunction with last access
+ // time tracking policy
+ DaysAfterLastAccessTimeGreaterThan *float32
+
+ // Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions
+ // and requires daysAfterModificationGreaterThan to be set for baseBlobs
+ // based actions. The blob will be archived if both the conditions are satisfied.
+ DaysAfterLastTierChangeGreaterThan *float32
+
+ // Value indicating the age in days after last modification
+ DaysAfterModificationGreaterThan *float32
+}
+
+// DeleteRetentionPolicy - The service properties for soft delete.
+type DeleteRetentionPolicy struct {
+ // This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be
+ // used blob restore policy. This property only applies to blob service and does
+ // not apply to containers or file share.
+ AllowPermanentDelete *bool
+
+ // Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum
+ // value can be 365.
+ Days *int32
+
+ // Indicates whether DeleteRetentionPolicy is enabled.
+ Enabled *bool
+}
+
+// DeletedAccount - Deleted storage account
+type DeletedAccount struct {
+ // Properties of the deleted account.
+ Properties *DeletedAccountProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// DeletedAccountListResult - The response from the List Deleted Accounts operation.
+type DeletedAccountListResult struct {
+ // READ-ONLY; Request URL that can be used to query next page of deleted accounts. Returned when total number of requested
+ // deleted accounts exceed maximum page size.
+ NextLink *string
+
+ // READ-ONLY; Gets the list of deleted accounts and their properties.
+ Value []*DeletedAccount
+}
+
+// DeletedAccountProperties - Attributes of a deleted storage account.
+type DeletedAccountProperties struct {
+ // READ-ONLY; Creation time of the deleted account.
+ CreationTime *string
+
+ // READ-ONLY; Deletion time of the deleted account.
+ DeletionTime *string
+
+ // READ-ONLY; Location of the deleted account.
+ Location *string
+
+ // READ-ONLY; Can be used to attempt recovering this deleted account via PutStorageAccount API.
+ RestoreReference *string
+
+ // READ-ONLY; Full resource id of the original storage account.
+ StorageAccountResourceID *string
+}
+
+// DeletedShare - The deleted share to be restored.
+type DeletedShare struct {
+ // REQUIRED; Required. Identify the name of the deleted share that will be restored.
+ DeletedShareName *string
+
+ // REQUIRED; Required. Identify the version of the deleted share that will be restored.
+ DeletedShareVersion *string
+}
+
+// Dimension of blobs, possibly be blob type or access tier.
+type Dimension struct {
+ // Display name of dimension.
+ DisplayName *string
+
+ // Display name of dimension.
+ Name *string
+}
+
+// DualStackEndpointPreference - Dual-stack endpoint preference defines whether IPv6 endpoints are going to be published.
+type DualStackEndpointPreference struct {
+ // A boolean flag which indicates whether IPv6 storage endpoints are to be published.
+ PublishIPv6Endpoint *bool
+}
+
+// Encryption - The encryption settings on the storage account.
+type Encryption struct {
+ // The identity to be used with service-side encryption at rest.
+ EncryptionIdentity *EncryptionIdentity
+
+ // The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault
+ KeySource *KeySource
+
+ // Properties provided by key vault.
+ KeyVaultProperties *KeyVaultProperties
+
+ // A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for
+ // data at rest.
+ RequireInfrastructureEncryption *bool
+
+ // List of services which support encryption.
+ Services *EncryptionServices
+}
+
+// EncryptionIdentity - Encryption identity for the storage account.
+type EncryptionIdentity struct {
+ // ClientId of the multi-tenant application to be used in conjunction with the user-assigned identity for cross-tenant customer-managed-keys
+ // server-side encryption on the storage account.
+ EncryptionFederatedIdentityClientID *string
+
+ // Resource identifier of the UserAssigned identity to be associated with server-side encryption on the storage account.
+ EncryptionUserAssignedIdentity *string
+}
+
+// EncryptionInTransit - Encryption in transit setting.
+type EncryptionInTransit struct {
+ // Indicates whether encryption in transit is required
+ Required *bool
+}
+
+// EncryptionScope - The Encryption Scope resource.
+type EncryptionScope struct {
+ // Properties of the encryption scope.
+ EncryptionScopeProperties *EncryptionScopeProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// EncryptionScopeKeyVaultProperties - The key vault properties for the encryption scope. This is a required field if encryption
+// scope 'source' attribute is set to 'Microsoft.KeyVault'.
+type EncryptionScopeKeyVaultProperties struct {
+ // The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the
+ // identifier to enable customer-managed key support on this encryption scope.
+ KeyURI *string
+
+ // READ-ONLY; The object identifier of the current versioned Key Vault Key in use.
+ CurrentVersionedKeyIdentifier *string
+
+ // READ-ONLY; Timestamp of last rotation of the Key Vault Key.
+ LastKeyRotationTimestamp *time.Time
+}
+
+// EncryptionScopeListResult - List of encryption scopes requested, and if paging is required, a URL to the next page of encryption
+// scopes.
+type EncryptionScopeListResult struct {
+ // READ-ONLY; Request URL that can be used to query next page of encryption scopes. Returned when total number of requested
+ // encryption scopes exceeds the maximum page size.
+ NextLink *string
+
+ // READ-ONLY; List of encryption scopes requested.
+ Value []*EncryptionScope
+}
+
+// EncryptionScopeProperties - Properties of the encryption scope.
+type EncryptionScopeProperties struct {
+ // The key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is set
+ // to 'Microsoft.KeyVault'.
+ KeyVaultProperties *EncryptionScopeKeyVaultProperties
+
+ // A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for
+ // data at rest.
+ RequireInfrastructureEncryption *bool
+
+ // The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault.
+ Source *EncryptionScopeSource
+
+ // The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled.
+ State *EncryptionScopeState
+
+ // READ-ONLY; Gets the creation date and time of the encryption scope in UTC.
+ CreationTime *time.Time
+
+ // READ-ONLY; Gets the last modification date and time of the encryption scope in UTC.
+ LastModifiedTime *time.Time
+}
+
+// EncryptionService - A service that allows server-side encryption to be used.
+type EncryptionService struct {
+ // A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default
+ // today and cannot be disabled.
+ Enabled *bool
+
+ // Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption
+ // key will be used. 'Service' key type implies that a default service key is used.
+ KeyType *KeyType
+
+ // READ-ONLY; Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at
+ // rest by default today and cannot be disabled.
+ LastEnabledTime *time.Time
+}
+
+// EncryptionServices - A list of services that support encryption.
+type EncryptionServices struct {
+ // The encryption function of the blob storage service.
+ Blob *EncryptionService
+
+ // The encryption function of the file storage service.
+ File *EncryptionService
+
+ // The encryption function of the queue storage service.
+ Queue *EncryptionService
+
+ // The encryption function of the table storage service.
+ Table *EncryptionService
+}
+
+// Endpoints - The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object.
+type Endpoints struct {
+ // Gets the IPv6 storage endpoints.
+ IPv6Endpoints *AccountIPv6Endpoints
+
+ // Gets the internet routing storage endpoints
+ InternetEndpoints *AccountInternetEndpoints
+
+ // Gets the microsoft routing storage endpoints.
+ MicrosoftEndpoints *AccountMicrosoftEndpoints
+
+ // READ-ONLY; Gets the blob endpoint.
+ Blob *string
+
+ // READ-ONLY; Gets the dfs endpoint.
+ Dfs *string
+
+ // READ-ONLY; Gets the file endpoint.
+ File *string
+
+ // READ-ONLY; Gets the queue endpoint.
+ Queue *string
+
+ // READ-ONLY; Gets the table endpoint.
+ Table *string
+
+ // READ-ONLY; Gets the web endpoint.
+ Web *string
+}
+
+// ErrorAdditionalInfo - The resource management error additional info.
+type ErrorAdditionalInfo struct {
+ // READ-ONLY; The additional info.
+ Info any
+
+ // READ-ONLY; The additional info type.
+ Type *string
+}
+
+// ErrorDetail - The error detail.
+type ErrorDetail struct {
+ // READ-ONLY; The error additional info.
+ AdditionalInfo []*ErrorAdditionalInfo
+
+ // READ-ONLY; The error code.
+ Code *string
+
+ // READ-ONLY; The error details.
+ Details []*ErrorDetail
+
+ // READ-ONLY; The error message.
+ Message *string
+
+ // READ-ONLY; The error target.
+ Target *string
+}
+
+// ErrorResponse - An error response from the storage resource provider.
+type ErrorResponse struct {
+ // Azure Storage Resource Provider error response body.
+ Error *ErrorResponseBody
+}
+
+// ErrorResponseAutoGenerated - Common error response for all Azure Resource Manager APIs to return error details for failed
+// operations. (This also follows the OData error response format.).
+type ErrorResponseAutoGenerated struct {
+ // The error object.
+ Error *ErrorDetail
+}
+
+// ErrorResponseBody - Error response body contract.
+type ErrorResponseBody struct {
+ // An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
+ Code *string
+
+ // A message describing the error, intended to be suitable for display in a user interface.
+ Message *string
+}
+
+// ExecutionTarget - Target helps provide filter parameters for the objects in the storage account and forms the execution
+// context for the storage task
+type ExecutionTarget struct {
+ // List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude prefixes,
+ // the exclude prefix will be the determining factor
+ ExcludePrefix []*string
+
+ // Required list of object prefixes to be included for task execution
+ Prefix []*string
+}
+
+// ExecutionTrigger - Execution trigger for storage task assignment
+type ExecutionTrigger struct {
+ // REQUIRED; The trigger parameters of the storage task assignment execution
+ Parameters *TriggerParameters
+
+ // REQUIRED; The trigger type of the storage task assignment execution
+ Type *TriggerType
+}
+
+// ExecutionTriggerUpdate - Execution trigger update for storage task assignment
+type ExecutionTriggerUpdate struct {
+ // The trigger parameters of the storage task assignment execution
+ Parameters *TriggerParametersUpdate
+
+ // The trigger type of the storage task assignment execution
+ Type *TriggerType
+}
+
+// ExtendedLocation - The complex type of the extended location.
+type ExtendedLocation struct {
+ // The name of the extended location.
+ Name *string
+
+ // The type of the extended location.
+ Type *ExtendedLocationTypes
+}
+
+type FileServiceItems struct {
+ // READ-ONLY; List of file services returned.
+ Value []*FileServiceProperties
+}
+
+// FileServiceProperties - The properties of File services in storage account.
+type FileServiceProperties struct {
+ // The properties of File services in storage account.
+ FileServiceProperties *FileServicePropertiesProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; Sku name and tier.
+ SKU *SKU
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// FileServicePropertiesProperties - The properties of File services in storage account.
+type FileServicePropertiesProperties struct {
+ // Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule
+ // elements are included in the request body, all CORS rules will be deleted, and
+ // CORS will be disabled for the File service.
+ Cors *CorsRules
+
+ // Protocol settings for file service
+ ProtocolSettings *ProtocolSettings
+
+ // The file service properties for share soft delete.
+ ShareDeleteRetentionPolicy *DeleteRetentionPolicy
+}
+
+// FileServiceUsage - The usage of file service in storage account.
+type FileServiceUsage struct {
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; File service usage in storage account including account limits, file share limits and constants used in recommendations
+ // and bursting formula.
+ Properties *FileServiceUsageProperties
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// FileServiceUsageProperties - File service usage in storage account including account limits, file share limits and constants
+// used in recommendations and bursting formula.
+type FileServiceUsageProperties struct {
+ // READ-ONLY; Constants used for calculating included burst IOPS and maximum burst credits for IOPS for a file share in the
+ // storage account.
+ BurstingConstants *BurstingConstants
+
+ // READ-ONLY; Minimum and maximum provisioned storage, IOPS and bandwidth limits for a file share in the storage account.
+ FileShareLimits *FileShareLimits
+
+ // READ-ONLY; Constants used for calculating recommended provisioned IOPS and bandwidth for a file share in the storage account.
+ FileShareRecommendations *FileShareRecommendations
+
+ // READ-ONLY; Maximum provisioned storage, IOPS, bandwidth and number of file shares limits for the storage account.
+ StorageAccountLimits *AccountLimits
+
+ // READ-ONLY; Usage of provisioned storage, IOPS, bandwidth and number of file shares across all live shares and soft-deleted
+ // shares in the account.
+ StorageAccountUsage *AccountUsage
+}
+
+// FileServiceUsages - List file service usages schema.
+type FileServiceUsages struct {
+ // READ-ONLY; Request URL that can be used to query next page of file service usages. Returned when total number of requested
+ // file service usages exceed maximum page size.
+ NextLink *string
+
+ // READ-ONLY; List of file service usages returned.
+ Value []*FileServiceUsage
+}
+
+// FileShare - Properties of the file share, including Id, resource name, resource type, Etag.
+type FileShare struct {
+ // Properties of the file share.
+ FileShareProperties *FileShareProperties
+
+ // READ-ONLY; Resource Etag.
+ Etag *string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// FileShareItem - The file share properties be listed out.
+type FileShareItem struct {
+ // The file share properties be listed out.
+ Properties *FileShareProperties
+
+ // READ-ONLY; Resource Etag.
+ Etag *string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// FileShareItems - Response schema. Contains list of shares returned, and if paging is requested or required, a URL to next
+// page of shares.
+type FileShareItems struct {
+ // READ-ONLY; Request URL that can be used to query next page of shares. Returned when total number of requested shares exceed
+ // maximum page size.
+ NextLink *string
+
+ // READ-ONLY; List of file shares returned.
+ Value []*FileShareItem
+}
+
+// FileShareLimits - Minimum and maximum provisioned storage, IOPS and bandwidth limits for a file share in the storage account.
+type FileShareLimits struct {
+ // READ-ONLY; The maximum provisioned bandwidth limit in mebibytes per second for a file share in the storage account.
+ MaxProvisionedBandwidthMiBPerSec *int32
+
+ // READ-ONLY; The maximum provisioned IOPS limit for a file share in the storage account.
+ MaxProvisionedIOPS *int32
+
+ // READ-ONLY; The maximum provisioned storage quota limit in gibibytes for a file share in the storage account.
+ MaxProvisionedStorageGiB *int32
+
+ // READ-ONLY; The minimum provisioned bandwidth limit in mebibytes per second for a file share in the storage account.
+ MinProvisionedBandwidthMiBPerSec *int32
+
+ // READ-ONLY; The minimum provisioned IOPS limit for a file share in the storage account.
+ MinProvisionedIOPS *int32
+
+ // READ-ONLY; The minimum provisioned storage quota limit in gibibytes for a file share in the storage account.
+ MinProvisionedStorageGiB *int32
+}
+
+// FileShareProperties - The properties of the file share.
+type FileShareProperties struct {
+ // Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage
+ // account can choose Premium.
+ AccessTier *ShareAccessTier
+
+ // The authentication protocol that is used for the file share. Can only be specified when creating a share.
+ EnabledProtocols *EnabledProtocols
+
+ // File Share Paid Bursting properties.
+ FileSharePaidBursting *FileSharePropertiesFileSharePaidBursting
+
+ // A name-value pair to associate with the share as metadata.
+ Metadata map[string]*string
+
+ // The provisioned bandwidth of the share, in mebibytes per second. This property is only for file shares created under Files
+ // Provisioned v2 account type. Please refer to the GetFileServiceUsage API
+ // response for the minimum and maximum allowed value for provisioned bandwidth.
+ ProvisionedBandwidthMibps *int32
+
+ // The provisioned IOPS of the share. This property is only for file shares created under Files Provisioned v2 account type.
+ // Please refer to the GetFileServiceUsage API response for the minimum and
+ // maximum allowed value for provisioned IOPS.
+ ProvisionedIops *int32
+
+ // The property is for NFS share only. The default is NoRootSquash.
+ RootSquash *RootSquashType
+
+ // The provisioned size of the share, in gibibytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large
+ // File Shares, the maximum size is 102400. For file shares created under Files
+ // Provisioned v2 account type, please refer to the GetFileServiceUsage API response for the minimum and maximum allowed provisioned
+ // storage size.
+ ShareQuota *int32
+
+ // List of stored access policies specified on the share.
+ SignedIdentifiers []*SignedIdentifier
+
+ // READ-ONLY; Indicates the last modification time for share access tier.
+ AccessTierChangeTime *time.Time
+
+ // READ-ONLY; Indicates if there is a pending transition for access tier.
+ AccessTierStatus *string
+
+ // READ-ONLY; Indicates whether the share was deleted.
+ Deleted *bool
+
+ // READ-ONLY; The deleted time if the share was deleted.
+ DeletedTime *time.Time
+
+ // READ-ONLY; The calculated burst IOPS of the share. This property is only for file shares created under Files Provisioned
+ // v2 account type.
+ IncludedBurstIops *int32
+
+ // READ-ONLY; Returns the date and time the share was last modified.
+ LastModifiedTime *time.Time
+
+ // READ-ONLY; Specifies whether the lease on a share is of infinite or fixed duration, only when the share is leased.
+ LeaseDuration *LeaseDuration
+
+ // READ-ONLY; Lease state of the share.
+ LeaseState *LeaseState
+
+ // READ-ONLY; The lease status of the share.
+ LeaseStatus *LeaseStatus
+
+ // READ-ONLY; The calculated maximum burst credits for the share. This property is only for file shares created under Files
+ // Provisioned v2 account type.
+ MaxBurstCreditsForIops *int64
+
+ // READ-ONLY; Returns the next allowed provisioned bandwidth downgrade time for the share. This property is only for file
+ // shares created under Files Provisioned v2 account type.
+ NextAllowedProvisionedBandwidthDowngradeTime *time.Time
+
+ // READ-ONLY; Returns the next allowed provisioned IOPS downgrade time for the share. This property is only for file shares
+ // created under Files Provisioned v2 account type.
+ NextAllowedProvisionedIopsDowngradeTime *time.Time
+
+ // READ-ONLY; Returns the next allowed provisioned storage size downgrade time for the share. This property is only for file
+ // shares created under Files Provisioned v1 SSD and Files Provisioned v2 account type
+ NextAllowedQuotaDowngradeTime *time.Time
+
+ // READ-ONLY; Remaining retention days for share that was soft deleted.
+ RemainingRetentionDays *int32
+
+ // READ-ONLY; The approximate size of the data stored on the share. Note that this value may not include all recently created
+ // or recently resized files.
+ ShareUsageBytes *int64
+
+ // READ-ONLY; Creation time of share snapshot returned in the response of list shares with expand param "snapshots".
+ SnapshotTime *time.Time
+
+ // READ-ONLY; The version of the share.
+ Version *string
+}
+
+// FileSharePropertiesFileSharePaidBursting - File Share Paid Bursting properties.
+type FileSharePropertiesFileSharePaidBursting struct {
+ // Indicates whether paid bursting is enabled for the share. This property is only for file shares created under Files Provisioned
+ // v1 SSD account type.
+ PaidBurstingEnabled *bool
+
+ // The maximum paid bursting bandwidth for the share, in mebibytes per second. This property is only for file shares created
+ // under Files Provisioned v1 SSD account type. The maximum allowed value is
+ // 10340 which is the maximum allowed bandwidth for a share.
+ PaidBurstingMaxBandwidthMibps *int32
+
+ // The maximum paid bursting IOPS for the share. This property is only for file shares created under Files Provisioned v1
+ // SSD account type. The maximum allowed value is 102400 which is the maximum
+ // allowed IOPS for a share.
+ PaidBurstingMaxIops *int32
+}
+
+// FileShareRecommendations - Constants used for calculating recommended provisioned IOPS and bandwidth for a file share in
+// the storage account.
+type FileShareRecommendations struct {
+ // READ-ONLY; The scalar for bandwidth in the file share provisioned bandwidth recommendation formula.
+ BandwidthScalar *float64
+
+ // READ-ONLY; The base bandwidth in the file share provisioned bandwidth recommendation formula.
+ BaseBandwidthMiBPerSec *int32
+
+ // READ-ONLY; The base IOPS in the file share provisioned IOPS recommendation formula.
+ BaseIOPS *int32
+
+ // READ-ONLY; The scalar for IO in the file share provisioned IOPS recommendation formula.
+ IoScalar *float64
+}
+
+// GeoReplicationStats - Statistics related to replication for storage account's Blob, Table, Queue and File services. It
+// is only available when geo-redundant replication is enabled for the storage account.
+type GeoReplicationStats struct {
+ // READ-ONLY; A boolean flag which indicates whether or not account failover is supported for the account.
+ CanFailover *bool
+
+ // READ-ONLY; A boolean flag which indicates whether or not planned account failover is supported for the account.
+ CanPlannedFailover *bool
+
+ // READ-ONLY; All primary writes preceding this UTC date/time value are guaranteed to be available for read operations. Primary
+ // writes following this point in time may or may not be available for reads. Element may
+ // be default value if value of LastSyncTime is not available, this can happen if secondary is offline or we are in bootstrap.
+ LastSyncTime *time.Time
+
+ // READ-ONLY; The redundancy type of the account after an account failover is performed.
+ PostFailoverRedundancy *PostFailoverRedundancy
+
+ // READ-ONLY; The redundancy type of the account after a planned account failover is performed.
+ PostPlannedFailoverRedundancy *PostPlannedFailoverRedundancy
+
+ // READ-ONLY; The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is
+ // active and operational. - Bootstrap: Indicates initial synchronization from the primary
+ // location to the secondary location is in progress.This typically occurs when replication is first enabled. - Unavailable:
+ // Indicates that the secondary location is temporarily unavailable.
+ Status *GeoReplicationStatus
+}
+
+// IPRule - IP rule with specific IP or IP range in CIDR format.
+type IPRule struct {
+ // CONSTANT; The action of IP ACL rule.
+ // Field has constant value "Allow", any specified value is ignored.
+ Action *string
+
+ // REQUIRED; Specifies the IP or IP range in CIDR format.
+ IPAddressOrRange *string
+}
+
+// Identity for the resource.
+type Identity struct {
+ // REQUIRED; The identity type.
+ Type *IdentityType
+
+ // Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage
+ // account. The key is the ARM resource identifier of the identity. Only 1
+ // User Assigned identity is permitted here.
+ UserAssignedIdentities map[string]*UserAssignedIdentity
+
+ // READ-ONLY; The principal ID of resource identity.
+ PrincipalID *string
+
+ // READ-ONLY; The tenant ID of resource.
+ TenantID *string
+}
+
+// ImmutabilityPolicy - The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag.
+type ImmutabilityPolicy struct {
+ // REQUIRED; The properties of an ImmutabilityPolicy of a blob container.
+ Properties *ImmutabilityPolicyProperty
+
+ // READ-ONLY; Resource Etag.
+ Etag *string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// ImmutabilityPolicyProperties - The properties of an ImmutabilityPolicy of a blob container.
+type ImmutabilityPolicyProperties struct {
+ // The properties of an ImmutabilityPolicy of a blob container.
+ Properties *ImmutabilityPolicyProperty
+
+ // READ-ONLY; ImmutabilityPolicy Etag.
+ Etag *string
+
+ // READ-ONLY; The ImmutabilityPolicy update history of the blob container.
+ UpdateHistory []*UpdateHistoryProperty
+}
+
+// ImmutabilityPolicyProperty - The properties of an ImmutabilityPolicy of a blob container.
+type ImmutabilityPolicyProperty struct {
+ // This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to
+ // an append blob while maintaining immutability protection and compliance. Only
+ // new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy
+ // API.
+ AllowProtectedAppendWrites *bool
+
+ // This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to
+ // both 'Append and Bock Blobs' while maintaining immutability protection and
+ // compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be
+ // changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and
+ // 'allowProtectedAppendWritesAll' properties are mutually exclusive.
+ AllowProtectedAppendWritesAll *bool
+
+ // The immutability period for the blobs in the container since the policy creation, in days.
+ ImmutabilityPeriodSinceCreationInDays *int32
+
+ // READ-ONLY; The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked.
+ State *ImmutabilityPolicyState
+}
+
+// ImmutableStorageAccount - This property enables and defines account-level immutability. Enabling the feature auto-enables
+// Blob Versioning.
+type ImmutableStorageAccount struct {
+ // A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability
+ // enabled by default.
+ Enabled *bool
+
+ // Specifies the default account-level immutability policy which is inherited and applied to objects that do not possess an
+ // explicit immutability policy at the object level. The object-level immutability
+ // policy has higher precedence than the container-level immutability policy, which has a higher precedence than the account-level
+ // immutability policy.
+ ImmutabilityPolicy *AccountImmutabilityPolicyProperties
+}
+
+// ImmutableStorageWithVersioning - Object level immutability properties of the container.
+type ImmutableStorageWithVersioning struct {
+ // This is an immutable property, when set to true it enables object level immutability at the container level.
+ Enabled *bool
+
+ // READ-ONLY; This property denotes the container level immutability to object level immutability migration state.
+ MigrationState *MigrationState
+
+ // READ-ONLY; Returns the date and time the object level immutability was enabled.
+ TimeStamp *time.Time
+}
+
+// KeyCreationTime - Storage account keys creation time.
+type KeyCreationTime struct {
+ Key1 *time.Time
+ Key2 *time.Time
+}
+
+// KeyPolicy assigned to the storage account.
+type KeyPolicy struct {
+ // REQUIRED; The key expiration period in days.
+ KeyExpirationPeriodInDays *int32
+}
+
+// KeyVaultProperties - Properties of key vault.
+type KeyVaultProperties struct {
+ // The name of KeyVault key.
+ KeyName *string
+
+ // The Uri of KeyVault.
+ KeyVaultURI *string
+
+ // The version of KeyVault key.
+ KeyVersion *string
+
+ // READ-ONLY; This is a read only property that represents the expiration time of the current version of the customer managed
+ // key used for encryption.
+ CurrentVersionedKeyExpirationTimestamp *time.Time
+
+ // READ-ONLY; The object identifier of the current versioned Key Vault Key in use.
+ CurrentVersionedKeyIdentifier *string
+
+ // READ-ONLY; Timestamp of last rotation of the Key Vault Key.
+ LastKeyRotationTimestamp *time.Time
+}
+
+// LastAccessTimeTrackingPolicy - The blob service properties for Last access time based tracking policy.
+type LastAccessTimeTrackingPolicy struct {
+ // REQUIRED; When set to true last access time based tracking is enabled.
+ Enable *bool
+
+ // An array of predefined supported blob types. Only blockBlob is the supported value. This field is currently read only
+ BlobType []*string
+
+ // Name of the policy. The valid value is AccessTimeTracking. This field is currently read only
+ Name *Name
+
+ // The field specifies blob object tracking granularity in days, typically how often the blob object should be tracked.This
+ // field is currently read only with value as 1
+ TrackingGranularityInDays *int32
+}
+
+// LeaseContainerRequest - Lease Container request schema.
+type LeaseContainerRequest struct {
+ // REQUIRED; Specifies the lease action. Can be one of the available actions.
+ Action *LeaseContainerRequestAction
+
+ // Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and
+ // 60.
+ BreakPeriod *int32
+
+ // Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires.
+ LeaseDuration *int32
+
+ // Identifies the lease. Can be specified in any valid GUID string format.
+ LeaseID *string
+
+ // Optional for acquire, required for change. Proposed lease ID, in a GUID string format.
+ ProposedLeaseID *string
+}
+
+// LeaseContainerResponse - Lease Container response schema.
+type LeaseContainerResponse struct {
+ // Returned unique lease ID that must be included with any request to delete the container, or to renew, change, or release
+ // the lease.
+ LeaseID *string
+
+ // Approximate time remaining in the lease period, in seconds.
+ LeaseTimeSeconds *string
+}
+
+// LeaseShareRequest - Lease Share request schema.
+type LeaseShareRequest struct {
+ // REQUIRED; Specifies the lease action. Can be one of the available actions.
+ Action *LeaseShareAction
+
+ // Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and
+ // 60.
+ BreakPeriod *int32
+
+ // Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires.
+ LeaseDuration *int32
+
+ // Identifies the lease. Can be specified in any valid GUID string format.
+ LeaseID *string
+
+ // Optional for acquire, required for change. Proposed lease ID, in a GUID string format.
+ ProposedLeaseID *string
+}
+
+// LeaseShareResponse - Lease Share response schema.
+type LeaseShareResponse struct {
+ // Returned unique lease ID that must be included with any request to delete the share, or to renew, change, or release the
+ // lease.
+ LeaseID *string
+
+ // Approximate time remaining in the lease period, in seconds.
+ LeaseTimeSeconds *string
+}
+
+// LegalHold - The LegalHold property of a blob container.
+type LegalHold struct {
+ // REQUIRED; Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP.
+ Tags []*string
+
+ // When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance.
+ // Only new blocks can be added and any existing blocks cannot be modified
+ // or deleted.
+ AllowProtectedAppendWritesAll *bool
+
+ // READ-ONLY; The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold
+ // public property is set to false by SRP if all existing legal hold tags are cleared out.
+ // There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account.
+ HasLegalHold *bool
+}
+
+// LegalHoldProperties - The LegalHold property of a blob container.
+type LegalHoldProperties struct {
+ // Protected append blob writes history.
+ ProtectedAppendWritesHistory *ProtectedAppendWritesHistory
+
+ // The list of LegalHold tags of a blob container.
+ Tags []*TagProperty
+
+ // READ-ONLY; The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold
+ // public property is set to false by SRP if all existing legal hold tags are cleared out.
+ // There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account.
+ HasLegalHold *bool
+}
+
+// ListAccountSasResponse - The List SAS credentials operation response.
+type ListAccountSasResponse struct {
+ // READ-ONLY; List SAS credentials of storage account.
+ AccountSasToken *string
+}
+
+// ListBlobInventoryPolicy - List of blob inventory policies returned.
+type ListBlobInventoryPolicy struct {
+ // READ-ONLY; List of blob inventory policies.
+ Value []*BlobInventoryPolicy
+}
+
+// ListContainerItem - The blob container properties be listed out.
+type ListContainerItem struct {
+ // The blob container properties be listed out.
+ Properties *ContainerProperties
+
+ // READ-ONLY; Resource Etag.
+ Etag *string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// ListContainerItems - Response schema. Contains list of blobs returned, and if paging is requested or required, a URL to
+// next page of containers.
+type ListContainerItems struct {
+ // READ-ONLY; Request URL that can be used to query next page of containers. Returned when total number of requested containers
+ // exceed maximum page size.
+ NextLink *string
+
+ // READ-ONLY; List of blobs containers returned.
+ Value []*ListContainerItem
+}
+
+type ListQueue struct {
+ // List Queue resource properties.
+ QueueProperties *ListQueueProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+type ListQueueProperties struct {
+ // A name-value pair that represents queue metadata.
+ Metadata map[string]*string
+}
+
+// ListQueueResource - Response schema. Contains list of queues returned
+type ListQueueResource struct {
+ // READ-ONLY; Request URL that can be used to list next page of queues
+ NextLink *string
+
+ // READ-ONLY; List of queues returned.
+ Value []*ListQueue
+}
+
+type ListQueueServices struct {
+ // READ-ONLY; List of queue services returned.
+ Value []*QueueServiceProperties
+}
+
+// ListServiceSasResponse - The List service SAS credentials operation response.
+type ListServiceSasResponse struct {
+ // READ-ONLY; List service SAS credentials of specific resource.
+ ServiceSasToken *string
+}
+
+// ListTableResource - Response schema. Contains list of tables returned
+type ListTableResource struct {
+ // READ-ONLY; Request URL that can be used to query next page of tables
+ NextLink *string
+
+ // READ-ONLY; List of tables returned.
+ Value []*Table
+}
+
+type ListTableServices struct {
+ // READ-ONLY; List of table services returned.
+ Value []*TableServiceProperties
+}
+
+// LocalUser - The local user associated with the storage accounts.
+type LocalUser struct {
+ // Storage account local user properties.
+ Properties *LocalUserProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; Metadata pertaining to creation and last modification of the resource.
+ SystemData *SystemData
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// LocalUserKeys - The Storage Account Local User keys.
+type LocalUserKeys struct {
+ // Optional, local user ssh authorized keys for SFTP.
+ SSHAuthorizedKeys []*SSHPublicKey
+
+ // READ-ONLY; Auto generated by the server for SMB authentication.
+ SharedKey *string
+}
+
+// LocalUserProperties - The Storage Account Local User properties.
+type LocalUserProperties struct {
+ // Indicates whether ACL authorization is allowed for this user. Set it to false to disallow using ACL authorization.
+ AllowACLAuthorization *bool
+
+ // Supplementary group membership. Only applicable for local users enabled for NFSv3 access.
+ ExtendedGroups []*int32
+
+ // An identifier for associating a group of users.
+ GroupID *int32
+
+ // Indicates whether ssh key exists. Set it to false to remove existing SSH key.
+ HasSSHKey *bool
+
+ // Indicates whether ssh password exists. Set it to false to remove existing SSH password.
+ HasSSHPassword *bool
+
+ // Indicates whether shared key exists. Set it to false to remove existing shared key.
+ HasSharedKey *bool
+
+ // Optional, local user home directory.
+ HomeDirectory *string
+
+ // Indicates if the local user is enabled for access with NFSv3 protocol.
+ IsNFSv3Enabled *bool
+
+ // The permission scopes of the local user.
+ PermissionScopes []*PermissionScope
+
+ // Optional, local user ssh authorized keys for SFTP.
+ SSHAuthorizedKeys []*SSHPublicKey
+
+ // READ-ONLY; A unique Security Identifier that is generated by the server.
+ Sid *string
+
+ // READ-ONLY; A unique Identifier that is generated by the server.
+ UserID *int32
+}
+
+// LocalUserRegeneratePasswordResult - The secrets of Storage Account Local User.
+type LocalUserRegeneratePasswordResult struct {
+ // READ-ONLY; Auto generated password by the server for SSH authentication if hasSshPassword is set to true on the creation
+ // of local user.
+ SSHPassword *string
+}
+
+// LocalUsers - List of local users requested, and if paging is required, a URL to the next page of local users.
+type LocalUsers struct {
+ // The list of local users associated with the storage account.
+ Value []*LocalUser
+
+ // READ-ONLY; Request URL that can be used to query next page of local users. Returned when total number of requested local
+ // users exceeds the maximum page size.
+ NextLink *string
+}
+
+// ManagementPolicy - The Get Storage Account ManagementPolicies operation response.
+type ManagementPolicy struct {
+ // Returns the Storage Account Data Policies Rules.
+ Properties *ManagementPolicyProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// ManagementPolicyAction - Actions are applied to the filtered blobs when the execution condition is met.
+type ManagementPolicyAction struct {
+ // The management policy action for base blob
+ BaseBlob *ManagementPolicyBaseBlob
+
+ // The management policy action for snapshot
+ Snapshot *ManagementPolicySnapShot
+
+ // The management policy action for version
+ Version *ManagementPolicyVersion
+}
+
+// ManagementPolicyBaseBlob - Management policy action for base blob.
+type ManagementPolicyBaseBlob struct {
+ // The function to delete the blob
+ Delete *DateAfterModification
+
+ // This property enables auto tiering of a blob from cool to hot on a blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan.
+ EnableAutoTierToHotFromCool *bool
+
+ // The function to tier blobs to archive storage.
+ TierToArchive *DateAfterModification
+
+ // The function to tier blobs to cold storage.
+ TierToCold *DateAfterModification
+
+ // The function to tier blobs to cool storage.
+ TierToCool *DateAfterModification
+
+ // The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts
+ TierToHot *DateAfterModification
+}
+
+// ManagementPolicyDefinition - An object that defines the Lifecycle rule. Each definition is made up with a filters set and
+// an actions set.
+type ManagementPolicyDefinition struct {
+ // REQUIRED; An object that defines the action set.
+ Actions *ManagementPolicyAction
+
+ // An object that defines the filter set.
+ Filters *ManagementPolicyFilter
+}
+
+// ManagementPolicyFilter - Filters limit rule actions to a subset of blobs within the storage account. If multiple filters
+// are defined, a logical AND is performed on all filters.
+type ManagementPolicyFilter struct {
+ // REQUIRED; An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete
+ // actions are supported for appendBlob.
+ BlobTypes []*string
+
+ // An array of blob index tag based filters, there can be at most 10 tag filters
+ BlobIndexMatch []*TagFilter
+
+ // An array of strings for prefixes to be match.
+ PrefixMatch []*string
+}
+
+// ManagementPolicyProperties - The Storage Account ManagementPolicy properties.
+type ManagementPolicyProperties struct {
+ // REQUIRED; The Storage Account ManagementPolicy, in JSON format. See more details in: https://learn.microsoft.com/azure/storage/blobs/lifecycle-management-overview.
+ Policy *ManagementPolicySchema
+
+ // READ-ONLY; Returns the date and time the ManagementPolicies was last modified.
+ LastModifiedTime *time.Time
+}
+
+// ManagementPolicyRule - An object that wraps the Lifecycle rule. Each rule is uniquely defined by name.
+type ManagementPolicyRule struct {
+ // REQUIRED; An object that defines the Lifecycle rule.
+ Definition *ManagementPolicyDefinition
+
+ // REQUIRED; A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be
+ // unique within a policy.
+ Name *string
+
+ // REQUIRED; The valid value is Lifecycle
+ Type *RuleType
+
+ // Rule is enabled if set to true.
+ Enabled *bool
+}
+
+// ManagementPolicySchema - The Storage Account ManagementPolicies Rules. See more details in: https://learn.microsoft.com/azure/storage/blobs/lifecycle-management-overview.
+type ManagementPolicySchema struct {
+ // REQUIRED; The Storage Account ManagementPolicies Rules. See more details in: https://learn.microsoft.com/azure/storage/blobs/lifecycle-management-overview.
+ Rules []*ManagementPolicyRule
+}
+
+// ManagementPolicySnapShot - Management policy action for snapshot.
+type ManagementPolicySnapShot struct {
+ // The function to delete the blob snapshot
+ Delete *DateAfterCreation
+
+ // The function to tier blob snapshot to archive storage.
+ TierToArchive *DateAfterCreation
+
+ // The function to tier blobs to cold storage.
+ TierToCold *DateAfterCreation
+
+ // The function to tier blob snapshot to cool storage.
+ TierToCool *DateAfterCreation
+
+ // The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts
+ TierToHot *DateAfterCreation
+}
+
+// ManagementPolicyVersion - Management policy action for blob version.
+type ManagementPolicyVersion struct {
+ // The function to delete the blob version
+ Delete *DateAfterCreation
+
+ // The function to tier blob version to archive storage.
+ TierToArchive *DateAfterCreation
+
+ // The function to tier blobs to cold storage.
+ TierToCold *DateAfterCreation
+
+ // The function to tier blob version to cool storage.
+ TierToCool *DateAfterCreation
+
+ // The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts
+ TierToHot *DateAfterCreation
+}
+
+// MetricSpecification - Metric specification of operation.
+type MetricSpecification struct {
+ // Aggregation type could be Average.
+ AggregationType *string
+
+ // The category this metric specification belong to, could be Capacity.
+ Category *string
+
+ // Dimensions of blobs, including blob type and access tier.
+ Dimensions []*Dimension
+
+ // Display description of metric specification.
+ DisplayDescription *string
+
+ // Display name of metric specification.
+ DisplayName *string
+
+ // The property to decide fill gap with zero or not.
+ FillGapWithZero *bool
+
+ // Name of metric specification.
+ Name *string
+
+ // Account Resource Id.
+ ResourceIDDimensionNameOverride *string
+
+ // Unit could be Bytes or Count.
+ Unit *string
+}
+
+// Multichannel setting. Applies to Premium FileStorage only.
+type Multichannel struct {
+ // Indicates whether multichannel is enabled
+ Enabled *bool
+}
+
+// NetworkRuleSet - Network rule set
+type NetworkRuleSet struct {
+ // REQUIRED; Specifies the default action of allow or deny when no other rules match.
+ DefaultAction *DefaultAction
+
+ // Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices
+ // (For example, "Logging, Metrics"), or None to bypass none
+ // of those traffics.
+ Bypass *Bypass
+
+ // Sets the IP ACL rules
+ IPRules []*IPRule
+
+ // Sets the IPv6 ACL rules.
+ IPv6Rules []*IPRule
+
+ // Sets the resource access rules
+ ResourceAccessRules []*ResourceAccessRule
+
+ // Sets the virtual network rules
+ VirtualNetworkRules []*VirtualNetworkRule
+}
+
+// NetworkSecurityPerimeter related information
+type NetworkSecurityPerimeter struct {
+ // The ARM identifier of the resource
+ ID *string
+
+ // Location of the resource
+ Location *string
+
+ // Guid of the resource
+ PerimeterGUID *string
+}
+
+// NetworkSecurityPerimeterConfiguration - The Network Security Perimeter configuration resource.
+type NetworkSecurityPerimeterConfiguration struct {
+ // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; Properties of the Network Security Perimeter Configuration
+ Properties *NetworkSecurityPerimeterConfigurationProperties
+
+ // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ SystemData *SystemData
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// NetworkSecurityPerimeterConfigurationList - Result of the List Network Security Perimeter configuration operation.
+type NetworkSecurityPerimeterConfigurationList struct {
+ // The URI that can be used to request the next set of paged results.
+ NextLink *string
+
+ // READ-ONLY; A collection of Network Security Perimeter configurations
+ Value []*NetworkSecurityPerimeterConfiguration
+}
+
+// NetworkSecurityPerimeterConfigurationProperties - Properties of the Network Security Perimeter Configuration
+type NetworkSecurityPerimeterConfigurationProperties struct {
+ // READ-ONLY; NetworkSecurityPerimeter related information
+ NetworkSecurityPerimeter *NetworkSecurityPerimeter
+
+ // READ-ONLY; Network Security Perimeter profile
+ Profile *NetworkSecurityPerimeterConfigurationPropertiesProfile
+
+ // READ-ONLY; List of Provisioning Issues if any
+ ProvisioningIssues []*ProvisioningIssue
+
+ // READ-ONLY; Provisioning state of Network Security Perimeter configuration propagation
+ ProvisioningState *NetworkSecurityPerimeterConfigurationProvisioningState
+
+ // READ-ONLY; Information about resource association
+ ResourceAssociation *NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation
+}
+
+// NetworkSecurityPerimeterConfigurationPropertiesProfile - Network Security Perimeter profile
+type NetworkSecurityPerimeterConfigurationPropertiesProfile struct {
+ // List of Access Rules
+ AccessRules []*NspAccessRule
+
+ // Current access rules version
+ AccessRulesVersion *float32
+
+ // Diagnostic settings version
+ DiagnosticSettingsVersion *float32
+
+ // Enabled logging categories
+ EnabledLogCategories []*string
+
+ // Name of the resource
+ Name *string
+}
+
+// NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation - Information about resource association
+type NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation struct {
+ // Access Mode of the resource association
+ AccessMode *ResourceAssociationAccessMode
+
+ // Name of the resource association
+ Name *string
+}
+
+// NfsSetting - Setting for NFS protocol
+type NfsSetting struct {
+ // Encryption in transit setting.
+ EncryptionInTransit *EncryptionInTransit
+}
+
+// NspAccessRule - Information of Access Rule in Network Security Perimeter profile
+type NspAccessRule struct {
+ // Name of the resource
+ Name *string
+
+ // READ-ONLY; Properties of Access Rule
+ Properties *NspAccessRuleProperties
+}
+
+// NspAccessRuleProperties - Properties of Access Rule
+type NspAccessRuleProperties struct {
+ // Address prefixes in the CIDR format for inbound rules
+ AddressPrefixes []*string
+
+ // Direction of Access Rule
+ Direction *NspAccessRuleDirection
+
+ // Subscriptions for inbound rules
+ Subscriptions []*NspAccessRulePropertiesSubscriptionsItem
+
+ // READ-ONLY; FQDN for outbound rules
+ FullyQualifiedDomainNames []*string
+
+ // READ-ONLY; NetworkSecurityPerimeters for inbound rules
+ NetworkSecurityPerimeters []*NetworkSecurityPerimeter
+}
+
+// NspAccessRulePropertiesSubscriptionsItem - Subscription for inbound rule
+type NspAccessRulePropertiesSubscriptionsItem struct {
+ // The ARM identifier of subscription
+ ID *string
+}
+
+// ObjectReplicationPolicies - List storage account object replication policies.
+type ObjectReplicationPolicies struct {
+ // The replication policy between two storage accounts.
+ Value []*ObjectReplicationPolicy
+}
+
+// ObjectReplicationPolicy - The replication policy between two storage accounts. Multiple rules can be defined in one policy.
+type ObjectReplicationPolicy struct {
+ // Returns the Storage Account Object Replication Policy.
+ Properties *ObjectReplicationPolicyProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// ObjectReplicationPolicyFilter - Filters limit replication to a subset of blobs within the storage account. A logical OR
+// is performed on values in the filter. If multiple filters are defined, a logical AND is performed on all
+// filters.
+type ObjectReplicationPolicyFilter struct {
+ // Blobs created after the time will be replicated to the destination. It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'.
+ // Example: 2020-02-19T16:05:00Z
+ MinCreationTime *string
+
+ // Optional. Filters the results to replicate only blobs whose names begin with the specified prefix.
+ PrefixMatch []*string
+}
+
+// ObjectReplicationPolicyProperties - The Storage Account ObjectReplicationPolicy properties.
+type ObjectReplicationPolicyProperties struct {
+ // REQUIRED; Required. Destination account name. It should be full resource id if allowCrossTenantReplication set to false.
+ DestinationAccount *string
+
+ // REQUIRED; Required. Source account name. It should be full resource id if allowCrossTenantReplication set to false.
+ SourceAccount *string
+
+ // Optional. The object replication policy metrics feature options.
+ Metrics *ObjectReplicationPolicyPropertiesMetrics
+
+ // The storage account object replication rules.
+ Rules []*ObjectReplicationPolicyRule
+
+ // READ-ONLY; Indicates when the policy is enabled on the source account.
+ EnabledTime *time.Time
+
+ // READ-ONLY; A unique id for object replication policy.
+ PolicyID *string
+}
+
+// ObjectReplicationPolicyPropertiesMetrics - Optional. The object replication policy metrics feature options.
+type ObjectReplicationPolicyPropertiesMetrics struct {
+ // Indicates whether object replication metrics feature is enabled for the policy.
+ Enabled *bool
+}
+
+// ObjectReplicationPolicyRule - The replication policy rule between two containers.
+type ObjectReplicationPolicyRule struct {
+ // REQUIRED; Required. Destination container name.
+ DestinationContainer *string
+
+ // REQUIRED; Required. Source container name.
+ SourceContainer *string
+
+ // Optional. An object that defines the filter set.
+ Filters *ObjectReplicationPolicyFilter
+
+ // Rule Id is auto-generated for each new rule on destination account. It is required for put policy on source account.
+ RuleID *string
+}
+
+// Operation - Storage REST API operation definition.
+type Operation struct {
+ // Display metadata associated with the operation.
+ Display *OperationDisplay
+
+ // Operation name: {provider}/{resource}/{operation}
+ Name *string
+
+ // Properties of operation, include metric specifications.
+ OperationProperties *OperationProperties
+
+ // The origin of operations.
+ Origin *string
+}
+
+// OperationDisplay - Display metadata associated with the operation.
+type OperationDisplay struct {
+ // Description of the operation.
+ Description *string
+
+ // Type of operation: get, read, delete, etc.
+ Operation *string
+
+ // Service provider: Microsoft Storage.
+ Provider *string
+
+ // Resource on which the operation is performed etc.
+ Resource *string
+}
+
+// OperationListResult - Result of the request to list Storage operations. It contains a list of operations and a URL link
+// to get the next set of results.
+type OperationListResult struct {
+ // List of Storage operations supported by the Storage resource provider.
+ Value []*Operation
+}
+
+// OperationProperties - Properties of operation, include metric specifications.
+type OperationProperties struct {
+ // One property of operation, include metric specifications.
+ ServiceSpecification *ServiceSpecification
+}
+
+type PermissionScope struct {
+ // REQUIRED; The permissions for the local user. Possible values include: Read (r), Write (w), Delete (d), List (l), Create
+ // (c), Modify Ownership (o), and Modify Permissions (p).
+ Permissions *string
+
+ // REQUIRED; The name of resource, normally the container name or the file share name, used by the local user.
+ ResourceName *string
+
+ // REQUIRED; The service used by the local user, e.g. blob, file.
+ Service *string
+}
+
+// Placement - The complex type of the zonal placement details.
+type Placement struct {
+ // The availability zone pinning policy for the storage account.
+ ZonePlacementPolicy *ZonePlacementPolicy
+}
+
+// PrivateEndpoint - The Private Endpoint resource.
+type PrivateEndpoint struct {
+ // READ-ONLY; The ARM identifier for Private Endpoint
+ ID *string
+}
+
+// PrivateEndpointConnection - The Private Endpoint Connection resource.
+type PrivateEndpointConnection struct {
+ // Resource properties.
+ Properties *PrivateEndpointConnectionProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// PrivateEndpointConnectionListResult - List of private endpoint connection associated with the specified storage account
+type PrivateEndpointConnectionListResult struct {
+ // Array of private endpoint connections
+ Value []*PrivateEndpointConnection
+}
+
+// PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnectProperties.
+type PrivateEndpointConnectionProperties struct {
+ // REQUIRED; A collection of information about the state of the connection between service consumer and provider.
+ PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState
+
+ // The resource of private end point.
+ PrivateEndpoint *PrivateEndpoint
+
+ // READ-ONLY; The provisioning state of the private endpoint connection resource.
+ ProvisioningState *PrivateEndpointConnectionProvisioningState
+}
+
+// PrivateLinkResource - A private link resource
+type PrivateLinkResource struct {
+ // Resource properties.
+ Properties *PrivateLinkResourceProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// PrivateLinkResourceListResult - A list of private link resources
+type PrivateLinkResourceListResult struct {
+ // Array of private link resources
+ Value []*PrivateLinkResource
+}
+
+// PrivateLinkResourceProperties - Properties of a private link resource.
+type PrivateLinkResourceProperties struct {
+ // The private link resource Private link DNS zone name.
+ RequiredZoneNames []*string
+
+ // READ-ONLY; The private link resource group id.
+ GroupID *string
+
+ // READ-ONLY; The private link resource required member names.
+ RequiredMembers []*string
+}
+
+// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer
+// and provider.
+type PrivateLinkServiceConnectionState struct {
+ // A message indicating if changes on the service provider require any updates on the consumer.
+ ActionRequired *string
+
+ // The reason for approval/rejection of the connection.
+ Description *string
+
+ // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.
+ Status *PrivateEndpointServiceConnectionStatus
+}
+
+// ProtectedAppendWritesHistory - Protected append writes history setting for the blob container with Legal holds.
+type ProtectedAppendWritesHistory struct {
+ // When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance.
+ // Only new blocks can be added and any existing blocks cannot be modified
+ // or deleted.
+ AllowProtectedAppendWritesAll *bool
+
+ // READ-ONLY; Returns the date and time the tag was added.
+ Timestamp *time.Time
+}
+
+// ProtocolSettings - Protocol settings for file service
+type ProtocolSettings struct {
+ // Setting for NFS protocol
+ Nfs *NfsSetting
+
+ // Setting for SMB protocol
+ Smb *SmbSetting
+}
+
+// ProvisioningIssue - Describes provisioning issue for given NetworkSecurityPerimeterConfiguration
+type ProvisioningIssue struct {
+ // Name of the issue
+ Name *string
+
+ // READ-ONLY; Properties of provisioning issue
+ Properties *ProvisioningIssueProperties
+}
+
+// ProvisioningIssueProperties - Properties of provisioning issue
+type ProvisioningIssueProperties struct {
+ // Description of the issue
+ Description *string
+
+ // Type of issue
+ IssueType *IssueType
+
+ // Severity of the issue.
+ Severity *Severity
+}
+
+// ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a
+// location
+type ProxyResource struct {
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// ProxyResourceAutoGenerated - The resource model definition for a Azure Resource Manager proxy resource. It will not have
+// tags and a location
+type ProxyResourceAutoGenerated struct {
+ // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ SystemData *SystemData
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+type Queue struct {
+ // Queue resource properties.
+ QueueProperties *QueueProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+type QueueProperties struct {
+ // A name-value pair that represents queue metadata.
+ Metadata map[string]*string
+
+ // READ-ONLY; Integer indicating an approximate number of messages in the queue. This number is not lower than the actual
+ // number of messages in the queue, but could be higher.
+ ApproximateMessageCount *int32
+}
+
+// QueueServiceProperties - The properties of a storage account’s Queue service.
+type QueueServiceProperties struct {
+ // The properties of a storage account’s Queue service.
+ QueueServiceProperties *QueueServicePropertiesProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// QueueServicePropertiesProperties - The properties of a storage account’s Queue service.
+type QueueServicePropertiesProperties struct {
+ // Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule
+ // elements are included in the request body, all CORS rules will be deleted, and
+ // CORS will be disabled for the Queue service.
+ Cors *CorsRules
+}
+
+// Resource - Common fields that are returned in the response for all Azure Resource Manager resources
+type Resource struct {
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// ResourceAccessRule - Resource Access Rule.
+type ResourceAccessRule struct {
+ // Resource Id
+ ResourceID *string
+
+ // Tenant Id
+ TenantID *string
+}
+
+// ResourceAutoGenerated - Common fields that are returned in the response for all Azure Resource Manager resources
+type ResourceAutoGenerated struct {
+ // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ SystemData *SystemData
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// RestorePolicyProperties - The blob service properties for blob restore policy
+type RestorePolicyProperties struct {
+ // REQUIRED; Blob restore is enabled if set to true.
+ Enabled *bool
+
+ // how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days.
+ Days *int32
+
+ // READ-ONLY; Deprecated in favor of minRestoreTime property.
+ LastEnabledTime *time.Time
+
+ // READ-ONLY; Returns the minimum date and time that the restore can be started.
+ MinRestoreTime *time.Time
+}
+
+// Restriction - The restriction because of which SKU cannot be used.
+type Restriction struct {
+ // The reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when
+ // the SKU has requiredQuotas parameter as the subscription does not belong to that
+ // quota. The "NotAvailableForSubscription" is related to capacity at DC.
+ ReasonCode *ReasonCode
+
+ // READ-ONLY; The type of restrictions. As of now only possible value for this is location.
+ Type *string
+
+ // READ-ONLY; The value of restrictions. If the restriction type is set to location. This would be different locations where
+ // the SKU is restricted.
+ Values []*string
+}
+
+// RoutingPreference - Routing preference defines the type of network, either microsoft or internet routing to be used to
+// deliver the user data, the default option is microsoft routing
+type RoutingPreference struct {
+ // A boolean flag which indicates whether internet routing storage endpoints are to be published
+ PublishInternetEndpoints *bool
+
+ // A boolean flag which indicates whether microsoft routing storage endpoints are to be published
+ PublishMicrosoftEndpoints *bool
+
+ // Routing Choice defines the kind of network routing opted by the user.
+ RoutingChoice *RoutingChoice
+}
+
+// SKU - The SKU of the storage account.
+type SKU struct {
+ // REQUIRED; The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called
+ // accountType.
+ Name *SKUName
+
+ // READ-ONLY; The SKU tier. This is based on the SKU name.
+ Tier *SKUTier
+}
+
+// SKUCapability - The capability information in the specified SKU, including file encryption, network ACLs, change notification,
+// etc.
+type SKUCapability struct {
+ // READ-ONLY; The name of capability, The capability information in the specified SKU, including file encryption, network
+ // ACLs, change notification, etc.
+ Name *string
+
+ // READ-ONLY; A string value to indicate states of given capability. Possibly 'true' or 'false'.
+ Value *string
+}
+
+// SKUInformation - Storage SKU and its properties
+type SKUInformation struct {
+ // REQUIRED; The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called
+ // accountType.
+ Name *SKUName
+ LocationInfo []*SKUInformationLocationInfoItem
+
+ // The restrictions because of which SKU cannot be used. This is empty if there are no restrictions.
+ Restrictions []*Restriction
+
+ // READ-ONLY; The capability information in the specified SKU, including file encryption, network ACLs, change notification,
+ // etc.
+ Capabilities []*SKUCapability
+
+ // READ-ONLY; Indicates the type of storage account.
+ Kind *Kind
+
+ // READ-ONLY; The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g.
+ // West US, East US, Southeast Asia, etc.).
+ Locations []*string
+
+ // READ-ONLY; The type of the resource, usually it is 'storageAccounts'.
+ ResourceType *string
+
+ // READ-ONLY; The SKU tier. This is based on the SKU name.
+ Tier *SKUTier
+}
+
+type SKUInformationLocationInfoItem struct {
+ // READ-ONLY; Describes the location for the product where storage account resource can be created.
+ Location *string
+
+ // READ-ONLY; Describes the available zones for the product where storage account resource can be created.
+ Zones []*string
+}
+
+// SKUListResult - The response from the List Storage SKUs operation.
+type SKUListResult struct {
+ // READ-ONLY; Get the list result of storage SKUs and their properties.
+ Value []*SKUInformation
+}
+
+type SSHPublicKey struct {
+ // Optional. It is used to store the function/usage of the key
+ Description *string
+
+ // Ssh public key base64 encoded. The format should be: ' ', e.g. ssh-rsa AAAABBBB
+ Key *string
+}
+
+// SasPolicy assigned to the storage account.
+type SasPolicy struct {
+ // REQUIRED; The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated.
+ // The 'Log' action can be used for audit purposes and the 'Block' action can be used to block
+ // and deny the usage of SAS tokens that do not adhere to the sas policy expiration period.
+ ExpirationAction *ExpirationAction
+
+ // REQUIRED; The SAS expiration period, DD.HH:MM:SS.
+ SasExpirationPeriod *string
+}
+
+// ServiceSasParameters - The parameters to list service SAS credentials of a specific resource.
+type ServiceSasParameters struct {
+ // REQUIRED; The canonical path to the signed resource.
+ CanonicalizedResource *string
+
+ // The response header override for cache control.
+ CacheControl *string
+
+ // The response header override for content disposition.
+ ContentDisposition *string
+
+ // The response header override for content encoding.
+ ContentEncoding *string
+
+ // The response header override for content language.
+ ContentLanguage *string
+
+ // The response header override for content type.
+ ContentType *string
+
+ // An IP address or a range of IP addresses from which to accept requests.
+ IPAddressOrRange *string
+
+ // A unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or
+ // table.
+ Identifier *string
+
+ // The key to sign the account SAS token with.
+ KeyToSign *string
+
+ // The end of partition key.
+ PartitionKeyEnd *string
+
+ // The start of partition key.
+ PartitionKeyStart *string
+
+ // The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a),
+ // Create (c), Update (u) and Process (p).
+ Permissions *Permissions
+
+ // The protocol permitted for a request made with the account SAS.
+ Protocols *HTTPProtocol
+
+ // The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share
+ // (s).
+ Resource *SignedResource
+
+ // The end of row key.
+ RowKeyEnd *string
+
+ // The start of row key.
+ RowKeyStart *string
+
+ // The time at which the shared access signature becomes invalid.
+ SharedAccessExpiryTime *time.Time
+
+ // The time at which the SAS becomes valid.
+ SharedAccessStartTime *time.Time
+}
+
+// ServiceSpecification - One property of operation, include metric specifications.
+type ServiceSpecification struct {
+ // Metric specifications of operation.
+ MetricSpecifications []*MetricSpecification
+}
+
+type SignedIdentifier struct {
+ // Access policy
+ AccessPolicy *AccessPolicy
+
+ // An unique identifier of the stored access policy.
+ ID *string
+}
+
+// SmbOAuthSettings - Setting property for Managed Identity access over SMB using OAuth
+type SmbOAuthSettings struct {
+ // Specifies if managed identities can access SMB shares using OAuth. The default interpretation is false for this property.
+ IsSmbOAuthEnabled *bool
+}
+
+// SmbSetting - Setting for SMB protocol
+type SmbSetting struct {
+ // SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. Should be passed as a string with delimiter
+ // ';'.
+ AuthenticationMethods *string
+
+ // SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be passed as
+ // a string with delimiter ';'.
+ ChannelEncryption *string
+
+ // Encryption in transit setting.
+ EncryptionInTransit *EncryptionInTransit
+
+ // Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. Should be passed as a string with delimiter
+ // ';'
+ KerberosTicketEncryption *string
+
+ // Multichannel setting. Applies to Premium FileStorage only.
+ Multichannel *Multichannel
+
+ // SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. Should be passed as a string with
+ // delimiter ';'.
+ Versions *string
+}
+
+// SystemData - Metadata pertaining to creation and last modification of the resource.
+type SystemData struct {
+ // The timestamp of resource creation (UTC).
+ CreatedAt *time.Time
+
+ // The identity that created the resource.
+ CreatedBy *string
+
+ // The type of identity that created the resource.
+ CreatedByType *CreatedByType
+
+ // The timestamp of resource last modification (UTC)
+ LastModifiedAt *time.Time
+
+ // The identity that last modified the resource.
+ LastModifiedBy *string
+
+ // The type of identity that last modified the resource.
+ LastModifiedByType *CreatedByType
+}
+
+// Table - Properties of the table, including Id, resource name, resource type.
+type Table struct {
+ // Table resource properties.
+ TableProperties *TableProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// TableAccessPolicy - Table Access Policy Properties Object.
+type TableAccessPolicy struct {
+ // REQUIRED; Required. List of abbreviated permissions. Supported permission values include 'r','a','u','d'
+ Permission *string
+
+ // Expiry time of the access policy
+ ExpiryTime *time.Time
+
+ // Start time of the access policy
+ StartTime *time.Time
+}
+
+type TableProperties struct {
+ // List of stored access policies specified on the table.
+ SignedIdentifiers []*TableSignedIdentifier
+
+ // READ-ONLY; Table name under the specified account
+ TableName *string
+}
+
+// TableServiceProperties - The properties of a storage account’s Table service.
+type TableServiceProperties struct {
+ // The properties of a storage account’s Table service.
+ TableServiceProperties *TableServicePropertiesProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// TableServicePropertiesProperties - The properties of a storage account’s Table service.
+type TableServicePropertiesProperties struct {
+ // Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule
+ // elements are included in the request body, all CORS rules will be deleted, and
+ // CORS will be disabled for the Table service.
+ Cors *CorsRules
+}
+
+// TableSignedIdentifier - Object to set Table Access Policy.
+type TableSignedIdentifier struct {
+ // REQUIRED; unique-64-character-value of the stored access policy.
+ ID *string
+
+ // Access policy
+ AccessPolicy *TableAccessPolicy
+}
+
+// TagFilter - Blob index tag based filtering for blob objects
+type TagFilter struct {
+ // REQUIRED; This is the filter tag name, it can have 1 - 128 characters
+ Name *string
+
+ // REQUIRED; This is the comparison operator which is used for object comparison and filtering. Only == (equality operator)
+ // is currently supported
+ Op *string
+
+ // REQUIRED; This is the filter tag value field used for tag based filtering, it can have 0 - 256 characters
+ Value *string
+}
+
+// TagProperty - A tag of the LegalHold of a blob container.
+type TagProperty struct {
+ // READ-ONLY; Returns the Object ID of the user who added the tag.
+ ObjectIdentifier *string
+
+ // READ-ONLY; The tag value.
+ Tag *string
+
+ // READ-ONLY; Returns the Tenant ID that issued the token for the user who added the tag.
+ TenantID *string
+
+ // READ-ONLY; Returns the date and time the tag was added.
+ Timestamp *time.Time
+
+ // READ-ONLY; Returns the User Principal Name of the user who added the tag.
+ Upn *string
+}
+
+// TaskAssignment - The storage task assignment.
+type TaskAssignment struct {
+ // REQUIRED; Properties of the storage task assignment.
+ Properties *TaskAssignmentProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// TaskAssignmentExecutionContext - Execution context of the storage task assignment.
+type TaskAssignmentExecutionContext struct {
+ // REQUIRED; Execution trigger of the storage task assignment
+ Trigger *ExecutionTrigger
+
+ // Execution target of the storage task assignment
+ Target *ExecutionTarget
+}
+
+// TaskAssignmentProperties - Properties of the storage task assignment.
+type TaskAssignmentProperties struct {
+ // REQUIRED; Text that describes the purpose of the storage task assignment
+ Description *string
+
+ // REQUIRED; Whether the storage task assignment is enabled or not
+ Enabled *bool
+
+ // REQUIRED; The storage task assignment execution context
+ ExecutionContext *TaskAssignmentExecutionContext
+
+ // REQUIRED; The storage task assignment report
+ Report *TaskAssignmentReport
+
+ // REQUIRED; Id of the corresponding storage task
+ TaskID *string
+
+ // Run status of storage task assignment
+ RunStatus *TaskReportProperties
+
+ // READ-ONLY; Represents the provisioning state of the storage task assignment.
+ ProvisioningState *ProvisioningState
+}
+
+// TaskAssignmentReport - The storage task assignment report
+type TaskAssignmentReport struct {
+ // REQUIRED; The container prefix for the location of storage task assignment report
+ Prefix *string
+}
+
+// TaskAssignmentUpdateExecutionContext - Execution context of the storage task assignment update.
+type TaskAssignmentUpdateExecutionContext struct {
+ // Execution target of the storage task assignment
+ Target *ExecutionTarget
+
+ // Execution trigger of the storage task assignment
+ Trigger *ExecutionTriggerUpdate
+}
+
+// TaskAssignmentUpdateParameters - Parameters of the storage task assignment update request
+type TaskAssignmentUpdateParameters struct {
+ // Properties of the storage task assignment.
+ Properties *TaskAssignmentUpdateProperties
+}
+
+// TaskAssignmentUpdateProperties - Properties of the storage task update assignment.
+type TaskAssignmentUpdateProperties struct {
+ // Text that describes the purpose of the storage task assignment
+ Description *string
+
+ // Whether the storage task assignment is enabled or not
+ Enabled *bool
+
+ // The storage task assignment execution context
+ ExecutionContext *TaskAssignmentUpdateExecutionContext
+
+ // The storage task assignment report
+ Report *TaskAssignmentUpdateReport
+
+ // Run status of storage task assignment
+ RunStatus *TaskReportProperties
+
+ // READ-ONLY; Represents the provisioning state of the storage task assignment.
+ ProvisioningState *ProvisioningState
+
+ // READ-ONLY; Id of the corresponding storage task
+ TaskID *string
+}
+
+// TaskAssignmentUpdateReport - The storage task assignment report
+type TaskAssignmentUpdateReport struct {
+ // The prefix of the storage task assignment report
+ Prefix *string
+}
+
+// TaskAssignmentsList - List of storage task assignments for the storage account
+type TaskAssignmentsList struct {
+ // READ-ONLY; Request URL that can be used to query next page of storage task assignments. Returned when total number of requested
+ // storage task assignments exceed maximum page size.
+ NextLink *string
+
+ // READ-ONLY; Gets the list of storage task assignments and their properties.
+ Value []*TaskAssignment
+}
+
+// TaskReportInstance - Storage Tasks run report instance
+type TaskReportInstance struct {
+ // Storage task execution report for a run instance.
+ Properties *TaskReportProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// TaskReportProperties - Storage task execution report for a run instance.
+type TaskReportProperties struct {
+ // READ-ONLY; End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison
+ // operators can be used as described for DateTime properties in
+ // https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators
+ FinishTime *string
+
+ // READ-ONLY; Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount
+ // eq 0 and other comparison operators can be used as described for Numerical properties
+ // in https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators
+ ObjectFailedCount *string
+
+ // READ-ONLY; Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as
+ // objectsOperatedOnCount ge 100 and other comparison operators can be used as described for
+ // Numerical properties in https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators
+ ObjectsOperatedOnCount *string
+
+ // READ-ONLY; Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount
+ // gt 150 and other comparison operators can be used as described for Numerical
+ // properties in https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators
+ ObjectsSucceededCount *string
+
+ // READ-ONLY; Total number of objects that meet the condition as defined in the storage task assignment execution context.
+ // Filter options such as objectsTargetedCount gt 50 and other comparison operators can be
+ // used as described for Numerical properties in https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators
+ ObjectsTargetedCount *string
+
+ // READ-ONLY; Represents the overall result of the execution for the run instance
+ RunResult *RunResult
+
+ // READ-ONLY; Represents the status of the execution.
+ RunStatusEnum *RunStatusEnum
+
+ // READ-ONLY; Well known Azure Storage error code that represents the error encountered during execution of the run instance.
+ RunStatusError *string
+
+ // READ-ONLY; Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other
+ // comparison operators can be used as described for DateTime properties in
+ // https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators
+ StartTime *string
+
+ // READ-ONLY; Represents the Storage Account Id where the storage task definition was applied and executed.
+ StorageAccountID *string
+
+ // READ-ONLY; Full path to the verbose report stored in the reporting container as specified in the assignment execution context
+ // for the storage account.
+ SummaryReportPath *string
+
+ // READ-ONLY; Represents the Storage Task Assignment Id associated with the storage task that provided an execution context.
+ TaskAssignmentID *string
+
+ // READ-ONLY; Storage Task Arm Id.
+ TaskID *string
+
+ // READ-ONLY; Storage Task Version
+ TaskVersion *string
+}
+
+// TaskReportSummary - Fetch Storage Tasks Run Summary.
+type TaskReportSummary struct {
+ // READ-ONLY; Request URL that can be used to query next page of storage task run results summary. Returned when the number
+ // of run instances and summary reports exceed maximum page size.
+ NextLink *string
+
+ // READ-ONLY; Gets storage tasks run result summary.
+ Value []*TaskReportInstance
+}
+
+// TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags'
+// and a 'location'
+type TrackedResource struct {
+ // REQUIRED; The geo-location where the resource lives
+ Location *string
+
+ // Resource tags.
+ Tags map[string]*string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// TriggerParameters - The trigger parameters update for the storage task assignment execution
+type TriggerParameters struct {
+ // When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property
+ // should not be present when ExecutionTrigger.properties.type is 'RunOnce'
+ EndBy *time.Time
+
+ // Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property
+ // should not be present when ExecutionTrigger.properties.type is 'RunOnce'
+ Interval *int32
+
+ // Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this
+ // property should not be present when ExecutionTrigger.properties.type is
+ // 'RunOnce'
+ IntervalUnit *IntervalUnit
+
+ // When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property
+ // should not be present when ExecutionTrigger.properties.type is 'RunOnce'
+ StartFrom *time.Time
+
+ // When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'RunOnce'; this property
+ // should not be present when ExecutionTrigger.properties.type is 'OnSchedule'
+ StartOn *time.Time
+}
+
+// TriggerParametersUpdate - The trigger parameters update for the storage task assignment execution
+type TriggerParametersUpdate struct {
+ // When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property
+ // should not be present when ExecutionTrigger.properties.type is 'RunOnce'
+ EndBy *time.Time
+
+ // Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property
+ // should not be present when ExecutionTrigger.properties.type is 'RunOnce'
+ Interval *int32
+
+ // Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this
+ // property should not be present when ExecutionTrigger.properties.type is
+ // 'RunOnce'
+ IntervalUnit *IntervalUnit
+
+ // When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property
+ // should not be present when ExecutionTrigger.properties.type is 'RunOnce'
+ StartFrom *time.Time
+
+ // When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this property
+ // should not be present when ExecutionTrigger.properties.type is 'OnSchedule'
+ StartOn *time.Time
+}
+
+// UpdateHistoryProperty - An update history of the ImmutabilityPolicy of a blob container.
+type UpdateHistoryProperty struct {
+ // This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to
+ // an append blob while maintaining immutability protection and compliance. Only
+ // new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy
+ // API.
+ AllowProtectedAppendWrites *bool
+
+ // This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to
+ // both 'Append and Bock Blobs' while maintaining immutability protection and
+ // compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be
+ // changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and
+ // 'allowProtectedAppendWritesAll' properties are mutually exclusive.
+ AllowProtectedAppendWritesAll *bool
+
+ // READ-ONLY; The immutability period for the blobs in the container since the policy creation, in days.
+ ImmutabilityPeriodSinceCreationInDays *int32
+
+ // READ-ONLY; Returns the Object ID of the user who updated the ImmutabilityPolicy.
+ ObjectIdentifier *string
+
+ // READ-ONLY; Returns the Tenant ID that issued the token for the user who updated the ImmutabilityPolicy.
+ TenantID *string
+
+ // READ-ONLY; Returns the date and time the ImmutabilityPolicy was updated.
+ Timestamp *time.Time
+
+ // READ-ONLY; The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend.
+ Update *ImmutabilityPolicyUpdateType
+
+ // READ-ONLY; Returns the User Principal Name of the user who updated the ImmutabilityPolicy.
+ Upn *string
+}
+
+// Usage - Describes Storage Resource Usage.
+type Usage struct {
+ // READ-ONLY; Gets the current count of the allocated resources in the subscription.
+ CurrentValue *int32
+
+ // READ-ONLY; Gets the maximum count of the resources that can be allocated in the subscription.
+ Limit *int32
+
+ // READ-ONLY; Gets the name of the type of usage.
+ Name *UsageName
+
+ // READ-ONLY; Gets the unit of measurement.
+ Unit *UsageUnit
+}
+
+// UsageListResult - The response from the List Usages operation.
+type UsageListResult struct {
+ // Gets or sets the list of Storage Resource Usages.
+ Value []*Usage
+}
+
+// UsageName - The usage names that can be used; currently limited to StorageAccount.
+type UsageName struct {
+ // READ-ONLY; Gets a localized string describing the resource name.
+ LocalizedValue *string
+
+ // READ-ONLY; Gets a string describing the resource name.
+ Value *string
+}
+
+// UserAssignedIdentity for the resource.
+type UserAssignedIdentity struct {
+ // READ-ONLY; The client ID of the identity.
+ ClientID *string
+
+ // READ-ONLY; The principal ID of the identity.
+ PrincipalID *string
+}
+
+// VirtualNetworkRule - Virtual Network rule.
+type VirtualNetworkRule struct {
+ // CONSTANT; The action of virtual network rule.
+ // Field has constant value "Allow", any specified value is ignored.
+ Action *string
+
+ // REQUIRED; Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}.
+ VirtualNetworkResourceID *string
+
+ // Gets the state of virtual network rule.
+ State *State
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/models_serde.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/models_serde.go
new file mode 100644
index 0000000000..c6ba017ac7
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/models_serde.go
@@ -0,0 +1,8720 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "encoding/json"
+ "fmt"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "reflect"
+)
+
+// MarshalJSON implements the json.Marshaller interface for type AccessPolicy.
+func (a AccessPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "expiryTime", a.ExpiryTime)
+ populate(objectMap, "permission", a.Permission)
+ populateDateTimeRFC3339(objectMap, "startTime", a.StartTime)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccessPolicy.
+func (a *AccessPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "expiryTime":
+ err = unpopulateDateTimeRFC3339(val, "ExpiryTime", &a.ExpiryTime)
+ delete(rawMsg, key)
+ case "permission":
+ err = unpopulate(val, "Permission", &a.Permission)
+ delete(rawMsg, key)
+ case "startTime":
+ err = unpopulateDateTimeRFC3339(val, "StartTime", &a.StartTime)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Account.
+func (a Account) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "extendedLocation", a.ExtendedLocation)
+ populate(objectMap, "id", a.ID)
+ populate(objectMap, "identity", a.Identity)
+ populate(objectMap, "kind", a.Kind)
+ populate(objectMap, "location", a.Location)
+ populate(objectMap, "name", a.Name)
+ populate(objectMap, "placement", a.Placement)
+ populate(objectMap, "properties", a.Properties)
+ populate(objectMap, "sku", a.SKU)
+ populate(objectMap, "tags", a.Tags)
+ populate(objectMap, "type", a.Type)
+ populate(objectMap, "zones", a.Zones)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Account.
+func (a *Account) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "extendedLocation":
+ err = unpopulate(val, "ExtendedLocation", &a.ExtendedLocation)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &a.ID)
+ delete(rawMsg, key)
+ case "identity":
+ err = unpopulate(val, "Identity", &a.Identity)
+ delete(rawMsg, key)
+ case "kind":
+ err = unpopulate(val, "Kind", &a.Kind)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &a.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &a.Name)
+ delete(rawMsg, key)
+ case "placement":
+ err = unpopulate(val, "Placement", &a.Placement)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &a.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &a.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &a.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &a.Type)
+ delete(rawMsg, key)
+ case "zones":
+ err = unpopulate(val, "Zones", &a.Zones)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountCheckNameAvailabilityParameters.
+func (a AccountCheckNameAvailabilityParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", a.Name)
+ objectMap["type"] = "Microsoft.Storage/storageAccounts"
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountCheckNameAvailabilityParameters.
+func (a *AccountCheckNameAvailabilityParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &a.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &a.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountCreateParameters.
+func (a AccountCreateParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "extendedLocation", a.ExtendedLocation)
+ populate(objectMap, "identity", a.Identity)
+ populate(objectMap, "kind", a.Kind)
+ populate(objectMap, "location", a.Location)
+ populate(objectMap, "placement", a.Placement)
+ populate(objectMap, "properties", a.Properties)
+ populate(objectMap, "sku", a.SKU)
+ populate(objectMap, "tags", a.Tags)
+ populate(objectMap, "zones", a.Zones)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountCreateParameters.
+func (a *AccountCreateParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "extendedLocation":
+ err = unpopulate(val, "ExtendedLocation", &a.ExtendedLocation)
+ delete(rawMsg, key)
+ case "identity":
+ err = unpopulate(val, "Identity", &a.Identity)
+ delete(rawMsg, key)
+ case "kind":
+ err = unpopulate(val, "Kind", &a.Kind)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &a.Location)
+ delete(rawMsg, key)
+ case "placement":
+ err = unpopulate(val, "Placement", &a.Placement)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &a.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &a.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &a.Tags)
+ delete(rawMsg, key)
+ case "zones":
+ err = unpopulate(val, "Zones", &a.Zones)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountIPv6Endpoints.
+func (a AccountIPv6Endpoints) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blob", a.Blob)
+ populate(objectMap, "dfs", a.Dfs)
+ populate(objectMap, "file", a.File)
+ populate(objectMap, "internetEndpoints", a.InternetEndpoints)
+ populate(objectMap, "microsoftEndpoints", a.MicrosoftEndpoints)
+ populate(objectMap, "queue", a.Queue)
+ populate(objectMap, "table", a.Table)
+ populate(objectMap, "web", a.Web)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountIPv6Endpoints.
+func (a *AccountIPv6Endpoints) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blob":
+ err = unpopulate(val, "Blob", &a.Blob)
+ delete(rawMsg, key)
+ case "dfs":
+ err = unpopulate(val, "Dfs", &a.Dfs)
+ delete(rawMsg, key)
+ case "file":
+ err = unpopulate(val, "File", &a.File)
+ delete(rawMsg, key)
+ case "internetEndpoints":
+ err = unpopulate(val, "InternetEndpoints", &a.InternetEndpoints)
+ delete(rawMsg, key)
+ case "microsoftEndpoints":
+ err = unpopulate(val, "MicrosoftEndpoints", &a.MicrosoftEndpoints)
+ delete(rawMsg, key)
+ case "queue":
+ err = unpopulate(val, "Queue", &a.Queue)
+ delete(rawMsg, key)
+ case "table":
+ err = unpopulate(val, "Table", &a.Table)
+ delete(rawMsg, key)
+ case "web":
+ err = unpopulate(val, "Web", &a.Web)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountImmutabilityPolicyProperties.
+func (a AccountImmutabilityPolicyProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "allowProtectedAppendWrites", a.AllowProtectedAppendWrites)
+ populate(objectMap, "immutabilityPeriodSinceCreationInDays", a.ImmutabilityPeriodSinceCreationInDays)
+ populate(objectMap, "state", a.State)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountImmutabilityPolicyProperties.
+func (a *AccountImmutabilityPolicyProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "allowProtectedAppendWrites":
+ err = unpopulate(val, "AllowProtectedAppendWrites", &a.AllowProtectedAppendWrites)
+ delete(rawMsg, key)
+ case "immutabilityPeriodSinceCreationInDays":
+ err = unpopulate(val, "ImmutabilityPeriodSinceCreationInDays", &a.ImmutabilityPeriodSinceCreationInDays)
+ delete(rawMsg, key)
+ case "state":
+ err = unpopulate(val, "State", &a.State)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountInternetEndpoints.
+func (a AccountInternetEndpoints) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blob", a.Blob)
+ populate(objectMap, "dfs", a.Dfs)
+ populate(objectMap, "file", a.File)
+ populate(objectMap, "web", a.Web)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountInternetEndpoints.
+func (a *AccountInternetEndpoints) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blob":
+ err = unpopulate(val, "Blob", &a.Blob)
+ delete(rawMsg, key)
+ case "dfs":
+ err = unpopulate(val, "Dfs", &a.Dfs)
+ delete(rawMsg, key)
+ case "file":
+ err = unpopulate(val, "File", &a.File)
+ delete(rawMsg, key)
+ case "web":
+ err = unpopulate(val, "Web", &a.Web)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountKey.
+func (a AccountKey) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "creationTime", a.CreationTime)
+ populate(objectMap, "keyName", a.KeyName)
+ populate(objectMap, "permissions", a.Permissions)
+ populate(objectMap, "value", a.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountKey.
+func (a *AccountKey) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "creationTime":
+ err = unpopulateDateTimeRFC3339(val, "CreationTime", &a.CreationTime)
+ delete(rawMsg, key)
+ case "keyName":
+ err = unpopulate(val, "KeyName", &a.KeyName)
+ delete(rawMsg, key)
+ case "permissions":
+ err = unpopulate(val, "Permissions", &a.Permissions)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &a.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountLimits.
+func (a AccountLimits) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "maxFileShares", a.MaxFileShares)
+ populate(objectMap, "maxProvisionedBandwidthMiBPerSec", a.MaxProvisionedBandwidthMiBPerSec)
+ populate(objectMap, "maxProvisionedIOPS", a.MaxProvisionedIOPS)
+ populate(objectMap, "maxProvisionedStorageGiB", a.MaxProvisionedStorageGiB)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountLimits.
+func (a *AccountLimits) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "maxFileShares":
+ err = unpopulate(val, "MaxFileShares", &a.MaxFileShares)
+ delete(rawMsg, key)
+ case "maxProvisionedBandwidthMiBPerSec":
+ err = unpopulate(val, "MaxProvisionedBandwidthMiBPerSec", &a.MaxProvisionedBandwidthMiBPerSec)
+ delete(rawMsg, key)
+ case "maxProvisionedIOPS":
+ err = unpopulate(val, "MaxProvisionedIOPS", &a.MaxProvisionedIOPS)
+ delete(rawMsg, key)
+ case "maxProvisionedStorageGiB":
+ err = unpopulate(val, "MaxProvisionedStorageGiB", &a.MaxProvisionedStorageGiB)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountListKeysResult.
+func (a AccountListKeysResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "keys", a.Keys)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountListKeysResult.
+func (a *AccountListKeysResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "keys":
+ err = unpopulate(val, "Keys", &a.Keys)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountListResult.
+func (a AccountListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", a.NextLink)
+ populate(objectMap, "value", a.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountListResult.
+func (a *AccountListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &a.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &a.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountMicrosoftEndpoints.
+func (a AccountMicrosoftEndpoints) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blob", a.Blob)
+ populate(objectMap, "dfs", a.Dfs)
+ populate(objectMap, "file", a.File)
+ populate(objectMap, "queue", a.Queue)
+ populate(objectMap, "table", a.Table)
+ populate(objectMap, "web", a.Web)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountMicrosoftEndpoints.
+func (a *AccountMicrosoftEndpoints) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blob":
+ err = unpopulate(val, "Blob", &a.Blob)
+ delete(rawMsg, key)
+ case "dfs":
+ err = unpopulate(val, "Dfs", &a.Dfs)
+ delete(rawMsg, key)
+ case "file":
+ err = unpopulate(val, "File", &a.File)
+ delete(rawMsg, key)
+ case "queue":
+ err = unpopulate(val, "Queue", &a.Queue)
+ delete(rawMsg, key)
+ case "table":
+ err = unpopulate(val, "Table", &a.Table)
+ delete(rawMsg, key)
+ case "web":
+ err = unpopulate(val, "Web", &a.Web)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountMigration.
+func (a AccountMigration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", a.ID)
+ populate(objectMap, "name", a.Name)
+ populate(objectMap, "properties", a.StorageAccountMigrationDetails)
+ populate(objectMap, "type", a.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountMigration.
+func (a *AccountMigration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &a.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &a.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "StorageAccountMigrationDetails", &a.StorageAccountMigrationDetails)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &a.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountMigrationProperties.
+func (a AccountMigrationProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "migrationFailedDetailedReason", a.MigrationFailedDetailedReason)
+ populate(objectMap, "migrationFailedReason", a.MigrationFailedReason)
+ populate(objectMap, "migrationStatus", a.MigrationStatus)
+ populate(objectMap, "targetSkuName", a.TargetSKUName)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountMigrationProperties.
+func (a *AccountMigrationProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "migrationFailedDetailedReason":
+ err = unpopulate(val, "MigrationFailedDetailedReason", &a.MigrationFailedDetailedReason)
+ delete(rawMsg, key)
+ case "migrationFailedReason":
+ err = unpopulate(val, "MigrationFailedReason", &a.MigrationFailedReason)
+ delete(rawMsg, key)
+ case "migrationStatus":
+ err = unpopulate(val, "MigrationStatus", &a.MigrationStatus)
+ delete(rawMsg, key)
+ case "targetSkuName":
+ err = unpopulate(val, "TargetSKUName", &a.TargetSKUName)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountProperties.
+func (a AccountProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "accessTier", a.AccessTier)
+ populate(objectMap, "accountMigrationInProgress", a.AccountMigrationInProgress)
+ populate(objectMap, "allowBlobPublicAccess", a.AllowBlobPublicAccess)
+ populate(objectMap, "allowCrossTenantReplication", a.AllowCrossTenantReplication)
+ populate(objectMap, "allowSharedKeyAccess", a.AllowSharedKeyAccess)
+ populate(objectMap, "allowedCopyScope", a.AllowedCopyScope)
+ populate(objectMap, "azureFilesIdentityBasedAuthentication", a.AzureFilesIdentityBasedAuthentication)
+ populate(objectMap, "blobRestoreStatus", a.BlobRestoreStatus)
+ populateDateTimeRFC3339(objectMap, "creationTime", a.CreationTime)
+ populate(objectMap, "customDomain", a.CustomDomain)
+ populate(objectMap, "dnsEndpointType", a.DNSEndpointType)
+ populate(objectMap, "defaultToOAuthAuthentication", a.DefaultToOAuthAuthentication)
+ populate(objectMap, "dualStackEndpointPreference", a.DualStackEndpointPreference)
+ populate(objectMap, "enableExtendedGroups", a.EnableExtendedGroups)
+ populate(objectMap, "supportsHttpsTrafficOnly", a.EnableHTTPSTrafficOnly)
+ populate(objectMap, "isNfsV3Enabled", a.EnableNfsV3)
+ populate(objectMap, "encryption", a.Encryption)
+ populate(objectMap, "failoverInProgress", a.FailoverInProgress)
+ populate(objectMap, "geoReplicationStats", a.GeoReplicationStats)
+ populate(objectMap, "immutableStorageWithVersioning", a.ImmutableStorageWithVersioning)
+ populate(objectMap, "isHnsEnabled", a.IsHnsEnabled)
+ populate(objectMap, "isLocalUserEnabled", a.IsLocalUserEnabled)
+ populate(objectMap, "isSkuConversionBlocked", a.IsSKUConversionBlocked)
+ populate(objectMap, "isSftpEnabled", a.IsSftpEnabled)
+ populate(objectMap, "keyCreationTime", a.KeyCreationTime)
+ populate(objectMap, "keyPolicy", a.KeyPolicy)
+ populate(objectMap, "largeFileSharesState", a.LargeFileSharesState)
+ populateDateTimeRFC3339(objectMap, "lastGeoFailoverTime", a.LastGeoFailoverTime)
+ populate(objectMap, "minimumTlsVersion", a.MinimumTLSVersion)
+ populate(objectMap, "networkAcls", a.NetworkRuleSet)
+ populate(objectMap, "primaryEndpoints", a.PrimaryEndpoints)
+ populate(objectMap, "primaryLocation", a.PrimaryLocation)
+ populate(objectMap, "privateEndpointConnections", a.PrivateEndpointConnections)
+ populate(objectMap, "provisioningState", a.ProvisioningState)
+ populate(objectMap, "publicNetworkAccess", a.PublicNetworkAccess)
+ populate(objectMap, "routingPreference", a.RoutingPreference)
+ populate(objectMap, "sasPolicy", a.SasPolicy)
+ populate(objectMap, "secondaryEndpoints", a.SecondaryEndpoints)
+ populate(objectMap, "secondaryLocation", a.SecondaryLocation)
+ populate(objectMap, "statusOfPrimary", a.StatusOfPrimary)
+ populate(objectMap, "statusOfSecondary", a.StatusOfSecondary)
+ populate(objectMap, "storageAccountSkuConversionStatus", a.StorageAccountSKUConversionStatus)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountProperties.
+func (a *AccountProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "accessTier":
+ err = unpopulate(val, "AccessTier", &a.AccessTier)
+ delete(rawMsg, key)
+ case "accountMigrationInProgress":
+ err = unpopulate(val, "AccountMigrationInProgress", &a.AccountMigrationInProgress)
+ delete(rawMsg, key)
+ case "allowBlobPublicAccess":
+ err = unpopulate(val, "AllowBlobPublicAccess", &a.AllowBlobPublicAccess)
+ delete(rawMsg, key)
+ case "allowCrossTenantReplication":
+ err = unpopulate(val, "AllowCrossTenantReplication", &a.AllowCrossTenantReplication)
+ delete(rawMsg, key)
+ case "allowSharedKeyAccess":
+ err = unpopulate(val, "AllowSharedKeyAccess", &a.AllowSharedKeyAccess)
+ delete(rawMsg, key)
+ case "allowedCopyScope":
+ err = unpopulate(val, "AllowedCopyScope", &a.AllowedCopyScope)
+ delete(rawMsg, key)
+ case "azureFilesIdentityBasedAuthentication":
+ err = unpopulate(val, "AzureFilesIdentityBasedAuthentication", &a.AzureFilesIdentityBasedAuthentication)
+ delete(rawMsg, key)
+ case "blobRestoreStatus":
+ err = unpopulate(val, "BlobRestoreStatus", &a.BlobRestoreStatus)
+ delete(rawMsg, key)
+ case "creationTime":
+ err = unpopulateDateTimeRFC3339(val, "CreationTime", &a.CreationTime)
+ delete(rawMsg, key)
+ case "customDomain":
+ err = unpopulate(val, "CustomDomain", &a.CustomDomain)
+ delete(rawMsg, key)
+ case "dnsEndpointType":
+ err = unpopulate(val, "DNSEndpointType", &a.DNSEndpointType)
+ delete(rawMsg, key)
+ case "defaultToOAuthAuthentication":
+ err = unpopulate(val, "DefaultToOAuthAuthentication", &a.DefaultToOAuthAuthentication)
+ delete(rawMsg, key)
+ case "dualStackEndpointPreference":
+ err = unpopulate(val, "DualStackEndpointPreference", &a.DualStackEndpointPreference)
+ delete(rawMsg, key)
+ case "enableExtendedGroups":
+ err = unpopulate(val, "EnableExtendedGroups", &a.EnableExtendedGroups)
+ delete(rawMsg, key)
+ case "supportsHttpsTrafficOnly":
+ err = unpopulate(val, "EnableHTTPSTrafficOnly", &a.EnableHTTPSTrafficOnly)
+ delete(rawMsg, key)
+ case "isNfsV3Enabled":
+ err = unpopulate(val, "EnableNfsV3", &a.EnableNfsV3)
+ delete(rawMsg, key)
+ case "encryption":
+ err = unpopulate(val, "Encryption", &a.Encryption)
+ delete(rawMsg, key)
+ case "failoverInProgress":
+ err = unpopulate(val, "FailoverInProgress", &a.FailoverInProgress)
+ delete(rawMsg, key)
+ case "geoReplicationStats":
+ err = unpopulate(val, "GeoReplicationStats", &a.GeoReplicationStats)
+ delete(rawMsg, key)
+ case "immutableStorageWithVersioning":
+ err = unpopulate(val, "ImmutableStorageWithVersioning", &a.ImmutableStorageWithVersioning)
+ delete(rawMsg, key)
+ case "isHnsEnabled":
+ err = unpopulate(val, "IsHnsEnabled", &a.IsHnsEnabled)
+ delete(rawMsg, key)
+ case "isLocalUserEnabled":
+ err = unpopulate(val, "IsLocalUserEnabled", &a.IsLocalUserEnabled)
+ delete(rawMsg, key)
+ case "isSkuConversionBlocked":
+ err = unpopulate(val, "IsSKUConversionBlocked", &a.IsSKUConversionBlocked)
+ delete(rawMsg, key)
+ case "isSftpEnabled":
+ err = unpopulate(val, "IsSftpEnabled", &a.IsSftpEnabled)
+ delete(rawMsg, key)
+ case "keyCreationTime":
+ err = unpopulate(val, "KeyCreationTime", &a.KeyCreationTime)
+ delete(rawMsg, key)
+ case "keyPolicy":
+ err = unpopulate(val, "KeyPolicy", &a.KeyPolicy)
+ delete(rawMsg, key)
+ case "largeFileSharesState":
+ err = unpopulate(val, "LargeFileSharesState", &a.LargeFileSharesState)
+ delete(rawMsg, key)
+ case "lastGeoFailoverTime":
+ err = unpopulateDateTimeRFC3339(val, "LastGeoFailoverTime", &a.LastGeoFailoverTime)
+ delete(rawMsg, key)
+ case "minimumTlsVersion":
+ err = unpopulate(val, "MinimumTLSVersion", &a.MinimumTLSVersion)
+ delete(rawMsg, key)
+ case "networkAcls":
+ err = unpopulate(val, "NetworkRuleSet", &a.NetworkRuleSet)
+ delete(rawMsg, key)
+ case "primaryEndpoints":
+ err = unpopulate(val, "PrimaryEndpoints", &a.PrimaryEndpoints)
+ delete(rawMsg, key)
+ case "primaryLocation":
+ err = unpopulate(val, "PrimaryLocation", &a.PrimaryLocation)
+ delete(rawMsg, key)
+ case "privateEndpointConnections":
+ err = unpopulate(val, "PrivateEndpointConnections", &a.PrivateEndpointConnections)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &a.ProvisioningState)
+ delete(rawMsg, key)
+ case "publicNetworkAccess":
+ err = unpopulate(val, "PublicNetworkAccess", &a.PublicNetworkAccess)
+ delete(rawMsg, key)
+ case "routingPreference":
+ err = unpopulate(val, "RoutingPreference", &a.RoutingPreference)
+ delete(rawMsg, key)
+ case "sasPolicy":
+ err = unpopulate(val, "SasPolicy", &a.SasPolicy)
+ delete(rawMsg, key)
+ case "secondaryEndpoints":
+ err = unpopulate(val, "SecondaryEndpoints", &a.SecondaryEndpoints)
+ delete(rawMsg, key)
+ case "secondaryLocation":
+ err = unpopulate(val, "SecondaryLocation", &a.SecondaryLocation)
+ delete(rawMsg, key)
+ case "statusOfPrimary":
+ err = unpopulate(val, "StatusOfPrimary", &a.StatusOfPrimary)
+ delete(rawMsg, key)
+ case "statusOfSecondary":
+ err = unpopulate(val, "StatusOfSecondary", &a.StatusOfSecondary)
+ delete(rawMsg, key)
+ case "storageAccountSkuConversionStatus":
+ err = unpopulate(val, "StorageAccountSKUConversionStatus", &a.StorageAccountSKUConversionStatus)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountPropertiesCreateParameters.
+func (a AccountPropertiesCreateParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "accessTier", a.AccessTier)
+ populate(objectMap, "allowBlobPublicAccess", a.AllowBlobPublicAccess)
+ populate(objectMap, "allowCrossTenantReplication", a.AllowCrossTenantReplication)
+ populate(objectMap, "allowSharedKeyAccess", a.AllowSharedKeyAccess)
+ populate(objectMap, "allowedCopyScope", a.AllowedCopyScope)
+ populate(objectMap, "azureFilesIdentityBasedAuthentication", a.AzureFilesIdentityBasedAuthentication)
+ populate(objectMap, "customDomain", a.CustomDomain)
+ populate(objectMap, "dnsEndpointType", a.DNSEndpointType)
+ populate(objectMap, "defaultToOAuthAuthentication", a.DefaultToOAuthAuthentication)
+ populate(objectMap, "dualStackEndpointPreference", a.DualStackEndpointPreference)
+ populate(objectMap, "enableExtendedGroups", a.EnableExtendedGroups)
+ populate(objectMap, "supportsHttpsTrafficOnly", a.EnableHTTPSTrafficOnly)
+ populate(objectMap, "isNfsV3Enabled", a.EnableNfsV3)
+ populate(objectMap, "encryption", a.Encryption)
+ populate(objectMap, "immutableStorageWithVersioning", a.ImmutableStorageWithVersioning)
+ populate(objectMap, "isHnsEnabled", a.IsHnsEnabled)
+ populate(objectMap, "isLocalUserEnabled", a.IsLocalUserEnabled)
+ populate(objectMap, "isSftpEnabled", a.IsSftpEnabled)
+ populate(objectMap, "keyPolicy", a.KeyPolicy)
+ populate(objectMap, "largeFileSharesState", a.LargeFileSharesState)
+ populate(objectMap, "minimumTlsVersion", a.MinimumTLSVersion)
+ populate(objectMap, "networkAcls", a.NetworkRuleSet)
+ populate(objectMap, "publicNetworkAccess", a.PublicNetworkAccess)
+ populate(objectMap, "routingPreference", a.RoutingPreference)
+ populate(objectMap, "sasPolicy", a.SasPolicy)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountPropertiesCreateParameters.
+func (a *AccountPropertiesCreateParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "accessTier":
+ err = unpopulate(val, "AccessTier", &a.AccessTier)
+ delete(rawMsg, key)
+ case "allowBlobPublicAccess":
+ err = unpopulate(val, "AllowBlobPublicAccess", &a.AllowBlobPublicAccess)
+ delete(rawMsg, key)
+ case "allowCrossTenantReplication":
+ err = unpopulate(val, "AllowCrossTenantReplication", &a.AllowCrossTenantReplication)
+ delete(rawMsg, key)
+ case "allowSharedKeyAccess":
+ err = unpopulate(val, "AllowSharedKeyAccess", &a.AllowSharedKeyAccess)
+ delete(rawMsg, key)
+ case "allowedCopyScope":
+ err = unpopulate(val, "AllowedCopyScope", &a.AllowedCopyScope)
+ delete(rawMsg, key)
+ case "azureFilesIdentityBasedAuthentication":
+ err = unpopulate(val, "AzureFilesIdentityBasedAuthentication", &a.AzureFilesIdentityBasedAuthentication)
+ delete(rawMsg, key)
+ case "customDomain":
+ err = unpopulate(val, "CustomDomain", &a.CustomDomain)
+ delete(rawMsg, key)
+ case "dnsEndpointType":
+ err = unpopulate(val, "DNSEndpointType", &a.DNSEndpointType)
+ delete(rawMsg, key)
+ case "defaultToOAuthAuthentication":
+ err = unpopulate(val, "DefaultToOAuthAuthentication", &a.DefaultToOAuthAuthentication)
+ delete(rawMsg, key)
+ case "dualStackEndpointPreference":
+ err = unpopulate(val, "DualStackEndpointPreference", &a.DualStackEndpointPreference)
+ delete(rawMsg, key)
+ case "enableExtendedGroups":
+ err = unpopulate(val, "EnableExtendedGroups", &a.EnableExtendedGroups)
+ delete(rawMsg, key)
+ case "supportsHttpsTrafficOnly":
+ err = unpopulate(val, "EnableHTTPSTrafficOnly", &a.EnableHTTPSTrafficOnly)
+ delete(rawMsg, key)
+ case "isNfsV3Enabled":
+ err = unpopulate(val, "EnableNfsV3", &a.EnableNfsV3)
+ delete(rawMsg, key)
+ case "encryption":
+ err = unpopulate(val, "Encryption", &a.Encryption)
+ delete(rawMsg, key)
+ case "immutableStorageWithVersioning":
+ err = unpopulate(val, "ImmutableStorageWithVersioning", &a.ImmutableStorageWithVersioning)
+ delete(rawMsg, key)
+ case "isHnsEnabled":
+ err = unpopulate(val, "IsHnsEnabled", &a.IsHnsEnabled)
+ delete(rawMsg, key)
+ case "isLocalUserEnabled":
+ err = unpopulate(val, "IsLocalUserEnabled", &a.IsLocalUserEnabled)
+ delete(rawMsg, key)
+ case "isSftpEnabled":
+ err = unpopulate(val, "IsSftpEnabled", &a.IsSftpEnabled)
+ delete(rawMsg, key)
+ case "keyPolicy":
+ err = unpopulate(val, "KeyPolicy", &a.KeyPolicy)
+ delete(rawMsg, key)
+ case "largeFileSharesState":
+ err = unpopulate(val, "LargeFileSharesState", &a.LargeFileSharesState)
+ delete(rawMsg, key)
+ case "minimumTlsVersion":
+ err = unpopulate(val, "MinimumTLSVersion", &a.MinimumTLSVersion)
+ delete(rawMsg, key)
+ case "networkAcls":
+ err = unpopulate(val, "NetworkRuleSet", &a.NetworkRuleSet)
+ delete(rawMsg, key)
+ case "publicNetworkAccess":
+ err = unpopulate(val, "PublicNetworkAccess", &a.PublicNetworkAccess)
+ delete(rawMsg, key)
+ case "routingPreference":
+ err = unpopulate(val, "RoutingPreference", &a.RoutingPreference)
+ delete(rawMsg, key)
+ case "sasPolicy":
+ err = unpopulate(val, "SasPolicy", &a.SasPolicy)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountPropertiesUpdateParameters.
+func (a AccountPropertiesUpdateParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "accessTier", a.AccessTier)
+ populate(objectMap, "allowBlobPublicAccess", a.AllowBlobPublicAccess)
+ populate(objectMap, "allowCrossTenantReplication", a.AllowCrossTenantReplication)
+ populate(objectMap, "allowSharedKeyAccess", a.AllowSharedKeyAccess)
+ populate(objectMap, "allowedCopyScope", a.AllowedCopyScope)
+ populate(objectMap, "azureFilesIdentityBasedAuthentication", a.AzureFilesIdentityBasedAuthentication)
+ populate(objectMap, "customDomain", a.CustomDomain)
+ populate(objectMap, "dnsEndpointType", a.DNSEndpointType)
+ populate(objectMap, "defaultToOAuthAuthentication", a.DefaultToOAuthAuthentication)
+ populate(objectMap, "dualStackEndpointPreference", a.DualStackEndpointPreference)
+ populate(objectMap, "enableExtendedGroups", a.EnableExtendedGroups)
+ populate(objectMap, "supportsHttpsTrafficOnly", a.EnableHTTPSTrafficOnly)
+ populate(objectMap, "encryption", a.Encryption)
+ populate(objectMap, "immutableStorageWithVersioning", a.ImmutableStorageWithVersioning)
+ populate(objectMap, "isLocalUserEnabled", a.IsLocalUserEnabled)
+ populate(objectMap, "isSftpEnabled", a.IsSftpEnabled)
+ populate(objectMap, "keyPolicy", a.KeyPolicy)
+ populate(objectMap, "largeFileSharesState", a.LargeFileSharesState)
+ populate(objectMap, "minimumTlsVersion", a.MinimumTLSVersion)
+ populate(objectMap, "networkAcls", a.NetworkRuleSet)
+ populate(objectMap, "publicNetworkAccess", a.PublicNetworkAccess)
+ populate(objectMap, "routingPreference", a.RoutingPreference)
+ populate(objectMap, "sasPolicy", a.SasPolicy)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountPropertiesUpdateParameters.
+func (a *AccountPropertiesUpdateParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "accessTier":
+ err = unpopulate(val, "AccessTier", &a.AccessTier)
+ delete(rawMsg, key)
+ case "allowBlobPublicAccess":
+ err = unpopulate(val, "AllowBlobPublicAccess", &a.AllowBlobPublicAccess)
+ delete(rawMsg, key)
+ case "allowCrossTenantReplication":
+ err = unpopulate(val, "AllowCrossTenantReplication", &a.AllowCrossTenantReplication)
+ delete(rawMsg, key)
+ case "allowSharedKeyAccess":
+ err = unpopulate(val, "AllowSharedKeyAccess", &a.AllowSharedKeyAccess)
+ delete(rawMsg, key)
+ case "allowedCopyScope":
+ err = unpopulate(val, "AllowedCopyScope", &a.AllowedCopyScope)
+ delete(rawMsg, key)
+ case "azureFilesIdentityBasedAuthentication":
+ err = unpopulate(val, "AzureFilesIdentityBasedAuthentication", &a.AzureFilesIdentityBasedAuthentication)
+ delete(rawMsg, key)
+ case "customDomain":
+ err = unpopulate(val, "CustomDomain", &a.CustomDomain)
+ delete(rawMsg, key)
+ case "dnsEndpointType":
+ err = unpopulate(val, "DNSEndpointType", &a.DNSEndpointType)
+ delete(rawMsg, key)
+ case "defaultToOAuthAuthentication":
+ err = unpopulate(val, "DefaultToOAuthAuthentication", &a.DefaultToOAuthAuthentication)
+ delete(rawMsg, key)
+ case "dualStackEndpointPreference":
+ err = unpopulate(val, "DualStackEndpointPreference", &a.DualStackEndpointPreference)
+ delete(rawMsg, key)
+ case "enableExtendedGroups":
+ err = unpopulate(val, "EnableExtendedGroups", &a.EnableExtendedGroups)
+ delete(rawMsg, key)
+ case "supportsHttpsTrafficOnly":
+ err = unpopulate(val, "EnableHTTPSTrafficOnly", &a.EnableHTTPSTrafficOnly)
+ delete(rawMsg, key)
+ case "encryption":
+ err = unpopulate(val, "Encryption", &a.Encryption)
+ delete(rawMsg, key)
+ case "immutableStorageWithVersioning":
+ err = unpopulate(val, "ImmutableStorageWithVersioning", &a.ImmutableStorageWithVersioning)
+ delete(rawMsg, key)
+ case "isLocalUserEnabled":
+ err = unpopulate(val, "IsLocalUserEnabled", &a.IsLocalUserEnabled)
+ delete(rawMsg, key)
+ case "isSftpEnabled":
+ err = unpopulate(val, "IsSftpEnabled", &a.IsSftpEnabled)
+ delete(rawMsg, key)
+ case "keyPolicy":
+ err = unpopulate(val, "KeyPolicy", &a.KeyPolicy)
+ delete(rawMsg, key)
+ case "largeFileSharesState":
+ err = unpopulate(val, "LargeFileSharesState", &a.LargeFileSharesState)
+ delete(rawMsg, key)
+ case "minimumTlsVersion":
+ err = unpopulate(val, "MinimumTLSVersion", &a.MinimumTLSVersion)
+ delete(rawMsg, key)
+ case "networkAcls":
+ err = unpopulate(val, "NetworkRuleSet", &a.NetworkRuleSet)
+ delete(rawMsg, key)
+ case "publicNetworkAccess":
+ err = unpopulate(val, "PublicNetworkAccess", &a.PublicNetworkAccess)
+ delete(rawMsg, key)
+ case "routingPreference":
+ err = unpopulate(val, "RoutingPreference", &a.RoutingPreference)
+ delete(rawMsg, key)
+ case "sasPolicy":
+ err = unpopulate(val, "SasPolicy", &a.SasPolicy)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountRegenerateKeyParameters.
+func (a AccountRegenerateKeyParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "keyName", a.KeyName)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountRegenerateKeyParameters.
+func (a *AccountRegenerateKeyParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "keyName":
+ err = unpopulate(val, "KeyName", &a.KeyName)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountSKUConversionStatus.
+func (a AccountSKUConversionStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "endTime", a.EndTime)
+ populate(objectMap, "skuConversionStatus", a.SKUConversionStatus)
+ populate(objectMap, "startTime", a.StartTime)
+ populate(objectMap, "targetSkuName", a.TargetSKUName)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountSKUConversionStatus.
+func (a *AccountSKUConversionStatus) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "endTime":
+ err = unpopulate(val, "EndTime", &a.EndTime)
+ delete(rawMsg, key)
+ case "skuConversionStatus":
+ err = unpopulate(val, "SKUConversionStatus", &a.SKUConversionStatus)
+ delete(rawMsg, key)
+ case "startTime":
+ err = unpopulate(val, "StartTime", &a.StartTime)
+ delete(rawMsg, key)
+ case "targetSkuName":
+ err = unpopulate(val, "TargetSKUName", &a.TargetSKUName)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountSasParameters.
+func (a AccountSasParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "signedIp", a.IPAddressOrRange)
+ populate(objectMap, "keyToSign", a.KeyToSign)
+ populate(objectMap, "signedPermission", a.Permissions)
+ populate(objectMap, "signedProtocol", a.Protocols)
+ populate(objectMap, "signedResourceTypes", a.ResourceTypes)
+ populate(objectMap, "signedServices", a.Services)
+ populateDateTimeRFC3339(objectMap, "signedExpiry", a.SharedAccessExpiryTime)
+ populateDateTimeRFC3339(objectMap, "signedStart", a.SharedAccessStartTime)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountSasParameters.
+func (a *AccountSasParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "signedIp":
+ err = unpopulate(val, "IPAddressOrRange", &a.IPAddressOrRange)
+ delete(rawMsg, key)
+ case "keyToSign":
+ err = unpopulate(val, "KeyToSign", &a.KeyToSign)
+ delete(rawMsg, key)
+ case "signedPermission":
+ err = unpopulate(val, "Permissions", &a.Permissions)
+ delete(rawMsg, key)
+ case "signedProtocol":
+ err = unpopulate(val, "Protocols", &a.Protocols)
+ delete(rawMsg, key)
+ case "signedResourceTypes":
+ err = unpopulate(val, "ResourceTypes", &a.ResourceTypes)
+ delete(rawMsg, key)
+ case "signedServices":
+ err = unpopulate(val, "Services", &a.Services)
+ delete(rawMsg, key)
+ case "signedExpiry":
+ err = unpopulateDateTimeRFC3339(val, "SharedAccessExpiryTime", &a.SharedAccessExpiryTime)
+ delete(rawMsg, key)
+ case "signedStart":
+ err = unpopulateDateTimeRFC3339(val, "SharedAccessStartTime", &a.SharedAccessStartTime)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountUpdateParameters.
+func (a AccountUpdateParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "identity", a.Identity)
+ populate(objectMap, "kind", a.Kind)
+ populate(objectMap, "placement", a.Placement)
+ populate(objectMap, "properties", a.Properties)
+ populate(objectMap, "sku", a.SKU)
+ populate(objectMap, "tags", a.Tags)
+ populate(objectMap, "zones", a.Zones)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountUpdateParameters.
+func (a *AccountUpdateParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "identity":
+ err = unpopulate(val, "Identity", &a.Identity)
+ delete(rawMsg, key)
+ case "kind":
+ err = unpopulate(val, "Kind", &a.Kind)
+ delete(rawMsg, key)
+ case "placement":
+ err = unpopulate(val, "Placement", &a.Placement)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &a.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &a.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &a.Tags)
+ delete(rawMsg, key)
+ case "zones":
+ err = unpopulate(val, "Zones", &a.Zones)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountUsage.
+func (a AccountUsage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "liveShares", a.LiveShares)
+ populate(objectMap, "softDeletedShares", a.SoftDeletedShares)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountUsage.
+func (a *AccountUsage) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "liveShares":
+ err = unpopulate(val, "LiveShares", &a.LiveShares)
+ delete(rawMsg, key)
+ case "softDeletedShares":
+ err = unpopulate(val, "SoftDeletedShares", &a.SoftDeletedShares)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountUsageElements.
+func (a AccountUsageElements) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "fileShareCount", a.FileShareCount)
+ populate(objectMap, "provisionedBandwidthMiBPerSec", a.ProvisionedBandwidthMiBPerSec)
+ populate(objectMap, "provisionedIOPS", a.ProvisionedIOPS)
+ populate(objectMap, "provisionedStorageGiB", a.ProvisionedStorageGiB)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountUsageElements.
+func (a *AccountUsageElements) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "fileShareCount":
+ err = unpopulate(val, "FileShareCount", &a.FileShareCount)
+ delete(rawMsg, key)
+ case "provisionedBandwidthMiBPerSec":
+ err = unpopulate(val, "ProvisionedBandwidthMiBPerSec", &a.ProvisionedBandwidthMiBPerSec)
+ delete(rawMsg, key)
+ case "provisionedIOPS":
+ err = unpopulate(val, "ProvisionedIOPS", &a.ProvisionedIOPS)
+ delete(rawMsg, key)
+ case "provisionedStorageGiB":
+ err = unpopulate(val, "ProvisionedStorageGiB", &a.ProvisionedStorageGiB)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ActiveDirectoryProperties.
+func (a ActiveDirectoryProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "accountType", a.AccountType)
+ populate(objectMap, "azureStorageSid", a.AzureStorageSid)
+ populate(objectMap, "domainGuid", a.DomainGUID)
+ populate(objectMap, "domainName", a.DomainName)
+ populate(objectMap, "domainSid", a.DomainSid)
+ populate(objectMap, "forestName", a.ForestName)
+ populate(objectMap, "netBiosDomainName", a.NetBiosDomainName)
+ populate(objectMap, "samAccountName", a.SamAccountName)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveDirectoryProperties.
+func (a *ActiveDirectoryProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "accountType":
+ err = unpopulate(val, "AccountType", &a.AccountType)
+ delete(rawMsg, key)
+ case "azureStorageSid":
+ err = unpopulate(val, "AzureStorageSid", &a.AzureStorageSid)
+ delete(rawMsg, key)
+ case "domainGuid":
+ err = unpopulate(val, "DomainGUID", &a.DomainGUID)
+ delete(rawMsg, key)
+ case "domainName":
+ err = unpopulate(val, "DomainName", &a.DomainName)
+ delete(rawMsg, key)
+ case "domainSid":
+ err = unpopulate(val, "DomainSid", &a.DomainSid)
+ delete(rawMsg, key)
+ case "forestName":
+ err = unpopulate(val, "ForestName", &a.ForestName)
+ delete(rawMsg, key)
+ case "netBiosDomainName":
+ err = unpopulate(val, "NetBiosDomainName", &a.NetBiosDomainName)
+ delete(rawMsg, key)
+ case "samAccountName":
+ err = unpopulate(val, "SamAccountName", &a.SamAccountName)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AzureEntityResource.
+func (a AzureEntityResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "etag", a.Etag)
+ populate(objectMap, "id", a.ID)
+ populate(objectMap, "name", a.Name)
+ populate(objectMap, "type", a.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AzureEntityResource.
+func (a *AzureEntityResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "etag":
+ err = unpopulate(val, "Etag", &a.Etag)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &a.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &a.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &a.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AzureFilesIdentityBasedAuthentication.
+func (a AzureFilesIdentityBasedAuthentication) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "activeDirectoryProperties", a.ActiveDirectoryProperties)
+ populate(objectMap, "defaultSharePermission", a.DefaultSharePermission)
+ populate(objectMap, "directoryServiceOptions", a.DirectoryServiceOptions)
+ populate(objectMap, "smbOAuthSettings", a.SmbOAuthSettings)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFilesIdentityBasedAuthentication.
+func (a *AzureFilesIdentityBasedAuthentication) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "activeDirectoryProperties":
+ err = unpopulate(val, "ActiveDirectoryProperties", &a.ActiveDirectoryProperties)
+ delete(rawMsg, key)
+ case "defaultSharePermission":
+ err = unpopulate(val, "DefaultSharePermission", &a.DefaultSharePermission)
+ delete(rawMsg, key)
+ case "directoryServiceOptions":
+ err = unpopulate(val, "DirectoryServiceOptions", &a.DirectoryServiceOptions)
+ delete(rawMsg, key)
+ case "smbOAuthSettings":
+ err = unpopulate(val, "SmbOAuthSettings", &a.SmbOAuthSettings)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobContainer.
+func (b BlobContainer) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", b.ContainerProperties)
+ populate(objectMap, "etag", b.Etag)
+ populate(objectMap, "id", b.ID)
+ populate(objectMap, "name", b.Name)
+ populate(objectMap, "type", b.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobContainer.
+func (b *BlobContainer) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "ContainerProperties", &b.ContainerProperties)
+ delete(rawMsg, key)
+ case "etag":
+ err = unpopulate(val, "Etag", &b.Etag)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &b.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &b.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &b.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobInventoryCreationTime.
+func (b BlobInventoryCreationTime) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "lastNDays", b.LastNDays)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobInventoryCreationTime.
+func (b *BlobInventoryCreationTime) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "lastNDays":
+ err = unpopulate(val, "LastNDays", &b.LastNDays)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobInventoryPolicy.
+func (b BlobInventoryPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", b.ID)
+ populate(objectMap, "name", b.Name)
+ populate(objectMap, "properties", b.Properties)
+ populate(objectMap, "systemData", b.SystemData)
+ populate(objectMap, "type", b.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobInventoryPolicy.
+func (b *BlobInventoryPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &b.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &b.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &b.Properties)
+ delete(rawMsg, key)
+ case "systemData":
+ err = unpopulate(val, "SystemData", &b.SystemData)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &b.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobInventoryPolicyDefinition.
+func (b BlobInventoryPolicyDefinition) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "filters", b.Filters)
+ populate(objectMap, "format", b.Format)
+ populate(objectMap, "objectType", b.ObjectType)
+ populate(objectMap, "schedule", b.Schedule)
+ populate(objectMap, "schemaFields", b.SchemaFields)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobInventoryPolicyDefinition.
+func (b *BlobInventoryPolicyDefinition) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "filters":
+ err = unpopulate(val, "Filters", &b.Filters)
+ delete(rawMsg, key)
+ case "format":
+ err = unpopulate(val, "Format", &b.Format)
+ delete(rawMsg, key)
+ case "objectType":
+ err = unpopulate(val, "ObjectType", &b.ObjectType)
+ delete(rawMsg, key)
+ case "schedule":
+ err = unpopulate(val, "Schedule", &b.Schedule)
+ delete(rawMsg, key)
+ case "schemaFields":
+ err = unpopulate(val, "SchemaFields", &b.SchemaFields)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobInventoryPolicyFilter.
+func (b BlobInventoryPolicyFilter) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blobTypes", b.BlobTypes)
+ populate(objectMap, "creationTime", b.CreationTime)
+ populate(objectMap, "excludePrefix", b.ExcludePrefix)
+ populate(objectMap, "includeBlobVersions", b.IncludeBlobVersions)
+ populate(objectMap, "includeDeleted", b.IncludeDeleted)
+ populate(objectMap, "includeSnapshots", b.IncludeSnapshots)
+ populate(objectMap, "prefixMatch", b.PrefixMatch)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobInventoryPolicyFilter.
+func (b *BlobInventoryPolicyFilter) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blobTypes":
+ err = unpopulate(val, "BlobTypes", &b.BlobTypes)
+ delete(rawMsg, key)
+ case "creationTime":
+ err = unpopulate(val, "CreationTime", &b.CreationTime)
+ delete(rawMsg, key)
+ case "excludePrefix":
+ err = unpopulate(val, "ExcludePrefix", &b.ExcludePrefix)
+ delete(rawMsg, key)
+ case "includeBlobVersions":
+ err = unpopulate(val, "IncludeBlobVersions", &b.IncludeBlobVersions)
+ delete(rawMsg, key)
+ case "includeDeleted":
+ err = unpopulate(val, "IncludeDeleted", &b.IncludeDeleted)
+ delete(rawMsg, key)
+ case "includeSnapshots":
+ err = unpopulate(val, "IncludeSnapshots", &b.IncludeSnapshots)
+ delete(rawMsg, key)
+ case "prefixMatch":
+ err = unpopulate(val, "PrefixMatch", &b.PrefixMatch)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobInventoryPolicyProperties.
+func (b BlobInventoryPolicyProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "lastModifiedTime", b.LastModifiedTime)
+ populate(objectMap, "policy", b.Policy)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobInventoryPolicyProperties.
+func (b *BlobInventoryPolicyProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "lastModifiedTime":
+ err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &b.LastModifiedTime)
+ delete(rawMsg, key)
+ case "policy":
+ err = unpopulate(val, "Policy", &b.Policy)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobInventoryPolicyRule.
+func (b BlobInventoryPolicyRule) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "definition", b.Definition)
+ populate(objectMap, "destination", b.Destination)
+ populate(objectMap, "enabled", b.Enabled)
+ populate(objectMap, "name", b.Name)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobInventoryPolicyRule.
+func (b *BlobInventoryPolicyRule) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "definition":
+ err = unpopulate(val, "Definition", &b.Definition)
+ delete(rawMsg, key)
+ case "destination":
+ err = unpopulate(val, "Destination", &b.Destination)
+ delete(rawMsg, key)
+ case "enabled":
+ err = unpopulate(val, "Enabled", &b.Enabled)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &b.Name)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobInventoryPolicySchema.
+func (b BlobInventoryPolicySchema) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "destination", b.Destination)
+ populate(objectMap, "enabled", b.Enabled)
+ populate(objectMap, "rules", b.Rules)
+ populate(objectMap, "type", b.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobInventoryPolicySchema.
+func (b *BlobInventoryPolicySchema) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "destination":
+ err = unpopulate(val, "Destination", &b.Destination)
+ delete(rawMsg, key)
+ case "enabled":
+ err = unpopulate(val, "Enabled", &b.Enabled)
+ delete(rawMsg, key)
+ case "rules":
+ err = unpopulate(val, "Rules", &b.Rules)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &b.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobRestoreParameters.
+func (b BlobRestoreParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blobRanges", b.BlobRanges)
+ populateDateTimeRFC3339(objectMap, "timeToRestore", b.TimeToRestore)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobRestoreParameters.
+func (b *BlobRestoreParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blobRanges":
+ err = unpopulate(val, "BlobRanges", &b.BlobRanges)
+ delete(rawMsg, key)
+ case "timeToRestore":
+ err = unpopulateDateTimeRFC3339(val, "TimeToRestore", &b.TimeToRestore)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobRestoreRange.
+func (b BlobRestoreRange) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "endRange", b.EndRange)
+ populate(objectMap, "startRange", b.StartRange)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobRestoreRange.
+func (b *BlobRestoreRange) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "endRange":
+ err = unpopulate(val, "EndRange", &b.EndRange)
+ delete(rawMsg, key)
+ case "startRange":
+ err = unpopulate(val, "StartRange", &b.StartRange)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobRestoreStatus.
+func (b BlobRestoreStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "failureReason", b.FailureReason)
+ populate(objectMap, "parameters", b.Parameters)
+ populate(objectMap, "restoreId", b.RestoreID)
+ populate(objectMap, "status", b.Status)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobRestoreStatus.
+func (b *BlobRestoreStatus) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "failureReason":
+ err = unpopulate(val, "FailureReason", &b.FailureReason)
+ delete(rawMsg, key)
+ case "parameters":
+ err = unpopulate(val, "Parameters", &b.Parameters)
+ delete(rawMsg, key)
+ case "restoreId":
+ err = unpopulate(val, "RestoreID", &b.RestoreID)
+ delete(rawMsg, key)
+ case "status":
+ err = unpopulate(val, "Status", &b.Status)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobServiceItems.
+func (b BlobServiceItems) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", b.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobServiceItems.
+func (b *BlobServiceItems) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &b.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobServiceProperties.
+func (b BlobServiceProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", b.BlobServiceProperties)
+ populate(objectMap, "id", b.ID)
+ populate(objectMap, "name", b.Name)
+ populate(objectMap, "sku", b.SKU)
+ populate(objectMap, "type", b.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobServiceProperties.
+func (b *BlobServiceProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "BlobServiceProperties", &b.BlobServiceProperties)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &b.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &b.Name)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &b.SKU)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &b.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobServicePropertiesProperties.
+func (b BlobServicePropertiesProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "automaticSnapshotPolicyEnabled", b.AutomaticSnapshotPolicyEnabled)
+ populate(objectMap, "changeFeed", b.ChangeFeed)
+ populate(objectMap, "containerDeleteRetentionPolicy", b.ContainerDeleteRetentionPolicy)
+ populate(objectMap, "cors", b.Cors)
+ populate(objectMap, "defaultServiceVersion", b.DefaultServiceVersion)
+ populate(objectMap, "deleteRetentionPolicy", b.DeleteRetentionPolicy)
+ populate(objectMap, "isVersioningEnabled", b.IsVersioningEnabled)
+ populate(objectMap, "lastAccessTimeTrackingPolicy", b.LastAccessTimeTrackingPolicy)
+ populate(objectMap, "restorePolicy", b.RestorePolicy)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobServicePropertiesProperties.
+func (b *BlobServicePropertiesProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "automaticSnapshotPolicyEnabled":
+ err = unpopulate(val, "AutomaticSnapshotPolicyEnabled", &b.AutomaticSnapshotPolicyEnabled)
+ delete(rawMsg, key)
+ case "changeFeed":
+ err = unpopulate(val, "ChangeFeed", &b.ChangeFeed)
+ delete(rawMsg, key)
+ case "containerDeleteRetentionPolicy":
+ err = unpopulate(val, "ContainerDeleteRetentionPolicy", &b.ContainerDeleteRetentionPolicy)
+ delete(rawMsg, key)
+ case "cors":
+ err = unpopulate(val, "Cors", &b.Cors)
+ delete(rawMsg, key)
+ case "defaultServiceVersion":
+ err = unpopulate(val, "DefaultServiceVersion", &b.DefaultServiceVersion)
+ delete(rawMsg, key)
+ case "deleteRetentionPolicy":
+ err = unpopulate(val, "DeleteRetentionPolicy", &b.DeleteRetentionPolicy)
+ delete(rawMsg, key)
+ case "isVersioningEnabled":
+ err = unpopulate(val, "IsVersioningEnabled", &b.IsVersioningEnabled)
+ delete(rawMsg, key)
+ case "lastAccessTimeTrackingPolicy":
+ err = unpopulate(val, "LastAccessTimeTrackingPolicy", &b.LastAccessTimeTrackingPolicy)
+ delete(rawMsg, key)
+ case "restorePolicy":
+ err = unpopulate(val, "RestorePolicy", &b.RestorePolicy)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BurstingConstants.
+func (b BurstingConstants) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "burstFloorIOPS", b.BurstFloorIOPS)
+ populate(objectMap, "burstIOScalar", b.BurstIOScalar)
+ populate(objectMap, "burstTimeframeSeconds", b.BurstTimeframeSeconds)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BurstingConstants.
+func (b *BurstingConstants) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "burstFloorIOPS":
+ err = unpopulate(val, "BurstFloorIOPS", &b.BurstFloorIOPS)
+ delete(rawMsg, key)
+ case "burstIOScalar":
+ err = unpopulate(val, "BurstIOScalar", &b.BurstIOScalar)
+ delete(rawMsg, key)
+ case "burstTimeframeSeconds":
+ err = unpopulate(val, "BurstTimeframeSeconds", &b.BurstTimeframeSeconds)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ChangeFeed.
+func (c ChangeFeed) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "enabled", c.Enabled)
+ populate(objectMap, "retentionInDays", c.RetentionInDays)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ChangeFeed.
+func (c *ChangeFeed) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "enabled":
+ err = unpopulate(val, "Enabled", &c.Enabled)
+ delete(rawMsg, key)
+ case "retentionInDays":
+ err = unpopulate(val, "RetentionInDays", &c.RetentionInDays)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResult.
+func (c CheckNameAvailabilityResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "message", c.Message)
+ populate(objectMap, "nameAvailable", c.NameAvailable)
+ populate(objectMap, "reason", c.Reason)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResult.
+func (c *CheckNameAvailabilityResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "message":
+ err = unpopulate(val, "Message", &c.Message)
+ delete(rawMsg, key)
+ case "nameAvailable":
+ err = unpopulate(val, "NameAvailable", &c.NameAvailable)
+ delete(rawMsg, key)
+ case "reason":
+ err = unpopulate(val, "Reason", &c.Reason)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ContainerProperties.
+func (c ContainerProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "defaultEncryptionScope", c.DefaultEncryptionScope)
+ populate(objectMap, "deleted", c.Deleted)
+ populateDateTimeRFC3339(objectMap, "deletedTime", c.DeletedTime)
+ populate(objectMap, "denyEncryptionScopeOverride", c.DenyEncryptionScopeOverride)
+ populate(objectMap, "enableNfsV3AllSquash", c.EnableNfsV3AllSquash)
+ populate(objectMap, "enableNfsV3RootSquash", c.EnableNfsV3RootSquash)
+ populate(objectMap, "hasImmutabilityPolicy", c.HasImmutabilityPolicy)
+ populate(objectMap, "hasLegalHold", c.HasLegalHold)
+ populate(objectMap, "immutabilityPolicy", c.ImmutabilityPolicy)
+ populate(objectMap, "immutableStorageWithVersioning", c.ImmutableStorageWithVersioning)
+ populateDateTimeRFC3339(objectMap, "lastModifiedTime", c.LastModifiedTime)
+ populate(objectMap, "leaseDuration", c.LeaseDuration)
+ populate(objectMap, "leaseState", c.LeaseState)
+ populate(objectMap, "leaseStatus", c.LeaseStatus)
+ populate(objectMap, "legalHold", c.LegalHold)
+ populate(objectMap, "metadata", c.Metadata)
+ populate(objectMap, "publicAccess", c.PublicAccess)
+ populate(objectMap, "remainingRetentionDays", c.RemainingRetentionDays)
+ populate(objectMap, "version", c.Version)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerProperties.
+func (c *ContainerProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "defaultEncryptionScope":
+ err = unpopulate(val, "DefaultEncryptionScope", &c.DefaultEncryptionScope)
+ delete(rawMsg, key)
+ case "deleted":
+ err = unpopulate(val, "Deleted", &c.Deleted)
+ delete(rawMsg, key)
+ case "deletedTime":
+ err = unpopulateDateTimeRFC3339(val, "DeletedTime", &c.DeletedTime)
+ delete(rawMsg, key)
+ case "denyEncryptionScopeOverride":
+ err = unpopulate(val, "DenyEncryptionScopeOverride", &c.DenyEncryptionScopeOverride)
+ delete(rawMsg, key)
+ case "enableNfsV3AllSquash":
+ err = unpopulate(val, "EnableNfsV3AllSquash", &c.EnableNfsV3AllSquash)
+ delete(rawMsg, key)
+ case "enableNfsV3RootSquash":
+ err = unpopulate(val, "EnableNfsV3RootSquash", &c.EnableNfsV3RootSquash)
+ delete(rawMsg, key)
+ case "hasImmutabilityPolicy":
+ err = unpopulate(val, "HasImmutabilityPolicy", &c.HasImmutabilityPolicy)
+ delete(rawMsg, key)
+ case "hasLegalHold":
+ err = unpopulate(val, "HasLegalHold", &c.HasLegalHold)
+ delete(rawMsg, key)
+ case "immutabilityPolicy":
+ err = unpopulate(val, "ImmutabilityPolicy", &c.ImmutabilityPolicy)
+ delete(rawMsg, key)
+ case "immutableStorageWithVersioning":
+ err = unpopulate(val, "ImmutableStorageWithVersioning", &c.ImmutableStorageWithVersioning)
+ delete(rawMsg, key)
+ case "lastModifiedTime":
+ err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &c.LastModifiedTime)
+ delete(rawMsg, key)
+ case "leaseDuration":
+ err = unpopulate(val, "LeaseDuration", &c.LeaseDuration)
+ delete(rawMsg, key)
+ case "leaseState":
+ err = unpopulate(val, "LeaseState", &c.LeaseState)
+ delete(rawMsg, key)
+ case "leaseStatus":
+ err = unpopulate(val, "LeaseStatus", &c.LeaseStatus)
+ delete(rawMsg, key)
+ case "legalHold":
+ err = unpopulate(val, "LegalHold", &c.LegalHold)
+ delete(rawMsg, key)
+ case "metadata":
+ err = unpopulate(val, "Metadata", &c.Metadata)
+ delete(rawMsg, key)
+ case "publicAccess":
+ err = unpopulate(val, "PublicAccess", &c.PublicAccess)
+ delete(rawMsg, key)
+ case "remainingRetentionDays":
+ err = unpopulate(val, "RemainingRetentionDays", &c.RemainingRetentionDays)
+ delete(rawMsg, key)
+ case "version":
+ err = unpopulate(val, "Version", &c.Version)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CorsRule.
+func (c CorsRule) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "allowedHeaders", c.AllowedHeaders)
+ populate(objectMap, "allowedMethods", c.AllowedMethods)
+ populate(objectMap, "allowedOrigins", c.AllowedOrigins)
+ populate(objectMap, "exposedHeaders", c.ExposedHeaders)
+ populate(objectMap, "maxAgeInSeconds", c.MaxAgeInSeconds)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CorsRule.
+func (c *CorsRule) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "allowedHeaders":
+ err = unpopulate(val, "AllowedHeaders", &c.AllowedHeaders)
+ delete(rawMsg, key)
+ case "allowedMethods":
+ err = unpopulate(val, "AllowedMethods", &c.AllowedMethods)
+ delete(rawMsg, key)
+ case "allowedOrigins":
+ err = unpopulate(val, "AllowedOrigins", &c.AllowedOrigins)
+ delete(rawMsg, key)
+ case "exposedHeaders":
+ err = unpopulate(val, "ExposedHeaders", &c.ExposedHeaders)
+ delete(rawMsg, key)
+ case "maxAgeInSeconds":
+ err = unpopulate(val, "MaxAgeInSeconds", &c.MaxAgeInSeconds)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CorsRules.
+func (c CorsRules) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "corsRules", c.CorsRules)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CorsRules.
+func (c *CorsRules) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "corsRules":
+ err = unpopulate(val, "CorsRules", &c.CorsRules)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CustomDomain.
+func (c CustomDomain) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", c.Name)
+ populate(objectMap, "useSubDomainName", c.UseSubDomainName)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomain.
+func (c *CustomDomain) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &c.Name)
+ delete(rawMsg, key)
+ case "useSubDomainName":
+ err = unpopulate(val, "UseSubDomainName", &c.UseSubDomainName)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DateAfterCreation.
+func (d DateAfterCreation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "daysAfterCreationGreaterThan", d.DaysAfterCreationGreaterThan)
+ populate(objectMap, "daysAfterLastTierChangeGreaterThan", d.DaysAfterLastTierChangeGreaterThan)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DateAfterCreation.
+func (d *DateAfterCreation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "daysAfterCreationGreaterThan":
+ err = unpopulate(val, "DaysAfterCreationGreaterThan", &d.DaysAfterCreationGreaterThan)
+ delete(rawMsg, key)
+ case "daysAfterLastTierChangeGreaterThan":
+ err = unpopulate(val, "DaysAfterLastTierChangeGreaterThan", &d.DaysAfterLastTierChangeGreaterThan)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DateAfterModification.
+func (d DateAfterModification) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "daysAfterCreationGreaterThan", d.DaysAfterCreationGreaterThan)
+ populate(objectMap, "daysAfterLastAccessTimeGreaterThan", d.DaysAfterLastAccessTimeGreaterThan)
+ populate(objectMap, "daysAfterLastTierChangeGreaterThan", d.DaysAfterLastTierChangeGreaterThan)
+ populate(objectMap, "daysAfterModificationGreaterThan", d.DaysAfterModificationGreaterThan)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DateAfterModification.
+func (d *DateAfterModification) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "daysAfterCreationGreaterThan":
+ err = unpopulate(val, "DaysAfterCreationGreaterThan", &d.DaysAfterCreationGreaterThan)
+ delete(rawMsg, key)
+ case "daysAfterLastAccessTimeGreaterThan":
+ err = unpopulate(val, "DaysAfterLastAccessTimeGreaterThan", &d.DaysAfterLastAccessTimeGreaterThan)
+ delete(rawMsg, key)
+ case "daysAfterLastTierChangeGreaterThan":
+ err = unpopulate(val, "DaysAfterLastTierChangeGreaterThan", &d.DaysAfterLastTierChangeGreaterThan)
+ delete(rawMsg, key)
+ case "daysAfterModificationGreaterThan":
+ err = unpopulate(val, "DaysAfterModificationGreaterThan", &d.DaysAfterModificationGreaterThan)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeleteRetentionPolicy.
+func (d DeleteRetentionPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "allowPermanentDelete", d.AllowPermanentDelete)
+ populate(objectMap, "days", d.Days)
+ populate(objectMap, "enabled", d.Enabled)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeleteRetentionPolicy.
+func (d *DeleteRetentionPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "allowPermanentDelete":
+ err = unpopulate(val, "AllowPermanentDelete", &d.AllowPermanentDelete)
+ delete(rawMsg, key)
+ case "days":
+ err = unpopulate(val, "Days", &d.Days)
+ delete(rawMsg, key)
+ case "enabled":
+ err = unpopulate(val, "Enabled", &d.Enabled)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeletedAccount.
+func (d DeletedAccount) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", d.ID)
+ populate(objectMap, "name", d.Name)
+ populate(objectMap, "properties", d.Properties)
+ populate(objectMap, "type", d.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedAccount.
+func (d *DeletedAccount) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &d.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &d.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &d.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &d.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeletedAccountListResult.
+func (d DeletedAccountListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", d.NextLink)
+ populate(objectMap, "value", d.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedAccountListResult.
+func (d *DeletedAccountListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &d.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &d.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeletedAccountProperties.
+func (d DeletedAccountProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "creationTime", d.CreationTime)
+ populate(objectMap, "deletionTime", d.DeletionTime)
+ populate(objectMap, "location", d.Location)
+ populate(objectMap, "restoreReference", d.RestoreReference)
+ populate(objectMap, "storageAccountResourceId", d.StorageAccountResourceID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedAccountProperties.
+func (d *DeletedAccountProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "creationTime":
+ err = unpopulate(val, "CreationTime", &d.CreationTime)
+ delete(rawMsg, key)
+ case "deletionTime":
+ err = unpopulate(val, "DeletionTime", &d.DeletionTime)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &d.Location)
+ delete(rawMsg, key)
+ case "restoreReference":
+ err = unpopulate(val, "RestoreReference", &d.RestoreReference)
+ delete(rawMsg, key)
+ case "storageAccountResourceId":
+ err = unpopulate(val, "StorageAccountResourceID", &d.StorageAccountResourceID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeletedShare.
+func (d DeletedShare) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "deletedShareName", d.DeletedShareName)
+ populate(objectMap, "deletedShareVersion", d.DeletedShareVersion)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedShare.
+func (d *DeletedShare) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "deletedShareName":
+ err = unpopulate(val, "DeletedShareName", &d.DeletedShareName)
+ delete(rawMsg, key)
+ case "deletedShareVersion":
+ err = unpopulate(val, "DeletedShareVersion", &d.DeletedShareVersion)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Dimension.
+func (d Dimension) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "displayName", d.DisplayName)
+ populate(objectMap, "name", d.Name)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Dimension.
+func (d *Dimension) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "displayName":
+ err = unpopulate(val, "DisplayName", &d.DisplayName)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &d.Name)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DualStackEndpointPreference.
+func (d DualStackEndpointPreference) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "publishIpv6Endpoint", d.PublishIPv6Endpoint)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DualStackEndpointPreference.
+func (d *DualStackEndpointPreference) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "publishIpv6Endpoint":
+ err = unpopulate(val, "PublishIPv6Endpoint", &d.PublishIPv6Endpoint)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Encryption.
+func (e Encryption) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "identity", e.EncryptionIdentity)
+ populate(objectMap, "keySource", e.KeySource)
+ populate(objectMap, "keyvaultproperties", e.KeyVaultProperties)
+ populate(objectMap, "requireInfrastructureEncryption", e.RequireInfrastructureEncryption)
+ populate(objectMap, "services", e.Services)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Encryption.
+func (e *Encryption) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "identity":
+ err = unpopulate(val, "EncryptionIdentity", &e.EncryptionIdentity)
+ delete(rawMsg, key)
+ case "keySource":
+ err = unpopulate(val, "KeySource", &e.KeySource)
+ delete(rawMsg, key)
+ case "keyvaultproperties":
+ err = unpopulate(val, "KeyVaultProperties", &e.KeyVaultProperties)
+ delete(rawMsg, key)
+ case "requireInfrastructureEncryption":
+ err = unpopulate(val, "RequireInfrastructureEncryption", &e.RequireInfrastructureEncryption)
+ delete(rawMsg, key)
+ case "services":
+ err = unpopulate(val, "Services", &e.Services)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type EncryptionIdentity.
+func (e EncryptionIdentity) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "federatedIdentityClientId", e.EncryptionFederatedIdentityClientID)
+ populate(objectMap, "userAssignedIdentity", e.EncryptionUserAssignedIdentity)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionIdentity.
+func (e *EncryptionIdentity) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "federatedIdentityClientId":
+ err = unpopulate(val, "EncryptionFederatedIdentityClientID", &e.EncryptionFederatedIdentityClientID)
+ delete(rawMsg, key)
+ case "userAssignedIdentity":
+ err = unpopulate(val, "EncryptionUserAssignedIdentity", &e.EncryptionUserAssignedIdentity)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type EncryptionInTransit.
+func (e EncryptionInTransit) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "required", e.Required)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionInTransit.
+func (e *EncryptionInTransit) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "required":
+ err = unpopulate(val, "Required", &e.Required)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type EncryptionScope.
+func (e EncryptionScope) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", e.EncryptionScopeProperties)
+ populate(objectMap, "id", e.ID)
+ populate(objectMap, "name", e.Name)
+ populate(objectMap, "type", e.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionScope.
+func (e *EncryptionScope) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "EncryptionScopeProperties", &e.EncryptionScopeProperties)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &e.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &e.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &e.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type EncryptionScopeKeyVaultProperties.
+func (e EncryptionScopeKeyVaultProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "currentVersionedKeyIdentifier", e.CurrentVersionedKeyIdentifier)
+ populate(objectMap, "keyUri", e.KeyURI)
+ populateDateTimeRFC3339(objectMap, "lastKeyRotationTimestamp", e.LastKeyRotationTimestamp)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionScopeKeyVaultProperties.
+func (e *EncryptionScopeKeyVaultProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "currentVersionedKeyIdentifier":
+ err = unpopulate(val, "CurrentVersionedKeyIdentifier", &e.CurrentVersionedKeyIdentifier)
+ delete(rawMsg, key)
+ case "keyUri":
+ err = unpopulate(val, "KeyURI", &e.KeyURI)
+ delete(rawMsg, key)
+ case "lastKeyRotationTimestamp":
+ err = unpopulateDateTimeRFC3339(val, "LastKeyRotationTimestamp", &e.LastKeyRotationTimestamp)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type EncryptionScopeListResult.
+func (e EncryptionScopeListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", e.NextLink)
+ populate(objectMap, "value", e.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionScopeListResult.
+func (e *EncryptionScopeListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &e.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &e.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type EncryptionScopeProperties.
+func (e EncryptionScopeProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "creationTime", e.CreationTime)
+ populate(objectMap, "keyVaultProperties", e.KeyVaultProperties)
+ populateDateTimeRFC3339(objectMap, "lastModifiedTime", e.LastModifiedTime)
+ populate(objectMap, "requireInfrastructureEncryption", e.RequireInfrastructureEncryption)
+ populate(objectMap, "source", e.Source)
+ populate(objectMap, "state", e.State)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionScopeProperties.
+func (e *EncryptionScopeProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "creationTime":
+ err = unpopulateDateTimeRFC3339(val, "CreationTime", &e.CreationTime)
+ delete(rawMsg, key)
+ case "keyVaultProperties":
+ err = unpopulate(val, "KeyVaultProperties", &e.KeyVaultProperties)
+ delete(rawMsg, key)
+ case "lastModifiedTime":
+ err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &e.LastModifiedTime)
+ delete(rawMsg, key)
+ case "requireInfrastructureEncryption":
+ err = unpopulate(val, "RequireInfrastructureEncryption", &e.RequireInfrastructureEncryption)
+ delete(rawMsg, key)
+ case "source":
+ err = unpopulate(val, "Source", &e.Source)
+ delete(rawMsg, key)
+ case "state":
+ err = unpopulate(val, "State", &e.State)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type EncryptionService.
+func (e EncryptionService) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "enabled", e.Enabled)
+ populate(objectMap, "keyType", e.KeyType)
+ populateDateTimeRFC3339(objectMap, "lastEnabledTime", e.LastEnabledTime)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionService.
+func (e *EncryptionService) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "enabled":
+ err = unpopulate(val, "Enabled", &e.Enabled)
+ delete(rawMsg, key)
+ case "keyType":
+ err = unpopulate(val, "KeyType", &e.KeyType)
+ delete(rawMsg, key)
+ case "lastEnabledTime":
+ err = unpopulateDateTimeRFC3339(val, "LastEnabledTime", &e.LastEnabledTime)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type EncryptionServices.
+func (e EncryptionServices) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blob", e.Blob)
+ populate(objectMap, "file", e.File)
+ populate(objectMap, "queue", e.Queue)
+ populate(objectMap, "table", e.Table)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionServices.
+func (e *EncryptionServices) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blob":
+ err = unpopulate(val, "Blob", &e.Blob)
+ delete(rawMsg, key)
+ case "file":
+ err = unpopulate(val, "File", &e.File)
+ delete(rawMsg, key)
+ case "queue":
+ err = unpopulate(val, "Queue", &e.Queue)
+ delete(rawMsg, key)
+ case "table":
+ err = unpopulate(val, "Table", &e.Table)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Endpoints.
+func (e Endpoints) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blob", e.Blob)
+ populate(objectMap, "dfs", e.Dfs)
+ populate(objectMap, "file", e.File)
+ populate(objectMap, "ipv6Endpoints", e.IPv6Endpoints)
+ populate(objectMap, "internetEndpoints", e.InternetEndpoints)
+ populate(objectMap, "microsoftEndpoints", e.MicrosoftEndpoints)
+ populate(objectMap, "queue", e.Queue)
+ populate(objectMap, "table", e.Table)
+ populate(objectMap, "web", e.Web)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Endpoints.
+func (e *Endpoints) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blob":
+ err = unpopulate(val, "Blob", &e.Blob)
+ delete(rawMsg, key)
+ case "dfs":
+ err = unpopulate(val, "Dfs", &e.Dfs)
+ delete(rawMsg, key)
+ case "file":
+ err = unpopulate(val, "File", &e.File)
+ delete(rawMsg, key)
+ case "ipv6Endpoints":
+ err = unpopulate(val, "IPv6Endpoints", &e.IPv6Endpoints)
+ delete(rawMsg, key)
+ case "internetEndpoints":
+ err = unpopulate(val, "InternetEndpoints", &e.InternetEndpoints)
+ delete(rawMsg, key)
+ case "microsoftEndpoints":
+ err = unpopulate(val, "MicrosoftEndpoints", &e.MicrosoftEndpoints)
+ delete(rawMsg, key)
+ case "queue":
+ err = unpopulate(val, "Queue", &e.Queue)
+ delete(rawMsg, key)
+ case "table":
+ err = unpopulate(val, "Table", &e.Table)
+ delete(rawMsg, key)
+ case "web":
+ err = unpopulate(val, "Web", &e.Web)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo.
+func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateAny(objectMap, "info", e.Info)
+ populate(objectMap, "type", e.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo.
+func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "info":
+ err = unpopulate(val, "Info", &e.Info)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &e.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ErrorDetail.
+func (e ErrorDetail) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "additionalInfo", e.AdditionalInfo)
+ populate(objectMap, "code", e.Code)
+ populate(objectMap, "details", e.Details)
+ populate(objectMap, "message", e.Message)
+ populate(objectMap, "target", e.Target)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail.
+func (e *ErrorDetail) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "additionalInfo":
+ err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo)
+ delete(rawMsg, key)
+ case "code":
+ err = unpopulate(val, "Code", &e.Code)
+ delete(rawMsg, key)
+ case "details":
+ err = unpopulate(val, "Details", &e.Details)
+ delete(rawMsg, key)
+ case "message":
+ err = unpopulate(val, "Message", &e.Message)
+ delete(rawMsg, key)
+ case "target":
+ err = unpopulate(val, "Target", &e.Target)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ErrorResponse.
+func (e ErrorResponse) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "error", e.Error)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.
+func (e *ErrorResponse) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "error":
+ err = unpopulate(val, "Error", &e.Error)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ErrorResponseAutoGenerated.
+func (e ErrorResponseAutoGenerated) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "error", e.Error)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseAutoGenerated.
+func (e *ErrorResponseAutoGenerated) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "error":
+ err = unpopulate(val, "Error", &e.Error)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ErrorResponseBody.
+func (e ErrorResponseBody) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "code", e.Code)
+ populate(objectMap, "message", e.Message)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseBody.
+func (e *ErrorResponseBody) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "code":
+ err = unpopulate(val, "Code", &e.Code)
+ delete(rawMsg, key)
+ case "message":
+ err = unpopulate(val, "Message", &e.Message)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ExecutionTarget.
+func (e ExecutionTarget) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "excludePrefix", e.ExcludePrefix)
+ populate(objectMap, "prefix", e.Prefix)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ExecutionTarget.
+func (e *ExecutionTarget) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "excludePrefix":
+ err = unpopulate(val, "ExcludePrefix", &e.ExcludePrefix)
+ delete(rawMsg, key)
+ case "prefix":
+ err = unpopulate(val, "Prefix", &e.Prefix)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ExecutionTrigger.
+func (e ExecutionTrigger) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "parameters", e.Parameters)
+ populate(objectMap, "type", e.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ExecutionTrigger.
+func (e *ExecutionTrigger) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "parameters":
+ err = unpopulate(val, "Parameters", &e.Parameters)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &e.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ExecutionTriggerUpdate.
+func (e ExecutionTriggerUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "parameters", e.Parameters)
+ populate(objectMap, "type", e.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ExecutionTriggerUpdate.
+func (e *ExecutionTriggerUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "parameters":
+ err = unpopulate(val, "Parameters", &e.Parameters)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &e.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ExtendedLocation.
+func (e ExtendedLocation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", e.Name)
+ populate(objectMap, "type", e.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedLocation.
+func (e *ExtendedLocation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &e.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &e.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FileServiceItems.
+func (f FileServiceItems) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", f.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FileServiceItems.
+func (f *FileServiceItems) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &f.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FileServiceProperties.
+func (f FileServiceProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", f.FileServiceProperties)
+ populate(objectMap, "id", f.ID)
+ populate(objectMap, "name", f.Name)
+ populate(objectMap, "sku", f.SKU)
+ populate(objectMap, "type", f.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FileServiceProperties.
+func (f *FileServiceProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "FileServiceProperties", &f.FileServiceProperties)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &f.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &f.Name)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &f.SKU)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &f.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FileServicePropertiesProperties.
+func (f FileServicePropertiesProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "cors", f.Cors)
+ populate(objectMap, "protocolSettings", f.ProtocolSettings)
+ populate(objectMap, "shareDeleteRetentionPolicy", f.ShareDeleteRetentionPolicy)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FileServicePropertiesProperties.
+func (f *FileServicePropertiesProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "cors":
+ err = unpopulate(val, "Cors", &f.Cors)
+ delete(rawMsg, key)
+ case "protocolSettings":
+ err = unpopulate(val, "ProtocolSettings", &f.ProtocolSettings)
+ delete(rawMsg, key)
+ case "shareDeleteRetentionPolicy":
+ err = unpopulate(val, "ShareDeleteRetentionPolicy", &f.ShareDeleteRetentionPolicy)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FileServiceUsage.
+func (f FileServiceUsage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", f.ID)
+ populate(objectMap, "name", f.Name)
+ populate(objectMap, "properties", f.Properties)
+ populate(objectMap, "type", f.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FileServiceUsage.
+func (f *FileServiceUsage) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &f.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &f.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &f.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &f.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FileServiceUsageProperties.
+func (f FileServiceUsageProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "burstingConstants", f.BurstingConstants)
+ populate(objectMap, "fileShareLimits", f.FileShareLimits)
+ populate(objectMap, "fileShareRecommendations", f.FileShareRecommendations)
+ populate(objectMap, "storageAccountLimits", f.StorageAccountLimits)
+ populate(objectMap, "storageAccountUsage", f.StorageAccountUsage)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FileServiceUsageProperties.
+func (f *FileServiceUsageProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "burstingConstants":
+ err = unpopulate(val, "BurstingConstants", &f.BurstingConstants)
+ delete(rawMsg, key)
+ case "fileShareLimits":
+ err = unpopulate(val, "FileShareLimits", &f.FileShareLimits)
+ delete(rawMsg, key)
+ case "fileShareRecommendations":
+ err = unpopulate(val, "FileShareRecommendations", &f.FileShareRecommendations)
+ delete(rawMsg, key)
+ case "storageAccountLimits":
+ err = unpopulate(val, "StorageAccountLimits", &f.StorageAccountLimits)
+ delete(rawMsg, key)
+ case "storageAccountUsage":
+ err = unpopulate(val, "StorageAccountUsage", &f.StorageAccountUsage)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FileServiceUsages.
+func (f FileServiceUsages) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", f.NextLink)
+ populate(objectMap, "value", f.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FileServiceUsages.
+func (f *FileServiceUsages) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &f.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &f.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FileShare.
+func (f FileShare) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "etag", f.Etag)
+ populate(objectMap, "properties", f.FileShareProperties)
+ populate(objectMap, "id", f.ID)
+ populate(objectMap, "name", f.Name)
+ populate(objectMap, "type", f.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FileShare.
+func (f *FileShare) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "etag":
+ err = unpopulate(val, "Etag", &f.Etag)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "FileShareProperties", &f.FileShareProperties)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &f.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &f.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &f.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FileShareItem.
+func (f FileShareItem) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "etag", f.Etag)
+ populate(objectMap, "id", f.ID)
+ populate(objectMap, "name", f.Name)
+ populate(objectMap, "properties", f.Properties)
+ populate(objectMap, "type", f.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FileShareItem.
+func (f *FileShareItem) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "etag":
+ err = unpopulate(val, "Etag", &f.Etag)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &f.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &f.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &f.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &f.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FileShareItems.
+func (f FileShareItems) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", f.NextLink)
+ populate(objectMap, "value", f.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FileShareItems.
+func (f *FileShareItems) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &f.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &f.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FileShareLimits.
+func (f FileShareLimits) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "maxProvisionedBandwidthMiBPerSec", f.MaxProvisionedBandwidthMiBPerSec)
+ populate(objectMap, "maxProvisionedIOPS", f.MaxProvisionedIOPS)
+ populate(objectMap, "maxProvisionedStorageGiB", f.MaxProvisionedStorageGiB)
+ populate(objectMap, "minProvisionedBandwidthMiBPerSec", f.MinProvisionedBandwidthMiBPerSec)
+ populate(objectMap, "minProvisionedIOPS", f.MinProvisionedIOPS)
+ populate(objectMap, "minProvisionedStorageGiB", f.MinProvisionedStorageGiB)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FileShareLimits.
+func (f *FileShareLimits) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "maxProvisionedBandwidthMiBPerSec":
+ err = unpopulate(val, "MaxProvisionedBandwidthMiBPerSec", &f.MaxProvisionedBandwidthMiBPerSec)
+ delete(rawMsg, key)
+ case "maxProvisionedIOPS":
+ err = unpopulate(val, "MaxProvisionedIOPS", &f.MaxProvisionedIOPS)
+ delete(rawMsg, key)
+ case "maxProvisionedStorageGiB":
+ err = unpopulate(val, "MaxProvisionedStorageGiB", &f.MaxProvisionedStorageGiB)
+ delete(rawMsg, key)
+ case "minProvisionedBandwidthMiBPerSec":
+ err = unpopulate(val, "MinProvisionedBandwidthMiBPerSec", &f.MinProvisionedBandwidthMiBPerSec)
+ delete(rawMsg, key)
+ case "minProvisionedIOPS":
+ err = unpopulate(val, "MinProvisionedIOPS", &f.MinProvisionedIOPS)
+ delete(rawMsg, key)
+ case "minProvisionedStorageGiB":
+ err = unpopulate(val, "MinProvisionedStorageGiB", &f.MinProvisionedStorageGiB)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FileShareProperties.
+func (f FileShareProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "accessTier", f.AccessTier)
+ populateDateTimeRFC3339(objectMap, "accessTierChangeTime", f.AccessTierChangeTime)
+ populate(objectMap, "accessTierStatus", f.AccessTierStatus)
+ populate(objectMap, "deleted", f.Deleted)
+ populateDateTimeRFC3339(objectMap, "deletedTime", f.DeletedTime)
+ populate(objectMap, "enabledProtocols", f.EnabledProtocols)
+ populate(objectMap, "fileSharePaidBursting", f.FileSharePaidBursting)
+ populate(objectMap, "includedBurstIops", f.IncludedBurstIops)
+ populateDateTimeRFC3339(objectMap, "lastModifiedTime", f.LastModifiedTime)
+ populate(objectMap, "leaseDuration", f.LeaseDuration)
+ populate(objectMap, "leaseState", f.LeaseState)
+ populate(objectMap, "leaseStatus", f.LeaseStatus)
+ populate(objectMap, "maxBurstCreditsForIops", f.MaxBurstCreditsForIops)
+ populate(objectMap, "metadata", f.Metadata)
+ populateDateTimeRFC1123(objectMap, "nextAllowedProvisionedBandwidthDowngradeTime", f.NextAllowedProvisionedBandwidthDowngradeTime)
+ populateDateTimeRFC1123(objectMap, "nextAllowedProvisionedIopsDowngradeTime", f.NextAllowedProvisionedIopsDowngradeTime)
+ populateDateTimeRFC1123(objectMap, "nextAllowedQuotaDowngradeTime", f.NextAllowedQuotaDowngradeTime)
+ populate(objectMap, "provisionedBandwidthMibps", f.ProvisionedBandwidthMibps)
+ populate(objectMap, "provisionedIops", f.ProvisionedIops)
+ populate(objectMap, "remainingRetentionDays", f.RemainingRetentionDays)
+ populate(objectMap, "rootSquash", f.RootSquash)
+ populate(objectMap, "shareQuota", f.ShareQuota)
+ populate(objectMap, "shareUsageBytes", f.ShareUsageBytes)
+ populate(objectMap, "signedIdentifiers", f.SignedIdentifiers)
+ populateDateTimeRFC3339(objectMap, "snapshotTime", f.SnapshotTime)
+ populate(objectMap, "version", f.Version)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FileShareProperties.
+func (f *FileShareProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "accessTier":
+ err = unpopulate(val, "AccessTier", &f.AccessTier)
+ delete(rawMsg, key)
+ case "accessTierChangeTime":
+ err = unpopulateDateTimeRFC3339(val, "AccessTierChangeTime", &f.AccessTierChangeTime)
+ delete(rawMsg, key)
+ case "accessTierStatus":
+ err = unpopulate(val, "AccessTierStatus", &f.AccessTierStatus)
+ delete(rawMsg, key)
+ case "deleted":
+ err = unpopulate(val, "Deleted", &f.Deleted)
+ delete(rawMsg, key)
+ case "deletedTime":
+ err = unpopulateDateTimeRFC3339(val, "DeletedTime", &f.DeletedTime)
+ delete(rawMsg, key)
+ case "enabledProtocols":
+ err = unpopulate(val, "EnabledProtocols", &f.EnabledProtocols)
+ delete(rawMsg, key)
+ case "fileSharePaidBursting":
+ err = unpopulate(val, "FileSharePaidBursting", &f.FileSharePaidBursting)
+ delete(rawMsg, key)
+ case "includedBurstIops":
+ err = unpopulate(val, "IncludedBurstIops", &f.IncludedBurstIops)
+ delete(rawMsg, key)
+ case "lastModifiedTime":
+ err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &f.LastModifiedTime)
+ delete(rawMsg, key)
+ case "leaseDuration":
+ err = unpopulate(val, "LeaseDuration", &f.LeaseDuration)
+ delete(rawMsg, key)
+ case "leaseState":
+ err = unpopulate(val, "LeaseState", &f.LeaseState)
+ delete(rawMsg, key)
+ case "leaseStatus":
+ err = unpopulate(val, "LeaseStatus", &f.LeaseStatus)
+ delete(rawMsg, key)
+ case "maxBurstCreditsForIops":
+ err = unpopulate(val, "MaxBurstCreditsForIops", &f.MaxBurstCreditsForIops)
+ delete(rawMsg, key)
+ case "metadata":
+ err = unpopulate(val, "Metadata", &f.Metadata)
+ delete(rawMsg, key)
+ case "nextAllowedProvisionedBandwidthDowngradeTime":
+ err = unpopulateDateTimeRFC1123(val, "NextAllowedProvisionedBandwidthDowngradeTime", &f.NextAllowedProvisionedBandwidthDowngradeTime)
+ delete(rawMsg, key)
+ case "nextAllowedProvisionedIopsDowngradeTime":
+ err = unpopulateDateTimeRFC1123(val, "NextAllowedProvisionedIopsDowngradeTime", &f.NextAllowedProvisionedIopsDowngradeTime)
+ delete(rawMsg, key)
+ case "nextAllowedQuotaDowngradeTime":
+ err = unpopulateDateTimeRFC1123(val, "NextAllowedQuotaDowngradeTime", &f.NextAllowedQuotaDowngradeTime)
+ delete(rawMsg, key)
+ case "provisionedBandwidthMibps":
+ err = unpopulate(val, "ProvisionedBandwidthMibps", &f.ProvisionedBandwidthMibps)
+ delete(rawMsg, key)
+ case "provisionedIops":
+ err = unpopulate(val, "ProvisionedIops", &f.ProvisionedIops)
+ delete(rawMsg, key)
+ case "remainingRetentionDays":
+ err = unpopulate(val, "RemainingRetentionDays", &f.RemainingRetentionDays)
+ delete(rawMsg, key)
+ case "rootSquash":
+ err = unpopulate(val, "RootSquash", &f.RootSquash)
+ delete(rawMsg, key)
+ case "shareQuota":
+ err = unpopulate(val, "ShareQuota", &f.ShareQuota)
+ delete(rawMsg, key)
+ case "shareUsageBytes":
+ err = unpopulate(val, "ShareUsageBytes", &f.ShareUsageBytes)
+ delete(rawMsg, key)
+ case "signedIdentifiers":
+ err = unpopulate(val, "SignedIdentifiers", &f.SignedIdentifiers)
+ delete(rawMsg, key)
+ case "snapshotTime":
+ err = unpopulateDateTimeRFC3339(val, "SnapshotTime", &f.SnapshotTime)
+ delete(rawMsg, key)
+ case "version":
+ err = unpopulate(val, "Version", &f.Version)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FileSharePropertiesFileSharePaidBursting.
+func (f FileSharePropertiesFileSharePaidBursting) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "paidBurstingEnabled", f.PaidBurstingEnabled)
+ populate(objectMap, "paidBurstingMaxBandwidthMibps", f.PaidBurstingMaxBandwidthMibps)
+ populate(objectMap, "paidBurstingMaxIops", f.PaidBurstingMaxIops)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FileSharePropertiesFileSharePaidBursting.
+func (f *FileSharePropertiesFileSharePaidBursting) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "paidBurstingEnabled":
+ err = unpopulate(val, "PaidBurstingEnabled", &f.PaidBurstingEnabled)
+ delete(rawMsg, key)
+ case "paidBurstingMaxBandwidthMibps":
+ err = unpopulate(val, "PaidBurstingMaxBandwidthMibps", &f.PaidBurstingMaxBandwidthMibps)
+ delete(rawMsg, key)
+ case "paidBurstingMaxIops":
+ err = unpopulate(val, "PaidBurstingMaxIops", &f.PaidBurstingMaxIops)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FileShareRecommendations.
+func (f FileShareRecommendations) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "bandwidthScalar", f.BandwidthScalar)
+ populate(objectMap, "baseBandwidthMiBPerSec", f.BaseBandwidthMiBPerSec)
+ populate(objectMap, "baseIOPS", f.BaseIOPS)
+ populate(objectMap, "ioScalar", f.IoScalar)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FileShareRecommendations.
+func (f *FileShareRecommendations) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "bandwidthScalar":
+ err = unpopulate(val, "BandwidthScalar", &f.BandwidthScalar)
+ delete(rawMsg, key)
+ case "baseBandwidthMiBPerSec":
+ err = unpopulate(val, "BaseBandwidthMiBPerSec", &f.BaseBandwidthMiBPerSec)
+ delete(rawMsg, key)
+ case "baseIOPS":
+ err = unpopulate(val, "BaseIOPS", &f.BaseIOPS)
+ delete(rawMsg, key)
+ case "ioScalar":
+ err = unpopulate(val, "IoScalar", &f.IoScalar)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GeoReplicationStats.
+func (g GeoReplicationStats) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "canFailover", g.CanFailover)
+ populate(objectMap, "canPlannedFailover", g.CanPlannedFailover)
+ populateDateTimeRFC3339(objectMap, "lastSyncTime", g.LastSyncTime)
+ populate(objectMap, "postFailoverRedundancy", g.PostFailoverRedundancy)
+ populate(objectMap, "postPlannedFailoverRedundancy", g.PostPlannedFailoverRedundancy)
+ populate(objectMap, "status", g.Status)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GeoReplicationStats.
+func (g *GeoReplicationStats) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "canFailover":
+ err = unpopulate(val, "CanFailover", &g.CanFailover)
+ delete(rawMsg, key)
+ case "canPlannedFailover":
+ err = unpopulate(val, "CanPlannedFailover", &g.CanPlannedFailover)
+ delete(rawMsg, key)
+ case "lastSyncTime":
+ err = unpopulateDateTimeRFC3339(val, "LastSyncTime", &g.LastSyncTime)
+ delete(rawMsg, key)
+ case "postFailoverRedundancy":
+ err = unpopulate(val, "PostFailoverRedundancy", &g.PostFailoverRedundancy)
+ delete(rawMsg, key)
+ case "postPlannedFailoverRedundancy":
+ err = unpopulate(val, "PostPlannedFailoverRedundancy", &g.PostPlannedFailoverRedundancy)
+ delete(rawMsg, key)
+ case "status":
+ err = unpopulate(val, "Status", &g.Status)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type IPRule.
+func (i IPRule) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ objectMap["action"] = "Allow"
+ populate(objectMap, "value", i.IPAddressOrRange)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type IPRule.
+func (i *IPRule) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "action":
+ err = unpopulate(val, "Action", &i.Action)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "IPAddressOrRange", &i.IPAddressOrRange)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Identity.
+func (i Identity) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "principalId", i.PrincipalID)
+ populate(objectMap, "tenantId", i.TenantID)
+ populate(objectMap, "type", i.Type)
+ populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Identity.
+func (i *Identity) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "principalId":
+ err = unpopulate(val, "PrincipalID", &i.PrincipalID)
+ delete(rawMsg, key)
+ case "tenantId":
+ err = unpopulate(val, "TenantID", &i.TenantID)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &i.Type)
+ delete(rawMsg, key)
+ case "userAssignedIdentities":
+ err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ImmutabilityPolicy.
+func (i ImmutabilityPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "etag", i.Etag)
+ populate(objectMap, "id", i.ID)
+ populate(objectMap, "name", i.Name)
+ populate(objectMap, "properties", i.Properties)
+ populate(objectMap, "type", i.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ImmutabilityPolicy.
+func (i *ImmutabilityPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "etag":
+ err = unpopulate(val, "Etag", &i.Etag)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &i.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &i.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &i.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &i.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ImmutabilityPolicyProperties.
+func (i ImmutabilityPolicyProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "etag", i.Etag)
+ populate(objectMap, "properties", i.Properties)
+ populate(objectMap, "updateHistory", i.UpdateHistory)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ImmutabilityPolicyProperties.
+func (i *ImmutabilityPolicyProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "etag":
+ err = unpopulate(val, "Etag", &i.Etag)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &i.Properties)
+ delete(rawMsg, key)
+ case "updateHistory":
+ err = unpopulate(val, "UpdateHistory", &i.UpdateHistory)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ImmutabilityPolicyProperty.
+func (i ImmutabilityPolicyProperty) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "allowProtectedAppendWrites", i.AllowProtectedAppendWrites)
+ populate(objectMap, "allowProtectedAppendWritesAll", i.AllowProtectedAppendWritesAll)
+ populate(objectMap, "immutabilityPeriodSinceCreationInDays", i.ImmutabilityPeriodSinceCreationInDays)
+ populate(objectMap, "state", i.State)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ImmutabilityPolicyProperty.
+func (i *ImmutabilityPolicyProperty) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "allowProtectedAppendWrites":
+ err = unpopulate(val, "AllowProtectedAppendWrites", &i.AllowProtectedAppendWrites)
+ delete(rawMsg, key)
+ case "allowProtectedAppendWritesAll":
+ err = unpopulate(val, "AllowProtectedAppendWritesAll", &i.AllowProtectedAppendWritesAll)
+ delete(rawMsg, key)
+ case "immutabilityPeriodSinceCreationInDays":
+ err = unpopulate(val, "ImmutabilityPeriodSinceCreationInDays", &i.ImmutabilityPeriodSinceCreationInDays)
+ delete(rawMsg, key)
+ case "state":
+ err = unpopulate(val, "State", &i.State)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ImmutableStorageAccount.
+func (i ImmutableStorageAccount) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "enabled", i.Enabled)
+ populate(objectMap, "immutabilityPolicy", i.ImmutabilityPolicy)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ImmutableStorageAccount.
+func (i *ImmutableStorageAccount) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "enabled":
+ err = unpopulate(val, "Enabled", &i.Enabled)
+ delete(rawMsg, key)
+ case "immutabilityPolicy":
+ err = unpopulate(val, "ImmutabilityPolicy", &i.ImmutabilityPolicy)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ImmutableStorageWithVersioning.
+func (i ImmutableStorageWithVersioning) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "enabled", i.Enabled)
+ populate(objectMap, "migrationState", i.MigrationState)
+ populateDateTimeRFC3339(objectMap, "timeStamp", i.TimeStamp)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ImmutableStorageWithVersioning.
+func (i *ImmutableStorageWithVersioning) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "enabled":
+ err = unpopulate(val, "Enabled", &i.Enabled)
+ delete(rawMsg, key)
+ case "migrationState":
+ err = unpopulate(val, "MigrationState", &i.MigrationState)
+ delete(rawMsg, key)
+ case "timeStamp":
+ err = unpopulateDateTimeRFC3339(val, "TimeStamp", &i.TimeStamp)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type KeyCreationTime.
+func (k KeyCreationTime) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "key1", k.Key1)
+ populateDateTimeRFC3339(objectMap, "key2", k.Key2)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type KeyCreationTime.
+func (k *KeyCreationTime) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "key1":
+ err = unpopulateDateTimeRFC3339(val, "Key1", &k.Key1)
+ delete(rawMsg, key)
+ case "key2":
+ err = unpopulateDateTimeRFC3339(val, "Key2", &k.Key2)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type KeyPolicy.
+func (k KeyPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "keyExpirationPeriodInDays", k.KeyExpirationPeriodInDays)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type KeyPolicy.
+func (k *KeyPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "keyExpirationPeriodInDays":
+ err = unpopulate(val, "KeyExpirationPeriodInDays", &k.KeyExpirationPeriodInDays)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type KeyVaultProperties.
+func (k KeyVaultProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "currentVersionedKeyExpirationTimestamp", k.CurrentVersionedKeyExpirationTimestamp)
+ populate(objectMap, "currentVersionedKeyIdentifier", k.CurrentVersionedKeyIdentifier)
+ populate(objectMap, "keyname", k.KeyName)
+ populate(objectMap, "keyvaulturi", k.KeyVaultURI)
+ populate(objectMap, "keyversion", k.KeyVersion)
+ populateDateTimeRFC3339(objectMap, "lastKeyRotationTimestamp", k.LastKeyRotationTimestamp)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultProperties.
+func (k *KeyVaultProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "currentVersionedKeyExpirationTimestamp":
+ err = unpopulateDateTimeRFC3339(val, "CurrentVersionedKeyExpirationTimestamp", &k.CurrentVersionedKeyExpirationTimestamp)
+ delete(rawMsg, key)
+ case "currentVersionedKeyIdentifier":
+ err = unpopulate(val, "CurrentVersionedKeyIdentifier", &k.CurrentVersionedKeyIdentifier)
+ delete(rawMsg, key)
+ case "keyname":
+ err = unpopulate(val, "KeyName", &k.KeyName)
+ delete(rawMsg, key)
+ case "keyvaulturi":
+ err = unpopulate(val, "KeyVaultURI", &k.KeyVaultURI)
+ delete(rawMsg, key)
+ case "keyversion":
+ err = unpopulate(val, "KeyVersion", &k.KeyVersion)
+ delete(rawMsg, key)
+ case "lastKeyRotationTimestamp":
+ err = unpopulateDateTimeRFC3339(val, "LastKeyRotationTimestamp", &k.LastKeyRotationTimestamp)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LastAccessTimeTrackingPolicy.
+func (l LastAccessTimeTrackingPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blobType", l.BlobType)
+ populate(objectMap, "enable", l.Enable)
+ populate(objectMap, "name", l.Name)
+ populate(objectMap, "trackingGranularityInDays", l.TrackingGranularityInDays)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LastAccessTimeTrackingPolicy.
+func (l *LastAccessTimeTrackingPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blobType":
+ err = unpopulate(val, "BlobType", &l.BlobType)
+ delete(rawMsg, key)
+ case "enable":
+ err = unpopulate(val, "Enable", &l.Enable)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &l.Name)
+ delete(rawMsg, key)
+ case "trackingGranularityInDays":
+ err = unpopulate(val, "TrackingGranularityInDays", &l.TrackingGranularityInDays)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LeaseContainerRequest.
+func (l LeaseContainerRequest) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "action", l.Action)
+ populate(objectMap, "breakPeriod", l.BreakPeriod)
+ populate(objectMap, "leaseDuration", l.LeaseDuration)
+ populate(objectMap, "leaseId", l.LeaseID)
+ populate(objectMap, "proposedLeaseId", l.ProposedLeaseID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LeaseContainerRequest.
+func (l *LeaseContainerRequest) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "action":
+ err = unpopulate(val, "Action", &l.Action)
+ delete(rawMsg, key)
+ case "breakPeriod":
+ err = unpopulate(val, "BreakPeriod", &l.BreakPeriod)
+ delete(rawMsg, key)
+ case "leaseDuration":
+ err = unpopulate(val, "LeaseDuration", &l.LeaseDuration)
+ delete(rawMsg, key)
+ case "leaseId":
+ err = unpopulate(val, "LeaseID", &l.LeaseID)
+ delete(rawMsg, key)
+ case "proposedLeaseId":
+ err = unpopulate(val, "ProposedLeaseID", &l.ProposedLeaseID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LeaseContainerResponse.
+func (l LeaseContainerResponse) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "leaseId", l.LeaseID)
+ populate(objectMap, "leaseTimeSeconds", l.LeaseTimeSeconds)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LeaseContainerResponse.
+func (l *LeaseContainerResponse) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "leaseId":
+ err = unpopulate(val, "LeaseID", &l.LeaseID)
+ delete(rawMsg, key)
+ case "leaseTimeSeconds":
+ err = unpopulate(val, "LeaseTimeSeconds", &l.LeaseTimeSeconds)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LeaseShareRequest.
+func (l LeaseShareRequest) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "action", l.Action)
+ populate(objectMap, "breakPeriod", l.BreakPeriod)
+ populate(objectMap, "leaseDuration", l.LeaseDuration)
+ populate(objectMap, "leaseId", l.LeaseID)
+ populate(objectMap, "proposedLeaseId", l.ProposedLeaseID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LeaseShareRequest.
+func (l *LeaseShareRequest) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "action":
+ err = unpopulate(val, "Action", &l.Action)
+ delete(rawMsg, key)
+ case "breakPeriod":
+ err = unpopulate(val, "BreakPeriod", &l.BreakPeriod)
+ delete(rawMsg, key)
+ case "leaseDuration":
+ err = unpopulate(val, "LeaseDuration", &l.LeaseDuration)
+ delete(rawMsg, key)
+ case "leaseId":
+ err = unpopulate(val, "LeaseID", &l.LeaseID)
+ delete(rawMsg, key)
+ case "proposedLeaseId":
+ err = unpopulate(val, "ProposedLeaseID", &l.ProposedLeaseID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LeaseShareResponse.
+func (l LeaseShareResponse) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "leaseId", l.LeaseID)
+ populate(objectMap, "leaseTimeSeconds", l.LeaseTimeSeconds)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LeaseShareResponse.
+func (l *LeaseShareResponse) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "leaseId":
+ err = unpopulate(val, "LeaseID", &l.LeaseID)
+ delete(rawMsg, key)
+ case "leaseTimeSeconds":
+ err = unpopulate(val, "LeaseTimeSeconds", &l.LeaseTimeSeconds)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LegalHold.
+func (l LegalHold) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "allowProtectedAppendWritesAll", l.AllowProtectedAppendWritesAll)
+ populate(objectMap, "hasLegalHold", l.HasLegalHold)
+ populate(objectMap, "tags", l.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LegalHold.
+func (l *LegalHold) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "allowProtectedAppendWritesAll":
+ err = unpopulate(val, "AllowProtectedAppendWritesAll", &l.AllowProtectedAppendWritesAll)
+ delete(rawMsg, key)
+ case "hasLegalHold":
+ err = unpopulate(val, "HasLegalHold", &l.HasLegalHold)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &l.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LegalHoldProperties.
+func (l LegalHoldProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "hasLegalHold", l.HasLegalHold)
+ populate(objectMap, "protectedAppendWritesHistory", l.ProtectedAppendWritesHistory)
+ populate(objectMap, "tags", l.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LegalHoldProperties.
+func (l *LegalHoldProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "hasLegalHold":
+ err = unpopulate(val, "HasLegalHold", &l.HasLegalHold)
+ delete(rawMsg, key)
+ case "protectedAppendWritesHistory":
+ err = unpopulate(val, "ProtectedAppendWritesHistory", &l.ProtectedAppendWritesHistory)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &l.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListAccountSasResponse.
+func (l ListAccountSasResponse) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "accountSasToken", l.AccountSasToken)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListAccountSasResponse.
+func (l *ListAccountSasResponse) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "accountSasToken":
+ err = unpopulate(val, "AccountSasToken", &l.AccountSasToken)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListBlobInventoryPolicy.
+func (l ListBlobInventoryPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", l.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListBlobInventoryPolicy.
+func (l *ListBlobInventoryPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &l.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListContainerItem.
+func (l ListContainerItem) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "etag", l.Etag)
+ populate(objectMap, "id", l.ID)
+ populate(objectMap, "name", l.Name)
+ populate(objectMap, "properties", l.Properties)
+ populate(objectMap, "type", l.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListContainerItem.
+func (l *ListContainerItem) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "etag":
+ err = unpopulate(val, "Etag", &l.Etag)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &l.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &l.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &l.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &l.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListContainerItems.
+func (l ListContainerItems) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", l.NextLink)
+ populate(objectMap, "value", l.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListContainerItems.
+func (l *ListContainerItems) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &l.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &l.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListQueue.
+func (l ListQueue) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", l.ID)
+ populate(objectMap, "name", l.Name)
+ populate(objectMap, "properties", l.QueueProperties)
+ populate(objectMap, "type", l.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListQueue.
+func (l *ListQueue) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &l.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &l.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "QueueProperties", &l.QueueProperties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &l.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListQueueProperties.
+func (l ListQueueProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "metadata", l.Metadata)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListQueueProperties.
+func (l *ListQueueProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "metadata":
+ err = unpopulate(val, "Metadata", &l.Metadata)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListQueueResource.
+func (l ListQueueResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", l.NextLink)
+ populate(objectMap, "value", l.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListQueueResource.
+func (l *ListQueueResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &l.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &l.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListQueueServices.
+func (l ListQueueServices) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", l.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListQueueServices.
+func (l *ListQueueServices) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &l.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListServiceSasResponse.
+func (l ListServiceSasResponse) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "serviceSasToken", l.ServiceSasToken)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListServiceSasResponse.
+func (l *ListServiceSasResponse) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "serviceSasToken":
+ err = unpopulate(val, "ServiceSasToken", &l.ServiceSasToken)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListTableResource.
+func (l ListTableResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", l.NextLink)
+ populate(objectMap, "value", l.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListTableResource.
+func (l *ListTableResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &l.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &l.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListTableServices.
+func (l ListTableServices) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", l.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListTableServices.
+func (l *ListTableServices) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &l.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LocalUser.
+func (l LocalUser) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", l.ID)
+ populate(objectMap, "name", l.Name)
+ populate(objectMap, "properties", l.Properties)
+ populate(objectMap, "systemData", l.SystemData)
+ populate(objectMap, "type", l.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LocalUser.
+func (l *LocalUser) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &l.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &l.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &l.Properties)
+ delete(rawMsg, key)
+ case "systemData":
+ err = unpopulate(val, "SystemData", &l.SystemData)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &l.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LocalUserKeys.
+func (l LocalUserKeys) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "sshAuthorizedKeys", l.SSHAuthorizedKeys)
+ populate(objectMap, "sharedKey", l.SharedKey)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LocalUserKeys.
+func (l *LocalUserKeys) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "sshAuthorizedKeys":
+ err = unpopulate(val, "SSHAuthorizedKeys", &l.SSHAuthorizedKeys)
+ delete(rawMsg, key)
+ case "sharedKey":
+ err = unpopulate(val, "SharedKey", &l.SharedKey)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LocalUserProperties.
+func (l LocalUserProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "allowAclAuthorization", l.AllowACLAuthorization)
+ populate(objectMap, "extendedGroups", l.ExtendedGroups)
+ populate(objectMap, "groupId", l.GroupID)
+ populate(objectMap, "hasSshKey", l.HasSSHKey)
+ populate(objectMap, "hasSshPassword", l.HasSSHPassword)
+ populate(objectMap, "hasSharedKey", l.HasSharedKey)
+ populate(objectMap, "homeDirectory", l.HomeDirectory)
+ populate(objectMap, "isNFSv3Enabled", l.IsNFSv3Enabled)
+ populate(objectMap, "permissionScopes", l.PermissionScopes)
+ populate(objectMap, "sshAuthorizedKeys", l.SSHAuthorizedKeys)
+ populate(objectMap, "sid", l.Sid)
+ populate(objectMap, "userId", l.UserID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LocalUserProperties.
+func (l *LocalUserProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "allowAclAuthorization":
+ err = unpopulate(val, "AllowACLAuthorization", &l.AllowACLAuthorization)
+ delete(rawMsg, key)
+ case "extendedGroups":
+ err = unpopulate(val, "ExtendedGroups", &l.ExtendedGroups)
+ delete(rawMsg, key)
+ case "groupId":
+ err = unpopulate(val, "GroupID", &l.GroupID)
+ delete(rawMsg, key)
+ case "hasSshKey":
+ err = unpopulate(val, "HasSSHKey", &l.HasSSHKey)
+ delete(rawMsg, key)
+ case "hasSshPassword":
+ err = unpopulate(val, "HasSSHPassword", &l.HasSSHPassword)
+ delete(rawMsg, key)
+ case "hasSharedKey":
+ err = unpopulate(val, "HasSharedKey", &l.HasSharedKey)
+ delete(rawMsg, key)
+ case "homeDirectory":
+ err = unpopulate(val, "HomeDirectory", &l.HomeDirectory)
+ delete(rawMsg, key)
+ case "isNFSv3Enabled":
+ err = unpopulate(val, "IsNFSv3Enabled", &l.IsNFSv3Enabled)
+ delete(rawMsg, key)
+ case "permissionScopes":
+ err = unpopulate(val, "PermissionScopes", &l.PermissionScopes)
+ delete(rawMsg, key)
+ case "sshAuthorizedKeys":
+ err = unpopulate(val, "SSHAuthorizedKeys", &l.SSHAuthorizedKeys)
+ delete(rawMsg, key)
+ case "sid":
+ err = unpopulate(val, "Sid", &l.Sid)
+ delete(rawMsg, key)
+ case "userId":
+ err = unpopulate(val, "UserID", &l.UserID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LocalUserRegeneratePasswordResult.
+func (l LocalUserRegeneratePasswordResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "sshPassword", l.SSHPassword)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LocalUserRegeneratePasswordResult.
+func (l *LocalUserRegeneratePasswordResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "sshPassword":
+ err = unpopulate(val, "SSHPassword", &l.SSHPassword)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LocalUsers.
+func (l LocalUsers) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", l.NextLink)
+ populate(objectMap, "value", l.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LocalUsers.
+func (l *LocalUsers) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &l.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &l.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagementPolicy.
+func (m ManagementPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", m.ID)
+ populate(objectMap, "name", m.Name)
+ populate(objectMap, "properties", m.Properties)
+ populate(objectMap, "type", m.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicy.
+func (m *ManagementPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &m.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &m.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &m.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &m.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagementPolicyAction.
+func (m ManagementPolicyAction) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "baseBlob", m.BaseBlob)
+ populate(objectMap, "snapshot", m.Snapshot)
+ populate(objectMap, "version", m.Version)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyAction.
+func (m *ManagementPolicyAction) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "baseBlob":
+ err = unpopulate(val, "BaseBlob", &m.BaseBlob)
+ delete(rawMsg, key)
+ case "snapshot":
+ err = unpopulate(val, "Snapshot", &m.Snapshot)
+ delete(rawMsg, key)
+ case "version":
+ err = unpopulate(val, "Version", &m.Version)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagementPolicyBaseBlob.
+func (m ManagementPolicyBaseBlob) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "delete", m.Delete)
+ populate(objectMap, "enableAutoTierToHotFromCool", m.EnableAutoTierToHotFromCool)
+ populate(objectMap, "tierToArchive", m.TierToArchive)
+ populate(objectMap, "tierToCold", m.TierToCold)
+ populate(objectMap, "tierToCool", m.TierToCool)
+ populate(objectMap, "tierToHot", m.TierToHot)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyBaseBlob.
+func (m *ManagementPolicyBaseBlob) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "delete":
+ err = unpopulate(val, "Delete", &m.Delete)
+ delete(rawMsg, key)
+ case "enableAutoTierToHotFromCool":
+ err = unpopulate(val, "EnableAutoTierToHotFromCool", &m.EnableAutoTierToHotFromCool)
+ delete(rawMsg, key)
+ case "tierToArchive":
+ err = unpopulate(val, "TierToArchive", &m.TierToArchive)
+ delete(rawMsg, key)
+ case "tierToCold":
+ err = unpopulate(val, "TierToCold", &m.TierToCold)
+ delete(rawMsg, key)
+ case "tierToCool":
+ err = unpopulate(val, "TierToCool", &m.TierToCool)
+ delete(rawMsg, key)
+ case "tierToHot":
+ err = unpopulate(val, "TierToHot", &m.TierToHot)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagementPolicyDefinition.
+func (m ManagementPolicyDefinition) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "actions", m.Actions)
+ populate(objectMap, "filters", m.Filters)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyDefinition.
+func (m *ManagementPolicyDefinition) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "actions":
+ err = unpopulate(val, "Actions", &m.Actions)
+ delete(rawMsg, key)
+ case "filters":
+ err = unpopulate(val, "Filters", &m.Filters)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagementPolicyFilter.
+func (m ManagementPolicyFilter) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blobIndexMatch", m.BlobIndexMatch)
+ populate(objectMap, "blobTypes", m.BlobTypes)
+ populate(objectMap, "prefixMatch", m.PrefixMatch)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyFilter.
+func (m *ManagementPolicyFilter) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blobIndexMatch":
+ err = unpopulate(val, "BlobIndexMatch", &m.BlobIndexMatch)
+ delete(rawMsg, key)
+ case "blobTypes":
+ err = unpopulate(val, "BlobTypes", &m.BlobTypes)
+ delete(rawMsg, key)
+ case "prefixMatch":
+ err = unpopulate(val, "PrefixMatch", &m.PrefixMatch)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagementPolicyProperties.
+func (m ManagementPolicyProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "lastModifiedTime", m.LastModifiedTime)
+ populate(objectMap, "policy", m.Policy)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyProperties.
+func (m *ManagementPolicyProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "lastModifiedTime":
+ err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &m.LastModifiedTime)
+ delete(rawMsg, key)
+ case "policy":
+ err = unpopulate(val, "Policy", &m.Policy)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagementPolicyRule.
+func (m ManagementPolicyRule) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "definition", m.Definition)
+ populate(objectMap, "enabled", m.Enabled)
+ populate(objectMap, "name", m.Name)
+ populate(objectMap, "type", m.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyRule.
+func (m *ManagementPolicyRule) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "definition":
+ err = unpopulate(val, "Definition", &m.Definition)
+ delete(rawMsg, key)
+ case "enabled":
+ err = unpopulate(val, "Enabled", &m.Enabled)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &m.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &m.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagementPolicySchema.
+func (m ManagementPolicySchema) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "rules", m.Rules)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicySchema.
+func (m *ManagementPolicySchema) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "rules":
+ err = unpopulate(val, "Rules", &m.Rules)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagementPolicySnapShot.
+func (m ManagementPolicySnapShot) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "delete", m.Delete)
+ populate(objectMap, "tierToArchive", m.TierToArchive)
+ populate(objectMap, "tierToCold", m.TierToCold)
+ populate(objectMap, "tierToCool", m.TierToCool)
+ populate(objectMap, "tierToHot", m.TierToHot)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicySnapShot.
+func (m *ManagementPolicySnapShot) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "delete":
+ err = unpopulate(val, "Delete", &m.Delete)
+ delete(rawMsg, key)
+ case "tierToArchive":
+ err = unpopulate(val, "TierToArchive", &m.TierToArchive)
+ delete(rawMsg, key)
+ case "tierToCold":
+ err = unpopulate(val, "TierToCold", &m.TierToCold)
+ delete(rawMsg, key)
+ case "tierToCool":
+ err = unpopulate(val, "TierToCool", &m.TierToCool)
+ delete(rawMsg, key)
+ case "tierToHot":
+ err = unpopulate(val, "TierToHot", &m.TierToHot)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagementPolicyVersion.
+func (m ManagementPolicyVersion) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "delete", m.Delete)
+ populate(objectMap, "tierToArchive", m.TierToArchive)
+ populate(objectMap, "tierToCold", m.TierToCold)
+ populate(objectMap, "tierToCool", m.TierToCool)
+ populate(objectMap, "tierToHot", m.TierToHot)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyVersion.
+func (m *ManagementPolicyVersion) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "delete":
+ err = unpopulate(val, "Delete", &m.Delete)
+ delete(rawMsg, key)
+ case "tierToArchive":
+ err = unpopulate(val, "TierToArchive", &m.TierToArchive)
+ delete(rawMsg, key)
+ case "tierToCold":
+ err = unpopulate(val, "TierToCold", &m.TierToCold)
+ delete(rawMsg, key)
+ case "tierToCool":
+ err = unpopulate(val, "TierToCool", &m.TierToCool)
+ delete(rawMsg, key)
+ case "tierToHot":
+ err = unpopulate(val, "TierToHot", &m.TierToHot)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type MetricSpecification.
+func (m MetricSpecification) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "aggregationType", m.AggregationType)
+ populate(objectMap, "category", m.Category)
+ populate(objectMap, "dimensions", m.Dimensions)
+ populate(objectMap, "displayDescription", m.DisplayDescription)
+ populate(objectMap, "displayName", m.DisplayName)
+ populate(objectMap, "fillGapWithZero", m.FillGapWithZero)
+ populate(objectMap, "name", m.Name)
+ populate(objectMap, "resourceIdDimensionNameOverride", m.ResourceIDDimensionNameOverride)
+ populate(objectMap, "unit", m.Unit)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type MetricSpecification.
+func (m *MetricSpecification) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "aggregationType":
+ err = unpopulate(val, "AggregationType", &m.AggregationType)
+ delete(rawMsg, key)
+ case "category":
+ err = unpopulate(val, "Category", &m.Category)
+ delete(rawMsg, key)
+ case "dimensions":
+ err = unpopulate(val, "Dimensions", &m.Dimensions)
+ delete(rawMsg, key)
+ case "displayDescription":
+ err = unpopulate(val, "DisplayDescription", &m.DisplayDescription)
+ delete(rawMsg, key)
+ case "displayName":
+ err = unpopulate(val, "DisplayName", &m.DisplayName)
+ delete(rawMsg, key)
+ case "fillGapWithZero":
+ err = unpopulate(val, "FillGapWithZero", &m.FillGapWithZero)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &m.Name)
+ delete(rawMsg, key)
+ case "resourceIdDimensionNameOverride":
+ err = unpopulate(val, "ResourceIDDimensionNameOverride", &m.ResourceIDDimensionNameOverride)
+ delete(rawMsg, key)
+ case "unit":
+ err = unpopulate(val, "Unit", &m.Unit)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Multichannel.
+func (m Multichannel) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "enabled", m.Enabled)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Multichannel.
+func (m *Multichannel) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "enabled":
+ err = unpopulate(val, "Enabled", &m.Enabled)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSet.
+func (n NetworkRuleSet) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "bypass", n.Bypass)
+ populate(objectMap, "defaultAction", n.DefaultAction)
+ populate(objectMap, "ipRules", n.IPRules)
+ populate(objectMap, "ipv6Rules", n.IPv6Rules)
+ populate(objectMap, "resourceAccessRules", n.ResourceAccessRules)
+ populate(objectMap, "virtualNetworkRules", n.VirtualNetworkRules)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSet.
+func (n *NetworkRuleSet) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "bypass":
+ err = unpopulate(val, "Bypass", &n.Bypass)
+ delete(rawMsg, key)
+ case "defaultAction":
+ err = unpopulate(val, "DefaultAction", &n.DefaultAction)
+ delete(rawMsg, key)
+ case "ipRules":
+ err = unpopulate(val, "IPRules", &n.IPRules)
+ delete(rawMsg, key)
+ case "ipv6Rules":
+ err = unpopulate(val, "IPv6Rules", &n.IPv6Rules)
+ delete(rawMsg, key)
+ case "resourceAccessRules":
+ err = unpopulate(val, "ResourceAccessRules", &n.ResourceAccessRules)
+ delete(rawMsg, key)
+ case "virtualNetworkRules":
+ err = unpopulate(val, "VirtualNetworkRules", &n.VirtualNetworkRules)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeter.
+func (n NetworkSecurityPerimeter) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", n.ID)
+ populate(objectMap, "location", n.Location)
+ populate(objectMap, "perimeterGuid", n.PerimeterGUID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeter.
+func (n *NetworkSecurityPerimeter) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &n.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &n.Location)
+ delete(rawMsg, key)
+ case "perimeterGuid":
+ err = unpopulate(val, "PerimeterGUID", &n.PerimeterGUID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfiguration.
+func (n NetworkSecurityPerimeterConfiguration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", n.ID)
+ populate(objectMap, "name", n.Name)
+ populate(objectMap, "properties", n.Properties)
+ populate(objectMap, "systemData", n.SystemData)
+ populate(objectMap, "type", n.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfiguration.
+func (n *NetworkSecurityPerimeterConfiguration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &n.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &n.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &n.Properties)
+ delete(rawMsg, key)
+ case "systemData":
+ err = unpopulate(val, "SystemData", &n.SystemData)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &n.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationList.
+func (n NetworkSecurityPerimeterConfigurationList) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", n.NextLink)
+ populate(objectMap, "value", n.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationList.
+func (n *NetworkSecurityPerimeterConfigurationList) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &n.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &n.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationProperties.
+func (n NetworkSecurityPerimeterConfigurationProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "networkSecurityPerimeter", n.NetworkSecurityPerimeter)
+ populate(objectMap, "profile", n.Profile)
+ populate(objectMap, "provisioningIssues", n.ProvisioningIssues)
+ populate(objectMap, "provisioningState", n.ProvisioningState)
+ populate(objectMap, "resourceAssociation", n.ResourceAssociation)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationProperties.
+func (n *NetworkSecurityPerimeterConfigurationProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "networkSecurityPerimeter":
+ err = unpopulate(val, "NetworkSecurityPerimeter", &n.NetworkSecurityPerimeter)
+ delete(rawMsg, key)
+ case "profile":
+ err = unpopulate(val, "Profile", &n.Profile)
+ delete(rawMsg, key)
+ case "provisioningIssues":
+ err = unpopulate(val, "ProvisioningIssues", &n.ProvisioningIssues)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &n.ProvisioningState)
+ delete(rawMsg, key)
+ case "resourceAssociation":
+ err = unpopulate(val, "ResourceAssociation", &n.ResourceAssociation)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationPropertiesProfile.
+func (n NetworkSecurityPerimeterConfigurationPropertiesProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "accessRules", n.AccessRules)
+ populate(objectMap, "accessRulesVersion", n.AccessRulesVersion)
+ populate(objectMap, "diagnosticSettingsVersion", n.DiagnosticSettingsVersion)
+ populate(objectMap, "enabledLogCategories", n.EnabledLogCategories)
+ populate(objectMap, "name", n.Name)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationPropertiesProfile.
+func (n *NetworkSecurityPerimeterConfigurationPropertiesProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "accessRules":
+ err = unpopulate(val, "AccessRules", &n.AccessRules)
+ delete(rawMsg, key)
+ case "accessRulesVersion":
+ err = unpopulate(val, "AccessRulesVersion", &n.AccessRulesVersion)
+ delete(rawMsg, key)
+ case "diagnosticSettingsVersion":
+ err = unpopulate(val, "DiagnosticSettingsVersion", &n.DiagnosticSettingsVersion)
+ delete(rawMsg, key)
+ case "enabledLogCategories":
+ err = unpopulate(val, "EnabledLogCategories", &n.EnabledLogCategories)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &n.Name)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.
+func (n NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "accessMode", n.AccessMode)
+ populate(objectMap, "name", n.Name)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.
+func (n *NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "accessMode":
+ err = unpopulate(val, "AccessMode", &n.AccessMode)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &n.Name)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type NfsSetting.
+func (n NfsSetting) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "encryptionInTransit", n.EncryptionInTransit)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type NfsSetting.
+func (n *NfsSetting) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "encryptionInTransit":
+ err = unpopulate(val, "EncryptionInTransit", &n.EncryptionInTransit)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type NspAccessRule.
+func (n NspAccessRule) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", n.Name)
+ populate(objectMap, "properties", n.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type NspAccessRule.
+func (n *NspAccessRule) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &n.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &n.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type NspAccessRuleProperties.
+func (n NspAccessRuleProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "addressPrefixes", n.AddressPrefixes)
+ populate(objectMap, "direction", n.Direction)
+ populate(objectMap, "fullyQualifiedDomainNames", n.FullyQualifiedDomainNames)
+ populate(objectMap, "networkSecurityPerimeters", n.NetworkSecurityPerimeters)
+ populate(objectMap, "subscriptions", n.Subscriptions)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type NspAccessRuleProperties.
+func (n *NspAccessRuleProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "addressPrefixes":
+ err = unpopulate(val, "AddressPrefixes", &n.AddressPrefixes)
+ delete(rawMsg, key)
+ case "direction":
+ err = unpopulate(val, "Direction", &n.Direction)
+ delete(rawMsg, key)
+ case "fullyQualifiedDomainNames":
+ err = unpopulate(val, "FullyQualifiedDomainNames", &n.FullyQualifiedDomainNames)
+ delete(rawMsg, key)
+ case "networkSecurityPerimeters":
+ err = unpopulate(val, "NetworkSecurityPerimeters", &n.NetworkSecurityPerimeters)
+ delete(rawMsg, key)
+ case "subscriptions":
+ err = unpopulate(val, "Subscriptions", &n.Subscriptions)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type NspAccessRulePropertiesSubscriptionsItem.
+func (n NspAccessRulePropertiesSubscriptionsItem) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", n.ID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type NspAccessRulePropertiesSubscriptionsItem.
+func (n *NspAccessRulePropertiesSubscriptionsItem) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &n.ID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicies.
+func (o ObjectReplicationPolicies) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", o.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectReplicationPolicies.
+func (o *ObjectReplicationPolicies) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &o.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicy.
+func (o ObjectReplicationPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", o.ID)
+ populate(objectMap, "name", o.Name)
+ populate(objectMap, "properties", o.Properties)
+ populate(objectMap, "type", o.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectReplicationPolicy.
+func (o *ObjectReplicationPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &o.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &o.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &o.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &o.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicyFilter.
+func (o ObjectReplicationPolicyFilter) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "minCreationTime", o.MinCreationTime)
+ populate(objectMap, "prefixMatch", o.PrefixMatch)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectReplicationPolicyFilter.
+func (o *ObjectReplicationPolicyFilter) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "minCreationTime":
+ err = unpopulate(val, "MinCreationTime", &o.MinCreationTime)
+ delete(rawMsg, key)
+ case "prefixMatch":
+ err = unpopulate(val, "PrefixMatch", &o.PrefixMatch)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicyProperties.
+func (o ObjectReplicationPolicyProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "destinationAccount", o.DestinationAccount)
+ populateDateTimeRFC3339(objectMap, "enabledTime", o.EnabledTime)
+ populate(objectMap, "metrics", o.Metrics)
+ populate(objectMap, "policyId", o.PolicyID)
+ populate(objectMap, "rules", o.Rules)
+ populate(objectMap, "sourceAccount", o.SourceAccount)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectReplicationPolicyProperties.
+func (o *ObjectReplicationPolicyProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "destinationAccount":
+ err = unpopulate(val, "DestinationAccount", &o.DestinationAccount)
+ delete(rawMsg, key)
+ case "enabledTime":
+ err = unpopulateDateTimeRFC3339(val, "EnabledTime", &o.EnabledTime)
+ delete(rawMsg, key)
+ case "metrics":
+ err = unpopulate(val, "Metrics", &o.Metrics)
+ delete(rawMsg, key)
+ case "policyId":
+ err = unpopulate(val, "PolicyID", &o.PolicyID)
+ delete(rawMsg, key)
+ case "rules":
+ err = unpopulate(val, "Rules", &o.Rules)
+ delete(rawMsg, key)
+ case "sourceAccount":
+ err = unpopulate(val, "SourceAccount", &o.SourceAccount)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicyPropertiesMetrics.
+func (o ObjectReplicationPolicyPropertiesMetrics) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "enabled", o.Enabled)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectReplicationPolicyPropertiesMetrics.
+func (o *ObjectReplicationPolicyPropertiesMetrics) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "enabled":
+ err = unpopulate(val, "Enabled", &o.Enabled)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicyRule.
+func (o ObjectReplicationPolicyRule) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "destinationContainer", o.DestinationContainer)
+ populate(objectMap, "filters", o.Filters)
+ populate(objectMap, "ruleId", o.RuleID)
+ populate(objectMap, "sourceContainer", o.SourceContainer)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectReplicationPolicyRule.
+func (o *ObjectReplicationPolicyRule) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "destinationContainer":
+ err = unpopulate(val, "DestinationContainer", &o.DestinationContainer)
+ delete(rawMsg, key)
+ case "filters":
+ err = unpopulate(val, "Filters", &o.Filters)
+ delete(rawMsg, key)
+ case "ruleId":
+ err = unpopulate(val, "RuleID", &o.RuleID)
+ delete(rawMsg, key)
+ case "sourceContainer":
+ err = unpopulate(val, "SourceContainer", &o.SourceContainer)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Operation.
+func (o Operation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "display", o.Display)
+ populate(objectMap, "name", o.Name)
+ populate(objectMap, "properties", o.OperationProperties)
+ populate(objectMap, "origin", o.Origin)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Operation.
+func (o *Operation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "display":
+ err = unpopulate(val, "Display", &o.Display)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &o.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "OperationProperties", &o.OperationProperties)
+ delete(rawMsg, key)
+ case "origin":
+ err = unpopulate(val, "Origin", &o.Origin)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OperationDisplay.
+func (o OperationDisplay) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "description", o.Description)
+ populate(objectMap, "operation", o.Operation)
+ populate(objectMap, "provider", o.Provider)
+ populate(objectMap, "resource", o.Resource)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.
+func (o *OperationDisplay) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "description":
+ err = unpopulate(val, "Description", &o.Description)
+ delete(rawMsg, key)
+ case "operation":
+ err = unpopulate(val, "Operation", &o.Operation)
+ delete(rawMsg, key)
+ case "provider":
+ err = unpopulate(val, "Provider", &o.Provider)
+ delete(rawMsg, key)
+ case "resource":
+ err = unpopulate(val, "Resource", &o.Resource)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OperationListResult.
+func (o OperationListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", o.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.
+func (o *OperationListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &o.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OperationProperties.
+func (o OperationProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "serviceSpecification", o.ServiceSpecification)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OperationProperties.
+func (o *OperationProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "serviceSpecification":
+ err = unpopulate(val, "ServiceSpecification", &o.ServiceSpecification)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PermissionScope.
+func (p PermissionScope) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "permissions", p.Permissions)
+ populate(objectMap, "resourceName", p.ResourceName)
+ populate(objectMap, "service", p.Service)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PermissionScope.
+func (p *PermissionScope) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "permissions":
+ err = unpopulate(val, "Permissions", &p.Permissions)
+ delete(rawMsg, key)
+ case "resourceName":
+ err = unpopulate(val, "ResourceName", &p.ResourceName)
+ delete(rawMsg, key)
+ case "service":
+ err = unpopulate(val, "Service", &p.Service)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Placement.
+func (p Placement) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "zonePlacementPolicy", p.ZonePlacementPolicy)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Placement.
+func (p *Placement) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "zonePlacementPolicy":
+ err = unpopulate(val, "ZonePlacementPolicy", &p.ZonePlacementPolicy)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint.
+func (p PrivateEndpoint) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", p.ID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint.
+func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &p.ID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection.
+func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", p.ID)
+ populate(objectMap, "name", p.Name)
+ populate(objectMap, "properties", p.Properties)
+ populate(objectMap, "type", p.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection.
+func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &p.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &p.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &p.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &p.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult.
+func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", p.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult.
+func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &p.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties.
+func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "privateEndpoint", p.PrivateEndpoint)
+ populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState)
+ populate(objectMap, "provisioningState", p.ProvisioningState)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties.
+func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "privateEndpoint":
+ err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint)
+ delete(rawMsg, key)
+ case "privateLinkServiceConnectionState":
+ err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &p.ProvisioningState)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource.
+func (p PrivateLinkResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", p.ID)
+ populate(objectMap, "name", p.Name)
+ populate(objectMap, "properties", p.Properties)
+ populate(objectMap, "type", p.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource.
+func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &p.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &p.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &p.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &p.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult.
+func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", p.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult.
+func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &p.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties.
+func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "groupId", p.GroupID)
+ populate(objectMap, "requiredMembers", p.RequiredMembers)
+ populate(objectMap, "requiredZoneNames", p.RequiredZoneNames)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties.
+func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "groupId":
+ err = unpopulate(val, "GroupID", &p.GroupID)
+ delete(rawMsg, key)
+ case "requiredMembers":
+ err = unpopulate(val, "RequiredMembers", &p.RequiredMembers)
+ delete(rawMsg, key)
+ case "requiredZoneNames":
+ err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState.
+func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "actionRequired", p.ActionRequired)
+ populate(objectMap, "description", p.Description)
+ populate(objectMap, "status", p.Status)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState.
+func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "actionRequired":
+ err = unpopulate(val, "ActionRequired", &p.ActionRequired)
+ delete(rawMsg, key)
+ case "description":
+ err = unpopulate(val, "Description", &p.Description)
+ delete(rawMsg, key)
+ case "status":
+ err = unpopulate(val, "Status", &p.Status)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProtectedAppendWritesHistory.
+func (p ProtectedAppendWritesHistory) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "allowProtectedAppendWritesAll", p.AllowProtectedAppendWritesAll)
+ populateDateTimeRFC3339(objectMap, "timestamp", p.Timestamp)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectedAppendWritesHistory.
+func (p *ProtectedAppendWritesHistory) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "allowProtectedAppendWritesAll":
+ err = unpopulate(val, "AllowProtectedAppendWritesAll", &p.AllowProtectedAppendWritesAll)
+ delete(rawMsg, key)
+ case "timestamp":
+ err = unpopulateDateTimeRFC3339(val, "Timestamp", &p.Timestamp)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProtocolSettings.
+func (p ProtocolSettings) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nfs", p.Nfs)
+ populate(objectMap, "smb", p.Smb)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProtocolSettings.
+func (p *ProtocolSettings) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nfs":
+ err = unpopulate(val, "Nfs", &p.Nfs)
+ delete(rawMsg, key)
+ case "smb":
+ err = unpopulate(val, "Smb", &p.Smb)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProvisioningIssue.
+func (p ProvisioningIssue) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", p.Name)
+ populate(objectMap, "properties", p.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningIssue.
+func (p *ProvisioningIssue) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &p.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &p.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProvisioningIssueProperties.
+func (p ProvisioningIssueProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "description", p.Description)
+ populate(objectMap, "issueType", p.IssueType)
+ populate(objectMap, "severity", p.Severity)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningIssueProperties.
+func (p *ProvisioningIssueProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "description":
+ err = unpopulate(val, "Description", &p.Description)
+ delete(rawMsg, key)
+ case "issueType":
+ err = unpopulate(val, "IssueType", &p.IssueType)
+ delete(rawMsg, key)
+ case "severity":
+ err = unpopulate(val, "Severity", &p.Severity)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProxyResource.
+func (p ProxyResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", p.ID)
+ populate(objectMap, "name", p.Name)
+ populate(objectMap, "type", p.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.
+func (p *ProxyResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &p.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &p.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &p.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProxyResourceAutoGenerated.
+func (p ProxyResourceAutoGenerated) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", p.ID)
+ populate(objectMap, "name", p.Name)
+ populate(objectMap, "systemData", p.SystemData)
+ populate(objectMap, "type", p.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResourceAutoGenerated.
+func (p *ProxyResourceAutoGenerated) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &p.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &p.Name)
+ delete(rawMsg, key)
+ case "systemData":
+ err = unpopulate(val, "SystemData", &p.SystemData)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &p.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Queue.
+func (q Queue) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", q.ID)
+ populate(objectMap, "name", q.Name)
+ populate(objectMap, "properties", q.QueueProperties)
+ populate(objectMap, "type", q.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Queue.
+func (q *Queue) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", q, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &q.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &q.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "QueueProperties", &q.QueueProperties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &q.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", q, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type QueueProperties.
+func (q QueueProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "approximateMessageCount", q.ApproximateMessageCount)
+ populate(objectMap, "metadata", q.Metadata)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type QueueProperties.
+func (q *QueueProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", q, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "approximateMessageCount":
+ err = unpopulate(val, "ApproximateMessageCount", &q.ApproximateMessageCount)
+ delete(rawMsg, key)
+ case "metadata":
+ err = unpopulate(val, "Metadata", &q.Metadata)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", q, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type QueueServiceProperties.
+func (q QueueServiceProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", q.ID)
+ populate(objectMap, "name", q.Name)
+ populate(objectMap, "properties", q.QueueServiceProperties)
+ populate(objectMap, "type", q.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type QueueServiceProperties.
+func (q *QueueServiceProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", q, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &q.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &q.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "QueueServiceProperties", &q.QueueServiceProperties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &q.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", q, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type QueueServicePropertiesProperties.
+func (q QueueServicePropertiesProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "cors", q.Cors)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type QueueServicePropertiesProperties.
+func (q *QueueServicePropertiesProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", q, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "cors":
+ err = unpopulate(val, "Cors", &q.Cors)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", q, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Resource.
+func (r Resource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", r.ID)
+ populate(objectMap, "name", r.Name)
+ populate(objectMap, "type", r.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Resource.
+func (r *Resource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &r.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &r.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &r.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceAccessRule.
+func (r ResourceAccessRule) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "resourceId", r.ResourceID)
+ populate(objectMap, "tenantId", r.TenantID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAccessRule.
+func (r *ResourceAccessRule) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "resourceId":
+ err = unpopulate(val, "ResourceID", &r.ResourceID)
+ delete(rawMsg, key)
+ case "tenantId":
+ err = unpopulate(val, "TenantID", &r.TenantID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceAutoGenerated.
+func (r ResourceAutoGenerated) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", r.ID)
+ populate(objectMap, "name", r.Name)
+ populate(objectMap, "systemData", r.SystemData)
+ populate(objectMap, "type", r.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAutoGenerated.
+func (r *ResourceAutoGenerated) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &r.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &r.Name)
+ delete(rawMsg, key)
+ case "systemData":
+ err = unpopulate(val, "SystemData", &r.SystemData)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &r.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RestorePolicyProperties.
+func (r RestorePolicyProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "days", r.Days)
+ populate(objectMap, "enabled", r.Enabled)
+ populateDateTimeRFC3339(objectMap, "lastEnabledTime", r.LastEnabledTime)
+ populateDateTimeRFC3339(objectMap, "minRestoreTime", r.MinRestoreTime)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePolicyProperties.
+func (r *RestorePolicyProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "days":
+ err = unpopulate(val, "Days", &r.Days)
+ delete(rawMsg, key)
+ case "enabled":
+ err = unpopulate(val, "Enabled", &r.Enabled)
+ delete(rawMsg, key)
+ case "lastEnabledTime":
+ err = unpopulateDateTimeRFC3339(val, "LastEnabledTime", &r.LastEnabledTime)
+ delete(rawMsg, key)
+ case "minRestoreTime":
+ err = unpopulateDateTimeRFC3339(val, "MinRestoreTime", &r.MinRestoreTime)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Restriction.
+func (r Restriction) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "reasonCode", r.ReasonCode)
+ populate(objectMap, "type", r.Type)
+ populate(objectMap, "values", r.Values)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Restriction.
+func (r *Restriction) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "reasonCode":
+ err = unpopulate(val, "ReasonCode", &r.ReasonCode)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &r.Type)
+ delete(rawMsg, key)
+ case "values":
+ err = unpopulate(val, "Values", &r.Values)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RoutingPreference.
+func (r RoutingPreference) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "publishInternetEndpoints", r.PublishInternetEndpoints)
+ populate(objectMap, "publishMicrosoftEndpoints", r.PublishMicrosoftEndpoints)
+ populate(objectMap, "routingChoice", r.RoutingChoice)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RoutingPreference.
+func (r *RoutingPreference) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "publishInternetEndpoints":
+ err = unpopulate(val, "PublishInternetEndpoints", &r.PublishInternetEndpoints)
+ delete(rawMsg, key)
+ case "publishMicrosoftEndpoints":
+ err = unpopulate(val, "PublishMicrosoftEndpoints", &r.PublishMicrosoftEndpoints)
+ delete(rawMsg, key)
+ case "routingChoice":
+ err = unpopulate(val, "RoutingChoice", &r.RoutingChoice)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SKU.
+func (s SKU) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", s.Name)
+ populate(objectMap, "tier", s.Tier)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SKU.
+func (s *SKU) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &s.Name)
+ delete(rawMsg, key)
+ case "tier":
+ err = unpopulate(val, "Tier", &s.Tier)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SKUCapability.
+func (s SKUCapability) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", s.Name)
+ populate(objectMap, "value", s.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SKUCapability.
+func (s *SKUCapability) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &s.Name)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &s.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SKUInformation.
+func (s SKUInformation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "capabilities", s.Capabilities)
+ populate(objectMap, "kind", s.Kind)
+ populate(objectMap, "locationInfo", s.LocationInfo)
+ populate(objectMap, "locations", s.Locations)
+ populate(objectMap, "name", s.Name)
+ populate(objectMap, "resourceType", s.ResourceType)
+ populate(objectMap, "restrictions", s.Restrictions)
+ populate(objectMap, "tier", s.Tier)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SKUInformation.
+func (s *SKUInformation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "capabilities":
+ err = unpopulate(val, "Capabilities", &s.Capabilities)
+ delete(rawMsg, key)
+ case "kind":
+ err = unpopulate(val, "Kind", &s.Kind)
+ delete(rawMsg, key)
+ case "locationInfo":
+ err = unpopulate(val, "LocationInfo", &s.LocationInfo)
+ delete(rawMsg, key)
+ case "locations":
+ err = unpopulate(val, "Locations", &s.Locations)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &s.Name)
+ delete(rawMsg, key)
+ case "resourceType":
+ err = unpopulate(val, "ResourceType", &s.ResourceType)
+ delete(rawMsg, key)
+ case "restrictions":
+ err = unpopulate(val, "Restrictions", &s.Restrictions)
+ delete(rawMsg, key)
+ case "tier":
+ err = unpopulate(val, "Tier", &s.Tier)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SKUInformationLocationInfoItem.
+func (s SKUInformationLocationInfoItem) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "location", s.Location)
+ populate(objectMap, "zones", s.Zones)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SKUInformationLocationInfoItem.
+func (s *SKUInformationLocationInfoItem) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "location":
+ err = unpopulate(val, "Location", &s.Location)
+ delete(rawMsg, key)
+ case "zones":
+ err = unpopulate(val, "Zones", &s.Zones)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SKUListResult.
+func (s SKUListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", s.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SKUListResult.
+func (s *SKUListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &s.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SSHPublicKey.
+func (s SSHPublicKey) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "description", s.Description)
+ populate(objectMap, "key", s.Key)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKey.
+func (s *SSHPublicKey) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "description":
+ err = unpopulate(val, "Description", &s.Description)
+ delete(rawMsg, key)
+ case "key":
+ err = unpopulate(val, "Key", &s.Key)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SasPolicy.
+func (s SasPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "expirationAction", s.ExpirationAction)
+ populate(objectMap, "sasExpirationPeriod", s.SasExpirationPeriod)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SasPolicy.
+func (s *SasPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "expirationAction":
+ err = unpopulate(val, "ExpirationAction", &s.ExpirationAction)
+ delete(rawMsg, key)
+ case "sasExpirationPeriod":
+ err = unpopulate(val, "SasExpirationPeriod", &s.SasExpirationPeriod)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ServiceSasParameters.
+func (s ServiceSasParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "rscc", s.CacheControl)
+ populate(objectMap, "canonicalizedResource", s.CanonicalizedResource)
+ populate(objectMap, "rscd", s.ContentDisposition)
+ populate(objectMap, "rsce", s.ContentEncoding)
+ populate(objectMap, "rscl", s.ContentLanguage)
+ populate(objectMap, "rsct", s.ContentType)
+ populate(objectMap, "signedIp", s.IPAddressOrRange)
+ populate(objectMap, "signedIdentifier", s.Identifier)
+ populate(objectMap, "keyToSign", s.KeyToSign)
+ populate(objectMap, "endPk", s.PartitionKeyEnd)
+ populate(objectMap, "startPk", s.PartitionKeyStart)
+ populate(objectMap, "signedPermission", s.Permissions)
+ populate(objectMap, "signedProtocol", s.Protocols)
+ populate(objectMap, "signedResource", s.Resource)
+ populate(objectMap, "endRk", s.RowKeyEnd)
+ populate(objectMap, "startRk", s.RowKeyStart)
+ populateDateTimeRFC3339(objectMap, "signedExpiry", s.SharedAccessExpiryTime)
+ populateDateTimeRFC3339(objectMap, "signedStart", s.SharedAccessStartTime)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSasParameters.
+func (s *ServiceSasParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "rscc":
+ err = unpopulate(val, "CacheControl", &s.CacheControl)
+ delete(rawMsg, key)
+ case "canonicalizedResource":
+ err = unpopulate(val, "CanonicalizedResource", &s.CanonicalizedResource)
+ delete(rawMsg, key)
+ case "rscd":
+ err = unpopulate(val, "ContentDisposition", &s.ContentDisposition)
+ delete(rawMsg, key)
+ case "rsce":
+ err = unpopulate(val, "ContentEncoding", &s.ContentEncoding)
+ delete(rawMsg, key)
+ case "rscl":
+ err = unpopulate(val, "ContentLanguage", &s.ContentLanguage)
+ delete(rawMsg, key)
+ case "rsct":
+ err = unpopulate(val, "ContentType", &s.ContentType)
+ delete(rawMsg, key)
+ case "signedIp":
+ err = unpopulate(val, "IPAddressOrRange", &s.IPAddressOrRange)
+ delete(rawMsg, key)
+ case "signedIdentifier":
+ err = unpopulate(val, "Identifier", &s.Identifier)
+ delete(rawMsg, key)
+ case "keyToSign":
+ err = unpopulate(val, "KeyToSign", &s.KeyToSign)
+ delete(rawMsg, key)
+ case "endPk":
+ err = unpopulate(val, "PartitionKeyEnd", &s.PartitionKeyEnd)
+ delete(rawMsg, key)
+ case "startPk":
+ err = unpopulate(val, "PartitionKeyStart", &s.PartitionKeyStart)
+ delete(rawMsg, key)
+ case "signedPermission":
+ err = unpopulate(val, "Permissions", &s.Permissions)
+ delete(rawMsg, key)
+ case "signedProtocol":
+ err = unpopulate(val, "Protocols", &s.Protocols)
+ delete(rawMsg, key)
+ case "signedResource":
+ err = unpopulate(val, "Resource", &s.Resource)
+ delete(rawMsg, key)
+ case "endRk":
+ err = unpopulate(val, "RowKeyEnd", &s.RowKeyEnd)
+ delete(rawMsg, key)
+ case "startRk":
+ err = unpopulate(val, "RowKeyStart", &s.RowKeyStart)
+ delete(rawMsg, key)
+ case "signedExpiry":
+ err = unpopulateDateTimeRFC3339(val, "SharedAccessExpiryTime", &s.SharedAccessExpiryTime)
+ delete(rawMsg, key)
+ case "signedStart":
+ err = unpopulateDateTimeRFC3339(val, "SharedAccessStartTime", &s.SharedAccessStartTime)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ServiceSpecification.
+func (s ServiceSpecification) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "metricSpecifications", s.MetricSpecifications)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSpecification.
+func (s *ServiceSpecification) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "metricSpecifications":
+ err = unpopulate(val, "MetricSpecifications", &s.MetricSpecifications)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SignedIdentifier.
+func (s SignedIdentifier) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "accessPolicy", s.AccessPolicy)
+ populate(objectMap, "id", s.ID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SignedIdentifier.
+func (s *SignedIdentifier) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "accessPolicy":
+ err = unpopulate(val, "AccessPolicy", &s.AccessPolicy)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &s.ID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SmbOAuthSettings.
+func (s SmbOAuthSettings) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "isSmbOAuthEnabled", s.IsSmbOAuthEnabled)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SmbOAuthSettings.
+func (s *SmbOAuthSettings) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "isSmbOAuthEnabled":
+ err = unpopulate(val, "IsSmbOAuthEnabled", &s.IsSmbOAuthEnabled)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SmbSetting.
+func (s SmbSetting) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "authenticationMethods", s.AuthenticationMethods)
+ populate(objectMap, "channelEncryption", s.ChannelEncryption)
+ populate(objectMap, "encryptionInTransit", s.EncryptionInTransit)
+ populate(objectMap, "kerberosTicketEncryption", s.KerberosTicketEncryption)
+ populate(objectMap, "multichannel", s.Multichannel)
+ populate(objectMap, "versions", s.Versions)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SmbSetting.
+func (s *SmbSetting) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "authenticationMethods":
+ err = unpopulate(val, "AuthenticationMethods", &s.AuthenticationMethods)
+ delete(rawMsg, key)
+ case "channelEncryption":
+ err = unpopulate(val, "ChannelEncryption", &s.ChannelEncryption)
+ delete(rawMsg, key)
+ case "encryptionInTransit":
+ err = unpopulate(val, "EncryptionInTransit", &s.EncryptionInTransit)
+ delete(rawMsg, key)
+ case "kerberosTicketEncryption":
+ err = unpopulate(val, "KerberosTicketEncryption", &s.KerberosTicketEncryption)
+ delete(rawMsg, key)
+ case "multichannel":
+ err = unpopulate(val, "Multichannel", &s.Multichannel)
+ delete(rawMsg, key)
+ case "versions":
+ err = unpopulate(val, "Versions", &s.Versions)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SystemData.
+func (s SystemData) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt)
+ populate(objectMap, "createdBy", s.CreatedBy)
+ populate(objectMap, "createdByType", s.CreatedByType)
+ populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt)
+ populate(objectMap, "lastModifiedBy", s.LastModifiedBy)
+ populate(objectMap, "lastModifiedByType", s.LastModifiedByType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.
+func (s *SystemData) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "createdAt":
+ err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt)
+ delete(rawMsg, key)
+ case "createdBy":
+ err = unpopulate(val, "CreatedBy", &s.CreatedBy)
+ delete(rawMsg, key)
+ case "createdByType":
+ err = unpopulate(val, "CreatedByType", &s.CreatedByType)
+ delete(rawMsg, key)
+ case "lastModifiedAt":
+ err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt)
+ delete(rawMsg, key)
+ case "lastModifiedBy":
+ err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy)
+ delete(rawMsg, key)
+ case "lastModifiedByType":
+ err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Table.
+func (t Table) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", t.ID)
+ populate(objectMap, "name", t.Name)
+ populate(objectMap, "properties", t.TableProperties)
+ populate(objectMap, "type", t.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Table.
+func (t *Table) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &t.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &t.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "TableProperties", &t.TableProperties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &t.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TableAccessPolicy.
+func (t TableAccessPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "expiryTime", t.ExpiryTime)
+ populate(objectMap, "permission", t.Permission)
+ populateDateTimeRFC3339(objectMap, "startTime", t.StartTime)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TableAccessPolicy.
+func (t *TableAccessPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "expiryTime":
+ err = unpopulateDateTimeRFC3339(val, "ExpiryTime", &t.ExpiryTime)
+ delete(rawMsg, key)
+ case "permission":
+ err = unpopulate(val, "Permission", &t.Permission)
+ delete(rawMsg, key)
+ case "startTime":
+ err = unpopulateDateTimeRFC3339(val, "StartTime", &t.StartTime)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TableProperties.
+func (t TableProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "signedIdentifiers", t.SignedIdentifiers)
+ populate(objectMap, "tableName", t.TableName)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TableProperties.
+func (t *TableProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "signedIdentifiers":
+ err = unpopulate(val, "SignedIdentifiers", &t.SignedIdentifiers)
+ delete(rawMsg, key)
+ case "tableName":
+ err = unpopulate(val, "TableName", &t.TableName)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TableServiceProperties.
+func (t TableServiceProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", t.ID)
+ populate(objectMap, "name", t.Name)
+ populate(objectMap, "properties", t.TableServiceProperties)
+ populate(objectMap, "type", t.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TableServiceProperties.
+func (t *TableServiceProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &t.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &t.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "TableServiceProperties", &t.TableServiceProperties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &t.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TableServicePropertiesProperties.
+func (t TableServicePropertiesProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "cors", t.Cors)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TableServicePropertiesProperties.
+func (t *TableServicePropertiesProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "cors":
+ err = unpopulate(val, "Cors", &t.Cors)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TableSignedIdentifier.
+func (t TableSignedIdentifier) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "accessPolicy", t.AccessPolicy)
+ populate(objectMap, "id", t.ID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TableSignedIdentifier.
+func (t *TableSignedIdentifier) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "accessPolicy":
+ err = unpopulate(val, "AccessPolicy", &t.AccessPolicy)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &t.ID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TagFilter.
+func (t TagFilter) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", t.Name)
+ populate(objectMap, "op", t.Op)
+ populate(objectMap, "value", t.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TagFilter.
+func (t *TagFilter) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &t.Name)
+ delete(rawMsg, key)
+ case "op":
+ err = unpopulate(val, "Op", &t.Op)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &t.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TagProperty.
+func (t TagProperty) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "objectIdentifier", t.ObjectIdentifier)
+ populate(objectMap, "tag", t.Tag)
+ populate(objectMap, "tenantId", t.TenantID)
+ populateDateTimeRFC3339(objectMap, "timestamp", t.Timestamp)
+ populate(objectMap, "upn", t.Upn)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TagProperty.
+func (t *TagProperty) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "objectIdentifier":
+ err = unpopulate(val, "ObjectIdentifier", &t.ObjectIdentifier)
+ delete(rawMsg, key)
+ case "tag":
+ err = unpopulate(val, "Tag", &t.Tag)
+ delete(rawMsg, key)
+ case "tenantId":
+ err = unpopulate(val, "TenantID", &t.TenantID)
+ delete(rawMsg, key)
+ case "timestamp":
+ err = unpopulateDateTimeRFC3339(val, "Timestamp", &t.Timestamp)
+ delete(rawMsg, key)
+ case "upn":
+ err = unpopulate(val, "Upn", &t.Upn)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TaskAssignment.
+func (t TaskAssignment) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", t.ID)
+ populate(objectMap, "name", t.Name)
+ populate(objectMap, "properties", t.Properties)
+ populate(objectMap, "type", t.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TaskAssignment.
+func (t *TaskAssignment) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &t.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &t.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &t.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &t.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TaskAssignmentExecutionContext.
+func (t TaskAssignmentExecutionContext) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "target", t.Target)
+ populate(objectMap, "trigger", t.Trigger)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TaskAssignmentExecutionContext.
+func (t *TaskAssignmentExecutionContext) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "target":
+ err = unpopulate(val, "Target", &t.Target)
+ delete(rawMsg, key)
+ case "trigger":
+ err = unpopulate(val, "Trigger", &t.Trigger)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TaskAssignmentProperties.
+func (t TaskAssignmentProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "description", t.Description)
+ populate(objectMap, "enabled", t.Enabled)
+ populate(objectMap, "executionContext", t.ExecutionContext)
+ populate(objectMap, "provisioningState", t.ProvisioningState)
+ populate(objectMap, "report", t.Report)
+ populate(objectMap, "runStatus", t.RunStatus)
+ populate(objectMap, "taskId", t.TaskID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TaskAssignmentProperties.
+func (t *TaskAssignmentProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "description":
+ err = unpopulate(val, "Description", &t.Description)
+ delete(rawMsg, key)
+ case "enabled":
+ err = unpopulate(val, "Enabled", &t.Enabled)
+ delete(rawMsg, key)
+ case "executionContext":
+ err = unpopulate(val, "ExecutionContext", &t.ExecutionContext)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &t.ProvisioningState)
+ delete(rawMsg, key)
+ case "report":
+ err = unpopulate(val, "Report", &t.Report)
+ delete(rawMsg, key)
+ case "runStatus":
+ err = unpopulate(val, "RunStatus", &t.RunStatus)
+ delete(rawMsg, key)
+ case "taskId":
+ err = unpopulate(val, "TaskID", &t.TaskID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TaskAssignmentReport.
+func (t TaskAssignmentReport) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "prefix", t.Prefix)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TaskAssignmentReport.
+func (t *TaskAssignmentReport) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "prefix":
+ err = unpopulate(val, "Prefix", &t.Prefix)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TaskAssignmentUpdateExecutionContext.
+func (t TaskAssignmentUpdateExecutionContext) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "target", t.Target)
+ populate(objectMap, "trigger", t.Trigger)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TaskAssignmentUpdateExecutionContext.
+func (t *TaskAssignmentUpdateExecutionContext) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "target":
+ err = unpopulate(val, "Target", &t.Target)
+ delete(rawMsg, key)
+ case "trigger":
+ err = unpopulate(val, "Trigger", &t.Trigger)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TaskAssignmentUpdateParameters.
+func (t TaskAssignmentUpdateParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", t.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TaskAssignmentUpdateParameters.
+func (t *TaskAssignmentUpdateParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "Properties", &t.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TaskAssignmentUpdateProperties.
+func (t TaskAssignmentUpdateProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "description", t.Description)
+ populate(objectMap, "enabled", t.Enabled)
+ populate(objectMap, "executionContext", t.ExecutionContext)
+ populate(objectMap, "provisioningState", t.ProvisioningState)
+ populate(objectMap, "report", t.Report)
+ populate(objectMap, "runStatus", t.RunStatus)
+ populate(objectMap, "taskId", t.TaskID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TaskAssignmentUpdateProperties.
+func (t *TaskAssignmentUpdateProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "description":
+ err = unpopulate(val, "Description", &t.Description)
+ delete(rawMsg, key)
+ case "enabled":
+ err = unpopulate(val, "Enabled", &t.Enabled)
+ delete(rawMsg, key)
+ case "executionContext":
+ err = unpopulate(val, "ExecutionContext", &t.ExecutionContext)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &t.ProvisioningState)
+ delete(rawMsg, key)
+ case "report":
+ err = unpopulate(val, "Report", &t.Report)
+ delete(rawMsg, key)
+ case "runStatus":
+ err = unpopulate(val, "RunStatus", &t.RunStatus)
+ delete(rawMsg, key)
+ case "taskId":
+ err = unpopulate(val, "TaskID", &t.TaskID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TaskAssignmentUpdateReport.
+func (t TaskAssignmentUpdateReport) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "prefix", t.Prefix)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TaskAssignmentUpdateReport.
+func (t *TaskAssignmentUpdateReport) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "prefix":
+ err = unpopulate(val, "Prefix", &t.Prefix)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TaskAssignmentsList.
+func (t TaskAssignmentsList) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", t.NextLink)
+ populate(objectMap, "value", t.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TaskAssignmentsList.
+func (t *TaskAssignmentsList) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &t.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &t.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TaskReportInstance.
+func (t TaskReportInstance) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", t.ID)
+ populate(objectMap, "name", t.Name)
+ populate(objectMap, "properties", t.Properties)
+ populate(objectMap, "type", t.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TaskReportInstance.
+func (t *TaskReportInstance) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &t.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &t.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &t.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &t.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TaskReportProperties.
+func (t TaskReportProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "finishTime", t.FinishTime)
+ populate(objectMap, "objectFailedCount", t.ObjectFailedCount)
+ populate(objectMap, "objectsOperatedOnCount", t.ObjectsOperatedOnCount)
+ populate(objectMap, "objectsSucceededCount", t.ObjectsSucceededCount)
+ populate(objectMap, "objectsTargetedCount", t.ObjectsTargetedCount)
+ populate(objectMap, "runResult", t.RunResult)
+ populate(objectMap, "runStatusEnum", t.RunStatusEnum)
+ populate(objectMap, "runStatusError", t.RunStatusError)
+ populate(objectMap, "startTime", t.StartTime)
+ populate(objectMap, "storageAccountId", t.StorageAccountID)
+ populate(objectMap, "summaryReportPath", t.SummaryReportPath)
+ populate(objectMap, "taskAssignmentId", t.TaskAssignmentID)
+ populate(objectMap, "taskId", t.TaskID)
+ populate(objectMap, "taskVersion", t.TaskVersion)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TaskReportProperties.
+func (t *TaskReportProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "finishTime":
+ err = unpopulate(val, "FinishTime", &t.FinishTime)
+ delete(rawMsg, key)
+ case "objectFailedCount":
+ err = unpopulate(val, "ObjectFailedCount", &t.ObjectFailedCount)
+ delete(rawMsg, key)
+ case "objectsOperatedOnCount":
+ err = unpopulate(val, "ObjectsOperatedOnCount", &t.ObjectsOperatedOnCount)
+ delete(rawMsg, key)
+ case "objectsSucceededCount":
+ err = unpopulate(val, "ObjectsSucceededCount", &t.ObjectsSucceededCount)
+ delete(rawMsg, key)
+ case "objectsTargetedCount":
+ err = unpopulate(val, "ObjectsTargetedCount", &t.ObjectsTargetedCount)
+ delete(rawMsg, key)
+ case "runResult":
+ err = unpopulate(val, "RunResult", &t.RunResult)
+ delete(rawMsg, key)
+ case "runStatusEnum":
+ err = unpopulate(val, "RunStatusEnum", &t.RunStatusEnum)
+ delete(rawMsg, key)
+ case "runStatusError":
+ err = unpopulate(val, "RunStatusError", &t.RunStatusError)
+ delete(rawMsg, key)
+ case "startTime":
+ err = unpopulate(val, "StartTime", &t.StartTime)
+ delete(rawMsg, key)
+ case "storageAccountId":
+ err = unpopulate(val, "StorageAccountID", &t.StorageAccountID)
+ delete(rawMsg, key)
+ case "summaryReportPath":
+ err = unpopulate(val, "SummaryReportPath", &t.SummaryReportPath)
+ delete(rawMsg, key)
+ case "taskAssignmentId":
+ err = unpopulate(val, "TaskAssignmentID", &t.TaskAssignmentID)
+ delete(rawMsg, key)
+ case "taskId":
+ err = unpopulate(val, "TaskID", &t.TaskID)
+ delete(rawMsg, key)
+ case "taskVersion":
+ err = unpopulate(val, "TaskVersion", &t.TaskVersion)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TaskReportSummary.
+func (t TaskReportSummary) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", t.NextLink)
+ populate(objectMap, "value", t.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TaskReportSummary.
+func (t *TaskReportSummary) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &t.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &t.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TrackedResource.
+func (t TrackedResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", t.ID)
+ populate(objectMap, "location", t.Location)
+ populate(objectMap, "name", t.Name)
+ populate(objectMap, "tags", t.Tags)
+ populate(objectMap, "type", t.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource.
+func (t *TrackedResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &t.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &t.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &t.Name)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &t.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &t.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TriggerParameters.
+func (t TriggerParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "endBy", t.EndBy)
+ populate(objectMap, "interval", t.Interval)
+ populate(objectMap, "intervalUnit", t.IntervalUnit)
+ populateDateTimeRFC3339(objectMap, "startFrom", t.StartFrom)
+ populateDateTimeRFC3339(objectMap, "startOn", t.StartOn)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TriggerParameters.
+func (t *TriggerParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "endBy":
+ err = unpopulateDateTimeRFC3339(val, "EndBy", &t.EndBy)
+ delete(rawMsg, key)
+ case "interval":
+ err = unpopulate(val, "Interval", &t.Interval)
+ delete(rawMsg, key)
+ case "intervalUnit":
+ err = unpopulate(val, "IntervalUnit", &t.IntervalUnit)
+ delete(rawMsg, key)
+ case "startFrom":
+ err = unpopulateDateTimeRFC3339(val, "StartFrom", &t.StartFrom)
+ delete(rawMsg, key)
+ case "startOn":
+ err = unpopulateDateTimeRFC3339(val, "StartOn", &t.StartOn)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TriggerParametersUpdate.
+func (t TriggerParametersUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "endBy", t.EndBy)
+ populate(objectMap, "interval", t.Interval)
+ populate(objectMap, "intervalUnit", t.IntervalUnit)
+ populateDateTimeRFC3339(objectMap, "startFrom", t.StartFrom)
+ populateDateTimeRFC3339(objectMap, "startOn", t.StartOn)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TriggerParametersUpdate.
+func (t *TriggerParametersUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "endBy":
+ err = unpopulateDateTimeRFC3339(val, "EndBy", &t.EndBy)
+ delete(rawMsg, key)
+ case "interval":
+ err = unpopulate(val, "Interval", &t.Interval)
+ delete(rawMsg, key)
+ case "intervalUnit":
+ err = unpopulate(val, "IntervalUnit", &t.IntervalUnit)
+ delete(rawMsg, key)
+ case "startFrom":
+ err = unpopulateDateTimeRFC3339(val, "StartFrom", &t.StartFrom)
+ delete(rawMsg, key)
+ case "startOn":
+ err = unpopulateDateTimeRFC3339(val, "StartOn", &t.StartOn)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UpdateHistoryProperty.
+func (u UpdateHistoryProperty) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "allowProtectedAppendWrites", u.AllowProtectedAppendWrites)
+ populate(objectMap, "allowProtectedAppendWritesAll", u.AllowProtectedAppendWritesAll)
+ populate(objectMap, "immutabilityPeriodSinceCreationInDays", u.ImmutabilityPeriodSinceCreationInDays)
+ populate(objectMap, "objectIdentifier", u.ObjectIdentifier)
+ populate(objectMap, "tenantId", u.TenantID)
+ populateDateTimeRFC3339(objectMap, "timestamp", u.Timestamp)
+ populate(objectMap, "update", u.Update)
+ populate(objectMap, "upn", u.Upn)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateHistoryProperty.
+func (u *UpdateHistoryProperty) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "allowProtectedAppendWrites":
+ err = unpopulate(val, "AllowProtectedAppendWrites", &u.AllowProtectedAppendWrites)
+ delete(rawMsg, key)
+ case "allowProtectedAppendWritesAll":
+ err = unpopulate(val, "AllowProtectedAppendWritesAll", &u.AllowProtectedAppendWritesAll)
+ delete(rawMsg, key)
+ case "immutabilityPeriodSinceCreationInDays":
+ err = unpopulate(val, "ImmutabilityPeriodSinceCreationInDays", &u.ImmutabilityPeriodSinceCreationInDays)
+ delete(rawMsg, key)
+ case "objectIdentifier":
+ err = unpopulate(val, "ObjectIdentifier", &u.ObjectIdentifier)
+ delete(rawMsg, key)
+ case "tenantId":
+ err = unpopulate(val, "TenantID", &u.TenantID)
+ delete(rawMsg, key)
+ case "timestamp":
+ err = unpopulateDateTimeRFC3339(val, "Timestamp", &u.Timestamp)
+ delete(rawMsg, key)
+ case "update":
+ err = unpopulate(val, "Update", &u.Update)
+ delete(rawMsg, key)
+ case "upn":
+ err = unpopulate(val, "Upn", &u.Upn)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Usage.
+func (u Usage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "currentValue", u.CurrentValue)
+ populate(objectMap, "limit", u.Limit)
+ populate(objectMap, "name", u.Name)
+ populate(objectMap, "unit", u.Unit)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Usage.
+func (u *Usage) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "currentValue":
+ err = unpopulate(val, "CurrentValue", &u.CurrentValue)
+ delete(rawMsg, key)
+ case "limit":
+ err = unpopulate(val, "Limit", &u.Limit)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &u.Name)
+ delete(rawMsg, key)
+ case "unit":
+ err = unpopulate(val, "Unit", &u.Unit)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UsageListResult.
+func (u UsageListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", u.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UsageListResult.
+func (u *UsageListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &u.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UsageName.
+func (u UsageName) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "localizedValue", u.LocalizedValue)
+ populate(objectMap, "value", u.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UsageName.
+func (u *UsageName) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "localizedValue":
+ err = unpopulate(val, "LocalizedValue", &u.LocalizedValue)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &u.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity.
+func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "clientId", u.ClientID)
+ populate(objectMap, "principalId", u.PrincipalID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity.
+func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "clientId":
+ err = unpopulate(val, "ClientID", &u.ClientID)
+ delete(rawMsg, key)
+ case "principalId":
+ err = unpopulate(val, "PrincipalID", &u.PrincipalID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRule.
+func (v VirtualNetworkRule) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ objectMap["action"] = "Allow"
+ populate(objectMap, "state", v.State)
+ populate(objectMap, "id", v.VirtualNetworkResourceID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRule.
+func (v *VirtualNetworkRule) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "action":
+ err = unpopulate(val, "Action", &v.Action)
+ delete(rawMsg, key)
+ case "state":
+ err = unpopulate(val, "State", &v.State)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "VirtualNetworkResourceID", &v.VirtualNetworkResourceID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+func populate(m map[string]any, k string, v any) {
+ if v == nil {
+ return
+ } else if azcore.IsNullValue(v) {
+ m[k] = nil
+ } else if !reflect.ValueOf(v).IsNil() {
+ m[k] = v
+ }
+}
+
+func populateAny(m map[string]any, k string, v any) {
+ if v == nil {
+ return
+ } else if azcore.IsNullValue(v) {
+ m[k] = nil
+ } else {
+ m[k] = v
+ }
+}
+
+func unpopulate(data json.RawMessage, fn string, v any) error {
+ if data == nil || string(data) == "null" {
+ return nil
+ }
+ if err := json.Unmarshal(data, v); err != nil {
+ return fmt.Errorf("struct field %s: %v", fn, err)
+ }
+ return nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/networksecurityperimeterconfigurations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/networksecurityperimeterconfigurations_client.go
new file mode 100644
index 0000000000..d856daf802
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/networksecurityperimeterconfigurations_client.go
@@ -0,0 +1,262 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// NetworkSecurityPerimeterConfigurationsClient contains the methods for the NetworkSecurityPerimeterConfigurations group.
+// Don't use this type directly, use NewNetworkSecurityPerimeterConfigurationsClient() instead.
+type NetworkSecurityPerimeterConfigurationsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewNetworkSecurityPerimeterConfigurationsClient creates a new instance of NetworkSecurityPerimeterConfigurationsClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewNetworkSecurityPerimeterConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkSecurityPerimeterConfigurationsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &NetworkSecurityPerimeterConfigurationsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Get - Gets effective NetworkSecurityPerimeterConfiguration for association
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - networkSecurityPerimeterConfigurationName - The name for Network Security Perimeter configuration
+// - options - NetworkSecurityPerimeterConfigurationsClientGetOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.Get
+// method.
+func (client *NetworkSecurityPerimeterConfigurationsClient) Get(ctx context.Context, resourceGroupName string, accountName string, networkSecurityPerimeterConfigurationName string, options *NetworkSecurityPerimeterConfigurationsClientGetOptions) (NetworkSecurityPerimeterConfigurationsClientGetResponse, error) {
+ var err error
+ const operationName = "NetworkSecurityPerimeterConfigurationsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, options)
+ if err != nil {
+ return NetworkSecurityPerimeterConfigurationsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return NetworkSecurityPerimeterConfigurationsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return NetworkSecurityPerimeterConfigurationsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *NetworkSecurityPerimeterConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, networkSecurityPerimeterConfigurationName string, _ *NetworkSecurityPerimeterConfigurationsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if networkSecurityPerimeterConfigurationName == "" {
+ return nil, errors.New("parameter networkSecurityPerimeterConfigurationName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterConfigurationName}", url.PathEscape(networkSecurityPerimeterConfigurationName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *NetworkSecurityPerimeterConfigurationsClient) getHandleResponse(resp *http.Response) (NetworkSecurityPerimeterConfigurationsClientGetResponse, error) {
+ result := NetworkSecurityPerimeterConfigurationsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.NetworkSecurityPerimeterConfiguration); err != nil {
+ return NetworkSecurityPerimeterConfigurationsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Gets list of effective NetworkSecurityPerimeterConfiguration for storage account
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - NetworkSecurityPerimeterConfigurationsClientListOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.NewListPager
+// method.
+func (client *NetworkSecurityPerimeterConfigurationsClient) NewListPager(resourceGroupName string, accountName string, options *NetworkSecurityPerimeterConfigurationsClientListOptions) *runtime.Pager[NetworkSecurityPerimeterConfigurationsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[NetworkSecurityPerimeterConfigurationsClientListResponse]{
+ More: func(page NetworkSecurityPerimeterConfigurationsClientListResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *NetworkSecurityPerimeterConfigurationsClientListResponse) (NetworkSecurityPerimeterConfigurationsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "NetworkSecurityPerimeterConfigurationsClient.NewListPager")
+ req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return NetworkSecurityPerimeterConfigurationsClientListResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return NetworkSecurityPerimeterConfigurationsClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return NetworkSecurityPerimeterConfigurationsClientListResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *NetworkSecurityPerimeterConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *NetworkSecurityPerimeterConfigurationsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *NetworkSecurityPerimeterConfigurationsClient) listHandleResponse(resp *http.Response) (NetworkSecurityPerimeterConfigurationsClientListResponse, error) {
+ result := NetworkSecurityPerimeterConfigurationsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.NetworkSecurityPerimeterConfigurationList); err != nil {
+ return NetworkSecurityPerimeterConfigurationsClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginReconcile - Refreshes any information about the association.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - networkSecurityPerimeterConfigurationName - The name for Network Security Perimeter configuration
+// - options - NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.BeginReconcile
+// method.
+func (client *NetworkSecurityPerimeterConfigurationsClient) BeginReconcile(ctx context.Context, resourceGroupName string, accountName string, networkSecurityPerimeterConfigurationName string, options *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*runtime.Poller[NetworkSecurityPerimeterConfigurationsClientReconcileResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.reconcile(ctx, resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkSecurityPerimeterConfigurationsClientReconcileResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[NetworkSecurityPerimeterConfigurationsClientReconcileResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Reconcile - Refreshes any information about the association.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+func (client *NetworkSecurityPerimeterConfigurationsClient) reconcile(ctx context.Context, resourceGroupName string, accountName string, networkSecurityPerimeterConfigurationName string, options *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*http.Response, error) {
+ var err error
+ const operationName = "NetworkSecurityPerimeterConfigurationsClient.BeginReconcile"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.reconcileCreateRequest(ctx, resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// reconcileCreateRequest creates the Reconcile request.
+func (client *NetworkSecurityPerimeterConfigurationsClient) reconcileCreateRequest(ctx context.Context, resourceGroupName string, accountName string, networkSecurityPerimeterConfigurationName string, _ *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if networkSecurityPerimeterConfigurationName == "" {
+ return nil, errors.New("parameter networkSecurityPerimeterConfigurationName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterConfigurationName}", url.PathEscape(networkSecurityPerimeterConfigurationName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/objectreplicationpolicies_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/objectreplicationpolicies_client.go
new file mode 100644
index 0000000000..360f6fa08f
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/objectreplicationpolicies_client.go
@@ -0,0 +1,321 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// ObjectReplicationPoliciesClient contains the methods for the ObjectReplicationPolicies group.
+// Don't use this type directly, use NewObjectReplicationPoliciesClient() instead.
+type ObjectReplicationPoliciesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewObjectReplicationPoliciesClient creates a new instance of ObjectReplicationPoliciesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewObjectReplicationPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ObjectReplicationPoliciesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &ObjectReplicationPoliciesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// CreateOrUpdate - Create or update the object replication policy of the storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - objectReplicationPolicyID - For the destination account, provide the value 'default'. Configure the policy on the destination
+// account first. For the source account, provide the value of the policy ID that is returned when you
+// download the policy that was defined on the destination account. The policy is downloaded as a JSON file.
+// - properties - The object replication policy set to a storage account. A unique policy ID will be created if absent.
+// - options - ObjectReplicationPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ObjectReplicationPoliciesClient.CreateOrUpdate
+// method.
+func (client *ObjectReplicationPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, properties ObjectReplicationPolicy, options *ObjectReplicationPoliciesClientCreateOrUpdateOptions) (ObjectReplicationPoliciesClientCreateOrUpdateResponse, error) {
+ var err error
+ const operationName = "ObjectReplicationPoliciesClient.CreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, objectReplicationPolicyID, properties, options)
+ if err != nil {
+ return ObjectReplicationPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ObjectReplicationPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ObjectReplicationPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ resp, err := client.createOrUpdateHandleResponse(httpResp)
+ return resp, err
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *ObjectReplicationPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, properties ObjectReplicationPolicy, _ *ObjectReplicationPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if objectReplicationPolicyID == "" {
+ return nil, errors.New("parameter objectReplicationPolicyID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{objectReplicationPolicyId}", url.PathEscape(objectReplicationPolicyID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, properties); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createOrUpdateHandleResponse handles the CreateOrUpdate response.
+func (client *ObjectReplicationPoliciesClient) createOrUpdateHandleResponse(resp *http.Response) (ObjectReplicationPoliciesClientCreateOrUpdateResponse, error) {
+ result := ObjectReplicationPoliciesClientCreateOrUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ObjectReplicationPolicy); err != nil {
+ return ObjectReplicationPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Deletes the object replication policy associated with the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - objectReplicationPolicyID - For the destination account, provide the value 'default'. Configure the policy on the destination
+// account first. For the source account, provide the value of the policy ID that is returned when you
+// download the policy that was defined on the destination account. The policy is downloaded as a JSON file.
+// - options - ObjectReplicationPoliciesClientDeleteOptions contains the optional parameters for the ObjectReplicationPoliciesClient.Delete
+// method.
+func (client *ObjectReplicationPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, options *ObjectReplicationPoliciesClientDeleteOptions) (ObjectReplicationPoliciesClientDeleteResponse, error) {
+ var err error
+ const operationName = "ObjectReplicationPoliciesClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, objectReplicationPolicyID, options)
+ if err != nil {
+ return ObjectReplicationPoliciesClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ObjectReplicationPoliciesClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return ObjectReplicationPoliciesClientDeleteResponse{}, err
+ }
+ return ObjectReplicationPoliciesClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *ObjectReplicationPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, _ *ObjectReplicationPoliciesClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if objectReplicationPolicyID == "" {
+ return nil, errors.New("parameter objectReplicationPolicyID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{objectReplicationPolicyId}", url.PathEscape(objectReplicationPolicyID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Get the object replication policy of the storage account by policy ID.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - objectReplicationPolicyID - For the destination account, provide the value 'default'. Configure the policy on the destination
+// account first. For the source account, provide the value of the policy ID that is returned when you
+// download the policy that was defined on the destination account. The policy is downloaded as a JSON file.
+// - options - ObjectReplicationPoliciesClientGetOptions contains the optional parameters for the ObjectReplicationPoliciesClient.Get
+// method.
+func (client *ObjectReplicationPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, options *ObjectReplicationPoliciesClientGetOptions) (ObjectReplicationPoliciesClientGetResponse, error) {
+ var err error
+ const operationName = "ObjectReplicationPoliciesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, objectReplicationPolicyID, options)
+ if err != nil {
+ return ObjectReplicationPoliciesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ObjectReplicationPoliciesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ObjectReplicationPoliciesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *ObjectReplicationPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, _ *ObjectReplicationPoliciesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if objectReplicationPolicyID == "" {
+ return nil, errors.New("parameter objectReplicationPolicyID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{objectReplicationPolicyId}", url.PathEscape(objectReplicationPolicyID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *ObjectReplicationPoliciesClient) getHandleResponse(resp *http.Response) (ObjectReplicationPoliciesClientGetResponse, error) {
+ result := ObjectReplicationPoliciesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ObjectReplicationPolicy); err != nil {
+ return ObjectReplicationPoliciesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - List the object replication policies associated with the storage account.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - ObjectReplicationPoliciesClientListOptions contains the optional parameters for the ObjectReplicationPoliciesClient.NewListPager
+// method.
+func (client *ObjectReplicationPoliciesClient) NewListPager(resourceGroupName string, accountName string, options *ObjectReplicationPoliciesClientListOptions) *runtime.Pager[ObjectReplicationPoliciesClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[ObjectReplicationPoliciesClientListResponse]{
+ More: func(page ObjectReplicationPoliciesClientListResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *ObjectReplicationPoliciesClientListResponse) (ObjectReplicationPoliciesClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ObjectReplicationPoliciesClient.NewListPager")
+ req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return ObjectReplicationPoliciesClientListResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ObjectReplicationPoliciesClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return ObjectReplicationPoliciesClientListResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *ObjectReplicationPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *ObjectReplicationPoliciesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *ObjectReplicationPoliciesClient) listHandleResponse(resp *http.Response) (ObjectReplicationPoliciesClientListResponse, error) {
+ result := ObjectReplicationPoliciesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ObjectReplicationPolicies); err != nil {
+ return ObjectReplicationPoliciesClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/operations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/operations_client.go
new file mode 100644
index 0000000000..33f8e6eda0
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/operations_client.go
@@ -0,0 +1,86 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+)
+
+// OperationsClient contains the methods for the Operations group.
+// Don't use this type directly, use NewOperationsClient() instead.
+type OperationsClient struct {
+ internal *arm.Client
+}
+
+// NewOperationsClient creates a new instance of OperationsClient with the specified values.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &OperationsClient{
+ internal: cl,
+ }
+ return client, nil
+}
+
+// NewListPager - Lists all of the available Storage Rest API operations.
+//
+// Generated from API version 2025-01-01
+// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
+func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{
+ More: func(page OperationsClientListResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "OperationsClient.NewListPager")
+ req, err := client.listCreateRequest(ctx, options)
+ if err != nil {
+ return OperationsClientListResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return OperationsClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return OperationsClientListResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Storage/operations"
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) {
+ result := OperationsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil {
+ return OperationsClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/options.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/options.go
new file mode 100644
index 0000000000..b0cbc5b2ee
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/options.go
@@ -0,0 +1,663 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+// AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions contains the optional parameters for the AccountsClient.BeginAbortHierarchicalNamespaceMigration
+// method.
+type AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// AccountsClientBeginCreateOptions contains the optional parameters for the AccountsClient.BeginCreate method.
+type AccountsClientBeginCreateOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// AccountsClientBeginCustomerInitiatedMigrationOptions contains the optional parameters for the AccountsClient.BeginCustomerInitiatedMigration
+// method.
+type AccountsClientBeginCustomerInitiatedMigrationOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// AccountsClientBeginFailoverOptions contains the optional parameters for the AccountsClient.BeginFailover method.
+type AccountsClientBeginFailoverOptions struct {
+ // The parameter is set to 'Planned' to indicate whether a Planned failover is requested.. Specifying any value will set the
+ // value to Planned.
+ FailoverType *string
+
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// AccountsClientBeginHierarchicalNamespaceMigrationOptions contains the optional parameters for the AccountsClient.BeginHierarchicalNamespaceMigration
+// method.
+type AccountsClientBeginHierarchicalNamespaceMigrationOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// AccountsClientBeginRestoreBlobRangesOptions contains the optional parameters for the AccountsClient.BeginRestoreBlobRanges
+// method.
+type AccountsClientBeginRestoreBlobRangesOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// AccountsClientCheckNameAvailabilityOptions contains the optional parameters for the AccountsClient.CheckNameAvailability
+// method.
+type AccountsClientCheckNameAvailabilityOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AccountsClientDeleteOptions contains the optional parameters for the AccountsClient.Delete method.
+type AccountsClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AccountsClientGetCustomerInitiatedMigrationOptions contains the optional parameters for the AccountsClient.GetCustomerInitiatedMigration
+// method.
+type AccountsClientGetCustomerInitiatedMigrationOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AccountsClientGetPropertiesOptions contains the optional parameters for the AccountsClient.GetProperties method.
+type AccountsClientGetPropertiesOptions struct {
+ // May be used to expand the properties within account's properties. By default, data is not included when fetching properties.
+ // Currently we only support geoReplicationStats and blobRestoreStatus.
+ Expand *StorageAccountExpand
+}
+
+// AccountsClientListAccountSASOptions contains the optional parameters for the AccountsClient.ListAccountSAS method.
+type AccountsClientListAccountSASOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AccountsClientListByResourceGroupOptions contains the optional parameters for the AccountsClient.NewListByResourceGroupPager
+// method.
+type AccountsClientListByResourceGroupOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AccountsClientListKeysOptions contains the optional parameters for the AccountsClient.ListKeys method.
+type AccountsClientListKeysOptions struct {
+ // Specifies type of the key to be listed. Possible value is kerb.. Specifying any value will set the value to kerb.
+ Expand *string
+}
+
+// AccountsClientListOptions contains the optional parameters for the AccountsClient.NewListPager method.
+type AccountsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AccountsClientListServiceSASOptions contains the optional parameters for the AccountsClient.ListServiceSAS method.
+type AccountsClientListServiceSASOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AccountsClientRegenerateKeyOptions contains the optional parameters for the AccountsClient.RegenerateKey method.
+type AccountsClientRegenerateKeyOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AccountsClientRevokeUserDelegationKeysOptions contains the optional parameters for the AccountsClient.RevokeUserDelegationKeys
+// method.
+type AccountsClientRevokeUserDelegationKeysOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AccountsClientUpdateOptions contains the optional parameters for the AccountsClient.Update method.
+type AccountsClientUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobContainersClientBeginObjectLevelWormOptions contains the optional parameters for the BlobContainersClient.BeginObjectLevelWorm
+// method.
+type BlobContainersClientBeginObjectLevelWormOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// BlobContainersClientClearLegalHoldOptions contains the optional parameters for the BlobContainersClient.ClearLegalHold
+// method.
+type BlobContainersClientClearLegalHoldOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobContainersClientCreateOptions contains the optional parameters for the BlobContainersClient.Create method.
+type BlobContainersClientCreateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.CreateOrUpdateImmutabilityPolicy
+// method.
+type BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions struct {
+ // The entity state (ETag) version of the immutability policy to update must be returned to the server for all update operations.
+ // The ETag value must include the leading and trailing double quotes as
+ // returned by the service.
+ IfMatch *string
+
+ // The ImmutabilityPolicy Properties that will be created or updated to a blob container.
+ Parameters *ImmutabilityPolicy
+}
+
+// BlobContainersClientDeleteImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.DeleteImmutabilityPolicy
+// method.
+type BlobContainersClientDeleteImmutabilityPolicyOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobContainersClientDeleteOptions contains the optional parameters for the BlobContainersClient.Delete method.
+type BlobContainersClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobContainersClientExtendImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.ExtendImmutabilityPolicy
+// method.
+type BlobContainersClientExtendImmutabilityPolicyOptions struct {
+ // The ImmutabilityPolicy Properties that will be extended for a blob container.
+ Parameters *ImmutabilityPolicy
+}
+
+// BlobContainersClientGetImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.GetImmutabilityPolicy
+// method.
+type BlobContainersClientGetImmutabilityPolicyOptions struct {
+ // The entity state (ETag) version of the immutability policy to update must be returned to the server for all update operations.
+ // The ETag value must include the leading and trailing double quotes as
+ // returned by the service.
+ IfMatch *string
+}
+
+// BlobContainersClientGetOptions contains the optional parameters for the BlobContainersClient.Get method.
+type BlobContainersClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobContainersClientLeaseOptions contains the optional parameters for the BlobContainersClient.Lease method.
+type BlobContainersClientLeaseOptions struct {
+ // Lease Container request body.
+ Parameters *LeaseContainerRequest
+}
+
+// BlobContainersClientListOptions contains the optional parameters for the BlobContainersClient.NewListPager method.
+type BlobContainersClientListOptions struct {
+ // Optional. When specified, only container names starting with the filter will be listed.
+ Filter *string
+
+ // Optional, used to include the properties for soft deleted blob containers.
+ Include *ListContainersInclude
+
+ // Optional. Specified maximum number of containers that can be included in the list.
+ Maxpagesize *string
+}
+
+// BlobContainersClientLockImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.LockImmutabilityPolicy
+// method.
+type BlobContainersClientLockImmutabilityPolicyOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobContainersClientSetLegalHoldOptions contains the optional parameters for the BlobContainersClient.SetLegalHold method.
+type BlobContainersClientSetLegalHoldOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobContainersClientUpdateOptions contains the optional parameters for the BlobContainersClient.Update method.
+type BlobContainersClientUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobInventoryPoliciesClientCreateOrUpdateOptions contains the optional parameters for the BlobInventoryPoliciesClient.CreateOrUpdate
+// method.
+type BlobInventoryPoliciesClientCreateOrUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobInventoryPoliciesClientDeleteOptions contains the optional parameters for the BlobInventoryPoliciesClient.Delete method.
+type BlobInventoryPoliciesClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobInventoryPoliciesClientGetOptions contains the optional parameters for the BlobInventoryPoliciesClient.Get method.
+type BlobInventoryPoliciesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobInventoryPoliciesClientListOptions contains the optional parameters for the BlobInventoryPoliciesClient.NewListPager
+// method.
+type BlobInventoryPoliciesClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobServicesClientGetServicePropertiesOptions contains the optional parameters for the BlobServicesClient.GetServiceProperties
+// method.
+type BlobServicesClientGetServicePropertiesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobServicesClientListOptions contains the optional parameters for the BlobServicesClient.NewListPager method.
+type BlobServicesClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobServicesClientSetServicePropertiesOptions contains the optional parameters for the BlobServicesClient.SetServiceProperties
+// method.
+type BlobServicesClientSetServicePropertiesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeletedAccountsClientGetOptions contains the optional parameters for the DeletedAccountsClient.Get method.
+type DeletedAccountsClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeletedAccountsClientListOptions contains the optional parameters for the DeletedAccountsClient.NewListPager method.
+type DeletedAccountsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// EncryptionScopesClientGetOptions contains the optional parameters for the EncryptionScopesClient.Get method.
+type EncryptionScopesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// EncryptionScopesClientListOptions contains the optional parameters for the EncryptionScopesClient.NewListPager method.
+type EncryptionScopesClientListOptions struct {
+ // Optional. When specified, only encryption scope names starting with the filter will be listed.
+ Filter *string
+
+ // Optional, when specified, will list encryption scopes with the specific state. Defaults to All
+ Include *ListEncryptionScopesInclude
+
+ // Optional, specifies the maximum number of encryption scopes that will be included in the list response.
+ Maxpagesize *int32
+}
+
+// EncryptionScopesClientPatchOptions contains the optional parameters for the EncryptionScopesClient.Patch method.
+type EncryptionScopesClientPatchOptions struct {
+ // placeholder for future optional parameters
+}
+
+// EncryptionScopesClientPutOptions contains the optional parameters for the EncryptionScopesClient.Put method.
+type EncryptionScopesClientPutOptions struct {
+ // placeholder for future optional parameters
+}
+
+// FileServicesClientGetServicePropertiesOptions contains the optional parameters for the FileServicesClient.GetServiceProperties
+// method.
+type FileServicesClientGetServicePropertiesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// FileServicesClientGetServiceUsageOptions contains the optional parameters for the FileServicesClient.GetServiceUsage method.
+type FileServicesClientGetServiceUsageOptions struct {
+ // placeholder for future optional parameters
+}
+
+// FileServicesClientListOptions contains the optional parameters for the FileServicesClient.List method.
+type FileServicesClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// FileServicesClientListServiceUsagesOptions contains the optional parameters for the FileServicesClient.NewListServiceUsagesPager
+// method.
+type FileServicesClientListServiceUsagesOptions struct {
+ // Optional, specifies the maximum number of file service usages to be included in the list response.
+ Maxpagesize *int32
+}
+
+// FileServicesClientSetServicePropertiesOptions contains the optional parameters for the FileServicesClient.SetServiceProperties
+// method.
+type FileServicesClientSetServicePropertiesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// FileSharesClientCreateOptions contains the optional parameters for the FileSharesClient.Create method.
+type FileSharesClientCreateOptions struct {
+ // Optional, used to expand the properties within share's properties. Valid values are: snapshots. Should be passed as a string
+ // with delimiter ','
+ Expand *string
+}
+
+// FileSharesClientDeleteOptions contains the optional parameters for the FileSharesClient.Delete method.
+type FileSharesClientDeleteOptions struct {
+ // Optional. Valid values are: snapshots, leased-snapshots, none. The default value is snapshots. For 'snapshots', the file
+ // share is deleted including all of its file share snapshots. If the file share
+ // contains leased-snapshots, the deletion fails. For 'leased-snapshots', the file share is deleted included all of its file
+ // share snapshots (leased/unleased). For 'none', the file share is deleted if it
+ // has no share snapshots. If the file share contains any snapshots (leased or unleased), the deletion fails.
+ Include *string
+
+ // Optional, used to delete a snapshot.
+ XMSSnapshot *string
+}
+
+// FileSharesClientGetOptions contains the optional parameters for the FileSharesClient.Get method.
+type FileSharesClientGetOptions struct {
+ // Optional, used to expand the properties within share's properties. Valid values are: stats. Should be passed as a string
+ // with delimiter ','.
+ Expand *string
+
+ // Optional, used to retrieve properties of a snapshot.
+ XMSSnapshot *string
+}
+
+// FileSharesClientLeaseOptions contains the optional parameters for the FileSharesClient.Lease method.
+type FileSharesClientLeaseOptions struct {
+ // Lease Share request body.
+ Parameters *LeaseShareRequest
+
+ // Optional. Specify the snapshot time to lease a snapshot.
+ XMSSnapshot *string
+}
+
+// FileSharesClientListOptions contains the optional parameters for the FileSharesClient.NewListPager method.
+type FileSharesClientListOptions struct {
+ // Optional, used to expand the properties within share's properties. Valid values are: deleted, snapshots. Should be passed
+ // as a string with delimiter ','
+ Expand *string
+
+ // Optional. When specified, only share names starting with the filter will be listed.
+ Filter *string
+
+ // Optional. Specified maximum number of shares that can be included in the list.
+ Maxpagesize *string
+}
+
+// FileSharesClientRestoreOptions contains the optional parameters for the FileSharesClient.Restore method.
+type FileSharesClientRestoreOptions struct {
+ // placeholder for future optional parameters
+}
+
+// FileSharesClientUpdateOptions contains the optional parameters for the FileSharesClient.Update method.
+type FileSharesClientUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// LocalUsersClientCreateOrUpdateOptions contains the optional parameters for the LocalUsersClient.CreateOrUpdate method.
+type LocalUsersClientCreateOrUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// LocalUsersClientDeleteOptions contains the optional parameters for the LocalUsersClient.Delete method.
+type LocalUsersClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// LocalUsersClientGetOptions contains the optional parameters for the LocalUsersClient.Get method.
+type LocalUsersClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// LocalUsersClientListKeysOptions contains the optional parameters for the LocalUsersClient.ListKeys method.
+type LocalUsersClientListKeysOptions struct {
+ // placeholder for future optional parameters
+}
+
+// LocalUsersClientListOptions contains the optional parameters for the LocalUsersClient.NewListPager method.
+type LocalUsersClientListOptions struct {
+ // Optional. When specified, only local user names starting with the filter will be listed.
+ Filter *string
+
+ // Optional, when specified, will list local users enabled for the specific protocol. Lists all users by default.
+ Include *ListLocalUserIncludeParam
+
+ // Optional, specifies the maximum number of local users that will be included in the list response.
+ Maxpagesize *int32
+}
+
+// LocalUsersClientRegeneratePasswordOptions contains the optional parameters for the LocalUsersClient.RegeneratePassword
+// method.
+type LocalUsersClientRegeneratePasswordOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ManagementPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ManagementPoliciesClient.CreateOrUpdate
+// method.
+type ManagementPoliciesClientCreateOrUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ManagementPoliciesClientDeleteOptions contains the optional parameters for the ManagementPoliciesClient.Delete method.
+type ManagementPoliciesClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ManagementPoliciesClientGetOptions contains the optional parameters for the ManagementPoliciesClient.Get method.
+type ManagementPoliciesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.BeginReconcile
+// method.
+type NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// NetworkSecurityPerimeterConfigurationsClientGetOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.Get
+// method.
+type NetworkSecurityPerimeterConfigurationsClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// NetworkSecurityPerimeterConfigurationsClientListOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.NewListPager
+// method.
+type NetworkSecurityPerimeterConfigurationsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ObjectReplicationPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ObjectReplicationPoliciesClient.CreateOrUpdate
+// method.
+type ObjectReplicationPoliciesClientCreateOrUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ObjectReplicationPoliciesClientDeleteOptions contains the optional parameters for the ObjectReplicationPoliciesClient.Delete
+// method.
+type ObjectReplicationPoliciesClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ObjectReplicationPoliciesClientGetOptions contains the optional parameters for the ObjectReplicationPoliciesClient.Get
+// method.
+type ObjectReplicationPoliciesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ObjectReplicationPoliciesClientListOptions contains the optional parameters for the ObjectReplicationPoliciesClient.NewListPager
+// method.
+type ObjectReplicationPoliciesClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
+type OperationsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete
+// method.
+type PrivateEndpointConnectionsClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get
+// method.
+type PrivateEndpointConnectionsClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager
+// method.
+type PrivateEndpointConnectionsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// PrivateEndpointConnectionsClientPutOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Put
+// method.
+type PrivateEndpointConnectionsClientPutOptions struct {
+ // placeholder for future optional parameters
+}
+
+// PrivateLinkResourcesClientListByStorageAccountOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByStorageAccount
+// method.
+type PrivateLinkResourcesClientListByStorageAccountOptions struct {
+ // placeholder for future optional parameters
+}
+
+// QueueClientCreateOptions contains the optional parameters for the QueueClient.Create method.
+type QueueClientCreateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// QueueClientDeleteOptions contains the optional parameters for the QueueClient.Delete method.
+type QueueClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// QueueClientGetOptions contains the optional parameters for the QueueClient.Get method.
+type QueueClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// QueueClientListOptions contains the optional parameters for the QueueClient.NewListPager method.
+type QueueClientListOptions struct {
+ // Optional, When specified, only the queues with a name starting with the given filter will be listed.
+ Filter *string
+
+ // Optional, a maximum number of queues that should be included in a list queue response
+ Maxpagesize *string
+}
+
+// QueueClientUpdateOptions contains the optional parameters for the QueueClient.Update method.
+type QueueClientUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// QueueServicesClientGetServicePropertiesOptions contains the optional parameters for the QueueServicesClient.GetServiceProperties
+// method.
+type QueueServicesClientGetServicePropertiesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// QueueServicesClientListOptions contains the optional parameters for the QueueServicesClient.List method.
+type QueueServicesClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// QueueServicesClientSetServicePropertiesOptions contains the optional parameters for the QueueServicesClient.SetServiceProperties
+// method.
+type QueueServicesClientSetServicePropertiesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// SKUsClientListOptions contains the optional parameters for the SKUsClient.NewListPager method.
+type SKUsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TableClientCreateOptions contains the optional parameters for the TableClient.Create method.
+type TableClientCreateOptions struct {
+ // The parameters to provide to create a table.
+ Parameters *Table
+}
+
+// TableClientDeleteOptions contains the optional parameters for the TableClient.Delete method.
+type TableClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TableClientGetOptions contains the optional parameters for the TableClient.Get method.
+type TableClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TableClientListOptions contains the optional parameters for the TableClient.NewListPager method.
+type TableClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TableClientUpdateOptions contains the optional parameters for the TableClient.Update method.
+type TableClientUpdateOptions struct {
+ // The parameters to provide to create a table.
+ Parameters *Table
+}
+
+// TableServicesClientGetServicePropertiesOptions contains the optional parameters for the TableServicesClient.GetServiceProperties
+// method.
+type TableServicesClientGetServicePropertiesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TableServicesClientListOptions contains the optional parameters for the TableServicesClient.List method.
+type TableServicesClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TableServicesClientSetServicePropertiesOptions contains the optional parameters for the TableServicesClient.SetServiceProperties
+// method.
+type TableServicesClientSetServicePropertiesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TaskAssignmentInstancesReportClientListOptions contains the optional parameters for the TaskAssignmentInstancesReportClient.NewListPager
+// method.
+type TaskAssignmentInstancesReportClientListOptions struct {
+ // Optional. When specified, it can be used to query using reporting properties. See Constructing Filter Strings
+ // [https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings] for details.
+ Filter *string
+
+ // Optional, specifies the maximum number of storage task assignment instances to be included in the list response.
+ Maxpagesize *int32
+}
+
+// TaskAssignmentsClientBeginCreateOptions contains the optional parameters for the TaskAssignmentsClient.BeginCreate method.
+type TaskAssignmentsClientBeginCreateOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// TaskAssignmentsClientBeginDeleteOptions contains the optional parameters for the TaskAssignmentsClient.BeginDelete method.
+type TaskAssignmentsClientBeginDeleteOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// TaskAssignmentsClientBeginUpdateOptions contains the optional parameters for the TaskAssignmentsClient.BeginUpdate method.
+type TaskAssignmentsClientBeginUpdateOptions struct {
+ // Resumes the long-running operation from the provided token.
+ ResumeToken string
+}
+
+// TaskAssignmentsClientGetOptions contains the optional parameters for the TaskAssignmentsClient.Get method.
+type TaskAssignmentsClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TaskAssignmentsClientListOptions contains the optional parameters for the TaskAssignmentsClient.NewListPager method.
+type TaskAssignmentsClientListOptions struct {
+ // Optional, specifies the maximum number of storage task assignment Ids to be included in the list response.
+ Maxpagesize *int32
+}
+
+// TaskAssignmentsInstancesReportClientListOptions contains the optional parameters for the TaskAssignmentsInstancesReportClient.NewListPager
+// method.
+type TaskAssignmentsInstancesReportClientListOptions struct {
+ // Optional. When specified, it can be used to query using reporting properties. See Constructing Filter Strings
+ // [https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings] for details.
+ Filter *string
+
+ // Optional, specifies the maximum number of storage task assignment instances to be included in the list response.
+ Maxpagesize *int32
+}
+
+// UsagesClientListByLocationOptions contains the optional parameters for the UsagesClient.NewListByLocationPager method.
+type UsagesClientListByLocationOptions struct {
+ // placeholder for future optional parameters
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/privateendpointconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/privateendpointconnections_client.go
new file mode 100644
index 0000000000..df3e32d290
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/privateendpointconnections_client.go
@@ -0,0 +1,315 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// PrivateEndpointConnectionsClient contains the methods for the PrivateEndpointConnections group.
+// Don't use this type directly, use NewPrivateEndpointConnectionsClient() instead.
+type PrivateEndpointConnectionsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &PrivateEndpointConnectionsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Delete - Deletes the specified private endpoint connection associated with the storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource
+// - options - PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete
+// method.
+func (client *PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteOptions) (PrivateEndpointConnectionsClientDeleteResponse, error) {
+ var err error
+ const operationName = "PrivateEndpointConnectionsClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, privateEndpointConnectionName, options)
+ if err != nil {
+ return PrivateEndpointConnectionsClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return PrivateEndpointConnectionsClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return PrivateEndpointConnectionsClientDeleteResponse{}, err
+ }
+ return PrivateEndpointConnectionsClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if privateEndpointConnectionName == "" {
+ return nil, errors.New("parameter privateEndpointConnectionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Gets the specified private endpoint connection associated with the storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource
+// - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get
+// method.
+func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) {
+ var err error
+ const operationName = "PrivateEndpointConnectionsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, privateEndpointConnectionName, options)
+ if err != nil {
+ return PrivateEndpointConnectionsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return PrivateEndpointConnectionsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return PrivateEndpointConnectionsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if privateEndpointConnectionName == "" {
+ return nil, errors.New("parameter privateEndpointConnectionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientGetResponse, error) {
+ result := PrivateEndpointConnectionsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil {
+ return PrivateEndpointConnectionsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - List all the private endpoint connections associated with the storage account.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager
+// method.
+func (client *PrivateEndpointConnectionsClient) NewListPager(resourceGroupName string, accountName string, options *PrivateEndpointConnectionsClientListOptions) *runtime.Pager[PrivateEndpointConnectionsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[PrivateEndpointConnectionsClientListResponse]{
+ More: func(page PrivateEndpointConnectionsClientListResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *PrivateEndpointConnectionsClientListResponse) (PrivateEndpointConnectionsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "PrivateEndpointConnectionsClient.NewListPager")
+ req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return PrivateEndpointConnectionsClientListResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return PrivateEndpointConnectionsClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return PrivateEndpointConnectionsClientListResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *PrivateEndpointConnectionsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *PrivateEndpointConnectionsClient) listHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientListResponse, error) {
+ result := PrivateEndpointConnectionsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionListResult); err != nil {
+ return PrivateEndpointConnectionsClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// Put - Update the state of specified private endpoint connection associated with the storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource
+// - properties - The private endpoint connection properties.
+// - options - PrivateEndpointConnectionsClientPutOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Put
+// method.
+func (client *PrivateEndpointConnectionsClient) Put(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientPutOptions) (PrivateEndpointConnectionsClientPutResponse, error) {
+ var err error
+ const operationName = "PrivateEndpointConnectionsClient.Put"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.putCreateRequest(ctx, resourceGroupName, accountName, privateEndpointConnectionName, properties, options)
+ if err != nil {
+ return PrivateEndpointConnectionsClientPutResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return PrivateEndpointConnectionsClientPutResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return PrivateEndpointConnectionsClientPutResponse{}, err
+ }
+ resp, err := client.putHandleResponse(httpResp)
+ return resp, err
+}
+
+// putCreateRequest creates the Put request.
+func (client *PrivateEndpointConnectionsClient) putCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, _ *PrivateEndpointConnectionsClientPutOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if privateEndpointConnectionName == "" {
+ return nil, errors.New("parameter privateEndpointConnectionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, properties); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// putHandleResponse handles the Put response.
+func (client *PrivateEndpointConnectionsClient) putHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientPutResponse, error) {
+ result := PrivateEndpointConnectionsClientPutResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil {
+ return PrivateEndpointConnectionsClientPutResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/privatelinkresources_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/privatelinkresources_client.go
new file mode 100644
index 0000000000..cb6f64e92a
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/privatelinkresources_client.go
@@ -0,0 +1,107 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// PrivateLinkResourcesClient contains the methods for the PrivateLinkResources group.
+// Don't use this type directly, use NewPrivateLinkResourcesClient() instead.
+type PrivateLinkResourcesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &PrivateLinkResourcesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// ListByStorageAccount - Gets the private link resources that need to be created for a storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - PrivateLinkResourcesClientListByStorageAccountOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByStorageAccount
+// method.
+func (client *PrivateLinkResourcesClient) ListByStorageAccount(ctx context.Context, resourceGroupName string, accountName string, options *PrivateLinkResourcesClientListByStorageAccountOptions) (PrivateLinkResourcesClientListByStorageAccountResponse, error) {
+ var err error
+ const operationName = "PrivateLinkResourcesClient.ListByStorageAccount"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listByStorageAccountCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return PrivateLinkResourcesClientListByStorageAccountResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return PrivateLinkResourcesClientListByStorageAccountResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return PrivateLinkResourcesClientListByStorageAccountResponse{}, err
+ }
+ resp, err := client.listByStorageAccountHandleResponse(httpResp)
+ return resp, err
+}
+
+// listByStorageAccountCreateRequest creates the ListByStorageAccount request.
+func (client *PrivateLinkResourcesClient) listByStorageAccountCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *PrivateLinkResourcesClientListByStorageAccountOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateLinkResources"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByStorageAccountHandleResponse handles the ListByStorageAccount response.
+func (client *PrivateLinkResourcesClient) listByStorageAccountHandleResponse(resp *http.Response) (PrivateLinkResourcesClientListByStorageAccountResponse, error) {
+ result := PrivateLinkResourcesClientListByStorageAccountResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceListResult); err != nil {
+ return PrivateLinkResourcesClientListByStorageAccountResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/queue_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/queue_client.go
new file mode 100644
index 0000000000..90d6c5a546
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/queue_client.go
@@ -0,0 +1,398 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// QueueClient contains the methods for the Queue group.
+// Don't use this type directly, use NewQueueClient() instead.
+type QueueClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewQueueClient creates a new instance of QueueClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewQueueClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QueueClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &QueueClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Create - Creates a new queue with the specified queue name, under the specified account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - queueName - A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must
+// comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with
+// an alphanumeric character and it cannot have two consecutive dash(-) characters.
+// - queue - Queue properties and metadata to be created with
+// - options - QueueClientCreateOptions contains the optional parameters for the QueueClient.Create method.
+func (client *QueueClient) Create(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue Queue, options *QueueClientCreateOptions) (QueueClientCreateResponse, error) {
+ var err error
+ const operationName = "QueueClient.Create"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, queueName, queue, options)
+ if err != nil {
+ return QueueClientCreateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return QueueClientCreateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return QueueClientCreateResponse{}, err
+ }
+ resp, err := client.createHandleResponse(httpResp)
+ return resp, err
+}
+
+// createCreateRequest creates the Create request.
+func (client *QueueClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue Queue, _ *QueueClientCreateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if queueName == "" {
+ return nil, errors.New("parameter queueName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{queueName}", url.PathEscape(queueName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, queue); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createHandleResponse handles the Create response.
+func (client *QueueClient) createHandleResponse(resp *http.Response) (QueueClientCreateResponse, error) {
+ result := QueueClientCreateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Queue); err != nil {
+ return QueueClientCreateResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Deletes the queue with the specified queue name, under the specified account if it exists.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - queueName - A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must
+// comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with
+// an alphanumeric character and it cannot have two consecutive dash(-) characters.
+// - options - QueueClientDeleteOptions contains the optional parameters for the QueueClient.Delete method.
+func (client *QueueClient) Delete(ctx context.Context, resourceGroupName string, accountName string, queueName string, options *QueueClientDeleteOptions) (QueueClientDeleteResponse, error) {
+ var err error
+ const operationName = "QueueClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, queueName, options)
+ if err != nil {
+ return QueueClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return QueueClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return QueueClientDeleteResponse{}, err
+ }
+ return QueueClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *QueueClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, _ *QueueClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if queueName == "" {
+ return nil, errors.New("parameter queueName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{queueName}", url.PathEscape(queueName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Gets the queue with the specified queue name, under the specified account if it exists.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - queueName - A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must
+// comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with
+// an alphanumeric character and it cannot have two consecutive dash(-) characters.
+// - options - QueueClientGetOptions contains the optional parameters for the QueueClient.Get method.
+func (client *QueueClient) Get(ctx context.Context, resourceGroupName string, accountName string, queueName string, options *QueueClientGetOptions) (QueueClientGetResponse, error) {
+ var err error
+ const operationName = "QueueClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, queueName, options)
+ if err != nil {
+ return QueueClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return QueueClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return QueueClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *QueueClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, _ *QueueClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if queueName == "" {
+ return nil, errors.New("parameter queueName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{queueName}", url.PathEscape(queueName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *QueueClient) getHandleResponse(resp *http.Response) (QueueClientGetResponse, error) {
+ result := QueueClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Queue); err != nil {
+ return QueueClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Gets a list of all the queues under the specified storage account
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - QueueClientListOptions contains the optional parameters for the QueueClient.NewListPager method.
+func (client *QueueClient) NewListPager(resourceGroupName string, accountName string, options *QueueClientListOptions) *runtime.Pager[QueueClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[QueueClientListResponse]{
+ More: func(page QueueClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *QueueClientListResponse) (QueueClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "QueueClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ }, nil)
+ if err != nil {
+ return QueueClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *QueueClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *QueueClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Maxpagesize != nil {
+ reqQP.Set("$maxpagesize", *options.Maxpagesize)
+ }
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *QueueClient) listHandleResponse(resp *http.Response) (QueueClientListResponse, error) {
+ result := QueueClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ListQueueResource); err != nil {
+ return QueueClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// Update - Creates a new queue with the specified queue name, under the specified account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - queueName - A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must
+// comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with
+// an alphanumeric character and it cannot have two consecutive dash(-) characters.
+// - queue - Queue properties and metadata to be created with
+// - options - QueueClientUpdateOptions contains the optional parameters for the QueueClient.Update method.
+func (client *QueueClient) Update(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue Queue, options *QueueClientUpdateOptions) (QueueClientUpdateResponse, error) {
+ var err error
+ const operationName = "QueueClient.Update"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, queueName, queue, options)
+ if err != nil {
+ return QueueClientUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return QueueClientUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return QueueClientUpdateResponse{}, err
+ }
+ resp, err := client.updateHandleResponse(httpResp)
+ return resp, err
+}
+
+// updateCreateRequest creates the Update request.
+func (client *QueueClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue Queue, _ *QueueClientUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if queueName == "" {
+ return nil, errors.New("parameter queueName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{queueName}", url.PathEscape(queueName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, queue); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// updateHandleResponse handles the Update response.
+func (client *QueueClient) updateHandleResponse(resp *http.Response) (QueueClientUpdateResponse, error) {
+ result := QueueClientUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Queue); err != nil {
+ return QueueClientUpdateResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/queueservices_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/queueservices_client.go
new file mode 100644
index 0000000000..304cb6c773
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/queueservices_client.go
@@ -0,0 +1,247 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// QueueServicesClient contains the methods for the QueueServices group.
+// Don't use this type directly, use NewQueueServicesClient() instead.
+type QueueServicesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewQueueServicesClient creates a new instance of QueueServicesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewQueueServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QueueServicesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &QueueServicesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// GetServiceProperties - Gets the properties of a storage account’s Queue service, including properties for Storage Analytics
+// and CORS (Cross-Origin Resource Sharing) rules.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - QueueServicesClientGetServicePropertiesOptions contains the optional parameters for the QueueServicesClient.GetServiceProperties
+// method.
+func (client *QueueServicesClient) GetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, options *QueueServicesClientGetServicePropertiesOptions) (QueueServicesClientGetServicePropertiesResponse, error) {
+ var err error
+ const operationName = "QueueServicesClient.GetServiceProperties"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getServicePropertiesCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return QueueServicesClientGetServicePropertiesResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return QueueServicesClientGetServicePropertiesResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return QueueServicesClientGetServicePropertiesResponse{}, err
+ }
+ resp, err := client.getServicePropertiesHandleResponse(httpResp)
+ return resp, err
+}
+
+// getServicePropertiesCreateRequest creates the GetServiceProperties request.
+func (client *QueueServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *QueueServicesClientGetServicePropertiesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ urlPath = strings.ReplaceAll(urlPath, "{queueServiceName}", url.PathEscape("default"))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getServicePropertiesHandleResponse handles the GetServiceProperties response.
+func (client *QueueServicesClient) getServicePropertiesHandleResponse(resp *http.Response) (QueueServicesClientGetServicePropertiesResponse, error) {
+ result := QueueServicesClientGetServicePropertiesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.QueueServiceProperties); err != nil {
+ return QueueServicesClientGetServicePropertiesResponse{}, err
+ }
+ return result, nil
+}
+
+// List - List all queue services for the storage account
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - QueueServicesClientListOptions contains the optional parameters for the QueueServicesClient.List method.
+func (client *QueueServicesClient) List(ctx context.Context, resourceGroupName string, accountName string, options *QueueServicesClientListOptions) (QueueServicesClientListResponse, error) {
+ var err error
+ const operationName = "QueueServicesClient.List"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return QueueServicesClientListResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return QueueServicesClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return QueueServicesClientListResponse{}, err
+ }
+ resp, err := client.listHandleResponse(httpResp)
+ return resp, err
+}
+
+// listCreateRequest creates the List request.
+func (client *QueueServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *QueueServicesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *QueueServicesClient) listHandleResponse(resp *http.Response) (QueueServicesClientListResponse, error) {
+ result := QueueServicesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ListQueueServices); err != nil {
+ return QueueServicesClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// SetServiceProperties - Sets the properties of a storage account’s Queue service, including properties for Storage Analytics
+// and CORS (Cross-Origin Resource Sharing) rules.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The properties of a storage account’s Queue service, only properties for Storage Analytics and CORS (Cross-Origin
+// Resource Sharing) rules can be specified.
+// - options - QueueServicesClientSetServicePropertiesOptions contains the optional parameters for the QueueServicesClient.SetServiceProperties
+// method.
+func (client *QueueServicesClient) SetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, parameters QueueServiceProperties, options *QueueServicesClientSetServicePropertiesOptions) (QueueServicesClientSetServicePropertiesResponse, error) {
+ var err error
+ const operationName = "QueueServicesClient.SetServiceProperties"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.setServicePropertiesCreateRequest(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return QueueServicesClientSetServicePropertiesResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return QueueServicesClientSetServicePropertiesResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return QueueServicesClientSetServicePropertiesResponse{}, err
+ }
+ resp, err := client.setServicePropertiesHandleResponse(httpResp)
+ return resp, err
+}
+
+// setServicePropertiesCreateRequest creates the SetServiceProperties request.
+func (client *QueueServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters QueueServiceProperties, _ *QueueServicesClientSetServicePropertiesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ urlPath = strings.ReplaceAll(urlPath, "{queueServiceName}", url.PathEscape("default"))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// setServicePropertiesHandleResponse handles the SetServiceProperties response.
+func (client *QueueServicesClient) setServicePropertiesHandleResponse(resp *http.Response) (QueueServicesClientSetServicePropertiesResponse, error) {
+ result := QueueServicesClientSetServicePropertiesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.QueueServiceProperties); err != nil {
+ return QueueServicesClientSetServicePropertiesResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/responses.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/responses.go
new file mode 100644
index 0000000000..a7f6f5c99a
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/responses.go
@@ -0,0 +1,624 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+// AccountsClientAbortHierarchicalNamespaceMigrationResponse contains the response from method AccountsClient.BeginAbortHierarchicalNamespaceMigration.
+type AccountsClientAbortHierarchicalNamespaceMigrationResponse struct {
+ // placeholder for future response values
+}
+
+// AccountsClientCheckNameAvailabilityResponse contains the response from method AccountsClient.CheckNameAvailability.
+type AccountsClientCheckNameAvailabilityResponse struct {
+ // The CheckNameAvailability operation response.
+ CheckNameAvailabilityResult
+}
+
+// AccountsClientCreateResponse contains the response from method AccountsClient.BeginCreate.
+type AccountsClientCreateResponse struct {
+ // The storage account.
+ Account
+}
+
+// AccountsClientCustomerInitiatedMigrationResponse contains the response from method AccountsClient.BeginCustomerInitiatedMigration.
+type AccountsClientCustomerInitiatedMigrationResponse struct {
+ // placeholder for future response values
+}
+
+// AccountsClientDeleteResponse contains the response from method AccountsClient.Delete.
+type AccountsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// AccountsClientFailoverResponse contains the response from method AccountsClient.BeginFailover.
+type AccountsClientFailoverResponse struct {
+ // placeholder for future response values
+}
+
+// AccountsClientGetCustomerInitiatedMigrationResponse contains the response from method AccountsClient.GetCustomerInitiatedMigration.
+type AccountsClientGetCustomerInitiatedMigrationResponse struct {
+ // The parameters or status associated with an ongoing or enqueued storage account migration in order to update its current
+ // SKU or region.
+ AccountMigration
+}
+
+// AccountsClientGetPropertiesResponse contains the response from method AccountsClient.GetProperties.
+type AccountsClientGetPropertiesResponse struct {
+ // The storage account.
+ Account
+}
+
+// AccountsClientHierarchicalNamespaceMigrationResponse contains the response from method AccountsClient.BeginHierarchicalNamespaceMigration.
+type AccountsClientHierarchicalNamespaceMigrationResponse struct {
+ // placeholder for future response values
+}
+
+// AccountsClientListAccountSASResponse contains the response from method AccountsClient.ListAccountSAS.
+type AccountsClientListAccountSASResponse struct {
+ // The List SAS credentials operation response.
+ ListAccountSasResponse
+}
+
+// AccountsClientListByResourceGroupResponse contains the response from method AccountsClient.NewListByResourceGroupPager.
+type AccountsClientListByResourceGroupResponse struct {
+ // The response from the List Storage Accounts operation.
+ AccountListResult
+}
+
+// AccountsClientListKeysResponse contains the response from method AccountsClient.ListKeys.
+type AccountsClientListKeysResponse struct {
+ // The response from the ListKeys operation.
+ AccountListKeysResult
+}
+
+// AccountsClientListResponse contains the response from method AccountsClient.NewListPager.
+type AccountsClientListResponse struct {
+ // The response from the List Storage Accounts operation.
+ AccountListResult
+}
+
+// AccountsClientListServiceSASResponse contains the response from method AccountsClient.ListServiceSAS.
+type AccountsClientListServiceSASResponse struct {
+ // The List service SAS credentials operation response.
+ ListServiceSasResponse
+}
+
+// AccountsClientRegenerateKeyResponse contains the response from method AccountsClient.RegenerateKey.
+type AccountsClientRegenerateKeyResponse struct {
+ // The response from the ListKeys operation.
+ AccountListKeysResult
+}
+
+// AccountsClientRestoreBlobRangesResponse contains the response from method AccountsClient.BeginRestoreBlobRanges.
+type AccountsClientRestoreBlobRangesResponse struct {
+ // Blob restore status.
+ BlobRestoreStatus
+}
+
+// AccountsClientRevokeUserDelegationKeysResponse contains the response from method AccountsClient.RevokeUserDelegationKeys.
+type AccountsClientRevokeUserDelegationKeysResponse struct {
+ // placeholder for future response values
+}
+
+// AccountsClientUpdateResponse contains the response from method AccountsClient.Update.
+type AccountsClientUpdateResponse struct {
+ // The storage account.
+ Account
+}
+
+// BlobContainersClientClearLegalHoldResponse contains the response from method BlobContainersClient.ClearLegalHold.
+type BlobContainersClientClearLegalHoldResponse struct {
+ // The LegalHold property of a blob container.
+ LegalHold
+}
+
+// BlobContainersClientCreateOrUpdateImmutabilityPolicyResponse contains the response from method BlobContainersClient.CreateOrUpdateImmutabilityPolicy.
+type BlobContainersClientCreateOrUpdateImmutabilityPolicyResponse struct {
+ // The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag.
+ ImmutabilityPolicy
+
+ // ETag contains the information returned from the ETag header response.
+ ETag *string
+}
+
+// BlobContainersClientCreateResponse contains the response from method BlobContainersClient.Create.
+type BlobContainersClientCreateResponse struct {
+ // Properties of the blob container, including Id, resource name, resource type, Etag.
+ BlobContainer
+}
+
+// BlobContainersClientDeleteImmutabilityPolicyResponse contains the response from method BlobContainersClient.DeleteImmutabilityPolicy.
+type BlobContainersClientDeleteImmutabilityPolicyResponse struct {
+ // The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag.
+ ImmutabilityPolicy
+
+ // ETag contains the information returned from the ETag header response.
+ ETag *string
+}
+
+// BlobContainersClientDeleteResponse contains the response from method BlobContainersClient.Delete.
+type BlobContainersClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// BlobContainersClientExtendImmutabilityPolicyResponse contains the response from method BlobContainersClient.ExtendImmutabilityPolicy.
+type BlobContainersClientExtendImmutabilityPolicyResponse struct {
+ // The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag.
+ ImmutabilityPolicy
+
+ // ETag contains the information returned from the ETag header response.
+ ETag *string
+}
+
+// BlobContainersClientGetImmutabilityPolicyResponse contains the response from method BlobContainersClient.GetImmutabilityPolicy.
+type BlobContainersClientGetImmutabilityPolicyResponse struct {
+ // The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag.
+ ImmutabilityPolicy
+
+ // ETag contains the information returned from the ETag header response.
+ ETag *string
+}
+
+// BlobContainersClientGetResponse contains the response from method BlobContainersClient.Get.
+type BlobContainersClientGetResponse struct {
+ // Properties of the blob container, including Id, resource name, resource type, Etag.
+ BlobContainer
+}
+
+// BlobContainersClientLeaseResponse contains the response from method BlobContainersClient.Lease.
+type BlobContainersClientLeaseResponse struct {
+ // Lease Container response schema.
+ LeaseContainerResponse
+}
+
+// BlobContainersClientListResponse contains the response from method BlobContainersClient.NewListPager.
+type BlobContainersClientListResponse struct {
+ // Response schema. Contains list of blobs returned, and if paging is requested or required, a URL to next page of containers.
+ ListContainerItems
+}
+
+// BlobContainersClientLockImmutabilityPolicyResponse contains the response from method BlobContainersClient.LockImmutabilityPolicy.
+type BlobContainersClientLockImmutabilityPolicyResponse struct {
+ // The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag.
+ ImmutabilityPolicy
+
+ // ETag contains the information returned from the ETag header response.
+ ETag *string
+}
+
+// BlobContainersClientObjectLevelWormResponse contains the response from method BlobContainersClient.BeginObjectLevelWorm.
+type BlobContainersClientObjectLevelWormResponse struct {
+ // placeholder for future response values
+}
+
+// BlobContainersClientSetLegalHoldResponse contains the response from method BlobContainersClient.SetLegalHold.
+type BlobContainersClientSetLegalHoldResponse struct {
+ // The LegalHold property of a blob container.
+ LegalHold
+}
+
+// BlobContainersClientUpdateResponse contains the response from method BlobContainersClient.Update.
+type BlobContainersClientUpdateResponse struct {
+ // Properties of the blob container, including Id, resource name, resource type, Etag.
+ BlobContainer
+}
+
+// BlobInventoryPoliciesClientCreateOrUpdateResponse contains the response from method BlobInventoryPoliciesClient.CreateOrUpdate.
+type BlobInventoryPoliciesClientCreateOrUpdateResponse struct {
+ // The storage account blob inventory policy.
+ BlobInventoryPolicy
+}
+
+// BlobInventoryPoliciesClientDeleteResponse contains the response from method BlobInventoryPoliciesClient.Delete.
+type BlobInventoryPoliciesClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// BlobInventoryPoliciesClientGetResponse contains the response from method BlobInventoryPoliciesClient.Get.
+type BlobInventoryPoliciesClientGetResponse struct {
+ // The storage account blob inventory policy.
+ BlobInventoryPolicy
+}
+
+// BlobInventoryPoliciesClientListResponse contains the response from method BlobInventoryPoliciesClient.NewListPager.
+type BlobInventoryPoliciesClientListResponse struct {
+ // List of blob inventory policies returned.
+ ListBlobInventoryPolicy
+}
+
+// BlobServicesClientGetServicePropertiesResponse contains the response from method BlobServicesClient.GetServiceProperties.
+type BlobServicesClientGetServicePropertiesResponse struct {
+ // The properties of a storage account’s Blob service.
+ BlobServiceProperties
+}
+
+// BlobServicesClientListResponse contains the response from method BlobServicesClient.NewListPager.
+type BlobServicesClientListResponse struct {
+ BlobServiceItems
+}
+
+// BlobServicesClientSetServicePropertiesResponse contains the response from method BlobServicesClient.SetServiceProperties.
+type BlobServicesClientSetServicePropertiesResponse struct {
+ // The properties of a storage account’s Blob service.
+ BlobServiceProperties
+}
+
+// DeletedAccountsClientGetResponse contains the response from method DeletedAccountsClient.Get.
+type DeletedAccountsClientGetResponse struct {
+ // Deleted storage account
+ DeletedAccount
+}
+
+// DeletedAccountsClientListResponse contains the response from method DeletedAccountsClient.NewListPager.
+type DeletedAccountsClientListResponse struct {
+ // The response from the List Deleted Accounts operation.
+ DeletedAccountListResult
+}
+
+// EncryptionScopesClientGetResponse contains the response from method EncryptionScopesClient.Get.
+type EncryptionScopesClientGetResponse struct {
+ // The Encryption Scope resource.
+ EncryptionScope
+}
+
+// EncryptionScopesClientListResponse contains the response from method EncryptionScopesClient.NewListPager.
+type EncryptionScopesClientListResponse struct {
+ // List of encryption scopes requested, and if paging is required, a URL to the next page of encryption scopes.
+ EncryptionScopeListResult
+}
+
+// EncryptionScopesClientPatchResponse contains the response from method EncryptionScopesClient.Patch.
+type EncryptionScopesClientPatchResponse struct {
+ // The Encryption Scope resource.
+ EncryptionScope
+}
+
+// EncryptionScopesClientPutResponse contains the response from method EncryptionScopesClient.Put.
+type EncryptionScopesClientPutResponse struct {
+ // The Encryption Scope resource.
+ EncryptionScope
+}
+
+// FileServicesClientGetServicePropertiesResponse contains the response from method FileServicesClient.GetServiceProperties.
+type FileServicesClientGetServicePropertiesResponse struct {
+ // The properties of File services in storage account.
+ FileServiceProperties
+}
+
+// FileServicesClientGetServiceUsageResponse contains the response from method FileServicesClient.GetServiceUsage.
+type FileServicesClientGetServiceUsageResponse struct {
+ // The usage of file service in storage account.
+ FileServiceUsage
+}
+
+// FileServicesClientListResponse contains the response from method FileServicesClient.List.
+type FileServicesClientListResponse struct {
+ FileServiceItems
+}
+
+// FileServicesClientListServiceUsagesResponse contains the response from method FileServicesClient.NewListServiceUsagesPager.
+type FileServicesClientListServiceUsagesResponse struct {
+ // List file service usages schema.
+ FileServiceUsages
+}
+
+// FileServicesClientSetServicePropertiesResponse contains the response from method FileServicesClient.SetServiceProperties.
+type FileServicesClientSetServicePropertiesResponse struct {
+ // The properties of File services in storage account.
+ FileServiceProperties
+}
+
+// FileSharesClientCreateResponse contains the response from method FileSharesClient.Create.
+type FileSharesClientCreateResponse struct {
+ // Properties of the file share, including Id, resource name, resource type, Etag.
+ FileShare
+}
+
+// FileSharesClientDeleteResponse contains the response from method FileSharesClient.Delete.
+type FileSharesClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// FileSharesClientGetResponse contains the response from method FileSharesClient.Get.
+type FileSharesClientGetResponse struct {
+ // Properties of the file share, including Id, resource name, resource type, Etag.
+ FileShare
+}
+
+// FileSharesClientLeaseResponse contains the response from method FileSharesClient.Lease.
+type FileSharesClientLeaseResponse struct {
+ // Lease Share response schema.
+ LeaseShareResponse
+
+ // ETag contains the information returned from the ETag header response.
+ ETag *string
+}
+
+// FileSharesClientListResponse contains the response from method FileSharesClient.NewListPager.
+type FileSharesClientListResponse struct {
+ // Response schema. Contains list of shares returned, and if paging is requested or required, a URL to next page of shares.
+ FileShareItems
+}
+
+// FileSharesClientRestoreResponse contains the response from method FileSharesClient.Restore.
+type FileSharesClientRestoreResponse struct {
+ // placeholder for future response values
+}
+
+// FileSharesClientUpdateResponse contains the response from method FileSharesClient.Update.
+type FileSharesClientUpdateResponse struct {
+ // Properties of the file share, including Id, resource name, resource type, Etag.
+ FileShare
+}
+
+// LocalUsersClientCreateOrUpdateResponse contains the response from method LocalUsersClient.CreateOrUpdate.
+type LocalUsersClientCreateOrUpdateResponse struct {
+ // The local user associated with the storage accounts.
+ LocalUser
+}
+
+// LocalUsersClientDeleteResponse contains the response from method LocalUsersClient.Delete.
+type LocalUsersClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// LocalUsersClientGetResponse contains the response from method LocalUsersClient.Get.
+type LocalUsersClientGetResponse struct {
+ // The local user associated with the storage accounts.
+ LocalUser
+}
+
+// LocalUsersClientListKeysResponse contains the response from method LocalUsersClient.ListKeys.
+type LocalUsersClientListKeysResponse struct {
+ // The Storage Account Local User keys.
+ LocalUserKeys
+}
+
+// LocalUsersClientListResponse contains the response from method LocalUsersClient.NewListPager.
+type LocalUsersClientListResponse struct {
+ // List of local users requested, and if paging is required, a URL to the next page of local users.
+ LocalUsers
+}
+
+// LocalUsersClientRegeneratePasswordResponse contains the response from method LocalUsersClient.RegeneratePassword.
+type LocalUsersClientRegeneratePasswordResponse struct {
+ // The secrets of Storage Account Local User.
+ LocalUserRegeneratePasswordResult
+}
+
+// ManagementPoliciesClientCreateOrUpdateResponse contains the response from method ManagementPoliciesClient.CreateOrUpdate.
+type ManagementPoliciesClientCreateOrUpdateResponse struct {
+ // The Get Storage Account ManagementPolicies operation response.
+ ManagementPolicy
+}
+
+// ManagementPoliciesClientDeleteResponse contains the response from method ManagementPoliciesClient.Delete.
+type ManagementPoliciesClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// ManagementPoliciesClientGetResponse contains the response from method ManagementPoliciesClient.Get.
+type ManagementPoliciesClientGetResponse struct {
+ // The Get Storage Account ManagementPolicies operation response.
+ ManagementPolicy
+}
+
+// NetworkSecurityPerimeterConfigurationsClientGetResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.Get.
+type NetworkSecurityPerimeterConfigurationsClientGetResponse struct {
+ // The Network Security Perimeter configuration resource.
+ NetworkSecurityPerimeterConfiguration
+}
+
+// NetworkSecurityPerimeterConfigurationsClientListResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.NewListPager.
+type NetworkSecurityPerimeterConfigurationsClientListResponse struct {
+ // Result of the List Network Security Perimeter configuration operation.
+ NetworkSecurityPerimeterConfigurationList
+}
+
+// NetworkSecurityPerimeterConfigurationsClientReconcileResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.BeginReconcile.
+type NetworkSecurityPerimeterConfigurationsClientReconcileResponse struct {
+ // placeholder for future response values
+}
+
+// ObjectReplicationPoliciesClientCreateOrUpdateResponse contains the response from method ObjectReplicationPoliciesClient.CreateOrUpdate.
+type ObjectReplicationPoliciesClientCreateOrUpdateResponse struct {
+ // The replication policy between two storage accounts. Multiple rules can be defined in one policy.
+ ObjectReplicationPolicy
+}
+
+// ObjectReplicationPoliciesClientDeleteResponse contains the response from method ObjectReplicationPoliciesClient.Delete.
+type ObjectReplicationPoliciesClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// ObjectReplicationPoliciesClientGetResponse contains the response from method ObjectReplicationPoliciesClient.Get.
+type ObjectReplicationPoliciesClientGetResponse struct {
+ // The replication policy between two storage accounts. Multiple rules can be defined in one policy.
+ ObjectReplicationPolicy
+}
+
+// ObjectReplicationPoliciesClientListResponse contains the response from method ObjectReplicationPoliciesClient.NewListPager.
+type ObjectReplicationPoliciesClientListResponse struct {
+ // List storage account object replication policies.
+ ObjectReplicationPolicies
+}
+
+// OperationsClientListResponse contains the response from method OperationsClient.NewListPager.
+type OperationsClientListResponse struct {
+ // Result of the request to list Storage operations. It contains a list of operations and a URL link to get the next set of
+ // results.
+ OperationListResult
+}
+
+// PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.Delete.
+type PrivateEndpointConnectionsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get.
+type PrivateEndpointConnectionsClientGetResponse struct {
+ // The Private Endpoint Connection resource.
+ PrivateEndpointConnection
+}
+
+// PrivateEndpointConnectionsClientListResponse contains the response from method PrivateEndpointConnectionsClient.NewListPager.
+type PrivateEndpointConnectionsClientListResponse struct {
+ // List of private endpoint connection associated with the specified storage account
+ PrivateEndpointConnectionListResult
+}
+
+// PrivateEndpointConnectionsClientPutResponse contains the response from method PrivateEndpointConnectionsClient.Put.
+type PrivateEndpointConnectionsClientPutResponse struct {
+ // The Private Endpoint Connection resource.
+ PrivateEndpointConnection
+}
+
+// PrivateLinkResourcesClientListByStorageAccountResponse contains the response from method PrivateLinkResourcesClient.ListByStorageAccount.
+type PrivateLinkResourcesClientListByStorageAccountResponse struct {
+ // A list of private link resources
+ PrivateLinkResourceListResult
+}
+
+// QueueClientCreateResponse contains the response from method QueueClient.Create.
+type QueueClientCreateResponse struct {
+ Queue
+}
+
+// QueueClientDeleteResponse contains the response from method QueueClient.Delete.
+type QueueClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// QueueClientGetResponse contains the response from method QueueClient.Get.
+type QueueClientGetResponse struct {
+ Queue
+}
+
+// QueueClientListResponse contains the response from method QueueClient.NewListPager.
+type QueueClientListResponse struct {
+ // Response schema. Contains list of queues returned
+ ListQueueResource
+}
+
+// QueueClientUpdateResponse contains the response from method QueueClient.Update.
+type QueueClientUpdateResponse struct {
+ Queue
+}
+
+// QueueServicesClientGetServicePropertiesResponse contains the response from method QueueServicesClient.GetServiceProperties.
+type QueueServicesClientGetServicePropertiesResponse struct {
+ // The properties of a storage account’s Queue service.
+ QueueServiceProperties
+}
+
+// QueueServicesClientListResponse contains the response from method QueueServicesClient.List.
+type QueueServicesClientListResponse struct {
+ ListQueueServices
+}
+
+// QueueServicesClientSetServicePropertiesResponse contains the response from method QueueServicesClient.SetServiceProperties.
+type QueueServicesClientSetServicePropertiesResponse struct {
+ // The properties of a storage account’s Queue service.
+ QueueServiceProperties
+}
+
+// SKUsClientListResponse contains the response from method SKUsClient.NewListPager.
+type SKUsClientListResponse struct {
+ // The response from the List Storage SKUs operation.
+ SKUListResult
+}
+
+// TableClientCreateResponse contains the response from method TableClient.Create.
+type TableClientCreateResponse struct {
+ // Properties of the table, including Id, resource name, resource type.
+ Table
+}
+
+// TableClientDeleteResponse contains the response from method TableClient.Delete.
+type TableClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// TableClientGetResponse contains the response from method TableClient.Get.
+type TableClientGetResponse struct {
+ // Properties of the table, including Id, resource name, resource type.
+ Table
+}
+
+// TableClientListResponse contains the response from method TableClient.NewListPager.
+type TableClientListResponse struct {
+ // Response schema. Contains list of tables returned
+ ListTableResource
+}
+
+// TableClientUpdateResponse contains the response from method TableClient.Update.
+type TableClientUpdateResponse struct {
+ // Properties of the table, including Id, resource name, resource type.
+ Table
+}
+
+// TableServicesClientGetServicePropertiesResponse contains the response from method TableServicesClient.GetServiceProperties.
+type TableServicesClientGetServicePropertiesResponse struct {
+ // The properties of a storage account’s Table service.
+ TableServiceProperties
+}
+
+// TableServicesClientListResponse contains the response from method TableServicesClient.List.
+type TableServicesClientListResponse struct {
+ ListTableServices
+}
+
+// TableServicesClientSetServicePropertiesResponse contains the response from method TableServicesClient.SetServiceProperties.
+type TableServicesClientSetServicePropertiesResponse struct {
+ // The properties of a storage account’s Table service.
+ TableServiceProperties
+}
+
+// TaskAssignmentInstancesReportClientListResponse contains the response from method TaskAssignmentInstancesReportClient.NewListPager.
+type TaskAssignmentInstancesReportClientListResponse struct {
+ // Fetch Storage Tasks Run Summary.
+ TaskReportSummary
+}
+
+// TaskAssignmentsClientCreateResponse contains the response from method TaskAssignmentsClient.BeginCreate.
+type TaskAssignmentsClientCreateResponse struct {
+ // The storage task assignment.
+ TaskAssignment
+}
+
+// TaskAssignmentsClientDeleteResponse contains the response from method TaskAssignmentsClient.BeginDelete.
+type TaskAssignmentsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// TaskAssignmentsClientGetResponse contains the response from method TaskAssignmentsClient.Get.
+type TaskAssignmentsClientGetResponse struct {
+ // The storage task assignment.
+ TaskAssignment
+}
+
+// TaskAssignmentsClientListResponse contains the response from method TaskAssignmentsClient.NewListPager.
+type TaskAssignmentsClientListResponse struct {
+ // List of storage task assignments for the storage account
+ TaskAssignmentsList
+}
+
+// TaskAssignmentsClientUpdateResponse contains the response from method TaskAssignmentsClient.BeginUpdate.
+type TaskAssignmentsClientUpdateResponse struct {
+ // The storage task assignment.
+ TaskAssignment
+}
+
+// TaskAssignmentsInstancesReportClientListResponse contains the response from method TaskAssignmentsInstancesReportClient.NewListPager.
+type TaskAssignmentsInstancesReportClientListResponse struct {
+ // Fetch Storage Tasks Run Summary.
+ TaskReportSummary
+}
+
+// UsagesClientListByLocationResponse contains the response from method UsagesClient.NewListByLocationPager.
+type UsagesClientListByLocationResponse struct {
+ // The response from the List Usages operation.
+ UsageListResult
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/skus_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/skus_client.go
new file mode 100644
index 0000000000..8c0ba7c21b
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/skus_client.go
@@ -0,0 +1,96 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// SKUsClient contains the methods for the SKUs group.
+// Don't use this type directly, use NewSKUsClient() instead.
+type SKUsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewSKUsClient creates a new instance of SKUsClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SKUsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &SKUsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// NewListPager - Lists the available SKUs supported by Microsoft.Storage for given subscription.
+//
+// Generated from API version 2025-01-01
+// - options - SKUsClientListOptions contains the optional parameters for the SKUsClient.NewListPager method.
+func (client *SKUsClient) NewListPager(options *SKUsClientListOptions) *runtime.Pager[SKUsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[SKUsClientListResponse]{
+ More: func(page SKUsClientListResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *SKUsClientListResponse) (SKUsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SKUsClient.NewListPager")
+ req, err := client.listCreateRequest(ctx, options)
+ if err != nil {
+ return SKUsClientListResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return SKUsClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return SKUsClientListResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *SKUsClient) listCreateRequest(ctx context.Context, _ *SKUsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *SKUsClient) listHandleResponse(resp *http.Response) (SKUsClientListResponse, error) {
+ result := SKUsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.SKUListResult); err != nil {
+ return SKUsClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/table_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/table_client.go
new file mode 100644
index 0000000000..af4d579b47
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/table_client.go
@@ -0,0 +1,392 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// TableClient contains the methods for the Table group.
+// Don't use this type directly, use NewTableClient() instead.
+type TableClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewTableClient creates a new instance of TableClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewTableClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TableClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &TableClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Create - Creates a new table with the specified table name, under the specified account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - tableName - A table name must be unique within a storage account and must be between 3 and 63 characters.The name must
+// comprise of only alphanumeric characters and it cannot begin with a numeric character.
+// - options - TableClientCreateOptions contains the optional parameters for the TableClient.Create method.
+func (client *TableClient) Create(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientCreateOptions) (TableClientCreateResponse, error) {
+ var err error
+ const operationName = "TableClient.Create"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, tableName, options)
+ if err != nil {
+ return TableClientCreateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TableClientCreateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return TableClientCreateResponse{}, err
+ }
+ resp, err := client.createHandleResponse(httpResp)
+ return resp, err
+}
+
+// createCreateRequest creates the Create request.
+func (client *TableClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientCreateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if tableName == "" {
+ return nil, errors.New("parameter tableName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{tableName}", url.PathEscape(tableName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.Parameters != nil {
+ if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// createHandleResponse handles the Create response.
+func (client *TableClient) createHandleResponse(resp *http.Response) (TableClientCreateResponse, error) {
+ result := TableClientCreateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Table); err != nil {
+ return TableClientCreateResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Deletes the table with the specified table name, under the specified account if it exists.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - tableName - A table name must be unique within a storage account and must be between 3 and 63 characters.The name must
+// comprise of only alphanumeric characters and it cannot begin with a numeric character.
+// - options - TableClientDeleteOptions contains the optional parameters for the TableClient.Delete method.
+func (client *TableClient) Delete(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientDeleteOptions) (TableClientDeleteResponse, error) {
+ var err error
+ const operationName = "TableClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, tableName, options)
+ if err != nil {
+ return TableClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TableClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return TableClientDeleteResponse{}, err
+ }
+ return TableClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *TableClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, _ *TableClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if tableName == "" {
+ return nil, errors.New("parameter tableName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{tableName}", url.PathEscape(tableName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Gets the table with the specified table name, under the specified account if it exists.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - tableName - A table name must be unique within a storage account and must be between 3 and 63 characters.The name must
+// comprise of only alphanumeric characters and it cannot begin with a numeric character.
+// - options - TableClientGetOptions contains the optional parameters for the TableClient.Get method.
+func (client *TableClient) Get(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientGetOptions) (TableClientGetResponse, error) {
+ var err error
+ const operationName = "TableClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, tableName, options)
+ if err != nil {
+ return TableClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TableClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return TableClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *TableClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, _ *TableClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if tableName == "" {
+ return nil, errors.New("parameter tableName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{tableName}", url.PathEscape(tableName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *TableClient) getHandleResponse(resp *http.Response) (TableClientGetResponse, error) {
+ result := TableClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Table); err != nil {
+ return TableClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Gets a list of all the tables under the specified storage account
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - TableClientListOptions contains the optional parameters for the TableClient.NewListPager method.
+func (client *TableClient) NewListPager(resourceGroupName string, accountName string, options *TableClientListOptions) *runtime.Pager[TableClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[TableClientListResponse]{
+ More: func(page TableClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *TableClientListResponse) (TableClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TableClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ }, nil)
+ if err != nil {
+ return TableClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *TableClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *TableClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *TableClient) listHandleResponse(resp *http.Response) (TableClientListResponse, error) {
+ result := TableClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ListTableResource); err != nil {
+ return TableClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// Update - Creates a new table with the specified table name, under the specified account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - tableName - A table name must be unique within a storage account and must be between 3 and 63 characters.The name must
+// comprise of only alphanumeric characters and it cannot begin with a numeric character.
+// - options - TableClientUpdateOptions contains the optional parameters for the TableClient.Update method.
+func (client *TableClient) Update(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientUpdateOptions) (TableClientUpdateResponse, error) {
+ var err error
+ const operationName = "TableClient.Update"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, tableName, options)
+ if err != nil {
+ return TableClientUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TableClientUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return TableClientUpdateResponse{}, err
+ }
+ resp, err := client.updateHandleResponse(httpResp)
+ return resp, err
+}
+
+// updateCreateRequest creates the Update request.
+func (client *TableClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if tableName == "" {
+ return nil, errors.New("parameter tableName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{tableName}", url.PathEscape(tableName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.Parameters != nil {
+ if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// updateHandleResponse handles the Update response.
+func (client *TableClient) updateHandleResponse(resp *http.Response) (TableClientUpdateResponse, error) {
+ result := TableClientUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Table); err != nil {
+ return TableClientUpdateResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/tableservices_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/tableservices_client.go
new file mode 100644
index 0000000000..706fcf517e
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/tableservices_client.go
@@ -0,0 +1,247 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// TableServicesClient contains the methods for the TableServices group.
+// Don't use this type directly, use NewTableServicesClient() instead.
+type TableServicesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewTableServicesClient creates a new instance of TableServicesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewTableServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TableServicesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &TableServicesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// GetServiceProperties - Gets the properties of a storage account’s Table service, including properties for Storage Analytics
+// and CORS (Cross-Origin Resource Sharing) rules.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - TableServicesClientGetServicePropertiesOptions contains the optional parameters for the TableServicesClient.GetServiceProperties
+// method.
+func (client *TableServicesClient) GetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, options *TableServicesClientGetServicePropertiesOptions) (TableServicesClientGetServicePropertiesResponse, error) {
+ var err error
+ const operationName = "TableServicesClient.GetServiceProperties"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getServicePropertiesCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return TableServicesClientGetServicePropertiesResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TableServicesClientGetServicePropertiesResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return TableServicesClientGetServicePropertiesResponse{}, err
+ }
+ resp, err := client.getServicePropertiesHandleResponse(httpResp)
+ return resp, err
+}
+
+// getServicePropertiesCreateRequest creates the GetServiceProperties request.
+func (client *TableServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *TableServicesClientGetServicePropertiesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ urlPath = strings.ReplaceAll(urlPath, "{tableServiceName}", url.PathEscape("default"))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getServicePropertiesHandleResponse handles the GetServiceProperties response.
+func (client *TableServicesClient) getServicePropertiesHandleResponse(resp *http.Response) (TableServicesClientGetServicePropertiesResponse, error) {
+ result := TableServicesClientGetServicePropertiesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.TableServiceProperties); err != nil {
+ return TableServicesClientGetServicePropertiesResponse{}, err
+ }
+ return result, nil
+}
+
+// List - List all table services for the storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - TableServicesClientListOptions contains the optional parameters for the TableServicesClient.List method.
+func (client *TableServicesClient) List(ctx context.Context, resourceGroupName string, accountName string, options *TableServicesClientListOptions) (TableServicesClientListResponse, error) {
+ var err error
+ const operationName = "TableServicesClient.List"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return TableServicesClientListResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TableServicesClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return TableServicesClientListResponse{}, err
+ }
+ resp, err := client.listHandleResponse(httpResp)
+ return resp, err
+}
+
+// listCreateRequest creates the List request.
+func (client *TableServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *TableServicesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *TableServicesClient) listHandleResponse(resp *http.Response) (TableServicesClientListResponse, error) {
+ result := TableServicesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ListTableServices); err != nil {
+ return TableServicesClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// SetServiceProperties - Sets the properties of a storage account’s Table service, including properties for Storage Analytics
+// and CORS (Cross-Origin Resource Sharing) rules.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The properties of a storage account’s Table service, only properties for Storage Analytics and CORS (Cross-Origin
+// Resource Sharing) rules can be specified.
+// - options - TableServicesClientSetServicePropertiesOptions contains the optional parameters for the TableServicesClient.SetServiceProperties
+// method.
+func (client *TableServicesClient) SetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, parameters TableServiceProperties, options *TableServicesClientSetServicePropertiesOptions) (TableServicesClientSetServicePropertiesResponse, error) {
+ var err error
+ const operationName = "TableServicesClient.SetServiceProperties"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.setServicePropertiesCreateRequest(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return TableServicesClientSetServicePropertiesResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TableServicesClientSetServicePropertiesResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return TableServicesClientSetServicePropertiesResponse{}, err
+ }
+ resp, err := client.setServicePropertiesHandleResponse(httpResp)
+ return resp, err
+}
+
+// setServicePropertiesCreateRequest creates the SetServiceProperties request.
+func (client *TableServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters TableServiceProperties, _ *TableServicesClientSetServicePropertiesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ urlPath = strings.ReplaceAll(urlPath, "{tableServiceName}", url.PathEscape("default"))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// setServicePropertiesHandleResponse handles the SetServiceProperties response.
+func (client *TableServicesClient) setServicePropertiesHandleResponse(resp *http.Response) (TableServicesClientSetServicePropertiesResponse, error) {
+ result := TableServicesClientSetServicePropertiesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.TableServiceProperties); err != nil {
+ return TableServicesClientSetServicePropertiesResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/taskassignmentinstancesreport_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/taskassignmentinstancesreport_client.go
new file mode 100644
index 0000000000..9f0836bc71
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/taskassignmentinstancesreport_client.go
@@ -0,0 +1,120 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// TaskAssignmentInstancesReportClient contains the methods for the StorageTaskAssignmentInstancesReport group.
+// Don't use this type directly, use NewTaskAssignmentInstancesReportClient() instead.
+type TaskAssignmentInstancesReportClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewTaskAssignmentInstancesReportClient creates a new instance of TaskAssignmentInstancesReportClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewTaskAssignmentInstancesReportClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TaskAssignmentInstancesReportClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &TaskAssignmentInstancesReportClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// NewListPager - Fetch the report summary of a single storage task assignment's instances
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - storageTaskAssignmentName - The name of the storage task assignment within the specified resource group. Storage task assignment
+// names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - TaskAssignmentInstancesReportClientListOptions contains the optional parameters for the TaskAssignmentInstancesReportClient.NewListPager
+// method.
+func (client *TaskAssignmentInstancesReportClient) NewListPager(resourceGroupName string, accountName string, storageTaskAssignmentName string, options *TaskAssignmentInstancesReportClientListOptions) *runtime.Pager[TaskAssignmentInstancesReportClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[TaskAssignmentInstancesReportClientListResponse]{
+ More: func(page TaskAssignmentInstancesReportClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *TaskAssignmentInstancesReportClientListResponse) (TaskAssignmentInstancesReportClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TaskAssignmentInstancesReportClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, accountName, storageTaskAssignmentName, options)
+ }, nil)
+ if err != nil {
+ return TaskAssignmentInstancesReportClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *TaskAssignmentInstancesReportClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, options *TaskAssignmentInstancesReportClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}/reports"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if storageTaskAssignmentName == "" {
+ return nil, errors.New("parameter storageTaskAssignmentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{storageTaskAssignmentName}", url.PathEscape(storageTaskAssignmentName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Maxpagesize != nil {
+ reqQP.Set("$maxpagesize", strconv.FormatInt(int64(*options.Maxpagesize), 10))
+ }
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *TaskAssignmentInstancesReportClient) listHandleResponse(resp *http.Response) (TaskAssignmentInstancesReportClientListResponse, error) {
+ result := TaskAssignmentInstancesReportClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.TaskReportSummary); err != nil {
+ return TaskAssignmentInstancesReportClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/taskassignments_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/taskassignments_client.go
new file mode 100644
index 0000000000..38883628c8
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/taskassignments_client.go
@@ -0,0 +1,450 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// TaskAssignmentsClient contains the methods for the StorageTaskAssignments group.
+// Don't use this type directly, use NewTaskAssignmentsClient() instead.
+type TaskAssignmentsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewTaskAssignmentsClient creates a new instance of TaskAssignmentsClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewTaskAssignmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TaskAssignmentsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &TaskAssignmentsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreate - Asynchronously creates a new storage task assignment sub-resource with the specified parameters. If a storage
+// task assignment is already created and a subsequent create request is issued with
+// different properties, the storage task assignment properties will be updated. If a storage task assignment is already created
+// and a subsequent create or update request is issued with the exact same
+// set of properties, the request will succeed.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - storageTaskAssignmentName - The name of the storage task assignment within the specified resource group. Storage task assignment
+// names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The parameters to create a Storage Task Assignment.
+// - options - TaskAssignmentsClientBeginCreateOptions contains the optional parameters for the TaskAssignmentsClient.BeginCreate
+// method.
+func (client *TaskAssignmentsClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, parameters TaskAssignment, options *TaskAssignmentsClientBeginCreateOptions) (*runtime.Poller[TaskAssignmentsClientCreateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.create(ctx, resourceGroupName, accountName, storageTaskAssignmentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TaskAssignmentsClientCreateResponse]{
+ FinalStateVia: runtime.FinalStateViaAzureAsyncOp,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[TaskAssignmentsClientCreateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Create - Asynchronously creates a new storage task assignment sub-resource with the specified parameters. If a storage
+// task assignment is already created and a subsequent create request is issued with
+// different properties, the storage task assignment properties will be updated. If a storage task assignment is already created
+// and a subsequent create or update request is issued with the exact same
+// set of properties, the request will succeed.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+func (client *TaskAssignmentsClient) create(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, parameters TaskAssignment, options *TaskAssignmentsClientBeginCreateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "TaskAssignmentsClient.BeginCreate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, storageTaskAssignmentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createCreateRequest creates the Create request.
+func (client *TaskAssignmentsClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, parameters TaskAssignment, _ *TaskAssignmentsClientBeginCreateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if storageTaskAssignmentName == "" {
+ return nil, errors.New("parameter storageTaskAssignmentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{storageTaskAssignmentName}", url.PathEscape(storageTaskAssignmentName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - Delete the storage task assignment sub-resource
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - storageTaskAssignmentName - The name of the storage task assignment within the specified resource group. Storage task assignment
+// names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - TaskAssignmentsClientBeginDeleteOptions contains the optional parameters for the TaskAssignmentsClient.BeginDelete
+// method.
+func (client *TaskAssignmentsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, options *TaskAssignmentsClientBeginDeleteOptions) (*runtime.Poller[TaskAssignmentsClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, storageTaskAssignmentName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TaskAssignmentsClientDeleteResponse]{
+ FinalStateVia: runtime.FinalStateViaAzureAsyncOp,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[TaskAssignmentsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Delete the storage task assignment sub-resource
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+func (client *TaskAssignmentsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, options *TaskAssignmentsClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "TaskAssignmentsClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, storageTaskAssignmentName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *TaskAssignmentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, _ *TaskAssignmentsClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if storageTaskAssignmentName == "" {
+ return nil, errors.New("parameter storageTaskAssignmentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{storageTaskAssignmentName}", url.PathEscape(storageTaskAssignmentName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Get the storage task assignment properties
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - storageTaskAssignmentName - The name of the storage task assignment within the specified resource group. Storage task assignment
+// names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - TaskAssignmentsClientGetOptions contains the optional parameters for the TaskAssignmentsClient.Get method.
+func (client *TaskAssignmentsClient) Get(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, options *TaskAssignmentsClientGetOptions) (TaskAssignmentsClientGetResponse, error) {
+ var err error
+ const operationName = "TaskAssignmentsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, storageTaskAssignmentName, options)
+ if err != nil {
+ return TaskAssignmentsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TaskAssignmentsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return TaskAssignmentsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *TaskAssignmentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, _ *TaskAssignmentsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if storageTaskAssignmentName == "" {
+ return nil, errors.New("parameter storageTaskAssignmentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{storageTaskAssignmentName}", url.PathEscape(storageTaskAssignmentName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *TaskAssignmentsClient) getHandleResponse(resp *http.Response) (TaskAssignmentsClientGetResponse, error) {
+ result := TaskAssignmentsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.TaskAssignment); err != nil {
+ return TaskAssignmentsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - List all the storage task assignments in an account
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - TaskAssignmentsClientListOptions contains the optional parameters for the TaskAssignmentsClient.NewListPager
+// method.
+func (client *TaskAssignmentsClient) NewListPager(resourceGroupName string, accountName string, options *TaskAssignmentsClientListOptions) *runtime.Pager[TaskAssignmentsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[TaskAssignmentsClientListResponse]{
+ More: func(page TaskAssignmentsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *TaskAssignmentsClientListResponse) (TaskAssignmentsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TaskAssignmentsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ }, nil)
+ if err != nil {
+ return TaskAssignmentsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *TaskAssignmentsClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *TaskAssignmentsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Maxpagesize != nil {
+ reqQP.Set("$maxpagesize", strconv.FormatInt(int64(*options.Maxpagesize), 10))
+ }
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *TaskAssignmentsClient) listHandleResponse(resp *http.Response) (TaskAssignmentsClientListResponse, error) {
+ result := TaskAssignmentsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.TaskAssignmentsList); err != nil {
+ return TaskAssignmentsClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginUpdate - Update storage task assignment properties
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - storageTaskAssignmentName - The name of the storage task assignment within the specified resource group. Storage task assignment
+// names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The parameters to update a Storage Task Assignment.
+// - options - TaskAssignmentsClientBeginUpdateOptions contains the optional parameters for the TaskAssignmentsClient.BeginUpdate
+// method.
+func (client *TaskAssignmentsClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, parameters TaskAssignmentUpdateParameters, options *TaskAssignmentsClientBeginUpdateOptions) (*runtime.Poller[TaskAssignmentsClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, accountName, storageTaskAssignmentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TaskAssignmentsClientUpdateResponse]{
+ FinalStateVia: runtime.FinalStateViaAzureAsyncOp,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[TaskAssignmentsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Update storage task assignment properties
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2025-01-01
+func (client *TaskAssignmentsClient) update(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, parameters TaskAssignmentUpdateParameters, options *TaskAssignmentsClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "TaskAssignmentsClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, storageTaskAssignmentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *TaskAssignmentsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, parameters TaskAssignmentUpdateParameters, _ *TaskAssignmentsClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if storageTaskAssignmentName == "" {
+ return nil, errors.New("parameter storageTaskAssignmentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{storageTaskAssignmentName}", url.PathEscape(storageTaskAssignmentName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/taskassignmentsinstancesreport_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/taskassignmentsinstancesreport_client.go
new file mode 100644
index 0000000000..ac1453ffa7
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/taskassignmentsinstancesreport_client.go
@@ -0,0 +1,114 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// TaskAssignmentsInstancesReportClient contains the methods for the StorageTaskAssignmentsInstancesReport group.
+// Don't use this type directly, use NewTaskAssignmentsInstancesReportClient() instead.
+type TaskAssignmentsInstancesReportClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewTaskAssignmentsInstancesReportClient creates a new instance of TaskAssignmentsInstancesReportClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewTaskAssignmentsInstancesReportClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TaskAssignmentsInstancesReportClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &TaskAssignmentsInstancesReportClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// NewListPager - Fetch the report summary of all the storage task assignments and instances in an account
+//
+// Generated from API version 2025-01-01
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - TaskAssignmentsInstancesReportClientListOptions contains the optional parameters for the TaskAssignmentsInstancesReportClient.NewListPager
+// method.
+func (client *TaskAssignmentsInstancesReportClient) NewListPager(resourceGroupName string, accountName string, options *TaskAssignmentsInstancesReportClientListOptions) *runtime.Pager[TaskAssignmentsInstancesReportClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[TaskAssignmentsInstancesReportClientListResponse]{
+ More: func(page TaskAssignmentsInstancesReportClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *TaskAssignmentsInstancesReportClientListResponse) (TaskAssignmentsInstancesReportClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TaskAssignmentsInstancesReportClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ }, nil)
+ if err != nil {
+ return TaskAssignmentsInstancesReportClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *TaskAssignmentsInstancesReportClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *TaskAssignmentsInstancesReportClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/reports"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Maxpagesize != nil {
+ reqQP.Set("$maxpagesize", strconv.FormatInt(int64(*options.Maxpagesize), 10))
+ }
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *TaskAssignmentsInstancesReportClient) listHandleResponse(resp *http.Response) (TaskAssignmentsInstancesReportClientListResponse, error) {
+ result := TaskAssignmentsInstancesReportClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.TaskReportSummary); err != nil {
+ return TaskAssignmentsInstancesReportClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/time_rfc1123.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/time_rfc1123.go
new file mode 100644
index 0000000000..dad32f06c5
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/time_rfc1123.go
@@ -0,0 +1,74 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "encoding/json"
+ "fmt"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "reflect"
+ "strings"
+ "time"
+)
+
+const (
+ dateTimeRFC1123JSON = `"` + time.RFC1123 + `"`
+)
+
+type dateTimeRFC1123 time.Time
+
+func (t dateTimeRFC1123) MarshalJSON() ([]byte, error) {
+ b := []byte(time.Time(t).Format(dateTimeRFC1123JSON))
+ return b, nil
+}
+
+func (t dateTimeRFC1123) MarshalText() ([]byte, error) {
+ b := []byte(time.Time(t).Format(time.RFC1123))
+ return b, nil
+}
+
+func (t *dateTimeRFC1123) UnmarshalJSON(data []byte) error {
+ p, err := time.Parse(dateTimeRFC1123JSON, strings.ToUpper(string(data)))
+ *t = dateTimeRFC1123(p)
+ return err
+}
+
+func (t *dateTimeRFC1123) UnmarshalText(data []byte) error {
+ if len(data) == 0 {
+ return nil
+ }
+ p, err := time.Parse(time.RFC1123, string(data))
+ *t = dateTimeRFC1123(p)
+ return err
+}
+
+func (t dateTimeRFC1123) String() string {
+ return time.Time(t).Format(time.RFC1123)
+}
+
+func populateDateTimeRFC1123(m map[string]any, k string, t *time.Time) {
+ if t == nil {
+ return
+ } else if azcore.IsNullValue(t) {
+ m[k] = nil
+ return
+ } else if reflect.ValueOf(t).IsNil() {
+ return
+ }
+ m[k] = (*dateTimeRFC1123)(t)
+}
+
+func unpopulateDateTimeRFC1123(data json.RawMessage, fn string, t **time.Time) error {
+ if data == nil || string(data) == "null" {
+ return nil
+ }
+ var aux dateTimeRFC1123
+ if err := json.Unmarshal(data, &aux); err != nil {
+ return fmt.Errorf("struct field %s: %v", fn, err)
+ }
+ *t = (*time.Time)(&aux)
+ return nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/time_rfc3339.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/time_rfc3339.go
new file mode 100644
index 0000000000..f13e107256
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/time_rfc3339.go
@@ -0,0 +1,110 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "encoding/json"
+ "fmt"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "reflect"
+ "regexp"
+ "strings"
+ "time"
+)
+
+// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases.
+var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`)
+
+const (
+ utcDateTime = "2006-01-02T15:04:05.999999999"
+ utcDateTimeJSON = `"` + utcDateTime + `"`
+ utcDateTimeNoT = "2006-01-02 15:04:05.999999999"
+ utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"`
+ dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00`
+ dateTimeJSON = `"` + time.RFC3339Nano + `"`
+ dateTimeJSONNoT = `"` + dateTimeNoT + `"`
+)
+
+type dateTimeRFC3339 time.Time
+
+func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) {
+ tt := time.Time(t)
+ return tt.MarshalJSON()
+}
+
+func (t dateTimeRFC3339) MarshalText() ([]byte, error) {
+ tt := time.Time(t)
+ return tt.MarshalText()
+}
+
+func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error {
+ tzOffset := tzOffsetRegex.Match(data)
+ hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t")
+ var layout string
+ if tzOffset && hasT {
+ layout = dateTimeJSON
+ } else if tzOffset {
+ layout = dateTimeJSONNoT
+ } else if hasT {
+ layout = utcDateTimeJSON
+ } else {
+ layout = utcDateTimeJSONNoT
+ }
+ return t.Parse(layout, string(data))
+}
+
+func (t *dateTimeRFC3339) UnmarshalText(data []byte) error {
+ if len(data) == 0 {
+ return nil
+ }
+ tzOffset := tzOffsetRegex.Match(data)
+ hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t")
+ var layout string
+ if tzOffset && hasT {
+ layout = time.RFC3339Nano
+ } else if tzOffset {
+ layout = dateTimeNoT
+ } else if hasT {
+ layout = utcDateTime
+ } else {
+ layout = utcDateTimeNoT
+ }
+ return t.Parse(layout, string(data))
+}
+
+func (t *dateTimeRFC3339) Parse(layout, value string) error {
+ p, err := time.Parse(layout, strings.ToUpper(value))
+ *t = dateTimeRFC3339(p)
+ return err
+}
+
+func (t dateTimeRFC3339) String() string {
+ return time.Time(t).Format(time.RFC3339Nano)
+}
+
+func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) {
+ if t == nil {
+ return
+ } else if azcore.IsNullValue(t) {
+ m[k] = nil
+ return
+ } else if reflect.ValueOf(t).IsNil() {
+ return
+ }
+ m[k] = (*dateTimeRFC3339)(t)
+}
+
+func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error {
+ if data == nil || string(data) == "null" {
+ return nil
+ }
+ var aux dateTimeRFC3339
+ if err := json.Unmarshal(data, &aux); err != nil {
+ return fmt.Errorf("struct field %s: %v", fn, err)
+ }
+ *t = (*time.Time)(&aux)
+ return nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/usages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/usages_client.go
new file mode 100644
index 0000000000..155622b0cf
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/usages_client.go
@@ -0,0 +1,102 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// UsagesClient contains the methods for the Usages group.
+// Don't use this type directly, use NewUsagesClient() instead.
+type UsagesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewUsagesClient creates a new instance of UsagesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsagesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &UsagesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// NewListByLocationPager - Gets the current usage count and the limit for the resources of the location under the subscription.
+//
+// Generated from API version 2025-01-01
+// - location - The location of the Azure Storage resource.
+// - options - UsagesClientListByLocationOptions contains the optional parameters for the UsagesClient.NewListByLocationPager
+// method.
+func (client *UsagesClient) NewListByLocationPager(location string, options *UsagesClientListByLocationOptions) *runtime.Pager[UsagesClientListByLocationResponse] {
+ return runtime.NewPager(runtime.PagingHandler[UsagesClientListByLocationResponse]{
+ More: func(page UsagesClientListByLocationResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *UsagesClientListByLocationResponse) (UsagesClientListByLocationResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "UsagesClient.NewListByLocationPager")
+ req, err := client.listByLocationCreateRequest(ctx, location, options)
+ if err != nil {
+ return UsagesClientListByLocationResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return UsagesClientListByLocationResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return UsagesClientListByLocationResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listByLocationHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByLocationCreateRequest creates the ListByLocation request.
+func (client *UsagesClient) listByLocationCreateRequest(ctx context.Context, location string, _ *UsagesClientListByLocationOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2025-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByLocationHandleResponse handles the ListByLocation response.
+func (client *UsagesClient) listByLocationHandleResponse(resp *http.Response) (UsagesClientListByLocationResponse, error) {
+ result := UsagesClientListByLocationResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.UsageListResult); err != nil {
+ return UsagesClientListByLocationResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/version.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/version.go
new file mode 100644
index 0000000000..560980b423
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2/version.go
@@ -0,0 +1,10 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package armstorage
+
+const (
+ moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ moduleVersion = "v2.0.0"
+)
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go
index 549d68ab99..29c004320d 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go
@@ -596,6 +596,11 @@ func (cca Client) AcquireTokenSilent(ctx context.Context, scopes []string, opts
return AuthResult{}, errors.New("call another AcquireToken method to request a new token having these claims")
}
+ // For service principal scenarios, require WithSilentAccount for public API
+ if o.account.IsZero() {
+ return AuthResult{}, errors.New("WithSilentAccount option is required")
+ }
+
silentParameters := base.AcquireTokenSilentParameters{
Scopes: scopes,
Account: o.account,
@@ -604,8 +609,15 @@ func (cca Client) AcquireTokenSilent(ctx context.Context, scopes []string, opts
IsAppCache: o.account.IsZero(),
TenantID: o.tenantID,
AuthnScheme: o.authnScheme,
+ Claims: o.claims,
}
+ return cca.acquireTokenSilentInternal(ctx, silentParameters)
+}
+
+// acquireTokenSilentInternal is the internal implementation shared by AcquireTokenSilent and AcquireTokenByCredential
+func (cca Client) acquireTokenSilentInternal(ctx context.Context, silentParameters base.AcquireTokenSilentParameters) (AuthResult, error) {
+
return cca.base.AcquireTokenSilent(ctx, silentParameters)
}
@@ -708,8 +720,10 @@ func (cca Client) AcquireTokenByAuthCode(ctx context.Context, code string, redir
// acquireTokenByCredentialOptions contains optional configuration for AcquireTokenByCredential
type acquireTokenByCredentialOptions struct {
- claims, tenantID string
- authnScheme AuthenticationScheme
+ claims, tenantID string
+ authnScheme AuthenticationScheme
+ extraBodyParameters map[string]string
+ cacheKeyComponents map[string]string
}
// AcquireByCredentialOption is implemented by options for AcquireTokenByCredential
@@ -719,7 +733,7 @@ type AcquireByCredentialOption interface {
// AcquireTokenByCredential acquires a security token from the authority, using the client credentials grant.
//
-// Options: [WithClaims], [WithTenantID]
+// Options: [WithClaims], [WithTenantID], [WithFMIPath], [WithAttribute]
func (cca Client) AcquireTokenByCredential(ctx context.Context, scopes []string, opts ...AcquireByCredentialOption) (AuthResult, error) {
o := acquireTokenByCredentialOptions{}
err := options.ApplyOptions(&o, opts)
@@ -736,6 +750,29 @@ func (cca Client) AcquireTokenByCredential(ctx context.Context, scopes []string,
if o.authnScheme != nil {
authParams.AuthnScheme = o.authnScheme
}
+ authParams.ExtraBodyParameters = o.extraBodyParameters
+ authParams.CacheKeyComponents = o.cacheKeyComponents
+ if o.claims == "" {
+ silentParameters := base.AcquireTokenSilentParameters{
+ Scopes: scopes,
+ Account: Account{}, // empty account for app token
+ RequestType: accesstokens.ATConfidential,
+ Credential: cca.cred,
+ IsAppCache: true,
+ TenantID: o.tenantID,
+ AuthnScheme: o.authnScheme,
+ Claims: o.claims,
+ ExtraBodyParameters: o.extraBodyParameters,
+ CacheKeyComponents: o.cacheKeyComponents,
+ }
+
+ // Use internal method with empty account (service principal scenario)
+ cache, err := cca.acquireTokenSilentInternal(ctx, silentParameters)
+ if err == nil {
+ return cache, nil
+ }
+ }
+
token, err := cca.base.Token.Credential(ctx, authParams, cca.cred)
if err != nil {
return AuthResult{}, err
@@ -781,3 +818,63 @@ func (cca Client) Account(ctx context.Context, accountID string) (Account, error
func (cca Client) RemoveAccount(ctx context.Context, account Account) error {
return cca.base.RemoveAccount(ctx, account)
}
+
+// WithFMIPath specifies the path to a federated managed identity.
+// The path should point to a valid FMI configuration file that contains the necessary
+// identity information for authentication.
+func WithFMIPath(path string) interface {
+ AcquireByCredentialOption
+ options.CallOption
+} {
+ return struct {
+ AcquireByCredentialOption
+ options.CallOption
+ }{
+ CallOption: options.NewCallOption(
+ func(a any) error {
+ switch t := a.(type) {
+ case *acquireTokenByCredentialOptions:
+ if t.extraBodyParameters == nil {
+ t.extraBodyParameters = make(map[string]string)
+ }
+ if t.cacheKeyComponents == nil {
+ t.cacheKeyComponents = make(map[string]string)
+ }
+ t.cacheKeyComponents["fmi_path"] = path
+ t.extraBodyParameters["fmi_path"] = path
+ default:
+ return fmt.Errorf("unexpected options type %T", a)
+ }
+ return nil
+ },
+ ),
+ }
+}
+
+// WithAttribute specifies an identity attribute to include in the token request.
+// The attribute is sent as "attributes" in the request body and returned as "xmc_attr"
+// in the access token claims. This is sometimes used withFMIPath
+func WithAttribute(attrValue string) interface {
+ AcquireByCredentialOption
+ options.CallOption
+} {
+ return struct {
+ AcquireByCredentialOption
+ options.CallOption
+ }{
+ CallOption: options.NewCallOption(
+ func(a any) error {
+ switch t := a.(type) {
+ case *acquireTokenByCredentialOptions:
+ if t.extraBodyParameters == nil {
+ t.extraBodyParameters = make(map[string]string)
+ }
+ t.extraBodyParameters["attributes"] = attrValue
+ default:
+ return fmt.Errorf("unexpected options type %T", a)
+ }
+ return nil
+ },
+ ),
+ }
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/base.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/base.go
index 61c1c4cec1..abf54f7e50 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/base.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/base.go
@@ -46,16 +46,18 @@ type accountManager interface {
// AcquireTokenSilentParameters contains the parameters to acquire a token silently (from cache).
type AcquireTokenSilentParameters struct {
- Scopes []string
- Account shared.Account
- RequestType accesstokens.AppType
- Credential *accesstokens.Credential
- IsAppCache bool
- TenantID string
- UserAssertion string
- AuthorizationType authority.AuthorizeType
- Claims string
- AuthnScheme authority.AuthenticationScheme
+ Scopes []string
+ Account shared.Account
+ RequestType accesstokens.AppType
+ Credential *accesstokens.Credential
+ IsAppCache bool
+ TenantID string
+ UserAssertion string
+ AuthorizationType authority.AuthorizeType
+ Claims string
+ AuthnScheme authority.AuthenticationScheme
+ ExtraBodyParameters map[string]string
+ CacheKeyComponents map[string]string
}
// AcquireTokenAuthCodeParameters contains the parameters required to acquire an access token using the auth code flow.
@@ -327,7 +329,12 @@ func (b Client) AcquireTokenSilent(ctx context.Context, silent AcquireTokenSilen
if silent.AuthnScheme != nil {
authParams.AuthnScheme = silent.AuthnScheme
}
-
+ if silent.CacheKeyComponents != nil {
+ authParams.CacheKeyComponents = silent.CacheKeyComponents
+ }
+ if silent.ExtraBodyParameters != nil {
+ authParams.ExtraBodyParameters = silent.ExtraBodyParameters
+ }
m := b.pmanager
if authParams.AuthorizationType != authority.ATOnBehalfOf {
authParams.AuthorizationType = authority.ATRefreshToken
@@ -367,8 +374,19 @@ func (b Client) AcquireTokenSilent(ctx context.Context, silent AcquireTokenSilen
// If the token is not same, we don't need to refresh it.
// Which means it refreshed.
if str, err := m.Read(ctx, authParams); err == nil && str.AccessToken.Secret == ar.AccessToken {
- if tr, er := b.Token.Credential(ctx, authParams, silent.Credential); er == nil {
- return b.AuthResultFromToken(ctx, authParams, tr)
+ switch silent.RequestType {
+ case accesstokens.ATConfidential:
+ if tr, er := b.Token.Credential(ctx, authParams, silent.Credential); er == nil {
+ return b.AuthResultFromToken(ctx, authParams, tr)
+ }
+ case accesstokens.ATPublic:
+ token, err := b.Token.Refresh(ctx, silent.RequestType, authParams, silent.Credential, storageTokenResponse.RefreshToken)
+ if err != nil {
+ return ar, err
+ }
+ return b.AuthResultFromToken(ctx, authParams, token)
+ case accesstokens.ATUnknown:
+ return ar, errors.New("silent request type cannot be ATUnknown")
}
}
}
@@ -446,6 +464,9 @@ func (b Client) AcquireTokenOnBehalfOf(ctx context.Context, onBehalfOfParams Acq
authParams.Claims = onBehalfOfParams.Claims
authParams.Scopes = onBehalfOfParams.Scopes
authParams.UserAssertion = onBehalfOfParams.UserAssertion
+ if authParams.ExtraBodyParameters != nil {
+ authParams.ExtraBodyParameters = silentParameters.ExtraBodyParameters
+ }
token, err := b.Token.OnBehalfOf(ctx, authParams, onBehalfOfParams.Credential)
if err == nil {
ar, err = b.AuthResultFromToken(ctx, authParams, token)
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/items.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/items.go
index 7379e2233c..b7d1a670b1 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/items.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/items.go
@@ -79,6 +79,7 @@ type AccessToken struct {
UserAssertionHash string `json:"user_assertion_hash,omitempty"`
TokenType string `json:"token_type,omitempty"`
AuthnSchemeKeyID string `json:"keyid,omitempty"`
+ ExtCacheKey string `json:"ext_cache_key,omitempty"`
AdditionalFields map[string]interface{}
}
@@ -105,15 +106,21 @@ func NewAccessToken(homeID, env, realm, clientID string, cachedAt, refreshOn, ex
// Key outputs the key that can be used to uniquely look up this entry in a map.
func (a AccessToken) Key() string {
ks := []string{a.HomeAccountID, a.Environment, a.CredentialType, a.ClientID, a.Realm, a.Scopes}
- key := strings.Join(
- ks,
- shared.CacheKeySeparator,
- )
+
// add token type to key for new access tokens types. skip for bearer token type to
// preserve fwd and back compat between a common cache and msal clients
if !strings.EqualFold(a.TokenType, authority.AccessTokenTypeBearer) {
- key = strings.Join([]string{key, a.TokenType}, shared.CacheKeySeparator)
+ ks = append(ks, a.TokenType)
}
+ // add extra body param hash to key if present
+ if a.ExtCacheKey != "" {
+ ks[2] = "atext" // if the there is extra cache we add "atext" to the key replacing accesstoken
+ ks = append(ks, a.ExtCacheKey)
+ }
+ key := strings.Join(
+ ks,
+ shared.CacheKeySeparator,
+ )
return strings.ToLower(key)
}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/storage.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/storage.go
index 84a234967f..825d8a0f66 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/storage.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/storage.go
@@ -135,7 +135,8 @@ func (m *Manager) Read(ctx context.Context, authParameters authority.AuthParams)
aliases = metadata.Aliases
}
- accessToken := m.readAccessToken(homeAccountID, aliases, realm, clientID, scopes, tokenType, authnSchemeKeyID)
+ accessToken := m.readAccessToken(homeAccountID, aliases, realm, clientID, scopes, tokenType, authnSchemeKeyID, authParameters.CacheExtKeyGenerator())
+
tr.AccessToken = accessToken
if homeAccountID == "" {
@@ -203,6 +204,7 @@ func (m *Manager) Write(authParameters authority.AuthParams, tokenResponse acces
authnSchemeKeyID,
)
+ accessToken.ExtCacheKey = authParameters.CacheExtKeyGenerator()
// Since we have a valid access token, cache it before moving on.
if err := accessToken.Validate(); err == nil {
if err := m.writeAccessToken(accessToken); err != nil {
@@ -291,26 +293,49 @@ func (m *Manager) aadMetadata(ctx context.Context, authorityInfo authority.Info)
return m.aadCache[authorityInfo.Host], nil
}
-func (m *Manager) readAccessToken(homeID string, envAliases []string, realm, clientID string, scopes []string, tokenType, authnSchemeKeyID string) AccessToken {
+func (m *Manager) readAccessToken(homeID string, envAliases []string, realm, clientID string, scopes []string, tokenType, authnSchemeKeyID, extCacheKey string) AccessToken {
m.contractMu.RLock()
- // TODO: linear search (over a map no less) is slow for a large number (thousands) of tokens.
- // this shows up as the dominating node in a profile. for real-world scenarios this likely isn't
- // an issue, however if it does become a problem then we know where to look.
- for k, at := range m.contract.AccessTokens {
+
+ tokensToSearch := m.contract.AccessTokens
+
+ for k, at := range tokensToSearch {
+ // TODO: linear search (over a map no less) is slow for a large number (thousands) of tokens.
+ // this shows up as the dominating node in a profile. for real-world scenarios this likely isn't
+ // an issue, however if it does become a problem then we know where to look.
if at.HomeAccountID == homeID && at.Realm == realm && at.ClientID == clientID {
- if (strings.EqualFold(at.TokenType, tokenType) && at.AuthnSchemeKeyID == authnSchemeKeyID) || (at.TokenType == "" && (tokenType == "" || tokenType == "Bearer")) {
- if checkAlias(at.Environment, envAliases) && isMatchingScopes(scopes, at.Scopes) {
- m.contractMu.RUnlock()
- if needsUpgrade(k) {
- m.contractMu.Lock()
- defer m.contractMu.Unlock()
- at = upgrade(m.contract.AccessTokens, k)
+ // Match token type and authentication scheme
+ tokenTypeMatch := (strings.EqualFold(at.TokenType, tokenType) && at.AuthnSchemeKeyID == authnSchemeKeyID) ||
+ (at.TokenType == "" && (tokenType == "" || tokenType == "Bearer"))
+ environmentAndScopesMatch := checkAlias(at.Environment, envAliases) && isMatchingScopes(scopes, at.Scopes)
+
+ if tokenTypeMatch && environmentAndScopesMatch {
+ // For hashed tokens, check that the key contains the hash
+ if extCacheKey != "" {
+ if !strings.Contains(k, extCacheKey) {
+ continue // Skip this token if the key doesn't contain the hash
+ }
+ } else {
+ // If no extCacheKey is provided, only match tokens that also have no extCacheKey
+ if at.ExtCacheKey != "" {
+ continue // Skip tokens that require a hash when no hash is provided
}
+ }
+ // Handle token upgrade if needed
+ if needsUpgrade(k) {
+ m.contractMu.RUnlock()
+ m.contractMu.Lock()
+ at = upgrade(tokensToSearch, k)
+ m.contractMu.Unlock()
return at
}
+
+ m.contractMu.RUnlock()
+ return at
}
}
}
+
+ // No token found, unlock and return empty token
m.contractMu.RUnlock()
return AccessToken{}
}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local/server.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local/server.go
index cda678e334..c6baf20947 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local/server.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local/server.go
@@ -143,9 +143,10 @@ func (s *Server) handler(w http.ResponseWriter, r *http.Request) {
headerErr := q.Get("error")
if headerErr != "" {
desc := html.EscapeString(q.Get("error_description"))
+ escapedHeaderErr := html.EscapeString(headerErr)
// Note: It is a little weird we handle some errors by not going to the failPage. If they all should,
// change this to s.error() and make s.error() write the failPage instead of an error code.
- _, _ = w.Write([]byte(fmt.Sprintf(failPage, headerErr, desc)))
+ _, _ = w.Write([]byte(fmt.Sprintf(failPage, escapedHeaderErr, desc)))
s.putResult(Result{Err: fmt.Errorf("%s", desc)})
return
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/accesstokens.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/accesstokens.go
index d738c7591e..481f9e4341 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/accesstokens.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/accesstokens.go
@@ -281,6 +281,9 @@ func (c Client) FromClientSecret(ctx context.Context, authParameters authority.A
qv.Set(clientID, authParameters.ClientID)
addScopeQueryParam(qv, authParameters)
+ // Add extra body parameters if provided
+ addExtraBodyParameters(ctx, qv, authParameters)
+
return c.doTokenResp(ctx, authParameters, qv)
}
@@ -296,6 +299,9 @@ func (c Client) FromAssertion(ctx context.Context, authParameters authority.Auth
qv.Set(clientInfo, clientInfoVal)
addScopeQueryParam(qv, authParameters)
+ // Add extra body parameters if provided
+ addExtraBodyParameters(ctx, qv, authParameters)
+
return c.doTokenResp(ctx, authParameters, qv)
}
@@ -329,6 +335,8 @@ func (c Client) FromUserAssertionClientCertificate(ctx context.Context, authPara
qv.Set("requested_token_use", "on_behalf_of")
addScopeQueryParam(qv, authParameters)
+ // Add extra body parameters if provided
+ addExtraBodyParameters(ctx, qv, authParameters)
return c.doTokenResp(ctx, authParameters, qv)
}
@@ -466,3 +474,12 @@ func addScopeQueryParam(queryParams url.Values, authParameters authority.AuthPar
scopes := AppendDefaultScopes(authParameters)
queryParams.Set("scope", strings.Join(scopes, " "))
}
+
+// addExtraBodyParameters evaluates and adds extra body parameters to the request
+func addExtraBodyParameters(ctx context.Context, v url.Values, ap authority.AuthParams) {
+ for key, value := range ap.ExtraBodyParameters {
+ if value != "" {
+ v.Set(key, value)
+ }
+ }
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authority.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authority.go
index c3c4a96fc3..debd465dba 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authority.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authority.go
@@ -15,6 +15,7 @@ import (
"net/url"
"os"
"path"
+ "sort"
"strings"
"time"
@@ -46,13 +47,20 @@ type jsonCaller interface {
JSONCall(ctx context.Context, endpoint string, headers http.Header, qv url.Values, body, resp interface{}) error
}
+// For backward compatibility, accept both old and new China endpoints for a transition period.
+// This list is derived from the AAD instance discovery metadata and represents all known trusted hosts
+// across different Azure clouds (Public, China, Germany, US Government, etc.)
var aadTrustedHostList = map[string]bool{
"login.windows.net": true, // Microsoft Azure Worldwide - Used in validation scenarios where host is not this list
- "login.partner.microsoftonline.cn": true, // Microsoft Azure China
+ "login.partner.microsoftonline.cn": true, // Microsoft Azure China (new)
+ "login.chinacloudapi.cn": true, // Microsoft Azure China (legacy, backward compatibility)
"login.microsoftonline.de": true, // Microsoft Azure Blackforest
"login-us.microsoftonline.com": true, // Microsoft Azure US Government - Legacy
"login.microsoftonline.us": true, // Microsoft Azure US Government
"login.microsoftonline.com": true, // Microsoft Azure Worldwide
+ "login.microsoft.com": true,
+ "sts.windows.net": true,
+ "login.usgovcloudapi.net": true,
}
// TrustedHost checks if an AAD host is trusted/valid.
@@ -98,6 +106,51 @@ func (r *TenantDiscoveryResponse) Validate() error {
return nil
}
+// ValidateIssuerMatchesAuthority validates that the issuer in the TenantDiscoveryResponse matches the authority.
+// This is used to identity security or configuration issues in authorities and the OIDC endpoint
+func (r *TenantDiscoveryResponse) ValidateIssuerMatchesAuthority(authorityURI string, aliases map[string]bool) error {
+ if authorityURI == "" {
+ return errors.New("TenantDiscoveryResponse: empty authorityURI provided for validation")
+ }
+ if r.Issuer == "" {
+ return errors.New("TenantDiscoveryResponse: empty issuer in response")
+ }
+
+ issuerURL, err := url.Parse(r.Issuer)
+ if err != nil {
+ return fmt.Errorf("TenantDiscoveryResponse: failed to parse issuer URL: %w", err)
+ }
+ authorityURL, err := url.Parse(authorityURI)
+ if err != nil {
+ return fmt.Errorf("TenantDiscoveryResponse: failed to parse authority URL: %w", err)
+ }
+
+ // Fast path: exact scheme + host match
+ if issuerURL.Scheme == authorityURL.Scheme && issuerURL.Host == authorityURL.Host {
+ return nil
+ }
+
+ // Alias-based acceptance
+ if aliases != nil && aliases[issuerURL.Host] {
+ return nil
+ }
+
+ issuerHost := issuerURL.Host
+ authorityHost := authorityURL.Host
+
+ // Accept if issuer host is trusted
+ if TrustedHost(issuerHost) {
+ return nil
+ }
+
+ // Accept if authority is a regional variant ending with "."
+ if strings.HasSuffix(authorityHost, "."+issuerHost) {
+ return nil
+ }
+
+ return fmt.Errorf("TenantDiscoveryResponse: issuer '%s' does not match authority '%s' or any trusted/alias rule", r.Issuer, authorityURI)
+}
+
type InstanceDiscoveryMetadata struct {
PreferredNetwork string `json:"preferred_network"`
PreferredCache string `json:"preferred_cache"`
@@ -219,6 +272,12 @@ type AuthParams struct {
DomainHint string
// AuthnScheme is an optional scheme for formatting access tokens
AuthnScheme AuthenticationScheme
+ // ExtraBodyParameters are additional parameters to include in token requests.
+ // The functions are evaluated at request time to get the parameter values.
+ // These parameters are also included in the cache key.
+ ExtraBodyParameters map[string]string
+ // CacheKeyComponents are additional components to include in the cache key.
+ CacheKeyComponents map[string]string
}
// NewAuthParams creates an authorization parameters object.
@@ -354,6 +413,8 @@ type Info struct {
Tenant string
Region string
InstanceDiscoveryDisabled bool
+ // InstanceDiscoveryMetadata stores the metadata from AAD instance discovery
+ InstanceDiscoveryMetadata []InstanceDiscoveryMetadata
}
// NewInfoFromAuthorityURI creates an AuthorityInfo instance from the authority URL provided.
@@ -603,8 +664,42 @@ func (a *AuthParams) AssertionHash() string {
}
func (a *AuthParams) AppKey() string {
+ baseKey := a.ClientID + "_"
if a.AuthorityInfo.Tenant != "" {
- return fmt.Sprintf("%s_%s_AppTokenCache", a.ClientID, a.AuthorityInfo.Tenant)
+ baseKey += a.AuthorityInfo.Tenant
+ }
+
+ // Include extra body parameters in the cache key
+ paramHash := a.CacheExtKeyGenerator()
+ if paramHash != "" {
+ baseKey = fmt.Sprintf("%s_%s", baseKey, paramHash)
}
- return fmt.Sprintf("%s__AppTokenCache", a.ClientID)
+
+ return baseKey + "_AppTokenCache"
+}
+
+// CacheExtKeyGenerator computes a hash of the Cache key components key and values
+// to include in the cache key. This ensures tokens acquired with different
+// parameters are cached separately.
+func (a *AuthParams) CacheExtKeyGenerator() string {
+ if len(a.CacheKeyComponents) == 0 {
+ return ""
+ }
+
+ // Sort keys to ensure consistent hashing
+ keys := make([]string, 0, len(a.CacheKeyComponents))
+ for k := range a.CacheKeyComponents {
+ keys = append(keys, k)
+ }
+ sort.Strings(keys)
+
+ // Create a string by concatenating key+value pairs
+ keyStr := ""
+ for _, key := range keys {
+ // Append key followed by its value with no separator
+ keyStr += key + a.CacheKeyComponents[key]
+ }
+
+ hash := sha256.Sum256([]byte(keyStr))
+ return strings.ToLower(base64.RawURLEncoding.EncodeToString(hash[:]))
}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/resolvers.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/resolvers.go
index 4030ec8d8f..d220a99466 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/resolvers.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/resolvers.go
@@ -21,10 +21,12 @@ import (
type cacheEntry struct {
Endpoints authority.Endpoints
ValidForDomainsInList map[string]bool
+ // Aliases stores host aliases from instance discovery for quick lookup
+ Aliases map[string]bool
}
func createcacheEntry(endpoints authority.Endpoints) cacheEntry {
- return cacheEntry{endpoints, map[string]bool{}}
+ return cacheEntry{endpoints, map[string]bool{}, map[string]bool{}}
}
// AuthorityEndpoint retrieves endpoints from an authority for auth and token acquisition.
@@ -71,10 +73,15 @@ func (m *authorityEndpoint) ResolveEndpoints(ctx context.Context, authorityInfo
m.addCachedEndpoints(authorityInfo, userPrincipalName, endpoints)
+ if err := resp.ValidateIssuerMatchesAuthority(authorityInfo.CanonicalAuthorityURI,
+ m.cache[authorityInfo.CanonicalAuthorityURI].Aliases); err != nil {
+ return authority.Endpoints{}, fmt.Errorf("ResolveEndpoints(): %w", err)
+ }
+
return endpoints, nil
}
-// cachedEndpoints returns a the cached endpoints if they exists. If not, we return false.
+// cachedEndpoints returns the cached endpoints if they exist. If not, we return false.
func (m *authorityEndpoint) cachedEndpoints(authorityInfo authority.Info, userPrincipalName string) (authority.Endpoints, bool) {
m.mu.Lock()
defer m.mu.Unlock()
@@ -113,6 +120,13 @@ func (m *authorityEndpoint) addCachedEndpoints(authorityInfo authority.Info, use
}
}
+ // Extract aliases from instance discovery metadata and add to cache
+ for _, metadata := range authorityInfo.InstanceDiscoveryMetadata {
+ for _, alias := range metadata.Aliases {
+ updatedCacheEntry.Aliases[alias] = true
+ }
+ }
+
m.cache[authorityInfo.CanonicalAuthorityURI] = updatedCacheEntry
}
@@ -127,12 +141,14 @@ func (m *authorityEndpoint) openIDConfigurationEndpoint(ctx context.Context, aut
if err != nil {
return "", err
}
+ authorityInfo.InstanceDiscoveryMetadata = resp.Metadata
return resp.TenantDiscoveryEndpoint, nil
} else if authorityInfo.Region != "" {
resp, err := m.rest.Authority().AADInstanceDiscovery(ctx, authorityInfo)
if err != nil {
return "", err
}
+ authorityInfo.InstanceDiscoveryMetadata = resp.Metadata
return resp.TenantDiscoveryEndpoint, nil
}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go
index 7beed26174..797c086cb8 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go
@@ -368,9 +368,9 @@ type AcquireByUsernamePasswordOption interface {
acquireByUsernamePasswordOption()
}
-// AcquireTokenByUsernamePassword acquires a security token from the authority, via Username/Password Authentication.
-// NOTE: this flow is NOT recommended.
+// Deprecated: This API will be removed in a future release. Use a more secure flow instead. Follow this migration guide: https://aka.ms/msal-ropc-migration
//
+// AcquireTokenByUsernamePassword acquires a security token from the authority, via Username/Password Authentication.
// Options: [WithClaims], [WithTenantID]
func (pca Client) AcquireTokenByUsernamePassword(ctx context.Context, scopes []string, username, password string, opts ...AcquireByUsernamePasswordOption) (AuthResult, error) {
o := acquireTokenByUsernamePasswordOptions{}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/desc.go b/vendor/github.com/prometheus/client_golang/prometheus/desc.go
index ad347113c0..2331b8b4f3 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/desc.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/desc.go
@@ -95,7 +95,8 @@ func (v2) NewDesc(fqName, help string, variableLabels ConstrainableLabels, const
help: help,
variableLabels: variableLabels.compile(),
}
- if !model.IsValidMetricName(model.LabelValue(fqName)) {
+ //nolint:staticcheck // TODO: Don't use deprecated model.NameValidationScheme.
+ if !model.NameValidationScheme.IsValidMetricName(fqName) {
d.err = fmt.Errorf("%q is not a valid metric name", fqName)
return d
}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/internal/go_runtime_metrics.go b/vendor/github.com/prometheus/client_golang/prometheus/internal/go_runtime_metrics.go
index f7f97ef926..d273b6640e 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/internal/go_runtime_metrics.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/internal/go_runtime_metrics.go
@@ -67,7 +67,7 @@ func RuntimeMetricsToProm(d *metrics.Description) (string, string, string, bool)
}
// Our current conversion moves to legacy naming, so use legacy validation.
- valid := model.IsValidLegacyMetricName(namespace + "_" + subsystem + "_" + name)
+ valid := model.LegacyValidation.IsValidMetricName(namespace + "_" + subsystem + "_" + name)
switch d.Kind {
case metrics.KindUint64:
case metrics.KindFloat64:
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/labels.go b/vendor/github.com/prometheus/client_golang/prometheus/labels.go
index c21911f292..5fe8d3b4d2 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/labels.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/labels.go
@@ -184,5 +184,6 @@ func validateLabelValues(vals []string, expectedNumberOfValues int) error {
}
func checkLabelName(l string) bool {
- return model.LabelName(l).IsValid() && !strings.HasPrefix(l, reservedLabelPrefix)
+ //nolint:staticcheck // TODO: Don't use deprecated model.NameValidationScheme.
+ return model.NameValidationScheme.IsValidLabelName(l) && !strings.HasPrefix(l, reservedLabelPrefix)
}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/testutil/testutil.go b/vendor/github.com/prometheus/client_golang/prometheus/testutil/testutil.go
index 1258508e4f..80a4d7c355 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/testutil/testutil.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/testutil/testutil.go
@@ -262,7 +262,7 @@ func CollectAndFormat(c prometheus.Collector, format expfmt.FormatType, metricNa
// convertReaderToMetricFamily would read from a io.Reader object and convert it to a slice of
// dto.MetricFamily.
func convertReaderToMetricFamily(reader io.Reader) ([]*dto.MetricFamily, error) {
- var tp expfmt.TextParser
+ tp := expfmt.NewTextParser(model.UTF8Validation)
notNormalized, err := tp.TextToMetricFamilies(reader)
if err != nil {
return nil, fmt.Errorf("converting reader to metric families failed: %w", err)
diff --git a/vendor/github.com/prometheus/common/expfmt/decode.go b/vendor/github.com/prometheus/common/expfmt/decode.go
index 1448439b7f..7b762370e2 100644
--- a/vendor/github.com/prometheus/common/expfmt/decode.go
+++ b/vendor/github.com/prometheus/common/expfmt/decode.go
@@ -70,19 +70,34 @@ func ResponseFormat(h http.Header) Format {
return FmtUnknown
}
-// NewDecoder returns a new decoder based on the given input format.
-// If the input format does not imply otherwise, a text format decoder is returned.
+// NewDecoder returns a new decoder based on the given input format. Metric
+// names are validated based on the provided Format -- if the format requires
+// escaping, raditional Prometheues validity checking is used. Otherwise, names
+// are checked for UTF-8 validity. Supported formats include delimited protobuf
+// and Prometheus text format. For historical reasons, this decoder fallbacks
+// to classic text decoding for any other format. This decoder does not fully
+// support OpenMetrics although it may often succeed due to the similarities
+// between the formats. This decoder may not support the latest features of
+// Prometheus text format and is not intended for high-performance applications.
+// See: https://github.com/prometheus/common/issues/812
func NewDecoder(r io.Reader, format Format) Decoder {
+ scheme := model.LegacyValidation
+ if format.ToEscapingScheme() == model.NoEscaping {
+ scheme = model.UTF8Validation
+ }
switch format.FormatType() {
case TypeProtoDelim:
- return &protoDecoder{r: bufio.NewReader(r)}
+ return &protoDecoder{r: bufio.NewReader(r), s: scheme}
+ case TypeProtoText, TypeProtoCompact:
+ return &errDecoder{err: fmt.Errorf("format %s not supported for decoding", format)}
}
- return &textDecoder{r: r}
+ return &textDecoder{r: r, s: scheme}
}
// protoDecoder implements the Decoder interface for protocol buffers.
type protoDecoder struct {
r protodelim.Reader
+ s model.ValidationScheme
}
// Decode implements the Decoder interface.
@@ -93,7 +108,7 @@ func (d *protoDecoder) Decode(v *dto.MetricFamily) error {
if err := opts.UnmarshalFrom(d.r, v); err != nil {
return err
}
- if !model.IsValidMetricName(model.LabelValue(v.GetName())) {
+ if !d.s.IsValidMetricName(v.GetName()) {
return fmt.Errorf("invalid metric name %q", v.GetName())
}
for _, m := range v.GetMetric() {
@@ -107,7 +122,7 @@ func (d *protoDecoder) Decode(v *dto.MetricFamily) error {
if !model.LabelValue(l.GetValue()).IsValid() {
return fmt.Errorf("invalid label value %q", l.GetValue())
}
- if !model.LabelName(l.GetName()).IsValid() {
+ if !d.s.IsValidLabelName(l.GetName()) {
return fmt.Errorf("invalid label name %q", l.GetName())
}
}
@@ -115,10 +130,20 @@ func (d *protoDecoder) Decode(v *dto.MetricFamily) error {
return nil
}
+// errDecoder is an error-state decoder that always returns the same error.
+type errDecoder struct {
+ err error
+}
+
+func (d *errDecoder) Decode(*dto.MetricFamily) error {
+ return d.err
+}
+
// textDecoder implements the Decoder interface for the text protocol.
type textDecoder struct {
r io.Reader
fams map[string]*dto.MetricFamily
+ s model.ValidationScheme
err error
}
@@ -126,7 +151,7 @@ type textDecoder struct {
func (d *textDecoder) Decode(v *dto.MetricFamily) error {
if d.err == nil {
// Read all metrics in one shot.
- var p TextParser
+ p := NewTextParser(d.s)
d.fams, d.err = p.TextToMetricFamilies(d.r)
// If we don't get an error, store io.EOF for the end.
if d.err == nil {
diff --git a/vendor/github.com/prometheus/common/expfmt/encode.go b/vendor/github.com/prometheus/common/expfmt/encode.go
index d7f3d76f55..73c24dfbc9 100644
--- a/vendor/github.com/prometheus/common/expfmt/encode.go
+++ b/vendor/github.com/prometheus/common/expfmt/encode.go
@@ -18,14 +18,12 @@ import (
"io"
"net/http"
+ "github.com/munnerz/goautoneg"
+ dto "github.com/prometheus/client_model/go"
"google.golang.org/protobuf/encoding/protodelim"
"google.golang.org/protobuf/encoding/prototext"
"github.com/prometheus/common/model"
-
- "github.com/munnerz/goautoneg"
-
- dto "github.com/prometheus/client_model/go"
)
// Encoder types encode metric families into an underlying wire protocol.
@@ -61,7 +59,7 @@ func (ec encoderCloser) Close() error {
// appropriate accepted type is found, FmtText is returned (which is the
// Prometheus text format). This function will never negotiate FmtOpenMetrics,
// as the support is still experimental. To include the option to negotiate
-// FmtOpenMetrics, use NegotiateOpenMetrics.
+// FmtOpenMetrics, use NegotiateIncludingOpenMetrics.
func Negotiate(h http.Header) Format {
escapingScheme := Format(fmt.Sprintf("; escaping=%s", Format(model.NameEscapingScheme.String())))
for _, ac := range goautoneg.ParseAccept(h.Get(hdrAccept)) {
@@ -153,7 +151,7 @@ func NewEncoder(w io.Writer, format Format, options ...EncoderOption) Encoder {
case TypeProtoDelim:
return encoderCloser{
encode: func(v *dto.MetricFamily) error {
- _, err := protodelim.MarshalTo(w, v)
+ _, err := protodelim.MarshalTo(w, model.EscapeMetricFamily(v, escapingScheme))
return err
},
close: func() error { return nil },
diff --git a/vendor/github.com/prometheus/common/expfmt/expfmt.go b/vendor/github.com/prometheus/common/expfmt/expfmt.go
index b26886560d..c34c7de432 100644
--- a/vendor/github.com/prometheus/common/expfmt/expfmt.go
+++ b/vendor/github.com/prometheus/common/expfmt/expfmt.go
@@ -36,9 +36,11 @@ const (
ProtoType = `application/vnd.google.protobuf`
ProtoProtocol = `io.prometheus.client.MetricFamily`
// Deprecated: Use expfmt.NewFormat(expfmt.TypeProtoCompact) instead.
- ProtoFmt = ProtoType + "; proto=" + ProtoProtocol + ";"
- OpenMetricsType = `application/openmetrics-text`
+ ProtoFmt = ProtoType + "; proto=" + ProtoProtocol + ";"
+ OpenMetricsType = `application/openmetrics-text`
+ //nolint:revive // Allow for underscores.
OpenMetricsVersion_0_0_1 = "0.0.1"
+ //nolint:revive // Allow for underscores.
OpenMetricsVersion_1_0_0 = "1.0.0"
// The Content-Type values for the different wire protocols. Do not do direct
@@ -54,8 +56,10 @@ const (
// Deprecated: Use expfmt.NewFormat(expfmt.TypeProtoCompact) instead.
FmtProtoCompact Format = ProtoFmt + ` encoding=compact-text`
// Deprecated: Use expfmt.NewFormat(expfmt.TypeOpenMetrics) instead.
+ //nolint:revive // Allow for underscores.
FmtOpenMetrics_1_0_0 Format = OpenMetricsType + `; version=` + OpenMetricsVersion_1_0_0 + `; charset=utf-8`
// Deprecated: Use expfmt.NewFormat(expfmt.TypeOpenMetrics) instead.
+ //nolint:revive // Allow for underscores.
FmtOpenMetrics_0_0_1 Format = OpenMetricsType + `; version=` + OpenMetricsVersion_0_0_1 + `; charset=utf-8`
)
@@ -188,8 +192,8 @@ func (f Format) FormatType() FormatType {
// Format contains a escaping=allow-utf-8 term, it will select NoEscaping. If a valid
// "escaping" term exists, that will be used. Otherwise, the global default will
// be returned.
-func (format Format) ToEscapingScheme() model.EscapingScheme {
- for _, p := range strings.Split(string(format), ";") {
+func (f Format) ToEscapingScheme() model.EscapingScheme {
+ for _, p := range strings.Split(string(f), ";") {
toks := strings.Split(p, "=")
if len(toks) != 2 {
continue
diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz.go b/vendor/github.com/prometheus/common/expfmt/fuzz.go
index dfac962a4e..0290f6abc4 100644
--- a/vendor/github.com/prometheus/common/expfmt/fuzz.go
+++ b/vendor/github.com/prometheus/common/expfmt/fuzz.go
@@ -17,7 +17,11 @@
package expfmt
-import "bytes"
+import (
+ "bytes"
+
+ "github.com/prometheus/common/model"
+)
// Fuzz text metric parser with with github.com/dvyukov/go-fuzz:
//
@@ -26,9 +30,8 @@ import "bytes"
//
// Further input samples should go in the folder fuzz/corpus.
func Fuzz(in []byte) int {
- parser := TextParser{}
+ parser := NewTextParser(model.UTF8Validation)
_, err := parser.TextToMetricFamilies(bytes.NewReader(in))
-
if err != nil {
return 0
}
diff --git a/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go b/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go
index a21ed4ec1f..8dbf6d04ed 100644
--- a/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go
+++ b/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go
@@ -22,11 +22,10 @@ import (
"strconv"
"strings"
+ dto "github.com/prometheus/client_model/go"
"google.golang.org/protobuf/types/known/timestamppb"
"github.com/prometheus/common/model"
-
- dto "github.com/prometheus/client_model/go"
)
type encoderOption struct {
@@ -249,7 +248,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily, options ...E
// Finally the samples, one line for each.
if metricType == dto.MetricType_COUNTER && strings.HasSuffix(name, "_total") {
- compliantName = compliantName + "_total"
+ compliantName += "_total"
}
for _, metric := range in.Metric {
switch metricType {
@@ -477,7 +476,7 @@ func writeOpenMetricsNameAndLabelPairs(
if name != "" {
// If the name does not pass the legacy validity check, we must put the
// metric name inside the braces, quoted.
- if !model.IsValidLegacyMetricName(name) {
+ if !model.LegacyValidation.IsValidMetricName(name) {
metricInsideBraces = true
err := w.WriteByte(separator)
written++
@@ -641,11 +640,11 @@ func writeExemplar(w enhancedWriter, e *dto.Exemplar) (int, error) {
if err != nil {
return written, err
}
- err = (*e).Timestamp.CheckValid()
+ err = e.Timestamp.CheckValid()
if err != nil {
return written, err
}
- ts := (*e).Timestamp.AsTime()
+ ts := e.Timestamp.AsTime()
// TODO(beorn7): Format this directly from components of ts to
// avoid overflow/underflow and precision issues of the float
// conversion.
diff --git a/vendor/github.com/prometheus/common/expfmt/text_create.go b/vendor/github.com/prometheus/common/expfmt/text_create.go
index 4b86434b33..c4e9c1bbc3 100644
--- a/vendor/github.com/prometheus/common/expfmt/text_create.go
+++ b/vendor/github.com/prometheus/common/expfmt/text_create.go
@@ -22,9 +22,9 @@ import (
"strings"
"sync"
- "github.com/prometheus/common/model"
-
dto "github.com/prometheus/client_model/go"
+
+ "github.com/prometheus/common/model"
)
// enhancedWriter has all the enhanced write functions needed here. bufio.Writer
@@ -354,7 +354,7 @@ func writeNameAndLabelPairs(
if name != "" {
// If the name does not pass the legacy validity check, we must put the
// metric name inside the braces.
- if !model.IsValidLegacyMetricName(name) {
+ if !model.LegacyValidation.IsValidMetricName(name) {
metricInsideBraces = true
err := w.WriteByte(separator)
written++
@@ -498,7 +498,7 @@ func writeInt(w enhancedWriter, i int64) (int, error) {
// writeName writes a string as-is if it complies with the legacy naming
// scheme, or escapes it in double quotes if not.
func writeName(w enhancedWriter, name string) (int, error) {
- if model.IsValidLegacyMetricName(name) {
+ if model.LegacyValidation.IsValidMetricName(name) {
return w.WriteString(name)
}
var written int
diff --git a/vendor/github.com/prometheus/common/expfmt/text_parse.go b/vendor/github.com/prometheus/common/expfmt/text_parse.go
index 4067978a17..8f2edde324 100644
--- a/vendor/github.com/prometheus/common/expfmt/text_parse.go
+++ b/vendor/github.com/prometheus/common/expfmt/text_parse.go
@@ -78,6 +78,14 @@ type TextParser struct {
// These indicate if the metric name from the current line being parsed is inside
// braces and if that metric name was found respectively.
currentMetricIsInsideBraces, currentMetricInsideBracesIsPresent bool
+ // scheme sets the desired ValidationScheme for names. Defaults to the invalid
+ // UnsetValidation.
+ scheme model.ValidationScheme
+}
+
+// NewTextParser returns a new TextParser with the provided nameValidationScheme.
+func NewTextParser(nameValidationScheme model.ValidationScheme) TextParser {
+ return TextParser{scheme: nameValidationScheme}
}
// TextToMetricFamilies reads 'in' as the simple and flat text-based exchange
@@ -126,6 +134,7 @@ func (p *TextParser) TextToMetricFamilies(in io.Reader) (map[string]*dto.MetricF
func (p *TextParser) reset(in io.Reader) {
p.metricFamiliesByName = map[string]*dto.MetricFamily{}
+ p.currentLabelPairs = nil
if p.buf == nil {
p.buf = bufio.NewReader(in)
} else {
@@ -216,6 +225,9 @@ func (p *TextParser) startComment() stateFn {
return nil
}
p.setOrCreateCurrentMF()
+ if p.err != nil {
+ return nil
+ }
if p.skipBlankTab(); p.err != nil {
return nil // Unexpected end of input.
}
@@ -244,6 +256,9 @@ func (p *TextParser) readingMetricName() stateFn {
return nil
}
p.setOrCreateCurrentMF()
+ if p.err != nil {
+ return nil
+ }
// Now is the time to fix the type if it hasn't happened yet.
if p.currentMF.Type == nil {
p.currentMF.Type = dto.MetricType_UNTYPED.Enum()
@@ -311,6 +326,9 @@ func (p *TextParser) startLabelName() stateFn {
switch p.currentByte {
case ',':
p.setOrCreateCurrentMF()
+ if p.err != nil {
+ return nil
+ }
if p.currentMF.Type == nil {
p.currentMF.Type = dto.MetricType_UNTYPED.Enum()
}
@@ -319,6 +337,10 @@ func (p *TextParser) startLabelName() stateFn {
return p.startLabelName
case '}':
p.setOrCreateCurrentMF()
+ if p.err != nil {
+ p.currentLabelPairs = nil
+ return nil
+ }
if p.currentMF.Type == nil {
p.currentMF.Type = dto.MetricType_UNTYPED.Enum()
}
@@ -341,6 +363,12 @@ func (p *TextParser) startLabelName() stateFn {
p.currentLabelPair = &dto.LabelPair{Name: proto.String(p.currentToken.String())}
if p.currentLabelPair.GetName() == string(model.MetricNameLabel) {
p.parseError(fmt.Sprintf("label name %q is reserved", model.MetricNameLabel))
+ p.currentLabelPairs = nil
+ return nil
+ }
+ if !p.scheme.IsValidLabelName(p.currentLabelPair.GetName()) {
+ p.parseError(fmt.Sprintf("invalid label name %q", p.currentLabelPair.GetName()))
+ p.currentLabelPairs = nil
return nil
}
// Special summary/histogram treatment. Don't add 'quantile' and 'le'
@@ -353,13 +381,12 @@ func (p *TextParser) startLabelName() stateFn {
labels := make(map[string]struct{})
for _, l := range p.currentLabelPairs {
lName := l.GetName()
- if _, exists := labels[lName]; !exists {
- labels[lName] = struct{}{}
- } else {
+ if _, exists := labels[lName]; exists {
p.parseError(fmt.Sprintf("duplicate label names for metric %q", p.currentMF.GetName()))
p.currentLabelPairs = nil
return nil
}
+ labels[lName] = struct{}{}
}
return p.startLabelValue
}
@@ -440,7 +467,8 @@ func (p *TextParser) readingValue() stateFn {
// When we are here, we have read all the labels, so for the
// special case of a summary/histogram, we can finally find out
// if the metric already exists.
- if p.currentMF.GetType() == dto.MetricType_SUMMARY {
+ switch p.currentMF.GetType() {
+ case dto.MetricType_SUMMARY:
signature := model.LabelsToSignature(p.currentLabels)
if summary := p.summaries[signature]; summary != nil {
p.currentMetric = summary
@@ -448,7 +476,7 @@ func (p *TextParser) readingValue() stateFn {
p.summaries[signature] = p.currentMetric
p.currentMF.Metric = append(p.currentMF.Metric, p.currentMetric)
}
- } else if p.currentMF.GetType() == dto.MetricType_HISTOGRAM {
+ case dto.MetricType_HISTOGRAM:
signature := model.LabelsToSignature(p.currentLabels)
if histogram := p.histograms[signature]; histogram != nil {
p.currentMetric = histogram
@@ -456,7 +484,7 @@ func (p *TextParser) readingValue() stateFn {
p.histograms[signature] = p.currentMetric
p.currentMF.Metric = append(p.currentMF.Metric, p.currentMetric)
}
- } else {
+ default:
p.currentMF.Metric = append(p.currentMF.Metric, p.currentMetric)
}
if p.readTokenUntilWhitespace(); p.err != nil {
@@ -805,6 +833,10 @@ func (p *TextParser) setOrCreateCurrentMF() {
p.currentIsHistogramCount = false
p.currentIsHistogramSum = false
name := p.currentToken.String()
+ if !p.scheme.IsValidMetricName(name) {
+ p.parseError(fmt.Sprintf("invalid metric name %q", name))
+ return
+ }
if p.currentMF = p.metricFamiliesByName[name]; p.currentMF != nil {
return
}
diff --git a/vendor/github.com/prometheus/common/model/labels.go b/vendor/github.com/prometheus/common/model/labels.go
index de83afe93e..dfeb34be5f 100644
--- a/vendor/github.com/prometheus/common/model/labels.go
+++ b/vendor/github.com/prometheus/common/model/labels.go
@@ -32,6 +32,12 @@ const (
// MetricNameLabel is the label name indicating the metric name of a
// timeseries.
MetricNameLabel = "__name__"
+ // MetricTypeLabel is the label name indicating the metric type of
+ // timeseries as per the PROM-39 proposal.
+ MetricTypeLabel = "__type__"
+ // MetricUnitLabel is the label name indicating the metric unit of
+ // timeseries as per the PROM-39 proposal.
+ MetricUnitLabel = "__unit__"
// SchemeLabel is the name of the label that holds the scheme on which to
// scrape a target.
@@ -100,34 +106,21 @@ type LabelName string
// IsValid returns true iff the name matches the pattern of LabelNameRE when
// NameValidationScheme is set to LegacyValidation, or valid UTF-8 if
// NameValidationScheme is set to UTF8Validation.
+//
+// Deprecated: This method should not be used and may be removed in the future.
+// Use [ValidationScheme.IsValidLabelName] instead.
func (ln LabelName) IsValid() bool {
- if len(ln) == 0 {
- return false
- }
- switch NameValidationScheme {
- case LegacyValidation:
- return ln.IsValidLegacy()
- case UTF8Validation:
- return utf8.ValidString(string(ln))
- default:
- panic(fmt.Sprintf("Invalid name validation scheme requested: %d", NameValidationScheme))
- }
+ return NameValidationScheme.IsValidLabelName(string(ln))
}
// IsValidLegacy returns true iff name matches the pattern of LabelNameRE for
// legacy names. It does not use LabelNameRE for the check but a much faster
// hardcoded implementation.
+//
+// Deprecated: This method should not be used and may be removed in the future.
+// Use [LegacyValidation.IsValidLabelName] instead.
func (ln LabelName) IsValidLegacy() bool {
- if len(ln) == 0 {
- return false
- }
- for i, b := range ln {
- // TODO: Apply De Morgan's law. Make sure there are tests for this.
- if !((b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_' || (b >= '0' && b <= '9' && i > 0)) { //nolint:staticcheck
- return false
- }
- }
- return true
+ return LegacyValidation.IsValidLabelName(string(ln))
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
diff --git a/vendor/github.com/prometheus/common/model/labelset.go b/vendor/github.com/prometheus/common/model/labelset.go
index d0ad88da33..9de47b2568 100644
--- a/vendor/github.com/prometheus/common/model/labelset.go
+++ b/vendor/github.com/prometheus/common/model/labelset.go
@@ -114,10 +114,10 @@ func (ls LabelSet) Clone() LabelSet {
}
// Merge is a helper function to non-destructively merge two label sets.
-func (l LabelSet) Merge(other LabelSet) LabelSet {
- result := make(LabelSet, len(l))
+func (ls LabelSet) Merge(other LabelSet) LabelSet {
+ result := make(LabelSet, len(ls))
- for k, v := range l {
+ for k, v := range ls {
result[k] = v
}
@@ -140,7 +140,7 @@ func (ls LabelSet) FastFingerprint() Fingerprint {
}
// UnmarshalJSON implements the json.Unmarshaler interface.
-func (l *LabelSet) UnmarshalJSON(b []byte) error {
+func (ls *LabelSet) UnmarshalJSON(b []byte) error {
var m map[LabelName]LabelValue
if err := json.Unmarshal(b, &m); err != nil {
return err
@@ -153,6 +153,6 @@ func (l *LabelSet) UnmarshalJSON(b []byte) error {
return fmt.Errorf("%q is not a valid label name", ln)
}
}
- *l = LabelSet(m)
+ *ls = LabelSet(m)
return nil
}
diff --git a/vendor/github.com/prometheus/common/model/metric.go b/vendor/github.com/prometheus/common/model/metric.go
index a6b01755bd..3feebf328a 100644
--- a/vendor/github.com/prometheus/common/model/metric.go
+++ b/vendor/github.com/prometheus/common/model/metric.go
@@ -14,6 +14,7 @@
package model
import (
+ "encoding/json"
"errors"
"fmt"
"regexp"
@@ -23,6 +24,7 @@ import (
"unicode/utf8"
dto "github.com/prometheus/client_model/go"
+ "go.yaml.in/yaml/v2"
"google.golang.org/protobuf/proto"
)
@@ -62,16 +64,151 @@ var (
type ValidationScheme int
const (
+ // UnsetValidation represents an undefined ValidationScheme.
+ // Should not be used in practice.
+ UnsetValidation ValidationScheme = iota
+
// LegacyValidation is a setting that requires that all metric and label names
// conform to the original Prometheus character requirements described by
// MetricNameRE and LabelNameRE.
- LegacyValidation ValidationScheme = iota
+ LegacyValidation
// UTF8Validation only requires that metric and label names be valid UTF-8
// strings.
UTF8Validation
)
+var _ interface {
+ yaml.Marshaler
+ yaml.Unmarshaler
+ json.Marshaler
+ json.Unmarshaler
+ fmt.Stringer
+} = new(ValidationScheme)
+
+// String returns the string representation of s.
+func (s ValidationScheme) String() string {
+ switch s {
+ case UnsetValidation:
+ return "unset"
+ case LegacyValidation:
+ return "legacy"
+ case UTF8Validation:
+ return "utf8"
+ default:
+ panic(fmt.Errorf("unhandled ValidationScheme: %d", s))
+ }
+}
+
+// MarshalYAML implements the yaml.Marshaler interface.
+func (s ValidationScheme) MarshalYAML() (any, error) {
+ switch s {
+ case UnsetValidation:
+ return "", nil
+ case LegacyValidation, UTF8Validation:
+ return s.String(), nil
+ default:
+ panic(fmt.Errorf("unhandled ValidationScheme: %d", s))
+ }
+}
+
+// UnmarshalYAML implements the yaml.Unmarshaler interface.
+func (s *ValidationScheme) UnmarshalYAML(unmarshal func(any) error) error {
+ var scheme string
+ if err := unmarshal(&scheme); err != nil {
+ return err
+ }
+ return s.Set(scheme)
+}
+
+// MarshalJSON implements the json.Marshaler interface.
+func (s ValidationScheme) MarshalJSON() ([]byte, error) {
+ switch s {
+ case UnsetValidation:
+ return json.Marshal("")
+ case UTF8Validation, LegacyValidation:
+ return json.Marshal(s.String())
+ default:
+ return nil, fmt.Errorf("unhandled ValidationScheme: %d", s)
+ }
+}
+
+// UnmarshalJSON implements the json.Unmarshaler interface.
+func (s *ValidationScheme) UnmarshalJSON(bytes []byte) error {
+ var repr string
+ if err := json.Unmarshal(bytes, &repr); err != nil {
+ return err
+ }
+ return s.Set(repr)
+}
+
+// Set implements the pflag.Value interface.
+func (s *ValidationScheme) Set(text string) error {
+ switch text {
+ case "":
+ // Don't change the value.
+ case LegacyValidation.String():
+ *s = LegacyValidation
+ case UTF8Validation.String():
+ *s = UTF8Validation
+ default:
+ return fmt.Errorf("unrecognized ValidationScheme: %q", text)
+ }
+ return nil
+}
+
+// IsValidMetricName returns whether metricName is valid according to s.
+func (s ValidationScheme) IsValidMetricName(metricName string) bool {
+ switch s {
+ case LegacyValidation:
+ if len(metricName) == 0 {
+ return false
+ }
+ for i, b := range metricName {
+ if !isValidLegacyRune(b, i) {
+ return false
+ }
+ }
+ return true
+ case UTF8Validation:
+ if len(metricName) == 0 {
+ return false
+ }
+ return utf8.ValidString(metricName)
+ default:
+ panic(fmt.Sprintf("Invalid name validation scheme requested: %s", s.String()))
+ }
+}
+
+// IsValidLabelName returns whether labelName is valid according to s.
+func (s ValidationScheme) IsValidLabelName(labelName string) bool {
+ switch s {
+ case LegacyValidation:
+ if len(labelName) == 0 {
+ return false
+ }
+ for i, b := range labelName {
+ // TODO: Apply De Morgan's law. Make sure there are tests for this.
+ if !((b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_' || (b >= '0' && b <= '9' && i > 0)) { //nolint:staticcheck
+ return false
+ }
+ }
+ return true
+ case UTF8Validation:
+ if len(labelName) == 0 {
+ return false
+ }
+ return utf8.ValidString(labelName)
+ default:
+ panic(fmt.Sprintf("Invalid name validation scheme requested: %s", s))
+ }
+}
+
+// Type implements the pflag.Value interface.
+func (ValidationScheme) Type() string {
+ return "validationScheme"
+}
+
type EscapingScheme int
const (
@@ -101,7 +238,7 @@ const (
// Accept header, the default NameEscapingScheme will be used.
EscapingKey = "escaping"
- // Possible values for Escaping Key:
+ // Possible values for Escaping Key.
AllowUTF8 = "allow-utf-8" // No escaping required.
EscapeUnderscores = "underscores"
EscapeDots = "dots"
@@ -175,34 +312,22 @@ func (m Metric) FastFingerprint() Fingerprint {
// IsValidMetricName returns true iff name matches the pattern of MetricNameRE
// for legacy names, and iff it's valid UTF-8 if the UTF8Validation scheme is
// selected.
+//
+// Deprecated: This function should not be used and might be removed in the future.
+// Use [ValidationScheme.IsValidMetricName] instead.
func IsValidMetricName(n LabelValue) bool {
- switch NameValidationScheme {
- case LegacyValidation:
- return IsValidLegacyMetricName(string(n))
- case UTF8Validation:
- if len(n) == 0 {
- return false
- }
- return utf8.ValidString(string(n))
- default:
- panic(fmt.Sprintf("Invalid name validation scheme requested: %d", NameValidationScheme))
- }
+ return NameValidationScheme.IsValidMetricName(string(n))
}
// IsValidLegacyMetricName is similar to IsValidMetricName but always uses the
// legacy validation scheme regardless of the value of NameValidationScheme.
// This function, however, does not use MetricNameRE for the check but a much
// faster hardcoded implementation.
+//
+// Deprecated: This function should not be used and might be removed in the future.
+// Use [LegacyValidation.IsValidMetricName] instead.
func IsValidLegacyMetricName(n string) bool {
- if len(n) == 0 {
- return false
- }
- for i, b := range n {
- if !isValidLegacyRune(b, i) {
- return false
- }
- }
- return true
+ return LegacyValidation.IsValidMetricName(n)
}
// EscapeMetricFamily escapes the given metric names and labels with the given
@@ -310,13 +435,14 @@ func EscapeName(name string, scheme EscapingScheme) string {
case DotsEscaping:
// Do not early return for legacy valid names, we still escape underscores.
for i, b := range name {
- if b == '_' {
+ switch {
+ case b == '_':
escaped.WriteString("__")
- } else if b == '.' {
+ case b == '.':
escaped.WriteString("_dot_")
- } else if isValidLegacyRune(b, i) {
+ case isValidLegacyRune(b, i):
escaped.WriteRune(b)
- } else {
+ default:
escaped.WriteString("__")
}
}
@@ -327,13 +453,14 @@ func EscapeName(name string, scheme EscapingScheme) string {
}
escaped.WriteString("U__")
for i, b := range name {
- if b == '_' {
+ switch {
+ case b == '_':
escaped.WriteString("__")
- } else if isValidLegacyRune(b, i) {
+ case isValidLegacyRune(b, i):
escaped.WriteRune(b)
- } else if !utf8.ValidRune(b) {
+ case !utf8.ValidRune(b):
escaped.WriteString("_FFFD_")
- } else {
+ default:
escaped.WriteRune('_')
escaped.WriteString(strconv.FormatInt(int64(b), 16))
escaped.WriteRune('_')
@@ -345,7 +472,7 @@ func EscapeName(name string, scheme EscapingScheme) string {
}
}
-// lower function taken from strconv.atoi
+// lower function taken from strconv.atoi.
func lower(c byte) byte {
return c | ('x' - 'X')
}
@@ -409,11 +536,12 @@ func UnescapeName(name string, scheme EscapingScheme) string {
}
r := lower(escapedName[i])
utf8Val *= 16
- if r >= '0' && r <= '9' {
+ switch {
+ case r >= '0' && r <= '9':
utf8Val += uint(r) - '0'
- } else if r >= 'a' && r <= 'f' {
+ case r >= 'a' && r <= 'f':
utf8Val += uint(r) - 'a' + 10
- } else {
+ default:
return name
}
i++
diff --git a/vendor/github.com/prometheus/common/model/time.go b/vendor/github.com/prometheus/common/model/time.go
index fed9e87b91..1730b0fdc1 100644
--- a/vendor/github.com/prometheus/common/model/time.go
+++ b/vendor/github.com/prometheus/common/model/time.go
@@ -126,14 +126,14 @@ func (t *Time) UnmarshalJSON(b []byte) error {
p := strings.Split(string(b), ".")
switch len(p) {
case 1:
- v, err := strconv.ParseInt(string(p[0]), 10, 64)
+ v, err := strconv.ParseInt(p[0], 10, 64)
if err != nil {
return err
}
*t = Time(v * second)
case 2:
- v, err := strconv.ParseInt(string(p[0]), 10, 64)
+ v, err := strconv.ParseInt(p[0], 10, 64)
if err != nil {
return err
}
@@ -143,7 +143,7 @@ func (t *Time) UnmarshalJSON(b []byte) error {
if prec < 0 {
p[1] = p[1][:dotPrecision]
} else if prec > 0 {
- p[1] = p[1] + strings.Repeat("0", prec)
+ p[1] += strings.Repeat("0", prec)
}
va, err := strconv.ParseInt(p[1], 10, 32)
@@ -170,15 +170,15 @@ func (t *Time) UnmarshalJSON(b []byte) error {
// This type should not propagate beyond the scope of input/output processing.
type Duration time.Duration
-// Set implements pflag/flag.Value
+// Set implements pflag/flag.Value.
func (d *Duration) Set(s string) error {
var err error
*d, err = ParseDuration(s)
return err
}
-// Type implements pflag.Value
-func (d *Duration) Type() string {
+// Type implements pflag.Value.
+func (*Duration) Type() string {
return "duration"
}
diff --git a/vendor/github.com/prometheus/common/model/value.go b/vendor/github.com/prometheus/common/model/value.go
index 8050637d82..a9995a37ee 100644
--- a/vendor/github.com/prometheus/common/model/value.go
+++ b/vendor/github.com/prometheus/common/model/value.go
@@ -191,7 +191,8 @@ func (ss SampleStream) String() string {
}
func (ss SampleStream) MarshalJSON() ([]byte, error) {
- if len(ss.Histograms) > 0 && len(ss.Values) > 0 {
+ switch {
+ case len(ss.Histograms) > 0 && len(ss.Values) > 0:
v := struct {
Metric Metric `json:"metric"`
Values []SamplePair `json:"values"`
@@ -202,7 +203,7 @@ func (ss SampleStream) MarshalJSON() ([]byte, error) {
Histograms: ss.Histograms,
}
return json.Marshal(&v)
- } else if len(ss.Histograms) > 0 {
+ case len(ss.Histograms) > 0:
v := struct {
Metric Metric `json:"metric"`
Histograms []SampleHistogramPair `json:"histograms"`
@@ -211,7 +212,7 @@ func (ss SampleStream) MarshalJSON() ([]byte, error) {
Histograms: ss.Histograms,
}
return json.Marshal(&v)
- } else {
+ default:
v := struct {
Metric Metric `json:"metric"`
Values []SamplePair `json:"values"`
@@ -258,7 +259,7 @@ func (s Scalar) String() string {
// MarshalJSON implements json.Marshaler.
func (s Scalar) MarshalJSON() ([]byte, error) {
v := strconv.FormatFloat(float64(s.Value), 'f', -1, 64)
- return json.Marshal([...]interface{}{s.Timestamp, string(v)})
+ return json.Marshal([...]interface{}{s.Timestamp, v})
}
// UnmarshalJSON implements json.Unmarshaler.
@@ -349,9 +350,9 @@ func (m Matrix) Len() int { return len(m) }
func (m Matrix) Less(i, j int) bool { return m[i].Metric.Before(m[j].Metric) }
func (m Matrix) Swap(i, j int) { m[i], m[j] = m[j], m[i] }
-func (mat Matrix) String() string {
- matCp := make(Matrix, len(mat))
- copy(matCp, mat)
+func (m Matrix) String() string {
+ matCp := make(Matrix, len(m))
+ copy(matCp, m)
sort.Sort(matCp)
strs := make([]string, len(matCp))
diff --git a/vendor/github.com/prometheus/common/model/value_histogram.go b/vendor/github.com/prometheus/common/model/value_histogram.go
index 895e6a3e83..91ce5b7a45 100644
--- a/vendor/github.com/prometheus/common/model/value_histogram.go
+++ b/vendor/github.com/prometheus/common/model/value_histogram.go
@@ -86,22 +86,22 @@ func (s *HistogramBucket) Equal(o *HistogramBucket) bool {
return s == o || (s.Boundaries == o.Boundaries && s.Lower == o.Lower && s.Upper == o.Upper && s.Count == o.Count)
}
-func (b HistogramBucket) String() string {
+func (s HistogramBucket) String() string {
var sb strings.Builder
- lowerInclusive := b.Boundaries == 1 || b.Boundaries == 3
- upperInclusive := b.Boundaries == 0 || b.Boundaries == 3
+ lowerInclusive := s.Boundaries == 1 || s.Boundaries == 3
+ upperInclusive := s.Boundaries == 0 || s.Boundaries == 3
if lowerInclusive {
sb.WriteRune('[')
} else {
sb.WriteRune('(')
}
- fmt.Fprintf(&sb, "%g,%g", b.Lower, b.Upper)
+ fmt.Fprintf(&sb, "%g,%g", s.Lower, s.Upper)
if upperInclusive {
sb.WriteRune(']')
} else {
sb.WriteRune(')')
}
- fmt.Fprintf(&sb, ":%v", b.Count)
+ fmt.Fprintf(&sb, ":%v", s.Count)
return sb.String()
}
diff --git a/vendor/github.com/prometheus/common/model/value_type.go b/vendor/github.com/prometheus/common/model/value_type.go
index 726c50ee63..078910f46b 100644
--- a/vendor/github.com/prometheus/common/model/value_type.go
+++ b/vendor/github.com/prometheus/common/model/value_type.go
@@ -66,8 +66,8 @@ func (et *ValueType) UnmarshalJSON(b []byte) error {
return nil
}
-func (e ValueType) String() string {
- switch e {
+func (et ValueType) String() string {
+ switch et {
case ValNone:
return ""
case ValScalar:
diff --git a/vendor/github.com/prometheus/otlptranslator/README.md b/vendor/github.com/prometheus/otlptranslator/README.md
index 3b31a448ec..b09484e274 100644
--- a/vendor/github.com/prometheus/otlptranslator/README.md
+++ b/vendor/github.com/prometheus/otlptranslator/README.md
@@ -1,2 +1,120 @@
-# otlp-prometheus-translator
-Library providing API to convert OTLP metric and attribute names to respectively Prometheus metric and label names.
+# OTLP Prometheus Translator
+
+A Go library for converting [OpenTelemetry Protocol (OTLP)](https://opentelemetry.io/docs/specs/otlp/) metric and attribute names to [Prometheus](https://prometheus.io/)-compliant formats.
+
+Part of the [Prometheus](https://prometheus.io/) ecosystem, following the [OpenTelemetry to Prometheus compatibility specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/prometheus_and_openmetrics.md).
+
+## Features
+
+- **Metric Name and Label Translation**: Convert OTLP metric names and attributes to Prometheus-compliant format
+- **Unit Handling**: Translate OTLP units to Prometheus unit conventions
+- **Type-Aware Suffixes**: Optionally append `_total`, `_ratio` based on metric type
+- **Namespace Support**: Add configurable namespace prefixes
+- **UTF-8 Support**: Choose between Prometheus legacy scheme compliant metric/label names (`[a-zA-Z0-9:_]`) or untranslated metric/label names
+- **Translation Strategy Configuration**: Select a translation strategy with a standard set of strings.
+
+## Installation
+
+```bash
+go get github.com/prometheus/otlptranslator
+```
+
+## Quick Start
+
+```go
+package main
+
+import (
+ "fmt"
+ "github.com/prometheus/otlptranslator"
+)
+
+func main() {
+ // Create a metric namer using traditional Prometheus name translation, with suffixes added and UTF-8 disallowed.
+ strategy := otlptranslator.UnderscoreEscapingWithSuffixes
+ namer := otlptranslator.NewMetricNamer("myapp", strategy)
+
+ // Translate OTLP metric to Prometheus format
+ metric := otlptranslator.Metric{
+ Name: "http.server.request.duration",
+ Unit: "s",
+ Type: otlptranslator.MetricTypeHistogram,
+ }
+ fmt.Println(namer.Build(metric)) // Output: myapp_http_server_request_duration_seconds
+
+ // Translate label names
+ labelNamer := otlptranslator.LabelNamer{UTF8Allowed: false}
+ fmt.Println(labelNamer.Build("http.method")) // Output: http_method
+}
+```
+
+## Usage Examples
+
+### Metric Name Translation
+
+```go
+namer := otlptranslator.MetricNamer{WithMetricSuffixes: true, UTF8Allowed: false}
+
+// Counter gets _total suffix
+counter := otlptranslator.Metric{
+ Name: "requests.count", Unit: "1", Type: otlptranslator.MetricTypeMonotonicCounter,
+}
+fmt.Println(namer.Build(counter)) // requests_count_total
+
+// Gauge with unit conversion
+gauge := otlptranslator.Metric{
+ Name: "memory.usage", Unit: "By", Type: otlptranslator.MetricTypeGauge,
+}
+fmt.Println(namer.Build(gauge)) // memory_usage_bytes
+
+// Dimensionless gauge gets _ratio suffix
+ratio := otlptranslator.Metric{
+ Name: "cpu.utilization", Unit: "1", Type: otlptranslator.MetricTypeGauge,
+}
+fmt.Println(namer.Build(ratio)) // cpu_utilization_ratio
+```
+
+### Label Translation
+
+```go
+labelNamer := otlptranslator.LabelNamer{UTF8Allowed: false}
+
+labelNamer.Build("http.method") // http_method
+labelNamer.Build("123invalid") // key_123invalid
+labelNamer.Build("_private") // key_private
+labelNamer.Build("__reserved__") // __reserved__ (preserved)
+labelNamer.Build("label@with$symbols") // label_with_symbols
+```
+
+### Unit Translation
+
+```go
+unitNamer := otlptranslator.UnitNamer{UTF8Allowed: false}
+
+unitNamer.Build("s") // seconds
+unitNamer.Build("By") // bytes
+unitNamer.Build("requests/s") // requests_per_second
+unitNamer.Build("1") // "" (dimensionless)
+```
+
+### Configuration Options
+
+```go
+// Prometheus-compliant mode - supports [a-zA-Z0-9:_]
+compliantNamer := otlptranslator.MetricNamer{UTF8Allowed: false, WithMetricSuffixes: true}
+
+// Transparent pass-through mode, aka "NoTranslation"
+utf8Namer := otlptranslator.MetricNamer{UTF8Allowed: true, WithMetricSuffixes: false}
+utf8Namer = otlptranslator.NewMetricNamer("", otlpTranslator.NoTranslation)
+
+// With namespace and suffixes
+productionNamer := otlptranslator.MetricNamer{
+ Namespace: "myservice",
+ WithMetricSuffixes: true,
+ UTF8Allowed: false,
+}
+```
+
+## License
+
+Licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
diff --git a/vendor/github.com/prometheus/otlptranslator/doc.go b/vendor/github.com/prometheus/otlptranslator/doc.go
new file mode 100644
index 0000000000..a704d81904
--- /dev/null
+++ b/vendor/github.com/prometheus/otlptranslator/doc.go
@@ -0,0 +1,24 @@
+// Copyright 2025 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package otlptranslator provides utilities for converting OpenTelemetry Protocol (OTLP)
+// metric and attribute names to Prometheus-compliant formats.
+//
+// This package is designed to help users translate OpenTelemetry metrics to Prometheus
+// metrics while following the official OpenTelemetry to Prometheus compatibility specification.
+//
+// Main components:
+// - MetricNamer: Translates OTLP metric names to Prometheus metric names
+// - LabelNamer: Translates OTLP attribute names to Prometheus label names
+// - UnitNamer: Translates OTLP units to Prometheus unit conventions
+package otlptranslator
diff --git a/vendor/github.com/prometheus/otlptranslator/label_namer.go b/vendor/github.com/prometheus/otlptranslator/label_namer.go
new file mode 100644
index 0000000000..00072a39e8
--- /dev/null
+++ b/vendor/github.com/prometheus/otlptranslator/label_namer.go
@@ -0,0 +1,90 @@
+// Copyright 2025 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// Provenance-includes-location: https://github.com/prometheus/prometheus/blob/93e991ef7ed19cc997a9360c8016cac3767b8057/storage/remote/otlptranslator/prometheus/normalize_label.go
+// Provenance-includes-license: Apache-2.0
+// Provenance-includes-copyright: Copyright The Prometheus Authors
+// Provenance-includes-location: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/95e8f8fdc2a9dc87230406c9a3cf02be4fd68bea/pkg/translator/prometheus/normalize_label.go
+// Provenance-includes-license: Apache-2.0
+// Provenance-includes-copyright: Copyright The OpenTelemetry Authors.
+
+package otlptranslator
+
+import (
+ "fmt"
+ "strings"
+ "unicode"
+)
+
+// LabelNamer is a helper struct to build label names.
+// It translates OpenTelemetry Protocol (OTLP) attribute names to Prometheus-compliant label names.
+//
+// Example usage:
+//
+// namer := LabelNamer{UTF8Allowed: false}
+// result := namer.Build("http.method") // "http_method"
+type LabelNamer struct {
+ UTF8Allowed bool
+}
+
+// Build normalizes the specified label to follow Prometheus label names standard.
+//
+// Translation rules:
+// - Replaces invalid characters with underscores
+// - Prefixes labels with invalid start characters (numbers or `_`) with "key"
+// - Preserves double underscore labels (reserved names)
+// - If UTF8Allowed is true, returns label as-is
+//
+// Examples:
+//
+// namer := LabelNamer{UTF8Allowed: false}
+// namer.Build("http.method") // "http_method"
+// namer.Build("123invalid") // "key_123invalid"
+// namer.Build("__reserved__") // "__reserved__" (preserved)
+func (ln *LabelNamer) Build(label string) (normalizedName string, err error) {
+ defer func() {
+ if len(normalizedName) == 0 {
+ err = fmt.Errorf("normalization for label name %q resulted in empty name", label)
+ return
+ }
+
+ if ln.UTF8Allowed || normalizedName == label {
+ return
+ }
+
+ // Check that the resulting normalized name contains at least one non-underscore character
+ for _, c := range normalizedName {
+ if c != '_' {
+ return
+ }
+ }
+ err = fmt.Errorf("normalization for label name %q resulted in invalid name %q", label, normalizedName)
+ normalizedName = ""
+ }()
+
+ // Trivial case.
+ if len(label) == 0 || ln.UTF8Allowed {
+ normalizedName = label
+ return
+ }
+
+ normalizedName = sanitizeLabelName(label)
+
+ // If label starts with a number, prepend with "key_".
+ if unicode.IsDigit(rune(normalizedName[0])) {
+ normalizedName = "key_" + normalizedName
+ } else if strings.HasPrefix(normalizedName, "_") && !strings.HasPrefix(normalizedName, "__") {
+ normalizedName = "key" + normalizedName
+ }
+
+ return
+}
diff --git a/vendor/github.com/prometheus/otlptranslator/metric_namer.go b/vendor/github.com/prometheus/otlptranslator/metric_namer.go
index 58d68ba986..79e005f689 100644
--- a/vendor/github.com/prometheus/otlptranslator/metric_namer.go
+++ b/vendor/github.com/prometheus/otlptranslator/metric_namer.go
@@ -20,6 +20,7 @@
package otlptranslator
import (
+ "fmt"
"slices"
"strings"
"unicode"
@@ -81,13 +82,48 @@ var perUnitMap = map[string]string{
}
// MetricNamer is a helper struct to build metric names.
+// It converts OpenTelemetry Protocol (OTLP) metric names to Prometheus-compliant metric names.
+//
+// Example usage:
+//
+// namer := MetricNamer{
+// WithMetricSuffixes: true,
+// UTF8Allowed: false,
+// }
+//
+// metric := Metric{
+// Name: "http.server.duration",
+// Unit: "s",
+// Type: MetricTypeHistogram,
+// }
+//
+// result := namer.Build(metric) // "http_server_duration_seconds"
type MetricNamer struct {
Namespace string
WithMetricSuffixes bool
UTF8Allowed bool
}
+// NewMetricNamer creates a MetricNamer with the specified namespace (can be
+// blank) and the requested Translation Strategy.
+func NewMetricNamer(namespace string, strategy TranslationStrategyOption) MetricNamer {
+ return MetricNamer{
+ Namespace: namespace,
+ WithMetricSuffixes: strategy.ShouldAddSuffixes(),
+ UTF8Allowed: !strategy.ShouldEscape(),
+ }
+}
+
// Metric is a helper struct that holds information about a metric.
+// It represents an OpenTelemetry metric with its name, unit, and type.
+//
+// Example:
+//
+// metric := Metric{
+// Name: "http.server.request.duration",
+// Unit: "s",
+// Type: MetricTypeHistogram,
+// }
type Metric struct {
Name string
Unit string
@@ -96,34 +132,70 @@ type Metric struct {
// Build builds a metric name for the specified metric.
//
-// If UTF8Allowed is true, the metric name is returned as is, only with the addition of type/unit suffixes and namespace preffix if required.
-// Otherwise the metric name is normalized to be Prometheus-compliant.
-// See rules at https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels,
-// https://prometheus.io/docs/practices/naming/#metric-and-label-naming
-func (mn *MetricNamer) Build(metric Metric) string {
+// The method applies different transformations based on the MetricNamer configuration:
+// - If UTF8Allowed is true, doesn't translate names - all characters must be valid UTF-8, however.
+// - If UTF8Allowed is false, translates metric names to comply with legacy Prometheus name scheme by escaping invalid characters to `_`.
+// - If WithMetricSuffixes is true, adds appropriate suffixes based on type and unit.
+//
+// See rules at https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels
+//
+// Examples:
+//
+// namer := MetricNamer{WithMetricSuffixes: true, UTF8Allowed: false}
+//
+// // Counter gets _total suffix
+// counter := Metric{Name: "requests.count", Unit: "1", Type: MetricTypeMonotonicCounter}
+// result := namer.Build(counter) // "requests_count_total"
+//
+// // Gauge with unit suffix
+// gauge := Metric{Name: "memory.usage", Unit: "By", Type: MetricTypeGauge}
+// result = namer.Build(gauge) // "memory_usage_bytes"
+func (mn *MetricNamer) Build(metric Metric) (string, error) {
if mn.UTF8Allowed {
return mn.buildMetricName(metric.Name, metric.Unit, metric.Type)
}
return mn.buildCompliantMetricName(metric.Name, metric.Unit, metric.Type)
}
-func (mn *MetricNamer) buildCompliantMetricName(name, unit string, metricType MetricType) string {
+func (mn *MetricNamer) buildCompliantMetricName(name, unit string, metricType MetricType) (normalizedName string, err error) {
+ defer func() {
+ if len(normalizedName) == 0 {
+ err = fmt.Errorf("normalization for metric %q resulted in empty name", name)
+ return
+ }
+
+ if normalizedName == name {
+ return
+ }
+
+ // Check that the resulting normalized name contains at least one non-underscore character
+ for _, c := range normalizedName {
+ if c != '_' {
+ return
+ }
+ }
+ err = fmt.Errorf("normalization for metric %q resulted in invalid name %q", name, normalizedName)
+ normalizedName = ""
+ }()
+
// Full normalization following standard Prometheus naming conventions
if mn.WithMetricSuffixes {
- return normalizeName(name, unit, metricType, mn.Namespace)
+ normalizedName = normalizeName(name, unit, metricType, mn.Namespace)
+ return
}
// Simple case (no full normalization, no units, etc.).
metricName := strings.Join(strings.FieldsFunc(name, func(r rune) bool {
- return invalidMetricCharRE.MatchString(string(r))
+ return !isValidCompliantMetricChar(r) && r != '_'
}), "_")
// Namespace?
if mn.Namespace != "" {
namespace := strings.Join(strings.FieldsFunc(mn.Namespace, func(r rune) bool {
- return invalidMetricCharRE.MatchString(string(r))
+ return !isValidCompliantMetricChar(r) && r != '_'
}), "_")
- return namespace + "_" + metricName
+ normalizedName = namespace + "_" + metricName
+ return
}
// Metric name starts with a digit? Prefix it with an underscore.
@@ -131,14 +203,11 @@ func (mn *MetricNamer) buildCompliantMetricName(name, unit string, metricType Me
metricName = "_" + metricName
}
- return metricName
+ normalizedName = metricName
+ return
}
-var (
- // Regexp for metric name characters that should be replaced with _.
- invalidMetricCharRE = regexp.MustCompile(`[^a-zA-Z0-9:_]`)
- multipleUnderscoresRE = regexp.MustCompile(`__+`)
-)
+var multipleUnderscoresRE = regexp.MustCompile(`__+`)
// isValidCompliantMetricChar checks if a rune is a valid metric name character (a-z, A-Z, 0-9, :).
func isValidCompliantMetricChar(r rune) bool {
@@ -243,33 +312,54 @@ func removeItem(slice []string, value string) []string {
return newSlice
}
-func (mn *MetricNamer) buildMetricName(name, unit string, metricType MetricType) string {
+func (mn *MetricNamer) buildMetricName(inputName, unit string, metricType MetricType) (name string, err error) {
+ name = inputName
if mn.Namespace != "" {
name = mn.Namespace + "_" + name
}
if mn.WithMetricSuffixes {
- mainUnitSuffix, perUnitSuffix := buildUnitSuffixes(unit)
- if mainUnitSuffix != "" {
- name = name + "_" + mainUnitSuffix
- }
- if perUnitSuffix != "" {
- name = name + "_" + perUnitSuffix
- }
-
- // Append _total for Counters
- if metricType == MetricTypeMonotonicCounter {
- name += "_total"
- }
-
// Append _ratio for metrics with unit "1"
// Some OTel receivers improperly use unit "1" for counters of objects
// See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aissue+some+metric+units+don%27t+follow+otel+semantic+conventions
// Until these issues have been fixed, we're appending `_ratio` for gauges ONLY
// Theoretically, counters could be ratios as well, but it's absurd (for mathematical reasons)
if unit == "1" && metricType == MetricTypeGauge {
- name += "_ratio"
+ name = trimSuffixAndDelimiter(name, "ratio")
+ defer func() {
+ name += "_ratio"
+ }()
}
+
+ // Append _total for Counters.
+ if metricType == MetricTypeMonotonicCounter {
+ name = trimSuffixAndDelimiter(name, "total")
+ defer func() {
+ name += "_total"
+ }()
+ }
+
+ mainUnitSuffix, perUnitSuffix := buildUnitSuffixes(unit)
+ if perUnitSuffix != "" {
+ name = trimSuffixAndDelimiter(name, perUnitSuffix)
+ defer func() {
+ name = name + "_" + perUnitSuffix
+ }()
+ }
+ // We don't need to trim and re-append the suffix here because this is
+ // the inner-most suffix.
+ if mainUnitSuffix != "" && !strings.HasSuffix(name, mainUnitSuffix) {
+ name = name + "_" + mainUnitSuffix
+ }
+ }
+ return
+}
+
+// trimSuffixAndDelimiter trims a suffix, plus one extra character which is
+// assumed to be a delimiter.
+func trimSuffixAndDelimiter(name, suffix string) string {
+ if strings.HasSuffix(name, suffix) && len(name) > len(suffix)+1 {
+ return name[:len(name)-(len(suffix)+1)]
}
return name
}
diff --git a/vendor/github.com/prometheus/otlptranslator/normalize_label.go b/vendor/github.com/prometheus/otlptranslator/normalize_label.go
deleted file mode 100644
index aa771f7840..0000000000
--- a/vendor/github.com/prometheus/otlptranslator/normalize_label.go
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2025 The Prometheus Authors
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// Provenance-includes-location: https://github.com/prometheus/prometheus/blob/93e991ef7ed19cc997a9360c8016cac3767b8057/storage/remote/otlptranslator/prometheus/normalize_label.go
-// Provenance-includes-license: Apache-2.0
-// Provenance-includes-copyright: Copyright The Prometheus Authors
-// Provenance-includes-location: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/95e8f8fdc2a9dc87230406c9a3cf02be4fd68bea/pkg/translator/prometheus/normalize_label.go
-// Provenance-includes-license: Apache-2.0
-// Provenance-includes-copyright: Copyright The OpenTelemetry Authors.
-
-package otlptranslator
-
-import (
- "strings"
- "unicode"
-)
-
-// LabelNamer is a helper struct to build label names.
-type LabelNamer struct {
- UTF8Allowed bool
-}
-
-// Build normalizes the specified label to follow Prometheus label names standard.
-//
-// See rules at https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels.
-//
-// Labels that start with non-letter rune will be prefixed with "key_".
-// An exception is made for double-underscores which are allowed.
-//
-// If UTF8Allowed is true, the label is returned as is. This option is provided just to
-// keep a consistent interface with the MetricNamer.
-func (ln *LabelNamer) Build(label string) string {
- // Trivial case.
- if len(label) == 0 || ln.UTF8Allowed {
- return label
- }
-
- label = sanitizeLabelName(label)
-
- // If label starts with a number, prepend with "key_".
- if unicode.IsDigit(rune(label[0])) {
- label = "key_" + label
- } else if strings.HasPrefix(label, "_") && !strings.HasPrefix(label, "__") {
- label = "key" + label
- }
-
- return label
-}
diff --git a/vendor/github.com/prometheus/otlptranslator/strategy.go b/vendor/github.com/prometheus/otlptranslator/strategy.go
new file mode 100644
index 0000000000..20fe019750
--- /dev/null
+++ b/vendor/github.com/prometheus/otlptranslator/strategy.go
@@ -0,0 +1,86 @@
+// Copyright 2025 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// Provenance-includes-location: https://github.com/prometheus/prometheus/blob/3602785a89162ccc99a940fb9d862219a2d02241/config/config.go
+// Provenance-includes-license: Apache-2.0
+// Provenance-includes-copyright: Copyright The Prometheus Authors
+
+package otlptranslator
+
+// TranslationStrategyOption is a constant that defines how metric and label
+// names should be handled during translation. The recommended approach is to
+// use either UnderscoreEscapingWithSuffixes for full Prometheus-style
+// compatibility, or NoTranslation for Otel-style names.
+type TranslationStrategyOption string
+
+var (
+ // NoUTF8EscapingWithSuffixes will accept metric/label names as they are. Unit
+ // and type suffixes may be added to metric names, according to certain rules.
+ NoUTF8EscapingWithSuffixes TranslationStrategyOption = "NoUTF8EscapingWithSuffixes"
+ // UnderscoreEscapingWithSuffixes is the default option for translating OTLP
+ // to Prometheus. This option will translate metric name characters that are
+ // not alphanumerics/underscores/colons to underscores, and label name
+ // characters that are not alphanumerics/underscores to underscores. Unit and
+ // type suffixes may be appended to metric names, according to certain rules.
+ UnderscoreEscapingWithSuffixes TranslationStrategyOption = "UnderscoreEscapingWithSuffixes"
+ // UnderscoreEscapingWithoutSuffixes translates metric name characters that
+ // are not alphanumerics/underscores/colons to underscores, and label name
+ // characters that are not alphanumerics/underscores to underscores, but
+ // unlike UnderscoreEscapingWithSuffixes it does not append any suffixes to
+ // the names.
+ UnderscoreEscapingWithoutSuffixes TranslationStrategyOption = "UnderscoreEscapingWithoutSuffixes"
+ // NoTranslation (EXPERIMENTAL): disables all translation of incoming metric
+ // and label names. This offers a way for the OTLP users to use native metric
+ // names, reducing confusion.
+ //
+ // WARNING: This setting has significant known risks and limitations (see
+ // https://prometheus.io/docs/practices/naming/ for details): * Impaired UX
+ // when using PromQL in plain YAML (e.g. alerts, rules, dashboard, autoscaling
+ // configuration). * Series collisions which in the best case may result in
+ // OOO errors, in the worst case a silently malformed time series. For
+ // instance, you may end up in situation of ingesting `foo.bar` series with
+ // unit `seconds` and a separate series `foo.bar` with unit `milliseconds`.
+ //
+ // As a result, this setting is experimental and currently, should not be used
+ // in production systems.
+ //
+ // TODO(ArthurSens): Mention `type-and-unit-labels` feature
+ // (https://github.com/prometheus/proposals/pull/39) once released, as
+ // potential mitigation of the above risks.
+ NoTranslation TranslationStrategyOption = "NoTranslation"
+)
+
+// ShouldEscape returns true if the translation strategy requires that metric
+// names be escaped.
+func (o TranslationStrategyOption) ShouldEscape() bool {
+ switch o {
+ case UnderscoreEscapingWithSuffixes, UnderscoreEscapingWithoutSuffixes:
+ return true
+ case NoTranslation, NoUTF8EscapingWithSuffixes:
+ return false
+ default:
+ return false
+ }
+}
+
+// ShouldAddSuffixes returns a bool deciding whether the given translation
+// strategy should have suffixes added.
+func (o TranslationStrategyOption) ShouldAddSuffixes() bool {
+ switch o {
+ case UnderscoreEscapingWithSuffixes, NoUTF8EscapingWithSuffixes:
+ return true
+ case UnderscoreEscapingWithoutSuffixes, NoTranslation:
+ return false
+ default:
+ return false
+ }
+}
diff --git a/vendor/github.com/prometheus/otlptranslator/unit_namer.go b/vendor/github.com/prometheus/otlptranslator/unit_namer.go
index 4bbf93ef97..bb41fa89e5 100644
--- a/vendor/github.com/prometheus/otlptranslator/unit_namer.go
+++ b/vendor/github.com/prometheus/otlptranslator/unit_namer.go
@@ -15,14 +15,34 @@ package otlptranslator
import "strings"
// UnitNamer is a helper for building compliant unit names.
+// It processes OpenTelemetry Protocol (OTLP) unit strings and converts them
+// to Prometheus-compliant unit names.
+//
+// Example usage:
+//
+// namer := UnitNamer{UTF8Allowed: false}
+// result := namer.Build("s") // "seconds"
+// result = namer.Build("By/s") // "bytes_per_second"
type UnitNamer struct {
UTF8Allowed bool
}
// Build builds a unit name for the specified unit string.
// It processes the unit by splitting it into main and per components,
-// applying appropriate unit mappings, and cleaning up invalid characters
-// when the whole UTF-8 character set is not allowed.
+// applying unit mappings, and cleaning up invalid characters when UTF8Allowed is false.
+//
+// Unit mappings include:
+// - Time: s→seconds, ms→milliseconds, h→hours
+// - Bytes: By→bytes, KBy→kilobytes, MBy→megabytes
+// - SI: m→meters, V→volts, W→watts
+// - Special: 1→"" (empty), %→percent
+//
+// Examples:
+//
+// namer := UnitNamer{UTF8Allowed: false}
+// namer.Build("s") // "seconds"
+// namer.Build("requests/s") // "requests_per_second"
+// namer.Build("1") // "" (dimensionless)
func (un *UnitNamer) Build(unit string) string {
mainUnit, perUnit := buildUnitSuffixes(unit)
if !un.UTF8Allowed {
diff --git a/vendor/github.com/samber/lo/.golangci.yml b/vendor/github.com/samber/lo/.golangci.yml
new file mode 100644
index 0000000000..2a71979cba
--- /dev/null
+++ b/vendor/github.com/samber/lo/.golangci.yml
@@ -0,0 +1,104 @@
+version: "2"
+run:
+ concurrency: 4
+ # also lint _test.go files
+ tests: true
+ timeout: 5m
+linters:
+ enable:
+ - govet
+ - staticcheck
+ - unused
+ - errcheck
+ - gocritic
+ - gocyclo
+ - revive
+ - ineffassign
+ - unconvert
+ - goconst
+ # - depguard
+ - prealloc
+ # - dupl
+ - misspell
+ - bodyclose
+ - sqlclosecheck
+ - nilerr
+ - nestif
+ - forcetypeassert
+ - exhaustive
+ - funlen
+ # - wsl_v5
+ - testifylint
+ - whitespace
+ - perfsprint
+ - nolintlint
+ - godot
+ - thelper
+ - tparallel
+ - paralleltest
+ - predeclared
+
+ # disable noisy/controversial ones which you might enable later
+ disable:
+ - lll # line length — handled by gfmt/gofumpt
+
+ settings:
+ dupl:
+ threshold: 20 # lower => stricter (tokens)
+ errcheck:
+ check-type-assertions: true
+ funlen:
+ lines: 120
+ statements: 80
+ goconst:
+ min-len: 2
+ min-occurrences: 3
+ gocyclo:
+ min-complexity: 15 # strict; lower => stricter
+ wsl_v5:
+ allow-first-in-block: true
+ allow-whole-block: false
+ branch-max-lines: 2
+ testifylint:
+ disable:
+ - require-error
+ - float-compare
+
+ exclusions:
+ generated: lax
+ paths:
+ - examples$
+ rules:
+ - linters:
+ - revive
+ text: "^unused-parameter:"
+ - linters:
+ - revive
+ text: "^package-comments:"
+ - linters:
+ - errcheck
+ text: "Error return value of `.*\\.Body\\.Close` is not checked"
+ # linters disabled in tests
+ - linters:
+ - dupl
+ - goconst
+ - funlen
+ path: "_test\\.go$"
+
+issues:
+ max-issues-per-linter: 0 # 0 = unlimited (we want ALL issues)
+ max-same-issues: 100
+
+formatters:
+ enable:
+ - gofmt
+ - gofumpt
+ settings:
+ gofumpt:
+ extra-rules: true
+ exclusions:
+ generated: lax
+ paths:
+ - third_party$
+ - builtin$
+ - examples$
diff --git a/vendor/github.com/samber/lo/Makefile b/vendor/github.com/samber/lo/Makefile
index f97ded85e7..5a6591d164 100644
--- a/vendor/github.com/samber/lo/Makefile
+++ b/vendor/github.com/samber/lo/Makefile
@@ -3,20 +3,19 @@ build:
go build -v ./...
test:
- go test -race -v ./...
+ go test -race ./...
watch-test:
- reflex -t 50ms -s -- sh -c 'gotest -race -v ./...'
+ reflex -t 50ms -s -- sh -c 'gotest -race ./...'
bench:
- go test -benchmem -count 3 -bench ./...
+ go test -v -run=^Benchmark -benchmem -count 3 -bench ./...
watch-bench:
- reflex -t 50ms -s -- sh -c 'go test -benchmem -count 3 -bench ./...'
+ reflex -t 50ms -s -- sh -c 'go test -v -run=^Benchmark -benchmem -count 3 -bench ./...'
coverage:
go test -v -coverprofile=cover.out -covermode=atomic ./...
go tool cover -html=cover.out -o cover.html
-# tools
tools:
go install github.com/cespare/reflex@latest
go install github.com/rakyll/gotest@latest
@@ -25,18 +24,27 @@ tools:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
go get -t -u golang.org/x/tools/cmd/cover
go install github.com/sonatype-nexus-community/nancy@latest
+ go install golang.org/x/perf/cmd/benchstat@latest
+ go install github.com/cespare/prettybench@latest
go mod tidy
+ # brew install hougesen/tap/mdsf
+
lint:
golangci-lint run --timeout 60s --max-same-issues 50 ./...
+ # mdsf verify --debug --log-level warn docs/
lint-fix:
golangci-lint run --timeout 60s --max-same-issues 50 --fix ./...
+ # mdsf format --debug --log-level warn docs/
-audit: tools
+audit:
go list -json -m all | nancy sleuth
-outdated: tools
+outdated:
go list -u -m -json all | go-mod-outdated -update -direct
-weight: tools
+weight:
goweight
+
+doc:
+ cd docs && npm install && npm start
diff --git a/vendor/github.com/samber/lo/README.md b/vendor/github.com/samber/lo/README.md
index 87d25509f8..7a4ee33f3a 100644
--- a/vendor/github.com/samber/lo/README.md
+++ b/vendor/github.com/samber/lo/README.md
@@ -21,6 +21,18 @@ A utility library based on Go 1.18+ generics that makes it easier to work with s
- [samber/do](https://github.com/samber/do): A dependency injection toolkit based on Go 1.18+ Generics
- [samber/mo](https://github.com/samber/mo): Monads based on Go 1.18+ Generics (Option, Result, Either...)
+----
+
+💖 Support This Project
+
+
+ I’m going all-in on open-source for the coming months.
+
+ Help sustain development: Become an individual sponsor or join as a corporate sponsor.
+
+
+----
+
**Why this name?**
I wanted a **short name**, similar to "Lodash", and no Go package uses this name.
@@ -48,6 +60,7 @@ import (
"github.com/samber/lo"
lop "github.com/samber/lo/parallel"
lom "github.com/samber/lo/mutable"
+ loi "github.com/samber/lo/it"
)
```
@@ -68,11 +81,13 @@ import (
)
```
-I take no responsibility on this junk. 😁 💩
+I take no responsibility for this junk. 😁 💩
## 🤠 Spec
-GoDoc: [https://godoc.org/github.com/samber/lo](https://godoc.org/github.com/samber/lo)
+GoDoc: [godoc.org/github.com/samber/lo](https://godoc.org/github.com/samber/lo)
+
+Documentation: [lo.samber.dev](https://lo.samber.dev/docs/about)
Supported helpers for slices:
@@ -123,6 +138,14 @@ Supported helpers for slices:
- [IsSorted](#issorted)
- [IsSortedByKey](#issortedbykey)
- [Splice](#Splice)
+- [Cut](#Cut)
+- [CutPrefix](#CutPrefix)
+- [CutSuffix](#CutSuffix)
+- [Trim](#Trim)
+- [TrimLeft](#TrimLeft)
+- [TrimPrefix](#TrimPrefix)
+- [TrimRight](#TrimRight)
+- [TrimSuffix](#TrimSuffix)
Supported helpers for maps:
@@ -142,11 +165,14 @@ Supported helpers for maps:
- [FromEntries / FromPairs](#fromentries-alias-frompairs)
- [Invert](#invert)
- [Assign (merge of maps)](#assign)
+- [ChunkEntries](#chunkentries)
- [MapKeys](#mapkeys)
- [MapValues](#mapvalues)
- [MapEntries](#mapentries)
- [MapToSlice](#maptoslice)
- [FilterMapToSlice](#FilterMapToSlice)
+- [FilterKeys](#FilterKeys)
+- [FilterValues](#FilterValues)
Supported math helpers:
@@ -158,6 +184,7 @@ Supported math helpers:
- [ProductBy](#productby)
- [Mean](#mean)
- [MeanBy](#meanby)
+- [Mode](#mode)
Supported helpers for strings:
@@ -193,6 +220,7 @@ Supported helpers for channels:
- [ChannelDispatcher](#channeldispatcher)
- [SliceToChannel](#slicetochannel)
+- [ChannelToSlice](#channeltoslice)
- [Generator](#generator)
- [Buffer](#buffer)
- [BufferWithContext](#bufferwithcontext)
@@ -224,6 +252,8 @@ Supported search helpers:
- [IndexOf](#indexof)
- [LastIndexOf](#lastindexof)
+- [HasPrefix](#hasprefix)
+- [HasSuffix](#hassuffix)
- [Find](#find)
- [FindIndexOf](#findindexof)
- [FindLastIndexOf](#findlastindexof)
@@ -310,6 +340,7 @@ Concurrency helpers:
- [ThrottleByWithCount](#throttle)
- [Synchronize](#synchronize)
- [Async](#async)
+- [Async{0->6}](#async0-6)
- [Transaction](#transaction)
- [WaitFor](#waitfor)
- [WaitForWithContext](#waitforwithcontext)
@@ -335,7 +366,7 @@ Constraints:
### Filter
-Iterates over a collection and returns an array of all the elements the predicate function returns `true` for.
+Iterates over a collection and returns a slice of all the elements the predicate function returns `true` for.
```go
even := lo.Filter([]int{1, 2, 3, 4}, func(x int, index int) bool {
@@ -389,6 +420,8 @@ lop.Map([]int64{1, 2, 3, 4}, func(x int64, _ int) string {
// []string{"1", "2", "3", "4"}
```
+[[play](https://go.dev/play/p/sCJaB3quRMC)]
+
Mutable: like `lo.Map()`, but the slice is updated in place.
```go
@@ -401,6 +434,8 @@ lom.Map(list, func(x int) int {
// []int{2, 4, 6, 8}
```
+[[play](https://go.dev/play/p/0jY3Z0B7O_5)]
+
### UniqMap
Manipulates a slice and transforms it to a slice of another type with unique values.
@@ -418,9 +453,11 @@ names := lo.UniqMap(users, func(u User, index int) string {
// []string{"Alex", "Bob", "Alice"}
```
+[[play](https://go.dev/play/p/fygzLBhvUdB)]
+
### FilterMap
-Returns a slice which obtained after both filtering and mapping using the given callback function.
+Returns a slice obtained after both filtering and mapping using the given callback function.
The callback function should return two values: the result of the mapping operation and whether the result element should be included or not.
@@ -526,7 +563,7 @@ lo.ForEachWhile(list, func(x int64, _ int) bool {
### Times
-Times invokes the iteratee n times, returning an array of the results of each invocation. The iteratee is invoked with index as argument.
+Times invokes the iteratee n times, returning a slice of the results of each invocation. The iteratee is invoked with index as argument.
```go
import "github.com/samber/lo"
@@ -552,7 +589,7 @@ lop.Times(3, func(i int) string {
### Uniq
-Returns a duplicate-free version of an array, in which only the first occurrence of each element is kept. The order of result values is determined by the order they occur in the array.
+Returns a duplicate-free version of a slice, in which only the first occurrence of each element is kept. The order of result values is determined by the order they occur in the slice.
```go
uniqValues := lo.Uniq([]int{1, 2, 2, 1})
@@ -563,7 +600,7 @@ uniqValues := lo.Uniq([]int{1, 2, 2, 1})
### UniqBy
-Returns a duplicate-free version of an array, in which only the first occurrence of each element is kept. The order of result values is determined by the order they occur in the array. It accepts `iteratee` which is invoked for each element in array to generate the criterion by which uniqueness is computed.
+Returns a duplicate-free version of a slice, in which only the first occurrence of each element is kept. The order of result values is determined by the order they occur in the slice. It accepts `iteratee` which is invoked for each element in the slice to generate the criterion by which uniqueness is computed.
```go
uniqValues := lo.UniqBy([]int{0, 1, 2, 3, 4, 5}, func(i int) int {
@@ -613,9 +650,11 @@ groups := lo.GroupByMap([]int{0, 1, 2, 3, 4, 5}, func(i int) (int, int) {
// map[int][]int{0: []int{0, 6}, 1: []int{2, 8}, 2: []int{4, 10}}
```
+[[play](https://go.dev/play/p/iMeruQ3_W80)]
+
### Chunk
-Returns an array of elements split into groups the length of size. If array can't be split evenly, the final chunk will be the remaining elements.
+Returns a slice of elements split into groups of length size. If the slice can't be split evenly, the final chunk will be the remaining elements.
```go
lo.Chunk([]int{0, 1, 2, 3, 4, 5}, 2)
@@ -631,11 +670,11 @@ lo.Chunk([]int{0}, 2)
// [][]int{{0}}
```
-[[play](https://go.dev/play/p/EeKl0AuTehH)]
+[[play](https://go.dev/play/p/kEMkFbdu85g)]
### PartitionBy
-Returns an array of elements split into groups. The order of grouped values is determined by the order they occur in collection. The grouping is generated from the results of running each element of collection through iteratee.
+Returns a slice of elements split into groups. The order of grouped values is determined by the order they occur in collection. The grouping is generated from the results of running each element of collection through iteratee.
```go
import lo "github.com/samber/lo"
@@ -671,7 +710,7 @@ partitions := lop.PartitionBy([]int{-2, -1, 0, 1, 2, 3, 4, 5}, func(x int) strin
### Flatten
-Returns an array a single level deep.
+Returns a slice a single level deep.
```go
flat := lo.Flatten([][]int{{0, 1}, {2, 3, 4, 5}})
@@ -696,7 +735,7 @@ interleaved := lo.Interleave([]int{1}, []int{2, 5, 8}, []int{3, 6}, []int{4, 7,
### Shuffle
-Returns an array of shuffled values. Uses the Fisher-Yates shuffle algorithm.
+Returns a slice of shuffled values. Uses the Fisher-Yates shuffle algorithm.
⚠️ This helper is **mutable**.
@@ -714,7 +753,7 @@ list
### Reverse
-Reverses array so that the first element becomes the last, the second element becomes the second to last, and so on.
+Reverses a slice so that the first element becomes the last, the second element becomes the second to last, and so on.
⚠️ This helper is **mutable**.
@@ -732,7 +771,7 @@ list
### Fill
-Fills elements of array with `initial` value.
+Fills elements of a slice with `initial` value.
```go
type foo struct {
@@ -788,7 +827,7 @@ slice := lo.RepeatBy(5, func(i int) string {
### KeyBy
-Transforms a slice or an array of structs to a map based on a pivot callback.
+Transforms a slice or a slice of structs to a map based on a pivot callback.
```go
m := lo.KeyBy([]string{"a", "aa", "aaa"}, func(str string) int {
@@ -815,9 +854,9 @@ result := lo.KeyBy(characters, func(char Character) string {
### SliceToMap (alias: Associate)
Returns a map containing key-value pairs provided by transform function applied to elements of the given slice.
-If any of two pairs would have the same key the last one gets added to the map.
+If any of two pairs have the same key the last one gets added to the map.
-The order of keys in returned map is not specified and is not guaranteed to be the same from the original array.
+The order of keys in returned map is not specified and is not guaranteed to be the same from the original slice.
```go
in := []*foo{{baz: "apple", bar: 1}, {baz: "banana", bar: 2}}
@@ -834,13 +873,12 @@ aMap := lo.SliceToMap(in, func (f *foo) (string, int) {
Returns a map containing key-value pairs provided by transform function applied to elements of the given slice.
-If any of two pairs would have the same key the last one gets added to the map.
+If any of two pairs have the same key the last one gets added to the map.
-The order of keys in returned map is not specified and is not guaranteed to be the same from the original array.
+The order of keys in returned map is not specified and is not guaranteed to be the same from the original slice.
The third return value of the transform function is a boolean that indicates whether the key-value pair should be included in the map.
-
```go
list := []string{"a", "aa", "aaa"}
@@ -850,6 +888,8 @@ result := lo.FilterSliceToMap(list, func(str string) (string, int, bool) {
// map[string][int]{"aa":2 "aaa":3}
```
+[[play](https://go.dev/play/p/2z0rDz2ZSGU)]
+
### Keyify
Returns a map with each unique element of the slice as a key.
@@ -859,9 +899,11 @@ set := lo.Keyify([]int{1, 1, 2, 3, 4})
// map[int]struct{}{1:{}, 2:{}, 3:{}, 4:{}}
```
+[[play](https://go.dev/play/p/RYhhM_csqIG)]
+
### Drop
-Drops n elements from the beginning of a slice or array.
+Drops n elements from the beginning of a slice.
```go
l := lo.Drop([]int{0, 1, 2, 3, 4, 5}, 2)
@@ -872,7 +914,7 @@ l := lo.Drop([]int{0, 1, 2, 3, 4, 5}, 2)
### DropRight
-Drops n elements from the end of a slice or array.
+Drops n elements from the end of a slice.
```go
l := lo.DropRight([]int{0, 1, 2, 3, 4, 5}, 2)
@@ -883,7 +925,7 @@ l := lo.DropRight([]int{0, 1, 2, 3, 4, 5}, 2)
### DropWhile
-Drop elements from the beginning of a slice or array while the predicate returns true.
+Drop elements from the beginning of a slice while the predicate returns true.
```go
l := lo.DropWhile([]string{"a", "aa", "aaa", "aa", "aa"}, func(val string) bool {
@@ -896,7 +938,7 @@ l := lo.DropWhile([]string{"a", "aa", "aaa", "aa", "aa"}, func(val string) bool
### DropRightWhile
-Drop elements from the end of a slice or array while the predicate returns true.
+Drop elements from the end of a slice while the predicate returns true.
```go
l := lo.DropRightWhile([]string{"a", "aa", "aaa", "aa", "aa"}, func(val string) bool {
@@ -909,7 +951,7 @@ l := lo.DropRightWhile([]string{"a", "aa", "aaa", "aa", "aa"}, func(val string)
### DropByIndex
-Drops elements from a slice or array by the index. A negative index will drop elements from the end of the slice.
+Drops elements from a slice by the index. A negative index will drop elements from the end of the slice.
```go
l := lo.DropByIndex([]int{0, 1, 2, 3, 4, 5}, 2, 4, -1)
@@ -920,7 +962,7 @@ l := lo.DropByIndex([]int{0, 1, 2, 3, 4, 5}, 2, 4, -1)
### Reject
-The opposite of Filter, this method returns the elements of collection that predicate does not return truthy for.
+The opposite of Filter, this method returns the elements of collection that predicate does not return true for.
```go
odd := lo.Reject([]int{1, 2, 3, 4}, func(x int, _ int) bool {
@@ -933,7 +975,7 @@ odd := lo.Reject([]int{1, 2, 3, 4}, func(x int, _ int) bool {
### RejectMap
-The opposite of FilterMap, this method returns a slice which obtained after both filtering and mapping using the given callback function.
+The opposite of FilterMap, this method returns a slice obtained after both filtering and mapping using the given callback function.
The callback function should return two values:
@@ -949,7 +991,7 @@ items := lo.RejectMap([]int{1, 2, 3, 4}, func(x int, _ int) (int, bool) {
### FilterReject
-Mixes Filter and Reject, this method returns two slices, one for the elements of collection that predicate returns truthy for and one for the elements that predicate does not return truthy for.
+Mixes Filter and Reject, this method returns two slices, one for the elements of collection that predicate returns true for and one for the elements that predicate does not return true for.
```go
kept, rejected := lo.FilterReject([]int{1, 2, 3, 4}, func(x int, _ int) bool {
@@ -961,7 +1003,7 @@ kept, rejected := lo.FilterReject([]int{1, 2, 3, 4}, func(x int, _ int) bool {
### Count
-Counts the number of elements in the collection that compare equal to value.
+Counts the number of elements in the collection that equal value.
```go
count := lo.Count([]int{1, 5, 1}, 1)
@@ -1008,7 +1050,7 @@ lo.CountValues([]string{"foo", "bar", "bar"})
### CountValuesBy
-Counts the number of each element in the collection. It ss equivalent to chaining lo.Map and lo.CountValues.
+Counts the number of each element in the collection. It is equivalent to chaining lo.Map and lo.CountValues.
```go
isEven := func(v int) bool {
@@ -1170,7 +1212,140 @@ result = lo.Splice([]string{"a", "b"}, 42, "1", "2")
// []string{"a", "b", "1", "2"}
```
-[[play](https://go.dev/play/p/wiG6XyBBu49)]
+[[play](https://go.dev/play/p/G5_GhkeSUBA)]
+
+### Cut
+
+Slices collection around the first instance of separator, returning the part of collection before and after separator. The found result reports whether separator appears in collection. If separator does not appear in s, cut returns collection, empty slice of []T, false.
+
+```go
+actualLeft, actualRight, result = lo.Cut([]string{"a", "b", "c", "d", "e", "f", "g"}, []string{"b", "c", "d"})
+// actualLeft: []string{"a"}
+// actualRight: []string{"e", "f", "g"}
+// result: true
+
+result = lo.Cut([]string{"a", "b", "c", "d", "e", "f", "g"}, []string{"z"})
+// actualLeft: []string{"a", "b", "c", "d", "e", "f", "g"}
+// actualRight: []string{}
+// result: false
+
+result = lo.Cut([]string{"a", "b", "c", "d", "e", "f", "g"}, []string{"a", "b"})
+// actualLeft: []string{}
+// actualRight: []string{"c", "d", "e", "f", "g"}
+// result: true
+```
+
+[[play](https://go.dev/play/p/GiL3qhpIP3f)]
+
+### CutPrefix
+
+Returns collection without the provided leading prefix []T and reports whether it found the prefix. If s doesn't start with prefix, CutPrefix returns collection, false. If prefix is the empty []T, CutPrefix returns collection, true.
+
+```go
+actualRight, result = lo.CutPrefix([]string{"a", "b", "c", "d", "e", "f", "g"}, []string{"a", "b", "c"})
+// actualRight: []string{"d", "e", "f", "g"}
+// result: true
+
+result = lo.CutPrefix([]string{"a", "b", "c", "d", "e", "f", "g"}, []string{"b"})
+// actualRight: []string{"a", "b", "c", "d", "e", "f", "g"}
+// result: false
+
+result = lo.CutPrefix([]string{"a", "b", "c", "d", "e", "f", "g"}, []string{})
+// actualRight: []string{"a", "b", "c", "d", "e", "f", "g"}
+// result: true
+```
+
+[[play](https://go.dev/play/p/7Plak4a1ICl)]
+
+### CutSuffix
+
+Returns collection without the provided ending suffix []T and reports whether it found the suffix. If it doesn't end with suffix, CutSuffix returns collection, false. If suffix is the empty []T, CutSuffix returns collection, true.
+
+```go
+actualLeft, result = lo.CutSuffix([]string{"a", "b", "c", "d", "e", "f", "g"}, []string{"f", "g"})
+// actualLeft: []string{"a", "b", "c", "d", "e"}
+// result: true
+
+actualLeft, result = lo.CutSuffix([]string{"a", "b", "c", "d", "e", "f", "g"}, []string{"b"})
+// actualLeft: []string{"a", "b", "c", "d", "e", "f", "g"}
+// result: false
+
+actualLeft, result = lo.CutSuffix([]string{"a", "b", "c", "d", "e", "f", "g"}, []string{})
+// actualLeft: []string{"a", "b", "c", "d", "e", "f", "g"}
+// result: true
+```
+
+[[play](https://go.dev/play/p/7FKfBFvPTaT)]
+
+### Trim
+
+Removes all the leading and trailing cutset from the collection.
+
+```go
+result := lo.Trim([]int{0, 1, 2, 0, 3, 0}, []int{1, 0})
+// []int{2, 0, 3}
+
+result := lo.Trim([]string{"hello", "world", " "}, []string{" ", ""})
+// []string{"hello", "world"}
+```
+
+[[play](https://go.dev/play/p/1an9mxLdRG5)]
+
+### TrimLeft
+
+Removes all the leading cutset from the collection.
+
+```go
+result := lo.TrimLeft([]int{0, 1, 2, 0, 3, 0}, []int{1, 0})
+// []int{2, 0, 3, 0}
+
+result := lo.TrimLeft([]string{"hello", "world", " "}, []string{" ", ""})
+// []string{"hello", "world", " "}
+```
+
+[[play](https://go.dev/play/p/74aqfAYLmyi)]
+
+### TrimPrefix
+
+Removes all the leading prefix from the collection.
+
+```go
+result := lo.TrimPrefix([]int{1, 2, 1, 2, 3, 1, 2, 4}, []int{1, 2})
+// []int{3, 1, 2, 4}
+
+result := lo.TrimPrefix([]string{"hello", "world", "hello", "test"}, []string{"hello"})
+// []string{"world", "hello", "test"}
+```
+
+[[play](https://go.dev/play/p/SHO6X-YegPg)]
+
+### TrimRight
+
+Removes all the trailing cutset from the collection.
+
+```go
+result := lo.TrimRight([]int{0, 1, 2, 0, 3, 0}, []int{0, 3})
+// []int{0, 1, 2}
+
+result := lo.TrimRight([]string{"hello", "world", " "}, []string{" ", ""})
+// []string{"hello", "world", ""}
+```
+
+[[play](https://go.dev/play/p/MRpAfR6sf0g)]
+
+### TrimSuffix
+
+Removes all the trailing suffix from the collection.
+
+```go
+result := lo.TrimSuffix([]int{1, 2, 3, 1, 2, 4, 2, 4, 2, 4}, []int{2, 4})
+// []int{1, 2, 3, 1}
+
+result := lo.TrimSuffix([]string{"hello", "world", "hello", "test"}, []string{"test"})
+// []string{"hello", "world", "hello"}
+```
+
+[[play](https://go.dev/play/p/IjEUrV0iofq)]
### Keys
@@ -1193,7 +1368,7 @@ keys := lo.Keys(map[string]int{"foo": 1, "bar": 2}, map[string]int{"bar": 3})
### UniqKeys
-Creates an array of unique map keys.
+Creates a slice of unique map keys.
```go
keys := lo.UniqKeys(map[string]int{"foo": 1, "bar": 2}, map[string]int{"baz": 3})
@@ -1221,7 +1396,7 @@ exists := lo.HasKey(map[string]int{"foo": 1, "bar": 2}, "baz")
### Values
-Creates an array of the map values.
+Creates a slice of the map values.
Use the UniqValues variant to deduplicate common values.
@@ -1240,7 +1415,7 @@ values := lo.Values(map[string]int{"foo": 1, "bar": 2}, map[string]int{"bar": 2}
### UniqValues
-Creates an array of unique map values.
+Creates a slice of unique map values.
```go
values := lo.UniqValues(map[string]int{"foo": 1, "bar": 2})
@@ -1341,7 +1516,7 @@ m := lo.OmitByValues(map[string]int{"foo": 1, "bar": 2, "baz": 3}, []int{1, 3})
### Entries (alias: ToPairs)
-Transforms a map into array of key/value pairs.
+Transforms a map into a slice of key/value pairs.
```go
entries := lo.Entries(map[string]int{"foo": 1, "bar": 2})
@@ -1357,11 +1532,11 @@ entries := lo.Entries(map[string]int{"foo": 1, "bar": 2})
// }
```
-[[play](https://go.dev/play/p/3Dhgx46gawJ)]
+[[play](https://go.dev/play/p/_t4Xe34-Nl5)]
### FromEntries (alias: FromPairs)
-Transforms an array of key/value pairs into a map.
+Transforms a slice of key/value pairs into a map.
```go
m := lo.FromEntries([]lo.Entry[string, int]{
@@ -1409,7 +1584,7 @@ mergedMaps := lo.Assign(
### ChunkEntries
-Splits a map into an array of elements in groups of a length equal to its size. If the map cannot be split evenly, the final chunk will contain the remaining elements.
+Splits a map into a slice of elements in groups of length equal to its size. If the map cannot be split evenly, the final chunk will contain the remaining elements.
```go
maps := lo.ChunkEntries(
@@ -1431,7 +1606,7 @@ maps := lo.ChunkEntries(
### MapKeys
-Manipulates a map keys and transforms it to a map of another type.
+Manipulates map keys and transforms it to a map of another type.
```go
m2 := lo.MapKeys(map[int]int{1: 1, 2: 2, 3: 3, 4: 4}, func(_ int, v int) string {
@@ -1444,7 +1619,7 @@ m2 := lo.MapKeys(map[int]int{1: 1, 2: 2, 3: 3, 4: 4}, func(_ int, v int) string
### MapValues
-Manipulates a map values and transforms it to a map of another type.
+Manipulates map values and transforms it to a map of another type.
```go
m1 := map[int]int64{1: 1, 2: 2, 3: 3}
@@ -1459,7 +1634,7 @@ m2 := lo.MapValues(m1, func(x int64, _ int) string {
### MapEntries
-Manipulates a map entries and transforms it to a map of another type.
+Manipulates map entries and transforms it to a map of another type.
```go
in := map[string]int{"foo": 1, "bar": 2}
@@ -1474,7 +1649,7 @@ out := lo.MapEntries(in, func(k string, v int) (int, string) {
### MapToSlice
-Transforms a map into a slice based on specific iteratee.
+Transforms a map into a slice based on specified iteratee.
```go
m := map[int]int64{1: 4, 2: 5, 3: 6}
@@ -1489,7 +1664,7 @@ s := lo.MapToSlice(m, func(k int, v int64) string {
### FilterMapToSlice
-Transforms a map into a slice based on specific iteratee. The iteratee returns a value and a boolean. If the boolean is true, the value is added to the result slice.
+Transforms a map into a slice based on specified iteratee. The iteratee returns a value and a boolean. If the boolean is true, the value is added to the result slice.
If the boolean is false, the value is not added to the result slice. The order of the keys in the input map is not specified and the order of the keys in the output slice is not guaranteed.
@@ -1502,9 +1677,39 @@ result := lo.FilterMapToSlice(kv, func(k int, v int64) (string, bool) {
// []{"2_2", "4_4"}
```
+### FilterKeys
+
+Transforms a map into a slice based on predicate returns true for specific elements. It is a mix of `lo.Filter()` and `lo.Keys()`.
+
+```go
+kv := map[int]string{1: "foo", 2: "bar", 3: "baz"}
+
+result := FilterKeys(kv, func(k int, v string) bool {
+ return v == "foo"
+})
+// [1]
+```
+
+[[play](https://go.dev/play/p/OFlKXlPrBAe)]
+
+### FilterValues
+
+Transforms a map into a slice based on predicate returns true for specific elements. It is a mix of `lo.Filter()` and `lo.Values()`.
+
+```go
+kv := map[int]string{1: "foo", 2: "bar", 3: "baz"}
+
+result := FilterValues(kv, func(k int, v string) bool {
+ return v == "foo"
+})
+// ["foo"]
+```
+
+[[play](https://go.dev/play/p/YVD5r_h-LX-)]
+
### Range / RangeFrom / RangeWithSteps
-Creates an array of numbers (positive and/or negative) progressing from start up to, but not including end.
+Creates a slice of numbers (positive and/or negative) progressing from start up to, but not including end.
```go
result := lo.Range(4)
@@ -1645,6 +1850,30 @@ mean := lo.MeanBy([]float64{}, mapper)
// 0
```
+[[play](https://go.dev/play/p/j7TsVwBOZ7P)]
+
+### Mode
+
+Calculates the mode (most frequent value) of a collection of numbers.
+
+If multiple values have the same highest frequency, then multiple values are returned.
+
+If the collection is empty, the zero value of `T[]` is returned.
+
+```go
+mode := lo.Mode([]int{2, 2, 3, 4})
+// [2]
+
+mode := lo.Mode([]float64{2, 2, 3, 3})
+// [2, 3]
+
+mode := lo.Mode([]float64{})
+// []
+
+mode := lo.Mode([]int{1, 2, 3, 4, 5, 6, 7, 8, 9})
+// [1, 2, 3, 4, 5, 6, 7, 8, 9]
+```
+
### RandomString
Returns a random string of the specified length and made of the specified charset.
@@ -1675,7 +1904,7 @@ sub := lo.Substring("hello", -2, math.MaxUint)
### ChunkString
-Returns an array of strings split into groups the length of size. If array can't be split evenly, the final chunk will be the remaining elements.
+Returns a slice of strings split into groups of length size. If the string can't be split evenly, the final chunk will be the remaining characters.
```go
lo.ChunkString("123456", 2)
@@ -1716,7 +1945,7 @@ str := lo.PascalCase("hello_world")
// HelloWorld
```
-[[play](https://go.dev/play/p/iZkdeLP9oiB)]
+[[play](https://go.dev/play/p/Dy_V_6DUYhe)]
### CamelCase
@@ -1727,7 +1956,7 @@ str := lo.CamelCase("hello_world")
// helloWorld
```
-[[play](https://go.dev/play/p/dtyFB58MBRp)]
+[[play](https://go.dev/play/p/Go6aKwUiq59)]
### KebabCase
@@ -1738,7 +1967,7 @@ str := lo.KebabCase("helloWorld")
// hello-world
```
-[[play](https://go.dev/play/p/2YTuPafwECA)]
+[[play](https://go.dev/play/p/96gT_WZnTVP)]
### SnakeCase
@@ -1749,18 +1978,18 @@ str := lo.SnakeCase("HelloWorld")
// hello_world
```
-[[play](https://go.dev/play/p/QVKJG9nOnDg)]
+[[play](https://go.dev/play/p/ziB0V89IeVH)]
### Words
-Splits string into an array of its words.
+Splits string into a slice of its words.
```go
str := lo.Words("helloWorld")
// []string{"hello", "world"}
```
-[[play](https://go.dev/play/p/2P4zhqqq61g)]
+[[play](https://go.dev/play/p/-f3VIQqiaVw)]
### Capitalize
@@ -1771,9 +2000,11 @@ str := lo.Capitalize("heLLO")
// Hello
```
+[[play](https://go.dev/play/p/uLTZZQXqnsa)]
+
### Ellipsis
-Trims and truncates a string to a specified length **in bytes** and appends an ellipsis if truncated. If the string contains non-ASCII characters (which may occupy multiple bytes in UTF-8), truncating by byte length may split a character in the middle, potentially resulting in garbled output.
+Trims and truncates a string to a specified length in `bytes` and appends an ellipsis if truncated. If the string contains non-ASCII characters (which may occupy multiple bytes in UTF-8), truncating by byte length may split a character in the middle, potentially resulting in garbled output.
```go
str := lo.Ellipsis(" Lorem Ipsum ", 5)
@@ -1786,6 +2017,8 @@ str := lo.Ellipsis("Lorem Ipsum", 3)
// ...
```
+[[play](https://go.dev/play/p/qE93rgqe1TW)]
+
### T2 -> T9
Creates a tuple from a list of values.
@@ -1803,7 +2036,7 @@ tuple2 := lo.T2(example())
### Unpack2 -> Unpack9
-Returns values contained in tuple.
+Returns values contained in a tuple.
```go
r1, r2 := lo.Unpack2(lo.Tuple2[string, int]{"a", 1})
@@ -1822,9 +2055,9 @@ a, b := tuple2.Unpack()
### Zip2 -> Zip9
-Zip creates a slice of grouped elements, the first of which contains the first elements of the given arrays, the second of which contains the second elements of the given arrays, and so on.
+Zip creates a slice of grouped elements, the first of which contains the first elements of the given slices, the second of which contains the second elements of the given slices, and so on.
-When collections have different size, the Tuple attributes are filled with zero value.
+When collections are different sizes, the Tuple attributes are filled with zero value.
```go
tuples := lo.Zip2([]string{"a", "b"}, []int{1, 2})
@@ -1835,9 +2068,9 @@ tuples := lo.Zip2([]string{"a", "b"}, []int{1, 2})
### ZipBy2 -> ZipBy9
-ZipBy creates a slice of transformed elements, the first of which contains the first elements of the given arrays, the second of which contains the second elements of the given arrays, and so on.
+ZipBy creates a slice of transformed elements, the first of which contains the first elements of the given slices, the second of which contains the second elements of the given slices, and so on.
-When collections have different size, the Tuple attributes are filled with zero value.
+When collections are different sizes, the Tuple attributes are filled with zero value.
```go
items := lo.ZipBy2([]string{"a", "b"}, []int{1, 2}, func(a string, b int) string {
@@ -1848,7 +2081,7 @@ items := lo.ZipBy2([]string{"a", "b"}, []int{1, 2}, func(a string, b int) string
### Unzip2 -> Unzip9
-Unzip accepts an array of grouped elements and creates an array regrouping the elements to their pre-zip configuration.
+Unzip accepts a slice of grouped elements and creates a slice regrouping the elements to their pre-zip configuration.
```go
a, b := lo.Unzip2([]Tuple2[string, int]{{A: "a", B: 1}, {A: "b", B: 2}})
@@ -1860,7 +2093,7 @@ a, b := lo.Unzip2([]Tuple2[string, int]{{A: "a", B: 1}, {A: "b", B: 2}})
### UnzipBy2 -> UnzipBy9
-UnzipBy2 iterates over a collection and creates an array regrouping the elements to their pre-zip configuration.
+UnzipBy2 iterates over a collection and creates a slice regrouping the elements to their pre-zip configuration.
```go
a, b := lo.UnzipBy2([]string{"hello", "john", "doe"}, func(str string) (string, int) {
@@ -1872,7 +2105,7 @@ a, b := lo.UnzipBy2([]string{"hello", "john", "doe"}, func(str string) (string,
### CrossJoin2 -> CrossJoin9
-Combines every items from one list with every items from others. It is the cartesian product of lists received as arguments. It returns an empty list if a list is empty.
+Combines every item from one list with every item from others. It is the cartesian product of lists received as arguments. Returns an empty list if a list is empty.
```go
result := lo.CrossJoin2([]string{"hello", "john", "doe"}, []int{1, 2})
@@ -1886,7 +2119,7 @@ result := lo.CrossJoin2([]string{"hello", "john", "doe"}, []int{1, 2})
### CrossJoinBy2 -> CrossJoinBy9
-Combines every items from one list with every items from others. It is the cartesian product of lists received as arguments. The project function is used to create the output values. It returns an empty list if a list is empty.
+Combines every item from one list with every item from others. It is the cartesian product of lists received as arguments. The project function is used to create the output values. Returns an empty list if a list is empty.
```go
result := lo.CrossJoinBy2([]string{"hello", "john", "doe"}, []int{1, 2}, func(a A, b B) string {
@@ -1911,6 +2144,8 @@ duration := lo.Duration(func() {
// 3s
```
+[[play](https://go.dev/play/p/HQfbBbAXaFP)]
+
### Duration0 -> Duration10
Returns the time taken to execute a function.
@@ -1923,7 +2158,7 @@ duration := lo.Duration0(func() {
err, duration := lo.Duration1(func() error {
// very long job
- return fmt.Errorf("an error")
+ return errors.New("an error")
})
// an error
// 3s
@@ -1971,6 +2206,8 @@ for i := range children {
}
```
+[[play](https://go.dev/play/p/UZGu2wVg3J2)]
+
Many distributions strategies are available:
- [lo.DispatchingStrategyRoundRobin](./channel.go): Distributes messages in a rotating sequential manner.
@@ -2020,7 +2257,7 @@ children := lo.ChannelDispatcher(ch, 5, 10, customStrategy)
### SliceToChannel
-Returns a read-only channels of collection elements. Channel is closed after last element. Channel capacity can be customized.
+Returns a read-only channel of collection elements. Channel is closed after last element. Channel capacity can be customized.
```go
list := []int{1, 2, 3, 4, 5}
@@ -2031,9 +2268,11 @@ for v := range lo.SliceToChannel(2, list) {
// prints 1, then 2, then 3, then 4, then 5
```
+[[play](https://go.dev/play/p/lIbSY3QmiEg)]
+
### ChannelToSlice
-Returns a slice built from channels items. Blocks until channel closes.
+Returns a slice built from channel items. Blocks until channel closes.
```go
list := []int{1, 2, 3, 4, 5}
@@ -2186,7 +2425,7 @@ for i := range children {
### FanIn
-Merge messages from multiple input channels into a single buffered channel. Output messages has no priority. When all upstream channels reach EOF, downstream channel closes.
+Merge messages from multiple input channels into a single buffered channel. Output messages have no priority. When all upstream channels reach EOF, downstream channel closes.
```go
stream1 := make(chan int, 42)
@@ -2199,7 +2438,7 @@ all := lo.FanIn(100, stream1, stream2, stream3)
### FanOut
-Broadcasts all the upstream messages to multiple downstream channels. When upstream channel reach EOF, downstream channels close. If any downstream channels is full, broadcasting is paused.
+Broadcasts all the upstream messages to multiple downstream channels. When upstream channel reaches EOF, downstream channels close. If any downstream channels is full, broadcasting is paused.
```go
stream := make(chan int, 42)
@@ -2217,6 +2456,8 @@ present := lo.Contains([]int{0, 1, 2, 3, 4, 5}, 5)
// true
```
+[[play](https://go.dev/play/p/W1EvyqY6t9j)]
+
### ContainsBy
Returns true if the predicate function returns `true`.
@@ -2230,7 +2471,7 @@ present := lo.ContainsBy([]int{0, 1, 2, 3, 4, 5}, func(x int) bool {
### Every
-Returns true if all elements of a subset are contained into a collection or if the subset is empty.
+Returns true if all elements of a subset are contained in a collection or if the subset is empty.
```go
ok := lo.Every([]int{0, 1, 2, 3, 4, 5}, []int{0, 2})
@@ -2251,14 +2492,19 @@ b := EveryBy([]int{1, 2, 3, 4}, func(x int) bool {
// true
```
+[[play](https://go.dev/play/p/dn1-vhHsq9x)]
+
### Some
-Returns true if at least 1 element of a subset is contained into a collection.
+Returns true if at least 1 element of a subset is contained in a collection.
If the subset is empty Some returns false.
```go
ok := lo.Some([]int{0, 1, 2, 3, 4, 5}, []int{0, 6})
// true
+```
+
+[[play](https://go.dev/play/p/Lj4ceFkeT9V)]
ok := lo.Some([]int{0, 1, 2, 3, 4, 5}, []int{-1, 6})
// false
@@ -2278,7 +2524,7 @@ b := SomeBy([]int{1, 2, 3, 4}, func(x int) bool {
### None
-Returns true if no element of a subset are contained into a collection or if the subset is empty.
+Returns true if no element of a subset is contained in a collection or if the subset is empty.
```go
b := None([]int{0, 1, 2, 3, 4, 5}, []int{0, 2})
@@ -2287,6 +2533,8 @@ b := None([]int{0, 1, 2, 3, 4, 5}, []int{-1, 6})
// true
```
+[[play](https://go.dev/play/p/fye7JsmxzPV)]
+
### NoneBy
Returns true if the predicate returns true for none of the elements in the collection or if the collection is empty.
@@ -2298,6 +2546,8 @@ b := NoneBy([]int{1, 2, 3, 4}, func(x int) bool {
// true
```
+[[play](https://go.dev/play/p/O64WZ32H58S)]
+
### Intersect
Returns the intersection between two collections.
@@ -2317,8 +2567,8 @@ result3 := lo.Intersect([]int{0, 1, 2, 3, 4, 5}, []int{-1, 6})
Returns the difference between two collections.
-- The first value is the collection of element absent of list2.
-- The second value is the collection of element absent of list1.
+- The first value is the collection of elements absent from list2.
+- The second value is the collection of elements absent from list1.
```go
left, right := lo.Difference([]int{0, 1, 2, 3, 4, 5}, []int{0, 2, 6})
@@ -2328,6 +2578,8 @@ left, right := lo.Difference([]int{0, 1, 2, 3, 4, 5}, []int{0, 1, 2, 3, 4, 5})
// []int{}, []int{}
```
+[[play](https://go.dev/play/p/pKE-JgzqRpz)]
+
### Union
Returns all distinct elements from given collections. Result will not change the order of elements relatively.
@@ -2339,7 +2591,7 @@ union := lo.Union([]int{0, 1, 2, 3, 4, 5}, []int{0, 2}, []int{0, 10})
### Without
-Returns slice excluding all given values.
+Returns a slice excluding all given values.
```go
subset := lo.Without([]int{0, 2, 10}, 2)
@@ -2353,8 +2605,7 @@ subset := lo.Without([]int{0, 2, 10}, 0, 1, 2, 3, 4, 5)
Filters a slice by excluding elements whose extracted keys match any in the exclude list.
-It returns a new slice containing only the elements whose keys are not in the exclude list.
-
+Returns a new slice containing only the elements whose keys are not in the exclude list.
```go
type struct User {
@@ -2384,7 +2635,7 @@ filteredUsers := lo.WithoutBy(users, getID, excludedIDs...)
### WithoutEmpty
-Returns slice excluding zero values.
+Returns a slice excluding zero values.
```go
subset := lo.WithoutEmpty([]int{0, 2, 10})
@@ -2393,7 +2644,7 @@ subset := lo.WithoutEmpty([]int{0, 2, 10})
### WithoutNth
-Returns slice excluding nth value.
+Returns a slice excluding the nth value.
```go
subset := lo.WithoutNth([]int{-2, -1, 0, 1, 2}, 3, -42, 1)
@@ -2404,7 +2655,7 @@ subset := lo.WithoutNth([]int{-2, -1, 0, 1, 2}, 3, -42, 1)
Returns true if lists contain the same set of elements (including empty set).
-If there are duplicate elements, the number of appearances of each of them in both lists should match.
+If there are duplicate elements, the number of occurrences in each list should match.
The order of elements is not checked.
@@ -2417,7 +2668,7 @@ b := lo.ElementsMatch([]int{1, 1, 2}, []int{2, 1, 1})
Returns true if lists contain the same set of elements' keys (including empty set).
-If there are duplicate keys, the number of appearances of each of them in both lists should match.
+If there are duplicate keys, the number of occurrences in each list should match.
The order of elements is not checked.
@@ -2432,7 +2683,7 @@ b := lo.ElementsMatchBy(
### IndexOf
-Returns the index at which the first occurrence of a value is found in an array or return -1 if the value cannot be found.
+Returns the index at which the first occurrence of a value is found in a slice or -1 if the value cannot be found.
```go
found := lo.IndexOf([]int{0, 1, 2, 1, 2, 3}, 2)
@@ -2442,9 +2693,11 @@ notFound := lo.IndexOf([]int{0, 1, 2, 1, 2, 3}, 6)
// -1
```
+[[play](https://go.dev/play/p/Eo7W0lvKTky)]
+
### LastIndexOf
-Returns the index at which the last occurrence of a value is found in an array or return -1 if the value cannot be found.
+Returns the index at which the last occurrence of a value is found in a slice or -1 if the value cannot be found.
```go
found := lo.LastIndexOf([]int{0, 1, 2, 1, 2, 3}, 2)
@@ -2454,9 +2707,37 @@ notFound := lo.LastIndexOf([]int{0, 1, 2, 1, 2, 3}, 6)
// -1
```
+### HasPrefix
+
+Returns true if the collection has the prefix.
+
+```go
+ok := lo.HasPrefix([]int{1, 2, 3, 4}, []int{42})
+// false
+
+ok := lo.HasPrefix([]int{1, 2, 3, 4}, []int{1, 2})
+// true
+```
+
+[[play](https://go.dev/play/p/SrljzVDpMQM)]
+
+### HasSuffix
+
+Returns true if the collection has the suffix.
+
+```go
+ok := lo.HasSuffix([]int{1, 2, 3, 4}, []int{42})
+// false
+
+ok := lo.HasSuffix([]int{1, 2, 3, 4}, []int{3, 4})
+// true
+```
+
+[[play](https://go.dev/play/p/bJeLetQNAON)]
+
### Find
-Search an element in a slice based on a predicate. It returns element and true if element was found.
+Searches for an element in a slice based on a predicate. Returns element and true if element was found.
```go
str, ok := lo.Find([]string{"a", "b", "c", "d"}, func(i string) bool {
@@ -2470,9 +2751,11 @@ str, ok := lo.Find([]string{"foobar"}, func(i string) bool {
// "", false
```
+[[play](https://go.dev/play/p/Eo7W0lvKTky)]
+
### FindIndexOf
-FindIndexOf searches an element in a slice based on a predicate and returns the index and true. It returns -1 and false if the element is not found.
+FindIndexOf searches for an element in a slice based on a predicate and returns the index and true. Returns -1 and false if the element is not found.
```go
str, index, ok := lo.FindIndexOf([]string{"a", "b", "a", "b"}, func(i string) bool {
@@ -2486,9 +2769,11 @@ str, index, ok := lo.FindIndexOf([]string{"foobar"}, func(i string) bool {
// "", -1, false
```
+[[play](https://go.dev/play/p/XWSEM4Ic_t0)]
+
### FindLastIndexOf
-FindLastIndexOf searches an element in a slice based on a predicate and returns the index and true. It returns -1 and false if the element is not found.
+FindLastIndexOf searches for the last element in a slice based on a predicate and returns the index and true. Returns -1 and false if the element is not found.
```go
str, index, ok := lo.FindLastIndexOf([]string{"a", "b", "a", "b"}, func(i string) bool {
@@ -2502,9 +2787,11 @@ str, index, ok := lo.FindLastIndexOf([]string{"foobar"}, func(i string) bool {
// "", -1, false
```
+[[play](https://go.dev/play/p/dPiMRtJ6cUx)]
+
### FindOrElse
-Search an element in a slice based on a predicate. It returns the element if found or a given fallback value otherwise.
+Searches for an element in a slice based on a predicate. Returns the element if found or a given fallback value otherwise.
```go
str := lo.FindOrElse([]string{"a", "b", "c", "d"}, "x", func(i string) bool {
@@ -2538,7 +2825,7 @@ result3, ok3 := lo.FindKey(map[string]test{"foo": test{"foo"}, "bar": test{"bar"
### FindKeyBy
-Returns the key of the first element predicate returns truthy for.
+Returns the key of the first element predicate returns true for.
```go
result1, ok1 := lo.FindKeyBy(map[string]int{"foo": 1, "bar": 2, "baz": 3}, func(k string, v int) bool {
@@ -2554,7 +2841,7 @@ result2, ok2 := lo.FindKeyBy(map[string]int{"foo": 1, "bar": 2, "baz": 3}, func(
### FindUniques
-Returns a slice with all the unique elements of the collection. The order of result values is determined by the order they occur in the array.
+Returns a slice with all the elements that appear in the collection only once. The order of result values is determined by the order they occur in the slice.
```go
uniqueValues := lo.FindUniques([]int{1, 2, 2, 1, 2, 3})
@@ -2563,7 +2850,7 @@ uniqueValues := lo.FindUniques([]int{1, 2, 2, 1, 2, 3})
### FindUniquesBy
-Returns a slice with all the unique elements of the collection. The order of result values is determined by the order they occur in the array. It accepts `iteratee` which is invoked for each element in array to generate the criterion by which uniqueness is computed.
+Returns a slice with all the elements that appear in the collection only once. The order of result values is determined by the order they occur in the slice. It accepts `iteratee` which is invoked for each element in the slice to generate the criterion by which uniqueness is computed.
```go
uniqueValues := lo.FindUniquesBy([]int{3, 4, 5, 6, 7}, func(i int) int {
@@ -2574,7 +2861,7 @@ uniqueValues := lo.FindUniquesBy([]int{3, 4, 5, 6, 7}, func(i int) int {
### FindDuplicates
-Returns a slice with the first occurrence of each duplicated elements of the collection. The order of result values is determined by the order they occur in the array.
+Returns a slice with the first occurrence of each duplicated element in the collection. The order of result values is determined by the order they occur in the slice.
```go
duplicatedValues := lo.FindDuplicates([]int{1, 2, 2, 1, 2, 3})
@@ -2583,7 +2870,7 @@ duplicatedValues := lo.FindDuplicates([]int{1, 2, 2, 1, 2, 3})
### FindDuplicatesBy
-Returns a slice with the first occurrence of each duplicated elements of the collection. The order of result values is determined by the order they occur in the array. It accepts `iteratee` which is invoked for each element in array to generate the criterion by which uniqueness is computed.
+Returns a slice with the first occurrence of each duplicated element in the collection. The order of result values is determined by the order they occur in the slice. It accepts `iteratee` which is invoked for each element in the slice to generate the criterion by which uniqueness is computed.
```go
duplicatedValues := lo.FindDuplicatesBy([]int{3, 4, 5, 6, 7}, func(i int) int {
@@ -2609,6 +2896,8 @@ min := lo.Min([]time.Duration{time.Second, time.Hour})
// 1s
```
+[[play](https://go.dev/play/p/r6e-Z8JozS8)]
+
### MinIndex
Search the minimum value of a collection and the index of the minimum value.
@@ -2885,7 +3174,7 @@ nth, err := lo.Nth([]int{0, 1, 2, 3}, -2)
### NthOr
Returns the element at index `nth` of the collection. If `nth` is negative, it returns the `nth` element from the end. If `nth` is out of slice bounds, it returns the provided fallback value
-```go
+```go
nth := lo.NthOr([]int{10, 20, 30, 40, 50}, 2, -1)
// 30
@@ -2928,7 +3217,7 @@ lo.Sample([]string{})
// ""
```
-
+[[play](https://go.dev/play/p/FYA45LcpfM2)]
### SampleBy
@@ -2966,8 +3255,7 @@ lo.SamplesBy([]string{"a", "b", "c"}, 3, r.Intn)
### Ternary
-A 1 line if/else statement.
-
+A single line if/else statement.
```go
result := lo.Ternary(true, "a", "b")
@@ -2983,7 +3271,7 @@ Take care to avoid dereferencing potentially nil pointers in your A/B expression
### TernaryF
-A 1 line if/else statement whose options are functions.
+A single line if/else statement whose options are functions.
```go
result := lo.TernaryF(true, func() string { return "a" }, func() string { return "b" })
@@ -3158,6 +3446,8 @@ ptr := lo.ToPtr("hello world")
// *string{"hello world"}
```
+[[play](https://go.dev/play/p/P2sD0PMXw4F)]
+
### Nil
Returns a nil pointer of type.
@@ -3214,7 +3504,7 @@ value := lo.FromPtrOr(nil, "empty")
### ToSlicePtr
-Returns a slice of pointer copy of value.
+Returns a slice of pointers to each value.
```go
ptr := lo.ToSlicePtr([]string{"hello", "world"})
@@ -3264,7 +3554,7 @@ elements := lo.ToAnySlice([]int{1, 5, 1})
### FromAnySlice
-Returns an `any` slice with all elements mapped to a type. Returns false in case of type conversion failure.
+Returns a slice with all elements mapped to a type. Returns false in case of type conversion failure.
```go
elements, ok := lo.FromAnySlice([]any{"foobar", 42})
@@ -3446,6 +3736,8 @@ f(42)
// 47
```
+[[play](https://go.dev/play/p/Sy1gAQiQZ3v)]
+
### Partial2 -> Partial5
Returns new function that, when called, has its first argument set to the provided value.
@@ -3461,6 +3753,8 @@ f(42, -4)
// 80
```
+[[play](https://go.dev/play/p/-xiPjy4JChJ)]
+
### Attempt
Invokes a function N times until it returns valid output. Returns either the caught error or nil.
@@ -3473,7 +3767,7 @@ iter, err := lo.Attempt(42, func(i int) error {
return nil
}
- return fmt.Errorf("failed")
+ return errors.New("failed")
})
// 6
// nil
@@ -3483,14 +3777,14 @@ iter, err := lo.Attempt(2, func(i int) error {
return nil
}
- return fmt.Errorf("failed")
+ return errors.New("failed")
})
// 2
// error "failed"
iter, err := lo.Attempt(0, func(i int) error {
if i < 42 {
- return fmt.Errorf("failed")
+ return errors.New("failed")
}
return nil
@@ -3499,7 +3793,7 @@ iter, err := lo.Attempt(0, func(i int) error {
// nil
```
-For more advanced retry strategies (delay, exponential backoff...), please take a look on [cenkalti/backoff](https://github.com/cenkalti/backoff).
+For more advanced retry strategies (delay, exponential backoff...), please take a look at [cenkalti/backoff](https://github.com/cenkalti/backoff).
[[play](https://go.dev/play/p/3ggJZ2ZKcMj)]
@@ -3515,14 +3809,14 @@ iter, duration, err := lo.AttemptWithDelay(5, 2*time.Second, func(i int, duratio
return nil
}
- return fmt.Errorf("failed")
+ return errors.New("failed")
})
// 3
// ~ 4 seconds
// nil
```
-For more advanced retry strategies (delay, exponential backoff...), please take a look on [cenkalti/backoff](https://github.com/cenkalti/backoff).
+For more advanced retry strategies (delay, exponential backoff...), please take a look at [cenkalti/backoff](https://github.com/cenkalti/backoff).
[[play](https://go.dev/play/p/tVs6CygC7m1)]
@@ -3536,7 +3830,7 @@ When the first argument is less than `1`, the function runs until a successful r
count1, err1 := lo.AttemptWhile(5, func(i int) (error, bool) {
err := doMockedHTTPRequest(i)
if err != nil {
- if errors.Is(err, ErrBadRequest) { // lets assume ErrBadRequest is a critical error that needs to terminate the invoke
+ if errors.Is(err, ErrBadRequest) { // let's assume ErrBadRequest is a critical error that needs to terminate the invoke
return err, false // flag the second return value as false to terminate the invoke
}
@@ -3547,9 +3841,9 @@ count1, err1 := lo.AttemptWhile(5, func(i int) (error, bool) {
})
```
-For more advanced retry strategies (delay, exponential backoff...), please take a look on [cenkalti/backoff](https://github.com/cenkalti/backoff).
+For more advanced retry strategies (delay, exponential backoff...), please take a look at [cenkalti/backoff](https://github.com/cenkalti/backoff).
-[[play](https://go.dev/play/p/M2wVq24PaZM)]
+[[play](https://go.dev/play/p/1VS7HxlYMOG)]
### AttemptWhileWithDelay
@@ -3561,7 +3855,7 @@ When the first argument is less than `1`, the function runs until a successful r
count1, time1, err1 := lo.AttemptWhileWithDelay(5, time.Millisecond, func(i int, d time.Duration) (error, bool) {
err := doMockedHTTPRequest(i)
if err != nil {
- if errors.Is(err, ErrBadRequest) { // lets assume ErrBadRequest is a critical error that needs to terminate the invoke
+ if errors.Is(err, ErrBadRequest) { // let's assume ErrBadRequest is a critical error that needs to terminate the invoke
return err, false // flag the second return value as false to terminate the invoke
}
@@ -3572,9 +3866,9 @@ count1, time1, err1 := lo.AttemptWhileWithDelay(5, time.Millisecond, func(i int,
})
```
-For more advanced retry strategies (delay, exponential backoff...), please take a look on [cenkalti/backoff](https://github.com/cenkalti/backoff).
+For more advanced retry strategies (delay, exponential backoff...), please take a look at [cenkalti/backoff](https://github.com/cenkalti/backoff).
-[[play](https://go.dev/play/p/cfcmhvLO-nv)]
+[[play](https://go.dev/play/p/mhufUjJfLEF)]
### Debounce
@@ -3715,8 +4009,8 @@ ch := lo.Async(func() error { time.Sleep(10 * time.Second); return nil })
### Async{0->6}
Executes a function in a goroutine and returns the result in a channel.
-For function with multiple return values, the results will be returned as a tuple inside the channel.
-For function without return, struct{} will be returned in the channel.
+For functions with multiple return values, the results will be returned as a tuple inside the channel.
+For functions without return, struct{} will be returned in the channel.
```go
ch := lo.Async0(func() { time.Sleep(10 * time.Second) })
@@ -3766,7 +4060,7 @@ transaction := NewTransaction().
fmt.Println("step 3")
if true {
- return state, fmt.Errorf("error")
+ return state, errors.New("error")
}
return state + 42, nil
@@ -3819,6 +4113,8 @@ iterations, duration, ok := lo.WaitFor(laterTrue, 10*time.Millisecond, 5*time.Mi
// false
```
+[[play](https://go.dev/play/p/t_wTDmubbK3)]
+
### WaitForWithContext
Runs periodically until a condition is validated or context is invalid.
@@ -3861,6 +4157,8 @@ iterations, duration, ok := lo.WaitForWithContext(expiringCtx, alwaysFalse, 100*
// false
```
+[[play](https://go.dev/play/p/t_wTDmubbK3)]
+
### Validate
Helper function that creates an error when a condition is not met.
@@ -3879,7 +4177,7 @@ val := lo.Validate(len(slice) == 0, "Slice should be empty but contains %v", sli
### Must
-Wraps a function call to panics if second argument is `error` or `false`, returns the value otherwise.
+Wraps a function call and panics if second argument is `error` or `false`, returns the value otherwise.
```go
val := lo.Must(time.Parse("2006-01-02", "2022-01-15"))
@@ -3893,7 +4191,7 @@ val := lo.Must(time.Parse("2006-01-02", "bad-value"))
### Must{0->6}
-Must\* has the same behavior as Must, but returns multiple values.
+Must\* has the same behavior as Must but returns multiple values.
```go
func example0() (error)
@@ -3956,7 +4254,7 @@ ok := lo.Try(func() error {
// true
ok := lo.Try(func() error {
- return fmt.Errorf("error")
+ return errors.New("error")
})
// false
```
@@ -3996,7 +4294,7 @@ str, ok := lo.TryOr(func() error {
// true
str, ok := lo.TryOr(func() error {
- return "hello", fmt.Errorf("error")
+ return "hello", errors.New("error")
}, "world")
// world
// false
@@ -4085,7 +4383,7 @@ if ok := errors.As(err, &rateLimitErr); ok {
}
```
-1 line `lo` helper:
+single line `lo` helper:
```go
err := doSomething()
@@ -4165,7 +4463,7 @@ ok github.com/samber/lo 6.657s
- `lo.Map` is way faster (x7) than `go-funk`, a reflection-based Map implementation.
- `lo.Map` has the same allocation profile as `for`.
- `lo.Map` is 4% slower than `for`.
-- `lop.Map` is slower than `lo.Map` because it implies more memory allocation and locks. `lop.Map` will be useful for long-running callbacks, such as i/o bound processing.
+- `lop.Map` is slower than `lo.Map` because it implies more memory allocation and locks. `lop.Map` is useful for long-running callbacks, such as i/o bound processing.
- `for` beats other implementations for memory and CPU.
## 🤝 Contributing
@@ -4178,14 +4476,6 @@ Don't hesitate ;)
Helper naming: helpers must be self-explanatory and respect standards (other languages, libraries...). Feel free to suggest many names in your contributions.
-### With Docker
-
-```bash
-docker-compose run --rm dev
-```
-
-### Without Docker
-
```bash
# Install some dev dependencies
make tools
diff --git a/vendor/github.com/samber/lo/channel.go b/vendor/github.com/samber/lo/channel.go
index a1e2cddcfb..9a10852d3e 100644
--- a/vendor/github.com/samber/lo/channel.go
+++ b/vendor/github.com/samber/lo/channel.go
@@ -5,15 +5,17 @@ import (
"sync"
"time"
- "github.com/samber/lo/internal/rand"
+ "github.com/samber/lo/internal/xrand"
)
+// DispatchingStrategy is a function that distributes messages to channels.
type DispatchingStrategy[T any] func(msg T, index uint64, channels []<-chan T) int
// ChannelDispatcher distributes messages from input channels into N child channels.
// Close events are propagated to children.
// Underlying channels can have a fixed buffer capacity or be unbuffered when cap is 0.
-func ChannelDispatcher[T any](stream <-chan T, count int, channelBufferCap int, strategy DispatchingStrategy[T]) []<-chan T {
+// Play: https://go.dev/play/p/UZGu2wVg3J2
+func ChannelDispatcher[T any](stream <-chan T, count, channelBufferCap int, strategy DispatchingStrategy[T]) []<-chan T {
children := createChannels[T](count, channelBufferCap)
roChildren := channelsToReadOnly(children)
@@ -22,7 +24,7 @@ func ChannelDispatcher[T any](stream <-chan T, count int, channelBufferCap int,
// propagate channel closing to children
defer closeChannels(children)
- var i uint64 = 0
+ var i uint64
for {
msg, ok := <-stream
@@ -40,7 +42,7 @@ func ChannelDispatcher[T any](stream <-chan T, count int, channelBufferCap int,
return roChildren
}
-func createChannels[T any](count int, channelBufferCap int) []chan T {
+func createChannels[T any](count, channelBufferCap int) []chan T {
children := make([]chan T, 0, count)
for i := 0; i < count; i++ {
@@ -72,6 +74,7 @@ func channelIsNotFull[T any](ch <-chan T) bool {
// DispatchingStrategyRoundRobin distributes messages in a rotating sequential manner.
// If the channel capacity is exceeded, the next channel will be selected and so on.
+// Play: https://go.dev/play/p/UZGu2wVg3J2
func DispatchingStrategyRoundRobin[T any](msg T, index uint64, channels []<-chan T) int {
for {
i := int(index % uint64(len(channels)))
@@ -86,9 +89,10 @@ func DispatchingStrategyRoundRobin[T any](msg T, index uint64, channels []<-chan
// DispatchingStrategyRandom distributes messages in a random manner.
// If the channel capacity is exceeded, another random channel will be selected and so on.
+// Play: https://go.dev/play/p/GEyGn3TdGk4
func DispatchingStrategyRandom[T any](msg T, index uint64, channels []<-chan T) int {
for {
- i := rand.IntN(len(channels))
+ i := xrand.IntN(len(channels))
if channelIsNotFull(channels[i]) {
return i
}
@@ -99,6 +103,7 @@ func DispatchingStrategyRandom[T any](msg T, index uint64, channels []<-chan T)
// DispatchingStrategyWeightedRandom distributes messages in a weighted manner.
// If the channel capacity is exceeded, another random channel will be selected and so on.
+// Play: https://go.dev/play/p/v0eMh8NZG2L
func DispatchingStrategyWeightedRandom[T any](weights []int) DispatchingStrategy[T] {
seq := []int{}
@@ -110,7 +115,7 @@ func DispatchingStrategyWeightedRandom[T any](weights []int) DispatchingStrategy
return func(msg T, index uint64, channels []<-chan T) int {
for {
- i := seq[rand.IntN(len(seq))]
+ i := seq[xrand.IntN(len(seq))]
if channelIsNotFull(channels[i]) {
return i
}
@@ -122,6 +127,7 @@ func DispatchingStrategyWeightedRandom[T any](weights []int) DispatchingStrategy
// DispatchingStrategyFirst distributes messages in the first non-full channel.
// If the capacity of the first channel is exceeded, the second channel will be selected and so on.
+// Play: https://go.dev/play/p/OrJCvOmk42f
func DispatchingStrategyFirst[T any](msg T, index uint64, channels []<-chan T) int {
for {
for i := range channels {
@@ -135,25 +141,28 @@ func DispatchingStrategyFirst[T any](msg T, index uint64, channels []<-chan T) i
}
// DispatchingStrategyLeast distributes messages in the emptiest channel.
+// Play: https://go.dev/play/p/ypy0jrRcEe7
func DispatchingStrategyLeast[T any](msg T, index uint64, channels []<-chan T) int {
seq := Range(len(channels))
- return MinBy(seq, func(item int, min int) bool {
- return len(channels[item]) < len(channels[min])
+ return MinBy(seq, func(item, mIn int) bool {
+ return len(channels[item]) < len(channels[mIn])
})
}
// DispatchingStrategyMost distributes messages in the fullest channel.
// If the channel capacity is exceeded, the next channel will be selected and so on.
+// Play: https://go.dev/play/p/erHHone7rF9
func DispatchingStrategyMost[T any](msg T, index uint64, channels []<-chan T) int {
seq := Range(len(channels))
- return MaxBy(seq, func(item int, max int) bool {
- return len(channels[item]) > len(channels[max]) && channelIsNotFull(channels[item])
+ return MaxBy(seq, func(item, mAx int) bool {
+ return len(channels[item]) > len(channels[mAx]) && channelIsNotFull(channels[item])
})
}
-// SliceToChannel returns a read-only channels of collection elements.
+// SliceToChannel returns a read-only channel of collection elements.
+// Play: https://go.dev/play/p/lIbSY3QmiEg
func SliceToChannel[T any](bufferSize int, collection []T) <-chan T {
ch := make(chan T, bufferSize)
@@ -168,7 +177,8 @@ func SliceToChannel[T any](bufferSize int, collection []T) <-chan T {
return ch
}
-// ChannelToSlice returns a slice built from channels items. Blocks until channel closes.
+// ChannelToSlice returns a slice built from channel items. Blocks until channel closes.
+// Play: https://go.dev/play/p/lIbSY3QmiEg
func ChannelToSlice[T any](ch <-chan T) []T {
collection := []T{}
@@ -180,6 +190,9 @@ func ChannelToSlice[T any](ch <-chan T) []T {
}
// Generator implements the generator design pattern.
+// Play: https://go.dev/play/p/lIbSY3QmiEg
+//
+// Deprecated: use "iter" package instead (Go >= 1.23).
func Generator[T any](bufferSize int, generator func(yield func(T))) <-chan T {
ch := make(chan T, bufferSize)
@@ -196,7 +209,8 @@ func Generator[T any](bufferSize int, generator func(yield func(T))) <-chan T {
}
// Buffer creates a slice of n elements from a channel. Returns the slice and the slice length.
-// @TODO: we should probably provide an helper that reuse the same buffer.
+// @TODO: we should probably provide a helper that reuses the same buffer.
+// Play: https://go.dev/play/p/gPQ-6xmcKQI
func Buffer[T any](ch <-chan T, size int) (collection []T, length int, readTime time.Duration, ok bool) {
buffer := make([]T, 0, size)
index := 0
@@ -222,7 +236,8 @@ func Batch[T any](ch <-chan T, size int) (collection []T, length int, readTime t
}
// BufferWithContext creates a slice of n elements from a channel, with context. Returns the slice and the slice length.
-// @TODO: we should probably provide an helper that reuse the same buffer.
+// @TODO: we should probably provide a helper that reuses the same buffer.
+// Play: https://go.dev/play/p/oRfOyJWK9YF
func BufferWithContext[T any](ctx context.Context, ch <-chan T, size int) (collection []T, length int, readTime time.Duration, ok bool) {
buffer := make([]T, 0, size)
now := time.Now()
@@ -245,6 +260,7 @@ func BufferWithContext[T any](ctx context.Context, ch <-chan T, size int) (colle
}
// BufferWithTimeout creates a slice of n elements from a channel, with timeout. Returns the slice and the slice length.
+// Play: https://go.dev/play/p/sxyEM3koo4n
func BufferWithTimeout[T any](ch <-chan T, size int, timeout time.Duration) (collection []T, length int, readTime time.Duration, ok bool) {
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
@@ -259,7 +275,8 @@ func BatchWithTimeout[T any](ch <-chan T, size int, timeout time.Duration) (coll
}
// FanIn collects messages from multiple input channels into a single buffered channel.
-// Output messages has no priority. When all upstream channels reach EOF, downstream channel closes.
+// Output messages have no priority. When all upstream channels reach EOF, downstream channel closes.
+// Play: https://go.dev/play/p/FH8Wq-T04Jb
func FanIn[T any](channelBufferCap int, upstreams ...<-chan T) <-chan T {
out := make(chan T, channelBufferCap)
var wg sync.WaitGroup
@@ -284,7 +301,7 @@ func FanIn[T any](channelBufferCap int, upstreams ...<-chan T) <-chan T {
}
// ChannelMerge collects messages from multiple input channels into a single buffered channel.
-// Output messages has no priority. When all upstream channels reach EOF, downstream channel closes.
+// Output messages have no priority. When all upstream channels reach EOF, downstream channel closes.
//
// Deprecated: Use [FanIn] instead.
func ChannelMerge[T any](channelBufferCap int, upstreams ...<-chan T) <-chan T {
@@ -292,9 +309,10 @@ func ChannelMerge[T any](channelBufferCap int, upstreams ...<-chan T) <-chan T {
}
// FanOut broadcasts all the upstream messages to multiple downstream channels.
-// When upstream channel reach EOF, downstream channels close. If any downstream
+// When upstream channel reaches EOF, downstream channels close. If any downstream
// channels is full, broadcasting is paused.
-func FanOut[T any](count int, channelsBufferCap int, upstream <-chan T) []<-chan T {
+// Play: https://go.dev/play/p/2LHxcjKX23L
+func FanOut[T any](count, channelsBufferCap int, upstream <-chan T) []<-chan T {
downstreams := createChannels[T](count, channelsBufferCap)
go func() {
diff --git a/vendor/github.com/samber/lo/concurrency.go b/vendor/github.com/samber/lo/concurrency.go
index a2ebbce20a..35e1f74968 100644
--- a/vendor/github.com/samber/lo/concurrency.go
+++ b/vendor/github.com/samber/lo/concurrency.go
@@ -17,9 +17,10 @@ func (s *synchronize) Do(cb func()) {
}
// Synchronize wraps the underlying callback in a mutex. It receives an optional mutex.
-func Synchronize(opt ...sync.Locker) *synchronize {
+// Play: https://go.dev/play/p/X3cqROSpQmu
+func Synchronize(opt ...sync.Locker) *synchronize { //nolint:revive
if len(opt) > 1 {
- panic("unexpected arguments")
+ panic("lo.Synchronize: unexpected arguments")
} else if len(opt) == 0 {
opt = append(opt, &sync.Mutex{})
}
@@ -30,6 +31,7 @@ func Synchronize(opt ...sync.Locker) *synchronize {
}
// Async executes a function in a goroutine and returns the result in a channel.
+// Play: https://go.dev/play/p/uo35gosuTLw
func Async[A any](f func() A) <-chan A {
ch := make(chan A, 1)
go func() {
@@ -39,6 +41,7 @@ func Async[A any](f func() A) <-chan A {
}
// Async0 executes a function in a goroutine and returns a channel set once the function finishes.
+// Play: https://go.dev/play/p/tNqf1cClG_o
func Async0(f func()) <-chan struct{} {
ch := make(chan struct{}, 1)
go func() {
@@ -49,11 +52,13 @@ func Async0(f func()) <-chan struct{} {
}
// Async1 is an alias to Async.
+// Play: https://go.dev/play/p/uo35gosuTLw
func Async1[A any](f func() A) <-chan A {
return Async(f)
}
// Async2 has the same behavior as Async, but returns the 2 results as a tuple inside the channel.
+// Play: https://go.dev/play/p/7W7mKQi0AhA
func Async2[A, B any](f func() (A, B)) <-chan Tuple2[A, B] {
ch := make(chan Tuple2[A, B], 1)
go func() {
@@ -63,6 +68,7 @@ func Async2[A, B any](f func() (A, B)) <-chan Tuple2[A, B] {
}
// Async3 has the same behavior as Async, but returns the 3 results as a tuple inside the channel.
+// Play: https://go.dev/play/p/L1d6o6l6q0d
func Async3[A, B, C any](f func() (A, B, C)) <-chan Tuple3[A, B, C] {
ch := make(chan Tuple3[A, B, C], 1)
go func() {
@@ -72,6 +78,7 @@ func Async3[A, B, C any](f func() (A, B, C)) <-chan Tuple3[A, B, C] {
}
// Async4 has the same behavior as Async, but returns the 4 results as a tuple inside the channel.
+// Play: https://go.dev/play/p/1X7q6oL0TqF
func Async4[A, B, C, D any](f func() (A, B, C, D)) <-chan Tuple4[A, B, C, D] {
ch := make(chan Tuple4[A, B, C, D], 1)
go func() {
@@ -81,6 +88,7 @@ func Async4[A, B, C, D any](f func() (A, B, C, D)) <-chan Tuple4[A, B, C, D] {
}
// Async5 has the same behavior as Async, but returns the 5 results as a tuple inside the channel.
+// Play: https://go.dev/play/p/2W7q4oL1TqG
func Async5[A, B, C, D, E any](f func() (A, B, C, D, E)) <-chan Tuple5[A, B, C, D, E] {
ch := make(chan Tuple5[A, B, C, D, E], 1)
go func() {
@@ -90,6 +98,7 @@ func Async5[A, B, C, D, E any](f func() (A, B, C, D, E)) <-chan Tuple5[A, B, C,
}
// Async6 has the same behavior as Async, but returns the 6 results as a tuple inside the channel.
+// Play: https://go.dev/play/p/3X8q5pM2UrH
func Async6[A, B, C, D, E, F any](f func() (A, B, C, D, E, F)) <-chan Tuple6[A, B, C, D, E, F] {
ch := make(chan Tuple6[A, B, C, D, E, F], 1)
go func() {
@@ -99,7 +108,8 @@ func Async6[A, B, C, D, E, F any](f func() (A, B, C, D, E, F)) <-chan Tuple6[A,
}
// WaitFor runs periodically until a condition is validated.
-func WaitFor(condition func(i int) bool, timeout time.Duration, heartbeatDelay time.Duration) (totalIterations int, elapsed time.Duration, conditionFound bool) {
+// Play: https://go.dev/play/p/t_wTDmubbK3
+func WaitFor(condition func(i int) bool, timeout, heartbeatDelay time.Duration) (totalIterations int, elapsed time.Duration, conditionFound bool) {
conditionWithContext := func(_ context.Context, currentIteration int) bool {
return condition(currentIteration)
}
@@ -107,7 +117,8 @@ func WaitFor(condition func(i int) bool, timeout time.Duration, heartbeatDelay t
}
// WaitForWithContext runs periodically until a condition is validated or context is canceled.
-func WaitForWithContext(ctx context.Context, condition func(ctx context.Context, currentIteration int) bool, timeout time.Duration, heartbeatDelay time.Duration) (totalIterations int, elapsed time.Duration, conditionFound bool) {
+// Play: https://go.dev/play/p/t_wTDmubbK3
+func WaitForWithContext(ctx context.Context, condition func(ctx context.Context, currentIteration int) bool, timeout, heartbeatDelay time.Duration) (totalIterations int, elapsed time.Duration, conditionFound bool) {
start := time.Now()
if ctx.Err() != nil {
diff --git a/vendor/github.com/samber/lo/condition.go b/vendor/github.com/samber/lo/condition.go
index eaeaa2b952..1eb017e6f8 100644
--- a/vendor/github.com/samber/lo/condition.go
+++ b/vendor/github.com/samber/lo/condition.go
@@ -1,9 +1,9 @@
package lo
-// Ternary is a 1 line if/else statement.
+// Ternary is a single line if/else statement.
// Take care to avoid dereferencing potentially nil pointers in your A/B expressions, because they are both evaluated. See TernaryF to avoid this problem.
// Play: https://go.dev/play/p/t-D7WBL44h2
-func Ternary[T any](condition bool, ifOutput T, elseOutput T) T {
+func Ternary[T any](condition bool, ifOutput, elseOutput T) T {
if condition {
return ifOutput
}
@@ -11,9 +11,9 @@ func Ternary[T any](condition bool, ifOutput T, elseOutput T) T {
return elseOutput
}
-// TernaryF is a 1 line if/else statement whose options are functions
+// TernaryF is a single line if/else statement whose options are functions.
// Play: https://go.dev/play/p/AO4VW20JoqM
-func TernaryF[T any](condition bool, ifFunc func() T, elseFunc func() T) T {
+func TernaryF[T any](condition bool, ifFunc, elseFunc func() T) T {
if condition {
return ifFunc()
}
@@ -26,9 +26,9 @@ type ifElse[T any] struct {
done bool
}
-// If.
+// If is a single line if/else statement.
// Play: https://go.dev/play/p/WSw3ApMxhyW
-func If[T any](condition bool, result T) *ifElse[T] {
+func If[T any](condition bool, result T) *ifElse[T] { //nolint:revive
if condition {
return &ifElse[T]{result, true}
}
@@ -37,9 +37,9 @@ func If[T any](condition bool, result T) *ifElse[T] {
return &ifElse[T]{t, false}
}
-// IfF.
+// IfF is a single line if/else statement whose options are functions.
// Play: https://go.dev/play/p/WSw3ApMxhyW
-func IfF[T any](condition bool, resultF func() T) *ifElse[T] {
+func IfF[T any](condition bool, resultF func() T) *ifElse[T] { //nolint:revive
if condition {
return &ifElse[T]{resultF(), true}
}
@@ -98,7 +98,7 @@ type switchCase[T comparable, R any] struct {
// Switch is a pure functional switch/case/default statement.
// Play: https://go.dev/play/p/TGbKUMAeRUd
-func Switch[T comparable, R any](predicate T) *switchCase[T, R] {
+func Switch[T comparable, R any](predicate T) *switchCase[T, R] { //nolint:revive
var result R
return &switchCase[T, R]{
diff --git a/vendor/github.com/samber/lo/errors.go b/vendor/github.com/samber/lo/errors.go
index a2347218dc..135230a7d6 100644
--- a/vendor/github.com/samber/lo/errors.go
+++ b/vendor/github.com/samber/lo/errors.go
@@ -25,7 +25,7 @@ func messageFromMsgAndArgs(msgAndArgs ...any) string {
return fmt.Sprintf("%+v", msgAndArgs[0])
}
if len(msgAndArgs) > 1 {
- return fmt.Sprintf(msgAndArgs[0].(string), msgAndArgs[1:]...)
+ return fmt.Sprintf(msgAndArgs[0].(string), msgAndArgs[1:]...) //nolint:errcheck,forcetypeassert
}
return ""
}
@@ -51,9 +51,8 @@ func must(err any, messageArgs ...any) {
message := messageFromMsgAndArgs(messageArgs...)
if message != "" {
panic(message + ": " + e.Error())
- } else {
- panic(e.Error())
}
+ panic(e.Error())
default:
panic("must: invalid err type '" + reflect.TypeOf(err).Name() + "', should either be a bool or an error")
@@ -62,7 +61,7 @@ func must(err any, messageArgs ...any) {
// Must is a helper that wraps a call to a function returning a value and an error
// and panics if err is error or false.
-// Play: https://go.dev/play/p/TMoWrRp3DyC
+// Play: https://go.dev/play/p/fOqtX5HudtN
func Must[T any](val T, err any, messageArgs ...any) T {
must(err, messageArgs...)
return val
@@ -74,7 +73,7 @@ func Must0(err any, messageArgs ...any) {
must(err, messageArgs...)
}
-// Must1 is an alias to Must
+// Must1 is an alias to Must.
// Play: https://go.dev/play/p/TMoWrRp3DyC
func Must1[T any](val T, err any, messageArgs ...any) T {
return Must(val, err, messageArgs...)
@@ -130,7 +129,7 @@ func Try(callback func() error) (ok bool) {
ok = false
}
- return
+ return ok
}
// Try0 has the same behavior as Try, but callback returns no variable.
@@ -328,7 +327,7 @@ func TryWithErrorValue(callback func() error) (errorValue any, ok bool) {
errorValue = err
}
- return
+ return errorValue, ok
}
// TryCatch has the same behavior as Try, but calls the catch function in case of error.
diff --git a/vendor/github.com/samber/lo/find.go b/vendor/github.com/samber/lo/find.go
index f04dc082ee..534b4d75e8 100644
--- a/vendor/github.com/samber/lo/find.go
+++ b/vendor/github.com/samber/lo/find.go
@@ -5,11 +5,12 @@ import (
"time"
"github.com/samber/lo/internal/constraints"
- "github.com/samber/lo/internal/rand"
+ "github.com/samber/lo/internal/xrand"
)
-// IndexOf returns the index at which the first occurrence of a value is found in an array or return -1
+// IndexOf returns the index at which the first occurrence of a value is found in a slice or -1
// if the value cannot be found.
+// Play: https://go.dev/play/p/Eo7W0lvKTky
func IndexOf[T comparable](collection []T, element T) int {
for i := range collection {
if collection[i] == element {
@@ -20,8 +21,9 @@ func IndexOf[T comparable](collection []T, element T) int {
return -1
}
-// LastIndexOf returns the index at which the last occurrence of a value is found in an array or return -1
+// LastIndexOf returns the index at which the last occurrence of a value is found in a slice or -1
// if the value cannot be found.
+// Play: https://go.dev/play/p/Eo7W0lvKTky
func LastIndexOf[T comparable](collection []T, element T) int {
length := len(collection)
@@ -34,7 +36,40 @@ func LastIndexOf[T comparable](collection []T, element T) int {
return -1
}
-// Find search an element in a slice based on a predicate. It returns element and true if element was found.
+// HasPrefix returns true if the collection has the prefix.
+// Play: https://go.dev/play/p/SrljzVDpMQM
+func HasPrefix[T comparable](collection, prefix []T) bool {
+ if len(collection) < len(prefix) {
+ return false
+ }
+
+ for i := range prefix {
+ if collection[i] != prefix[i] {
+ return false
+ }
+ }
+
+ return true
+}
+
+// HasSuffix returns true if the collection has the suffix.
+// Play: https://go.dev/play/p/bJeLetQNAON
+func HasSuffix[T comparable](collection, suffix []T) bool {
+ if len(collection) < len(suffix) {
+ return false
+ }
+
+ for i := range suffix {
+ if collection[len(collection)-len(suffix)+i] != suffix[i] {
+ return false
+ }
+ }
+
+ return true
+}
+
+// Find searches for an element in a slice based on a predicate. Returns element and true if element was found.
+// Play: https://go.dev/play/p/Eo7W0lvKTky
func Find[T any](collection []T, predicate func(item T) bool) (T, bool) {
for i := range collection {
if predicate(collection[i]) {
@@ -46,8 +81,9 @@ func Find[T any](collection []T, predicate func(item T) bool) (T, bool) {
return result, false
}
-// FindIndexOf searches an element in a slice based on a predicate and returns the index and true.
-// It returns -1 and false if the element is not found.
+// FindIndexOf searches for an element in a slice based on a predicate and returns the index and true.
+// Returns -1 and false if the element is not found.
+// Play: https://go.dev/play/p/XWSEM4Ic_t0
func FindIndexOf[T any](collection []T, predicate func(item T) bool) (T, int, bool) {
for i := range collection {
if predicate(collection[i]) {
@@ -59,8 +95,9 @@ func FindIndexOf[T any](collection []T, predicate func(item T) bool) (T, int, bo
return result, -1, false
}
-// FindLastIndexOf searches last element in a slice based on a predicate and returns the index and true.
-// It returns -1 and false if the element is not found.
+// FindLastIndexOf searches for the last element in a slice based on a predicate and returns the index and true.
+// Returns -1 and false if the element is not found.
+// Play: https://go.dev/play/p/dPiMRtJ6cUx
func FindLastIndexOf[T any](collection []T, predicate func(item T) bool) (T, int, bool) {
length := len(collection)
@@ -74,7 +111,8 @@ func FindLastIndexOf[T any](collection []T, predicate func(item T) bool) (T, int
return result, -1, false
}
-// FindOrElse search an element in a slice based on a predicate. It returns the element if found or a given fallback value otherwise.
+// FindOrElse searches for an element in a slice based on a predicate. Returns the element if found or a given fallback value otherwise.
+// Play: https://go.dev/play/p/Eo7W0lvKTky
func FindOrElse[T any](collection []T, fallback T, predicate func(item T) bool) T {
for i := range collection {
if predicate(collection[i]) {
@@ -86,9 +124,10 @@ func FindOrElse[T any](collection []T, fallback T, predicate func(item T) bool)
}
// FindKey returns the key of the first value matching.
-func FindKey[K comparable, V comparable](object map[K]V, value V) (K, bool) {
- for k := range object {
- if object[k] == value {
+// Play: https://go.dev/play/p/Bg0w1VDPYXx
+func FindKey[K, V comparable](object map[K]V, value V) (K, bool) {
+ for k, v := range object {
+ if v == value {
return k, true
}
}
@@ -96,10 +135,11 @@ func FindKey[K comparable, V comparable](object map[K]V, value V) (K, bool) {
return Empty[K](), false
}
-// FindKeyBy returns the key of the first element predicate returns truthy for.
+// FindKeyBy returns the key of the first element predicate returns true for.
+// Play: https://go.dev/play/p/9IbiPElcyo8
func FindKeyBy[K comparable, V any](object map[K]V, predicate func(key K, value V) bool) (K, bool) {
- for k := range object {
- if predicate(k, object[k]) {
+ for k, v := range object {
+ if predicate(k, v) {
return k, true
}
}
@@ -107,7 +147,7 @@ func FindKeyBy[K comparable, V any](object map[K]V, predicate func(key K, value
return Empty[K](), false
}
-// FindUniques returns a slice with all the unique elements of the collection.
+// FindUniques returns a slice with all the elements that appear in the collection only once.
// The order of result values is determined by the order they occur in the collection.
func FindUniques[T comparable, Slice ~[]T](collection Slice) Slice {
isDupl := make(map[T]bool, len(collection))
@@ -132,9 +172,9 @@ func FindUniques[T comparable, Slice ~[]T](collection Slice) Slice {
return result
}
-// FindUniquesBy returns a slice with all the unique elements of the collection.
-// The order of result values is determined by the order they occur in the array. It accepts `iteratee` which is
-// invoked for each element in array to generate the criterion by which uniqueness is computed.
+// FindUniquesBy returns a slice with all the elements that appear in the collection only once.
+// The order of result values is determined by the order they occur in the slice. It accepts `iteratee` which is
+// invoked for each element in the slice to generate the criterion by which uniqueness is computed.
func FindUniquesBy[T any, U comparable, Slice ~[]T](collection Slice, iteratee func(item T) U) Slice {
isDupl := make(map[U]bool, len(collection))
@@ -162,7 +202,7 @@ func FindUniquesBy[T any, U comparable, Slice ~[]T](collection Slice, iteratee f
return result
}
-// FindDuplicates returns a slice with the first occurrence of each duplicated elements of the collection.
+// FindDuplicates returns a slice with the first occurrence of each duplicated element in the collection.
// The order of result values is determined by the order they occur in the collection.
func FindDuplicates[T comparable, Slice ~[]T](collection Slice) Slice {
isDupl := make(map[T]bool, len(collection))
@@ -188,9 +228,9 @@ func FindDuplicates[T comparable, Slice ~[]T](collection Slice) Slice {
return result
}
-// FindDuplicatesBy returns a slice with the first occurrence of each duplicated elements of the collection.
-// The order of result values is determined by the order they occur in the array. It accepts `iteratee` which is
-// invoked for each element in array to generate the criterion by which uniqueness is computed.
+// FindDuplicatesBy returns a slice with the first occurrence of each duplicated element in the collection.
+// The order of result values is determined by the order they occur in the slice. It accepts `iteratee` which is
+// invoked for each element in the slice to generate the criterion by which uniqueness is computed.
func FindDuplicatesBy[T any, U comparable, Slice ~[]T](collection Slice, iteratee func(item T) U) Slice {
isDupl := make(map[U]bool, len(collection))
@@ -221,122 +261,123 @@ func FindDuplicatesBy[T any, U comparable, Slice ~[]T](collection Slice, iterate
// Min search the minimum value of a collection.
// Returns zero value when the collection is empty.
+// Play: https://go.dev/play/p/r6e-Z8JozS8
func Min[T constraints.Ordered](collection []T) T {
- var min T
+ var mIn T
if len(collection) == 0 {
- return min
+ return mIn
}
- min = collection[0]
+ mIn = collection[0]
for i := 1; i < len(collection); i++ {
item := collection[i]
- if item < min {
- min = item
+ if item < mIn {
+ mIn = item
}
}
- return min
+ return mIn
}
// MinIndex search the minimum value of a collection and the index of the minimum value.
// Returns (zero value, -1) when the collection is empty.
func MinIndex[T constraints.Ordered](collection []T) (T, int) {
var (
- min T
+ mIn T
index int
)
if len(collection) == 0 {
- return min, -1
+ return mIn, -1
}
- min = collection[0]
+ mIn = collection[0]
for i := 1; i < len(collection); i++ {
item := collection[i]
- if item < min {
- min = item
+ if item < mIn {
+ mIn = item
index = i
}
}
- return min, index
+ return mIn, index
}
// MinBy search the minimum value of a collection using the given comparison function.
// If several values of the collection are equal to the smallest value, returns the first such value.
// Returns zero value when the collection is empty.
-func MinBy[T any](collection []T, comparison func(a T, b T) bool) T {
- var min T
+func MinBy[T any](collection []T, comparison func(a, b T) bool) T {
+ var mIn T
if len(collection) == 0 {
- return min
+ return mIn
}
- min = collection[0]
+ mIn = collection[0]
for i := 1; i < len(collection); i++ {
item := collection[i]
- if comparison(item, min) {
- min = item
+ if comparison(item, mIn) {
+ mIn = item
}
}
- return min
+ return mIn
}
// MinIndexBy search the minimum value of a collection using the given comparison function and the index of the minimum value.
// If several values of the collection are equal to the smallest value, returns the first such value.
// Returns (zero value, -1) when the collection is empty.
-func MinIndexBy[T any](collection []T, comparison func(a T, b T) bool) (T, int) {
+func MinIndexBy[T any](collection []T, comparison func(a, b T) bool) (T, int) {
var (
- min T
+ mIn T
index int
)
if len(collection) == 0 {
- return min, -1
+ return mIn, -1
}
- min = collection[0]
+ mIn = collection[0]
for i := 1; i < len(collection); i++ {
item := collection[i]
- if comparison(item, min) {
- min = item
+ if comparison(item, mIn) {
+ mIn = item
index = i
}
}
- return min, index
+ return mIn, index
}
// Earliest search the minimum time.Time of a collection.
// Returns zero value when the collection is empty.
func Earliest(times ...time.Time) time.Time {
- var min time.Time
+ var mIn time.Time
if len(times) == 0 {
- return min
+ return mIn
}
- min = times[0]
+ mIn = times[0]
for i := 1; i < len(times); i++ {
item := times[i]
- if item.Before(min) {
- min = item
+ if item.Before(mIn) {
+ mIn = item
}
}
- return min
+ return mIn
}
// EarliestBy search the minimum time.Time of a collection using the given iteratee function.
@@ -365,122 +406,123 @@ func EarliestBy[T any](collection []T, iteratee func(item T) time.Time) T {
// Max searches the maximum value of a collection.
// Returns zero value when the collection is empty.
+// Play: https://go.dev/play/p/r6e-Z8JozS8
func Max[T constraints.Ordered](collection []T) T {
- var max T
+ var mAx T
if len(collection) == 0 {
- return max
+ return mAx
}
- max = collection[0]
+ mAx = collection[0]
for i := 1; i < len(collection); i++ {
item := collection[i]
- if item > max {
- max = item
+ if item > mAx {
+ mAx = item
}
}
- return max
+ return mAx
}
// MaxIndex searches the maximum value of a collection and the index of the maximum value.
// Returns (zero value, -1) when the collection is empty.
func MaxIndex[T constraints.Ordered](collection []T) (T, int) {
var (
- max T
+ mAx T
index int
)
if len(collection) == 0 {
- return max, -1
+ return mAx, -1
}
- max = collection[0]
+ mAx = collection[0]
for i := 1; i < len(collection); i++ {
item := collection[i]
- if item > max {
- max = item
+ if item > mAx {
+ mAx = item
index = i
}
}
- return max, index
+ return mAx, index
}
// MaxBy search the maximum value of a collection using the given comparison function.
// If several values of the collection are equal to the greatest value, returns the first such value.
// Returns zero value when the collection is empty.
-func MaxBy[T any](collection []T, comparison func(a T, b T) bool) T {
- var max T
+func MaxBy[T any](collection []T, comparison func(a, b T) bool) T {
+ var mAx T
if len(collection) == 0 {
- return max
+ return mAx
}
- max = collection[0]
+ mAx = collection[0]
for i := 1; i < len(collection); i++ {
item := collection[i]
- if comparison(item, max) {
- max = item
+ if comparison(item, mAx) {
+ mAx = item
}
}
- return max
+ return mAx
}
// MaxIndexBy search the maximum value of a collection using the given comparison function and the index of the maximum value.
// If several values of the collection are equal to the greatest value, returns the first such value.
// Returns (zero value, -1) when the collection is empty.
-func MaxIndexBy[T any](collection []T, comparison func(a T, b T) bool) (T, int) {
+func MaxIndexBy[T any](collection []T, comparison func(a, b T) bool) (T, int) {
var (
- max T
+ mAx T
index int
)
if len(collection) == 0 {
- return max, -1
+ return mAx, -1
}
- max = collection[0]
+ mAx = collection[0]
for i := 1; i < len(collection); i++ {
item := collection[i]
- if comparison(item, max) {
- max = item
+ if comparison(item, mAx) {
+ mAx = item
index = i
}
}
- return max, index
+ return mAx, index
}
// Latest search the maximum time.Time of a collection.
// Returns zero value when the collection is empty.
func Latest(times ...time.Time) time.Time {
- var max time.Time
+ var mAx time.Time
if len(times) == 0 {
- return max
+ return mAx
}
- max = times[0]
+ mAx = times[0]
for i := 1; i < len(times); i++ {
item := times[i]
- if item.After(max) {
- max = item
+ if item.After(mAx) {
+ mAx = item
}
}
- return max
+ return mAx
}
// LatestBy search the maximum time.Time of a collection using the given iteratee function.
@@ -508,6 +550,7 @@ func LatestBy[T any](collection []T, iteratee func(item T) time.Time) T {
}
// First returns the first element of a collection and check for availability of the first element.
+// Play: https://go.dev/play/p/ul45Z0y2EFO
func First[T any](collection []T) (T, bool) {
length := len(collection)
@@ -520,12 +563,14 @@ func First[T any](collection []T) (T, bool) {
}
// FirstOrEmpty returns the first element of a collection or zero value if empty.
+// Play: https://go.dev/play/p/ul45Z0y2EFO
func FirstOrEmpty[T any](collection []T) T {
i, _ := First(collection)
return i
}
// FirstOr returns the first element of a collection or the fallback value if empty.
+// Play: https://go.dev/play/p/ul45Z0y2EFO
func FirstOr[T any](collection []T, fallback T) T {
i, ok := First(collection)
if !ok {
@@ -536,6 +581,7 @@ func FirstOr[T any](collection []T, fallback T) T {
}
// Last returns the last element of a collection or error if empty.
+// Play: https://go.dev/play/p/ul45Z0y2EFO
func Last[T any](collection []T) (T, bool) {
length := len(collection)
@@ -548,12 +594,14 @@ func Last[T any](collection []T) (T, bool) {
}
// LastOrEmpty returns the last element of a collection or zero value if empty.
+// Play: https://go.dev/play/p/ul45Z0y2EFO
func LastOrEmpty[T any](collection []T) T {
i, _ := Last(collection)
return i
}
// LastOr returns the last element of a collection or the fallback value if empty.
+// Play: https://go.dev/play/p/ul45Z0y2EFO
func LastOr[T any](collection []T, fallback T) T {
i, ok := Last(collection)
if !ok {
@@ -565,6 +613,7 @@ func LastOr[T any](collection []T, fallback T) T {
// Nth returns the element at index `nth` of collection. If `nth` is negative, the nth element
// from the end is returned. An error is returned when nth is out of slice bounds.
+// Play: https://go.dev/play/p/sHoh88KWt6B
func Nth[T any, N constraints.Integer](collection []T, nth N) (T, error) {
n := int(nth)
l := len(collection)
@@ -582,6 +631,7 @@ func Nth[T any, N constraints.Integer](collection []T, nth N) (T, error) {
// NthOr returns the element at index `nth` of collection.
// If `nth` is negative, it returns the nth element from the end.
// If `nth` is out of slice bounds, it returns the fallback value instead of an error.
+// Play: https://go.dev/play/p/sHoh88KWt6B
func NthOr[T any, N constraints.Integer](collection []T, nth N, fallback T) T {
value, err := Nth(collection, nth)
if err != nil {
@@ -593,6 +643,7 @@ func NthOr[T any, N constraints.Integer](collection []T, nth N, fallback T) T {
// NthOrEmpty returns the element at index `nth` of collection.
// If `nth` is negative, it returns the nth element from the end.
// If `nth` is out of slice bounds, it returns the zero value (empty value) for that type.
+// Play: https://go.dev/play/p/sHoh88KWt6B
func NthOrEmpty[T any, N constraints.Integer](collection []T, nth N) T {
value, err := Nth(collection, nth)
if err != nil {
@@ -603,16 +654,18 @@ func NthOrEmpty[T any, N constraints.Integer](collection []T, nth N) T {
}
// randomIntGenerator is a function that should return a random integer in the range [0, n)
-// where n is the parameter passed to the randomIntGenerator.
+// where n is the argument passed to the randomIntGenerator.
type randomIntGenerator func(n int) int
// Sample returns a random item from collection.
+// Play: https://go.dev/play/p/vCcSJbh5s6l
func Sample[T any](collection []T) T {
- result := SampleBy(collection, rand.IntN)
+ result := SampleBy(collection, xrand.IntN)
return result
}
// SampleBy returns a random item from collection, using randomIntGenerator as the random index generator.
+// Play: https://go.dev/play/p/HDmKmMgq0XN
func SampleBy[T any](collection []T, randomIntGenerator randomIntGenerator) T {
size := len(collection)
if size == 0 {
@@ -622,16 +675,18 @@ func SampleBy[T any](collection []T, randomIntGenerator randomIntGenerator) T {
}
// Samples returns N random unique items from collection.
+// Play: https://go.dev/play/p/vCcSJbh5s6l
func Samples[T any, Slice ~[]T](collection Slice, count int) Slice {
- results := SamplesBy(collection, count, rand.IntN)
+ results := SamplesBy(collection, count, xrand.IntN)
return results
}
// SamplesBy returns N random unique items from collection, using randomIntGenerator as the random index generator.
+// Play: https://go.dev/play/p/HDmKmMgq0XN
func SamplesBy[T any, Slice ~[]T](collection Slice, count int, randomIntGenerator randomIntGenerator) Slice {
size := len(collection)
- copy := append(Slice{}, collection...)
+ cOpy := append(Slice{}, collection...)
results := Slice{}
@@ -639,12 +694,12 @@ func SamplesBy[T any, Slice ~[]T](collection Slice, count int, randomIntGenerato
copyLength := size - i
index := randomIntGenerator(size - i)
- results = append(results, copy[index])
+ results = append(results, cOpy[index])
// Removes element.
// It is faster to swap with last element and remove it.
- copy[index] = copy[copyLength-1]
- copy = copy[:copyLength-1]
+ cOpy[index] = cOpy[copyLength-1]
+ cOpy = cOpy[:copyLength-1]
}
return results
diff --git a/vendor/github.com/samber/lo/func.go b/vendor/github.com/samber/lo/func.go
index 5fa1cbc871..c1e9c93bdf 100644
--- a/vendor/github.com/samber/lo/func.go
+++ b/vendor/github.com/samber/lo/func.go
@@ -1,6 +1,7 @@
package lo
// Partial returns new function that, when called, has its first argument set to the provided value.
+// Play: https://go.dev/play/p/Sy1gAQiQZ3v
func Partial[T1, T2, R any](f func(a T1, b T2) R, arg1 T1) func(T2) R {
return func(t2 T2) R {
return f(arg1, t2)
@@ -8,11 +9,13 @@ func Partial[T1, T2, R any](f func(a T1, b T2) R, arg1 T1) func(T2) R {
}
// Partial1 returns new function that, when called, has its first argument set to the provided value.
+// Play: https://go.dev/play/p/D-ASTXCLBzw
func Partial1[T1, T2, R any](f func(T1, T2) R, arg1 T1) func(T2) R {
return Partial(f, arg1)
}
// Partial2 returns new function that, when called, has its first argument set to the provided value.
+// Play: https://go.dev/play/p/-xiPjy4JChJ
func Partial2[T1, T2, T3, R any](f func(T1, T2, T3) R, arg1 T1) func(T2, T3) R {
return func(t2 T2, t3 T3) R {
return f(arg1, t2, t3)
@@ -20,6 +23,7 @@ func Partial2[T1, T2, T3, R any](f func(T1, T2, T3) R, arg1 T1) func(T2, T3) R {
}
// Partial3 returns new function that, when called, has its first argument set to the provided value.
+// Play: https://go.dev/play/p/zWtSutpI26m
func Partial3[T1, T2, T3, T4, R any](f func(T1, T2, T3, T4) R, arg1 T1) func(T2, T3, T4) R {
return func(t2 T2, t3 T3, t4 T4) R {
return f(arg1, t2, t3, t4)
@@ -27,13 +31,15 @@ func Partial3[T1, T2, T3, T4, R any](f func(T1, T2, T3, T4) R, arg1 T1) func(T2,
}
// Partial4 returns new function that, when called, has its first argument set to the provided value.
+// Play: https://go.dev/play/p/kBrnnMTcJm0
func Partial4[T1, T2, T3, T4, T5, R any](f func(T1, T2, T3, T4, T5) R, arg1 T1) func(T2, T3, T4, T5) R {
return func(t2 T2, t3 T3, t4 T4, t5 T5) R {
return f(arg1, t2, t3, t4, t5)
}
}
-// Partial5 returns new function that, when called, has its first argument set to the provided value
+// Partial5 returns new function that, when called, has its first argument set to the provided value.
+// Play: https://go.dev/play/p/7Is7K2y_VC3
func Partial5[T1, T2, T3, T4, T5, T6, R any](f func(T1, T2, T3, T4, T5, T6) R, arg1 T1) func(T2, T3, T4, T5, T6) R {
return func(t2 T2, t3 T3, t4 T4, t5 T5, t6 T6) R {
return f(arg1, t2, t3, t4, t5, t6)
diff --git a/vendor/github.com/samber/lo/internal/constraints/README.md b/vendor/github.com/samber/lo/internal/constraints/README.md
new file mode 100644
index 0000000000..27a3b1c49a
--- /dev/null
+++ b/vendor/github.com/samber/lo/internal/constraints/README.md
@@ -0,0 +1,4 @@
+
+# Constraints
+
+This package is for Go 1.18 retrocompatiblity purpose.
diff --git a/vendor/github.com/samber/lo/internal/constraints/ordered_go121.go b/vendor/github.com/samber/lo/internal/constraints/ordered_go121.go
index c02de93548..085a743641 100644
--- a/vendor/github.com/samber/lo/internal/constraints/ordered_go121.go
+++ b/vendor/github.com/samber/lo/internal/constraints/ordered_go121.go
@@ -6,4 +6,8 @@ import (
"cmp"
)
+// Ordered is a constraint that permits any ordered type: any type
+// that supports the operators < <= >= >.
+// If future releases of Go add new ordered types,
+// this constraint will be modified to include them.
type Ordered = cmp.Ordered
diff --git a/vendor/github.com/samber/lo/internal/rand/ordered_go122.go b/vendor/github.com/samber/lo/internal/rand/ordered_go122.go
deleted file mode 100644
index 65abf51a7a..0000000000
--- a/vendor/github.com/samber/lo/internal/rand/ordered_go122.go
+++ /dev/null
@@ -1,17 +0,0 @@
-//go:build go1.22
-
-package rand
-
-import "math/rand/v2"
-
-func Shuffle(n int, swap func(i, j int)) {
- rand.Shuffle(n, swap)
-}
-
-func IntN(n int) int {
- return rand.IntN(n)
-}
-
-func Int64() int64 {
- return rand.Int64()
-}
diff --git a/vendor/github.com/samber/lo/internal/rand/ordered_go118.go b/vendor/github.com/samber/lo/internal/xrand/ordered_go118.go
similarity index 53%
rename from vendor/github.com/samber/lo/internal/rand/ordered_go118.go
rename to vendor/github.com/samber/lo/internal/xrand/ordered_go118.go
index 9fbc5385a0..410a5f3427 100644
--- a/vendor/github.com/samber/lo/internal/rand/ordered_go118.go
+++ b/vendor/github.com/samber/lo/internal/xrand/ordered_go118.go
@@ -1,22 +1,28 @@
//go:build !go1.22
-package rand
+package xrand
import "math/rand"
+// Shuffle returns a slice of shuffled values. Uses the Fisher-Yates shuffle algorithm.
func Shuffle(n int, swap func(i, j int)) {
rand.Shuffle(n, swap)
}
+// IntN returns, as an int, a pseudo-random number in the half-open interval [0,n)
+// from the default Source.
+// It panics if n <= 0.
func IntN(n int) int {
// bearer:disable go_gosec_crypto_weak_random
return rand.Intn(n)
}
+// Int64 returns a non-negative pseudo-random 63-bit integer as an int64
+// from the default Source.
func Int64() int64 {
// bearer:disable go_gosec_crypto_weak_random
n := rand.Int63()
-
+
// bearer:disable go_gosec_crypto_weak_random
if rand.Intn(2) == 0 {
return -n
diff --git a/vendor/github.com/samber/lo/internal/xrand/ordered_go122.go b/vendor/github.com/samber/lo/internal/xrand/ordered_go122.go
new file mode 100644
index 0000000000..6bca250e2c
--- /dev/null
+++ b/vendor/github.com/samber/lo/internal/xrand/ordered_go122.go
@@ -0,0 +1,23 @@
+//go:build go1.22
+
+package xrand
+
+import "math/rand/v2"
+
+// Shuffle returns a slice of shuffled values. Uses the Fisher-Yates shuffle algorithm.
+func Shuffle(n int, swap func(i, j int)) {
+ rand.Shuffle(n, swap)
+}
+
+// IntN returns, as an int, a pseudo-random number in the half-open interval [0,n)
+// from the default Source.
+// It panics if n <= 0.
+func IntN(n int) int {
+ return rand.IntN(n)
+}
+
+// Int64 returns a non-negative pseudo-random 63-bit integer as an int64
+// from the default Source.
+func Int64() int64 {
+ return rand.Int64()
+}
diff --git a/vendor/github.com/samber/lo/internal/xtime/README.md b/vendor/github.com/samber/lo/internal/xtime/README.md
new file mode 100644
index 0000000000..73acd1e5fb
--- /dev/null
+++ b/vendor/github.com/samber/lo/internal/xtime/README.md
@@ -0,0 +1,6 @@
+
+# xtime
+
+Lightweight mock for time package.
+
+A dedicated package such as [jonboulle/clockwork](https://github.com/jonboulle/clockwork/) would be better, but I would rather limit dependencies for this package. `clockwork` does not support Go 1.18 anymore.
diff --git a/vendor/github.com/samber/lo/internal/xtime/fake.go b/vendor/github.com/samber/lo/internal/xtime/fake.go
new file mode 100644
index 0000000000..380e238acb
--- /dev/null
+++ b/vendor/github.com/samber/lo/internal/xtime/fake.go
@@ -0,0 +1,40 @@
+//nolint:revive
+package xtime
+
+import (
+ "time"
+)
+
+func NewFakeClock() *FakeClock {
+ return NewFakeClockAt(time.Now())
+}
+
+func NewFakeClockAt(t time.Time) *FakeClock {
+ return &FakeClock{
+ time: t,
+ }
+}
+
+type FakeClock struct {
+ _ noCopy
+
+ // Not protected by a mutex. If a warning is thrown in your tests,
+ // just disable parallel tests.
+ time time.Time
+}
+
+func (c *FakeClock) Now() time.Time {
+ return c.time
+}
+
+func (c *FakeClock) Since(t time.Time) time.Duration {
+ return c.time.Sub(t)
+}
+
+func (c *FakeClock) Until(t time.Time) time.Duration {
+ return t.Sub(c.time)
+}
+
+func (c *FakeClock) Sleep(d time.Duration) {
+ c.time = c.time.Add(d)
+}
diff --git a/vendor/github.com/samber/lo/internal/xtime/noCopy.go b/vendor/github.com/samber/lo/internal/xtime/noCopy.go
new file mode 100644
index 0000000000..9d425adf71
--- /dev/null
+++ b/vendor/github.com/samber/lo/internal/xtime/noCopy.go
@@ -0,0 +1,14 @@
+package xtime
+
+// noCopy may be added to structs which must not be copied
+// after the first use.
+//
+// See https://golang.org/issues/8005#issuecomment-190753527
+// for details.
+//
+// Note that it must not be embedded, due to the Lock and Unlock methods.
+type noCopy struct{}
+
+// Lock is a no-op used by -copylocks checker from `go vet`.
+func (*noCopy) Lock() {}
+func (*noCopy) Unlock() {}
diff --git a/vendor/github.com/samber/lo/internal/xtime/real.go b/vendor/github.com/samber/lo/internal/xtime/real.go
new file mode 100644
index 0000000000..df5a8dbde4
--- /dev/null
+++ b/vendor/github.com/samber/lo/internal/xtime/real.go
@@ -0,0 +1,30 @@
+//nolint:revive
+package xtime
+
+import (
+ "time"
+)
+
+func NewRealClock() *RealClock {
+ return &RealClock{}
+}
+
+type RealClock struct {
+ _ noCopy
+}
+
+func (c *RealClock) Now() time.Time {
+ return time.Now()
+}
+
+func (c *RealClock) Since(t time.Time) time.Duration {
+ return time.Since(t)
+}
+
+func (c *RealClock) Until(t time.Time) time.Duration {
+ return time.Until(t)
+}
+
+func (c *RealClock) Sleep(d time.Duration) {
+ time.Sleep(d)
+}
diff --git a/vendor/github.com/samber/lo/internal/xtime/time.go b/vendor/github.com/samber/lo/internal/xtime/time.go
new file mode 100644
index 0000000000..093a959ece
--- /dev/null
+++ b/vendor/github.com/samber/lo/internal/xtime/time.go
@@ -0,0 +1,33 @@
+//nolint:revive
+package xtime
+
+import "time"
+
+var clock Clock = &RealClock{}
+
+func SetClock(c Clock) {
+ clock = c
+}
+
+func Now() time.Time {
+ return clock.Now()
+}
+
+func Since(t time.Time) time.Duration {
+ return clock.Since(t)
+}
+
+func Until(t time.Time) time.Duration {
+ return clock.Until(t)
+}
+
+func Sleep(d time.Duration) {
+ clock.Sleep(d)
+}
+
+type Clock interface {
+ Now() time.Time
+ Since(t time.Time) time.Duration
+ Until(t time.Time) time.Duration
+ Sleep(d time.Duration)
+}
diff --git a/vendor/github.com/samber/lo/intersect.go b/vendor/github.com/samber/lo/intersect.go
index c57bd81719..6c79f9997d 100644
--- a/vendor/github.com/samber/lo/intersect.go
+++ b/vendor/github.com/samber/lo/intersect.go
@@ -1,6 +1,7 @@
package lo
// Contains returns true if an element is present in a collection.
+// Play: https://go.dev/play/p/W1EvyqY6t9j
func Contains[T comparable](collection []T, element T) bool {
for i := range collection {
if collection[i] == element {
@@ -12,6 +13,7 @@ func Contains[T comparable](collection []T, element T) bool {
}
// ContainsBy returns true if predicate function return true.
+// Play: https://go.dev/play/p/W1EvyqY6t9j
func ContainsBy[T any](collection []T, predicate func(item T) bool) bool {
for i := range collection {
if predicate(collection[i]) {
@@ -22,8 +24,9 @@ func ContainsBy[T any](collection []T, predicate func(item T) bool) bool {
return false
}
-// Every returns true if all elements of a subset are contained into a collection or if the subset is empty.
-func Every[T comparable](collection []T, subset []T) bool {
+// Every returns true if all elements of a subset are contained in a collection or if the subset is empty.
+// Play: https://go.dev/play/p/W1EvyqY6t9j
+func Every[T comparable](collection, subset []T) bool {
for i := range subset {
if !Contains(collection, subset[i]) {
return false
@@ -34,6 +37,7 @@ func Every[T comparable](collection []T, subset []T) bool {
}
// EveryBy returns true if the predicate returns true for all elements in the collection or if the collection is empty.
+// Play: https://go.dev/play/p/dn1-vhHsq9x
func EveryBy[T any](collection []T, predicate func(item T) bool) bool {
for i := range collection {
if !predicate(collection[i]) {
@@ -44,9 +48,10 @@ func EveryBy[T any](collection []T, predicate func(item T) bool) bool {
return true
}
-// Some returns true if at least 1 element of a subset is contained into a collection.
+// Some returns true if at least 1 element of a subset is contained in a collection.
// If the subset is empty Some returns false.
-func Some[T comparable](collection []T, subset []T) bool {
+// Play: https://go.dev/play/p/Lj4ceFkeT9V
+func Some[T comparable](collection, subset []T) bool {
for i := range subset {
if Contains(collection, subset[i]) {
return true
@@ -58,6 +63,7 @@ func Some[T comparable](collection []T, subset []T) bool {
// SomeBy returns true if the predicate returns true for any of the elements in the collection.
// If the collection is empty SomeBy returns false.
+// Play: https://go.dev/play/p/DXF-TORBudx
func SomeBy[T any](collection []T, predicate func(item T) bool) bool {
for i := range collection {
if predicate(collection[i]) {
@@ -68,8 +74,9 @@ func SomeBy[T any](collection []T, predicate func(item T) bool) bool {
return false
}
-// None returns true if no element of a subset are contained into a collection or if the subset is empty.
-func None[T comparable](collection []T, subset []T) bool {
+// None returns true if no element of a subset is contained in a collection or if the subset is empty.
+// Play: https://go.dev/play/p/fye7JsmxzPV
+func None[T comparable](collection, subset []T) bool {
for i := range subset {
if Contains(collection, subset[i]) {
return false
@@ -80,6 +87,7 @@ func None[T comparable](collection []T, subset []T) bool {
}
// NoneBy returns true if the predicate returns true for none of the elements in the collection or if the collection is empty.
+// Play: https://go.dev/play/p/O64WZ32H58S
func NoneBy[T any](collection []T, predicate func(item T) bool) bool {
for i := range collection {
if predicate(collection[i]) {
@@ -91,7 +99,8 @@ func NoneBy[T any](collection []T, predicate func(item T) bool) bool {
}
// Intersect returns the intersection between two collections.
-func Intersect[T comparable, Slice ~[]T](list1 Slice, list2 Slice) Slice {
+// Play: https://go.dev/play/p/uuElL9X9e58
+func Intersect[T comparable, Slice ~[]T](list1, list2 Slice) Slice {
result := Slice{}
seen := map[T]struct{}{}
@@ -109,9 +118,10 @@ func Intersect[T comparable, Slice ~[]T](list1 Slice, list2 Slice) Slice {
}
// Difference returns the difference between two collections.
-// The first value is the collection of element absent of list2.
-// The second value is the collection of element absent of list1.
-func Difference[T comparable, Slice ~[]T](list1 Slice, list2 Slice) (Slice, Slice) {
+// The first value is the collection of elements absent from list2.
+// The second value is the collection of elements absent from list1.
+// Play: https://go.dev/play/p/pKE-JgzqRpz
+func Difference[T comparable, Slice ~[]T](list1, list2 Slice) (Slice, Slice) {
left := Slice{}
right := Slice{}
@@ -143,6 +153,7 @@ func Difference[T comparable, Slice ~[]T](list1 Slice, list2 Slice) (Slice, Slic
// Union returns all distinct elements from given collections.
// result returns will not change the order of elements relatively.
+// Play: https://go.dev/play/p/DI9RVEB_qMK
func Union[T comparable, Slice ~[]T](lists ...Slice) Slice {
var capLen int
@@ -165,7 +176,8 @@ func Union[T comparable, Slice ~[]T](lists ...Slice) Slice {
return result
}
-// Without returns slice excluding all given values.
+// Without returns a slice excluding all given values.
+// Play: https://go.dev/play/p/5j30Ux8TaD0
func Without[T comparable, Slice ~[]T](collection Slice, exclude ...T) Slice {
excludeMap := make(map[T]struct{}, len(exclude))
for i := range exclude {
@@ -182,14 +194,15 @@ func Without[T comparable, Slice ~[]T](collection Slice, exclude ...T) Slice {
}
// WithoutBy filters a slice by excluding elements whose extracted keys match any in the exclude list.
-// It returns a new slice containing only the elements whose keys are not in the exclude list.
-func WithoutBy[T any, K comparable](collection []T, iteratee func(item T) K, exclude ...K) []T {
+// Returns a new slice containing only the elements whose keys are not in the exclude list.
+// Play: https://go.dev/play/p/VgWJOF01NbJ
+func WithoutBy[T any, K comparable, Slice ~[]T](collection Slice, iteratee func(item T) K, exclude ...K) Slice {
excludeMap := make(map[K]struct{}, len(exclude))
for _, e := range exclude {
excludeMap[e] = struct{}{}
}
- result := make([]T, 0, len(collection))
+ result := make(Slice, 0, len(collection))
for _, item := range collection {
if _, ok := excludeMap[iteratee(item)]; !ok {
result = append(result, item)
@@ -198,14 +211,15 @@ func WithoutBy[T any, K comparable](collection []T, iteratee func(item T) K, exc
return result
}
-// WithoutEmpty returns slice excluding zero values.
+// WithoutEmpty returns a slice excluding zero values.
//
// Deprecated: Use lo.Compact instead.
func WithoutEmpty[T comparable, Slice ~[]T](collection Slice) Slice {
return Compact(collection)
}
-// WithoutNth returns slice excluding nth value.
+// WithoutNth returns a slice excluding the nth value.
+// Play: https://go.dev/play/p/5g3F9R2H1xL
func WithoutNth[T comparable, Slice ~[]T](collection Slice, nths ...int) Slice {
length := len(collection)
@@ -227,16 +241,18 @@ func WithoutNth[T comparable, Slice ~[]T](collection Slice, nths ...int) Slice {
}
// ElementsMatch returns true if lists contain the same set of elements (including empty set).
-// If there are duplicate elements, the number of appearances of each of them in both lists should match.
+// If there are duplicate elements, the number of occurrences in each list should match.
// The order of elements is not checked.
-func ElementsMatch[T comparable, Slice ~[]T](list1 Slice, list2 Slice) bool {
+// Play: https://go.dev/play/p/XWSEM4Ic_t0
+func ElementsMatch[T comparable, Slice ~[]T](list1, list2 Slice) bool {
return ElementsMatchBy(list1, list2, func(item T) T { return item })
}
// ElementsMatchBy returns true if lists contain the same set of elements' keys (including empty set).
-// If there are duplicate keys, the number of appearances of each of them in both lists should match.
+// If there are duplicate keys, the number of occurrences in each list should match.
// The order of elements is not checked.
-func ElementsMatchBy[T any, K comparable](list1 []T, list2 []T, iteratee func(item T) K) bool {
+// Play: https://go.dev/play/p/XWSEM4Ic_t0
+func ElementsMatchBy[T any, K comparable](list1, list2 []T, iteratee func(item T) K) bool {
if len(list1) != len(list2) {
return false
}
diff --git a/vendor/github.com/samber/lo/map.go b/vendor/github.com/samber/lo/map.go
index 6febb3fddb..cd0e9d72d2 100644
--- a/vendor/github.com/samber/lo/map.go
+++ b/vendor/github.com/samber/lo/map.go
@@ -1,6 +1,6 @@
package lo
-// Keys creates an array of the map keys.
+// Keys creates a slice of the map keys.
// Play: https://go.dev/play/p/Uu11fHASqrU
func Keys[K comparable, V any](in ...map[K]V) []K {
size := 0
@@ -18,7 +18,7 @@ func Keys[K comparable, V any](in ...map[K]V) []K {
return result
}
-// UniqKeys creates an array of unique keys in the map.
+// UniqKeys creates a slice of unique keys in the map.
// Play: https://go.dev/play/p/TPKAb6ILdHk
func UniqKeys[K comparable, V any](in ...map[K]V) []K {
size := 0
@@ -49,7 +49,7 @@ func HasKey[K comparable, V any](in map[K]V, key K) bool {
return ok
}
-// Values creates an array of the map values.
+// Values creates a slice of the map values.
// Play: https://go.dev/play/p/nnRTQkzQfF6
func Values[K comparable, V any](in ...map[K]V) []V {
size := 0
@@ -59,17 +59,17 @@ func Values[K comparable, V any](in ...map[K]V) []V {
result := make([]V, 0, size)
for i := range in {
- for k := range in[i] {
- result = append(result, in[i][k])
+ for _, v := range in[i] {
+ result = append(result, v)
}
}
return result
}
-// UniqValues creates an array of unique values in the map.
+// UniqValues creates a slice of unique values in the map.
// Play: https://go.dev/play/p/nf6bXMh7rM3
-func UniqValues[K comparable, V comparable](in ...map[K]V) []V {
+func UniqValues[K, V comparable](in ...map[K]V) []V {
size := 0
for i := range in {
size += len(in[i])
@@ -79,13 +79,12 @@ func UniqValues[K comparable, V comparable](in ...map[K]V) []V {
result := make([]V, 0)
for i := range in {
- for k := range in[i] {
- val := in[i][k]
- if _, exists := seen[val]; exists {
+ for _, v := range in[i] {
+ if _, exists := seen[v]; exists {
continue
}
- seen[val] = struct{}{}
- result = append(result, val)
+ seen[v] = struct{}{}
+ result = append(result, v)
}
}
@@ -105,9 +104,9 @@ func ValueOr[K comparable, V any](in map[K]V, key K, fallback V) V {
// Play: https://go.dev/play/p/kdg8GR_QMmf
func PickBy[K comparable, V any, Map ~map[K]V](in Map, predicate func(key K, value V) bool) Map {
r := Map{}
- for k := range in {
- if predicate(k, in[k]) {
- r[k] = in[k]
+ for k, v := range in {
+ if predicate(k, v) {
+ r[k] = v
}
}
return r
@@ -127,11 +126,11 @@ func PickByKeys[K comparable, V any, Map ~map[K]V](in Map, keys []K) Map {
// PickByValues returns same map type filtered by given values.
// Play: https://go.dev/play/p/1zdzSvbfsJc
-func PickByValues[K comparable, V comparable, Map ~map[K]V](in Map, values []V) Map {
+func PickByValues[K, V comparable, Map ~map[K]V](in Map, values []V) Map {
r := Map{}
- for k := range in {
- if Contains(values, in[k]) {
- r[k] = in[k]
+ for k, v := range in {
+ if Contains(values, v) {
+ r[k] = v
}
}
return r
@@ -141,9 +140,9 @@ func PickByValues[K comparable, V comparable, Map ~map[K]V](in Map, values []V)
// Play: https://go.dev/play/p/EtBsR43bdsd
func OmitBy[K comparable, V any, Map ~map[K]V](in Map, predicate func(key K, value V) bool) Map {
r := Map{}
- for k := range in {
- if !predicate(k, in[k]) {
- r[k] = in[k]
+ for k, v := range in {
+ if !predicate(k, v) {
+ r[k] = v
}
}
return r
@@ -153,8 +152,8 @@ func OmitBy[K comparable, V any, Map ~map[K]V](in Map, predicate func(key K, val
// Play: https://go.dev/play/p/t1QjCrs-ysk
func OmitByKeys[K comparable, V any, Map ~map[K]V](in Map, keys []K) Map {
r := Map{}
- for k := range in {
- r[k] = in[k]
+ for k, v := range in {
+ r[k] = v
}
for i := range keys {
delete(r, keys[i])
@@ -164,39 +163,39 @@ func OmitByKeys[K comparable, V any, Map ~map[K]V](in Map, keys []K) Map {
// OmitByValues returns same map type filtered by given values.
// Play: https://go.dev/play/p/9UYZi-hrs8j
-func OmitByValues[K comparable, V comparable, Map ~map[K]V](in Map, values []V) Map {
+func OmitByValues[K, V comparable, Map ~map[K]V](in Map, values []V) Map {
r := Map{}
- for k := range in {
- if !Contains(values, in[k]) {
- r[k] = in[k]
+ for k, v := range in {
+ if !Contains(values, v) {
+ r[k] = v
}
}
return r
}
-// Entries transforms a map into array of key/value pairs.
-// Play:
+// Entries transforms a map into a slice of key/value pairs.
+// Play: https://go.dev/play/p/_t4Xe34-Nl5
func Entries[K comparable, V any](in map[K]V) []Entry[K, V] {
entries := make([]Entry[K, V], 0, len(in))
- for k := range in {
+ for k, v := range in {
entries = append(entries, Entry[K, V]{
Key: k,
- Value: in[k],
+ Value: v,
})
}
return entries
}
-// ToPairs transforms a map into array of key/value pairs.
+// ToPairs transforms a map into a slice of key/value pairs.
// Alias of Entries().
// Play: https://go.dev/play/p/3Dhgx46gawJ
func ToPairs[K comparable, V any](in map[K]V) []Entry[K, V] {
return Entries(in)
}
-// FromEntries transforms an array of key/value pairs into a map.
+// FromEntries transforms a slice of key/value pairs into a map.
// Play: https://go.dev/play/p/oIr5KHFGCEN
func FromEntries[K comparable, V any](entries []Entry[K, V]) map[K]V {
out := make(map[K]V, len(entries))
@@ -208,7 +207,7 @@ func FromEntries[K comparable, V any](entries []Entry[K, V]) map[K]V {
return out
}
-// FromPairs transforms an array of key/value pairs into a map.
+// FromPairs transforms a slice of key/value pairs into a map.
// Alias of FromEntries().
// Play: https://go.dev/play/p/oIr5KHFGCEN
func FromPairs[K comparable, V any](entries []Entry[K, V]) map[K]V {
@@ -219,11 +218,11 @@ func FromPairs[K comparable, V any](entries []Entry[K, V]) map[K]V {
// contains duplicate values, subsequent values overwrite property assignments
// of previous values.
// Play: https://go.dev/play/p/rFQ4rak6iA1
-func Invert[K comparable, V comparable](in map[K]V) map[V]K {
+func Invert[K, V comparable](in map[K]V) map[V]K {
out := make(map[V]K, len(in))
- for k := range in {
- out[in[k]] = k
+ for k, v := range in {
+ out[v] = k
}
return out
@@ -239,20 +238,20 @@ func Assign[K comparable, V any, Map ~map[K]V](maps ...Map) Map {
out := make(Map, count)
for i := range maps {
- for k := range maps[i] {
- out[k] = maps[i][k]
+ for k, v := range maps[i] {
+ out[k] = v
}
}
return out
}
-// ChunkEntries splits a map into an array of elements in groups of a length equal to its size. If the map cannot be split evenly,
+// ChunkEntries splits a map into a slice of elements in groups of length equal to its size. If the map cannot be split evenly,
// the final chunk will contain the remaining elements.
// Play: https://go.dev/play/p/X_YQL6mmoD-
func ChunkEntries[K comparable, V any](m map[K]V, size int) []map[K]V {
if size <= 0 {
- panic("The chunk size must be greater than 0")
+ panic("lo.ChunkEntries: size must be greater than 0")
}
count := len(m)
@@ -262,7 +261,7 @@ func ChunkEntries[K comparable, V any](m map[K]V, size int) []map[K]V {
chunksNum := count / size
if count%size != 0 {
- chunksNum += 1
+ chunksNum++
}
result := make([]map[K]V, 0, chunksNum)
@@ -278,31 +277,31 @@ func ChunkEntries[K comparable, V any](m map[K]V, size int) []map[K]V {
return result
}
-// MapKeys manipulates a map keys and transforms it to a map of another type.
+// MapKeys manipulates map keys and transforms it to a map of another type.
// Play: https://go.dev/play/p/9_4WPIqOetJ
func MapKeys[K comparable, V any, R comparable](in map[K]V, iteratee func(value V, key K) R) map[R]V {
result := make(map[R]V, len(in))
- for k := range in {
- result[iteratee(in[k], k)] = in[k]
+ for k, v := range in {
+ result[iteratee(v, k)] = v
}
return result
}
-// MapValues manipulates a map values and transforms it to a map of another type.
+// MapValues manipulates map values and transforms it to a map of another type.
// Play: https://go.dev/play/p/T_8xAfvcf0W
-func MapValues[K comparable, V any, R any](in map[K]V, iteratee func(value V, key K) R) map[K]R {
+func MapValues[K comparable, V, R any](in map[K]V, iteratee func(value V, key K) R) map[K]R {
result := make(map[K]R, len(in))
- for k := range in {
- result[k] = iteratee(in[k], k)
+ for k, v := range in {
+ result[k] = iteratee(v, k)
}
return result
}
-// MapEntries manipulates a map entries and transforms it to a map of another type.
+// MapEntries manipulates map entries and transforms it to a map of another type.
// Play: https://go.dev/play/p/VuvNQzxKimT
func MapEntries[K1 comparable, V1 any, K2 comparable, V2 any](in map[K1]V1, iteratee func(key K1, value V1) (K2, V2)) map[K2]V2 {
result := make(map[K2]V2, len(in))
@@ -315,27 +314,58 @@ func MapEntries[K1 comparable, V1 any, K2 comparable, V2 any](in map[K1]V1, iter
return result
}
-// MapToSlice transforms a map into a slice based on specific iteratee
+// MapToSlice transforms a map into a slice based on specified iteratee.
// Play: https://go.dev/play/p/ZuiCZpDt6LD
-func MapToSlice[K comparable, V any, R any](in map[K]V, iteratee func(key K, value V) R) []R {
+func MapToSlice[K comparable, V, R any](in map[K]V, iteratee func(key K, value V) R) []R {
result := make([]R, 0, len(in))
- for k := range in {
- result = append(result, iteratee(k, in[k]))
+ for k, v := range in {
+ result = append(result, iteratee(k, v))
}
return result
}
-// FilterMapToSlice transforms a map into a slice based on specific iteratee.
+// FilterMapToSlice transforms a map into a slice based on specified iteratee.
// The iteratee returns a value and a boolean. If the boolean is true, the value is added to the result slice.
// If the boolean is false, the value is not added to the result slice.
// The order of the keys in the input map is not specified and the order of the keys in the output slice is not guaranteed.
-func FilterMapToSlice[K comparable, V any, R any](in map[K]V, iteratee func(key K, value V) (R, bool)) []R {
+// Play: https://go.dev/play/p/jgsD_Kil9pV
+func FilterMapToSlice[K comparable, V, R any](in map[K]V, iteratee func(key K, value V) (R, bool)) []R {
result := make([]R, 0, len(in))
- for k := range in {
- if v, ok := iteratee(k, in[k]); ok {
+ for k, v := range in {
+ if v, ok := iteratee(k, v); ok {
+ result = append(result, v)
+ }
+ }
+
+ return result
+}
+
+// FilterKeys transforms a map into a slice based on predicate returns true for specific elements.
+// It is a mix of lo.Filter() and lo.Keys().
+// Play: https://go.dev/play/p/OFlKXlPrBAe
+func FilterKeys[K comparable, V any](in map[K]V, predicate func(key K, value V) bool) []K {
+ result := make([]K, 0)
+
+ for k, v := range in {
+ if predicate(k, v) {
+ result = append(result, k)
+ }
+ }
+
+ return result
+}
+
+// FilterValues transforms a map into a slice based on predicate returns true for specific elements.
+// It is a mix of lo.Filter() and lo.Values().
+// Play: https://go.dev/play/p/YVD5r_h-LX-
+func FilterValues[K comparable, V any](in map[K]V, predicate func(key K, value V) bool) []V {
+ result := make([]V, 0)
+
+ for k, v := range in {
+ if predicate(k, v) {
result = append(result, v)
}
}
diff --git a/vendor/github.com/samber/lo/math.go b/vendor/github.com/samber/lo/math.go
index e3f4289269..9342b59e7f 100644
--- a/vendor/github.com/samber/lo/math.go
+++ b/vendor/github.com/samber/lo/math.go
@@ -4,7 +4,7 @@ import (
"github.com/samber/lo/internal/constraints"
)
-// Range creates an array of numbers (positive and/or negative) with given length.
+// Range creates a slice of numbers (positive and/or negative) with given length.
// Play: https://go.dev/play/p/0r6VimXAi9H
func Range(elementNum int) []int {
length := If(elementNum < 0, -elementNum).Else(elementNum)
@@ -16,7 +16,7 @@ func Range(elementNum int) []int {
return result
}
-// RangeFrom creates an array of numbers from start with specified length.
+// RangeFrom creates a slice of numbers from start with specified length.
// Play: https://go.dev/play/p/0r6VimXAi9H
func RangeFrom[T constraints.Integer | constraints.Float](start T, elementNum int) []T {
length := If(elementNum < 0, -elementNum).Else(elementNum)
@@ -28,8 +28,8 @@ func RangeFrom[T constraints.Integer | constraints.Float](start T, elementNum in
return result
}
-// RangeWithSteps creates an array of numbers (positive and/or negative) progressing from start up to, but not including end.
-// step set to zero will return empty array.
+// RangeWithSteps creates a slice of numbers (positive and/or negative) progressing from start up to, but not including end.
+// step set to zero will return an empty slice.
// Play: https://go.dev/play/p/0r6VimXAi9H
func RangeWithSteps[T constraints.Integer | constraints.Float](start, end, step T) []T {
result := []T{}
@@ -56,11 +56,11 @@ func RangeWithSteps[T constraints.Integer | constraints.Float](start, end, step
// Clamp clamps number within the inclusive lower and upper bounds.
// Play: https://go.dev/play/p/RU4lJNC2hlI
-func Clamp[T constraints.Ordered](value T, min T, max T) T {
- if value < min {
- return min
- } else if value > max {
- return max
+func Clamp[T constraints.Ordered](value, mIn, mAx T) T {
+ if value < mIn {
+ return mIn
+ } else if value > mAx {
+ return mAx
}
return value
}
@@ -68,7 +68,7 @@ func Clamp[T constraints.Ordered](value T, min T, max T) T {
// Sum sums the values in a collection. If collection is empty 0 is returned.
// Play: https://go.dev/play/p/upfeJVqs4Bt
func Sum[T constraints.Float | constraints.Integer | constraints.Complex](collection []T) T {
- var sum T = 0
+ var sum T
for i := range collection {
sum += collection[i]
}
@@ -78,14 +78,14 @@ func Sum[T constraints.Float | constraints.Integer | constraints.Complex](collec
// SumBy summarizes the values in a collection using the given return value from the iteration function. If collection is empty 0 is returned.
// Play: https://go.dev/play/p/Dz_a_7jN_ca
func SumBy[T any, R constraints.Float | constraints.Integer | constraints.Complex](collection []T, iteratee func(item T) R) R {
- var sum R = 0
+ var sum R
for i := range collection {
- sum = sum + iteratee(collection[i])
+ sum += iteratee(collection[i])
}
return sum
}
-// Product gets the product of the values in a collection. If collection is empty 0 is returned.
+// Product gets the product of the values in a collection. If collection is empty 1 is returned.
// Play: https://go.dev/play/p/2_kjM_smtAH
func Product[T constraints.Float | constraints.Integer | constraints.Complex](collection []T) T {
if collection == nil {
@@ -103,7 +103,7 @@ func Product[T constraints.Float | constraints.Integer | constraints.Complex](co
return product
}
-// ProductBy summarizes the values in a collection using the given return value from the iteration function. If collection is empty 0 is returned.
+// ProductBy summarizes the values in a collection using the given return value from the iteration function. If collection is empty 1 is returned.
// Play: https://go.dev/play/p/wadzrWr9Aer
func ProductBy[T any, R constraints.Float | constraints.Integer | constraints.Complex](collection []T, iteratee func(item T) R) R {
if collection == nil {
@@ -116,27 +116,57 @@ func ProductBy[T any, R constraints.Float | constraints.Integer | constraints.Co
var product R = 1
for i := range collection {
- product = product * iteratee(collection[i])
+ product *= iteratee(collection[i])
}
return product
}
// Mean calculates the mean of a collection of numbers.
+// Play: https://go.dev/play/p/tPURSuteUsP
func Mean[T constraints.Float | constraints.Integer](collection []T) T {
- var length = T(len(collection))
+ length := T(len(collection))
if length == 0 {
return 0
}
- var sum = Sum(collection)
+ sum := Sum(collection)
return sum / length
}
// MeanBy calculates the mean of a collection of numbers using the given return value from the iteration function.
+// Play: https://go.dev/play/p/j7TsVwBOZ7P
func MeanBy[T any, R constraints.Float | constraints.Integer](collection []T, iteratee func(item T) R) R {
- var length = R(len(collection))
+ length := R(len(collection))
if length == 0 {
return 0
}
- var sum = SumBy(collection, iteratee)
+ sum := SumBy(collection, iteratee)
return sum / length
}
+
+// Mode returns the mode (most frequent value) of a collection.
+// If multiple values have the same highest frequency, then multiple values are returned.
+// If the collection is empty, then the zero value of T is returned.
+func Mode[T constraints.Integer | constraints.Float](collection []T) []T {
+ length := T(len(collection))
+ if length == 0 {
+ return []T{}
+ }
+
+ mode := make([]T, 0)
+ maxFreq := 0
+ frequency := make(map[T]int)
+
+ for _, item := range collection {
+ frequency[item]++
+ count := frequency[item]
+
+ if count > maxFreq {
+ maxFreq = count
+ mode = []T{item}
+ } else if count == maxFreq {
+ mode = append(mode, item)
+ }
+ }
+
+ return mode
+}
diff --git a/vendor/github.com/samber/lo/mutable/slice.go b/vendor/github.com/samber/lo/mutable/slice.go
index 969f399553..f3412c1038 100644
--- a/vendor/github.com/samber/lo/mutable/slice.go
+++ b/vendor/github.com/samber/lo/mutable/slice.go
@@ -1,12 +1,13 @@
package mutable
-import "github.com/samber/lo/internal/rand"
+import "github.com/samber/lo/internal/xrand"
// Filter is a generic function that modifies the input slice in-place to contain only the elements
// that satisfy the provided predicate function. The predicate function takes an element of the slice and its index,
// and should return true for elements that should be kept and false for elements that should be removed.
// The function returns the modified slice, which may be shorter than the original if some elements were removed.
// Note that the order of elements in the original slice is preserved in the output.
+// Play: https://go.dev/play/p/0jY3Z0B7O_5
func Filter[T any, Slice ~[]T](collection Slice, predicate func(item T) bool) Slice {
j := 0
for _, item := range collection {
@@ -36,6 +37,7 @@ func FilterI[T any, Slice ~[]T](collection Slice, predicate func(item T, index i
// Map is a generic function that modifies the input slice in-place to contain the result of applying the provided
// function to each element of the slice. The function returns the modified slice, which has the same length as the original.
+// Play: https://go.dev/play/p/0jY3Z0B7O_5
func Map[T any, Slice ~[]T](collection Slice, fn func(item T) T) {
for i := range collection {
collection[i] = fn(collection[i])
@@ -50,21 +52,21 @@ func MapI[T any, Slice ~[]T](collection Slice, fn func(item T, index int) T) {
}
}
-// Shuffle returns an array of shuffled values. Uses the Fisher-Yates shuffle algorithm.
+// Shuffle returns a slice of shuffled values. Uses the Fisher-Yates shuffle algorithm.
// Play: https://go.dev/play/p/2xb3WdLjeSJ
func Shuffle[T any, Slice ~[]T](collection Slice) {
- rand.Shuffle(len(collection), func(i, j int) {
+ xrand.Shuffle(len(collection), func(i, j int) {
collection[i], collection[j] = collection[j], collection[i]
})
}
-// Reverse reverses array so that the first element becomes the last, the second element becomes the second to last, and so on.
+// Reverse reverses a slice so that the first element becomes the last, the second element becomes the second to last, and so on.
// Play: https://go.dev/play/p/O-M5pmCRgzV
func Reverse[T any, Slice ~[]T](collection Slice) {
length := len(collection)
half := length / 2
- for i := 0; i < half; i = i + 1 {
+ for i := 0; i < half; i++ {
j := length - 1 - i
collection[i], collection[j] = collection[j], collection[i]
}
diff --git a/vendor/github.com/samber/lo/retry.go b/vendor/github.com/samber/lo/retry.go
index 5b9cef3dd0..e8b98c4771 100644
--- a/vendor/github.com/samber/lo/retry.go
+++ b/vendor/github.com/samber/lo/retry.go
@@ -3,6 +3,8 @@ package lo
import (
"sync"
"time"
+
+ "github.com/samber/lo/internal/xtime"
)
type debounce struct {
@@ -26,8 +28,13 @@ func (d *debounce) reset() {
}
d.timer = time.AfterFunc(d.after, func() {
- for i := range d.callbacks {
- d.callbacks[i]()
+ // We need to lock the mutex here to avoid race conditions with 2 concurrent calls to reset()
+ d.mu.Lock()
+ callbacks := append([]func(){}, d.callbacks...)
+ d.mu.Unlock()
+
+ for i := range callbacks {
+ callbacks[i]()
}
})
}
@@ -96,13 +103,15 @@ func (d *debounceBy[T]) reset(key T) {
}
item.timer = time.AfterFunc(d.after, func() {
+ // We need to lock the mutex here to avoid race conditions with 2 concurrent calls to reset()
item.mu.Lock()
count := item.count
item.count = 0
+ callbacks := append([]func(key T, count int){}, d.callbacks...)
item.mu.Unlock()
- for i := range d.callbacks {
- d.callbacks[i](key, count)
+ for i := range callbacks {
+ callbacks[i](key, count)
}
})
}
@@ -165,20 +174,20 @@ func Attempt(maxIteration int, f func(index int) error) (int, error) {
func AttemptWithDelay(maxIteration int, delay time.Duration, f func(index int, duration time.Duration) error) (int, time.Duration, error) {
var err error
- start := time.Now()
+ start := xtime.Now()
for i := 0; maxIteration <= 0 || i < maxIteration; i++ {
- err = f(i, time.Since(start))
+ err = f(i, xtime.Since(start))
if err == nil {
- return i + 1, time.Since(start), nil
+ return i + 1, xtime.Since(start), nil
}
if maxIteration <= 0 || i+1 < maxIteration {
- time.Sleep(delay)
+ xtime.Sleep(delay)
}
}
- return maxIteration, time.Since(start), err
+ return maxIteration, xtime.Since(start), err
}
// AttemptWhile invokes a function N times until it returns valid output.
@@ -187,6 +196,7 @@ func AttemptWithDelay(maxIteration int, delay time.Duration, f func(index int, d
// immediately if the second return value is false. When the first
// argument is less than `1`, the function runs until a successful response is
// returned.
+// Play: https://go.dev/play/p/1VS7HxlYMOG
func AttemptWhile(maxIteration int, f func(int) (error, bool)) (int, error) {
var err error
var shouldContinueInvoke bool
@@ -211,27 +221,28 @@ func AttemptWhile(maxIteration int, f func(int) (error, bool)) (int, error) {
// It will terminate the invoke immediately if the second return value is false.
// When the first argument is less than `1`, the function runs until a successful
// response is returned.
+// Play: https://go.dev/play/p/mhufUjJfLEF
func AttemptWhileWithDelay(maxIteration int, delay time.Duration, f func(int, time.Duration) (error, bool)) (int, time.Duration, error) {
var err error
var shouldContinueInvoke bool
- start := time.Now()
+ start := xtime.Now()
for i := 0; maxIteration <= 0 || i < maxIteration; i++ {
- err, shouldContinueInvoke = f(i, time.Since(start))
+ err, shouldContinueInvoke = f(i, xtime.Since(start))
if !shouldContinueInvoke { // if shouldContinueInvoke is false, then return immediately
- return i + 1, time.Since(start), err
+ return i + 1, xtime.Since(start), err
}
if err == nil {
- return i + 1, time.Since(start), nil
+ return i + 1, xtime.Since(start), nil
}
if maxIteration <= 0 || i+1 < maxIteration {
- time.Sleep(delay)
+ xtime.Sleep(delay)
}
}
- return maxIteration, time.Since(start), err
+ return maxIteration, xtime.Since(start), err
}
type transactionStep[T any] struct {
@@ -240,18 +251,20 @@ type transactionStep[T any] struct {
}
// NewTransaction instantiate a new transaction.
+// Play: https://go.dev/play/p/Qxrd7MGQGh1
func NewTransaction[T any]() *Transaction[T] {
return &Transaction[T]{
steps: []transactionStep[T]{},
}
}
-// Transaction implements a Saga pattern
+// Transaction implements a Saga pattern.
type Transaction[T any] struct {
steps []transactionStep[T]
}
-// Then adds a step to the chain of callbacks. It returns the same Transaction.
+// Then adds a step to the chain of callbacks. Returns the same Transaction.
+// Play: https://go.dev/play/p/Qxrd7MGQGh1 https://go.dev/play/p/xrHb2_kMvTY
func (t *Transaction[T]) Then(exec func(T) (T, error), onRollback func(T) T) *Transaction[T] {
t.steps = append(t.steps, transactionStep[T]{
exec: exec,
@@ -262,6 +275,7 @@ func (t *Transaction[T]) Then(exec func(T) (T, error), onRollback func(T) T) *Tr
}
// Process runs the Transaction steps and rollbacks in case of errors.
+// Play: https://go.dev/play/p/Qxrd7MGQGh1 https://go.dev/play/p/xrHb2_kMvTY
func (t *Transaction[T]) Process(state T) (T, error) {
var i int
var err error
@@ -287,7 +301,7 @@ func (t *Transaction[T]) Process(state T) (T, error) {
return state, err
}
-// @TODO: single mutex per key ?
+// @TODO: single mutex per key?
type throttleBy[T comparable] struct {
mu *sync.Mutex
timer *time.Timer
@@ -311,7 +325,6 @@ func (th *throttleBy[T]) throttledFunc(key T) {
for _, f := range th.callbacks {
f(key)
}
-
}
if th.timer == nil {
th.timer = time.AfterFunc(th.interval, func() {
@@ -333,13 +346,15 @@ func (th *throttleBy[T]) reset() {
}
// NewThrottle creates a throttled instance that invokes given functions only once in every interval.
-// This returns 2 functions, First one is throttled function and Second one is a function to reset interval
-func NewThrottle(interval time.Duration, f ...func()) (throttle func(), reset func()) {
+// This returns 2 functions, First one is throttled function and Second one is a function to reset interval.
+// Play: https://go.dev/play/p/qQn3fm8Z7jS
+func NewThrottle(interval time.Duration, f ...func()) (throttle, reset func()) {
return NewThrottleWithCount(interval, 1, f...)
}
// NewThrottleWithCount is NewThrottle with count limit, throttled function will be invoked count times in every interval.
-func NewThrottleWithCount(interval time.Duration, count int, f ...func()) (throttle func(), reset func()) {
+// Play: https://go.dev/play/p/w5nc0MgWtjC
+func NewThrottleWithCount(interval time.Duration, count int, f ...func()) (throttle, reset func()) {
callbacks := Map(f, func(item func(), _ int) func(struct{}) {
return func(struct{}) {
item()
@@ -353,12 +368,14 @@ func NewThrottleWithCount(interval time.Duration, count int, f ...func()) (throt
}
// NewThrottleBy creates a throttled instance that invokes given functions only once in every interval.
-// This returns 2 functions, First one is throttled function and Second one is a function to reset interval
+// This returns 2 functions, First one is throttled function and Second one is a function to reset interval.
+// Play: https://go.dev/play/p/0Wv6oX7dHdC
func NewThrottleBy[T comparable](interval time.Duration, f ...func(key T)) (throttle func(key T), reset func()) {
return NewThrottleByWithCount[T](interval, 1, f...)
}
// NewThrottleByWithCount is NewThrottleBy with count limit, throttled function will be invoked count times in every interval.
+// Play: https://go.dev/play/p/vQk3ECH7_EW
func NewThrottleByWithCount[T comparable](interval time.Duration, count int, f ...func(key T)) (throttle func(key T), reset func()) {
if count <= 0 {
count = 1
diff --git a/vendor/github.com/samber/lo/slice.go b/vendor/github.com/samber/lo/slice.go
index 9c15a6cb23..d35d27669f 100644
--- a/vendor/github.com/samber/lo/slice.go
+++ b/vendor/github.com/samber/lo/slice.go
@@ -7,7 +7,7 @@ import (
"github.com/samber/lo/mutable"
)
-// Filter iterates over elements of collection, returning an array of all elements predicate returns truthy for.
+// Filter iterates over elements of collection, returning a slice of all elements predicate returns true for.
// Play: https://go.dev/play/p/Apjg3WeSi7K
func Filter[T any, Slice ~[]T](collection Slice, predicate func(item T, index int) bool) Slice {
result := make(Slice, 0, len(collection))
@@ -23,7 +23,7 @@ func Filter[T any, Slice ~[]T](collection Slice, predicate func(item T, index in
// Map manipulates a slice and transforms it to a slice of another type.
// Play: https://go.dev/play/p/OkPcYAhBo0D
-func Map[T any, R any](collection []T, iteratee func(item T, index int) R) []R {
+func Map[T, R any](collection []T, iteratee func(item T, index int) R) []R {
result := make([]R, len(collection))
for i := range collection {
@@ -34,6 +34,7 @@ func Map[T any, R any](collection []T, iteratee func(item T, index int) R) []R {
}
// UniqMap manipulates a slice and transforms it to a slice of another type with unique values.
+// Play: https://go.dev/play/p/fygzLBhvUdB
func UniqMap[T any, R comparable](collection []T, iteratee func(item T, index int) R) []R {
result := make([]R, 0, len(collection))
seen := make(map[R]struct{}, len(collection))
@@ -48,13 +49,13 @@ func UniqMap[T any, R comparable](collection []T, iteratee func(item T, index in
return result
}
-// FilterMap returns a slice which obtained after both filtering and mapping using the given callback function.
+// FilterMap returns a slice obtained after both filtering and mapping using the given callback function.
// The callback function should return two values:
// - the result of the mapping operation and
// - whether the result element should be included or not.
//
-// Play: https://go.dev/play/p/-AuYXfy7opz
-func FilterMap[T any, R any](collection []T, callback func(item T, index int) (R, bool)) []R {
+// Play: https://go.dev/play/p/CgHYNUpOd1I
+func FilterMap[T, R any](collection []T, callback func(item T, index int) (R, bool)) []R {
result := make([]R, 0, len(collection))
for i := range collection {
@@ -69,8 +70,8 @@ func FilterMap[T any, R any](collection []T, callback func(item T, index int) (R
// FlatMap manipulates a slice and transforms and flattens it to a slice of another type.
// The transform function can either return a slice or a `nil`, and in the `nil` case
// no value is added to the final slice.
-// Play: https://go.dev/play/p/YSoYmQTA8-U
-func FlatMap[T any, R any](collection []T, iteratee func(item T, index int) []R) []R {
+// Play: https://go.dev/play/p/pFCF5WVB225
+func FlatMap[T, R any](collection []T, iteratee func(item T, index int) []R) []R {
result := make([]R, 0, len(collection))
for i := range collection {
@@ -82,8 +83,8 @@ func FlatMap[T any, R any](collection []T, iteratee func(item T, index int) []R)
// Reduce reduces collection to a value which is the accumulated result of running each element in collection
// through accumulator, where each successive invocation is supplied the return value of the previous.
-// Play: https://go.dev/play/p/R4UHXZNaaUG
-func Reduce[T any, R any](collection []T, accumulator func(agg R, item T, index int) R, initial R) R {
+// Play: https://go.dev/play/p/CgHYNUpOd1I
+func Reduce[T, R any](collection []T, accumulator func(agg R, item T, index int) R, initial R) R {
for i := range collection {
initial = accumulator(initial, collection[i], i)
}
@@ -91,9 +92,9 @@ func Reduce[T any, R any](collection []T, accumulator func(agg R, item T, index
return initial
}
-// ReduceRight helper is like Reduce except that it iterates over elements of collection from right to left.
+// ReduceRight is like Reduce except that it iterates over elements of collection from right to left.
// Play: https://go.dev/play/p/Fq3W70l7wXF
-func ReduceRight[T any, R any](collection []T, accumulator func(agg R, item T, index int) R, initial R) R {
+func ReduceRight[T, R any](collection []T, accumulator func(agg R, item T, index int) R, initial R) R {
for i := len(collection) - 1; i >= 0; i-- {
initial = accumulator(initial, collection[i], i)
}
@@ -112,7 +113,7 @@ func ForEach[T any](collection []T, iteratee func(item T, index int)) {
// ForEachWhile iterates over elements of collection and invokes iteratee for each element
// collection return value decide to continue or break, like do while().
// Play: https://go.dev/play/p/QnLGt35tnow
-func ForEachWhile[T any](collection []T, iteratee func(item T, index int) (goon bool)) {
+func ForEachWhile[T any](collection []T, iteratee func(item T, index int) bool) {
for i := range collection {
if !iteratee(collection[i], i) {
break
@@ -120,7 +121,7 @@ func ForEachWhile[T any](collection []T, iteratee func(item T, index int) (goon
}
}
-// Times invokes the iteratee n times, returning an array of the results of each invocation.
+// Times invokes the iteratee n times, returning a slice of the results of each invocation.
// The iteratee is invoked with index as argument.
// Play: https://go.dev/play/p/vgQj3Glr6lT
func Times[T any](count int, iteratee func(index int) T) []T {
@@ -133,8 +134,8 @@ func Times[T any](count int, iteratee func(index int) T) []T {
return result
}
-// Uniq returns a duplicate-free version of an array, in which only the first occurrence of each element is kept.
-// The order of result values is determined by the order they occur in the array.
+// Uniq returns a duplicate-free version of a slice, in which only the first occurrence of each element is kept.
+// The order of result values is determined by the order they occur in the slice.
// Play: https://go.dev/play/p/DTzbeXZ6iEN
func Uniq[T comparable, Slice ~[]T](collection Slice) Slice {
result := make(Slice, 0, len(collection))
@@ -152,9 +153,9 @@ func Uniq[T comparable, Slice ~[]T](collection Slice) Slice {
return result
}
-// UniqBy returns a duplicate-free version of an array, in which only the first occurrence of each element is kept.
-// The order of result values is determined by the order they occur in the array. It accepts `iteratee` which is
-// invoked for each element in array to generate the criterion by which uniqueness is computed.
+// UniqBy returns a duplicate-free version of a slice, in which only the first occurrence of each element is kept.
+// The order of result values is determined by the order they occur in the slice. It accepts `iteratee` which is
+// invoked for each element in the slice to generate the criterion by which uniqueness is computed.
// Play: https://go.dev/play/p/g42Z3QSb53u
func UniqBy[T any, U comparable, Slice ~[]T](collection Slice, iteratee func(item T) U) Slice {
result := make(Slice, 0, len(collection))
@@ -189,6 +190,7 @@ func GroupBy[T any, U comparable, Slice ~[]T](collection Slice, iteratee func(it
}
// GroupByMap returns an object composed of keys generated from the results of running each element of collection through iteratee.
+// Play: https://go.dev/play/p/iMeruQ3_W80
func GroupByMap[T any, K comparable, V any](collection []T, iteratee func(item T) (K, V)) map[K][]V {
result := map[K][]V{}
@@ -201,17 +203,17 @@ func GroupByMap[T any, K comparable, V any](collection []T, iteratee func(item T
return result
}
-// Chunk returns an array of elements split into groups the length of size. If array can't be split evenly,
+// Chunk returns a slice of elements split into groups of length size. If the slice can't be split evenly,
// the final chunk will be the remaining elements.
-// Play: https://go.dev/play/p/EeKl0AuTehH
+// Play: https://go.dev/play/p/kEMkFbdu85g
func Chunk[T any, Slice ~[]T](collection Slice, size int) []Slice {
if size <= 0 {
- panic("Second parameter must be greater than 0")
+ panic("lo.Chunk: size must be greater than 0")
}
chunksNum := len(collection) / size
if len(collection)%size != 0 {
- chunksNum += 1
+ chunksNum++
}
result := make([]Slice, 0, chunksNum)
@@ -221,13 +223,17 @@ func Chunk[T any, Slice ~[]T](collection Slice, size int) []Slice {
if last > len(collection) {
last = len(collection)
}
- result = append(result, collection[i*size:last:last])
+
+ // Copy chunk in a new slice, to prevent memory leak and free memory from initial collection.
+ newSlice := make(Slice, last-i*size)
+ copy(newSlice, collection[i*size:last])
+ result = append(result, newSlice)
}
return result
}
-// PartitionBy returns an array of elements split into groups. The order of grouped values is
+// PartitionBy returns a slice of elements split into groups. The order of grouped values is
// determined by the order they occur in collection. The grouping is generated from the results
// of running each element of collection through iteratee.
// Play: https://go.dev/play/p/NfQ_nGjkgXW
@@ -255,7 +261,7 @@ func PartitionBy[T any, K comparable, Slice ~[]T](collection Slice, iteratee fun
// return Values[K, []T](groups)
}
-// Flatten returns an array a single level deep.
+// Flatten returns a slice a single level deep.
// Play: https://go.dev/play/p/rbp9ORaMpjw
func Flatten[T any, Slice ~[]T](collection []Slice) Slice {
totalLen := 0
@@ -271,7 +277,7 @@ func Flatten[T any, Slice ~[]T](collection []Slice) Slice {
return result
}
-// Interleave round-robin alternating input slices and sequentially appending value at index into result
+// Interleave round-robin alternating input slices and sequentially appending value at index into result.
// Play: https://go.dev/play/p/-RJkTLQEDVt
func Interleave[T any, Slice ~[]T](collections ...Slice) Slice {
if len(collections) == 0 {
@@ -309,7 +315,7 @@ func Interleave[T any, Slice ~[]T](collections ...Slice) Slice {
return result
}
-// Shuffle returns an array of shuffled values. Uses the Fisher-Yates shuffle algorithm.
+// Shuffle returns a slice of shuffled values. Uses the Fisher-Yates shuffle algorithm.
// Play: https://go.dev/play/p/ZTGG7OUCdnp
//
// Deprecated: use mutable.Shuffle() instead.
@@ -318,7 +324,7 @@ func Shuffle[T any, Slice ~[]T](collection Slice) Slice {
return collection
}
-// Reverse reverses array so that the first element becomes the last, the second element becomes the second to last, and so on.
+// Reverse reverses a slice so that the first element becomes the last, the second element becomes the second to last, and so on.
// Play: https://go.dev/play/p/iv2e9jslfBM
//
// Deprecated: use mutable.Reverse() instead.
@@ -327,7 +333,7 @@ func Reverse[T any, Slice ~[]T](collection Slice) Slice {
return collection
}
-// Fill fills elements of array with `initial` value.
+// Fill fills elements of a slice with `initial` value.
// Play: https://go.dev/play/p/VwR34GzqEub
func Fill[T Clonable[T], Slice ~[]T](collection Slice, initial T) Slice {
result := make(Slice, 0, len(collection))
@@ -363,8 +369,8 @@ func RepeatBy[T any](count int, predicate func(index int) T) []T {
return result
}
-// KeyBy transforms a slice or an array of structs to a map based on a pivot callback.
-// Play: https://go.dev/play/p/mdaClUAT-zZ
+// KeyBy transforms a slice or a slice of structs to a map based on a pivot callback.
+// Play: https://go.dev/play/p/ccUiUL_Lnel
func KeyBy[K comparable, V any](collection []V, iteratee func(item V) K) map[K]V {
result := make(map[K]V, len(collection))
@@ -377,14 +383,24 @@ func KeyBy[K comparable, V any](collection []V, iteratee func(item V) K) map[K]V
}
// Associate returns a map containing key-value pairs provided by transform function applied to elements of the given slice.
-// If any of two pairs would have the same key the last one gets added to the map.
-// The order of keys in returned map is not specified and is not guaranteed to be the same from the original array.
+// If any of two pairs have the same key the last one gets added to the map.
+// The order of keys in returned map is not specified and is not guaranteed to be the same from the original slice.
// Play: https://go.dev/play/p/WHa2CfMO3Lr
func Associate[T any, K comparable, V any](collection []T, transform func(item T) (K, V)) map[K]V {
+ return AssociateI(collection, func(item T, _ int) (K, V) {
+ return transform(item)
+ })
+}
+
+// AssociateI returns a map containing key-value pairs provided by transform function applied to elements of the given slice.
+// If any of two pairs have the same key the last one gets added to the map.
+// The order of keys in returned map is not specified and is not guaranteed to be the same from the original slice.
+// Play: https://go.dev/play/p/Ugmz6S22rRO
+func AssociateI[T any, K comparable, V any](collection []T, transform func(item T, index int) (K, V)) map[K]V {
result := make(map[K]V, len(collection))
- for i := range collection {
- k, v := transform(collection[i])
+ for index, item := range collection {
+ k, v := transform(item, index)
result[k] = v
}
@@ -392,23 +408,44 @@ func Associate[T any, K comparable, V any](collection []T, transform func(item T
}
// SliceToMap returns a map containing key-value pairs provided by transform function applied to elements of the given slice.
-// If any of two pairs would have the same key the last one gets added to the map.
-// The order of keys in returned map is not specified and is not guaranteed to be the same from the original array.
+// If any of two pairs have the same key the last one gets added to the map.
+// The order of keys in returned map is not specified and is not guaranteed to be the same from the original slice.
// Alias of Associate().
// Play: https://go.dev/play/p/WHa2CfMO3Lr
func SliceToMap[T any, K comparable, V any](collection []T, transform func(item T) (K, V)) map[K]V {
return Associate(collection, transform)
}
+// SliceToMapI returns a map containing key-value pairs provided by transform function applied to elements of the given slice.
+// If any of two pairs have the same key the last one gets added to the map.
+// The order of keys in returned map is not specified and is not guaranteed to be the same from the original slice.
+// Alias of AssociateI().
+// Play: https://go.dev/play/p/mMBm5GV3_eq
+func SliceToMapI[T any, K comparable, V any](collection []T, transform func(item T, index int) (K, V)) map[K]V {
+ return AssociateI(collection, transform)
+}
+
// FilterSliceToMap returns a map containing key-value pairs provided by transform function applied to elements of the given slice.
-// If any of two pairs would have the same key the last one gets added to the map.
-// The order of keys in returned map is not specified and is not guaranteed to be the same from the original array.
+// If any of two pairs have the same key the last one gets added to the map.
+// The order of keys in returned map is not specified and is not guaranteed to be the same from the original slice.
// The third return value of the transform function is a boolean that indicates whether the key-value pair should be included in the map.
+// Play: https://go.dev/play/p/2z0rDz2ZSGU
func FilterSliceToMap[T any, K comparable, V any](collection []T, transform func(item T) (K, V, bool)) map[K]V {
+ return FilterSliceToMapI(collection, func(item T, _ int) (K, V, bool) {
+ return transform(item)
+ })
+}
+
+// FilterSliceToMapI returns a map containing key-value pairs provided by transform function applied to elements of the given slice.
+// If any of two pairs have the same key the last one gets added to the map.
+// The order of keys in returned map is not specified and is not guaranteed to be the same from the original slice.
+// The third return value of the transform function is a boolean that indicates whether the key-value pair should be included in the map.
+// Play: https://go.dev/play/p/mSz_bUIk9aJ
+func FilterSliceToMapI[T any, K comparable, V any](collection []T, transform func(item T, index int) (K, V, bool)) map[K]V {
result := make(map[K]V, len(collection))
- for i := range collection {
- k, v, ok := transform(collection[i])
+ for index, item := range collection {
+ k, v, ok := transform(item, index)
if ok {
result[k] = v
}
@@ -418,6 +455,7 @@ func FilterSliceToMap[T any, K comparable, V any](collection []T, transform func
}
// Keyify returns a map with each unique element of the slice as a key.
+// Play: https://go.dev/play/p/RYhhM_csqIG
func Keyify[T comparable, Slice ~[]T](collection Slice) map[T]struct{} {
result := make(map[T]struct{}, len(collection))
@@ -428,9 +466,13 @@ func Keyify[T comparable, Slice ~[]T](collection Slice) map[T]struct{} {
return result
}
-// Drop drops n elements from the beginning of a slice or array.
+// Drop drops n elements from the beginning of a slice.
// Play: https://go.dev/play/p/JswS7vXRJP2
func Drop[T any, Slice ~[]T](collection Slice, n int) Slice {
+ if n < 0 {
+ panic("lo.Drop: n must not be negative")
+ }
+
if len(collection) <= n {
return make(Slice, 0)
}
@@ -440,9 +482,13 @@ func Drop[T any, Slice ~[]T](collection Slice, n int) Slice {
return append(result, collection[n:]...)
}
-// DropRight drops n elements from the end of a slice or array.
+// DropRight drops n elements from the end of a slice.
// Play: https://go.dev/play/p/GG0nXkSJJa3
func DropRight[T any, Slice ~[]T](collection Slice, n int) Slice {
+ if n < 0 {
+ panic("lo.DropRight: n must not be negative")
+ }
+
if len(collection) <= n {
return Slice{}
}
@@ -451,7 +497,7 @@ func DropRight[T any, Slice ~[]T](collection Slice, n int) Slice {
return append(result, collection[:len(collection)-n]...)
}
-// DropWhile drops elements from the beginning of a slice or array while the predicate returns true.
+// DropWhile drops elements from the beginning of a slice while the predicate returns true.
// Play: https://go.dev/play/p/7gBPYw2IK16
func DropWhile[T any, Slice ~[]T](collection Slice, predicate func(item T) bool) Slice {
i := 0
@@ -465,7 +511,7 @@ func DropWhile[T any, Slice ~[]T](collection Slice, predicate func(item T) bool)
return append(result, collection[i:]...)
}
-// DropRightWhile drops elements from the end of a slice or array while the predicate returns true.
+// DropRightWhile drops elements from the end of a slice while the predicate returns true.
// Play: https://go.dev/play/p/3-n71oEC0Hz
func DropRightWhile[T any, Slice ~[]T](collection Slice, predicate func(item T) bool) Slice {
i := len(collection) - 1
@@ -479,13 +525,13 @@ func DropRightWhile[T any, Slice ~[]T](collection Slice, predicate func(item T)
return append(result, collection[:i+1]...)
}
-// DropByIndex drops elements from a slice or array by the index.
+// DropByIndex drops elements from a slice by the index.
// A negative index will drop elements from the end of the slice.
// Play: https://go.dev/play/p/bPIH4npZRxS
-func DropByIndex[T any](collection []T, indexes ...int) []T {
+func DropByIndex[T any, Slice ~[]T](collection Slice, indexes ...int) Slice {
initialSize := len(collection)
if initialSize == 0 {
- return make([]T, 0)
+ return make(Slice, 0)
}
for i := range indexes {
@@ -497,7 +543,7 @@ func DropByIndex[T any](collection []T, indexes ...int) []T {
indexes = Uniq(indexes)
sort.Ints(indexes)
- result := make([]T, 0, initialSize)
+ result := make(Slice, 0, initialSize)
result = append(result, collection...)
for i := range indexes {
@@ -511,8 +557,8 @@ func DropByIndex[T any](collection []T, indexes ...int) []T {
return result
}
-// Reject is the opposite of Filter, this method returns the elements of collection that predicate does not return truthy for.
-// Play: https://go.dev/play/p/YkLMODy1WEL
+// Reject is the opposite of Filter, this method returns the elements of collection that predicate does not return true for.
+// Play: https://go.dev/play/p/pFCF5WVB225
func Reject[T any, Slice ~[]T](collection Slice, predicate func(item T, index int) bool) Slice {
result := Slice{}
@@ -525,11 +571,13 @@ func Reject[T any, Slice ~[]T](collection Slice, predicate func(item T, index in
return result
}
-// RejectMap is the opposite of FilterMap, this method returns a slice which obtained after both filtering and mapping using the given callback function.
+// RejectMap is the opposite of FilterMap, this method returns a slice obtained after both filtering and mapping using the given callback function.
// The callback function should return two values:
// - the result of the mapping operation and
// - whether the result element should be included or not.
-func RejectMap[T any, R any](collection []T, callback func(item T, index int) (R, bool)) []R {
+//
+// Play: https://go.dev/play/p/W9Ug9r0QFkL
+func RejectMap[T, R any](collection []T, callback func(item T, index int) (R, bool)) []R {
result := []R{}
for i := range collection {
@@ -542,8 +590,9 @@ func RejectMap[T any, R any](collection []T, callback func(item T, index int) (R
}
// FilterReject mixes Filter and Reject, this method returns two slices, one for the elements of collection that
-// predicate returns truthy for and one for the elements that predicate does not return truthy for.
-func FilterReject[T any, Slice ~[]T](collection Slice, predicate func(T, int) bool) (kept Slice, rejected Slice) {
+// predicate returns true for and one for the elements that predicate does not return true for.
+// Play: https://go.dev/play/p/lHSEGSznJjB
+func FilterReject[T any, Slice ~[]T](collection Slice, predicate func(T, int) bool) (kept, rejected Slice) {
kept = make(Slice, 0, len(collection))
rejected = make(Slice, 0, len(collection))
@@ -558,9 +607,11 @@ func FilterReject[T any, Slice ~[]T](collection Slice, predicate func(T, int) bo
return kept, rejected
}
-// Count counts the number of elements in the collection that compare equal to value.
+// Count counts the number of elements in the collection that equal value.
// Play: https://go.dev/play/p/Y3FlK54yveC
-func Count[T comparable](collection []T, value T) (count int) {
+func Count[T comparable](collection []T, value T) int {
+ var count int
+
for i := range collection {
if collection[i] == value {
count++
@@ -572,7 +623,9 @@ func Count[T comparable](collection []T, value T) (count int) {
// CountBy counts the number of elements in the collection for which predicate is true.
// Play: https://go.dev/play/p/ByQbNYQQi4X
-func CountBy[T any](collection []T, predicate func(item T) bool) (count int) {
+func CountBy[T any](collection []T, predicate func(item T) bool) int {
+ var count int
+
for i := range collection {
if predicate(collection[i]) {
count++
@@ -594,7 +647,7 @@ func CountValues[T comparable](collection []T) map[T]int {
return result
}
-// CountValuesBy counts the number of each element return from mapper function.
+// CountValuesBy counts the number of each element returned from mapper function.
// Is equivalent to chaining lo.Map and lo.CountValues.
// Play: https://go.dev/play/p/2U0dG1SnOmS
func CountValuesBy[T any, U comparable](collection []T, mapper func(item T) U) map[U]int {
@@ -632,7 +685,7 @@ func Subset[T any, Slice ~[]T](collection Slice, offset int, length uint) Slice
// Slice returns a copy of a slice from `start` up to, but not including `end`. Like `slice[start:end]`, but does not panic on overflow.
// Play: https://go.dev/play/p/8XWYhfMMA1h
-func Slice[T any, Slice ~[]T](collection Slice, start int, end int) Slice {
+func Slice[T any, Slice ~[]T](collection Slice, start, end int) Slice {
size := len(collection)
if start >= end {
@@ -658,13 +711,13 @@ func Slice[T any, Slice ~[]T](collection Slice, start int, end int) Slice {
// Replace returns a copy of the slice with the first n non-overlapping instances of old replaced by new.
// Play: https://go.dev/play/p/XfPzmf9gql6
-func Replace[T comparable, Slice ~[]T](collection Slice, old T, new T, n int) Slice {
+func Replace[T comparable, Slice ~[]T](collection Slice, old, nEw T, n int) Slice {
result := make(Slice, len(collection))
copy(result, collection)
for i := range result {
if result[i] == old && n != 0 {
- result[i] = new
+ result[i] = nEw
n--
}
}
@@ -674,8 +727,8 @@ func Replace[T comparable, Slice ~[]T](collection Slice, old T, new T, n int) Sl
// ReplaceAll returns a copy of the slice with all non-overlapping instances of old replaced by new.
// Play: https://go.dev/play/p/a9xZFUHfYcV
-func ReplaceAll[T comparable, Slice ~[]T](collection Slice, old T, new T) Slice {
- return Replace(collection, old, new, -1)
+func ReplaceAll[T comparable, Slice ~[]T](collection Slice, old, nEw T) Slice {
+ return Replace(collection, old, nEw, -1)
}
// Compact returns a slice of all non-zero elements.
@@ -707,7 +760,6 @@ func IsSorted[T constraints.Ordered](collection []T) bool {
}
// IsSortedByKey checks if a slice is sorted by iteratee.
-// Play: https://go.dev/play/p/wiG6XyBBu49
func IsSortedByKey[T any, K constraints.Ordered](collection []T, iteratee func(item T) K) bool {
size := len(collection)
@@ -728,18 +780,167 @@ func Splice[T any, Slice ~[]T](collection Slice, i int, elements ...T) Slice {
sizeElements := len(elements)
output := make(Slice, 0, sizeCollection+sizeElements) // preallocate memory for the output slice
- if sizeElements == 0 {
+ switch {
+ case sizeElements == 0:
return append(output, collection...) // simple copy
- } else if i > sizeCollection {
+ case i > sizeCollection:
// positive overflow
return append(append(output, collection...), elements...)
- } else if i < -sizeCollection {
+ case i < -sizeCollection:
// negative overflow
return append(append(output, elements...), collection...)
- } else if i < 0 {
+ case i < 0:
// backward
i = sizeCollection + i
}
return append(append(append(output, collection[:i]...), elements...), collection[i:]...)
}
+
+// Cut slices collection around the first instance of separator, returning the part of collection
+// before and after separator. The found result reports whether separator appears in collection.
+// If separator does not appear in s, cut returns collection, empty slice of []T, false.
+// Play: https://go.dev/play/p/GiL3qhpIP3f
+func Cut[T comparable, Slice ~[]T](collection, separator Slice) (before, after Slice, found bool) {
+ if len(separator) == 0 {
+ return make(Slice, 0), collection, true
+ }
+
+ for i := 0; i+len(separator) <= len(collection); i++ {
+ match := true
+ for j := 0; j < len(separator); j++ {
+ if collection[i+j] != separator[j] {
+ match = false
+ break
+ }
+ }
+ if match {
+ return collection[:i], collection[i+len(separator):], true
+ }
+ }
+
+ return collection, make(Slice, 0), false
+}
+
+// CutPrefix returns collection without the provided leading prefix []T
+// and reports whether it found the prefix.
+// If s doesn't start with prefix, CutPrefix returns collection, false.
+// If prefix is the empty []T, CutPrefix returns collection, true.
+// Play: https://go.dev/play/p/7Plak4a1ICl
+func CutPrefix[T comparable, Slice ~[]T](collection, separator Slice) (after Slice, found bool) {
+ if len(separator) == 0 {
+ return collection, true
+ }
+ if len(separator) > len(collection) {
+ return collection, false
+ }
+
+ for i := range separator {
+ if collection[i] != separator[i] {
+ return collection, false
+ }
+ }
+
+ return collection[len(separator):], true
+}
+
+// CutSuffix returns collection without the provided ending suffix []T and reports
+// whether it found the suffix. If s doesn't end with suffix, CutSuffix returns collection, false.
+// If suffix is the empty []T, CutSuffix returns collection, true.
+// Play: https://go.dev/play/p/7FKfBFvPTaT
+func CutSuffix[T comparable, Slice ~[]T](collection, separator Slice) (before Slice, found bool) {
+ if len(separator) == 0 {
+ return collection, true
+ }
+ if len(separator) > len(collection) {
+ return collection, false
+ }
+
+ start := len(collection) - len(separator)
+ for i := range separator {
+ if collection[start+i] != separator[i] {
+ return collection, false
+ }
+ }
+
+ return collection[:start], true
+}
+
+// Trim removes all the leading and trailing cutset from the collection.
+// Play: https://go.dev/play/p/1an9mxLdRG5
+func Trim[T comparable, Slice ~[]T](collection, cutset Slice) Slice {
+ set := Keyify(cutset)
+
+ i := 0
+ for ; i < len(collection); i++ {
+ if _, ok := set[collection[i]]; !ok {
+ break
+ }
+ }
+
+ if i >= len(collection) {
+ return Slice{}
+ }
+
+ j := len(collection) - 1
+ for ; j >= 0; j-- {
+ if _, ok := set[collection[j]]; !ok {
+ break
+ }
+ }
+
+ result := make(Slice, 0, j+1-i)
+ return append(result, collection[i:j+1]...)
+}
+
+// TrimLeft removes all the leading cutset from the collection.
+// Play: https://go.dev/play/p/74aqfAYLmyi
+func TrimLeft[T comparable, Slice ~[]T](collection, cutset Slice) Slice {
+ set := Keyify(cutset)
+
+ return DropWhile(collection, func(item T) bool {
+ _, ok := set[item]
+ return ok
+ })
+}
+
+// TrimPrefix removes all the leading prefix from the collection.
+// Play: https://go.dev/play/p/SHO6X-YegPg
+func TrimPrefix[T comparable, Slice ~[]T](collection, prefix Slice) Slice {
+ if len(prefix) == 0 {
+ return collection
+ }
+
+ for {
+ if !HasPrefix(collection, prefix) {
+ return collection
+ }
+ collection = collection[len(prefix):]
+ }
+}
+
+// TrimRight removes all the trailing cutset from the collection.
+// Play: https://go.dev/play/p/MRpAfR6sf0g
+func TrimRight[T comparable, Slice ~[]T](collection, cutset Slice) Slice {
+ set := Keyify(cutset)
+
+ return DropRightWhile(collection, func(item T) bool {
+ _, ok := set[item]
+ return ok
+ })
+}
+
+// TrimSuffix removes all the trailing suffix from the collection.
+// Play: https://go.dev/play/p/IjEUrV0iofq
+func TrimSuffix[T comparable, Slice ~[]T](collection, suffix Slice) Slice {
+ if len(suffix) == 0 {
+ return collection
+ }
+
+ for {
+ if !HasSuffix(collection, suffix) {
+ return collection
+ }
+ collection = collection[:len(collection)-len(suffix)]
+ }
+}
diff --git a/vendor/github.com/samber/lo/string.go b/vendor/github.com/samber/lo/string.go
index 923faa32b1..9590114b9e 100644
--- a/vendor/github.com/samber/lo/string.go
+++ b/vendor/github.com/samber/lo/string.go
@@ -7,13 +7,14 @@ import (
"unicode"
"unicode/utf8"
- "github.com/samber/lo/internal/rand"
+ "github.com/samber/lo/internal/xrand"
"golang.org/x/text/cases"
"golang.org/x/text/language"
)
var (
+ //nolint:revive
LowerCaseLettersCharset = []rune("abcdefghijklmnopqrstuvwxyz")
UpperCaseLettersCharset = []rune("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
LettersCharset = append(LowerCaseLettersCharset, UpperCaseLettersCharset...)
@@ -33,38 +34,49 @@ var (
// Play: https://go.dev/play/p/rRseOQVVum4
func RandomString(size int, charset []rune) string {
if size <= 0 {
- panic("lo.RandomString: Size parameter must be greater than 0")
+ panic("lo.RandomString: size must be greater than 0")
}
- if len(charset) <= 0 {
- panic("lo.RandomString: Charset parameter must not be empty")
+ if len(charset) == 0 {
+ panic("lo.RandomString: charset must not be empty")
}
// see https://stackoverflow.com/questions/22892120/how-to-generate-a-random-string-of-a-fixed-length-in-go
sb := strings.Builder{}
sb.Grow(size)
+
+ if len(charset) == 1 {
+ // Edge case, because if the charset is a single character,
+ // it will panic below (divide by zero).
+ // -> https://github.com/samber/lo/issues/679
+ for i := 0; i < size; i++ {
+ sb.WriteRune(charset[0])
+ }
+ return sb.String()
+ }
+
// Calculate the number of bits required to represent the charset,
// e.g., for 62 characters, it would need 6 bits (since 62 -> 64 = 2^6)
- letterIdBits := int(math.Log2(float64(nearestPowerOfTwo(len(charset)))))
+ letterIDBits := int(math.Log2(float64(nearestPowerOfTwo(len(charset)))))
// Determine the corresponding bitmask,
// e.g., for 62 characters, the bitmask would be 111111.
- var letterIdMask int64 = 1<= 0; {
+ for i, cache, remain := size-1, xrand.Int64(), letterIDMax; i >= 0; {
// Regenerate the random number if all available bits have been used
if remain == 0 {
- cache, remain = rand.Int64(), letterIdMax
+ cache, remain = xrand.Int64(), letterIDMax
}
// Select a character from the charset
- if idx := int(cache & letterIdMask); idx < len(charset) {
+ if idx := int(cache & letterIDMask); idx < len(charset) {
sb.WriteRune(charset[idx])
i--
}
// Shift the bits to the right to prepare for the next character selection,
// e.g., for 62 characters, shift by 6 bits.
- cache >>= letterIdBits
+ cache >>= letterIDBits
// Decrease the remaining number of uses for the current random number.
remain--
}
@@ -72,8 +84,8 @@ func RandomString(size int, charset []rune) string {
}
// nearestPowerOfTwo returns the nearest power of two.
-func nearestPowerOfTwo(cap int) int {
- n := cap - 1
+func nearestPowerOfTwo(capacity int) int {
+ n := capacity - 1
n |= n >> 1
n |= n >> 2
n |= n >> 4
@@ -112,12 +124,12 @@ func Substring[T ~string](str T, offset int, length uint) T {
return T(strings.ReplaceAll(string(rs[offset:offset+int(length)]), "\x00", ""))
}
-// ChunkString returns an array of strings split into groups the length of size. If array can't be split evenly,
-// the final chunk will be the remaining elements.
+// ChunkString returns a slice of strings split into groups of length size. If the string can't be split evenly,
+// the final chunk will be the remaining characters.
// Play: https://go.dev/play/p/__FLTuJVz54
func ChunkString[T ~string](str T, size int) []T {
if size <= 0 {
- panic("lo.ChunkString: Size parameter must be greater than 0")
+ panic("lo.ChunkString: size must be greater than 0")
}
if len(str) == 0 {
@@ -128,7 +140,7 @@ func ChunkString[T ~string](str T, size int) []T {
return []T{str}
}
- var chunks = make([]T, 0, ((len(str)-1)/size)+1)
+ chunks := make([]T, 0, ((len(str)-1)/size)+1)
currentLen := 0
currentStart := 0
for i := range str {
@@ -150,6 +162,7 @@ func RuneLength(str string) int {
}
// PascalCase converts string to pascal case.
+// Play: https://go.dev/play/p/Dy_V_6DUYhe
func PascalCase(str string) string {
items := Words(str)
for i := range items {
@@ -159,6 +172,7 @@ func PascalCase(str string) string {
}
// CamelCase converts string to camel case.
+// Play: https://go.dev/play/p/Go6aKwUiq59
func CamelCase(str string) string {
items := Words(str)
for i, item := range items {
@@ -172,6 +186,7 @@ func CamelCase(str string) string {
}
// KebabCase converts string to kebab case.
+// Play: https://go.dev/play/p/96gT_WZnTVP
func KebabCase(str string) string {
items := Words(str)
for i := range items {
@@ -181,6 +196,7 @@ func KebabCase(str string) string {
}
// SnakeCase converts string to snake case.
+// Play: https://go.dev/play/p/ziB0V89IeVH
func SnakeCase(str string) string {
items := Words(str)
for i := range items {
@@ -189,7 +205,8 @@ func SnakeCase(str string) string {
return strings.Join(items, "_")
}
-// Words splits string into an array of its words.
+// Words splits string into a slice of its words.
+// Play: https://go.dev/play/p/-f3VIQqiaVw
func Words(str string) []string {
str = splitWordReg.ReplaceAllString(str, `$1$3$5$7 $2$4$6$8$9`)
// example: Int8Value => Int 8Value => Int 8 Value
@@ -206,6 +223,7 @@ func Words(str string) []string {
}
// Capitalize converts the first character of string to upper case and the remaining to lower case.
+// Play: https://go.dev/play/p/uLTZZQXqnsa
func Capitalize(str string) string {
return cases.Title(language.English).String(str)
}
@@ -213,6 +231,7 @@ func Capitalize(str string) string {
// Ellipsis trims and truncates a string to a specified length **in bytes** and appends an ellipsis
// if truncated. If the string contains non-ASCII characters (which may occupy multiple bytes in UTF-8),
// truncating by byte length may split a character in the middle, potentially resulting in garbled output.
+// Play: https://go.dev/play/p/qE93rgqe1TW
func Ellipsis(str string, length int) string {
str = strings.TrimSpace(str)
diff --git a/vendor/github.com/samber/lo/time.go b/vendor/github.com/samber/lo/time.go
index e98e80f9e8..f295adbbdc 100644
--- a/vendor/github.com/samber/lo/time.go
+++ b/vendor/github.com/samber/lo/time.go
@@ -1,13 +1,17 @@
package lo
-import "time"
+import (
+ "time"
+)
// Duration returns the time taken to execute a function.
+// Play: https://go.dev/play/p/HQfbBbAXaFP
func Duration(cb func()) time.Duration {
return Duration0(cb)
}
// Duration0 returns the time taken to execute a function.
+// Play: https://go.dev/play/p/HQfbBbAXaFP
func Duration0(cb func()) time.Duration {
start := time.Now()
cb()
@@ -15,6 +19,7 @@ func Duration0(cb func()) time.Duration {
}
// Duration1 returns the time taken to execute a function.
+// Play: https://go.dev/play/p/HQfbBbAXaFP
func Duration1[A any](cb func() A) (A, time.Duration) {
start := time.Now()
a := cb()
@@ -22,6 +27,7 @@ func Duration1[A any](cb func() A) (A, time.Duration) {
}
// Duration2 returns the time taken to execute a function.
+// Play: https://go.dev/play/p/HQfbBbAXaFP
func Duration2[A, B any](cb func() (A, B)) (A, B, time.Duration) {
start := time.Now()
a, b := cb()
@@ -29,6 +35,7 @@ func Duration2[A, B any](cb func() (A, B)) (A, B, time.Duration) {
}
// Duration3 returns the time taken to execute a function.
+// Play: https://go.dev/play/p/xr863iwkAxQ
func Duration3[A, B, C any](cb func() (A, B, C)) (A, B, C, time.Duration) {
start := time.Now()
a, b, c := cb()
@@ -36,6 +43,7 @@ func Duration3[A, B, C any](cb func() (A, B, C)) (A, B, C, time.Duration) {
}
// Duration4 returns the time taken to execute a function.
+// Play: https://go.dev/play/p/xr863iwkAxQ
func Duration4[A, B, C, D any](cb func() (A, B, C, D)) (A, B, C, D, time.Duration) {
start := time.Now()
a, b, c, d := cb()
@@ -43,6 +51,7 @@ func Duration4[A, B, C, D any](cb func() (A, B, C, D)) (A, B, C, D, time.Duratio
}
// Duration5 returns the time taken to execute a function.
+// Play: https://go.dev/play/p/xr863iwkAxQ
func Duration5[A, B, C, D, E any](cb func() (A, B, C, D, E)) (A, B, C, D, E, time.Duration) {
start := time.Now()
a, b, c, d, e := cb()
@@ -50,6 +59,7 @@ func Duration5[A, B, C, D, E any](cb func() (A, B, C, D, E)) (A, B, C, D, E, tim
}
// Duration6 returns the time taken to execute a function.
+// Play: https://go.dev/play/p/mR4bTQKO-Tf
func Duration6[A, B, C, D, E, F any](cb func() (A, B, C, D, E, F)) (A, B, C, D, E, F, time.Duration) {
start := time.Now()
a, b, c, d, e, f := cb()
@@ -57,6 +67,7 @@ func Duration6[A, B, C, D, E, F any](cb func() (A, B, C, D, E, F)) (A, B, C, D,
}
// Duration7 returns the time taken to execute a function.
+// Play: https://go.dev/play/p/jgIAcBWWInS
func Duration7[A, B, C, D, E, F, G any](cb func() (A, B, C, D, E, F, G)) (A, B, C, D, E, F, G, time.Duration) {
start := time.Now()
a, b, c, d, e, f, g := cb()
@@ -64,6 +75,7 @@ func Duration7[A, B, C, D, E, F, G any](cb func() (A, B, C, D, E, F, G)) (A, B,
}
// Duration8 returns the time taken to execute a function.
+// Play: https://go.dev/play/p/T8kxpG1c5Na
func Duration8[A, B, C, D, E, F, G, H any](cb func() (A, B, C, D, E, F, G, H)) (A, B, C, D, E, F, G, H, time.Duration) {
start := time.Now()
a, b, c, d, e, f, g, h := cb()
@@ -71,6 +83,7 @@ func Duration8[A, B, C, D, E, F, G, H any](cb func() (A, B, C, D, E, F, G, H)) (
}
// Duration9 returns the time taken to execute a function.
+// Play: https://go.dev/play/p/bg9ix2VrZ0j
func Duration9[A, B, C, D, E, F, G, H, I any](cb func() (A, B, C, D, E, F, G, H, I)) (A, B, C, D, E, F, G, H, I, time.Duration) {
start := time.Now()
a, b, c, d, e, f, g, h, i := cb()
@@ -78,6 +91,7 @@ func Duration9[A, B, C, D, E, F, G, H, I any](cb func() (A, B, C, D, E, F, G, H,
}
// Duration10 returns the time taken to execute a function.
+// Play: https://go.dev/play/p/Y3n7oJXqJbk
func Duration10[A, B, C, D, E, F, G, H, I, J any](cb func() (A, B, C, D, E, F, G, H, I, J)) (A, B, C, D, E, F, G, H, I, J, time.Duration) {
start := time.Now()
a, b, c, d, e, f, g, h, i, j := cb()
diff --git a/vendor/github.com/samber/lo/tuples.go b/vendor/github.com/samber/lo/tuples.go
index e355d0ca88..d9805b2d4e 100644
--- a/vendor/github.com/samber/lo/tuples.go
+++ b/vendor/github.com/samber/lo/tuples.go
@@ -48,57 +48,57 @@ func T9[A, B, C, D, E, F, G, H, I any](a A, b B, c C, d D, e E, f F, g G, h H, i
return Tuple9[A, B, C, D, E, F, G, H, I]{A: a, B: b, C: c, D: d, E: e, F: f, G: g, H: h, I: i}
}
-// Unpack2 returns values contained in tuple.
+// Unpack2 returns values contained in a tuple.
// Play: https://go.dev/play/p/xVP_k0kJ96W
func Unpack2[A, B any](tuple Tuple2[A, B]) (A, B) {
return tuple.A, tuple.B
}
-// Unpack3 returns values contained in tuple.
+// Unpack3 returns values contained in a tuple.
// Play: https://go.dev/play/p/xVP_k0kJ96W
func Unpack3[A, B, C any](tuple Tuple3[A, B, C]) (A, B, C) {
return tuple.A, tuple.B, tuple.C
}
-// Unpack4 returns values contained in tuple.
+// Unpack4 returns values contained in a tuple.
// Play: https://go.dev/play/p/xVP_k0kJ96W
func Unpack4[A, B, C, D any](tuple Tuple4[A, B, C, D]) (A, B, C, D) {
return tuple.A, tuple.B, tuple.C, tuple.D
}
-// Unpack5 returns values contained in tuple.
+// Unpack5 returns values contained in a tuple.
// Play: https://go.dev/play/p/xVP_k0kJ96W
func Unpack5[A, B, C, D, E any](tuple Tuple5[A, B, C, D, E]) (A, B, C, D, E) {
return tuple.A, tuple.B, tuple.C, tuple.D, tuple.E
}
-// Unpack6 returns values contained in tuple.
+// Unpack6 returns values contained in a tuple.
// Play: https://go.dev/play/p/xVP_k0kJ96W
func Unpack6[A, B, C, D, E, F any](tuple Tuple6[A, B, C, D, E, F]) (A, B, C, D, E, F) {
return tuple.A, tuple.B, tuple.C, tuple.D, tuple.E, tuple.F
}
-// Unpack7 returns values contained in tuple.
+// Unpack7 returns values contained in a tuple.
// Play: https://go.dev/play/p/xVP_k0kJ96W
func Unpack7[A, B, C, D, E, F, G any](tuple Tuple7[A, B, C, D, E, F, G]) (A, B, C, D, E, F, G) {
return tuple.A, tuple.B, tuple.C, tuple.D, tuple.E, tuple.F, tuple.G
}
-// Unpack8 returns values contained in tuple.
+// Unpack8 returns values contained in a tuple.
// Play: https://go.dev/play/p/xVP_k0kJ96W
func Unpack8[A, B, C, D, E, F, G, H any](tuple Tuple8[A, B, C, D, E, F, G, H]) (A, B, C, D, E, F, G, H) {
return tuple.A, tuple.B, tuple.C, tuple.D, tuple.E, tuple.F, tuple.G, tuple.H
}
-// Unpack9 returns values contained in tuple.
+// Unpack9 returns values contained in a tuple.
// Play: https://go.dev/play/p/xVP_k0kJ96W
func Unpack9[A, B, C, D, E, F, G, H, I any](tuple Tuple9[A, B, C, D, E, F, G, H, I]) (A, B, C, D, E, F, G, H, I) {
return tuple.A, tuple.B, tuple.C, tuple.D, tuple.E, tuple.F, tuple.G, tuple.H, tuple.I
}
// Zip2 creates a slice of grouped elements, the first of which contains the first elements
-// of the given arrays, the second of which contains the second elements of the given arrays, and so on.
-// When collections have different size, the Tuple attributes are filled with zero value.
+// of the given slices, the second of which contains the second elements of the given slices, and so on.
+// When collections are different sizes, the Tuple attributes are filled with zero value.
// Play: https://go.dev/play/p/jujaA6GaJTp
func Zip2[A, B any](a []A, b []B) []Tuple2[A, B] {
size := Max([]int{len(a), len(b)})
@@ -119,8 +119,8 @@ func Zip2[A, B any](a []A, b []B) []Tuple2[A, B] {
}
// Zip3 creates a slice of grouped elements, the first of which contains the first elements
-// of the given arrays, the second of which contains the second elements of the given arrays, and so on.
-// When collections have different size, the Tuple attributes are filled with zero value.
+// of the given slices, the second of which contains the second elements of the given slices, and so on.
+// When collections are different sizes, the Tuple attributes are filled with zero value.
// Play: https://go.dev/play/p/jujaA6GaJTp
func Zip3[A, B, C any](a []A, b []B, c []C) []Tuple3[A, B, C] {
size := Max([]int{len(a), len(b), len(c)})
@@ -143,8 +143,8 @@ func Zip3[A, B, C any](a []A, b []B, c []C) []Tuple3[A, B, C] {
}
// Zip4 creates a slice of grouped elements, the first of which contains the first elements
-// of the given arrays, the second of which contains the second elements of the given arrays, and so on.
-// When collections have different size, the Tuple attributes are filled with zero value.
+// of the given slices, the second of which contains the second elements of the given slices, and so on.
+// When collections are different sizes, the Tuple attributes are filled with zero value.
// Play: https://go.dev/play/p/jujaA6GaJTp
func Zip4[A, B, C, D any](a []A, b []B, c []C, d []D) []Tuple4[A, B, C, D] {
size := Max([]int{len(a), len(b), len(c), len(d)})
@@ -169,8 +169,8 @@ func Zip4[A, B, C, D any](a []A, b []B, c []C, d []D) []Tuple4[A, B, C, D] {
}
// Zip5 creates a slice of grouped elements, the first of which contains the first elements
-// of the given arrays, the second of which contains the second elements of the given arrays, and so on.
-// When collections have different size, the Tuple attributes are filled with zero value.
+// of the given slices, the second of which contains the second elements of the given slices, and so on.
+// When collections are different sizes, the Tuple attributes are filled with zero value.
// Play: https://go.dev/play/p/jujaA6GaJTp
func Zip5[A, B, C, D, E any](a []A, b []B, c []C, d []D, e []E) []Tuple5[A, B, C, D, E] {
size := Max([]int{len(a), len(b), len(c), len(d), len(e)})
@@ -197,8 +197,8 @@ func Zip5[A, B, C, D, E any](a []A, b []B, c []C, d []D, e []E) []Tuple5[A, B, C
}
// Zip6 creates a slice of grouped elements, the first of which contains the first elements
-// of the given arrays, the second of which contains the second elements of the given arrays, and so on.
-// When collections have different size, the Tuple attributes are filled with zero value.
+// of the given slices, the second of which contains the second elements of the given slices, and so on.
+// When collections are different sizes, the Tuple attributes are filled with zero value.
// Play: https://go.dev/play/p/jujaA6GaJTp
func Zip6[A, B, C, D, E, F any](a []A, b []B, c []C, d []D, e []E, f []F) []Tuple6[A, B, C, D, E, F] {
size := Max([]int{len(a), len(b), len(c), len(d), len(e), len(f)})
@@ -227,8 +227,8 @@ func Zip6[A, B, C, D, E, F any](a []A, b []B, c []C, d []D, e []E, f []F) []Tupl
}
// Zip7 creates a slice of grouped elements, the first of which contains the first elements
-// of the given arrays, the second of which contains the second elements of the given arrays, and so on.
-// When collections have different size, the Tuple attributes are filled with zero value.
+// of the given slices, the second of which contains the second elements of the given slices, and so on.
+// When collections are different sizes, the Tuple attributes are filled with zero value.
// Play: https://go.dev/play/p/jujaA6GaJTp
func Zip7[A, B, C, D, E, F, G any](a []A, b []B, c []C, d []D, e []E, f []F, g []G) []Tuple7[A, B, C, D, E, F, G] {
size := Max([]int{len(a), len(b), len(c), len(d), len(e), len(f), len(g)})
@@ -259,8 +259,8 @@ func Zip7[A, B, C, D, E, F, G any](a []A, b []B, c []C, d []D, e []E, f []F, g [
}
// Zip8 creates a slice of grouped elements, the first of which contains the first elements
-// of the given arrays, the second of which contains the second elements of the given arrays, and so on.
-// When collections have different size, the Tuple attributes are filled with zero value.
+// of the given slices, the second of which contains the second elements of the given slices, and so on.
+// When collections are different sizes, the Tuple attributes are filled with zero value.
// Play: https://go.dev/play/p/jujaA6GaJTp
func Zip8[A, B, C, D, E, F, G, H any](a []A, b []B, c []C, d []D, e []E, f []F, g []G, h []H) []Tuple8[A, B, C, D, E, F, G, H] {
size := Max([]int{len(a), len(b), len(c), len(d), len(e), len(f), len(g), len(h)})
@@ -293,8 +293,8 @@ func Zip8[A, B, C, D, E, F, G, H any](a []A, b []B, c []C, d []D, e []E, f []F,
}
// Zip9 creates a slice of grouped elements, the first of which contains the first elements
-// of the given arrays, the second of which contains the second elements of the given arrays, and so on.
-// When collections have different size, the Tuple attributes are filled with zero value.
+// of the given slices, the second of which contains the second elements of the given slices, and so on.
+// When collections are different sizes, the Tuple attributes are filled with zero value.
// Play: https://go.dev/play/p/jujaA6GaJTp
func Zip9[A, B, C, D, E, F, G, H, I any](a []A, b []B, c []C, d []D, e []E, f []F, g []G, h []H, i []I) []Tuple9[A, B, C, D, E, F, G, H, I] {
size := Max([]int{len(a), len(b), len(c), len(d), len(e), len(f), len(g), len(h), len(i)})
@@ -329,9 +329,10 @@ func Zip9[A, B, C, D, E, F, G, H, I any](a []A, b []B, c []C, d []D, e []E, f []
}
// ZipBy2 creates a slice of transformed elements, the first of which contains the first elements
-// of the given arrays, the second of which contains the second elements of the given arrays, and so on.
-// When collections have different size, the Tuple attributes are filled with zero value.
-func ZipBy2[A any, B any, Out any](a []A, b []B, iteratee func(a A, b B) Out) []Out {
+// of the given slices, the second of which contains the second elements of the given slices, and so on.
+// When collections are different sizes, the Tuple attributes are filled with zero value.
+// Play: https://go.dev/play/p/wlHur6yO8rR
+func ZipBy2[A, B, Out any](a []A, b []B, iteratee func(a A, b B) Out) []Out {
size := Max([]int{len(a), len(b)})
result := make([]Out, 0, size)
@@ -347,9 +348,10 @@ func ZipBy2[A any, B any, Out any](a []A, b []B, iteratee func(a A, b B) Out) []
}
// ZipBy3 creates a slice of transformed elements, the first of which contains the first elements
-// of the given arrays, the second of which contains the second elements of the given arrays, and so on.
-// When collections have different size, the Tuple attributes are filled with zero value.
-func ZipBy3[A any, B any, C any, Out any](a []A, b []B, c []C, iteratee func(a A, b B, c C) Out) []Out {
+// of the given slices, the second of which contains the second elements of the given slices, and so on.
+// When collections are different sizes, the Tuple attributes are filled with zero value.
+// Play: https://go.dev/play/p/j9maveOnSQX
+func ZipBy3[A, B, C, Out any](a []A, b []B, c []C, iteratee func(a A, b B, c C) Out) []Out {
size := Max([]int{len(a), len(b), len(c)})
result := make([]Out, 0, size)
@@ -366,9 +368,10 @@ func ZipBy3[A any, B any, C any, Out any](a []A, b []B, c []C, iteratee func(a A
}
// ZipBy4 creates a slice of transformed elements, the first of which contains the first elements
-// of the given arrays, the second of which contains the second elements of the given arrays, and so on.
-// When collections have different size, the Tuple attributes are filled with zero value.
-func ZipBy4[A any, B any, C any, D any, Out any](a []A, b []B, c []C, d []D, iteratee func(a A, b B, c C, d D) Out) []Out {
+// of the given slices, the second of which contains the second elements of the given slices, and so on.
+// When collections are different sizes, the Tuple attributes are filled with zero value.
+// Play: https://go.dev/play/p/Y1eF2Ke0Ayz
+func ZipBy4[A, B, C, D, Out any](a []A, b []B, c []C, d []D, iteratee func(a A, b B, c C, d D) Out) []Out {
size := Max([]int{len(a), len(b), len(c), len(d)})
result := make([]Out, 0, size)
@@ -386,9 +389,10 @@ func ZipBy4[A any, B any, C any, D any, Out any](a []A, b []B, c []C, d []D, ite
}
// ZipBy5 creates a slice of transformed elements, the first of which contains the first elements
-// of the given arrays, the second of which contains the second elements of the given arrays, and so on.
-// When collections have different size, the Tuple attributes are filled with zero value.
-func ZipBy5[A any, B any, C any, D any, E any, Out any](a []A, b []B, c []C, d []D, e []E, iteratee func(a A, b B, c C, d D, e E) Out) []Out {
+// of the given slices, the second of which contains the second elements of the given slices, and so on.
+// When collections are different sizes, the Tuple attributes are filled with zero value.
+// Play: https://go.dev/play/p/SLynyalh5Oa
+func ZipBy5[A, B, C, D, E, Out any](a []A, b []B, c []C, d []D, e []E, iteratee func(a A, b B, c C, d D, e E) Out) []Out {
size := Max([]int{len(a), len(b), len(c), len(d), len(e)})
result := make([]Out, 0, size)
@@ -407,9 +411,10 @@ func ZipBy5[A any, B any, C any, D any, E any, Out any](a []A, b []B, c []C, d [
}
// ZipBy6 creates a slice of transformed elements, the first of which contains the first elements
-// of the given arrays, the second of which contains the second elements of the given arrays, and so on.
-// When collections have different size, the Tuple attributes are filled with zero value.
-func ZipBy6[A any, B any, C any, D any, E any, F any, Out any](a []A, b []B, c []C, d []D, e []E, f []F, iteratee func(a A, b B, c C, d D, e E, f F) Out) []Out {
+// of the given slices, the second of which contains the second elements of the given slices, and so on.
+// When collections are different sizes, the Tuple attributes are filled with zero value.
+// Play: https://go.dev/play/p/IK6KVgw9e-S
+func ZipBy6[A, B, C, D, E, F, Out any](a []A, b []B, c []C, d []D, e []E, f []F, iteratee func(a A, b B, c C, d D, e E, f F) Out) []Out {
size := Max([]int{len(a), len(b), len(c), len(d), len(e), len(f)})
result := make([]Out, 0, size)
@@ -429,10 +434,11 @@ func ZipBy6[A any, B any, C any, D any, E any, F any, Out any](a []A, b []B, c [
}
// ZipBy7 creates a slice of transformed elements, the first of which contains the first elements
-// of the given arrays, the second of which contains the second elements of the given arrays, and so on.
-// When collections have different size, the Tuple attributes are filled with zero value.
-func ZipBy7[A any, B any, C any, D any, E any, F any, G any, Out any](a []A, b []B, c []C, d []D, e []E, f []F, g []G, iteratee func(a A, b B, c C, d D, e E, f F, g G) Out) []Out {
- size := Max([]int{len(a), len(b), len(c), len(d), len(e), len(f)})
+// of the given slices, the second of which contains the second elements of the given slices, and so on.
+// When collections are different sizes, the Tuple attributes are filled with zero value.
+// Play: https://go.dev/play/p/4uW6a2vXh8w
+func ZipBy7[A, B, C, D, E, F, G, Out any](a []A, b []B, c []C, d []D, e []E, f []F, g []G, iteratee func(a A, b B, c C, d D, e E, f F, g G) Out) []Out {
+ size := Max([]int{len(a), len(b), len(c), len(d), len(e), len(f), len(g)})
result := make([]Out, 0, size)
@@ -452,10 +458,11 @@ func ZipBy7[A any, B any, C any, D any, E any, F any, G any, Out any](a []A, b [
}
// ZipBy8 creates a slice of transformed elements, the first of which contains the first elements
-// of the given arrays, the second of which contains the second elements of the given arrays, and so on.
-// When collections have different size, the Tuple attributes are filled with zero value.
-func ZipBy8[A any, B any, C any, D any, E any, F any, G any, H any, Out any](a []A, b []B, c []C, d []D, e []E, f []F, g []G, h []H, iteratee func(a A, b B, c C, d D, e E, f F, g G, h H) Out) []Out {
- size := Max([]int{len(a), len(b), len(c), len(d), len(e), len(f), len(g)})
+// of the given slices, the second of which contains the second elements of the given slices, and so on.
+// When collections are different sizes, the Tuple attributes are filled with zero value.
+// Play: https://go.dev/play/p/tk8xW7XzY4v
+func ZipBy8[A, B, C, D, E, F, G, H, Out any](a []A, b []B, c []C, d []D, e []E, f []F, g []G, h []H, iteratee func(a A, b B, c C, d D, e E, f F, g G, h H) Out) []Out {
+ size := Max([]int{len(a), len(b), len(c), len(d), len(e), len(f), len(g), len(h)})
result := make([]Out, 0, size)
@@ -476,9 +483,10 @@ func ZipBy8[A any, B any, C any, D any, E any, F any, G any, H any, Out any](a [
}
// ZipBy9 creates a slice of transformed elements, the first of which contains the first elements
-// of the given arrays, the second of which contains the second elements of the given arrays, and so on.
-// When collections have different size, the Tuple attributes are filled with zero value.
-func ZipBy9[A any, B any, C any, D any, E any, F any, G any, H any, I any, Out any](a []A, b []B, c []C, d []D, e []E, f []F, g []G, h []H, i []I, iteratee func(a A, b B, c C, d D, e E, f F, g G, h H, i I) Out) []Out {
+// of the given slices, the second of which contains the second elements of the given slices, and so on.
+// When collections are different sizes, the Tuple attributes are filled with zero value.
+// Play: https://go.dev/play/p/VGqjDmQ9YqX
+func ZipBy9[A, B, C, D, E, F, G, H, I, Out any](a []A, b []B, c []C, d []D, e []E, f []F, g []G, h []H, i []I, iteratee func(a A, b B, c C, d D, e E, f F, g G, h H, i I) Out) []Out {
size := Max([]int{len(a), len(b), len(c), len(d), len(e), len(f), len(g), len(h), len(i)})
result := make([]Out, 0, size)
@@ -500,7 +508,7 @@ func ZipBy9[A any, B any, C any, D any, E any, F any, G any, H any, I any, Out a
return result
}
-// Unzip2 accepts an array of grouped elements and creates an array regrouping the elements
+// Unzip2 accepts a slice of grouped elements and creates a slice regrouping the elements
// to their pre-zip configuration.
// Play: https://go.dev/play/p/ciHugugvaAW
func Unzip2[A, B any](tuples []Tuple2[A, B]) ([]A, []B) {
@@ -516,7 +524,7 @@ func Unzip2[A, B any](tuples []Tuple2[A, B]) ([]A, []B) {
return r1, r2
}
-// Unzip3 accepts an array of grouped elements and creates an array regrouping the elements
+// Unzip3 accepts a slice of grouped elements and creates a slice regrouping the elements
// to their pre-zip configuration.
// Play: https://go.dev/play/p/ciHugugvaAW
func Unzip3[A, B, C any](tuples []Tuple3[A, B, C]) ([]A, []B, []C) {
@@ -534,7 +542,7 @@ func Unzip3[A, B, C any](tuples []Tuple3[A, B, C]) ([]A, []B, []C) {
return r1, r2, r3
}
-// Unzip4 accepts an array of grouped elements and creates an array regrouping the elements
+// Unzip4 accepts a slice of grouped elements and creates a slice regrouping the elements
// to their pre-zip configuration.
// Play: https://go.dev/play/p/ciHugugvaAW
func Unzip4[A, B, C, D any](tuples []Tuple4[A, B, C, D]) ([]A, []B, []C, []D) {
@@ -554,7 +562,7 @@ func Unzip4[A, B, C, D any](tuples []Tuple4[A, B, C, D]) ([]A, []B, []C, []D) {
return r1, r2, r3, r4
}
-// Unzip5 accepts an array of grouped elements and creates an array regrouping the elements
+// Unzip5 accepts a slice of grouped elements and creates a slice regrouping the elements
// to their pre-zip configuration.
// Play: https://go.dev/play/p/ciHugugvaAW
func Unzip5[A, B, C, D, E any](tuples []Tuple5[A, B, C, D, E]) ([]A, []B, []C, []D, []E) {
@@ -576,7 +584,7 @@ func Unzip5[A, B, C, D, E any](tuples []Tuple5[A, B, C, D, E]) ([]A, []B, []C, [
return r1, r2, r3, r4, r5
}
-// Unzip6 accepts an array of grouped elements and creates an array regrouping the elements
+// Unzip6 accepts a slice of grouped elements and creates a slice regrouping the elements
// to their pre-zip configuration.
// Play: https://go.dev/play/p/ciHugugvaAW
func Unzip6[A, B, C, D, E, F any](tuples []Tuple6[A, B, C, D, E, F]) ([]A, []B, []C, []D, []E, []F) {
@@ -600,7 +608,7 @@ func Unzip6[A, B, C, D, E, F any](tuples []Tuple6[A, B, C, D, E, F]) ([]A, []B,
return r1, r2, r3, r4, r5, r6
}
-// Unzip7 accepts an array of grouped elements and creates an array regrouping the elements
+// Unzip7 accepts a slice of grouped elements and creates a slice regrouping the elements
// to their pre-zip configuration.
// Play: https://go.dev/play/p/ciHugugvaAW
func Unzip7[A, B, C, D, E, F, G any](tuples []Tuple7[A, B, C, D, E, F, G]) ([]A, []B, []C, []D, []E, []F, []G) {
@@ -626,7 +634,7 @@ func Unzip7[A, B, C, D, E, F, G any](tuples []Tuple7[A, B, C, D, E, F, G]) ([]A,
return r1, r2, r3, r4, r5, r6, r7
}
-// Unzip8 accepts an array of grouped elements and creates an array regrouping the elements
+// Unzip8 accepts a slice of grouped elements and creates a slice regrouping the elements
// to their pre-zip configuration.
// Play: https://go.dev/play/p/ciHugugvaAW
func Unzip8[A, B, C, D, E, F, G, H any](tuples []Tuple8[A, B, C, D, E, F, G, H]) ([]A, []B, []C, []D, []E, []F, []G, []H) {
@@ -654,7 +662,7 @@ func Unzip8[A, B, C, D, E, F, G, H any](tuples []Tuple8[A, B, C, D, E, F, G, H])
return r1, r2, r3, r4, r5, r6, r7, r8
}
-// Unzip9 accepts an array of grouped elements and creates an array regrouping the elements
+// Unzip9 accepts a slice of grouped elements and creates a slice regrouping the elements
// to their pre-zip configuration.
// Play: https://go.dev/play/p/ciHugugvaAW
func Unzip9[A, B, C, D, E, F, G, H, I any](tuples []Tuple9[A, B, C, D, E, F, G, H, I]) ([]A, []B, []C, []D, []E, []F, []G, []H, []I) {
@@ -684,9 +692,10 @@ func Unzip9[A, B, C, D, E, F, G, H, I any](tuples []Tuple9[A, B, C, D, E, F, G,
return r1, r2, r3, r4, r5, r6, r7, r8, r9
}
-// UnzipBy2 iterates over a collection and creates an array regrouping the elements
+// UnzipBy2 iterates over a collection and creates a slice regrouping the elements
// to their pre-zip configuration.
-func UnzipBy2[In any, A any, B any](items []In, iteratee func(In) (a A, b B)) ([]A, []B) {
+// Play: https://go.dev/play/p/tN8yqaRZz0r
+func UnzipBy2[In, A, B any](items []In, iteratee func(In) (a A, b B)) ([]A, []B) {
size := len(items)
r1 := make([]A, 0, size)
r2 := make([]B, 0, size)
@@ -700,9 +709,10 @@ func UnzipBy2[In any, A any, B any](items []In, iteratee func(In) (a A, b B)) ([
return r1, r2
}
-// UnzipBy3 iterates over a collection and creates an array regrouping the elements
+// UnzipBy3 iterates over a collection and creates a slice regrouping the elements
// to their pre-zip configuration.
-func UnzipBy3[In any, A any, B any, C any](items []In, iteratee func(In) (a A, b B, c C)) ([]A, []B, []C) {
+// Play: https://go.dev/play/p/36ITO2DlQq1
+func UnzipBy3[In, A, B, C any](items []In, iteratee func(In) (a A, b B, c C)) ([]A, []B, []C) {
size := len(items)
r1 := make([]A, 0, size)
r2 := make([]B, 0, size)
@@ -718,9 +728,10 @@ func UnzipBy3[In any, A any, B any, C any](items []In, iteratee func(In) (a A, b
return r1, r2, r3
}
-// UnzipBy4 iterates over a collection and creates an array regrouping the elements
+// UnzipBy4 iterates over a collection and creates a slice regrouping the elements
// to their pre-zip configuration.
-func UnzipBy4[In any, A any, B any, C any, D any](items []In, iteratee func(In) (a A, b B, c C, d D)) ([]A, []B, []C, []D) {
+// Play: https://go.dev/play/p/zJ6qY1dD1rL
+func UnzipBy4[In, A, B, C, D any](items []In, iteratee func(In) (a A, b B, c C, d D)) ([]A, []B, []C, []D) {
size := len(items)
r1 := make([]A, 0, size)
r2 := make([]B, 0, size)
@@ -738,9 +749,10 @@ func UnzipBy4[In any, A any, B any, C any, D any](items []In, iteratee func(In)
return r1, r2, r3, r4
}
-// UnzipBy5 iterates over a collection and creates an array regrouping the elements
+// UnzipBy5 iterates over a collection and creates a slice regrouping the elements
// to their pre-zip configuration.
-func UnzipBy5[In any, A any, B any, C any, D any, E any](items []In, iteratee func(In) (a A, b B, c C, d D, e E)) ([]A, []B, []C, []D, []E) {
+// Play: https://go.dev/play/p/3f7jKkV9xZt
+func UnzipBy5[In, A, B, C, D, E any](items []In, iteratee func(In) (a A, b B, c C, d D, e E)) ([]A, []B, []C, []D, []E) {
size := len(items)
r1 := make([]A, 0, size)
r2 := make([]B, 0, size)
@@ -760,9 +772,10 @@ func UnzipBy5[In any, A any, B any, C any, D any, E any](items []In, iteratee fu
return r1, r2, r3, r4, r5
}
-// UnzipBy6 iterates over a collection and creates an array regrouping the elements
+// UnzipBy6 iterates over a collection and creates a slice regrouping the elements
// to their pre-zip configuration.
-func UnzipBy6[In any, A any, B any, C any, D any, E any, F any](items []In, iteratee func(In) (a A, b B, c C, d D, e E, f F)) ([]A, []B, []C, []D, []E, []F) {
+// Play: https://go.dev/play/p/8Y1b7tKu2pL
+func UnzipBy6[In, A, B, C, D, E, F any](items []In, iteratee func(In) (a A, b B, c C, d D, e E, f F)) ([]A, []B, []C, []D, []E, []F) {
size := len(items)
r1 := make([]A, 0, size)
r2 := make([]B, 0, size)
@@ -784,9 +797,10 @@ func UnzipBy6[In any, A any, B any, C any, D any, E any, F any](items []In, iter
return r1, r2, r3, r4, r5, r6
}
-// UnzipBy7 iterates over a collection and creates an array regrouping the elements
+// UnzipBy7 iterates over a collection and creates a slice regrouping the elements
// to their pre-zip configuration.
-func UnzipBy7[In any, A any, B any, C any, D any, E any, F any, G any](items []In, iteratee func(In) (a A, b B, c C, d D, e E, f F, g G)) ([]A, []B, []C, []D, []E, []F, []G) {
+// Play: https://go.dev/play/p/7j1kLmVn3pM
+func UnzipBy7[In, A, B, C, D, E, F, G any](items []In, iteratee func(In) (a A, b B, c C, d D, e E, f F, g G)) ([]A, []B, []C, []D, []E, []F, []G) {
size := len(items)
r1 := make([]A, 0, size)
r2 := make([]B, 0, size)
@@ -810,9 +824,10 @@ func UnzipBy7[In any, A any, B any, C any, D any, E any, F any, G any](items []I
return r1, r2, r3, r4, r5, r6, r7
}
-// UnzipBy8 iterates over a collection and creates an array regrouping the elements
+// UnzipBy8 iterates over a collection and creates a slice regrouping the elements
// to their pre-zip configuration.
-func UnzipBy8[In any, A any, B any, C any, D any, E any, F any, G any, H any](items []In, iteratee func(In) (a A, b B, c C, d D, e E, f F, g G, h H)) ([]A, []B, []C, []D, []E, []F, []G, []H) {
+// Play: https://go.dev/play/p/1n2k3L4m5N6
+func UnzipBy8[In, A, B, C, D, E, F, G, H any](items []In, iteratee func(In) (a A, b B, c C, d D, e E, f F, g G, h H)) ([]A, []B, []C, []D, []E, []F, []G, []H) {
size := len(items)
r1 := make([]A, 0, size)
r2 := make([]B, 0, size)
@@ -838,9 +853,10 @@ func UnzipBy8[In any, A any, B any, C any, D any, E any, F any, G any, H any](it
return r1, r2, r3, r4, r5, r6, r7, r8
}
-// UnzipBy9 iterates over a collection and creates an array regrouping the elements
+// UnzipBy9 iterates over a collection and creates a slice regrouping the elements
// to their pre-zip configuration.
-func UnzipBy9[In any, A any, B any, C any, D any, E any, F any, G any, H any, I any](items []In, iteratee func(In) (a A, b B, c C, d D, e E, f F, g G, h H, i I)) ([]A, []B, []C, []D, []E, []F, []G, []H, []I) {
+// Play: https://go.dev/play/p/7o8p9q0r1s2
+func UnzipBy9[In, A, B, C, D, E, F, G, H, I any](items []In, iteratee func(In) (a A, b B, c C, d D, e E, f F, g G, h H, i I)) ([]A, []B, []C, []D, []E, []F, []G, []H, []I) {
size := len(items)
r1 := make([]A, 0, size)
r2 := make([]B, 0, size)
@@ -868,66 +884,75 @@ func UnzipBy9[In any, A any, B any, C any, D any, E any, F any, G any, H any, I
return r1, r2, r3, r4, r5, r6, r7, r8, r9
}
-// CrossJoin2 combines every items from one list with every items from others.
+// CrossJoin2 combines every item from one list with every item from others.
// It is the cartesian product of lists received as arguments.
-// It returns an empty list if a list is empty.
+// Returns an empty list if a list is empty.
+// Play: https://go.dev/play/p/3VFppyL9FDU
func CrossJoin2[A, B any](listA []A, listB []B) []Tuple2[A, B] {
return CrossJoinBy2(listA, listB, T2[A, B])
}
-// CrossJoin3 combines every items from one list with every items from others.
+// CrossJoin3 combines every item from one list with every item from others.
// It is the cartesian product of lists received as arguments.
-// It returns an empty list if a list is empty.
+// Returns an empty list if a list is empty.
+// Play: https://go.dev/play/p/2WGeHyJj4fK
func CrossJoin3[A, B, C any](listA []A, listB []B, listC []C) []Tuple3[A, B, C] {
return CrossJoinBy3(listA, listB, listC, T3[A, B, C])
}
-// CrossJoin4 combines every items from one list with every items from others.
+// CrossJoin4 combines every item from one list with every item from others.
// It is the cartesian product of lists received as arguments.
-// It returns an empty list if a list is empty.
+// Returns an empty list if a list is empty.
+// Play: https://go.dev/play/p/6XhKjLmMnNp
func CrossJoin4[A, B, C, D any](listA []A, listB []B, listC []C, listD []D) []Tuple4[A, B, C, D] {
return CrossJoinBy4(listA, listB, listC, listD, T4[A, B, C, D])
}
-// CrossJoin5 combines every items from one list with every items from others.
+// CrossJoin5 combines every item from one list with every item from others.
// It is the cartesian product of lists received as arguments.
-// It returns an empty list if a list is empty.
+// Returns an empty list if a list is empty.
+// Play: https://go.dev/play/p/7oPqRsTuVwX
func CrossJoin5[A, B, C, D, E any](listA []A, listB []B, listC []C, listD []D, listE []E) []Tuple5[A, B, C, D, E] {
return CrossJoinBy5(listA, listB, listC, listD, listE, T5[A, B, C, D, E])
}
-// CrossJoin6 combines every items from one list with every items from others.
+// CrossJoin6 combines every item from one list with every item from others.
// It is the cartesian product of lists received as arguments.
-// It returns an empty list if a list is empty.
+// Returns an empty list if a list is empty.
+// Play: https://go.dev/play/p/8yZ1aB2cD3e
func CrossJoin6[A, B, C, D, E, F any](listA []A, listB []B, listC []C, listD []D, listE []E, listF []F) []Tuple6[A, B, C, D, E, F] {
return CrossJoinBy6(listA, listB, listC, listD, listE, listF, T6[A, B, C, D, E, F])
}
-// CrossJoin7 combines every items from one list with every items from others.
+// CrossJoin7 combines every item from one list with every item from others.
// It is the cartesian product of lists received as arguments.
-// It returns an empty list if a list is empty.
+// Returns an empty list if a list is empty.
+// Play: https://go.dev/play/p/9f4g5h6i7j8
func CrossJoin7[A, B, C, D, E, F, G any](listA []A, listB []B, listC []C, listD []D, listE []E, listF []F, listG []G) []Tuple7[A, B, C, D, E, F, G] {
return CrossJoinBy7(listA, listB, listC, listD, listE, listF, listG, T7[A, B, C, D, E, F, G])
}
-// CrossJoin8 combines every items from one list with every items from others.
+// CrossJoin8 combines every item from one list with every item from others.
// It is the cartesian product of lists received as arguments.
-// It returns an empty list if a list is empty.
+// Returns an empty list if a list is empty.
+// Play: https://go.dev/play/p/0k1l2m3n4o5
func CrossJoin8[A, B, C, D, E, F, G, H any](listA []A, listB []B, listC []C, listD []D, listE []E, listF []F, listG []G, listH []H) []Tuple8[A, B, C, D, E, F, G, H] {
return CrossJoinBy8(listA, listB, listC, listD, listE, listF, listG, listH, T8[A, B, C, D, E, F, G, H])
}
-// CrossJoin9 combines every items from one list with every items from others.
+// CrossJoin9 combines every item from one list with every item from others.
// It is the cartesian product of lists received as arguments.
-// It returns an empty list if a list is empty.
+// Returns an empty list if a list is empty.
+// Play: https://go.dev/play/p/6p7q8r9s0t1
func CrossJoin9[A, B, C, D, E, F, G, H, I any](listA []A, listB []B, listC []C, listD []D, listE []E, listF []F, listG []G, listH []H, listI []I) []Tuple9[A, B, C, D, E, F, G, H, I] {
return CrossJoinBy9(listA, listB, listC, listD, listE, listF, listG, listH, listI, T9[A, B, C, D, E, F, G, H, I])
}
-// CrossJoinBy2 combines every items from one list with every items from others.
+// CrossJoinBy2 combines every item from one list with every item from others.
// It is the cartesian product of lists received as arguments. The project function
// is used to create the output values.
-// It returns an empty list if a list is empty.
+// Returns an empty list if a list is empty.
+// Play: https://go.dev/play/p/8Y7btpvuA-C
func CrossJoinBy2[A, B, Out any](listA []A, listB []B, project func(a A, b B) Out) []Out {
size := len(listA) * len(listB)
if size == 0 {
@@ -945,10 +970,11 @@ func CrossJoinBy2[A, B, Out any](listA []A, listB []B, project func(a A, b B) Ou
return result
}
-// CrossJoinBy3 combines every items from one list with every items from others.
+// CrossJoinBy3 combines every item from one list with every item from others.
// It is the cartesian product of lists received as arguments. The project function
// is used to create the output values.
-// It returns an empty list if a list is empty.
+// Returns an empty list if a list is empty.
+// Play: https://go.dev/play/p/3z4y5x6w7v8
func CrossJoinBy3[A, B, C, Out any](listA []A, listB []B, listC []C, project func(a A, b B, c C) Out) []Out {
size := len(listA) * len(listB) * len(listC)
if size == 0 {
@@ -968,10 +994,11 @@ func CrossJoinBy3[A, B, C, Out any](listA []A, listB []B, listC []C, project fun
return result
}
-// CrossJoinBy4 combines every items from one list with every items from others.
+// CrossJoinBy4 combines every item from one list with every item from others.
// It is the cartesian product of lists received as arguments. The project function
// is used to create the output values.
-// It returns an empty list if a list is empty.
+// Returns an empty list if a list is empty.
+// Play: https://go.dev/play/p/8b9c0d1e2f3
func CrossJoinBy4[A, B, C, D, Out any](listA []A, listB []B, listC []C, listD []D, project func(a A, b B, c C, d D) Out) []Out {
size := len(listA) * len(listB) * len(listC) * len(listD)
if size == 0 {
@@ -993,10 +1020,11 @@ func CrossJoinBy4[A, B, C, D, Out any](listA []A, listB []B, listC []C, listD []
return result
}
-// CrossJoinBy5 combines every items from one list with every items from others.
+// CrossJoinBy5 combines every item from one list with every item from others.
// It is the cartesian product of lists received as arguments. The project function
// is used to create the output values.
-// It returns an empty list if a list is empty.
+// Returns an empty list if a list is empty.
+// Play: https://go.dev/play/p/4g5h6i7j8k9
func CrossJoinBy5[A, B, C, D, E, Out any](listA []A, listB []B, listC []C, listD []D, listE []E, project func(a A, b B, c C, d D, e E) Out) []Out {
size := len(listA) * len(listB) * len(listC) * len(listD) * len(listE)
if size == 0 {
@@ -1020,10 +1048,11 @@ func CrossJoinBy5[A, B, C, D, E, Out any](listA []A, listB []B, listC []C, listD
return result
}
-// CrossJoinBy6 combines every items from one list with every items from others.
+// CrossJoinBy6 combines every item from one list with every item from others.
// It is the cartesian product of lists received as arguments. The project function
// is used to create the output values.
-// It returns an empty list if a list is empty.
+// Returns an empty list if a list is empty.
+// Play: https://go.dev/play/p/1l2m3n4o5p6
func CrossJoinBy6[A, B, C, D, E, F, Out any](listA []A, listB []B, listC []C, listD []D, listE []E, listF []F, project func(a A, b B, c C, d D, e E, f F) Out) []Out {
size := len(listA) * len(listB) * len(listC) * len(listD) * len(listE) * len(listF)
if size == 0 {
@@ -1049,10 +1078,11 @@ func CrossJoinBy6[A, B, C, D, E, F, Out any](listA []A, listB []B, listC []C, li
return result
}
-// CrossJoinBy7 combines every items from one list with every items from others.
+// CrossJoinBy7 combines every item from one list with every item from others.
// It is the cartesian product of lists received as arguments. The project function
// is used to create the output values.
-// It returns an empty list if a list is empty.
+// Returns an empty list if a list is empty.
+// Play: https://go.dev/play/p/7q8r9s0t1u2
func CrossJoinBy7[A, B, C, D, E, F, G, Out any](listA []A, listB []B, listC []C, listD []D, listE []E, listF []F, listG []G, project func(a A, b B, c C, d D, e E, f F, g G) Out) []Out {
size := len(listA) * len(listB) * len(listC) * len(listD) * len(listE) * len(listF) * len(listG)
if size == 0 {
@@ -1080,10 +1110,11 @@ func CrossJoinBy7[A, B, C, D, E, F, G, Out any](listA []A, listB []B, listC []C,
return result
}
-// CrossJoinBy8 combines every items from one list with every items from others.
+// CrossJoinBy8 combines every item from one list with every item from others.
// It is the cartesian product of lists received as arguments. The project function
// is used to create the output values.
-// It returns an empty list if a list is empty.
+// Returns an empty list if a list is empty.
+// Play: https://go.dev/play/p/3v4w5x6y7z8
func CrossJoinBy8[A, B, C, D, E, F, G, H, Out any](listA []A, listB []B, listC []C, listD []D, listE []E, listF []F, listG []G, listH []H, project func(a A, b B, c C, d D, e E, f F, g G, h H) Out) []Out {
size := len(listA) * len(listB) * len(listC) * len(listD) * len(listE) * len(listF) * len(listG) * len(listH)
if size == 0 {
@@ -1113,10 +1144,11 @@ func CrossJoinBy8[A, B, C, D, E, F, G, H, Out any](listA []A, listB []B, listC [
return result
}
-// CrossJoinBy9 combines every items from one list with every items from others.
+// CrossJoinBy9 combines every item from one list with every item from others.
// It is the cartesian product of lists received as arguments. The project function
// is used to create the output values.
-// It returns an empty list if a list is empty.
+// Returns an empty list if a list is empty.
+// Play: https://go.dev/play/p/9a0b1c2d3e4
func CrossJoinBy9[A, B, C, D, E, F, G, H, I, Out any](listA []A, listB []B, listC []C, listD []D, listE []E, listF []F, listG []G, listH []H, listI []I, project func(a A, b B, c C, d D, e E, f F, g G, h H, i I) Out) []Out {
size := len(listA) * len(listB) * len(listC) * len(listD) * len(listE) * len(listF) * len(listG) * len(listH) * len(listI)
if size == 0 {
diff --git a/vendor/github.com/samber/lo/type_manipulation.go b/vendor/github.com/samber/lo/type_manipulation.go
index bcf990cd6d..281f316dc0 100644
--- a/vendor/github.com/samber/lo/type_manipulation.go
+++ b/vendor/github.com/samber/lo/type_manipulation.go
@@ -3,28 +3,41 @@ package lo
import "reflect"
// IsNil checks if a value is nil or if it's a reference type with a nil underlying value.
+// Play: https://go.dev/play/p/P2sD0PMXw4F
func IsNil(x any) bool {
- defer func() { recover() }() // nolint:errcheck
- return x == nil || reflect.ValueOf(x).IsNil()
+ if x == nil {
+ return true
+ }
+ v := reflect.ValueOf(x)
+ switch v.Kind() { //nolint:exhaustive
+ case reflect.Chan, reflect.Func, reflect.Map, reflect.Pointer, reflect.UnsafePointer, reflect.Interface, reflect.Slice:
+ return v.IsNil()
+ default:
+ return false
+ }
}
// IsNotNil checks if a value is not nil or if it's not a reference type with a nil underlying value.
+// Play: https://go.dev/play/p/P2sD0PMXw4F
func IsNotNil(x any) bool {
return !IsNil(x)
}
// ToPtr returns a pointer copy of value.
+// Play: https://go.dev/play/p/P2sD0PMXw4F
func ToPtr[T any](x T) *T {
return &x
}
// Nil returns a nil pointer of type.
+// Play: https://go.dev/play/p/P2sD0PMXw4F
func Nil[T any]() *T {
return nil
}
// EmptyableToPtr returns a pointer copy of value if it's nonzero.
// Otherwise, returns nil pointer.
+// Play: https://go.dev/play/p/P2sD0PMXw4F
func EmptyableToPtr[T any](x T) *T {
// 🤮
isZero := reflect.ValueOf(&x).Elem().IsZero()
@@ -36,6 +49,7 @@ func EmptyableToPtr[T any](x T) *T {
}
// FromPtr returns the pointer value or empty.
+// Play: https://go.dev/play/p/mhD9CwO3X0m
func FromPtr[T any](x *T) T {
if x == nil {
return Empty[T]()
@@ -45,6 +59,7 @@ func FromPtr[T any](x *T) T {
}
// FromPtrOr returns the pointer value or the fallback value.
+// Play: https://go.dev/play/p/mhD9CwO3X0m
func FromPtrOr[T any](x *T, fallback T) T {
if x == nil {
return fallback
@@ -53,7 +68,8 @@ func FromPtrOr[T any](x *T, fallback T) T {
return *x
}
-// ToSlicePtr returns a slice of pointer copy of value.
+// ToSlicePtr returns a slice of pointers to each value.
+// Play: https://go.dev/play/p/P2sD0PMXw4F
func ToSlicePtr[T any](collection []T) []*T {
result := make([]*T, len(collection))
@@ -65,6 +81,7 @@ func ToSlicePtr[T any](collection []T) []*T {
// FromSlicePtr returns a slice with the pointer values.
// Returns a zero value in case of a nil pointer element.
+// Play: https://go.dev/play/p/lbunFvzlUDX
func FromSlicePtr[T any](collection []*T) []T {
return Map(collection, func(x *T, _ int) T {
if x == nil {
@@ -85,7 +102,8 @@ func FromSlicePtrOr[T any](collection []*T, fallback T) []T {
})
}
-// ToAnySlice returns a slice with all elements mapped to `any` type
+// ToAnySlice returns a slice with all elements mapped to `any` type.
+// Play: https://go.dev/play/p/P2sD0PMXw4F
func ToAnySlice[T any](collection []T) []any {
result := make([]any, len(collection))
for i := range collection {
@@ -94,61 +112,65 @@ func ToAnySlice[T any](collection []T) []any {
return result
}
-// FromAnySlice returns an `any` slice with all elements mapped to a type.
+// FromAnySlice returns a slice with all elements mapped to a type.
// Returns false in case of type conversion failure.
-func FromAnySlice[T any](in []any) (out []T, ok bool) {
- defer func() {
- if r := recover(); r != nil {
- out = []T{}
- ok = false
- }
- }()
-
- result := make([]T, len(in))
+// Play: https://go.dev/play/p/P2sD0PMXw4F
+func FromAnySlice[T any](in []any) ([]T, bool) {
+ out := make([]T, len(in))
for i := range in {
- result[i] = in[i].(T)
+ t, ok := in[i].(T)
+ if !ok {
+ return []T{}, false
+ }
+ out[i] = t
}
- return result, true
+ return out, true
}
// Empty returns the zero value (https://go.dev/ref/spec#The_zero_value).
+// Play: https://go.dev/play/p/P2sD0PMXw4F
func Empty[T any]() T {
var zero T
return zero
}
// IsEmpty returns true if argument is a zero value.
+// Play: https://go.dev/play/p/P2sD0PMXw4F
func IsEmpty[T comparable](v T) bool {
var zero T
return zero == v
}
// IsNotEmpty returns true if argument is not a zero value.
+// Play: https://go.dev/play/p/P2sD0PMXw4F
func IsNotEmpty[T comparable](v T) bool {
var zero T
return zero != v
}
// Coalesce returns the first non-empty arguments. Arguments must be comparable.
-func Coalesce[T comparable](values ...T) (result T, ok bool) {
+// Play: https://go.dev/play/p/Gyo9otyvFHH
+func Coalesce[T comparable](values ...T) (T, bool) {
+ var zero T
+
for i := range values {
- if values[i] != result {
- result = values[i]
- ok = true
- return
+ if values[i] != zero {
+ return values[i], true
}
}
- return
+ return zero, false
}
// CoalesceOrEmpty returns the first non-empty arguments. Arguments must be comparable.
+// Play: https://go.dev/play/p/Gyo9otyvFHH
func CoalesceOrEmpty[T comparable](v ...T) T {
result, _ := Coalesce(v...)
return result
}
// CoalesceSlice returns the first non-zero slice.
+// Play: https://go.dev/play/p/Gyo9otyvFHH
func CoalesceSlice[T any](v ...[]T) ([]T, bool) {
for i := range v {
if v[i] != nil && len(v[i]) > 0 {
@@ -159,6 +181,7 @@ func CoalesceSlice[T any](v ...[]T) ([]T, bool) {
}
// CoalesceSliceOrEmpty returns the first non-zero slice.
+// Play: https://go.dev/play/p/Gyo9otyvFHH
func CoalesceSliceOrEmpty[T any](v ...[]T) []T {
for i := range v {
if v[i] != nil && len(v[i]) > 0 {
@@ -169,6 +192,7 @@ func CoalesceSliceOrEmpty[T any](v ...[]T) []T {
}
// CoalesceMap returns the first non-zero map.
+// Play: https://go.dev/play/p/Gyo9otyvFHH
func CoalesceMap[K comparable, V any](v ...map[K]V) (map[K]V, bool) {
for i := range v {
if v[i] != nil && len(v[i]) > 0 {
@@ -179,6 +203,7 @@ func CoalesceMap[K comparable, V any](v ...map[K]V) (map[K]V, bool) {
}
// CoalesceMapOrEmpty returns the first non-zero map.
+// Play: https://go.dev/play/p/Gyo9otyvFHH
func CoalesceMapOrEmpty[K comparable, V any](v ...map[K]V) map[K]V {
for i := range v {
if v[i] != nil && len(v[i]) > 0 {
diff --git a/vendor/github.com/samber/lo/types.go b/vendor/github.com/samber/lo/types.go
index 1c6f0d0057..ccd3d07bce 100644
--- a/vendor/github.com/samber/lo/types.go
+++ b/vendor/github.com/samber/lo/types.go
@@ -12,7 +12,8 @@ type Tuple2[A, B any] struct {
B B
}
-// Unpack returns values contained in tuple.
+// Unpack returns values contained in a tuple.
+// Play: https://go.dev/play/p/yrtn7QJTmL_E
func (t Tuple2[A, B]) Unpack() (A, B) {
return t.A, t.B
}
@@ -24,7 +25,8 @@ type Tuple3[A, B, C any] struct {
C C
}
-// Unpack returns values contained in tuple.
+// Unpack returns values contained in a tuple.
+// Play: https://go.dev/play/p/yrtn7QJTmL_E
func (t Tuple3[A, B, C]) Unpack() (A, B, C) {
return t.A, t.B, t.C
}
@@ -37,7 +39,8 @@ type Tuple4[A, B, C, D any] struct {
D D
}
-// Unpack returns values contained in tuple.
+// Unpack returns values contained in a tuple.
+// Play: https://go.dev/play/p/yrtn7QJTmL_E
func (t Tuple4[A, B, C, D]) Unpack() (A, B, C, D) {
return t.A, t.B, t.C, t.D
}
@@ -51,7 +54,8 @@ type Tuple5[A, B, C, D, E any] struct {
E E
}
-// Unpack returns values contained in tuple.
+// Unpack returns values contained in a tuple.
+// Play: https://go.dev/play/p/7J4KrtgtK3M
func (t Tuple5[A, B, C, D, E]) Unpack() (A, B, C, D, E) {
return t.A, t.B, t.C, t.D, t.E
}
@@ -66,7 +70,8 @@ type Tuple6[A, B, C, D, E, F any] struct {
F F
}
-// Unpack returns values contained in tuple.
+// Unpack returns values contained in a tuple.
+// Play: https://go.dev/play/p/7J4KrtgtK3M
func (t Tuple6[A, B, C, D, E, F]) Unpack() (A, B, C, D, E, F) {
return t.A, t.B, t.C, t.D, t.E, t.F
}
@@ -82,7 +87,8 @@ type Tuple7[A, B, C, D, E, F, G any] struct {
G G
}
-// Unpack returns values contained in tuple.
+// Unpack returns values contained in a tuple.
+// Play: https://go.dev/play/p/Ow9Zgf_zeiA
func (t Tuple7[A, B, C, D, E, F, G]) Unpack() (A, B, C, D, E, F, G) {
return t.A, t.B, t.C, t.D, t.E, t.F, t.G
}
@@ -99,7 +105,8 @@ type Tuple8[A, B, C, D, E, F, G, H any] struct {
H H
}
-// Unpack returns values contained in tuple.
+// Unpack returns values contained in a tuple.
+// Play: https://go.dev/play/p/Ow9Zgf_zeiA
func (t Tuple8[A, B, C, D, E, F, G, H]) Unpack() (A, B, C, D, E, F, G, H) {
return t.A, t.B, t.C, t.D, t.E, t.F, t.G, t.H
}
@@ -117,7 +124,8 @@ type Tuple9[A, B, C, D, E, F, G, H, I any] struct {
I I
}
-// Unpack returns values contained in tuple.
+// Unpack returns values contained in a tuple.
+// Play: https://go.dev/play/p/Ow9Zgf_zeiA
func (t Tuple9[A, B, C, D, E, F, G, H, I]) Unpack() (A, B, C, D, E, F, G, H, I) {
return t.A, t.B, t.C, t.D, t.E, t.F, t.G, t.H, t.I
}
diff --git a/vendor/github.com/spf13/cobra/.golangci.yml b/vendor/github.com/spf13/cobra/.golangci.yml
index 2c8f4808c1..6acf8ab1ea 100644
--- a/vendor/github.com/spf13/cobra/.golangci.yml
+++ b/vendor/github.com/spf13/cobra/.golangci.yml
@@ -12,14 +12,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+version: "2"
+
run:
- deadline: 5m
+ timeout: 5m
+
+formatters:
+ enable:
+ - gofmt
+ - goimports
linters:
- disable-all: true
+ default: none
enable:
#- bodyclose
- # - deadcode ! deprecated since v1.49.0; replaced by 'unused'
#- depguard
#- dogsled
#- dupl
@@ -30,28 +36,24 @@ linters:
- goconst
- gocritic
#- gocyclo
- - gofmt
- - goimports
- #- gomnd
#- goprintffuncname
- gosec
- - gosimple
- govet
- ineffassign
#- lll
- misspell
+ #- mnd
#- nakedret
#- noctx
- nolintlint
#- rowserrcheck
- #- scopelint
- staticcheck
- #- structcheck ! deprecated since v1.49.0; replaced by 'unused'
- - stylecheck
- #- typecheck
- unconvert
#- unparam
- unused
- # - varcheck ! deprecated since v1.49.0; replaced by 'unused'
#- whitespace
- fast: false
+ exclusions:
+ presets:
+ - common-false-positives
+ - legacy
+ - std-error-handling
diff --git a/vendor/github.com/spf13/cobra/README.md b/vendor/github.com/spf13/cobra/README.md
index 71757151c3..8416275f48 100644
--- a/vendor/github.com/spf13/cobra/README.md
+++ b/vendor/github.com/spf13/cobra/README.md
@@ -1,8 +1,14 @@
-
-
+
Cobra is a library for creating powerful modern CLI applications.
+Visit Cobra.dev for extensive documentation
+
+
Cobra is used in many Go projects such as [Kubernetes](https://kubernetes.io/),
[Hugo](https://gohugo.io), and [GitHub CLI](https://github.com/cli/cli) to
name a few. [This list](site/content/projects_using_cobra.md) contains a more extensive list of projects using Cobra.
@@ -11,6 +17,20 @@ name a few. [This list](site/content/projects_using_cobra.md) contains a more ex
[](https://pkg.go.dev/github.com/spf13/cobra)
[](https://goreportcard.com/report/github.com/spf13/cobra)
[](https://gophers.slack.com/archives/CD3LP1199)
+
+
+
Supported by:
+
+
+
+
+
+
+### [Warp, the AI terminal for devs](https://www.warp.dev/cobra)
+[Try Cobra in Warp today](https://www.warp.dev/cobra)
+
+
+
# Overview
diff --git a/vendor/github.com/spf13/cobra/SECURITY.md b/vendor/github.com/spf13/cobra/SECURITY.md
new file mode 100644
index 0000000000..54e60c28c1
--- /dev/null
+++ b/vendor/github.com/spf13/cobra/SECURITY.md
@@ -0,0 +1,105 @@
+# Security Policy
+
+## Reporting a Vulnerability
+
+The `cobra` maintainers take security issues seriously and
+we appreciate your efforts to _**responsibly**_ disclose your findings.
+We will make every effort to swiftly respond and address concerns.
+
+To report a security vulnerability:
+
+1. **DO NOT** create a public GitHub issue for the vulnerability!
+2. **DO NOT** create a public GitHub Pull Request with a fix for the vulnerability!
+3. Send an email to `cobra-security@googlegroups.com`.
+4. Include the following details in your report:
+ - Description of the vulnerability
+ - Steps to reproduce
+ - Potential impact of the vulnerability (to your downstream project, to the Go ecosystem, etc.)
+ - Any potential mitigations you've already identified
+5. Allow up to 7 days for an initial response.
+ You should receive an acknowledgment of your report and an estimated timeline for a fix.
+6. (Optional) If you have a fix and would like to contribute your patch, please work
+ directly with the maintainers via `cobra-security@googlegroups.com` to
+ coordinate pushing the patch to GitHub, cutting a new release, and disclosing the change.
+
+## Response Process
+
+When a security vulnerability report is received, the `cobra` maintainers will:
+
+1. Confirm receipt of the vulnerability report within 7 days.
+2. Assess the report to determine if it constitutes a security vulnerability.
+3. If confirmed, assign the vulnerability a severity level and create a timeline for addressing it.
+4. Develop and test a fix.
+5. Patch the vulnerability and make a new GitHub release: the maintainers will coordinate disclosure with the reporter.
+6. Create a new GitHub Security Advisory to inform the broader Go ecosystem
+
+## Disclosure Policy
+
+The `cobra` maintainers follow a coordinated disclosure process:
+
+1. Security vulnerabilities will be addressed as quickly as possible.
+2. A CVE (Common Vulnerabilities and Exposures) identifier will be requested for significant vulnerabilities
+ that are within `cobra` itself.
+3. Once a fix is ready, the maintainers will:
+ - Release a new version containing the fix.
+ - Update the security advisory with details about the vulnerability.
+ - Credit the reporter (unless they wish to remain anonymous).
+ - Credit the fixer (unless they wish to remain anonymous, this may be the same as the reporter).
+ - Announce the vulnerability through appropriate channels
+ (GitHub Security Advisory, mailing lists, GitHub Releases, etc.)
+
+## Supported Versions
+
+Security fixes will typically only be released for the most recent major release.
+
+## Upstream Security Issues
+
+`cobra` generally will not accept vulnerability reports that originate in upstream
+dependencies. I.e., if there is a problem in Go code that `cobra` depends on,
+it is best to engage that project's maintainers and owners.
+
+This security policy primarily pertains only to `cobra` itself but if you believe you've
+identified a problem that originates in an upstream dependency and is being widely
+distributed by `cobra`, please follow the disclosure procedure above: the `cobra`
+maintainers will work with you to determine the severity and ecosystem impact.
+
+## Security Updates and CVEs
+
+Information about known security vulnerabilities and CVEs affecting `cobra` will
+be published as GitHub Security Advisories at
+https://github.com/spf13/cobra/security/advisories.
+
+All users are encouraged to watch the repository and upgrade promptly when
+security releases are published.
+
+## `cobra` Security Best Practices for Users
+
+When using `cobra` in your CLIs, the `cobra` maintainers recommend the following:
+
+1. Always use the latest version of `cobra`.
+2. [Use Go modules](https://go.dev/blog/using-go-modules) for dependency management.
+3. Always use the latest possible version of Go.
+
+## Security Best Practices for Contributors
+
+When contributing to `cobra`:
+
+1. Be mindful of security implications when adding new features or modifying existing ones.
+2. Be aware of `cobra`'s extremely large reach: it is used in nearly every Go CLI
+ (like Kubernetes, Docker, Prometheus, etc. etc.)
+3. Write tests that explicitly cover edge cases and potential issues.
+4. If you discover a security issue while working on `cobra`, please report it
+ following the process above rather than opening a public pull request or issue that
+ addresses the vulnerability.
+5. Take personal sec-ops seriously and secure your GitHub account: use [two-factor authentication](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa),
+ [sign your commits with a GPG or SSH key](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification),
+ etc.
+
+## Acknowledgments
+
+The `cobra` maintainers would like to thank all security researchers and
+community members who help keep cobra, its users, and the entire Go ecosystem secure through responsible disclosures!!
+
+---
+
+*This security policy is inspired by the [Open Web Application Security Project (OWASP)](https://owasp.org/) guidelines and security best practices.*
diff --git a/vendor/github.com/spf13/cobra/command.go b/vendor/github.com/spf13/cobra/command.go
index dbb2c298ba..78088db69c 100644
--- a/vendor/github.com/spf13/cobra/command.go
+++ b/vendor/github.com/spf13/cobra/command.go
@@ -39,7 +39,7 @@ const (
)
// FParseErrWhitelist configures Flag parse errors to be ignored
-type FParseErrWhitelist flag.ParseErrorsWhitelist
+type FParseErrWhitelist flag.ParseErrorsAllowlist
// Group Structure to manage groups for commands
type Group struct {
@@ -1296,6 +1296,11 @@ Simply type ` + c.DisplayName() + ` help [path to command] for full details.`,
c.Printf("Unknown help topic %#q\n", args)
CheckErr(c.Root().Usage())
} else {
+ // FLow the context down to be used in help text
+ if cmd.ctx == nil {
+ cmd.ctx = c.ctx
+ }
+
cmd.InitDefaultHelpFlag() // make possible 'help' flag to be shown
cmd.InitDefaultVersionFlag() // make possible 'version' flag to be shown
CheckErr(cmd.Help())
@@ -1872,7 +1877,7 @@ func (c *Command) ParseFlags(args []string) error {
c.mergePersistentFlags()
// do it here after merging all flags and just before parse
- c.Flags().ParseErrorsWhitelist = flag.ParseErrorsWhitelist(c.FParseErrWhitelist)
+ c.Flags().ParseErrorsAllowlist = flag.ParseErrorsAllowlist(c.FParseErrWhitelist)
err := c.Flags().Parse(args)
// Print warnings if they occurred (e.g. deprecated flag messages).
@@ -2020,7 +2025,7 @@ func defaultUsageFunc(w io.Writer, in interface{}) error {
fmt.Fprint(w, trimRightSpace(c.InheritedFlags().FlagUsages()))
}
if c.HasHelpSubCommands() {
- fmt.Fprintf(w, "\n\nAdditional help topcis:")
+ fmt.Fprintf(w, "\n\nAdditional help topics:")
for _, subcmd := range c.Commands() {
if subcmd.IsAdditionalHelpTopicCommand() {
fmt.Fprintf(w, "\n %s %s", rpad(subcmd.CommandPath(), subcmd.CommandPathPadding()), subcmd.Short)
diff --git a/vendor/github.com/spf13/cobra/completions.go b/vendor/github.com/spf13/cobra/completions.go
index a1752f7631..d3607c2d2f 100644
--- a/vendor/github.com/spf13/cobra/completions.go
+++ b/vendor/github.com/spf13/cobra/completions.go
@@ -115,6 +115,13 @@ type CompletionOptions struct {
DisableDescriptions bool
// HiddenDefaultCmd makes the default 'completion' command hidden
HiddenDefaultCmd bool
+ // DefaultShellCompDirective sets the ShellCompDirective that is returned
+ // if no special directive can be determined
+ DefaultShellCompDirective *ShellCompDirective
+}
+
+func (receiver *CompletionOptions) SetDefaultShellCompDirective(directive ShellCompDirective) {
+ receiver.DefaultShellCompDirective = &directive
}
// Completion is a string that can be used for completions
@@ -375,7 +382,7 @@ func (c *Command) getCompletions(args []string) (*Command, []Completion, ShellCo
// Error while attempting to parse flags
if flagErr != nil {
// If error type is flagCompError and we don't want flagCompletion we should ignore the error
- if _, ok := flagErr.(*flagCompError); !(ok && !flagCompletion) {
+ if _, ok := flagErr.(*flagCompError); !ok || flagCompletion {
return finalCmd, []Completion{}, ShellCompDirectiveDefault, flagErr
}
}
@@ -480,6 +487,14 @@ func (c *Command) getCompletions(args []string) (*Command, []Completion, ShellCo
}
} else {
directive = ShellCompDirectiveDefault
+ // check current and parent commands for a custom DefaultShellCompDirective
+ for cmd := finalCmd; cmd != nil; cmd = cmd.parent {
+ if cmd.CompletionOptions.DefaultShellCompDirective != nil {
+ directive = *cmd.CompletionOptions.DefaultShellCompDirective
+ break
+ }
+ }
+
if flag == nil {
foundLocalNonPersistentFlag := false
// If TraverseChildren is true on the root command we don't check for
@@ -773,7 +788,7 @@ See each sub-command's help for details on how to use the generated script.
// shell completion for it (prog __complete completion '')
subCmd, cmdArgs, err := c.Find(args)
if err != nil || subCmd.Name() != compCmdName &&
- !(subCmd.Name() == ShellCompRequestCmd && len(cmdArgs) > 1 && cmdArgs[0] == compCmdName) {
+ (subCmd.Name() != ShellCompRequestCmd || len(cmdArgs) <= 1 || cmdArgs[0] != compCmdName) {
// The completion command is not being called or being completed so we remove it.
c.RemoveCommand(completionCmd)
return
diff --git a/vendor/github.com/spf13/pflag/flag.go b/vendor/github.com/spf13/pflag/flag.go
index d4dfbc5ea0..eeed1e92b0 100644
--- a/vendor/github.com/spf13/pflag/flag.go
+++ b/vendor/github.com/spf13/pflag/flag.go
@@ -137,12 +137,16 @@ const (
PanicOnError
)
-// ParseErrorsWhitelist defines the parsing errors that can be ignored
-type ParseErrorsWhitelist struct {
+// ParseErrorsAllowlist defines the parsing errors that can be ignored
+type ParseErrorsAllowlist struct {
// UnknownFlags will ignore unknown flags errors and continue parsing rest of the flags
UnknownFlags bool
}
+// DEPRECATED: please use ParseErrorsAllowlist instead
+// This type will be removed in a future release
+type ParseErrorsWhitelist = ParseErrorsAllowlist
+
// NormalizedName is a flag name that has been normalized according to rules
// for the FlagSet (e.g. making '-' and '_' equivalent).
type NormalizedName string
@@ -158,8 +162,12 @@ type FlagSet struct {
// help/usage messages.
SortFlags bool
- // ParseErrorsWhitelist is used to configure a whitelist of errors
- ParseErrorsWhitelist ParseErrorsWhitelist
+ // ParseErrorsAllowlist is used to configure an allowlist of errors
+ ParseErrorsAllowlist ParseErrorsAllowlist
+
+ // DEPRECATED: please use ParseErrorsAllowlist instead
+ // This field will be removed in a future release
+ ParseErrorsWhitelist ParseErrorsAllowlist
name string
parsed bool
@@ -928,7 +936,6 @@ func VarP(value Value, name, shorthand, usage string) {
// returns the error.
func (f *FlagSet) fail(err error) error {
if f.errorHandling != ContinueOnError {
- fmt.Fprintln(f.Output(), err)
f.usage()
}
return err
@@ -986,6 +993,8 @@ func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []strin
f.usage()
return a, ErrHelp
case f.ParseErrorsWhitelist.UnknownFlags:
+ fallthrough
+ case f.ParseErrorsAllowlist.UnknownFlags:
// --unknown=unknownval arg ...
// we do not want to lose arg in this case
if len(split) >= 2 {
@@ -1044,6 +1053,8 @@ func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parse
err = ErrHelp
return
case f.ParseErrorsWhitelist.UnknownFlags:
+ fallthrough
+ case f.ParseErrorsAllowlist.UnknownFlags:
// '-f=arg arg ...'
// we do not want to lose arg in this case
if len(shorthands) > 2 && shorthands[1] == '=' {
@@ -1158,12 +1169,12 @@ func (f *FlagSet) Parse(arguments []string) error {
}
f.parsed = true
+ f.args = make([]string, 0, len(arguments))
+
if len(arguments) == 0 {
return nil
}
- f.args = make([]string, 0, len(arguments))
-
set := func(flag *Flag, value string) error {
return f.Set(flag.Name, value)
}
@@ -1174,7 +1185,10 @@ func (f *FlagSet) Parse(arguments []string) error {
case ContinueOnError:
return err
case ExitOnError:
- fmt.Println(err)
+ if errors.Is(err, ErrHelp) {
+ os.Exit(0)
+ }
+ fmt.Fprintln(f.Output(), err)
os.Exit(2)
case PanicOnError:
panic(err)
@@ -1200,6 +1214,10 @@ func (f *FlagSet) ParseAll(arguments []string, fn func(flag *Flag, value string)
case ContinueOnError:
return err
case ExitOnError:
+ if errors.Is(err, ErrHelp) {
+ os.Exit(0)
+ }
+ fmt.Fprintln(f.Output(), err)
os.Exit(2)
case PanicOnError:
panic(err)
diff --git a/vendor/github.com/spf13/pflag/golangflag.go b/vendor/github.com/spf13/pflag/golangflag.go
index f563907e28..e62eab5381 100644
--- a/vendor/github.com/spf13/pflag/golangflag.go
+++ b/vendor/github.com/spf13/pflag/golangflag.go
@@ -8,6 +8,7 @@ import (
goflag "flag"
"reflect"
"strings"
+ "time"
)
// go test flags prefixes
@@ -113,6 +114,38 @@ func (f *FlagSet) AddGoFlagSet(newSet *goflag.FlagSet) {
f.addedGoFlagSets = append(f.addedGoFlagSets, newSet)
}
+// CopyToGoFlagSet will add all current flags to the given Go flag set.
+// Deprecation remarks get copied into the usage description.
+// Whenever possible, a flag gets added for which Go flags shows
+// a proper type in the help message.
+func (f *FlagSet) CopyToGoFlagSet(newSet *goflag.FlagSet) {
+ f.VisitAll(func(flag *Flag) {
+ usage := flag.Usage
+ if flag.Deprecated != "" {
+ usage += " (DEPRECATED: " + flag.Deprecated + ")"
+ }
+
+ switch value := flag.Value.(type) {
+ case *stringValue:
+ newSet.StringVar((*string)(value), flag.Name, flag.DefValue, usage)
+ case *intValue:
+ newSet.IntVar((*int)(value), flag.Name, *(*int)(value), usage)
+ case *int64Value:
+ newSet.Int64Var((*int64)(value), flag.Name, *(*int64)(value), usage)
+ case *uintValue:
+ newSet.UintVar((*uint)(value), flag.Name, *(*uint)(value), usage)
+ case *uint64Value:
+ newSet.Uint64Var((*uint64)(value), flag.Name, *(*uint64)(value), usage)
+ case *durationValue:
+ newSet.DurationVar((*time.Duration)(value), flag.Name, *(*time.Duration)(value), usage)
+ case *float64Value:
+ newSet.Float64Var((*float64)(value), flag.Name, *(*float64)(value), usage)
+ default:
+ newSet.Var(flag.Value, flag.Name, usage)
+ }
+ })
+}
+
// ParseSkippedFlags explicitly Parses go test flags (i.e. the one starting with '-test.') with goflag.Parse(),
// since by default those are skipped by pflag.Parse().
// Typical usage example: `ParseGoTestFlags(os.Args[1:], goflag.CommandLine)`
@@ -125,3 +158,4 @@ func ParseSkippedFlags(osArgs []string, goFlagSet *goflag.FlagSet) error {
}
return goFlagSet.Parse(skippedFlags)
}
+
diff --git a/vendor/github.com/spf13/pflag/string_to_string.go b/vendor/github.com/spf13/pflag/string_to_string.go
index 890a01afc0..1d1e3bf91a 100644
--- a/vendor/github.com/spf13/pflag/string_to_string.go
+++ b/vendor/github.com/spf13/pflag/string_to_string.go
@@ -4,6 +4,7 @@ import (
"bytes"
"encoding/csv"
"fmt"
+ "sort"
"strings"
)
@@ -62,8 +63,15 @@ func (s *stringToStringValue) Type() string {
}
func (s *stringToStringValue) String() string {
+ keys := make([]string, 0, len(*s.value))
+ for k := range *s.value {
+ keys = append(keys, k)
+ }
+ sort.Strings(keys)
+
records := make([]string, 0, len(*s.value)>>1)
- for k, v := range *s.value {
+ for _, k := range keys {
+ v := (*s.value)[k]
records = append(records, k+"="+v)
}
diff --git a/vendor/github.com/spf13/pflag/time.go b/vendor/github.com/spf13/pflag/time.go
index dc024807e0..3dee424791 100644
--- a/vendor/github.com/spf13/pflag/time.go
+++ b/vendor/github.com/spf13/pflag/time.go
@@ -48,7 +48,13 @@ func (d *timeValue) Type() string {
return "time"
}
-func (d *timeValue) String() string { return d.Time.Format(time.RFC3339Nano) }
+func (d *timeValue) String() string {
+ if d.Time.IsZero() {
+ return ""
+ } else {
+ return d.Time.Format(time.RFC3339Nano)
+ }
+}
// GetTime return the time value of a flag with the given name
func (f *FlagSet) GetTime(name string) (time.Time, error) {
diff --git a/vendor/go.opentelemetry.io/otel/.codespellignore b/vendor/go.opentelemetry.io/otel/.codespellignore
index 6bf3abc41e..2b53a25e1e 100644
--- a/vendor/go.opentelemetry.io/otel/.codespellignore
+++ b/vendor/go.opentelemetry.io/otel/.codespellignore
@@ -7,3 +7,4 @@ ans
nam
valu
thirdparty
+addOpt
diff --git a/vendor/go.opentelemetry.io/otel/.golangci.yml b/vendor/go.opentelemetry.io/otel/.golangci.yml
index 5f69cc027c..b01762ffcc 100644
--- a/vendor/go.opentelemetry.io/otel/.golangci.yml
+++ b/vendor/go.opentelemetry.io/otel/.golangci.yml
@@ -10,6 +10,7 @@ linters:
- depguard
- errcheck
- errorlint
+ - gocritic
- godot
- gosec
- govet
@@ -86,6 +87,18 @@ linters:
deny:
- pkg: go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal
desc: Do not use cross-module internal packages.
+ gocritic:
+ disabled-checks:
+ - appendAssign
+ - commentedOutCode
+ - dupArg
+ - hugeParam
+ - importShadow
+ - preferDecodeRune
+ - rangeValCopy
+ - unnamedResult
+ - whyNoLint
+ enable-all: true
godot:
exclude:
# Exclude links.
@@ -167,7 +180,10 @@ linters:
- fmt.Print
- fmt.Printf
- fmt.Println
+ - name: unused-parameter
+ - name: unused-receiver
- name: unnecessary-stmt
+ - name: use-any
- name: useless-break
- name: var-declaration
- name: var-naming
@@ -224,10 +240,6 @@ linters:
- linters:
- gosec
text: 'G402: TLS MinVersion too low.'
- paths:
- - third_party$
- - builtin$
- - examples$
issues:
max-issues-per-linter: 0
max-same-issues: 0
@@ -237,14 +249,12 @@ formatters:
- goimports
- golines
settings:
+ gofumpt:
+ extra-rules: true
goimports:
local-prefixes:
- - go.opentelemetry.io
+ - go.opentelemetry.io/otel
golines:
max-len: 120
exclusions:
generated: lax
- paths:
- - third_party$
- - builtin$
- - examples$
diff --git a/vendor/go.opentelemetry.io/otel/.lycheeignore b/vendor/go.opentelemetry.io/otel/.lycheeignore
index 40d62fa2eb..5328505888 100644
--- a/vendor/go.opentelemetry.io/otel/.lycheeignore
+++ b/vendor/go.opentelemetry.io/otel/.lycheeignore
@@ -2,5 +2,8 @@ http://localhost
http://jaeger-collector
https://github.com/open-telemetry/opentelemetry-go/milestone/
https://github.com/open-telemetry/opentelemetry-go/projects
+# Weaver model URL for semantic-conventions repository.
+https?:\/\/github\.com\/open-telemetry\/semantic-conventions\/archive\/refs\/tags\/[^.]+\.zip\[[^]]+]
file:///home/runner/work/opentelemetry-go/opentelemetry-go/libraries
file:///home/runner/work/opentelemetry-go/opentelemetry-go/manual
+http://4.3.2.1:78/user/123
\ No newline at end of file
diff --git a/vendor/go.opentelemetry.io/otel/CHANGELOG.md b/vendor/go.opentelemetry.io/otel/CHANGELOG.md
index 4acc75701b..f3abcfdc2e 100644
--- a/vendor/go.opentelemetry.io/otel/CHANGELOG.md
+++ b/vendor/go.opentelemetry.io/otel/CHANGELOG.md
@@ -11,6 +11,93 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
+## [1.38.0/0.60.0/0.14.0/0.0.13] 2025-08-29
+
+This release is the last to support [Go 1.23].
+The next release will require at least [Go 1.24].
+
+### Added
+
+- Add native histogram exemplar support in `go.opentelemetry.io/otel/exporters/prometheus`. (#6772)
+- Add template attribute functions to the `go.opentelmetry.io/otel/semconv/v1.34.0` package. (#6939)
+ - `ContainerLabel`
+ - `DBOperationParameter`
+ - `DBSystemParameter`
+ - `HTTPRequestHeader`
+ - `HTTPResponseHeader`
+ - `K8SCronJobAnnotation`
+ - `K8SCronJobLabel`
+ - `K8SDaemonSetAnnotation`
+ - `K8SDaemonSetLabel`
+ - `K8SDeploymentAnnotation`
+ - `K8SDeploymentLabel`
+ - `K8SJobAnnotation`
+ - `K8SJobLabel`
+ - `K8SNamespaceAnnotation`
+ - `K8SNamespaceLabel`
+ - `K8SNodeAnnotation`
+ - `K8SNodeLabel`
+ - `K8SPodAnnotation`
+ - `K8SPodLabel`
+ - `K8SReplicaSetAnnotation`
+ - `K8SReplicaSetLabel`
+ - `K8SStatefulSetAnnotation`
+ - `K8SStatefulSetLabel`
+ - `ProcessEnvironmentVariable`
+ - `RPCConnectRPCRequestMetadata`
+ - `RPCConnectRPCResponseMetadata`
+ - `RPCGRPCRequestMetadata`
+ - `RPCGRPCResponseMetadata`
+- Add `ErrorType` attribute helper function to the `go.opentelmetry.io/otel/semconv/v1.34.0` package. (#6962)
+- Add `WithAllowKeyDuplication` in `go.opentelemetry.io/otel/sdk/log` which can be used to disable deduplication for log records. (#6968)
+- Add `WithCardinalityLimit` option to configure the cardinality limit in `go.opentelemetry.io/otel/sdk/metric`. (#6996, #7065, #7081, #7164, #7165, #7179)
+- Add `Clone` method to `Record` in `go.opentelemetry.io/otel/log` that returns a copy of the record with no shared state. (#7001)
+- Add experimental self-observability span and batch span processor metrics in `go.opentelemetry.io/otel/sdk/trace`.
+ Check the `go.opentelemetry.io/otel/sdk/trace/internal/x` package documentation for more information. (#7027, #6393, #7209)
+- The `go.opentelemetry.io/otel/semconv/v1.36.0` package.
+ The package contains semantic conventions from the `v1.36.0` version of the OpenTelemetry Semantic Conventions.
+ See the [migration documentation](./semconv/v1.36.0/MIGRATION.md) for information on how to upgrade from `go.opentelemetry.io/otel/semconv/v1.34.0.`(#7032, #7041)
+- Add support for configuring Prometheus name translation using `WithTranslationStrategy` option in `go.opentelemetry.io/otel/exporters/prometheus`. The current default translation strategy when UTF-8 mode is enabled is `NoUTF8EscapingWithSuffixes`, but a future release will change the default strategy to `UnderscoreEscapingWithSuffixes` for compliance with the specification. (#7111)
+- Add experimental self-observability log metrics in `go.opentelemetry.io/otel/sdk/log`.
+ Check the `go.opentelemetry.io/otel/sdk/log/internal/x` package documentation for more information. (#7121)
+- Add experimental self-observability trace exporter metrics in `go.opentelemetry.io/otel/exporters/stdout/stdouttrace`.
+ Check the `go.opentelemetry.io/otel/exporters/stdout/stdouttrace/internal/x` package documentation for more information. (#7133)
+- Support testing of [Go 1.25]. (#7187)
+- The `go.opentelemetry.io/otel/semconv/v1.37.0` package.
+ The package contains semantic conventions from the `v1.37.0` version of the OpenTelemetry Semantic Conventions.
+ See the [migration documentation](./semconv/v1.37.0/MIGRATION.md) for information on how to upgrade from `go.opentelemetry.io/otel/semconv/v1.36.0.`(#7254)
+
+### Changed
+
+- Optimize `TraceIDFromHex` and `SpanIDFromHex` in `go.opentelemetry.io/otel/sdk/trace`. (#6791)
+- Change `AssertEqual` in `go.opentelemetry.io/otel/log/logtest` to accept `TestingT` in order to support benchmarks and fuzz tests. (#6908)
+- Change `DefaultExemplarReservoirProviderSelector` in `go.opentelemetry.io/otel/sdk/metric` to use `runtime.GOMAXPROCS(0)` instead of `runtime.NumCPU()` for the `FixedSizeReservoirProvider` default size. (#7094)
+
+### Fixed
+
+- `SetBody` method of `Record` in `go.opentelemetry.io/otel/sdk/log` now deduplicates key-value collections (`log.Value` of `log.KindMap` from `go.opentelemetry.io/otel/log`). (#7002)
+- Fix `go.opentelemetry.io/otel/exporters/prometheus` to not append a suffix if it's already present in metric name. (#7088)
+- Fix the `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` self-observability component type and name. (#7195)
+- Fix partial export count metric in `go.opentelemetry.io/otel/exporters/stdout/stdouttrace`. (#7199)
+
+### Deprecated
+
+- Deprecate `WithoutUnits` and `WithoutCounterSuffixes` options, preferring `WithTranslationStrategy` instead. (#7111)
+- Deprecate support for `OTEL_GO_X_CARDINALITY_LIMIT` environment variable in `go.opentelemetry.io/otel/sdk/metric`. Use `WithCardinalityLimit` option instead. (#7166)
+
+## [0.59.1] 2025-07-21
+
+### Changed
+
+- Retract `v0.59.0` release of `go.opentelemetry.io/otel/exporters/prometheus` module which appends incorrect unit suffixes. (#7046)
+- Change `go.opentelemetry.io/otel/exporters/prometheus` to no longer deduplicate suffixes when UTF8 is enabled.
+ It is recommended to disable unit and counter suffixes in the exporter, and manually add suffixes if you rely on the existing behavior. (#7044)
+
+### Fixed
+
+- Fix `go.opentelemetry.io/otel/exporters/prometheus` to properly handle unit suffixes when the unit is in brackets.
+ E.g. `{spans}`. (#7044)
+
## [1.37.0/0.59.0/0.13.0] 2025-06-25
### Added
@@ -3343,7 +3430,8 @@ It contains api and sdk for trace and meter.
- CircleCI build CI manifest files.
- CODEOWNERS file to track owners of this project.
-[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.37.0...HEAD
+[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.38.0...HEAD
+[1.38.0/0.60.0/0.14.0/0.0.13]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.38.0
[1.37.0/0.59.0/0.13.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.37.0
[0.12.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/log/v0.12.2
[0.12.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/log/v0.12.1
@@ -3439,6 +3527,7 @@ It contains api and sdk for trace and meter.
+[Go 1.25]: https://go.dev/doc/go1.25
[Go 1.24]: https://go.dev/doc/go1.24
[Go 1.23]: https://go.dev/doc/go1.23
[Go 1.22]: https://go.dev/doc/go1.22
diff --git a/vendor/go.opentelemetry.io/otel/CODEOWNERS b/vendor/go.opentelemetry.io/otel/CODEOWNERS
index 945a07d2b0..26a03aed1d 100644
--- a/vendor/go.opentelemetry.io/otel/CODEOWNERS
+++ b/vendor/go.opentelemetry.io/otel/CODEOWNERS
@@ -12,6 +12,6 @@
# https://help.github.com/en/articles/about-code-owners
#
-* @MrAlias @XSAM @dashpole @pellared @dmathieu
+* @MrAlias @XSAM @dashpole @pellared @dmathieu @flc1125
CODEOWNERS @MrAlias @pellared @dashpole @XSAM @dmathieu
diff --git a/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md
index f9ddc281fc..0b3ae855c1 100644
--- a/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md
+++ b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md
@@ -192,6 +192,35 @@ should have `go test -bench` output in their description.
should have [`benchstat`](https://pkg.go.dev/golang.org/x/perf/cmd/benchstat)
output in their description.
+## Dependencies
+
+This project uses [Go Modules] for dependency management. All modules will use
+`go.mod` to explicitly list all direct and indirect dependencies, ensuring a
+clear dependency graph. The `go.sum` file for each module will be committed to
+the repository and used to verify the integrity of downloaded modules,
+preventing malicious tampering.
+
+This project uses automated dependency update tools (i.e. dependabot,
+renovatebot) to manage updates to dependencies. This ensures that dependencies
+are kept up-to-date with the latest security patches and features and are
+reviewed before being merged. If you would like to propose a change to a
+dependency it should be done through a pull request that updates the `go.mod`
+file and includes a description of the change.
+
+See the [versioning and compatibility](./VERSIONING.md) policy for more details
+about dependency compatibility.
+
+[Go Modules]: https://pkg.go.dev/cmd/go#hdr-Modules__module_versions__and_more
+
+### Environment Dependencies
+
+This project does not partition dependencies based on the environment (i.e.
+`development`, `staging`, `production`).
+
+Only the dependencies explicitly included in the released modules have be
+tested and verified to work with the released code. No other guarantee is made
+about the compatibility of other dependencies.
+
## Documentation
Each (non-internal, non-test) package must be documented using
@@ -233,6 +262,10 @@ For a non-comprehensive but foundational overview of these best practices
the [Effective Go](https://golang.org/doc/effective_go.html) documentation
is an excellent starting place.
+We also recommend following the
+[Go Code Review Comments](https://go.dev/wiki/CodeReviewComments)
+that collects common comments made during reviews of Go code.
+
As a convenience for developers building this project the `make precommit`
will format, lint, validate, and in some cases fix the changes you plan to
submit. This check will need to pass for your changes to be able to be
@@ -586,6 +619,10 @@ See also:
### Testing
+We allow using [`testify`](https://github.com/stretchr/testify) even though
+it is seen as non-idiomatic according to
+the [Go Test Comments](https://go.dev/wiki/TestComments#assert-libraries) page.
+
The tests should never leak goroutines.
Use the term `ConcurrentSafe` in the test name when it aims to verify the
@@ -640,13 +677,6 @@ should be canceled.
## Approvers and Maintainers
-### Triagers
-
-- [Alex Kats](https://github.com/akats7), Capital One
-- [Cheng-Zhen Yang](https://github.com/scorpionknifes), Independent
-
-### Approvers
-
### Maintainers
- [Damien Mathieu](https://github.com/dmathieu), Elastic ([GPG](https://keys.openpgp.org/search?q=5A126B972A81A6CE443E5E1B408B8E44F0873832))
@@ -655,6 +685,21 @@ should be canceled.
- [Sam Xie](https://github.com/XSAM), Splunk ([GPG](https://keys.openpgp.org/search?q=AEA033782371ABB18EE39188B8044925D6FEEBEA))
- [Tyler Yahn](https://github.com/MrAlias), Splunk ([GPG](https://keys.openpgp.org/search?q=0x46B0F3E1A8B1BA5A))
+For more information about the maintainer role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#maintainer).
+
+### Approvers
+
+- [Flc](https://github.com/flc1125), Independent
+
+For more information about the approver role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#approver).
+
+### Triagers
+
+- [Alex Kats](https://github.com/akats7), Capital One
+- [Cheng-Zhen Yang](https://github.com/scorpionknifes), Independent
+
+For more information about the triager role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#triager).
+
### Emeritus
- [Aaron Clawson](https://github.com/MadVikingGod)
@@ -665,6 +710,8 @@ should be canceled.
- [Josh MacDonald](https://github.com/jmacd)
- [Liz Fong-Jones](https://github.com/lizthegrey)
+For more information about the emeritus role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#emeritus-maintainerapprovertriager).
+
### Become an Approver or a Maintainer
See the [community membership document in OpenTelemetry community
diff --git a/vendor/go.opentelemetry.io/otel/LICENSE b/vendor/go.opentelemetry.io/otel/LICENSE
index 261eeb9e9f..f1aee0f110 100644
--- a/vendor/go.opentelemetry.io/otel/LICENSE
+++ b/vendor/go.opentelemetry.io/otel/LICENSE
@@ -199,3 +199,33 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+
+--------------------------------------------------------------------------------
+
+Copyright 2009 The Go Authors.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google LLC nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/vendor/go.opentelemetry.io/otel/Makefile b/vendor/go.opentelemetry.io/otel/Makefile
index 4fa423ca02..bc0f1f92d1 100644
--- a/vendor/go.opentelemetry.io/otel/Makefile
+++ b/vendor/go.opentelemetry.io/otel/Makefile
@@ -34,9 +34,6 @@ $(TOOLS)/%: $(TOOLS_MOD_DIR)/go.mod | $(TOOLS)
MULTIMOD = $(TOOLS)/multimod
$(TOOLS)/multimod: PACKAGE=go.opentelemetry.io/build-tools/multimod
-SEMCONVGEN = $(TOOLS)/semconvgen
-$(TOOLS)/semconvgen: PACKAGE=go.opentelemetry.io/build-tools/semconvgen
-
CROSSLINK = $(TOOLS)/crosslink
$(TOOLS)/crosslink: PACKAGE=go.opentelemetry.io/build-tools/crosslink
@@ -71,7 +68,7 @@ GOVULNCHECK = $(TOOLS)/govulncheck
$(TOOLS)/govulncheck: PACKAGE=golang.org/x/vuln/cmd/govulncheck
.PHONY: tools
-tools: $(CROSSLINK) $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(PORTO) $(SEMCONVGEN) $(VERIFYREADMES) $(MULTIMOD) $(SEMCONVKIT) $(GOTMPL) $(GORELEASE)
+tools: $(CROSSLINK) $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(PORTO) $(VERIFYREADMES) $(MULTIMOD) $(SEMCONVKIT) $(GOTMPL) $(GORELEASE)
# Virtualized python tools via docker
@@ -284,7 +281,7 @@ semconv-generate: $(SEMCONVKIT)
docker run --rm \
-u $(DOCKER_USER) \
--env HOME=/tmp/weaver \
- --mount 'type=bind,source=$(PWD)/semconv,target=/home/weaver/templates/registry/go,readonly' \
+ --mount 'type=bind,source=$(PWD)/semconv/templates,target=/home/weaver/templates,readonly' \
--mount 'type=bind,source=$(PWD)/semconv/${TAG},target=/home/weaver/target' \
--mount 'type=bind,source=$(HOME)/.weaver,target=/tmp/weaver/.weaver' \
$(WEAVER_IMAGE) registry generate \
diff --git a/vendor/go.opentelemetry.io/otel/README.md b/vendor/go.opentelemetry.io/otel/README.md
index 5fa1b75c60..6b7ab5f219 100644
--- a/vendor/go.opentelemetry.io/otel/README.md
+++ b/vendor/go.opentelemetry.io/otel/README.md
@@ -53,18 +53,25 @@ Currently, this project supports the following environments.
| OS | Go Version | Architecture |
|----------|------------|--------------|
+| Ubuntu | 1.25 | amd64 |
| Ubuntu | 1.24 | amd64 |
| Ubuntu | 1.23 | amd64 |
+| Ubuntu | 1.25 | 386 |
| Ubuntu | 1.24 | 386 |
| Ubuntu | 1.23 | 386 |
+| Ubuntu | 1.25 | arm64 |
| Ubuntu | 1.24 | arm64 |
| Ubuntu | 1.23 | arm64 |
+| macOS 13 | 1.25 | amd64 |
| macOS 13 | 1.24 | amd64 |
| macOS 13 | 1.23 | amd64 |
+| macOS | 1.25 | arm64 |
| macOS | 1.24 | arm64 |
| macOS | 1.23 | arm64 |
+| Windows | 1.25 | amd64 |
| Windows | 1.24 | amd64 |
| Windows | 1.23 | amd64 |
+| Windows | 1.25 | 386 |
| Windows | 1.24 | 386 |
| Windows | 1.23 | 386 |
diff --git a/vendor/go.opentelemetry.io/otel/SECURITY-INSIGHTS.yml b/vendor/go.opentelemetry.io/otel/SECURITY-INSIGHTS.yml
new file mode 100644
index 0000000000..8041fc62e4
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/SECURITY-INSIGHTS.yml
@@ -0,0 +1,203 @@
+header:
+ schema-version: "1.0.0"
+ expiration-date: "2026-08-04T00:00:00.000Z"
+ last-updated: "2025-08-04"
+ last-reviewed: "2025-08-04"
+ commit-hash: 69e81088ad40f45a0764597326722dea8f3f00a8
+ project-url: https://github.com/open-telemetry/opentelemetry-go
+ project-release: "v1.37.0"
+ changelog: https://github.com/open-telemetry/opentelemetry-go/blob/69e81088ad40f45a0764597326722dea8f3f00a8/CHANGELOG.md
+ license: https://github.com/open-telemetry/opentelemetry-go/blob/69e81088ad40f45a0764597326722dea8f3f00a8/LICENSE
+
+project-lifecycle:
+ status: active
+ bug-fixes-only: false
+ core-maintainers:
+ - https://github.com/dmathieu
+ - https://github.com/dashpole
+ - https://github.com/pellared
+ - https://github.com/XSAM
+ - https://github.com/MrAlias
+ release-process: |
+ See https://github.com/open-telemetry/opentelemetry-go/blob/69e81088ad40f45a0764597326722dea8f3f00a8/RELEASING.md
+
+contribution-policy:
+ accepts-pull-requests: true
+ accepts-automated-pull-requests: true
+ automated-tools-list:
+ - automated-tool: dependabot
+ action: allowed
+ comment: Automated dependency updates are accepted.
+ - automated-tool: renovatebot
+ action: allowed
+ comment: Automated dependency updates are accepted.
+ - automated-tool: opentelemetrybot
+ action: allowed
+ comment: Automated OpenTelemetry actions are accepted.
+ contributing-policy: https://github.com/open-telemetry/opentelemetry-go/blob/69e81088ad40f45a0764597326722dea8f3f00a8/CONTRIBUTING.md
+ code-of-conduct: https://github.com/open-telemetry/.github/blob/ffa15f76b65ec7bcc41f6a0b277edbb74f832206/CODE_OF_CONDUCT.md
+
+documentation:
+ - https://pkg.go.dev/go.opentelemetry.io/otel
+ - https://opentelemetry.io/docs/instrumentation/go/
+
+distribution-points:
+ - pkg:golang/go.opentelemetry.io/otel
+ - pkg:golang/go.opentelemetry.io/otel/bridge/opencensus
+ - pkg:golang/go.opentelemetry.io/otel/bridge/opencensus/test
+ - pkg:golang/go.opentelemetry.io/otel/bridge/opentracing
+ - pkg:golang/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc
+ - pkg:golang/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp
+ - pkg:golang/go.opentelemetry.io/otel/exporters/otlp/otlptrace
+ - pkg:golang/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc
+ - pkg:golang/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp
+ - pkg:golang/go.opentelemetry.io/otel/exporters/stdout/stdoutmetric
+ - pkg:golang/go.opentelemetry.io/otel/exporters/stdout/stdouttrace
+ - pkg:golang/go.opentelemetry.io/otel/exporters/zipkin
+ - pkg:golang/go.opentelemetry.io/otel/metric
+ - pkg:golang/go.opentelemetry.io/otel/sdk
+ - pkg:golang/go.opentelemetry.io/otel/sdk/metric
+ - pkg:golang/go.opentelemetry.io/otel/trace
+ - pkg:golang/go.opentelemetry.io/otel/exporters/prometheus
+ - pkg:golang/go.opentelemetry.io/otel/log
+ - pkg:golang/go.opentelemetry.io/otel/log/logtest
+ - pkg:golang/go.opentelemetry.io/otel/sdk/log
+ - pkg:golang/go.opentelemetry.io/otel/sdk/log/logtest
+ - pkg:golang/go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc
+ - pkg:golang/go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp
+ - pkg:golang/go.opentelemetry.io/otel/exporters/stdout/stdoutlog
+ - pkg:golang/go.opentelemetry.io/otel/schema
+
+security-artifacts:
+ threat-model:
+ threat-model-created: false
+ comment: |
+ No formal threat model created yet.
+ self-assessment:
+ self-assessment-created: false
+ comment: |
+ No formal self-assessment yet.
+
+security-testing:
+ - tool-type: sca
+ tool-name: Dependabot
+ tool-version: latest
+ tool-url: https://github.com/dependabot
+ tool-rulesets:
+ - built-in
+ integration:
+ ad-hoc: false
+ ci: true
+ before-release: true
+ comment: |
+ Automated dependency updates.
+ - tool-type: sast
+ tool-name: golangci-lint
+ tool-version: latest
+ tool-url: https://github.com/golangci/golangci-lint
+ tool-rulesets:
+ - built-in
+ integration:
+ ad-hoc: false
+ ci: true
+ before-release: true
+ comment: |
+ Static analysis in CI.
+ - tool-type: fuzzing
+ tool-name: OSS-Fuzz
+ tool-version: latest
+ tool-url: https://github.com/google/oss-fuzz
+ tool-rulesets:
+ - default
+ integration:
+ ad-hoc: false
+ ci: false
+ before-release: false
+ comment: |
+ OpenTelemetry Go is integrated with OSS-Fuzz for continuous fuzz testing. See https://github.com/google/oss-fuzz/tree/f0f9b221190c6063a773bea606d192ebfc3d00cf/projects/opentelemetry-go for more details.
+ - tool-type: sast
+ tool-name: CodeQL
+ tool-version: latest
+ tool-url: https://github.com/github/codeql
+ tool-rulesets:
+ - default
+ integration:
+ ad-hoc: false
+ ci: true
+ before-release: true
+ comment: |
+ CodeQL static analysis is run in CI for all commits and pull requests to detect security vulnerabilities in the Go source code. See https://github.com/open-telemetry/opentelemetry-go/blob/d5b5b059849720144a03ca5c87561bfbdb940119/.github/workflows/codeql-analysis.yml for workflow details.
+ - tool-type: sca
+ tool-name: govulncheck
+ tool-version: latest
+ tool-url: https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck
+ tool-rulesets:
+ - default
+ integration:
+ ad-hoc: false
+ ci: true
+ before-release: true
+ comment: |
+ govulncheck is run in CI to detect known vulnerabilities in Go modules and code paths. See https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/.github/workflows/ci.yml for workflow configuration.
+
+security-assessments:
+ - auditor-name: 7ASecurity
+ auditor-url: https://7asecurity.com
+ auditor-report: https://7asecurity.com/reports/pentest-report-opentelemetry.pdf
+ report-year: 2023
+ comment: |
+ This independent penetration test by 7ASecurity covered OpenTelemetry repositories including opentelemetry-go. The assessment focused on codebase review, threat modeling, and vulnerability identification. See the report for details of findings and recommendations applicable to opentelemetry-go. No critical vulnerabilities were found for this repository.
+
+security-contacts:
+ - type: email
+ value: cncf-opentelemetry-security@lists.cncf.io
+ primary: true
+ - type: website
+ value: https://github.com/open-telemetry/opentelemetry-go/security/policy
+ primary: false
+
+vulnerability-reporting:
+ accepts-vulnerability-reports: true
+ email-contact: cncf-opentelemetry-security@lists.cncf.io
+ security-policy: https://github.com/open-telemetry/opentelemetry-go/security/policy
+ comment: |
+ Security issues should be reported via email or GitHub security policy page.
+
+dependencies:
+ third-party-packages: true
+ dependencies-lists:
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/bridge/opencensus/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/bridge/opencensus/test/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/bridge/opentracing/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/otlp/otlplog/otlploggrpc/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/otlp/otlplog/otlploghttp/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/otlp/otlpmetric/otlpmetricgrpc/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/otlp/otlpmetric/otlpmetrichttp/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/otlp/otlptrace/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/otlp/otlptrace/otlptracegrpc/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/otlp/otlptrace/otlptracehttp/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/prometheus/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/stdout/stdoutlog/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/stdout/stdoutmetric/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/stdout/stdouttrace/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/zipkin/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/internal/tools/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/log/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/log/logtest/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/metric/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/schema/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/sdk/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/sdk/log/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/sdk/log/logtest/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/sdk/metric/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/trace/go.mod
+ - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/trace/internal/telemetry/test/go.mod
+ dependencies-lifecycle:
+ policy-url: https://github.com/open-telemetry/opentelemetry-go/blob/69e81088ad40f45a0764597326722dea8f3f00a8/CONTRIBUTING.md
+ comment: |
+ Dependency lifecycle managed via go.mod and renovatebot.
+ env-dependencies-policy:
+ policy-url: https://github.com/open-telemetry/opentelemetry-go/blob/69e81088ad40f45a0764597326722dea8f3f00a8/CONTRIBUTING.md
+ comment: |
+ See contributing policy for environment usage.
diff --git a/vendor/go.opentelemetry.io/otel/attribute/encoder.go b/vendor/go.opentelemetry.io/otel/attribute/encoder.go
index 318e42fcab..6333d34b31 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/encoder.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/encoder.go
@@ -78,7 +78,7 @@ func DefaultEncoder() Encoder {
defaultEncoderOnce.Do(func() {
defaultEncoderInstance = &defaultAttrEncoder{
pool: sync.Pool{
- New: func() interface{} {
+ New: func() any {
return &bytes.Buffer{}
},
},
@@ -96,11 +96,11 @@ func (d *defaultAttrEncoder) Encode(iter Iterator) string {
for iter.Next() {
i, keyValue := iter.IndexedAttribute()
if i > 0 {
- _, _ = buf.WriteRune(',')
+ _ = buf.WriteByte(',')
}
copyAndEscape(buf, string(keyValue.Key))
- _, _ = buf.WriteRune('=')
+ _ = buf.WriteByte('=')
if keyValue.Value.Type() == STRING {
copyAndEscape(buf, keyValue.Value.AsString())
@@ -122,14 +122,14 @@ func copyAndEscape(buf *bytes.Buffer, val string) {
for _, ch := range val {
switch ch {
case '=', ',', escapeChar:
- _, _ = buf.WriteRune(escapeChar)
+ _ = buf.WriteByte(escapeChar)
}
_, _ = buf.WriteRune(ch)
}
}
-// Valid returns true if this encoder ID was allocated by
-// `NewEncoderID`. Invalid encoder IDs will not be cached.
+// Valid reports whether this encoder ID was allocated by
+// [NewEncoderID]. Invalid encoder IDs will not be cached.
func (id EncoderID) Valid() bool {
return id.value != 0
}
diff --git a/vendor/go.opentelemetry.io/otel/attribute/filter.go b/vendor/go.opentelemetry.io/otel/attribute/filter.go
index 3eeaa5d442..624ebbe381 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/filter.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/filter.go
@@ -15,8 +15,8 @@ type Filter func(KeyValue) bool
//
// If keys is empty a deny-all filter is returned.
func NewAllowKeysFilter(keys ...Key) Filter {
- if len(keys) <= 0 {
- return func(kv KeyValue) bool { return false }
+ if len(keys) == 0 {
+ return func(KeyValue) bool { return false }
}
allowed := make(map[Key]struct{}, len(keys))
@@ -34,8 +34,8 @@ func NewAllowKeysFilter(keys ...Key) Filter {
//
// If keys is empty an allow-all filter is returned.
func NewDenyKeysFilter(keys ...Key) Filter {
- if len(keys) <= 0 {
- return func(kv KeyValue) bool { return true }
+ if len(keys) == 0 {
+ return func(KeyValue) bool { return true }
}
forbid := make(map[Key]struct{}, len(keys))
diff --git a/vendor/go.opentelemetry.io/otel/attribute/internal/attribute.go b/vendor/go.opentelemetry.io/otel/attribute/internal/attribute.go
index b76d2bbfdb..0875504302 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/internal/attribute.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/internal/attribute.go
@@ -12,7 +12,7 @@ import (
)
// BoolSliceValue converts a bool slice into an array with same elements as slice.
-func BoolSliceValue(v []bool) interface{} {
+func BoolSliceValue(v []bool) any {
var zero bool
cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))).Elem()
reflect.Copy(cp, reflect.ValueOf(v))
@@ -20,7 +20,7 @@ func BoolSliceValue(v []bool) interface{} {
}
// Int64SliceValue converts an int64 slice into an array with same elements as slice.
-func Int64SliceValue(v []int64) interface{} {
+func Int64SliceValue(v []int64) any {
var zero int64
cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))).Elem()
reflect.Copy(cp, reflect.ValueOf(v))
@@ -28,7 +28,7 @@ func Int64SliceValue(v []int64) interface{} {
}
// Float64SliceValue converts a float64 slice into an array with same elements as slice.
-func Float64SliceValue(v []float64) interface{} {
+func Float64SliceValue(v []float64) any {
var zero float64
cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))).Elem()
reflect.Copy(cp, reflect.ValueOf(v))
@@ -36,7 +36,7 @@ func Float64SliceValue(v []float64) interface{} {
}
// StringSliceValue converts a string slice into an array with same elements as slice.
-func StringSliceValue(v []string) interface{} {
+func StringSliceValue(v []string) any {
var zero string
cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))).Elem()
reflect.Copy(cp, reflect.ValueOf(v))
@@ -44,7 +44,7 @@ func StringSliceValue(v []string) interface{} {
}
// AsBoolSlice converts a bool array into a slice into with same elements as array.
-func AsBoolSlice(v interface{}) []bool {
+func AsBoolSlice(v any) []bool {
rv := reflect.ValueOf(v)
if rv.Type().Kind() != reflect.Array {
return nil
@@ -57,7 +57,7 @@ func AsBoolSlice(v interface{}) []bool {
}
// AsInt64Slice converts an int64 array into a slice into with same elements as array.
-func AsInt64Slice(v interface{}) []int64 {
+func AsInt64Slice(v any) []int64 {
rv := reflect.ValueOf(v)
if rv.Type().Kind() != reflect.Array {
return nil
@@ -70,7 +70,7 @@ func AsInt64Slice(v interface{}) []int64 {
}
// AsFloat64Slice converts a float64 array into a slice into with same elements as array.
-func AsFloat64Slice(v interface{}) []float64 {
+func AsFloat64Slice(v any) []float64 {
rv := reflect.ValueOf(v)
if rv.Type().Kind() != reflect.Array {
return nil
@@ -83,7 +83,7 @@ func AsFloat64Slice(v interface{}) []float64 {
}
// AsStringSlice converts a string array into a slice into with same elements as array.
-func AsStringSlice(v interface{}) []string {
+func AsStringSlice(v any) []string {
rv := reflect.ValueOf(v)
if rv.Type().Kind() != reflect.Array {
return nil
diff --git a/vendor/go.opentelemetry.io/otel/attribute/iterator.go b/vendor/go.opentelemetry.io/otel/attribute/iterator.go
index f2ba89ce4b..8df6249f02 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/iterator.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/iterator.go
@@ -25,8 +25,8 @@ type oneIterator struct {
attr KeyValue
}
-// Next moves the iterator to the next position. Returns false if there are no
-// more attributes.
+// Next moves the iterator to the next position.
+// Next reports whether there are more attributes.
func (i *Iterator) Next() bool {
i.idx++
return i.idx < i.Len()
@@ -106,7 +106,8 @@ func (oi *oneIterator) advance() {
}
}
-// Next returns true if there is another attribute available.
+// Next moves the iterator to the next position.
+// Next reports whether there is another attribute available.
func (m *MergeIterator) Next() bool {
if m.one.done && m.two.done {
return false
diff --git a/vendor/go.opentelemetry.io/otel/attribute/key.go b/vendor/go.opentelemetry.io/otel/attribute/key.go
index d9a22c6502..80a9e5643f 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/key.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/key.go
@@ -117,7 +117,7 @@ func (k Key) StringSlice(v []string) KeyValue {
}
}
-// Defined returns true for non-empty keys.
+// Defined reports whether the key is not empty.
func (k Key) Defined() bool {
return len(k) != 0
}
diff --git a/vendor/go.opentelemetry.io/otel/attribute/kv.go b/vendor/go.opentelemetry.io/otel/attribute/kv.go
index 3028f9a40f..8c6928ca79 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/kv.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/kv.go
@@ -13,7 +13,7 @@ type KeyValue struct {
Value Value
}
-// Valid returns if kv is a valid OpenTelemetry attribute.
+// Valid reports whether kv is a valid OpenTelemetry attribute.
func (kv KeyValue) Valid() bool {
return kv.Key.Defined() && kv.Value.Type() != INVALID
}
diff --git a/vendor/go.opentelemetry.io/otel/attribute/set.go b/vendor/go.opentelemetry.io/otel/attribute/set.go
index 6cbefceadf..64735d382e 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/set.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/set.go
@@ -31,11 +31,11 @@ type (
// Distinct is a unique identifier of a Set.
//
- // Distinct is designed to be ensures equivalence stability: comparisons
- // will return the save value across versions. For this reason, Distinct
- // should always be used as a map key instead of a Set.
+ // Distinct is designed to ensure equivalence stability: comparisons will
+ // return the same value across versions. For this reason, Distinct should
+ // always be used as a map key instead of a Set.
Distinct struct {
- iface interface{}
+ iface any
}
// Sortable implements sort.Interface, used for sorting KeyValue.
@@ -70,7 +70,7 @@ func (d Distinct) reflectValue() reflect.Value {
return reflect.ValueOf(d.iface)
}
-// Valid returns true if this value refers to a valid Set.
+// Valid reports whether this value refers to a valid Set.
func (d Distinct) Valid() bool {
return d.iface != nil
}
@@ -120,7 +120,7 @@ func (l *Set) Value(k Key) (Value, bool) {
return Value{}, false
}
-// HasValue tests whether a key is defined in this set.
+// HasValue reports whether a key is defined in this set.
func (l *Set) HasValue(k Key) bool {
if l == nil {
return false
@@ -155,7 +155,7 @@ func (l *Set) Equivalent() Distinct {
return l.equivalent
}
-// Equals returns true if the argument set is equivalent to this set.
+// Equals reports whether the argument set is equivalent to this set.
func (l *Set) Equals(o *Set) bool {
return l.Equivalent() == o.Equivalent()
}
@@ -344,7 +344,7 @@ func computeDistinct(kvs []KeyValue) Distinct {
// computeDistinctFixed computes a Distinct for small slices. It returns nil
// if the input is too large for this code path.
-func computeDistinctFixed(kvs []KeyValue) interface{} {
+func computeDistinctFixed(kvs []KeyValue) any {
switch len(kvs) {
case 1:
return [1]KeyValue(kvs)
@@ -373,7 +373,7 @@ func computeDistinctFixed(kvs []KeyValue) interface{} {
// computeDistinctReflect computes a Distinct using reflection, works for any
// size input.
-func computeDistinctReflect(kvs []KeyValue) interface{} {
+func computeDistinctReflect(kvs []KeyValue) any {
at := reflect.New(reflect.ArrayOf(len(kvs), keyValueType)).Elem()
for i, keyValue := range kvs {
*(at.Index(i).Addr().Interface().(*KeyValue)) = keyValue
@@ -387,7 +387,7 @@ func (l *Set) MarshalJSON() ([]byte, error) {
}
// MarshalLog is the marshaling function used by the logging system to represent this Set.
-func (l Set) MarshalLog() interface{} {
+func (l Set) MarshalLog() any {
kvs := make(map[string]string)
for _, kv := range l.ToSlice() {
kvs[string(kv.Key)] = kv.Value.Emit()
diff --git a/vendor/go.opentelemetry.io/otel/attribute/value.go b/vendor/go.opentelemetry.io/otel/attribute/value.go
index 817eecacf1..653c33a861 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/value.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/value.go
@@ -22,7 +22,7 @@ type Value struct {
vtype Type
numeric uint64
stringly string
- slice interface{}
+ slice any
}
const (
@@ -199,8 +199,8 @@ func (v Value) asStringSlice() []string {
type unknownValueType struct{}
-// AsInterface returns Value's data as interface{}.
-func (v Value) AsInterface() interface{} {
+// AsInterface returns Value's data as any.
+func (v Value) AsInterface() any {
switch v.Type() {
case BOOL:
return v.AsBool()
@@ -262,7 +262,7 @@ func (v Value) Emit() string {
func (v Value) MarshalJSON() ([]byte, error) {
var jsonVal struct {
Type string
- Value interface{}
+ Value any
}
jsonVal.Type = v.Type().String()
jsonVal.Value = v.AsInterface()
diff --git a/vendor/go.opentelemetry.io/otel/baggage/baggage.go b/vendor/go.opentelemetry.io/otel/baggage/baggage.go
index 0e1fe24220..f83a448ec6 100644
--- a/vendor/go.opentelemetry.io/otel/baggage/baggage.go
+++ b/vendor/go.opentelemetry.io/otel/baggage/baggage.go
@@ -812,7 +812,7 @@ var safeKeyCharset = [utf8.RuneSelf]bool{
// validateBaggageName checks if the string is a valid OpenTelemetry Baggage name.
// Baggage name is a valid, non-empty UTF-8 string.
func validateBaggageName(s string) bool {
- if len(s) == 0 {
+ if s == "" {
return false
}
@@ -828,7 +828,7 @@ func validateBaggageValue(s string) bool {
// validateKey checks if the string is a valid W3C Baggage key.
func validateKey(s string) bool {
- if len(s) == 0 {
+ if s == "" {
return false
}
diff --git a/vendor/go.opentelemetry.io/otel/codes/codes.go b/vendor/go.opentelemetry.io/otel/codes/codes.go
index 49a35b1225..d48847ed86 100644
--- a/vendor/go.opentelemetry.io/otel/codes/codes.go
+++ b/vendor/go.opentelemetry.io/otel/codes/codes.go
@@ -67,7 +67,7 @@ func (c *Code) UnmarshalJSON(b []byte) error {
return errors.New("nil receiver passed to UnmarshalJSON")
}
- var x interface{}
+ var x any
if err := json.Unmarshal(b, &x); err != nil {
return err
}
@@ -102,5 +102,5 @@ func (c *Code) MarshalJSON() ([]byte, error) {
if !ok {
return nil, fmt.Errorf("invalid code: %d", *c)
}
- return []byte(fmt.Sprintf("%q", str)), nil
+ return fmt.Appendf(nil, "%q", str), nil
}
diff --git a/vendor/go.opentelemetry.io/otel/dependencies.Dockerfile b/vendor/go.opentelemetry.io/otel/dependencies.Dockerfile
index 935bd48763..a311fbb483 100644
--- a/vendor/go.opentelemetry.io/otel/dependencies.Dockerfile
+++ b/vendor/go.opentelemetry.io/otel/dependencies.Dockerfile
@@ -1,4 +1,4 @@
# This is a renovate-friendly source of Docker images.
-FROM python:3.13.5-slim-bullseye@sha256:5b9fc0d8ef79cfb5f300e61cb516e0c668067bbf77646762c38c94107e230dbc AS python
-FROM otel/weaver:v0.15.2@sha256:b13acea09f721774daba36344861f689ac4bb8d6ecd94c4600b4d590c8fb34b9 AS weaver
+FROM python:3.13.6-slim-bullseye@sha256:e98b521460ee75bca92175c16247bdf7275637a8faaeb2bcfa19d879ae5c4b9a AS python
+FROM otel/weaver:v0.17.1@sha256:32523b5e44fb44418786347e9f7dde187d8797adb6d57a2ee99c245346c3cdfe AS weaver
FROM avtodev/markdown-lint:v1@sha256:6aeedc2f49138ce7a1cd0adffc1b1c0321b841dc2102408967d9301c031949ee AS markdown
diff --git a/vendor/go.opentelemetry.io/otel/exporters/prometheus/config.go b/vendor/go.opentelemetry.io/otel/exporters/prometheus/config.go
index 4757b793d3..dc3542637b 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/prometheus/config.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/prometheus/config.go
@@ -7,6 +7,8 @@ import (
"sync"
"github.com/prometheus/client_golang/prometheus"
+ "github.com/prometheus/common/model"
+ "github.com/prometheus/otlptranslator"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/internal/global"
@@ -17,6 +19,7 @@ import (
type config struct {
registerer prometheus.Registerer
disableTargetInfo bool
+ translationStrategy otlptranslator.TranslationStrategyOption
withoutUnits bool
withoutCounterSuffixes bool
readerOpts []metric.ManualReaderOption
@@ -25,9 +28,9 @@ type config struct {
resourceAttributesFilter attribute.Filter
}
-var logDeprecatedLegacyScheme = sync.OnceFunc(func() {
+var logTemporaryDefault = sync.OnceFunc(func() {
global.Warn(
- "prometheus exporter legacy scheme deprecated: support for the legacy NameValidationScheme will be removed in a future release",
+ "The default Prometheus naming translation strategy is planned to be changed from otlptranslator.NoUTF8EscapingWithSuffixes to otlptranslator.UnderscoreEscapingWithSuffixes in a future release. Add prometheus.WithTranslationStrategy(otlptranslator.NoUTF8EscapingWithSuffixes) to preserve the existing behavior, or prometheus.WithTranslationStrategy(otlptranslator.UnderscoreEscapingWithSuffixes) to opt into the future default behavior.",
)
})
@@ -38,6 +41,30 @@ func newConfig(opts ...Option) config {
cfg = opt.apply(cfg)
}
+ if cfg.translationStrategy == "" {
+ // If no translation strategy was specified, deduce one based on the global
+ // NameValidationScheme. NOTE: this logic will change in the future, always
+ // defaulting to UnderscoreEscapingWithSuffixes
+
+ //nolint:staticcheck // NameValidationScheme is deprecated but we still need it for now.
+ if model.NameValidationScheme == model.UTF8Validation {
+ logTemporaryDefault()
+ cfg.translationStrategy = otlptranslator.NoUTF8EscapingWithSuffixes
+ } else {
+ cfg.translationStrategy = otlptranslator.UnderscoreEscapingWithSuffixes
+ }
+ } else {
+ // Note, if the translation strategy implies that suffixes should be added,
+ // the user can still use WithoutUnits and WithoutCounterSuffixes to
+ // explicitly disable specific suffixes. We do not override their preference
+ // in this case. However if the chosen strategy disables suffixes, we should
+ // forcibly disable all of them.
+ if !cfg.translationStrategy.ShouldAddSuffixes() {
+ cfg.withoutCounterSuffixes = true
+ cfg.withoutUnits = true
+ }
+ }
+
if cfg.registerer == nil {
cfg.registerer = prometheus.DefaultRegisterer
}
@@ -95,6 +122,30 @@ func WithoutTargetInfo() Option {
})
}
+// WithTranslationStrategy provides a standardized way to define how metric and
+// label names should be handled during translation to Prometheus format. See:
+// https://github.com/open-telemetry/opentelemetry-specification/blob/v1.48.0/specification/metrics/sdk_exporters/prometheus.md#configuration.
+// The recommended approach is to use either
+// [otlptranslator.UnderscoreEscapingWithSuffixes] for full Prometheus-style
+// compatibility or [otlptranslator.NoTranslation] for OpenTelemetry-style names.
+//
+// By default, if the NameValidationScheme variable in
+// [github.com/prometheus/common/model] is "legacy", the default strategy is
+// [otlptranslator.UnderscoreEscapingWithSuffixes]. If the validation scheme is
+// "utf8", then currently the default Strategy is
+// [otlptranslator.NoUTF8EscapingWithSuffixes].
+//
+// Notice: It is planned that a future release of this SDK will change the
+// default to always be [otlptranslator.UnderscoreEscapingWithSuffixes] in all
+// circumstances. Users wanting a different translation strategy should specify
+// it explicitly.
+func WithTranslationStrategy(strategy otlptranslator.TranslationStrategyOption) Option {
+ return optionFunc(func(cfg config) config {
+ cfg.translationStrategy = strategy
+ return cfg
+ })
+}
+
// WithoutUnits disables exporter's addition of unit suffixes to metric names,
// and will also prevent unit comments from being added in OpenMetrics once
// unit comments are supported.
@@ -103,6 +154,12 @@ func WithoutTargetInfo() Option {
// conventions. For example, the counter metric request.duration, with unit
// milliseconds would become request_duration_milliseconds_total.
// With this option set, the name would instead be request_duration_total.
+//
+// Can be used in conjunction with [WithTranslationStrategy] to disable unit
+// suffixes in strategies that would otherwise add suffixes, but this behavior
+// is not recommended and may be removed in a future release.
+//
+// Deprecated: Use [WithTranslationStrategy] instead.
func WithoutUnits() Option {
return optionFunc(func(cfg config) config {
cfg.withoutUnits = true
@@ -110,12 +167,19 @@ func WithoutUnits() Option {
})
}
-// WithoutCounterSuffixes disables exporter's addition _total suffixes on counters.
+// WithoutCounterSuffixes disables exporter's addition _total suffixes on
+// counters.
//
// By default, metric names include a _total suffix to follow Prometheus naming
// conventions. For example, the counter metric happy.people would become
// happy_people_total. With this option set, the name would instead be
// happy_people.
+//
+// Can be used in conjunction with [WithTranslationStrategy] to disable counter
+// suffixes in strategies that would otherwise add suffixes, but this behavior
+// is not recommended and may be removed in a future release.
+//
+// Deprecated: Use [WithTranslationStrategy] instead.
func WithoutCounterSuffixes() Option {
return optionFunc(func(cfg config) config {
cfg.withoutCounterSuffixes = true
@@ -132,9 +196,11 @@ func WithoutScopeInfo() Option {
})
}
-// WithNamespace configures the Exporter to prefix metric with the given namespace.
-// Metadata metrics such as target_info are not prefixed since these
-// have special behavior based on their name.
+// WithNamespace configures the Exporter to prefix metric with the given
+// namespace. Metadata metrics such as target_info are not prefixed since these
+// have special behavior based on their name. Namespaces will be prepended even
+// if [otlptranslator.NoTranslation] is set as a translation strategy. If the provided namespace
+// is empty, nothing will be prepended to metric names.
func WithNamespace(ns string) Option {
return optionFunc(func(cfg config) config {
cfg.namespace = ns
diff --git a/vendor/go.opentelemetry.io/otel/exporters/prometheus/exporter.go b/vendor/go.opentelemetry.io/otel/exporters/prometheus/exporter.go
index 9f3e5414ac..0f29c0abbd 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/prometheus/exporter.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/prometheus/exporter.go
@@ -15,7 +15,6 @@ import (
"github.com/prometheus/client_golang/prometheus"
dto "github.com/prometheus/client_model/go"
- "github.com/prometheus/common/model"
"github.com/prometheus/otlptranslator"
"google.golang.org/protobuf/proto"
@@ -37,7 +36,7 @@ const (
)
var metricsPool = sync.Pool{
- New: func() interface{} {
+ New: func() any {
return &metricdata.ResourceMetrics{}
},
}
@@ -49,7 +48,7 @@ type Exporter struct {
}
// MarshalLog returns logging data about the Exporter.
-func (e *Exporter) MarshalLog() interface{} {
+func (e *Exporter) MarshalLog() any {
const t = "Prometheus exporter"
if r, ok := e.Reader.(*metric.ManualReader); ok {
@@ -104,12 +103,18 @@ func New(opts ...Option) (*Exporter, error) {
// TODO (#3244): Enable some way to configure the reader, but not change temporality.
reader := metric.NewManualReader(cfg.readerOpts...)
- utf8Allowed := model.NameValidationScheme == model.UTF8Validation // nolint:staticcheck // We need this check to keep supporting the legacy scheme.
- if !utf8Allowed {
- // Only sanitize if prometheus does not support UTF-8.
- logDeprecatedLegacyScheme()
+ labelNamer := otlptranslator.LabelNamer{UTF8Allowed: !cfg.translationStrategy.ShouldEscape()}
+ escapedNamespace := cfg.namespace
+ if escapedNamespace != "" {
+ var err error
+ // If the namespace needs to be escaped, do that now when creating the new
+ // Collector object. The escaping is not persisted in the Config itself.
+ escapedNamespace, err = labelNamer.Build(escapedNamespace)
+ if err != nil {
+ return nil, err
+ }
}
- labelNamer := otlptranslator.LabelNamer{UTF8Allowed: utf8Allowed}
+
collector := &collector{
reader: reader,
disableTargetInfo: cfg.disableTargetInfo,
@@ -117,18 +122,11 @@ func New(opts ...Option) (*Exporter, error) {
withoutCounterSuffixes: cfg.withoutCounterSuffixes,
disableScopeInfo: cfg.disableScopeInfo,
metricFamilies: make(map[string]*dto.MetricFamily),
- namespace: labelNamer.Build(cfg.namespace),
+ namespace: escapedNamespace,
resourceAttributesFilter: cfg.resourceAttributesFilter,
- metricNamer: otlptranslator.MetricNamer{
- Namespace: cfg.namespace,
- // We decide whether to pass type and unit to the netricNamer based
- // on whether units or counter suffixes are enabled, and keep this
- // always enabled.
- WithMetricSuffixes: true,
- UTF8Allowed: utf8Allowed,
- },
- unitNamer: otlptranslator.UnitNamer{UTF8Allowed: utf8Allowed},
- labelNamer: labelNamer,
+ metricNamer: otlptranslator.NewMetricNamer(escapedNamespace, cfg.translationStrategy),
+ unitNamer: otlptranslator.UnitNamer{UTF8Allowed: !cfg.translationStrategy.ShouldEscape()},
+ labelNamer: labelNamer,
}
if err := cfg.registerer.Register(collector); err != nil {
@@ -143,7 +141,7 @@ func New(opts ...Option) (*Exporter, error) {
}
// Describe implements prometheus.Collector.
-func (c *collector) Describe(ch chan<- *prometheus.Desc) {
+func (*collector) Describe(chan<- *prometheus.Desc) {
// The Opentelemetry SDK doesn't have information on which will exist when the collector
// is registered. By returning nothing we are an "unchecked" collector in Prometheus,
// and assume responsibility for consistency of the metrics produced.
@@ -197,7 +195,11 @@ func (c *collector) Collect(ch chan<- prometheus.Metric) {
}
if c.resourceAttributesFilter != nil && len(c.resourceKeyVals.keys) == 0 {
- c.createResourceAttributes(metrics.Resource)
+ err := c.createResourceAttributes(metrics.Resource)
+ if err != nil {
+ otel.Handle(err)
+ return
+ }
}
for _, scopeMetrics := range metrics.ScopeMetrics {
@@ -211,7 +213,11 @@ func (c *collector) Collect(ch chan<- prometheus.Metric) {
kv.keys = append(kv.keys, scopeNameLabel, scopeVersionLabel, scopeSchemaLabel)
kv.vals = append(kv.vals, scopeMetrics.Scope.Name, scopeMetrics.Scope.Version, scopeMetrics.Scope.SchemaURL)
- attrKeys, attrVals := getAttrs(scopeMetrics.Scope.Attributes, c.labelNamer)
+ attrKeys, attrVals, err := getAttrs(scopeMetrics.Scope.Attributes, c.labelNamer)
+ if err != nil {
+ otel.Handle(err)
+ continue
+ }
for i := range attrKeys {
attrKeys[i] = scopeLabelPrefix + attrKeys[i]
}
@@ -227,7 +233,13 @@ func (c *collector) Collect(ch chan<- prometheus.Metric) {
if typ == nil {
continue
}
- name := c.getName(m)
+ name, err := c.getName(m)
+ if err != nil {
+ // TODO(#7066): Handle this error better. It's not clear this can be
+ // reached, bad metric names should / will be caught at creation time.
+ otel.Handle(err)
+ continue
+ }
drop, help := c.validateMetrics(name, m.Description, typ)
if drop {
@@ -322,7 +334,11 @@ func addExponentialHistogramMetric[N int64 | float64](
labelNamer otlptranslator.LabelNamer,
) {
for _, dp := range histogram.DataPoints {
- keys, values := getAttrs(dp.Attributes, labelNamer)
+ keys, values, err := getAttrs(dp.Attributes, labelNamer)
+ if err != nil {
+ otel.Handle(err)
+ continue
+ }
keys = append(keys, kv.keys...)
values = append(values, kv.vals...)
@@ -382,8 +398,7 @@ func addExponentialHistogramMetric[N int64 | float64](
otel.Handle(err)
continue
}
-
- // TODO(GiedriusS): add exemplars here after https://github.com/prometheus/client_golang/pull/1654#pullrequestreview-2434669425 is done.
+ m = addExemplars(m, dp.Exemplars, labelNamer)
ch <- m
}
}
@@ -397,7 +412,11 @@ func addHistogramMetric[N int64 | float64](
labelNamer otlptranslator.LabelNamer,
) {
for _, dp := range histogram.DataPoints {
- keys, values := getAttrs(dp.Attributes, labelNamer)
+ keys, values, err := getAttrs(dp.Attributes, labelNamer)
+ if err != nil {
+ otel.Handle(err)
+ continue
+ }
keys = append(keys, kv.keys...)
values = append(values, kv.vals...)
@@ -433,7 +452,11 @@ func addSumMetric[N int64 | float64](
}
for _, dp := range sum.DataPoints {
- keys, values := getAttrs(dp.Attributes, labelNamer)
+ keys, values, err := getAttrs(dp.Attributes, labelNamer)
+ if err != nil {
+ otel.Handle(err)
+ continue
+ }
keys = append(keys, kv.keys...)
values = append(values, kv.vals...)
@@ -461,7 +484,11 @@ func addGaugeMetric[N int64 | float64](
labelNamer otlptranslator.LabelNamer,
) {
for _, dp := range gauge.DataPoints {
- keys, values := getAttrs(dp.Attributes, labelNamer)
+ keys, values, err := getAttrs(dp.Attributes, labelNamer)
+ if err != nil {
+ otel.Handle(err)
+ continue
+ }
keys = append(keys, kv.keys...)
values = append(values, kv.vals...)
@@ -477,7 +504,7 @@ func addGaugeMetric[N int64 | float64](
// getAttrs converts the attribute.Set to two lists of matching Prometheus-style
// keys and values.
-func getAttrs(attrs attribute.Set, labelNamer otlptranslator.LabelNamer) ([]string, []string) {
+func getAttrs(attrs attribute.Set, labelNamer otlptranslator.LabelNamer) ([]string, []string, error) {
keys := make([]string, 0, attrs.Len())
values := make([]string, 0, attrs.Len())
itr := attrs.Iter()
@@ -495,7 +522,11 @@ func getAttrs(attrs attribute.Set, labelNamer otlptranslator.LabelNamer) ([]stri
keysMap := make(map[string][]string)
for itr.Next() {
kv := itr.Attribute()
- key := labelNamer.Build(string(kv.Key))
+ key, err := labelNamer.Build(string(kv.Key))
+ if err != nil {
+ // TODO(#7066) Handle this error better.
+ return nil, nil, err
+ }
if _, ok := keysMap[key]; !ok {
keysMap[key] = []string{kv.Value.Emit()}
} else {
@@ -509,17 +540,21 @@ func getAttrs(attrs attribute.Set, labelNamer otlptranslator.LabelNamer) ([]stri
values = append(values, strings.Join(vals, ";"))
}
}
- return keys, values
+ return keys, values, nil
}
func (c *collector) createInfoMetric(name, description string, res *resource.Resource) (prometheus.Metric, error) {
- keys, values := getAttrs(*res.Set(), c.labelNamer)
+ keys, values, err := getAttrs(*res.Set(), c.labelNamer)
+ if err != nil {
+ return nil, err
+ }
desc := prometheus.NewDesc(name, description, keys, nil)
return prometheus.NewConstMetric(desc, prometheus.GaugeValue, float64(1), values...)
}
-// getName returns the sanitized name, prefixed with the namespace and suffixed with unit.
-func (c *collector) getName(m metricdata.Metrics) string {
+// getName returns the sanitized name, translated according to the selected
+// TranslationStrategy and namespace option.
+func (c *collector) getName(m metricdata.Metrics) (string, error) {
translatorMetric := otlptranslator.Metric{
Name: m.Name,
Type: c.namingMetricType(m),
@@ -530,7 +565,7 @@ func (c *collector) getName(m metricdata.Metrics) string {
return c.metricNamer.Build(translatorMetric)
}
-func (c *collector) metricType(m metricdata.Metrics) *dto.MetricType {
+func (*collector) metricType(m metricdata.Metrics) *dto.MetricType {
switch v := m.Data.(type) {
case metricdata.ExponentialHistogram[int64], metricdata.ExponentialHistogram[float64]:
return dto.MetricType_HISTOGRAM.Enum()
@@ -581,13 +616,18 @@ func (c *collector) namingMetricType(m metricdata.Metrics) otlptranslator.Metric
return otlptranslator.MetricTypeUnknown
}
-func (c *collector) createResourceAttributes(res *resource.Resource) {
+func (c *collector) createResourceAttributes(res *resource.Resource) error {
c.mu.Lock()
defer c.mu.Unlock()
resourceAttrs, _ := res.Set().Filter(c.resourceAttributesFilter)
- resourceKeys, resourceValues := getAttrs(resourceAttrs, c.labelNamer)
+ resourceKeys, resourceValues, err := getAttrs(resourceAttrs, c.labelNamer)
+ if err != nil {
+ return err
+ }
+
c.resourceKeyVals = keyVals{keys: resourceKeys, vals: resourceValues}
+ return nil
}
func (c *collector) validateMetrics(name, description string, metricType *dto.MetricType) (drop bool, help string) {
@@ -638,10 +678,14 @@ func addExemplars[N int64 | float64](
}
promExemplars := make([]prometheus.Exemplar, len(exemplars))
for i, exemplar := range exemplars {
- labels := attributesToLabels(exemplar.FilteredAttributes, labelNamer)
+ labels, err := attributesToLabels(exemplar.FilteredAttributes, labelNamer)
+ if err != nil {
+ otel.Handle(err)
+ return m
+ }
// Overwrite any existing trace ID or span ID attributes
- labels[otlptranslator.ExemplarTraceIDKey] = hex.EncodeToString(exemplar.TraceID[:])
- labels[otlptranslator.ExemplarSpanIDKey] = hex.EncodeToString(exemplar.SpanID[:])
+ labels[otlptranslator.ExemplarTraceIDKey] = hex.EncodeToString(exemplar.TraceID)
+ labels[otlptranslator.ExemplarSpanIDKey] = hex.EncodeToString(exemplar.SpanID)
promExemplars[i] = prometheus.Exemplar{
Value: float64(exemplar.Value),
Timestamp: exemplar.Time,
@@ -658,10 +702,14 @@ func addExemplars[N int64 | float64](
return metricWithExemplar
}
-func attributesToLabels(attrs []attribute.KeyValue, labelNamer otlptranslator.LabelNamer) prometheus.Labels {
+func attributesToLabels(attrs []attribute.KeyValue, labelNamer otlptranslator.LabelNamer) (prometheus.Labels, error) {
labels := make(map[string]string)
for _, attr := range attrs {
- labels[labelNamer.Build(string(attr.Key))] = attr.Value.Emit()
+ name, err := labelNamer.Build(string(attr.Key))
+ if err != nil {
+ return nil, err
+ }
+ labels[name] = attr.Value.Emit()
}
- return labels
+ return labels, nil
}
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go b/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go
index adbca7d347..86d7f4ba08 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go
@@ -41,22 +41,22 @@ func GetLogger() logr.Logger {
// Info prints messages about the general state of the API or SDK.
// This should usually be less than 5 messages a minute.
-func Info(msg string, keysAndValues ...interface{}) {
+func Info(msg string, keysAndValues ...any) {
GetLogger().V(4).Info(msg, keysAndValues...)
}
// Error prints messages about exceptional states of the API or SDK.
-func Error(err error, msg string, keysAndValues ...interface{}) {
+func Error(err error, msg string, keysAndValues ...any) {
GetLogger().Error(err, msg, keysAndValues...)
}
// Debug prints messages about all internal changes in the API or SDK.
-func Debug(msg string, keysAndValues ...interface{}) {
+func Debug(msg string, keysAndValues ...any) {
GetLogger().V(8).Info(msg, keysAndValues...)
}
// Warn prints messages about warnings in the API or SDK.
// Not an error but is likely more important than an informational event.
-func Warn(msg string, keysAndValues ...interface{}) {
+func Warn(msg string, keysAndValues ...any) {
GetLogger().V(1).Info(msg, keysAndValues...)
}
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/trace.go b/vendor/go.opentelemetry.io/otel/internal/global/trace.go
index 49e4ac4faa..bf5cf3119b 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/trace.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/trace.go
@@ -26,6 +26,7 @@ import (
"sync/atomic"
"go.opentelemetry.io/auto/sdk"
+
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/trace"
diff --git a/vendor/go.opentelemetry.io/otel/metric/LICENSE b/vendor/go.opentelemetry.io/otel/metric/LICENSE
index 261eeb9e9f..f1aee0f110 100644
--- a/vendor/go.opentelemetry.io/otel/metric/LICENSE
+++ b/vendor/go.opentelemetry.io/otel/metric/LICENSE
@@ -199,3 +199,33 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+
+--------------------------------------------------------------------------------
+
+Copyright 2009 The Go Authors.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google LLC nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/vendor/go.opentelemetry.io/otel/propagation/baggage.go b/vendor/go.opentelemetry.io/otel/propagation/baggage.go
index ebda5026d6..0518826020 100644
--- a/vendor/go.opentelemetry.io/otel/propagation/baggage.go
+++ b/vendor/go.opentelemetry.io/otel/propagation/baggage.go
@@ -20,7 +20,7 @@ type Baggage struct{}
var _ TextMapPropagator = Baggage{}
// Inject sets baggage key-values from ctx into the carrier.
-func (b Baggage) Inject(ctx context.Context, carrier TextMapCarrier) {
+func (Baggage) Inject(ctx context.Context, carrier TextMapCarrier) {
bStr := baggage.FromContext(ctx).String()
if bStr != "" {
carrier.Set(baggageHeader, bStr)
@@ -30,7 +30,7 @@ func (b Baggage) Inject(ctx context.Context, carrier TextMapCarrier) {
// Extract returns a copy of parent with the baggage from the carrier added.
// If carrier implements [ValuesGetter] (e.g. [HeaderCarrier]), Values is invoked
// for multiple values extraction. Otherwise, Get is called.
-func (b Baggage) Extract(parent context.Context, carrier TextMapCarrier) context.Context {
+func (Baggage) Extract(parent context.Context, carrier TextMapCarrier) context.Context {
if multiCarrier, ok := carrier.(ValuesGetter); ok {
return extractMultiBaggage(parent, multiCarrier)
}
@@ -38,7 +38,7 @@ func (b Baggage) Extract(parent context.Context, carrier TextMapCarrier) context
}
// Fields returns the keys who's values are set with Inject.
-func (b Baggage) Fields() []string {
+func (Baggage) Fields() []string {
return []string{baggageHeader}
}
diff --git a/vendor/go.opentelemetry.io/otel/propagation/propagation.go b/vendor/go.opentelemetry.io/otel/propagation/propagation.go
index 5c8c26ea2e..0a32c59aa3 100644
--- a/vendor/go.opentelemetry.io/otel/propagation/propagation.go
+++ b/vendor/go.opentelemetry.io/otel/propagation/propagation.go
@@ -20,7 +20,7 @@ type TextMapCarrier interface {
// must never be done outside of a new major release.
// Set stores the key-value pair.
- Set(key string, value string)
+ Set(key, value string)
// DO NOT CHANGE: any modification will not be backwards compatible and
// must never be done outside of a new major release.
@@ -88,7 +88,7 @@ func (hc HeaderCarrier) Values(key string) []string {
}
// Set stores the key-value pair.
-func (hc HeaderCarrier) Set(key string, value string) {
+func (hc HeaderCarrier) Set(key, value string) {
http.Header(hc).Set(key, value)
}
diff --git a/vendor/go.opentelemetry.io/otel/propagation/trace_context.go b/vendor/go.opentelemetry.io/otel/propagation/trace_context.go
index 6870e316dc..6692d2665d 100644
--- a/vendor/go.opentelemetry.io/otel/propagation/trace_context.go
+++ b/vendor/go.opentelemetry.io/otel/propagation/trace_context.go
@@ -36,7 +36,7 @@ var (
)
// Inject injects the trace context from ctx into carrier.
-func (tc TraceContext) Inject(ctx context.Context, carrier TextMapCarrier) {
+func (TraceContext) Inject(ctx context.Context, carrier TextMapCarrier) {
sc := trace.SpanContextFromContext(ctx)
if !sc.IsValid() {
return
@@ -77,7 +77,7 @@ func (tc TraceContext) Extract(ctx context.Context, carrier TextMapCarrier) cont
return trace.ContextWithRemoteSpanContext(ctx, sc)
}
-func (tc TraceContext) extract(carrier TextMapCarrier) trace.SpanContext {
+func (TraceContext) extract(carrier TextMapCarrier) trace.SpanContext {
h := carrier.Get(traceparentHeader)
if h == "" {
return trace.SpanContext{}
@@ -151,6 +151,6 @@ func extractPart(dst []byte, h *string, n int) bool {
}
// Fields returns the keys who's values are set with Inject.
-func (tc TraceContext) Fields() []string {
+func (TraceContext) Fields() []string {
return []string{traceparentHeader, tracestateHeader}
}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/LICENSE b/vendor/go.opentelemetry.io/otel/sdk/LICENSE
index 261eeb9e9f..f1aee0f110 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/LICENSE
+++ b/vendor/go.opentelemetry.io/otel/sdk/LICENSE
@@ -199,3 +199,33 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+
+--------------------------------------------------------------------------------
+
+Copyright 2009 The Go Authors.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google LLC nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/vendor/go.opentelemetry.io/otel/sdk/internal/x/x.go b/vendor/go.opentelemetry.io/otel/sdk/internal/x/x.go
index 68d296cbed..1be472e917 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/internal/x/x.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/internal/x/x.go
@@ -19,7 +19,7 @@ import (
// to the case-insensitive string value of "true" (i.e. "True" and "TRUE"
// will also enable this).
var Resource = newFeature("RESOURCE", func(v string) (string, bool) {
- if strings.ToLower(v) == "true" {
+ if strings.EqualFold(v, "true") {
return v, true
}
return "", false
@@ -59,7 +59,7 @@ func (f Feature[T]) Lookup() (v T, ok bool) {
return f.parse(vRaw)
}
-// Enabled returns if the feature is enabled.
+// Enabled reports whether the feature is enabled.
func (f Feature[T]) Enabled() bool {
_, ok := f.Lookup()
return ok
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/LICENSE b/vendor/go.opentelemetry.io/otel/sdk/metric/LICENSE
index 261eeb9e9f..f1aee0f110 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/LICENSE
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/LICENSE
@@ -199,3 +199,33 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+
+--------------------------------------------------------------------------------
+
+Copyright 2009 The Go Authors.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google LLC nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/config.go b/vendor/go.opentelemetry.io/otel/sdk/metric/config.go
index 203cd9d650..c6440a1346 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/config.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/config.go
@@ -7,6 +7,7 @@ import (
"context"
"errors"
"os"
+ "strconv"
"strings"
"sync"
@@ -17,12 +18,15 @@ import (
// config contains configuration options for a MeterProvider.
type config struct {
- res *resource.Resource
- readers []Reader
- views []View
- exemplarFilter exemplar.Filter
+ res *resource.Resource
+ readers []Reader
+ views []View
+ exemplarFilter exemplar.Filter
+ cardinalityLimit int
}
+const defaultCardinalityLimit = 0
+
// readerSignals returns a force-flush and shutdown function for a
// MeterProvider to call in their respective options. All Readers c contains
// will have their force-flush and shutdown methods unified into returned
@@ -69,8 +73,9 @@ func unifyShutdown(funcs []func(context.Context) error) func(context.Context) er
// newConfig returns a config configured with options.
func newConfig(options []Option) config {
conf := config{
- res: resource.Default(),
- exemplarFilter: exemplar.TraceBasedFilter,
+ res: resource.Default(),
+ exemplarFilter: exemplar.TraceBasedFilter,
+ cardinalityLimit: cardinalityLimitFromEnv(),
}
for _, o := range meterProviderOptionsFromEnv() {
conf = o.apply(conf)
@@ -155,6 +160,21 @@ func WithExemplarFilter(filter exemplar.Filter) Option {
})
}
+// WithCardinalityLimit sets the cardinality limit for the MeterProvider.
+//
+// The cardinality limit is the hard limit on the number of metric datapoints
+// that can be collected for a single instrument in a single collect cycle.
+//
+// Setting this to a zero or negative value means no limit is applied.
+func WithCardinalityLimit(limit int) Option {
+ // For backward compatibility, the environment variable `OTEL_GO_X_CARDINALITY_LIMIT`
+ // can also be used to set this value.
+ return optionFunc(func(cfg config) config {
+ cfg.cardinalityLimit = limit
+ return cfg
+ })
+}
+
func meterProviderOptionsFromEnv() []Option {
var opts []Option
// https://github.com/open-telemetry/opentelemetry-specification/blob/d4b241f451674e8f611bb589477680341006ad2b/specification/configuration/sdk-environment-variables.md#exemplar
@@ -170,3 +190,17 @@ func meterProviderOptionsFromEnv() []Option {
}
return opts
}
+
+func cardinalityLimitFromEnv() int {
+ const cardinalityLimitKey = "OTEL_GO_X_CARDINALITY_LIMIT"
+ v := strings.TrimSpace(os.Getenv(cardinalityLimitKey))
+ if v == "" {
+ return defaultCardinalityLimit
+ }
+ n, err := strconv.Atoi(v)
+ if err != nil {
+ otel.Handle(err)
+ return defaultCardinalityLimit
+ }
+ return n
+}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/doc.go b/vendor/go.opentelemetry.io/otel/sdk/metric/doc.go
index 90a4ae16c1..0f3b9d623f 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/doc.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/doc.go
@@ -39,6 +39,30 @@
// Meter.RegisterCallback and Registration.Unregister to add and remove
// callbacks without leaking memory.
//
+// # Cardinality Limits
+//
+// Cardinality refers to the number of unique attributes collected. High cardinality can lead to
+// excessive memory usage, increased storage costs, and backend performance issues.
+//
+// Currently, the OpenTelemetry Go Metric SDK does not enforce a cardinality limit by default
+// (note that this may change in a future release). Use [WithCardinalityLimit] to set the
+// cardinality limit as desired.
+//
+// New attribute sets are dropped when the cardinality limit is reached. The measurement of
+// these sets are aggregated into
+// a special attribute set containing attribute.Bool("otel.metric.overflow", true).
+// This ensures total metric values (e.g., Sum, Count) remain correct for the
+// collection cycle, but information about the specific dropped sets
+// is not preserved.
+//
+// Recommendations:
+//
+// - Set the limit based on the theoretical maximum combinations or expected
+// active combinations. The OpenTelemetry Specification recommends a default of 2000.
+// - A too high of a limit increases worst-case memory overhead in the SDK and may cause downstream
+// issues for databases that cannot handle high cardinality.
+// - A too low of a limit causes loss of attribute detail as more data falls into overflow.
+//
// See [go.opentelemetry.io/otel/metric] for more information about
// the metric API.
//
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar.go b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar.go
index 549d3bd5f9..38b8745e67 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar.go
@@ -58,10 +58,7 @@ func DefaultExemplarReservoirProviderSelector(agg Aggregation) exemplar.Reservoi
// SimpleFixedSizeExemplarReservoir with a reservoir equal to the
// smaller of the maximum number of buckets configured on the
// aggregation or twenty (e.g. min(20, max_buckets)).
- n = int(a.MaxSize)
- if n > 20 {
- n = 20
- }
+ n = min(int(a.MaxSize), 20)
} else {
// https://github.com/open-telemetry/opentelemetry-specification/blob/e94af89e3d0c01de30127a0f423e912f6cda7bed/specification/metrics/sdk.md#simplefixedsizeexemplarreservoir
// This Exemplar reservoir MAY take a configuration parameter for
@@ -69,11 +66,11 @@ func DefaultExemplarReservoirProviderSelector(agg Aggregation) exemplar.Reservoi
// provided, the default size MAY be the number of possible
// concurrent threads (e.g. number of CPUs) to help reduce
// contention. Otherwise, a default size of 1 SHOULD be used.
- n = runtime.NumCPU()
- if n < 1 {
- // Should never be the case, but be defensive.
- n = 1
- }
+ //
+ // Use runtime.GOMAXPROCS instead of runtime.NumCPU to support
+ // containerized environments that may have less than the total number
+ // of logical CPUs available on the local machine allocated to it.
+ n = max(runtime.GOMAXPROCS(0), 1)
}
return exemplar.FixedSizeReservoirProvider(n)
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/filter.go b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/filter.go
index b595e2acef..b50f5c1531 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/filter.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/filter.go
@@ -24,11 +24,11 @@ func TraceBasedFilter(ctx context.Context) bool {
}
// AlwaysOnFilter is a [Filter] that always offers measurements.
-func AlwaysOnFilter(ctx context.Context) bool {
+func AlwaysOnFilter(context.Context) bool {
return true
}
// AlwaysOffFilter is a [Filter] that never offers measurements.
-func AlwaysOffFilter(ctx context.Context) bool {
+func AlwaysOffFilter(context.Context) bool {
return false
}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/fixed_size_reservoir.go b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/fixed_size_reservoir.go
index 1fb1e0095f..08e8f68fe7 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/fixed_size_reservoir.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/fixed_size_reservoir.go
@@ -14,7 +14,7 @@ import (
// FixedSizeReservoirProvider returns a provider of [FixedSizeReservoir].
func FixedSizeReservoirProvider(k int) ReservoirProvider {
- return func(_ attribute.Set) Reservoir {
+ return func(attribute.Set) Reservoir {
return NewFixedSizeReservoir(k)
}
}
@@ -56,7 +56,7 @@ func newFixedSizeReservoir(s *storage) *FixedSizeReservoir {
// randomFloat64 returns, as a float64, a uniform pseudo-random number in the
// open interval (0.0,1.0).
-func (r *FixedSizeReservoir) randomFloat64() float64 {
+func (*FixedSizeReservoir) randomFloat64() float64 {
// TODO: Use an algorithm that avoids rejection sampling. For example:
//
// const precision = 1 << 53 // 2^53
@@ -125,13 +125,11 @@ func (r *FixedSizeReservoir) Offer(ctx context.Context, t time.Time, n Value, a
if int(r.count) < cap(r.store) {
r.store[r.count] = newMeasurement(ctx, t, n, a)
- } else {
- if r.count == r.next {
- // Overwrite a random existing measurement with the one offered.
- idx := int(rand.Int64N(int64(cap(r.store))))
- r.store[idx] = newMeasurement(ctx, t, n, a)
- r.advance()
- }
+ } else if r.count == r.next {
+ // Overwrite a random existing measurement with the one offered.
+ idx := int(rand.Int64N(int64(cap(r.store))))
+ r.store[idx] = newMeasurement(ctx, t, n, a)
+ r.advance()
}
r.count++
}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/histogram_reservoir.go b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/histogram_reservoir.go
index 3b76cf305a..decab613e7 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/histogram_reservoir.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/histogram_reservoir.go
@@ -16,7 +16,7 @@ import (
func HistogramReservoirProvider(bounds []float64) ReservoirProvider {
cp := slices.Clone(bounds)
slices.Sort(cp)
- return func(_ attribute.Set) Reservoir {
+ return func(attribute.Set) Reservoir {
return NewHistogramReservoir(cp)
}
}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/instrument.go b/vendor/go.opentelemetry.io/otel/sdk/metric/instrument.go
index 18891ed5b1..63cccc508f 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/instrument.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/instrument.go
@@ -75,7 +75,7 @@ type Instrument struct {
nonComparable // nolint: unused
}
-// IsEmpty returns if all Instrument fields are their zero-value.
+// IsEmpty reports whether all Instrument fields are their zero-value.
func (i Instrument) IsEmpty() bool {
return i.Name == "" &&
i.Description == "" &&
@@ -204,7 +204,7 @@ func (i *int64Inst) Record(ctx context.Context, val int64, opts ...metric.Record
i.aggregate(ctx, val, c.Attributes())
}
-func (i *int64Inst) Enabled(_ context.Context) bool {
+func (i *int64Inst) Enabled(context.Context) bool {
return len(i.measures) != 0
}
@@ -245,7 +245,7 @@ func (i *float64Inst) Record(ctx context.Context, val float64, opts ...metric.Re
i.aggregate(ctx, val, c.Attributes())
}
-func (i *float64Inst) Enabled(_ context.Context) bool {
+func (i *float64Inst) Enabled(context.Context) bool {
return len(i.measures) != 0
}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/drop.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/drop.go
index 8396faaa4a..129920cbdd 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/drop.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/drop.go
@@ -18,10 +18,10 @@ func dropReservoir[N int64 | float64](attribute.Set) FilteredExemplarReservoir[N
type dropRes[N int64 | float64] struct{}
// Offer does nothing, all measurements offered will be dropped.
-func (r *dropRes[N]) Offer(context.Context, N, []attribute.KeyValue) {}
+func (*dropRes[N]) Offer(context.Context, N, []attribute.KeyValue) {}
// Collect resets dest. No exemplars will ever be returned.
-func (r *dropRes[N]) Collect(dest *[]exemplar.Exemplar) {
+func (*dropRes[N]) Collect(dest *[]exemplar.Exemplar) {
clear(*dest) // Erase elements to let GC collect objects
*dest = (*dest)[:0]
}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/exponential_histogram.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/exponential_histogram.go
index ae1f593440..857eddf305 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/exponential_histogram.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/exponential_histogram.go
@@ -183,8 +183,8 @@ func (p *expoHistogramDataPoint[N]) scaleChange(bin, startBin int32, length int)
var count int32
for high-low >= p.maxSize {
- low = low >> 1
- high = high >> 1
+ low >>= 1
+ high >>= 1
count++
if count > expoMaxScale-expoMinScale {
return count
@@ -225,7 +225,7 @@ func (b *expoBuckets) record(bin int32) {
b.counts = append(b.counts, make([]uint64, newLength-len(b.counts))...)
}
- copy(b.counts[shift:origLen+int(shift)], b.counts[:])
+ copy(b.counts[shift:origLen+int(shift)], b.counts)
b.counts = b.counts[:newLength]
for i := 1; i < int(shift); i++ {
b.counts[i] = 0
@@ -264,7 +264,7 @@ func (b *expoBuckets) downscale(delta int32) {
// new Counts: [4, 14, 30, 10]
if len(b.counts) <= 1 || delta < 1 {
- b.startBin = b.startBin >> delta
+ b.startBin >>= delta
return
}
@@ -282,7 +282,7 @@ func (b *expoBuckets) downscale(delta int32) {
lastIdx := (len(b.counts) - 1 + int(offset)) / int(steps)
b.counts = b.counts[:lastIdx+1]
- b.startBin = b.startBin >> delta
+ b.startBin >>= delta
}
// newExponentialHistogram returns an Aggregator that summarizes a set of
@@ -350,7 +350,9 @@ func (e *expoHistogram[N]) measure(
v.res.Offer(ctx, value, droppedAttr)
}
-func (e *expoHistogram[N]) delta(dest *metricdata.Aggregation) int {
+func (e *expoHistogram[N]) delta(
+ dest *metricdata.Aggregation, //nolint:gocritic // The pointer is needed for the ComputeAggregation interface
+) int {
t := now()
// If *dest is not a metricdata.ExponentialHistogram, memory reuse is missed.
@@ -411,7 +413,9 @@ func (e *expoHistogram[N]) delta(dest *metricdata.Aggregation) int {
return n
}
-func (e *expoHistogram[N]) cumulative(dest *metricdata.Aggregation) int {
+func (e *expoHistogram[N]) cumulative(
+ dest *metricdata.Aggregation, //nolint:gocritic // The pointer is needed for the ComputeAggregation interface
+) int {
t := now()
// If *dest is not a metricdata.ExponentialHistogram, memory reuse is missed.
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/histogram.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/histogram.go
index d3068484cf..736287e736 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/histogram.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/histogram.go
@@ -140,7 +140,9 @@ type histogram[N int64 | float64] struct {
start time.Time
}
-func (s *histogram[N]) delta(dest *metricdata.Aggregation) int {
+func (s *histogram[N]) delta(
+ dest *metricdata.Aggregation, //nolint:gocritic // The pointer is needed for the ComputeAggregation interface
+) int {
t := now()
// If *dest is not a metricdata.Histogram, memory reuse is missed. In that
@@ -190,7 +192,9 @@ func (s *histogram[N]) delta(dest *metricdata.Aggregation) int {
return n
}
-func (s *histogram[N]) cumulative(dest *metricdata.Aggregation) int {
+func (s *histogram[N]) cumulative(
+ dest *metricdata.Aggregation, //nolint:gocritic // The pointer is needed for the ComputeAggregation interface
+) int {
t := now()
// If *dest is not a metricdata.Histogram, memory reuse is missed. In that
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/lastvalue.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/lastvalue.go
index 350ccebdcb..4bbe624c77 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/lastvalue.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/lastvalue.go
@@ -55,7 +55,9 @@ func (s *lastValue[N]) measure(ctx context.Context, value N, fltrAttr attribute.
s.values[attr.Equivalent()] = d
}
-func (s *lastValue[N]) delta(dest *metricdata.Aggregation) int {
+func (s *lastValue[N]) delta(
+ dest *metricdata.Aggregation, //nolint:gocritic // The pointer is needed for the ComputeAggregation interface
+) int {
t := now()
// Ignore if dest is not a metricdata.Gauge. The chance for memory reuse of
// the DataPoints is missed (better luck next time).
@@ -75,7 +77,9 @@ func (s *lastValue[N]) delta(dest *metricdata.Aggregation) int {
return n
}
-func (s *lastValue[N]) cumulative(dest *metricdata.Aggregation) int {
+func (s *lastValue[N]) cumulative(
+ dest *metricdata.Aggregation, //nolint:gocritic // The pointer is needed for the ComputeAggregation interface
+) int {
t := now()
// Ignore if dest is not a metricdata.Gauge. The chance for memory reuse of
// the DataPoints is missed (better luck next time).
@@ -126,7 +130,9 @@ type precomputedLastValue[N int64 | float64] struct {
*lastValue[N]
}
-func (s *precomputedLastValue[N]) delta(dest *metricdata.Aggregation) int {
+func (s *precomputedLastValue[N]) delta(
+ dest *metricdata.Aggregation, //nolint:gocritic // The pointer is needed for the ComputeAggregation interface
+) int {
t := now()
// Ignore if dest is not a metricdata.Gauge. The chance for memory reuse of
// the DataPoints is missed (better luck next time).
@@ -146,7 +152,9 @@ func (s *precomputedLastValue[N]) delta(dest *metricdata.Aggregation) int {
return n
}
-func (s *precomputedLastValue[N]) cumulative(dest *metricdata.Aggregation) int {
+func (s *precomputedLastValue[N]) cumulative(
+ dest *metricdata.Aggregation, //nolint:gocritic // The pointer is needed for the ComputeAggregation interface
+) int {
t := now()
// Ignore if dest is not a metricdata.Gauge. The chance for memory reuse of
// the DataPoints is missed (better luck next time).
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/sum.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/sum.go
index 612cde4327..1b4b2304c0 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/sum.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/sum.go
@@ -70,7 +70,9 @@ type sum[N int64 | float64] struct {
start time.Time
}
-func (s *sum[N]) delta(dest *metricdata.Aggregation) int {
+func (s *sum[N]) delta(
+ dest *metricdata.Aggregation, //nolint:gocritic // The pointer is needed for the ComputeAggregation interface
+) int {
t := now()
// If *dest is not a metricdata.Sum, memory reuse is missed. In that case,
@@ -105,7 +107,9 @@ func (s *sum[N]) delta(dest *metricdata.Aggregation) int {
return n
}
-func (s *sum[N]) cumulative(dest *metricdata.Aggregation) int {
+func (s *sum[N]) cumulative(
+ dest *metricdata.Aggregation, //nolint:gocritic // The pointer is needed for the ComputeAggregation interface
+) int {
t := now()
// If *dest is not a metricdata.Sum, memory reuse is missed. In that case,
@@ -165,7 +169,9 @@ type precomputedSum[N int64 | float64] struct {
reported map[attribute.Distinct]N
}
-func (s *precomputedSum[N]) delta(dest *metricdata.Aggregation) int {
+func (s *precomputedSum[N]) delta(
+ dest *metricdata.Aggregation, //nolint:gocritic // The pointer is needed for the ComputeAggregation interface
+) int {
t := now()
newReported := make(map[attribute.Distinct]N)
@@ -206,7 +212,9 @@ func (s *precomputedSum[N]) delta(dest *metricdata.Aggregation) int {
return n
}
-func (s *precomputedSum[N]) cumulative(dest *metricdata.Aggregation) int {
+func (s *precomputedSum[N]) cumulative(
+ dest *metricdata.Aggregation, //nolint:gocritic // The pointer is needed for the ComputeAggregation interface
+) int {
t := now()
// If *dest is not a metricdata.Sum, memory reuse is missed. In that case,
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/x/README.md b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/x/README.md
index 59f736b733..be0714a5f4 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/x/README.md
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/x/README.md
@@ -1,47 +1,16 @@
# Experimental Features
-The metric SDK contains features that have not yet stabilized in the OpenTelemetry specification.
-These features are added to the OpenTelemetry Go metric SDK prior to stabilization in the specification so that users can start experimenting with them and provide feedback.
+The Metric SDK contains features that have not yet stabilized in the OpenTelemetry specification.
+These features are added to the OpenTelemetry Go Metric SDK prior to stabilization in the specification so that users can start experimenting with them and provide feedback.
These feature may change in backwards incompatible ways as feedback is applied.
See the [Compatibility and Stability](#compatibility-and-stability) section for more information.
## Features
-- [Cardinality Limit](#cardinality-limit)
- [Exemplars](#exemplars)
- [Instrument Enabled](#instrument-enabled)
-### Cardinality Limit
-
-The cardinality limit is the hard limit on the number of metric streams that can be collected for a single instrument.
-
-This experimental feature can be enabled by setting the `OTEL_GO_X_CARDINALITY_LIMIT` environment value.
-The value must be an integer value.
-All other values are ignored.
-
-If the value set is less than or equal to `0`, no limit will be applied.
-
-#### Examples
-
-Set the cardinality limit to 2000.
-
-```console
-export OTEL_GO_X_CARDINALITY_LIMIT=2000
-```
-
-Set an infinite cardinality limit (functionally equivalent to disabling the feature).
-
-```console
-export OTEL_GO_X_CARDINALITY_LIMIT=-1
-```
-
-Disable the cardinality limit.
-
-```console
-unset OTEL_GO_X_CARDINALITY_LIMIT
-```
-
### Exemplars
A sample of measurements made may be exported directly as a set of exemplars.
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/x/x.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/x/x.go
index a98606238a..294dcf8469 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/x/x.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/x/x.go
@@ -10,25 +10,8 @@ package x // import "go.opentelemetry.io/otel/sdk/metric/internal/x"
import (
"context"
"os"
- "strconv"
)
-// CardinalityLimit is an experimental feature flag that defines if
-// cardinality limits should be applied to the recorded metric data-points.
-//
-// To enable this feature set the OTEL_GO_X_CARDINALITY_LIMIT environment
-// variable to the integer limit value you want to use.
-//
-// Setting OTEL_GO_X_CARDINALITY_LIMIT to a value less than or equal to 0
-// will disable the cardinality limits.
-var CardinalityLimit = newFeature("CARDINALITY_LIMIT", func(v string) (int, bool) {
- n, err := strconv.Atoi(v)
- if err != nil {
- return 0, false
- }
- return n, true
-})
-
// Feature is an experimental feature control flag. It provides a uniform way
// to interact with these feature flags and parse their values.
type Feature[T any] struct {
@@ -36,6 +19,7 @@ type Feature[T any] struct {
parse func(v string) (T, bool)
}
+//nolint:unused
func newFeature[T any](suffix string, parse func(string) (T, bool)) Feature[T] {
const envKeyRoot = "OTEL_GO_X_"
return Feature[T]{
@@ -63,7 +47,7 @@ func (f Feature[T]) Lookup() (v T, ok bool) {
return f.parse(vRaw)
}
-// Enabled returns if the feature is enabled.
+// Enabled reports whether the feature is enabled.
func (f Feature[T]) Enabled() bool {
_, ok := f.Lookup()
return ok
@@ -73,7 +57,7 @@ func (f Feature[T]) Enabled() bool {
//
// EnabledInstrument interface is implemented by synchronous instruments.
type EnabledInstrument interface {
- // Enabled returns whether the instrument will process measurements for the given context.
+ // Enabled reports whether the instrument will process measurements for the given context.
//
// This function can be used in places where measuring an instrument
// would result in computationally expensive operations.
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/manual_reader.go b/vendor/go.opentelemetry.io/otel/sdk/metric/manual_reader.go
index 96e7790866..85d3dc2076 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/manual_reader.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/manual_reader.go
@@ -129,7 +129,7 @@ func (mr *ManualReader) Collect(ctx context.Context, rm *metricdata.ResourceMetr
}
// MarshalLog returns logging data about the ManualReader.
-func (r *ManualReader) MarshalLog() interface{} {
+func (r *ManualReader) MarshalLog() any {
r.mu.Lock()
down := r.isShutdown
r.mu.Unlock()
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/meter.go b/vendor/go.opentelemetry.io/otel/sdk/metric/meter.go
index c500fd9f2a..e0a1e90e77 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/meter.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/meter.go
@@ -12,7 +12,6 @@ import (
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/metric/embedded"
"go.opentelemetry.io/otel/sdk/instrumentation"
-
"go.opentelemetry.io/otel/sdk/metric/internal/aggregate"
)
@@ -423,7 +422,7 @@ func (m *meter) Float64ObservableGauge(
}
func validateInstrumentName(name string) error {
- if len(name) == 0 {
+ if name == "" {
return fmt.Errorf("%w: %s: is empty", ErrInstrumentName, name)
}
if len(name) > 255 {
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/periodic_reader.go b/vendor/go.opentelemetry.io/otel/sdk/metric/periodic_reader.go
index 0a48aed74d..f08c771a68 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/periodic_reader.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/periodic_reader.go
@@ -114,7 +114,7 @@ func NewPeriodicReader(exporter Exporter, options ...PeriodicReaderOption) *Peri
cancel: cancel,
done: make(chan struct{}),
rmPool: sync.Pool{
- New: func() interface{} {
+ New: func() any {
return &metricdata.ResourceMetrics{}
},
},
@@ -234,7 +234,7 @@ func (r *PeriodicReader) Collect(ctx context.Context, rm *metricdata.ResourceMet
}
// collect unwraps p as a produceHolder and returns its produce results.
-func (r *PeriodicReader) collect(ctx context.Context, p interface{}, rm *metricdata.ResourceMetrics) error {
+func (r *PeriodicReader) collect(ctx context.Context, p any, rm *metricdata.ResourceMetrics) error {
if p == nil {
return ErrReaderNotRegistered
}
@@ -349,7 +349,7 @@ func (r *PeriodicReader) Shutdown(ctx context.Context) error {
}
// MarshalLog returns logging data about the PeriodicReader.
-func (r *PeriodicReader) MarshalLog() interface{} {
+func (r *PeriodicReader) MarshalLog() any {
r.mu.Lock()
down := r.isShutdown
r.mu.Unlock()
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/pipeline.go b/vendor/go.opentelemetry.io/otel/sdk/metric/pipeline.go
index 7bdb699cae..408fddc8d4 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/pipeline.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/pipeline.go
@@ -17,7 +17,6 @@ import (
"go.opentelemetry.io/otel/sdk/metric/exemplar"
"go.opentelemetry.io/otel/sdk/metric/internal"
"go.opentelemetry.io/otel/sdk/metric/internal/aggregate"
- "go.opentelemetry.io/otel/sdk/metric/internal/x"
"go.opentelemetry.io/otel/sdk/metric/metricdata"
"go.opentelemetry.io/otel/sdk/resource"
)
@@ -37,17 +36,24 @@ type instrumentSync struct {
compAgg aggregate.ComputeAggregation
}
-func newPipeline(res *resource.Resource, reader Reader, views []View, exemplarFilter exemplar.Filter) *pipeline {
+func newPipeline(
+ res *resource.Resource,
+ reader Reader,
+ views []View,
+ exemplarFilter exemplar.Filter,
+ cardinalityLimit int,
+) *pipeline {
if res == nil {
res = resource.Empty()
}
return &pipeline{
- resource: res,
- reader: reader,
- views: views,
- int64Measures: map[observableID[int64]][]aggregate.Measure[int64]{},
- float64Measures: map[observableID[float64]][]aggregate.Measure[float64]{},
- exemplarFilter: exemplarFilter,
+ resource: res,
+ reader: reader,
+ views: views,
+ int64Measures: map[observableID[int64]][]aggregate.Measure[int64]{},
+ float64Measures: map[observableID[float64]][]aggregate.Measure[float64]{},
+ exemplarFilter: exemplarFilter,
+ cardinalityLimit: cardinalityLimit,
// aggregations is lazy allocated when needed.
}
}
@@ -65,12 +71,13 @@ type pipeline struct {
views []View
sync.Mutex
- int64Measures map[observableID[int64]][]aggregate.Measure[int64]
- float64Measures map[observableID[float64]][]aggregate.Measure[float64]
- aggregations map[instrumentation.Scope][]instrumentSync
- callbacks []func(context.Context) error
- multiCallbacks list.List
- exemplarFilter exemplar.Filter
+ int64Measures map[observableID[int64]][]aggregate.Measure[int64]
+ float64Measures map[observableID[float64]][]aggregate.Measure[float64]
+ aggregations map[instrumentation.Scope][]instrumentSync
+ callbacks []func(context.Context) error
+ multiCallbacks list.List
+ exemplarFilter exemplar.Filter
+ cardinalityLimit int
}
// addInt64Measure adds a new int64 measure to the pipeline for each observer.
@@ -388,10 +395,9 @@ func (i *inserter[N]) cachedAggregator(
b.Filter = stream.AttributeFilter
// A value less than or equal to zero will disable the aggregation
// limits for the builder (an all the created aggregates).
- // CardinalityLimit.Lookup returns 0 by default if unset (or
+ // cardinalityLimit will be 0 by default if unset (or
// unrecognized input). Use that value directly.
- b.AggregationLimit, _ = x.CardinalityLimit.Lookup()
-
+ b.AggregationLimit = i.pipeline.cardinalityLimit
in, out, err := i.aggregateFunc(b, stream.Aggregation, kind)
if err != nil {
return aggVal[N]{0, nil, err}
@@ -426,7 +432,7 @@ func (i *inserter[N]) logConflict(id instID) {
}
const msg = "duplicate metric stream definitions"
- args := []interface{}{
+ args := []any{
"names", fmt.Sprintf("%q, %q", existing.Name, id.Name),
"descriptions", fmt.Sprintf("%q, %q", existing.Description, id.Description),
"kinds", fmt.Sprintf("%s, %s", existing.Kind, id.Kind),
@@ -460,7 +466,7 @@ func (i *inserter[N]) logConflict(id instID) {
global.Warn(msg, args...)
}
-func (i *inserter[N]) instID(kind InstrumentKind, stream Stream) instID {
+func (*inserter[N]) instID(kind InstrumentKind, stream Stream) instID {
var zero N
return instID{
Name: stream.Name,
@@ -590,10 +596,16 @@ func isAggregatorCompatible(kind InstrumentKind, agg Aggregation) error {
// measurement.
type pipelines []*pipeline
-func newPipelines(res *resource.Resource, readers []Reader, views []View, exemplarFilter exemplar.Filter) pipelines {
+func newPipelines(
+ res *resource.Resource,
+ readers []Reader,
+ views []View,
+ exemplarFilter exemplar.Filter,
+ cardinalityLimit int,
+) pipelines {
pipes := make([]*pipeline, 0, len(readers))
for _, r := range readers {
- p := newPipeline(res, r, views, exemplarFilter)
+ p := newPipeline(res, r, views, exemplarFilter, cardinalityLimit)
r.register(p)
pipes = append(pipes, p)
}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/provider.go b/vendor/go.opentelemetry.io/otel/sdk/metric/provider.go
index 2fca89e5a8..b0a6ec5808 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/provider.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/provider.go
@@ -42,7 +42,7 @@ func NewMeterProvider(options ...Option) *MeterProvider {
flush, sdown := conf.readerSignals()
mp := &MeterProvider{
- pipes: newPipelines(conf.res, conf.readers, conf.views, conf.exemplarFilter),
+ pipes: newPipelines(conf.res, conf.readers, conf.views, conf.exemplarFilter, conf.cardinalityLimit),
forceFlush: flush,
shutdown: sdown,
}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/reader.go b/vendor/go.opentelemetry.io/otel/sdk/metric/reader.go
index c96e500a2b..5c1cea8254 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/reader.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/reader.go
@@ -117,7 +117,7 @@ type produceHolder struct {
type shutdownProducer struct{}
// produce returns an ErrReaderShutdown error.
-func (p shutdownProducer) produce(context.Context, *metricdata.ResourceMetrics) error {
+func (shutdownProducer) produce(context.Context, *metricdata.ResourceMetrics) error {
return ErrReaderShutdown
}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/version.go b/vendor/go.opentelemetry.io/otel/sdk/metric/version.go
index 0e5adc1a76..dd9051a76c 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/version.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/version.go
@@ -5,5 +5,5 @@ package metric // import "go.opentelemetry.io/otel/sdk/metric"
// version is the current release version of the metric SDK in use.
func version() string {
- return "1.37.0"
+ return "1.38.0"
}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go b/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go
index cefe4ab914..3f20eb7a56 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go
@@ -13,7 +13,7 @@ import (
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/sdk"
- semconv "go.opentelemetry.io/otel/semconv/v1.34.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.37.0"
)
type (
@@ -72,7 +72,7 @@ func StringDetector(schemaURL string, k attribute.Key, f func() (string, error))
// Detect returns a *Resource that describes the string as a value
// corresponding to attribute.Key as well as the specific schemaURL.
-func (sd stringDetector) Detect(ctx context.Context) (*Resource, error) {
+func (sd stringDetector) Detect(context.Context) (*Resource, error) {
value, err := sd.F()
if err != nil {
return nil, fmt.Errorf("%s: %w", string(sd.K), err)
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/container.go b/vendor/go.opentelemetry.io/otel/sdk/resource/container.go
index 0d8619715e..bbe142d203 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/container.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/container.go
@@ -11,7 +11,7 @@ import (
"os"
"regexp"
- semconv "go.opentelemetry.io/otel/semconv/v1.34.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.37.0"
)
type containerIDProvider func() (string, error)
@@ -27,7 +27,7 @@ const cgroupPath = "/proc/self/cgroup"
// Detect returns a *Resource that describes the id of the container.
// If no container id found, an empty resource will be returned.
-func (cgroupContainerIDDetector) Detect(ctx context.Context) (*Resource, error) {
+func (cgroupContainerIDDetector) Detect(context.Context) (*Resource, error) {
containerID, err := containerID()
if err != nil {
return nil, err
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/env.go b/vendor/go.opentelemetry.io/otel/sdk/resource/env.go
index 16a062ad8c..4a1b017eea 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/env.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/env.go
@@ -12,7 +12,7 @@ import (
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
- semconv "go.opentelemetry.io/otel/semconv/v1.34.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.37.0"
)
const (
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go
index 7819039238..5fed33d4fb 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go
@@ -8,7 +8,7 @@ import (
"errors"
"strings"
- semconv "go.opentelemetry.io/otel/semconv/v1.34.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.37.0"
)
type hostIDProvider func() (string, error)
@@ -96,7 +96,7 @@ func (r *hostIDReaderLinux) read() (string, error) {
type hostIDDetector struct{}
// Detect returns a *Resource containing the platform specific host id.
-func (hostIDDetector) Detect(ctx context.Context) (*Resource, error) {
+func (hostIDDetector) Detect(context.Context) (*Resource, error) {
hostID, err := hostID()
if err != nil {
return nil, err
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/os.go b/vendor/go.opentelemetry.io/otel/sdk/resource/os.go
index 01b4d27a03..51da76e807 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/os.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/os.go
@@ -8,7 +8,7 @@ import (
"strings"
"go.opentelemetry.io/otel/attribute"
- semconv "go.opentelemetry.io/otel/semconv/v1.34.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.37.0"
)
type osDescriptionProvider func() (string, error)
@@ -32,7 +32,7 @@ type (
// Detect returns a *Resource that describes the operating system type the
// service is running on.
-func (osTypeDetector) Detect(ctx context.Context) (*Resource, error) {
+func (osTypeDetector) Detect(context.Context) (*Resource, error) {
osType := runtimeOS()
osTypeAttribute := mapRuntimeOSToSemconvOSType(osType)
@@ -45,7 +45,7 @@ func (osTypeDetector) Detect(ctx context.Context) (*Resource, error) {
// Detect returns a *Resource that describes the operating system the
// service is running on.
-func (osDescriptionDetector) Detect(ctx context.Context) (*Resource, error) {
+func (osDescriptionDetector) Detect(context.Context) (*Resource, error) {
description, err := osDescription()
if err != nil {
return nil, err
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_unix.go b/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_unix.go
index f537e5ca5c..7252af79fc 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_unix.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_unix.go
@@ -63,12 +63,12 @@ func parseOSReleaseFile(file io.Reader) map[string]string {
return values
}
-// skip returns true if the line is blank or starts with a '#' character, and
+// skip reports whether the line is blank or starts with a '#' character, and
// therefore should be skipped from processing.
func skip(line string) bool {
line = strings.TrimSpace(line)
- return len(line) == 0 || strings.HasPrefix(line, "#")
+ return line == "" || strings.HasPrefix(line, "#")
}
// parse attempts to split the provided line on the first '=' character, and then
@@ -76,7 +76,7 @@ func skip(line string) bool {
func parse(line string) (string, string, bool) {
k, v, found := strings.Cut(line, "=")
- if !found || len(k) == 0 {
+ if !found || k == "" {
return "", "", false
}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/process.go b/vendor/go.opentelemetry.io/otel/sdk/resource/process.go
index 6712ce80d5..138e57721b 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/process.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/process.go
@@ -11,7 +11,7 @@ import (
"path/filepath"
"runtime"
- semconv "go.opentelemetry.io/otel/semconv/v1.34.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.37.0"
)
type (
@@ -112,19 +112,19 @@ type (
// Detect returns a *Resource that describes the process identifier (PID) of the
// executing process.
-func (processPIDDetector) Detect(ctx context.Context) (*Resource, error) {
+func (processPIDDetector) Detect(context.Context) (*Resource, error) {
return NewWithAttributes(semconv.SchemaURL, semconv.ProcessPID(pid())), nil
}
// Detect returns a *Resource that describes the name of the process executable.
-func (processExecutableNameDetector) Detect(ctx context.Context) (*Resource, error) {
+func (processExecutableNameDetector) Detect(context.Context) (*Resource, error) {
executableName := filepath.Base(commandArgs()[0])
return NewWithAttributes(semconv.SchemaURL, semconv.ProcessExecutableName(executableName)), nil
}
// Detect returns a *Resource that describes the full path of the process executable.
-func (processExecutablePathDetector) Detect(ctx context.Context) (*Resource, error) {
+func (processExecutablePathDetector) Detect(context.Context) (*Resource, error) {
executablePath, err := executablePath()
if err != nil {
return nil, err
@@ -135,13 +135,13 @@ func (processExecutablePathDetector) Detect(ctx context.Context) (*Resource, err
// Detect returns a *Resource that describes all the command arguments as received
// by the process.
-func (processCommandArgsDetector) Detect(ctx context.Context) (*Resource, error) {
+func (processCommandArgsDetector) Detect(context.Context) (*Resource, error) {
return NewWithAttributes(semconv.SchemaURL, semconv.ProcessCommandArgs(commandArgs()...)), nil
}
// Detect returns a *Resource that describes the username of the user that owns the
// process.
-func (processOwnerDetector) Detect(ctx context.Context) (*Resource, error) {
+func (processOwnerDetector) Detect(context.Context) (*Resource, error) {
owner, err := owner()
if err != nil {
return nil, err
@@ -152,17 +152,17 @@ func (processOwnerDetector) Detect(ctx context.Context) (*Resource, error) {
// Detect returns a *Resource that describes the name of the compiler used to compile
// this process image.
-func (processRuntimeNameDetector) Detect(ctx context.Context) (*Resource, error) {
+func (processRuntimeNameDetector) Detect(context.Context) (*Resource, error) {
return NewWithAttributes(semconv.SchemaURL, semconv.ProcessRuntimeName(runtimeName())), nil
}
// Detect returns a *Resource that describes the version of the runtime of this process.
-func (processRuntimeVersionDetector) Detect(ctx context.Context) (*Resource, error) {
+func (processRuntimeVersionDetector) Detect(context.Context) (*Resource, error) {
return NewWithAttributes(semconv.SchemaURL, semconv.ProcessRuntimeVersion(runtimeVersion())), nil
}
// Detect returns a *Resource that describes the runtime of this process.
-func (processRuntimeDescriptionDetector) Detect(ctx context.Context) (*Resource, error) {
+func (processRuntimeDescriptionDetector) Detect(context.Context) (*Resource, error) {
runtimeDescription := fmt.Sprintf(
"go version %s %s/%s", runtimeVersion(), runtimeOS(), runtimeArch())
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go b/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go
index 09b91e1e1b..28e1e4f7eb 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go
@@ -112,7 +112,7 @@ func (r *Resource) String() string {
}
// MarshalLog is the marshaling function used by the logging system to represent this Resource.
-func (r *Resource) MarshalLog() interface{} {
+func (r *Resource) MarshalLog() any {
return struct {
Attributes attribute.Set
SchemaURL string
@@ -148,7 +148,7 @@ func (r *Resource) Iter() attribute.Iterator {
return r.attrs.Iter()
}
-// Equal returns whether r and o represent the same resource. Two resources can
+// Equal reports whether r and o represent the same resource. Two resources can
// be equal even if they have different schema URLs.
//
// See the documentation on the [Resource] type for the pitfalls of using ==
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go b/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go
index 6966ed861e..9bc3e525d1 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go
@@ -6,24 +6,35 @@ package trace // import "go.opentelemetry.io/otel/sdk/trace"
import (
"context"
"errors"
+ "fmt"
"sync"
"sync/atomic"
"time"
"go.opentelemetry.io/otel"
+ "go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/internal/global"
+ "go.opentelemetry.io/otel/metric"
+ "go.opentelemetry.io/otel/sdk"
"go.opentelemetry.io/otel/sdk/internal/env"
+ "go.opentelemetry.io/otel/sdk/trace/internal/x"
+ semconv "go.opentelemetry.io/otel/semconv/v1.37.0"
+ "go.opentelemetry.io/otel/semconv/v1.37.0/otelconv"
"go.opentelemetry.io/otel/trace"
)
// Defaults for BatchSpanProcessorOptions.
const (
- DefaultMaxQueueSize = 2048
- DefaultScheduleDelay = 5000
+ DefaultMaxQueueSize = 2048
+ // DefaultScheduleDelay is the delay interval between two consecutive exports, in milliseconds.
+ DefaultScheduleDelay = 5000
+ // DefaultExportTimeout is the duration after which an export is cancelled, in milliseconds.
DefaultExportTimeout = 30000
DefaultMaxExportBatchSize = 512
)
+var queueFull = otelconv.ErrorTypeAttr("queue_full")
+
// BatchSpanProcessorOption configures a BatchSpanProcessor.
type BatchSpanProcessorOption func(o *BatchSpanProcessorOptions)
@@ -67,6 +78,11 @@ type batchSpanProcessor struct {
queue chan ReadOnlySpan
dropped uint32
+ selfObservabilityEnabled bool
+ callbackRegistration metric.Registration
+ spansProcessedCounter otelconv.SDKProcessorSpanProcessed
+ componentNameAttr attribute.KeyValue
+
batch []ReadOnlySpan
batchMutex sync.Mutex
timer *time.Timer
@@ -87,11 +103,7 @@ func NewBatchSpanProcessor(exporter SpanExporter, options ...BatchSpanProcessorO
maxExportBatchSize := env.BatchSpanProcessorMaxExportBatchSize(DefaultMaxExportBatchSize)
if maxExportBatchSize > maxQueueSize {
- if DefaultMaxExportBatchSize > maxQueueSize {
- maxExportBatchSize = maxQueueSize
- } else {
- maxExportBatchSize = DefaultMaxExportBatchSize
- }
+ maxExportBatchSize = min(DefaultMaxExportBatchSize, maxQueueSize)
}
o := BatchSpanProcessorOptions{
@@ -112,6 +124,21 @@ func NewBatchSpanProcessor(exporter SpanExporter, options ...BatchSpanProcessorO
stopCh: make(chan struct{}),
}
+ if x.SelfObservability.Enabled() {
+ bsp.selfObservabilityEnabled = true
+ bsp.componentNameAttr = componentName()
+
+ var err error
+ bsp.spansProcessedCounter, bsp.callbackRegistration, err = newBSPObs(
+ bsp.componentNameAttr,
+ func() int64 { return int64(len(bsp.queue)) },
+ int64(bsp.o.MaxQueueSize),
+ )
+ if err != nil {
+ otel.Handle(err)
+ }
+ }
+
bsp.stopWait.Add(1)
go func() {
defer bsp.stopWait.Done()
@@ -122,8 +149,61 @@ func NewBatchSpanProcessor(exporter SpanExporter, options ...BatchSpanProcessorO
return bsp
}
+var processorIDCounter atomic.Int64
+
+// nextProcessorID returns an identifier for this batch span processor,
+// starting with 0 and incrementing by 1 each time it is called.
+func nextProcessorID() int64 {
+ return processorIDCounter.Add(1) - 1
+}
+
+func componentName() attribute.KeyValue {
+ id := nextProcessorID()
+ name := fmt.Sprintf("%s/%d", otelconv.ComponentTypeBatchingSpanProcessor, id)
+ return semconv.OTelComponentName(name)
+}
+
+// newBSPObs creates and returns a new set of metrics instruments and a
+// registration for a BatchSpanProcessor. It is the caller's responsibility
+// to unregister the registration when it is no longer needed.
+func newBSPObs(
+ cmpnt attribute.KeyValue,
+ qLen func() int64,
+ qMax int64,
+) (otelconv.SDKProcessorSpanProcessed, metric.Registration, error) {
+ meter := otel.GetMeterProvider().Meter(
+ selfObsScopeName,
+ metric.WithInstrumentationVersion(sdk.Version()),
+ metric.WithSchemaURL(semconv.SchemaURL),
+ )
+
+ qCap, err := otelconv.NewSDKProcessorSpanQueueCapacity(meter)
+
+ qSize, e := otelconv.NewSDKProcessorSpanQueueSize(meter)
+ err = errors.Join(err, e)
+
+ spansProcessed, e := otelconv.NewSDKProcessorSpanProcessed(meter)
+ err = errors.Join(err, e)
+
+ cmpntT := semconv.OTelComponentTypeBatchingSpanProcessor
+ attrs := metric.WithAttributes(cmpnt, cmpntT)
+
+ reg, e := meter.RegisterCallback(
+ func(_ context.Context, o metric.Observer) error {
+ o.ObserveInt64(qSize.Inst(), qLen(), attrs)
+ o.ObserveInt64(qCap.Inst(), qMax, attrs)
+ return nil
+ },
+ qSize.Inst(),
+ qCap.Inst(),
+ )
+ err = errors.Join(err, e)
+
+ return spansProcessed, reg, err
+}
+
// OnStart method does nothing.
-func (bsp *batchSpanProcessor) OnStart(parent context.Context, s ReadWriteSpan) {}
+func (*batchSpanProcessor) OnStart(context.Context, ReadWriteSpan) {}
// OnEnd method enqueues a ReadOnlySpan for later processing.
func (bsp *batchSpanProcessor) OnEnd(s ReadOnlySpan) {
@@ -162,6 +242,9 @@ func (bsp *batchSpanProcessor) Shutdown(ctx context.Context) error {
case <-ctx.Done():
err = ctx.Err()
}
+ if bsp.selfObservabilityEnabled {
+ err = errors.Join(err, bsp.callbackRegistration.Unregister())
+ }
})
return err
}
@@ -171,7 +254,7 @@ type forceFlushSpan struct {
flushed chan struct{}
}
-func (f forceFlushSpan) SpanContext() trace.SpanContext {
+func (forceFlushSpan) SpanContext() trace.SpanContext {
return trace.NewSpanContext(trace.SpanContextConfig{TraceFlags: trace.FlagsSampled})
}
@@ -274,6 +357,11 @@ func (bsp *batchSpanProcessor) exportSpans(ctx context.Context) error {
if l := len(bsp.batch); l > 0 {
global.Debug("exporting spans", "count", len(bsp.batch), "total_dropped", atomic.LoadUint32(&bsp.dropped))
+ if bsp.selfObservabilityEnabled {
+ bsp.spansProcessedCounter.Add(ctx, int64(l),
+ bsp.componentNameAttr,
+ bsp.spansProcessedCounter.AttrComponentType(otelconv.ComponentTypeBatchingSpanProcessor))
+ }
err := bsp.e.ExportSpans(ctx, bsp.batch)
// A new batch is always created after exporting, even if the batch failed to be exported.
@@ -382,11 +470,17 @@ func (bsp *batchSpanProcessor) enqueueBlockOnQueueFull(ctx context.Context, sd R
case bsp.queue <- sd:
return true
case <-ctx.Done():
+ if bsp.selfObservabilityEnabled {
+ bsp.spansProcessedCounter.Add(ctx, 1,
+ bsp.componentNameAttr,
+ bsp.spansProcessedCounter.AttrComponentType(otelconv.ComponentTypeBatchingSpanProcessor),
+ bsp.spansProcessedCounter.AttrErrorType(queueFull))
+ }
return false
}
}
-func (bsp *batchSpanProcessor) enqueueDrop(_ context.Context, sd ReadOnlySpan) bool {
+func (bsp *batchSpanProcessor) enqueueDrop(ctx context.Context, sd ReadOnlySpan) bool {
if !sd.SpanContext().IsSampled() {
return false
}
@@ -396,12 +490,18 @@ func (bsp *batchSpanProcessor) enqueueDrop(_ context.Context, sd ReadOnlySpan) b
return true
default:
atomic.AddUint32(&bsp.dropped, 1)
+ if bsp.selfObservabilityEnabled {
+ bsp.spansProcessedCounter.Add(ctx, 1,
+ bsp.componentNameAttr,
+ bsp.spansProcessedCounter.AttrComponentType(otelconv.ComponentTypeBatchingSpanProcessor),
+ bsp.spansProcessedCounter.AttrErrorType(queueFull))
+ }
}
return false
}
// MarshalLog is the marshaling function used by the logging system to represent this Span Processor.
-func (bsp *batchSpanProcessor) MarshalLog() interface{} {
+func (bsp *batchSpanProcessor) MarshalLog() any {
return struct {
Type string
SpanExporter SpanExporter
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/doc.go b/vendor/go.opentelemetry.io/otel/sdk/trace/doc.go
index 1f60524e3e..e58e7f6ed7 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/doc.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/doc.go
@@ -6,5 +6,8 @@ Package trace contains support for OpenTelemetry distributed tracing.
The following assumes a basic familiarity with OpenTelemetry concepts.
See https://opentelemetry.io.
+
+See [go.opentelemetry.io/otel/sdk/trace/internal/x] for information about
+the experimental features.
*/
package trace // import "go.opentelemetry.io/otel/sdk/trace"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go b/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go
index c8d3fb7e3c..3649322a6e 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go
@@ -32,7 +32,7 @@ type randomIDGenerator struct{}
var _ IDGenerator = &randomIDGenerator{}
// NewSpanID returns a non-zero span ID from a randomly-chosen sequence.
-func (gen *randomIDGenerator) NewSpanID(ctx context.Context, traceID trace.TraceID) trace.SpanID {
+func (*randomIDGenerator) NewSpanID(context.Context, trace.TraceID) trace.SpanID {
sid := trace.SpanID{}
for {
binary.NativeEndian.PutUint64(sid[:], rand.Uint64())
@@ -45,7 +45,7 @@ func (gen *randomIDGenerator) NewSpanID(ctx context.Context, traceID trace.Trace
// NewIDs returns a non-zero trace ID and a non-zero span ID from a
// randomly-chosen sequence.
-func (gen *randomIDGenerator) NewIDs(ctx context.Context) (trace.TraceID, trace.SpanID) {
+func (*randomIDGenerator) NewIDs(context.Context) (trace.TraceID, trace.SpanID) {
tid := trace.TraceID{}
sid := trace.SpanID{}
for {
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/internal/x/README.md b/vendor/go.opentelemetry.io/otel/sdk/trace/internal/x/README.md
new file mode 100644
index 0000000000..feec16fa64
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/internal/x/README.md
@@ -0,0 +1,35 @@
+# Experimental Features
+
+The Trace SDK contains features that have not yet stabilized in the OpenTelemetry specification.
+These features are added to the OpenTelemetry Go Trace SDK prior to stabilization in the specification so that users can start experimenting with them and provide feedback.
+
+These features may change in backwards incompatible ways as feedback is applied.
+See the [Compatibility and Stability](#compatibility-and-stability) section for more information.
+
+## Features
+
+- [Self-Observability](#self-observability)
+
+### Self-Observability
+
+The SDK provides a self-observability feature that allows you to monitor the SDK itself.
+
+To opt-in, set the environment variable `OTEL_GO_X_SELF_OBSERVABILITY` to `true`.
+
+When enabled, the SDK will create the following metrics using the global `MeterProvider`:
+
+- `otel.sdk.span.live`
+- `otel.sdk.span.started`
+
+Please see the [Semantic conventions for OpenTelemetry SDK metrics] documentation for more details on these metrics.
+
+[Semantic conventions for OpenTelemetry SDK metrics]: https://github.com/open-telemetry/semantic-conventions/blob/v1.36.0/docs/otel/sdk-metrics.md
+
+## Compatibility and Stability
+
+Experimental features do not fall within the scope of the OpenTelemetry Go versioning and stability [policy](../../../../VERSIONING.md).
+These features may be removed or modified in successive version releases, including patch versions.
+
+When an experimental feature is promoted to a stable feature, a migration path will be included in the changelog entry of the release.
+There is no guarantee that any environment variable feature flags that enabled the experimental feature will be supported by the stable version.
+If they are supported, they may be accompanied with a deprecation notice stating a timeline for the removal of that support.
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/internal/x/x.go b/vendor/go.opentelemetry.io/otel/sdk/trace/internal/x/x.go
new file mode 100644
index 0000000000..2fcbbcc66e
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/internal/x/x.go
@@ -0,0 +1,63 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Package x documents experimental features for [go.opentelemetry.io/otel/sdk/trace].
+package x // import "go.opentelemetry.io/otel/sdk/trace/internal/x"
+
+import (
+ "os"
+ "strings"
+)
+
+// SelfObservability is an experimental feature flag that determines if SDK
+// self-observability metrics are enabled.
+//
+// To enable this feature set the OTEL_GO_X_SELF_OBSERVABILITY environment variable
+// to the case-insensitive string value of "true" (i.e. "True" and "TRUE"
+// will also enable this).
+var SelfObservability = newFeature("SELF_OBSERVABILITY", func(v string) (string, bool) {
+ if strings.EqualFold(v, "true") {
+ return v, true
+ }
+ return "", false
+})
+
+// Feature is an experimental feature control flag. It provides a uniform way
+// to interact with these feature flags and parse their values.
+type Feature[T any] struct {
+ key string
+ parse func(v string) (T, bool)
+}
+
+func newFeature[T any](suffix string, parse func(string) (T, bool)) Feature[T] {
+ const envKeyRoot = "OTEL_GO_X_"
+ return Feature[T]{
+ key: envKeyRoot + suffix,
+ parse: parse,
+ }
+}
+
+// Key returns the environment variable key that needs to be set to enable the
+// feature.
+func (f Feature[T]) Key() string { return f.key }
+
+// Lookup returns the user configured value for the feature and true if the
+// user has enabled the feature. Otherwise, if the feature is not enabled, a
+// zero-value and false are returned.
+func (f Feature[T]) Lookup() (v T, ok bool) {
+ // https://github.com/open-telemetry/opentelemetry-specification/blob/62effed618589a0bec416a87e559c0a9d96289bb/specification/configuration/sdk-environment-variables.md#parsing-empty-value
+ //
+ // > The SDK MUST interpret an empty value of an environment variable the
+ // > same way as when the variable is unset.
+ vRaw := os.Getenv(f.key)
+ if vRaw == "" {
+ return v, ok
+ }
+ return f.parse(vRaw)
+}
+
+// Enabled reports whether the feature is enabled.
+func (f Feature[T]) Enabled() bool {
+ _, ok := f.Lookup()
+ return ok
+}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go b/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go
index 0e2a2e7c60..37ce2ac876 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go
@@ -5,14 +5,20 @@ package trace // import "go.opentelemetry.io/otel/sdk/trace"
import (
"context"
+ "errors"
"fmt"
"sync"
"sync/atomic"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/internal/global"
+ "go.opentelemetry.io/otel/metric"
+ "go.opentelemetry.io/otel/sdk"
"go.opentelemetry.io/otel/sdk/instrumentation"
"go.opentelemetry.io/otel/sdk/resource"
+ "go.opentelemetry.io/otel/sdk/trace/internal/x"
+ semconv "go.opentelemetry.io/otel/semconv/v1.37.0"
+ "go.opentelemetry.io/otel/semconv/v1.37.0/otelconv"
"go.opentelemetry.io/otel/trace"
"go.opentelemetry.io/otel/trace/embedded"
"go.opentelemetry.io/otel/trace/noop"
@@ -20,6 +26,7 @@ import (
const (
defaultTracerName = "go.opentelemetry.io/otel/sdk/tracer"
+ selfObsScopeName = "go.opentelemetry.io/otel/sdk/trace"
)
// tracerProviderConfig.
@@ -45,7 +52,7 @@ type tracerProviderConfig struct {
}
// MarshalLog is the marshaling function used by the logging system to represent this Provider.
-func (cfg tracerProviderConfig) MarshalLog() interface{} {
+func (cfg tracerProviderConfig) MarshalLog() any {
return struct {
SpanProcessors []SpanProcessor
SamplerType string
@@ -156,8 +163,18 @@ func (p *TracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.T
t, ok := p.namedTracer[is]
if !ok {
t = &tracer{
- provider: p,
- instrumentationScope: is,
+ provider: p,
+ instrumentationScope: is,
+ selfObservabilityEnabled: x.SelfObservability.Enabled(),
+ }
+ if t.selfObservabilityEnabled {
+ var err error
+ t.spanLiveMetric, t.spanStartedMetric, err = newInst()
+ if err != nil {
+ msg := "failed to create self-observability metrics for tracer: %w"
+ err := fmt.Errorf(msg, err)
+ otel.Handle(err)
+ }
}
p.namedTracer[is] = t
}
@@ -184,6 +201,23 @@ func (p *TracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.T
return t
}
+func newInst() (otelconv.SDKSpanLive, otelconv.SDKSpanStarted, error) {
+ m := otel.GetMeterProvider().Meter(
+ selfObsScopeName,
+ metric.WithInstrumentationVersion(sdk.Version()),
+ metric.WithSchemaURL(semconv.SchemaURL),
+ )
+
+ var err error
+ spanLiveMetric, e := otelconv.NewSDKSpanLive(m)
+ err = errors.Join(err, e)
+
+ spanStartedMetric, e := otelconv.NewSDKSpanStarted(m)
+ err = errors.Join(err, e)
+
+ return spanLiveMetric, spanStartedMetric, err
+}
+
// RegisterSpanProcessor adds the given SpanProcessor to the list of SpanProcessors.
func (p *TracerProvider) RegisterSpanProcessor(sp SpanProcessor) {
// This check prevents calls during a shutdown.
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go b/vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go
index aa7b262d0d..689663d48b 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go
@@ -110,14 +110,14 @@ func TraceIDRatioBased(fraction float64) Sampler {
type alwaysOnSampler struct{}
-func (as alwaysOnSampler) ShouldSample(p SamplingParameters) SamplingResult {
+func (alwaysOnSampler) ShouldSample(p SamplingParameters) SamplingResult {
return SamplingResult{
Decision: RecordAndSample,
Tracestate: trace.SpanContextFromContext(p.ParentContext).TraceState(),
}
}
-func (as alwaysOnSampler) Description() string {
+func (alwaysOnSampler) Description() string {
return "AlwaysOnSampler"
}
@@ -131,14 +131,14 @@ func AlwaysSample() Sampler {
type alwaysOffSampler struct{}
-func (as alwaysOffSampler) ShouldSample(p SamplingParameters) SamplingResult {
+func (alwaysOffSampler) ShouldSample(p SamplingParameters) SamplingResult {
return SamplingResult{
Decision: Drop,
Tracestate: trace.SpanContextFromContext(p.ParentContext).TraceState(),
}
}
-func (as alwaysOffSampler) Description() string {
+func (alwaysOffSampler) Description() string {
return "AlwaysOffSampler"
}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go b/vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go
index 664e13e03f..411d9ccdd7 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go
@@ -39,7 +39,7 @@ func NewSimpleSpanProcessor(exporter SpanExporter) SpanProcessor {
}
// OnStart does nothing.
-func (ssp *simpleSpanProcessor) OnStart(context.Context, ReadWriteSpan) {}
+func (*simpleSpanProcessor) OnStart(context.Context, ReadWriteSpan) {}
// OnEnd immediately exports a ReadOnlySpan.
func (ssp *simpleSpanProcessor) OnEnd(s ReadOnlySpan) {
@@ -104,13 +104,13 @@ func (ssp *simpleSpanProcessor) Shutdown(ctx context.Context) error {
}
// ForceFlush does nothing as there is no data to flush.
-func (ssp *simpleSpanProcessor) ForceFlush(context.Context) error {
+func (*simpleSpanProcessor) ForceFlush(context.Context) error {
return nil
}
// MarshalLog is the marshaling function used by the logging system to represent
// this Span Processor.
-func (ssp *simpleSpanProcessor) MarshalLog() interface{} {
+func (ssp *simpleSpanProcessor) MarshalLog() any {
return struct {
Type string
Exporter SpanExporter
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/snapshot.go b/vendor/go.opentelemetry.io/otel/sdk/trace/snapshot.go
index d511d0f271..63aa337800 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/snapshot.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/snapshot.go
@@ -35,7 +35,7 @@ type snapshot struct {
var _ ReadOnlySpan = snapshot{}
-func (s snapshot) private() {}
+func (snapshot) private() {}
// Name returns the name of the span.
func (s snapshot) Name() string {
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/span.go b/vendor/go.opentelemetry.io/otel/sdk/trace/span.go
index 1785a4bbb0..b376051fbb 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/span.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/span.go
@@ -20,7 +20,7 @@ import (
"go.opentelemetry.io/otel/internal/global"
"go.opentelemetry.io/otel/sdk/instrumentation"
"go.opentelemetry.io/otel/sdk/resource"
- semconv "go.opentelemetry.io/otel/semconv/v1.34.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.37.0"
"go.opentelemetry.io/otel/trace"
"go.opentelemetry.io/otel/trace/embedded"
)
@@ -61,6 +61,7 @@ type ReadOnlySpan interface {
InstrumentationScope() instrumentation.Scope
// InstrumentationLibrary returns information about the instrumentation
// library that created the span.
+ //
// Deprecated: please use InstrumentationScope instead.
InstrumentationLibrary() instrumentation.Library //nolint:staticcheck // This method needs to be define for backwards compatibility
// Resource returns information about the entity that produced the span.
@@ -165,7 +166,7 @@ func (s *recordingSpan) SpanContext() trace.SpanContext {
return s.spanContext
}
-// IsRecording returns if this span is being recorded. If this span has ended
+// IsRecording reports whether this span is being recorded. If this span has ended
// this will return false.
func (s *recordingSpan) IsRecording() bool {
if s == nil {
@@ -177,7 +178,7 @@ func (s *recordingSpan) IsRecording() bool {
return s.isRecording()
}
-// isRecording returns if this span is being recorded. If this span has ended
+// isRecording reports whether this span is being recorded. If this span has ended
// this will return false.
//
// This method assumes s.mu.Lock is held by the caller.
@@ -495,6 +496,16 @@ func (s *recordingSpan) End(options ...trace.SpanEndOption) {
}
s.mu.Unlock()
+ if s.tracer.selfObservabilityEnabled {
+ defer func() {
+ // Add the span to the context to ensure the metric is recorded
+ // with the correct span context.
+ ctx := trace.ContextWithSpan(context.Background(), s)
+ set := spanLiveSet(s.spanContext.IsSampled())
+ s.tracer.spanLiveMetric.AddSet(ctx, -1, set)
+ }()
+ }
+
sps := s.tracer.provider.getSpanProcessors()
if len(sps) == 0 {
return
@@ -545,7 +556,7 @@ func (s *recordingSpan) RecordError(err error, opts ...trace.EventOption) {
s.addEvent(semconv.ExceptionEventName, opts...)
}
-func typeStr(i interface{}) string {
+func typeStr(i any) string {
t := reflect.TypeOf(i)
if t.PkgPath() == "" && t.Name() == "" {
// Likely a builtin type.
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go b/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go
index 0b65ae9ab7..e965c4cce8 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go
@@ -7,7 +7,9 @@ import (
"context"
"time"
+ "go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/sdk/instrumentation"
+ "go.opentelemetry.io/otel/semconv/v1.37.0/otelconv"
"go.opentelemetry.io/otel/trace"
"go.opentelemetry.io/otel/trace/embedded"
)
@@ -17,6 +19,10 @@ type tracer struct {
provider *TracerProvider
instrumentationScope instrumentation.Scope
+
+ selfObservabilityEnabled bool
+ spanLiveMetric otelconv.SDKSpanLive
+ spanStartedMetric otelconv.SDKSpanStarted
}
var _ trace.Tracer = &tracer{}
@@ -46,17 +52,25 @@ func (tr *tracer) Start(
}
s := tr.newSpan(ctx, name, &config)
+ newCtx := trace.ContextWithSpan(ctx, s)
+ if tr.selfObservabilityEnabled {
+ psc := trace.SpanContextFromContext(ctx)
+ set := spanStartedSet(psc, s)
+ tr.spanStartedMetric.AddSet(newCtx, 1, set)
+ }
+
if rw, ok := s.(ReadWriteSpan); ok && s.IsRecording() {
sps := tr.provider.getSpanProcessors()
for _, sp := range sps {
+ // Use original context.
sp.sp.OnStart(ctx, rw)
}
}
if rtt, ok := s.(runtimeTracer); ok {
- ctx = rtt.runtimeTrace(ctx)
+ newCtx = rtt.runtimeTrace(newCtx)
}
- return trace.ContextWithSpan(ctx, s), s
+ return newCtx, s
}
type runtimeTracer interface {
@@ -112,11 +126,12 @@ func (tr *tracer) newSpan(ctx context.Context, name string, config *trace.SpanCo
if !isRecording(samplingResult) {
return tr.newNonRecordingSpan(sc)
}
- return tr.newRecordingSpan(psc, sc, name, samplingResult, config)
+ return tr.newRecordingSpan(ctx, psc, sc, name, samplingResult, config)
}
// newRecordingSpan returns a new configured recordingSpan.
func (tr *tracer) newRecordingSpan(
+ ctx context.Context,
psc, sc trace.SpanContext,
name string,
sr SamplingResult,
@@ -153,6 +168,14 @@ func (tr *tracer) newRecordingSpan(
s.SetAttributes(sr.Attributes...)
s.SetAttributes(config.Attributes()...)
+ if tr.selfObservabilityEnabled {
+ // Propagate any existing values from the context with the new span to
+ // the measurement context.
+ ctx = trace.ContextWithSpan(ctx, s)
+ set := spanLiveSet(s.spanContext.IsSampled())
+ tr.spanLiveMetric.AddSet(ctx, 1, set)
+ }
+
return s
}
@@ -160,3 +183,112 @@ func (tr *tracer) newRecordingSpan(
func (tr *tracer) newNonRecordingSpan(sc trace.SpanContext) nonRecordingSpan {
return nonRecordingSpan{tracer: tr, sc: sc}
}
+
+type parentState int
+
+const (
+ parentStateNoParent parentState = iota
+ parentStateLocalParent
+ parentStateRemoteParent
+)
+
+type samplingState int
+
+const (
+ samplingStateDrop samplingState = iota
+ samplingStateRecordOnly
+ samplingStateRecordAndSample
+)
+
+type spanStartedSetKey struct {
+ parent parentState
+ sampling samplingState
+}
+
+var spanStartedSetCache = map[spanStartedSetKey]attribute.Set{
+ {parentStateNoParent, samplingStateDrop}: attribute.NewSet(
+ otelconv.SDKSpanStarted{}.AttrSpanParentOrigin(otelconv.SpanParentOriginNone),
+ otelconv.SDKSpanStarted{}.AttrSpanSamplingResult(otelconv.SpanSamplingResultDrop),
+ ),
+ {parentStateLocalParent, samplingStateDrop}: attribute.NewSet(
+ otelconv.SDKSpanStarted{}.AttrSpanParentOrigin(otelconv.SpanParentOriginLocal),
+ otelconv.SDKSpanStarted{}.AttrSpanSamplingResult(otelconv.SpanSamplingResultDrop),
+ ),
+ {parentStateRemoteParent, samplingStateDrop}: attribute.NewSet(
+ otelconv.SDKSpanStarted{}.AttrSpanParentOrigin(otelconv.SpanParentOriginRemote),
+ otelconv.SDKSpanStarted{}.AttrSpanSamplingResult(otelconv.SpanSamplingResultDrop),
+ ),
+
+ {parentStateNoParent, samplingStateRecordOnly}: attribute.NewSet(
+ otelconv.SDKSpanStarted{}.AttrSpanParentOrigin(otelconv.SpanParentOriginNone),
+ otelconv.SDKSpanStarted{}.AttrSpanSamplingResult(otelconv.SpanSamplingResultRecordOnly),
+ ),
+ {parentStateLocalParent, samplingStateRecordOnly}: attribute.NewSet(
+ otelconv.SDKSpanStarted{}.AttrSpanParentOrigin(otelconv.SpanParentOriginLocal),
+ otelconv.SDKSpanStarted{}.AttrSpanSamplingResult(otelconv.SpanSamplingResultRecordOnly),
+ ),
+ {parentStateRemoteParent, samplingStateRecordOnly}: attribute.NewSet(
+ otelconv.SDKSpanStarted{}.AttrSpanParentOrigin(otelconv.SpanParentOriginRemote),
+ otelconv.SDKSpanStarted{}.AttrSpanSamplingResult(otelconv.SpanSamplingResultRecordOnly),
+ ),
+
+ {parentStateNoParent, samplingStateRecordAndSample}: attribute.NewSet(
+ otelconv.SDKSpanStarted{}.AttrSpanParentOrigin(otelconv.SpanParentOriginNone),
+ otelconv.SDKSpanStarted{}.AttrSpanSamplingResult(otelconv.SpanSamplingResultRecordAndSample),
+ ),
+ {parentStateLocalParent, samplingStateRecordAndSample}: attribute.NewSet(
+ otelconv.SDKSpanStarted{}.AttrSpanParentOrigin(otelconv.SpanParentOriginLocal),
+ otelconv.SDKSpanStarted{}.AttrSpanSamplingResult(otelconv.SpanSamplingResultRecordAndSample),
+ ),
+ {parentStateRemoteParent, samplingStateRecordAndSample}: attribute.NewSet(
+ otelconv.SDKSpanStarted{}.AttrSpanParentOrigin(otelconv.SpanParentOriginRemote),
+ otelconv.SDKSpanStarted{}.AttrSpanSamplingResult(otelconv.SpanSamplingResultRecordAndSample),
+ ),
+}
+
+func spanStartedSet(psc trace.SpanContext, span trace.Span) attribute.Set {
+ key := spanStartedSetKey{
+ parent: parentStateNoParent,
+ sampling: samplingStateDrop,
+ }
+
+ if psc.IsValid() {
+ if psc.IsRemote() {
+ key.parent = parentStateRemoteParent
+ } else {
+ key.parent = parentStateLocalParent
+ }
+ }
+
+ if span.IsRecording() {
+ if span.SpanContext().IsSampled() {
+ key.sampling = samplingStateRecordAndSample
+ } else {
+ key.sampling = samplingStateRecordOnly
+ }
+ }
+
+ return spanStartedSetCache[key]
+}
+
+type spanLiveSetKey struct {
+ sampled bool
+}
+
+var spanLiveSetCache = map[spanLiveSetKey]attribute.Set{
+ {true}: attribute.NewSet(
+ otelconv.SDKSpanLive{}.AttrSpanSamplingResult(
+ otelconv.SpanSamplingResultRecordAndSample,
+ ),
+ ),
+ {false}: attribute.NewSet(
+ otelconv.SDKSpanLive{}.AttrSpanSamplingResult(
+ otelconv.SpanSamplingResultRecordOnly,
+ ),
+ ),
+}
+
+func spanLiveSet(sampled bool) attribute.Set {
+ key := spanLiveSetKey{sampled: sampled}
+ return spanLiveSetCache[key]
+}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/version.go b/vendor/go.opentelemetry.io/otel/sdk/trace/version.go
deleted file mode 100644
index b84dd2c5ee..0000000000
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/version.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright The OpenTelemetry Authors
-// SPDX-License-Identifier: Apache-2.0
-
-package trace // import "go.opentelemetry.io/otel/sdk/trace"
-
-// version is the current release version of the metric SDK in use.
-func version() string {
- return "1.16.0-rc.1"
-}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/version.go b/vendor/go.opentelemetry.io/otel/sdk/version.go
index c0217af6b9..7f97cc31e5 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/version.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/version.go
@@ -6,5 +6,5 @@ package sdk // import "go.opentelemetry.io/otel/sdk"
// Version is the current release version of the OpenTelemetry SDK in use.
func Version() string {
- return "1.37.0"
+ return "1.38.0"
}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/internal/http.go b/vendor/go.opentelemetry.io/otel/semconv/internal/http.go
index e9eb577345..58b5eddef6 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/internal/http.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/internal/http.go
@@ -104,7 +104,7 @@ func (sc *SemanticConventions) NetAttributesFromHTTPRequest(
// It handles both IPv4 and IPv6 addresses. If the host portion is not recognized
// as a valid IPv4 or IPv6 address, the `ip` result will be empty and the
// host portion will instead be returned in `name`.
-func hostIPNamePort(hostWithPort string) (ip string, name string, port int) {
+func hostIPNamePort(hostWithPort string) (ip, name string, port int) {
var (
hostPart, portPart string
parsedPort uint64
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.34.0/attribute_group.go b/vendor/go.opentelemetry.io/otel/semconv/v1.34.0/attribute_group.go
index 5b56662573..98c0fddaa3 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.34.0/attribute_group.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.34.0/attribute_group.go
@@ -3467,6 +3467,13 @@ func ContainerImageTags(val ...string) attribute.KeyValue {
return ContainerImageTagsKey.StringSlice(val)
}
+// ContainerLabel returns an attribute KeyValue conforming to the
+// "container.label" semantic conventions. It represents the container labels,
+// `` being the label name, the value being the label value.
+func ContainerLabel(key string, val string) attribute.KeyValue {
+ return attribute.String("container.label."+key, val)
+}
+
// ContainerName returns an attribute KeyValue conforming to the "container.name"
// semantic conventions. It represents the container name used by container
// runtime.
@@ -3794,6 +3801,22 @@ func DBOperationName(val string) attribute.KeyValue {
return DBOperationNameKey.String(val)
}
+// DBOperationParameter returns an attribute KeyValue conforming to the
+// "db.operation.parameter" semantic conventions. It represents a database
+// operation parameter, with `` being the parameter name, and the attribute
+// value being a string representation of the parameter value.
+func DBOperationParameter(key string, val string) attribute.KeyValue {
+ return attribute.String("db.operation.parameter."+key, val)
+}
+
+// DBQueryParameter returns an attribute KeyValue conforming to the
+// "db.query.parameter" semantic conventions. It represents a database query
+// parameter, with `` being the parameter name, and the attribute value
+// being a string representation of the parameter value.
+func DBQueryParameter(key string, val string) attribute.KeyValue {
+ return attribute.String("db.query.parameter."+key, val)
+}
+
// DBQuerySummary returns an attribute KeyValue conforming to the
// "db.query.summary" semantic conventions. It represents the low cardinality
// summary of a database query.
@@ -7312,6 +7335,14 @@ func HTTPRequestBodySize(val int) attribute.KeyValue {
return HTTPRequestBodySizeKey.Int(val)
}
+// HTTPRequestHeader returns an attribute KeyValue conforming to the
+// "http.request.header" semantic conventions. It represents the HTTP request
+// headers, `` being the normalized HTTP Header name (lowercase), the value
+// being the header values.
+func HTTPRequestHeader(key string, val ...string) attribute.KeyValue {
+ return attribute.StringSlice("http.request.header."+key, val)
+}
+
// HTTPRequestMethodOriginal returns an attribute KeyValue conforming to the
// "http.request.method_original" semantic conventions. It represents the
// original HTTP method sent by the client in the request line.
@@ -7347,6 +7378,14 @@ func HTTPResponseBodySize(val int) attribute.KeyValue {
return HTTPResponseBodySizeKey.Int(val)
}
+// HTTPResponseHeader returns an attribute KeyValue conforming to the
+// "http.response.header" semantic conventions. It represents the HTTP response
+// headers, `` being the normalized HTTP Header name (lowercase), the value
+// being the header values.
+func HTTPResponseHeader(key string, val ...string) attribute.KeyValue {
+ return attribute.StringSlice("http.response.header."+key, val)
+}
+
// HTTPResponseSize returns an attribute KeyValue conforming to the
// "http.response.size" semantic conventions. It represents the total size of the
// response in bytes. This should be the total number of bytes sent over the
@@ -8001,6 +8040,22 @@ func K8SContainerStatusLastTerminatedReason(val string) attribute.KeyValue {
return K8SContainerStatusLastTerminatedReasonKey.String(val)
}
+// K8SCronJobAnnotation returns an attribute KeyValue conforming to the
+// "k8s.cronjob.annotation" semantic conventions. It represents the cronjob
+// annotation placed on the CronJob, the `` being the annotation name, the
+// value being the annotation value.
+func K8SCronJobAnnotation(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.cronjob.annotation."+key, val)
+}
+
+// K8SCronJobLabel returns an attribute KeyValue conforming to the
+// "k8s.cronjob.label" semantic conventions. It represents the label placed on
+// the CronJob, the `` being the label name, the value being the label
+// value.
+func K8SCronJobLabel(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.cronjob.label."+key, val)
+}
+
// K8SCronJobName returns an attribute KeyValue conforming to the
// "k8s.cronjob.name" semantic conventions. It represents the name of the
// CronJob.
@@ -8014,6 +8069,20 @@ func K8SCronJobUID(val string) attribute.KeyValue {
return K8SCronJobUIDKey.String(val)
}
+// K8SDaemonSetAnnotation returns an attribute KeyValue conforming to the
+// "k8s.daemonset.annotation" semantic conventions. It represents the annotation
+// key-value pairs placed on the DaemonSet.
+func K8SDaemonSetAnnotation(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.daemonset.annotation."+key, val)
+}
+
+// K8SDaemonSetLabel returns an attribute KeyValue conforming to the
+// "k8s.daemonset.label" semantic conventions. It represents the label key-value
+// pairs placed on the DaemonSet.
+func K8SDaemonSetLabel(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.daemonset.label."+key, val)
+}
+
// K8SDaemonSetName returns an attribute KeyValue conforming to the
// "k8s.daemonset.name" semantic conventions. It represents the name of the
// DaemonSet.
@@ -8028,6 +8097,20 @@ func K8SDaemonSetUID(val string) attribute.KeyValue {
return K8SDaemonSetUIDKey.String(val)
}
+// K8SDeploymentAnnotation returns an attribute KeyValue conforming to the
+// "k8s.deployment.annotation" semantic conventions. It represents the annotation
+// key-value pairs placed on the Deployment.
+func K8SDeploymentAnnotation(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.deployment.annotation."+key, val)
+}
+
+// K8SDeploymentLabel returns an attribute KeyValue conforming to the
+// "k8s.deployment.label" semantic conventions. It represents the label key-value
+// pairs placed on the Deployment.
+func K8SDeploymentLabel(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.deployment.label."+key, val)
+}
+
// K8SDeploymentName returns an attribute KeyValue conforming to the
// "k8s.deployment.name" semantic conventions. It represents the name of the
// Deployment.
@@ -8054,6 +8137,20 @@ func K8SHPAUID(val string) attribute.KeyValue {
return K8SHPAUIDKey.String(val)
}
+// K8SJobAnnotation returns an attribute KeyValue conforming to the
+// "k8s.job.annotation" semantic conventions. It represents the annotation
+// key-value pairs placed on the Job.
+func K8SJobAnnotation(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.job.annotation."+key, val)
+}
+
+// K8SJobLabel returns an attribute KeyValue conforming to the "k8s.job.label"
+// semantic conventions. It represents the label key-value pairs placed on the
+// Job.
+func K8SJobLabel(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.job.label."+key, val)
+}
+
// K8SJobName returns an attribute KeyValue conforming to the "k8s.job.name"
// semantic conventions. It represents the name of the Job.
func K8SJobName(val string) attribute.KeyValue {
@@ -8066,6 +8163,20 @@ func K8SJobUID(val string) attribute.KeyValue {
return K8SJobUIDKey.String(val)
}
+// K8SNamespaceAnnotation returns an attribute KeyValue conforming to the
+// "k8s.namespace.annotation" semantic conventions. It represents the annotation
+// key-value pairs placed on the Namespace.
+func K8SNamespaceAnnotation(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.namespace.annotation."+key, val)
+}
+
+// K8SNamespaceLabel returns an attribute KeyValue conforming to the
+// "k8s.namespace.label" semantic conventions. It represents the label key-value
+// pairs placed on the Namespace.
+func K8SNamespaceLabel(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.namespace.label."+key, val)
+}
+
// K8SNamespaceName returns an attribute KeyValue conforming to the
// "k8s.namespace.name" semantic conventions. It represents the name of the
// namespace that the pod is running in.
@@ -8073,6 +8184,22 @@ func K8SNamespaceName(val string) attribute.KeyValue {
return K8SNamespaceNameKey.String(val)
}
+// K8SNodeAnnotation returns an attribute KeyValue conforming to the
+// "k8s.node.annotation" semantic conventions. It represents the annotation
+// placed on the Node, the `` being the annotation name, the value being the
+// annotation value, even if the value is empty.
+func K8SNodeAnnotation(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.node.annotation."+key, val)
+}
+
+// K8SNodeLabel returns an attribute KeyValue conforming to the "k8s.node.label"
+// semantic conventions. It represents the label placed on the Node, the ``
+// being the label name, the value being the label value, even if the value is
+// empty.
+func K8SNodeLabel(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.node.label."+key, val)
+}
+
// K8SNodeName returns an attribute KeyValue conforming to the "k8s.node.name"
// semantic conventions. It represents the name of the Node.
func K8SNodeName(val string) attribute.KeyValue {
@@ -8085,6 +8212,21 @@ func K8SNodeUID(val string) attribute.KeyValue {
return K8SNodeUIDKey.String(val)
}
+// K8SPodAnnotation returns an attribute KeyValue conforming to the
+// "k8s.pod.annotation" semantic conventions. It represents the annotation placed
+// on the Pod, the `` being the annotation name, the value being the
+// annotation value.
+func K8SPodAnnotation(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.pod.annotation."+key, val)
+}
+
+// K8SPodLabel returns an attribute KeyValue conforming to the "k8s.pod.label"
+// semantic conventions. It represents the label placed on the Pod, the ``
+// being the label name, the value being the label value.
+func K8SPodLabel(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.pod.label."+key, val)
+}
+
// K8SPodName returns an attribute KeyValue conforming to the "k8s.pod.name"
// semantic conventions. It represents the name of the Pod.
func K8SPodName(val string) attribute.KeyValue {
@@ -8097,6 +8239,20 @@ func K8SPodUID(val string) attribute.KeyValue {
return K8SPodUIDKey.String(val)
}
+// K8SReplicaSetAnnotation returns an attribute KeyValue conforming to the
+// "k8s.replicaset.annotation" semantic conventions. It represents the annotation
+// key-value pairs placed on the ReplicaSet.
+func K8SReplicaSetAnnotation(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.replicaset.annotation."+key, val)
+}
+
+// K8SReplicaSetLabel returns an attribute KeyValue conforming to the
+// "k8s.replicaset.label" semantic conventions. It represents the label key-value
+// pairs placed on the ReplicaSet.
+func K8SReplicaSetLabel(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.replicaset.label."+key, val)
+}
+
// K8SReplicaSetName returns an attribute KeyValue conforming to the
// "k8s.replicaset.name" semantic conventions. It represents the name of the
// ReplicaSet.
@@ -8139,6 +8295,20 @@ func K8SResourceQuotaUID(val string) attribute.KeyValue {
return K8SResourceQuotaUIDKey.String(val)
}
+// K8SStatefulSetAnnotation returns an attribute KeyValue conforming to the
+// "k8s.statefulset.annotation" semantic conventions. It represents the
+// annotation key-value pairs placed on the StatefulSet.
+func K8SStatefulSetAnnotation(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.statefulset.annotation."+key, val)
+}
+
+// K8SStatefulSetLabel returns an attribute KeyValue conforming to the
+// "k8s.statefulset.label" semantic conventions. It represents the label
+// key-value pairs placed on the StatefulSet.
+func K8SStatefulSetLabel(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.statefulset.label."+key, val)
+}
+
// K8SStatefulSetName returns an attribute KeyValue conforming to the
// "k8s.statefulset.name" semantic conventions. It represents the name of the
// StatefulSet.
@@ -10497,6 +10667,14 @@ func ProcessCreationTime(val string) attribute.KeyValue {
return ProcessCreationTimeKey.String(val)
}
+// ProcessEnvironmentVariable returns an attribute KeyValue conforming to the
+// "process.environment_variable" semantic conventions. It represents the process
+// environment variables, being the environment variable name, the value
+// being the environment variable value.
+func ProcessEnvironmentVariable(key string, val string) attribute.KeyValue {
+ return attribute.String("process.environment_variable."+key, val)
+}
+
// ProcessExecutableBuildIDGNU returns an attribute KeyValue conforming to the
// "process.executable.build_id.gnu" semantic conventions. It represents the GNU
// build ID as found in the `.note.gnu.build-id` ELF section (hex string).
@@ -10965,6 +11143,38 @@ const (
RPCSystemKey = attribute.Key("rpc.system")
)
+// RPCConnectRPCRequestMetadata returns an attribute KeyValue conforming to the
+// "rpc.connect_rpc.request.metadata" semantic conventions. It represents the
+// connect request metadata, `` being the normalized Connect Metadata key
+// (lowercase), the value being the metadata values.
+func RPCConnectRPCRequestMetadata(key string, val ...string) attribute.KeyValue {
+ return attribute.StringSlice("rpc.connect_rpc.request.metadata."+key, val)
+}
+
+// RPCConnectRPCResponseMetadata returns an attribute KeyValue conforming to the
+// "rpc.connect_rpc.response.metadata" semantic conventions. It represents the
+// connect response metadata, `` being the normalized Connect Metadata key
+// (lowercase), the value being the metadata values.
+func RPCConnectRPCResponseMetadata(key string, val ...string) attribute.KeyValue {
+ return attribute.StringSlice("rpc.connect_rpc.response.metadata."+key, val)
+}
+
+// RPCGRPCRequestMetadata returns an attribute KeyValue conforming to the
+// "rpc.grpc.request.metadata" semantic conventions. It represents the gRPC
+// request metadata, `` being the normalized gRPC Metadata key (lowercase),
+// the value being the metadata values.
+func RPCGRPCRequestMetadata(key string, val ...string) attribute.KeyValue {
+ return attribute.StringSlice("rpc.grpc.request.metadata."+key, val)
+}
+
+// RPCGRPCResponseMetadata returns an attribute KeyValue conforming to the
+// "rpc.grpc.response.metadata" semantic conventions. It represents the gRPC
+// response metadata, `` being the normalized gRPC Metadata key (lowercase),
+// the value being the metadata values.
+func RPCGRPCResponseMetadata(key string, val ...string) attribute.KeyValue {
+ return attribute.StringSlice("rpc.grpc.response.metadata."+key, val)
+}
+
// RPCJSONRPCErrorCode returns an attribute KeyValue conforming to the
// "rpc.jsonrpc.error_code" semantic conventions. It represents the `error.code`
// property of response if it is an error response.
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.34.0/error_type.go b/vendor/go.opentelemetry.io/otel/semconv/v1.34.0/error_type.go
new file mode 100644
index 0000000000..19bf022465
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.34.0/error_type.go
@@ -0,0 +1,31 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.34.0"
+
+import (
+ "fmt"
+ "reflect"
+
+ "go.opentelemetry.io/otel/attribute"
+)
+
+// ErrorType returns an [attribute.KeyValue] identifying the error type of err.
+func ErrorType(err error) attribute.KeyValue {
+ if err == nil {
+ return ErrorTypeOther
+ }
+ t := reflect.TypeOf(err)
+ var value string
+ if t.PkgPath() == "" && t.Name() == "" {
+ // Likely a builtin type.
+ value = t.String()
+ } else {
+ value = fmt.Sprintf("%s.%s", t.PkgPath(), t.Name())
+ }
+
+ if value == "" {
+ return ErrorTypeOther
+ }
+ return ErrorTypeKey.String(value)
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/MIGRATION.md b/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/MIGRATION.md
new file mode 100644
index 0000000000..2480547895
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/MIGRATION.md
@@ -0,0 +1,41 @@
+
+# Migration from v1.36.0 to v1.37.0
+
+The `go.opentelemetry.io/otel/semconv/v1.37.0` package should be a drop-in replacement for `go.opentelemetry.io/otel/semconv/v1.36.0` with the following exceptions.
+
+## Removed
+
+The following declarations have been removed.
+Refer to the [OpenTelemetry Semantic Conventions documentation] for deprecation instructions.
+
+If the type is not listed in the documentation as deprecated, it has been removed in this version due to lack of applicability or use.
+If you use any of these non-deprecated declarations in your Go application, please [open an issue] describing your use-case.
+
+- `ContainerRuntime`
+- `ContainerRuntimeKey`
+- `GenAIOpenAIRequestServiceTierAuto`
+- `GenAIOpenAIRequestServiceTierDefault`
+- `GenAIOpenAIRequestServiceTierKey`
+- `GenAIOpenAIResponseServiceTier`
+- `GenAIOpenAIResponseServiceTierKey`
+- `GenAIOpenAIResponseSystemFingerprint`
+- `GenAIOpenAIResponseSystemFingerprintKey`
+- `GenAISystemAWSBedrock`
+- `GenAISystemAnthropic`
+- `GenAISystemAzureAIInference`
+- `GenAISystemAzureAIOpenAI`
+- `GenAISystemCohere`
+- `GenAISystemDeepseek`
+- `GenAISystemGCPGemini`
+- `GenAISystemGCPGenAI`
+- `GenAISystemGCPVertexAI`
+- `GenAISystemGroq`
+- `GenAISystemIBMWatsonxAI`
+- `GenAISystemKey`
+- `GenAISystemMistralAI`
+- `GenAISystemOpenAI`
+- `GenAISystemPerplexity`
+- `GenAISystemXai`
+
+[OpenTelemetry Semantic Conventions documentation]: https://github.com/open-telemetry/semantic-conventions
+[open an issue]: https://github.com/open-telemetry/opentelemetry-go/issues/new?template=Blank+issue
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/README.md b/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/README.md
new file mode 100644
index 0000000000..d795247f32
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/README.md
@@ -0,0 +1,3 @@
+# Semconv v1.37.0
+
+[](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.37.0)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/attribute_group.go b/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/attribute_group.go
new file mode 100644
index 0000000000..b6b27498f2
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/attribute_group.go
@@ -0,0 +1,15193 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated from semantic convention specification. DO NOT EDIT.
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.37.0"
+
+import "go.opentelemetry.io/otel/attribute"
+
+// Namespace: android
+const (
+ // AndroidAppStateKey is the attribute Key conforming to the "android.app.state"
+ // semantic conventions. It represents the this attribute represents the state
+ // of the application.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "created"
+ // Note: The Android lifecycle states are defined in
+ // [Activity lifecycle callbacks], and from which the `OS identifiers` are
+ // derived.
+ //
+ // [Activity lifecycle callbacks]: https://developer.android.com/guide/components/activities/activity-lifecycle#lc
+ AndroidAppStateKey = attribute.Key("android.app.state")
+
+ // AndroidOSAPILevelKey is the attribute Key conforming to the
+ // "android.os.api_level" semantic conventions. It represents the uniquely
+ // identifies the framework API revision offered by a version (`os.version`) of
+ // the android operating system. More information can be found in the
+ // [Android API levels documentation].
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "33", "32"
+ //
+ // [Android API levels documentation]: https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels
+ AndroidOSAPILevelKey = attribute.Key("android.os.api_level")
+)
+
+// AndroidOSAPILevel returns an attribute KeyValue conforming to the
+// "android.os.api_level" semantic conventions. It represents the uniquely
+// identifies the framework API revision offered by a version (`os.version`) of
+// the android operating system. More information can be found in the
+// [Android API levels documentation].
+//
+// [Android API levels documentation]: https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels
+func AndroidOSAPILevel(val string) attribute.KeyValue {
+ return AndroidOSAPILevelKey.String(val)
+}
+
+// Enum values for android.app.state
+var (
+ // Any time before Activity.onResume() or, if the app has no Activity,
+ // Context.startService() has been called in the app for the first time.
+ //
+ // Stability: development
+ AndroidAppStateCreated = AndroidAppStateKey.String("created")
+ // Any time after Activity.onPause() or, if the app has no Activity,
+ // Context.stopService() has been called when the app was in the foreground
+ // state.
+ //
+ // Stability: development
+ AndroidAppStateBackground = AndroidAppStateKey.String("background")
+ // Any time after Activity.onResume() or, if the app has no Activity,
+ // Context.startService() has been called when the app was in either the created
+ // or background states.
+ //
+ // Stability: development
+ AndroidAppStateForeground = AndroidAppStateKey.String("foreground")
+)
+
+// Namespace: app
+const (
+ // AppBuildIDKey is the attribute Key conforming to the "app.build_id" semantic
+ // conventions. It represents the unique identifier for a particular build or
+ // compilation of the application.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "6cff0a7e-cefc-4668-96f5-1273d8b334d0",
+ // "9f2b833506aa6973a92fde9733e6271f", "my-app-1.0.0-code-123"
+ AppBuildIDKey = attribute.Key("app.build_id")
+
+ // AppInstallationIDKey is the attribute Key conforming to the
+ // "app.installation.id" semantic conventions. It represents a unique identifier
+ // representing the installation of an application on a specific device.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "2ab2916d-a51f-4ac8-80ee-45ac31a28092"
+ // Note: Its value SHOULD persist across launches of the same application
+ // installation, including through application upgrades.
+ // It SHOULD change if the application is uninstalled or if all applications of
+ // the vendor are uninstalled.
+ // Additionally, users might be able to reset this value (e.g. by clearing
+ // application data).
+ // If an app is installed multiple times on the same device (e.g. in different
+ // accounts on Android), each `app.installation.id` SHOULD have a different
+ // value.
+ // If multiple OpenTelemetry SDKs are used within the same application, they
+ // SHOULD use the same value for `app.installation.id`.
+ // Hardware IDs (e.g. serial number, IMEI, MAC address) MUST NOT be used as the
+ // `app.installation.id`.
+ //
+ // For iOS, this value SHOULD be equal to the [vendor identifier].
+ //
+ // For Android, examples of `app.installation.id` implementations include:
+ //
+ // - [Firebase Installation ID].
+ // - A globally unique UUID which is persisted across sessions in your
+ // application.
+ // - [App set ID].
+ // - [`Settings.getString(Settings.Secure.ANDROID_ID)`].
+ //
+ // More information about Android identifier best practices can be found in the
+ // [Android user data IDs guide].
+ //
+ // [vendor identifier]: https://developer.apple.com/documentation/uikit/uidevice/identifierforvendor
+ // [Firebase Installation ID]: https://firebase.google.com/docs/projects/manage-installations
+ // [App set ID]: https://developer.android.com/identity/app-set-id
+ // [`Settings.getString(Settings.Secure.ANDROID_ID)`]: https://developer.android.com/reference/android/provider/Settings.Secure#ANDROID_ID
+ // [Android user data IDs guide]: https://developer.android.com/training/articles/user-data-ids
+ AppInstallationIDKey = attribute.Key("app.installation.id")
+
+ // AppJankFrameCountKey is the attribute Key conforming to the
+ // "app.jank.frame_count" semantic conventions. It represents a number of frame
+ // renders that experienced jank.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 9, 42
+ // Note: Depending on platform limitations, the value provided MAY be
+ // approximation.
+ AppJankFrameCountKey = attribute.Key("app.jank.frame_count")
+
+ // AppJankPeriodKey is the attribute Key conforming to the "app.jank.period"
+ // semantic conventions. It represents the time period, in seconds, for which
+ // this jank is being reported.
+ //
+ // Type: double
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 1.0, 5.0, 10.24
+ AppJankPeriodKey = attribute.Key("app.jank.period")
+
+ // AppJankThresholdKey is the attribute Key conforming to the
+ // "app.jank.threshold" semantic conventions. It represents the minimum
+ // rendering threshold for this jank, in seconds.
+ //
+ // Type: double
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 0.016, 0.7, 1.024
+ AppJankThresholdKey = attribute.Key("app.jank.threshold")
+
+ // AppScreenCoordinateXKey is the attribute Key conforming to the
+ // "app.screen.coordinate.x" semantic conventions. It represents the x
+ // (horizontal) coordinate of a screen coordinate, in screen pixels.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 0, 131
+ AppScreenCoordinateXKey = attribute.Key("app.screen.coordinate.x")
+
+ // AppScreenCoordinateYKey is the attribute Key conforming to the
+ // "app.screen.coordinate.y" semantic conventions. It represents the y
+ // (vertical) component of a screen coordinate, in screen pixels.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 12, 99
+ AppScreenCoordinateYKey = attribute.Key("app.screen.coordinate.y")
+
+ // AppWidgetIDKey is the attribute Key conforming to the "app.widget.id"
+ // semantic conventions. It represents an identifier that uniquely
+ // differentiates this widget from other widgets in the same application.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "f9bc787d-ff05-48ad-90e1-fca1d46130b3", "submit_order_1829"
+ // Note: A widget is an application component, typically an on-screen visual GUI
+ // element.
+ AppWidgetIDKey = attribute.Key("app.widget.id")
+
+ // AppWidgetNameKey is the attribute Key conforming to the "app.widget.name"
+ // semantic conventions. It represents the name of an application widget.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "submit", "attack", "Clear Cart"
+ // Note: A widget is an application component, typically an on-screen visual GUI
+ // element.
+ AppWidgetNameKey = attribute.Key("app.widget.name")
+)
+
+// AppBuildID returns an attribute KeyValue conforming to the "app.build_id"
+// semantic conventions. It represents the unique identifier for a particular
+// build or compilation of the application.
+func AppBuildID(val string) attribute.KeyValue {
+ return AppBuildIDKey.String(val)
+}
+
+// AppInstallationID returns an attribute KeyValue conforming to the
+// "app.installation.id" semantic conventions. It represents a unique identifier
+// representing the installation of an application on a specific device.
+func AppInstallationID(val string) attribute.KeyValue {
+ return AppInstallationIDKey.String(val)
+}
+
+// AppJankFrameCount returns an attribute KeyValue conforming to the
+// "app.jank.frame_count" semantic conventions. It represents a number of frame
+// renders that experienced jank.
+func AppJankFrameCount(val int) attribute.KeyValue {
+ return AppJankFrameCountKey.Int(val)
+}
+
+// AppJankPeriod returns an attribute KeyValue conforming to the
+// "app.jank.period" semantic conventions. It represents the time period, in
+// seconds, for which this jank is being reported.
+func AppJankPeriod(val float64) attribute.KeyValue {
+ return AppJankPeriodKey.Float64(val)
+}
+
+// AppJankThreshold returns an attribute KeyValue conforming to the
+// "app.jank.threshold" semantic conventions. It represents the minimum rendering
+// threshold for this jank, in seconds.
+func AppJankThreshold(val float64) attribute.KeyValue {
+ return AppJankThresholdKey.Float64(val)
+}
+
+// AppScreenCoordinateX returns an attribute KeyValue conforming to the
+// "app.screen.coordinate.x" semantic conventions. It represents the x
+// (horizontal) coordinate of a screen coordinate, in screen pixels.
+func AppScreenCoordinateX(val int) attribute.KeyValue {
+ return AppScreenCoordinateXKey.Int(val)
+}
+
+// AppScreenCoordinateY returns an attribute KeyValue conforming to the
+// "app.screen.coordinate.y" semantic conventions. It represents the y (vertical)
+// component of a screen coordinate, in screen pixels.
+func AppScreenCoordinateY(val int) attribute.KeyValue {
+ return AppScreenCoordinateYKey.Int(val)
+}
+
+// AppWidgetID returns an attribute KeyValue conforming to the "app.widget.id"
+// semantic conventions. It represents an identifier that uniquely differentiates
+// this widget from other widgets in the same application.
+func AppWidgetID(val string) attribute.KeyValue {
+ return AppWidgetIDKey.String(val)
+}
+
+// AppWidgetName returns an attribute KeyValue conforming to the
+// "app.widget.name" semantic conventions. It represents the name of an
+// application widget.
+func AppWidgetName(val string) attribute.KeyValue {
+ return AppWidgetNameKey.String(val)
+}
+
+// Namespace: artifact
+const (
+ // ArtifactAttestationFilenameKey is the attribute Key conforming to the
+ // "artifact.attestation.filename" semantic conventions. It represents the
+ // provenance filename of the built attestation which directly relates to the
+ // build artifact filename. This filename SHOULD accompany the artifact at
+ // publish time. See the [SLSA Relationship] specification for more information.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "golang-binary-amd64-v0.1.0.attestation",
+ // "docker-image-amd64-v0.1.0.intoto.json1", "release-1.tar.gz.attestation",
+ // "file-name-package.tar.gz.intoto.json1"
+ //
+ // [SLSA Relationship]: https://slsa.dev/spec/v1.0/distributing-provenance#relationship-between-artifacts-and-attestations
+ ArtifactAttestationFilenameKey = attribute.Key("artifact.attestation.filename")
+
+ // ArtifactAttestationHashKey is the attribute Key conforming to the
+ // "artifact.attestation.hash" semantic conventions. It represents the full
+ // [hash value (see glossary)], of the built attestation. Some envelopes in the
+ // [software attestation space] also refer to this as the **digest**.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "1b31dfcd5b7f9267bf2ff47651df1cfb9147b9e4df1f335accf65b4cda498408"
+ //
+ // [hash value (see glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf
+ // [software attestation space]: https://github.com/in-toto/attestation/tree/main/spec
+ ArtifactAttestationHashKey = attribute.Key("artifact.attestation.hash")
+
+ // ArtifactAttestationIDKey is the attribute Key conforming to the
+ // "artifact.attestation.id" semantic conventions. It represents the id of the
+ // build [software attestation].
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "123"
+ //
+ // [software attestation]: https://slsa.dev/attestation-model
+ ArtifactAttestationIDKey = attribute.Key("artifact.attestation.id")
+
+ // ArtifactFilenameKey is the attribute Key conforming to the
+ // "artifact.filename" semantic conventions. It represents the human readable
+ // file name of the artifact, typically generated during build and release
+ // processes. Often includes the package name and version in the file name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "golang-binary-amd64-v0.1.0", "docker-image-amd64-v0.1.0",
+ // "release-1.tar.gz", "file-name-package.tar.gz"
+ // Note: This file name can also act as the [Package Name]
+ // in cases where the package ecosystem maps accordingly.
+ // Additionally, the artifact [can be published]
+ // for others, but that is not a guarantee.
+ //
+ // [Package Name]: https://slsa.dev/spec/v1.0/terminology#package-model
+ // [can be published]: https://slsa.dev/spec/v1.0/terminology#software-supply-chain
+ ArtifactFilenameKey = attribute.Key("artifact.filename")
+
+ // ArtifactHashKey is the attribute Key conforming to the "artifact.hash"
+ // semantic conventions. It represents the full [hash value (see glossary)],
+ // often found in checksum.txt on a release of the artifact and used to verify
+ // package integrity.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "9ff4c52759e2c4ac70b7d517bc7fcdc1cda631ca0045271ddd1b192544f8a3e9"
+ // Note: The specific algorithm used to create the cryptographic hash value is
+ // not defined. In situations where an artifact has multiple
+ // cryptographic hashes, it is up to the implementer to choose which
+ // hash value to set here; this should be the most secure hash algorithm
+ // that is suitable for the situation and consistent with the
+ // corresponding attestation. The implementer can then provide the other
+ // hash values through an additional set of attribute extensions as they
+ // deem necessary.
+ //
+ // [hash value (see glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf
+ ArtifactHashKey = attribute.Key("artifact.hash")
+
+ // ArtifactPurlKey is the attribute Key conforming to the "artifact.purl"
+ // semantic conventions. It represents the [Package URL] of the
+ // [package artifact] provides a standard way to identify and locate the
+ // packaged artifact.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "pkg:github/package-url/purl-spec@1209109710924",
+ // "pkg:npm/foo@12.12.3"
+ //
+ // [Package URL]: https://github.com/package-url/purl-spec
+ // [package artifact]: https://slsa.dev/spec/v1.0/terminology#package-model
+ ArtifactPurlKey = attribute.Key("artifact.purl")
+
+ // ArtifactVersionKey is the attribute Key conforming to the "artifact.version"
+ // semantic conventions. It represents the version of the artifact.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "v0.1.0", "1.2.1", "122691-build"
+ ArtifactVersionKey = attribute.Key("artifact.version")
+)
+
+// ArtifactAttestationFilename returns an attribute KeyValue conforming to the
+// "artifact.attestation.filename" semantic conventions. It represents the
+// provenance filename of the built attestation which directly relates to the
+// build artifact filename. This filename SHOULD accompany the artifact at
+// publish time. See the [SLSA Relationship] specification for more information.
+//
+// [SLSA Relationship]: https://slsa.dev/spec/v1.0/distributing-provenance#relationship-between-artifacts-and-attestations
+func ArtifactAttestationFilename(val string) attribute.KeyValue {
+ return ArtifactAttestationFilenameKey.String(val)
+}
+
+// ArtifactAttestationHash returns an attribute KeyValue conforming to the
+// "artifact.attestation.hash" semantic conventions. It represents the full
+// [hash value (see glossary)], of the built attestation. Some envelopes in the
+// [software attestation space] also refer to this as the **digest**.
+//
+// [hash value (see glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf
+// [software attestation space]: https://github.com/in-toto/attestation/tree/main/spec
+func ArtifactAttestationHash(val string) attribute.KeyValue {
+ return ArtifactAttestationHashKey.String(val)
+}
+
+// ArtifactAttestationID returns an attribute KeyValue conforming to the
+// "artifact.attestation.id" semantic conventions. It represents the id of the
+// build [software attestation].
+//
+// [software attestation]: https://slsa.dev/attestation-model
+func ArtifactAttestationID(val string) attribute.KeyValue {
+ return ArtifactAttestationIDKey.String(val)
+}
+
+// ArtifactFilename returns an attribute KeyValue conforming to the
+// "artifact.filename" semantic conventions. It represents the human readable
+// file name of the artifact, typically generated during build and release
+// processes. Often includes the package name and version in the file name.
+func ArtifactFilename(val string) attribute.KeyValue {
+ return ArtifactFilenameKey.String(val)
+}
+
+// ArtifactHash returns an attribute KeyValue conforming to the "artifact.hash"
+// semantic conventions. It represents the full [hash value (see glossary)],
+// often found in checksum.txt on a release of the artifact and used to verify
+// package integrity.
+//
+// [hash value (see glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf
+func ArtifactHash(val string) attribute.KeyValue {
+ return ArtifactHashKey.String(val)
+}
+
+// ArtifactPurl returns an attribute KeyValue conforming to the "artifact.purl"
+// semantic conventions. It represents the [Package URL] of the
+// [package artifact] provides a standard way to identify and locate the packaged
+// artifact.
+//
+// [Package URL]: https://github.com/package-url/purl-spec
+// [package artifact]: https://slsa.dev/spec/v1.0/terminology#package-model
+func ArtifactPurl(val string) attribute.KeyValue {
+ return ArtifactPurlKey.String(val)
+}
+
+// ArtifactVersion returns an attribute KeyValue conforming to the
+// "artifact.version" semantic conventions. It represents the version of the
+// artifact.
+func ArtifactVersion(val string) attribute.KeyValue {
+ return ArtifactVersionKey.String(val)
+}
+
+// Namespace: aws
+const (
+ // AWSBedrockGuardrailIDKey is the attribute Key conforming to the
+ // "aws.bedrock.guardrail.id" semantic conventions. It represents the unique
+ // identifier of the AWS Bedrock Guardrail. A [guardrail] helps safeguard and
+ // prevent unwanted behavior from model responses or user messages.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "sgi5gkybzqak"
+ //
+ // [guardrail]: https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html
+ AWSBedrockGuardrailIDKey = attribute.Key("aws.bedrock.guardrail.id")
+
+ // AWSBedrockKnowledgeBaseIDKey is the attribute Key conforming to the
+ // "aws.bedrock.knowledge_base.id" semantic conventions. It represents the
+ // unique identifier of the AWS Bedrock Knowledge base. A [knowledge base] is a
+ // bank of information that can be queried by models to generate more relevant
+ // responses and augment prompts.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "XFWUPB9PAW"
+ //
+ // [knowledge base]: https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html
+ AWSBedrockKnowledgeBaseIDKey = attribute.Key("aws.bedrock.knowledge_base.id")
+
+ // AWSDynamoDBAttributeDefinitionsKey is the attribute Key conforming to the
+ // "aws.dynamodb.attribute_definitions" semantic conventions. It represents the
+ // JSON-serialized value of each item in the `AttributeDefinitions` request
+ // field.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "{ "AttributeName": "string", "AttributeType": "string" }"
+ AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions")
+
+ // AWSDynamoDBAttributesToGetKey is the attribute Key conforming to the
+ // "aws.dynamodb.attributes_to_get" semantic conventions. It represents the
+ // value of the `AttributesToGet` request parameter.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "lives", "id"
+ AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get")
+
+ // AWSDynamoDBConsistentReadKey is the attribute Key conforming to the
+ // "aws.dynamodb.consistent_read" semantic conventions. It represents the value
+ // of the `ConsistentRead` request parameter.
+ //
+ // Type: boolean
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read")
+
+ // AWSDynamoDBConsumedCapacityKey is the attribute Key conforming to the
+ // "aws.dynamodb.consumed_capacity" semantic conventions. It represents the
+ // JSON-serialized value of each item in the `ConsumedCapacity` response field.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "{ "CapacityUnits": number, "GlobalSecondaryIndexes": { "string" :
+ // { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits":
+ // number } }, "LocalSecondaryIndexes": { "string" : { "CapacityUnits": number,
+ // "ReadCapacityUnits": number, "WriteCapacityUnits": number } },
+ // "ReadCapacityUnits": number, "Table": { "CapacityUnits": number,
+ // "ReadCapacityUnits": number, "WriteCapacityUnits": number }, "TableName":
+ // "string", "WriteCapacityUnits": number }"
+ AWSDynamoDBConsumedCapacityKey = attribute.Key("aws.dynamodb.consumed_capacity")
+
+ // AWSDynamoDBCountKey is the attribute Key conforming to the
+ // "aws.dynamodb.count" semantic conventions. It represents the value of the
+ // `Count` response parameter.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 10
+ AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count")
+
+ // AWSDynamoDBExclusiveStartTableKey is the attribute Key conforming to the
+ // "aws.dynamodb.exclusive_start_table" semantic conventions. It represents the
+ // value of the `ExclusiveStartTableName` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Users", "CatsTable"
+ AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table")
+
+ // AWSDynamoDBGlobalSecondaryIndexUpdatesKey is the attribute Key conforming to
+ // the "aws.dynamodb.global_secondary_index_updates" semantic conventions. It
+ // represents the JSON-serialized value of each item in the
+ // `GlobalSecondaryIndexUpdates` request field.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "{ "Create": { "IndexName": "string", "KeySchema": [ {
+ // "AttributeName": "string", "KeyType": "string" } ], "Projection": {
+ // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" },
+ // "ProvisionedThroughput": { "ReadCapacityUnits": number, "WriteCapacityUnits":
+ // number } }"
+ AWSDynamoDBGlobalSecondaryIndexUpdatesKey = attribute.Key("aws.dynamodb.global_secondary_index_updates")
+
+ // AWSDynamoDBGlobalSecondaryIndexesKey is the attribute Key conforming to the
+ // "aws.dynamodb.global_secondary_indexes" semantic conventions. It represents
+ // the JSON-serialized value of each item of the `GlobalSecondaryIndexes`
+ // request field.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "{ "IndexName": "string", "KeySchema": [ { "AttributeName":
+ // "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [
+ // "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": {
+ // "ReadCapacityUnits": number, "WriteCapacityUnits": number } }"
+ AWSDynamoDBGlobalSecondaryIndexesKey = attribute.Key("aws.dynamodb.global_secondary_indexes")
+
+ // AWSDynamoDBIndexNameKey is the attribute Key conforming to the
+ // "aws.dynamodb.index_name" semantic conventions. It represents the value of
+ // the `IndexName` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "name_to_group"
+ AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name")
+
+ // AWSDynamoDBItemCollectionMetricsKey is the attribute Key conforming to the
+ // "aws.dynamodb.item_collection_metrics" semantic conventions. It represents
+ // the JSON-serialized value of the `ItemCollectionMetrics` response field.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "{ "string" : [ { "ItemCollectionKey": { "string" : { "B": blob,
+ // "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { "string" :
+ // "AttributeValue" }, "N": "string", "NS": [ "string" ], "NULL": boolean, "S":
+ // "string", "SS": [ "string" ] } }, "SizeEstimateRangeGB": [ number ] } ] }"
+ AWSDynamoDBItemCollectionMetricsKey = attribute.Key("aws.dynamodb.item_collection_metrics")
+
+ // AWSDynamoDBLimitKey is the attribute Key conforming to the
+ // "aws.dynamodb.limit" semantic conventions. It represents the value of the
+ // `Limit` request parameter.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 10
+ AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit")
+
+ // AWSDynamoDBLocalSecondaryIndexesKey is the attribute Key conforming to the
+ // "aws.dynamodb.local_secondary_indexes" semantic conventions. It represents
+ // the JSON-serialized value of each item of the `LocalSecondaryIndexes` request
+ // field.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "{ "IndexArn": "string", "IndexName": "string", "IndexSizeBytes":
+ // number, "ItemCount": number, "KeySchema": [ { "AttributeName": "string",
+ // "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ],
+ // "ProjectionType": "string" } }"
+ AWSDynamoDBLocalSecondaryIndexesKey = attribute.Key("aws.dynamodb.local_secondary_indexes")
+
+ // AWSDynamoDBProjectionKey is the attribute Key conforming to the
+ // "aws.dynamodb.projection" semantic conventions. It represents the value of
+ // the `ProjectionExpression` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Title", "Title, Price, Color", "Title, Description, RelatedItems,
+ // ProductReviews"
+ AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection")
+
+ // AWSDynamoDBProvisionedReadCapacityKey is the attribute Key conforming to the
+ // "aws.dynamodb.provisioned_read_capacity" semantic conventions. It represents
+ // the value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter.
+ //
+ // Type: double
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 1.0, 2.0
+ AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity")
+
+ // AWSDynamoDBProvisionedWriteCapacityKey is the attribute Key conforming to the
+ // "aws.dynamodb.provisioned_write_capacity" semantic conventions. It represents
+ // the value of the `ProvisionedThroughput.WriteCapacityUnits` request
+ // parameter.
+ //
+ // Type: double
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 1.0, 2.0
+ AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity")
+
+ // AWSDynamoDBScanForwardKey is the attribute Key conforming to the
+ // "aws.dynamodb.scan_forward" semantic conventions. It represents the value of
+ // the `ScanIndexForward` request parameter.
+ //
+ // Type: boolean
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward")
+
+ // AWSDynamoDBScannedCountKey is the attribute Key conforming to the
+ // "aws.dynamodb.scanned_count" semantic conventions. It represents the value of
+ // the `ScannedCount` response parameter.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 50
+ AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count")
+
+ // AWSDynamoDBSegmentKey is the attribute Key conforming to the
+ // "aws.dynamodb.segment" semantic conventions. It represents the value of the
+ // `Segment` request parameter.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 10
+ AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment")
+
+ // AWSDynamoDBSelectKey is the attribute Key conforming to the
+ // "aws.dynamodb.select" semantic conventions. It represents the value of the
+ // `Select` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "ALL_ATTRIBUTES", "COUNT"
+ AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select")
+
+ // AWSDynamoDBTableCountKey is the attribute Key conforming to the
+ // "aws.dynamodb.table_count" semantic conventions. It represents the number of
+ // items in the `TableNames` response parameter.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 20
+ AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count")
+
+ // AWSDynamoDBTableNamesKey is the attribute Key conforming to the
+ // "aws.dynamodb.table_names" semantic conventions. It represents the keys in
+ // the `RequestItems` object field.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Users", "Cats"
+ AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names")
+
+ // AWSDynamoDBTotalSegmentsKey is the attribute Key conforming to the
+ // "aws.dynamodb.total_segments" semantic conventions. It represents the value
+ // of the `TotalSegments` request parameter.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 100
+ AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments")
+
+ // AWSECSClusterARNKey is the attribute Key conforming to the
+ // "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an
+ // [ECS cluster].
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster"
+ //
+ // [ECS cluster]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html
+ AWSECSClusterARNKey = attribute.Key("aws.ecs.cluster.arn")
+
+ // AWSECSContainerARNKey is the attribute Key conforming to the
+ // "aws.ecs.container.arn" semantic conventions. It represents the Amazon
+ // Resource Name (ARN) of an [ECS container instance].
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // "arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9"
+ //
+ // [ECS container instance]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html
+ AWSECSContainerARNKey = attribute.Key("aws.ecs.container.arn")
+
+ // AWSECSLaunchtypeKey is the attribute Key conforming to the
+ // "aws.ecs.launchtype" semantic conventions. It represents the [launch type]
+ // for an ECS task.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ //
+ // [launch type]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html
+ AWSECSLaunchtypeKey = attribute.Key("aws.ecs.launchtype")
+
+ // AWSECSTaskARNKey is the attribute Key conforming to the "aws.ecs.task.arn"
+ // semantic conventions. It represents the ARN of a running [ECS task].
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // "arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b",
+ // "arn:aws:ecs:us-west-1:123456789123:task/my-cluster/task-id/23ebb8ac-c18f-46c6-8bbe-d55d0e37cfbd"
+ //
+ // [ECS task]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids
+ AWSECSTaskARNKey = attribute.Key("aws.ecs.task.arn")
+
+ // AWSECSTaskFamilyKey is the attribute Key conforming to the
+ // "aws.ecs.task.family" semantic conventions. It represents the family name of
+ // the [ECS task definition] used to create the ECS task.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "opentelemetry-family"
+ //
+ // [ECS task definition]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html
+ AWSECSTaskFamilyKey = attribute.Key("aws.ecs.task.family")
+
+ // AWSECSTaskIDKey is the attribute Key conforming to the "aws.ecs.task.id"
+ // semantic conventions. It represents the ID of a running ECS task. The ID MUST
+ // be extracted from `task.arn`.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "10838bed-421f-43ef-870a-f43feacbbb5b",
+ // "23ebb8ac-c18f-46c6-8bbe-d55d0e37cfbd"
+ AWSECSTaskIDKey = attribute.Key("aws.ecs.task.id")
+
+ // AWSECSTaskRevisionKey is the attribute Key conforming to the
+ // "aws.ecs.task.revision" semantic conventions. It represents the revision for
+ // the task definition used to create the ECS task.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "8", "26"
+ AWSECSTaskRevisionKey = attribute.Key("aws.ecs.task.revision")
+
+ // AWSEKSClusterARNKey is the attribute Key conforming to the
+ // "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an EKS
+ // cluster.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster"
+ AWSEKSClusterARNKey = attribute.Key("aws.eks.cluster.arn")
+
+ // AWSExtendedRequestIDKey is the attribute Key conforming to the
+ // "aws.extended_request_id" semantic conventions. It represents the AWS
+ // extended request ID as returned in the response header `x-amz-id-2`.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // "wzHcyEWfmOGDIE5QOhTAqFDoDWP3y8IUvpNINCwL9N4TEHbUw0/gZJ+VZTmCNCWR7fezEN3eCiQ="
+ AWSExtendedRequestIDKey = attribute.Key("aws.extended_request_id")
+
+ // AWSKinesisStreamNameKey is the attribute Key conforming to the
+ // "aws.kinesis.stream_name" semantic conventions. It represents the name of the
+ // AWS Kinesis [stream] the request refers to. Corresponds to the
+ // `--stream-name` parameter of the Kinesis [describe-stream] operation.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "some-stream-name"
+ //
+ // [stream]: https://docs.aws.amazon.com/streams/latest/dev/introduction.html
+ // [describe-stream]: https://docs.aws.amazon.com/cli/latest/reference/kinesis/describe-stream.html
+ AWSKinesisStreamNameKey = attribute.Key("aws.kinesis.stream_name")
+
+ // AWSLambdaInvokedARNKey is the attribute Key conforming to the
+ // "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked
+ // ARN as provided on the `Context` passed to the function (
+ // `Lambda-Runtime-Invoked-Function-Arn` header on the
+ // `/runtime/invocation/next` applicable).
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "arn:aws:lambda:us-east-1:123456:function:myfunction:myalias"
+ // Note: This may be different from `cloud.resource_id` if an alias is involved.
+ AWSLambdaInvokedARNKey = attribute.Key("aws.lambda.invoked_arn")
+
+ // AWSLambdaResourceMappingIDKey is the attribute Key conforming to the
+ // "aws.lambda.resource_mapping.id" semantic conventions. It represents the UUID
+ // of the [AWS Lambda EvenSource Mapping]. An event source is mapped to a lambda
+ // function. It's contents are read by Lambda and used to trigger a function.
+ // This isn't available in the lambda execution context or the lambda runtime
+ // environtment. This is going to be populated by the AWS SDK for each language
+ // when that UUID is present. Some of these operations are
+ // Create/Delete/Get/List/Update EventSourceMapping.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "587ad24b-03b9-4413-8202-bbd56b36e5b7"
+ //
+ // [AWS Lambda EvenSource Mapping]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html
+ AWSLambdaResourceMappingIDKey = attribute.Key("aws.lambda.resource_mapping.id")
+
+ // AWSLogGroupARNsKey is the attribute Key conforming to the
+ // "aws.log.group.arns" semantic conventions. It represents the Amazon Resource
+ // Name(s) (ARN) of the AWS log group(s).
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*"
+ // Note: See the [log group ARN format documentation].
+ //
+ // [log group ARN format documentation]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format
+ AWSLogGroupARNsKey = attribute.Key("aws.log.group.arns")
+
+ // AWSLogGroupNamesKey is the attribute Key conforming to the
+ // "aws.log.group.names" semantic conventions. It represents the name(s) of the
+ // AWS log group(s) an application is writing to.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "/aws/lambda/my-function", "opentelemetry-service"
+ // Note: Multiple log groups must be supported for cases like multi-container
+ // applications, where a single application has sidecar containers, and each
+ // write to their own log group.
+ AWSLogGroupNamesKey = attribute.Key("aws.log.group.names")
+
+ // AWSLogStreamARNsKey is the attribute Key conforming to the
+ // "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of the
+ // AWS log stream(s).
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // "arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b"
+ // Note: See the [log stream ARN format documentation]. One log group can
+ // contain several log streams, so these ARNs necessarily identify both a log
+ // group and a log stream.
+ //
+ // [log stream ARN format documentation]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format
+ AWSLogStreamARNsKey = attribute.Key("aws.log.stream.arns")
+
+ // AWSLogStreamNamesKey is the attribute Key conforming to the
+ // "aws.log.stream.names" semantic conventions. It represents the name(s) of the
+ // AWS log stream(s) an application is writing to.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "logs/main/10838bed-421f-43ef-870a-f43feacbbb5b"
+ AWSLogStreamNamesKey = attribute.Key("aws.log.stream.names")
+
+ // AWSRequestIDKey is the attribute Key conforming to the "aws.request_id"
+ // semantic conventions. It represents the AWS request ID as returned in the
+ // response headers `x-amzn-requestid`, `x-amzn-request-id` or
+ // `x-amz-request-id`.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "79b9da39-b7ae-508a-a6bc-864b2829c622", "C9ER4AJX75574TDJ"
+ AWSRequestIDKey = attribute.Key("aws.request_id")
+
+ // AWSS3BucketKey is the attribute Key conforming to the "aws.s3.bucket"
+ // semantic conventions. It represents the S3 bucket name the request refers to.
+ // Corresponds to the `--bucket` parameter of the [S3 API] operations.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "some-bucket-name"
+ // Note: The `bucket` attribute is applicable to all S3 operations that
+ // reference a bucket, i.e. that require the bucket name as a mandatory
+ // parameter.
+ // This applies to almost all S3 operations except `list-buckets`.
+ //
+ // [S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html
+ AWSS3BucketKey = attribute.Key("aws.s3.bucket")
+
+ // AWSS3CopySourceKey is the attribute Key conforming to the
+ // "aws.s3.copy_source" semantic conventions. It represents the source object
+ // (in the form `bucket`/`key`) for the copy operation.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "someFile.yml"
+ // Note: The `copy_source` attribute applies to S3 copy operations and
+ // corresponds to the `--copy-source` parameter
+ // of the [copy-object operation within the S3 API].
+ // This applies in particular to the following operations:
+ //
+ // - [copy-object]
+ // - [upload-part-copy]
+ //
+ //
+ // [copy-object operation within the S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html
+ // [copy-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html
+ // [upload-part-copy]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html
+ AWSS3CopySourceKey = attribute.Key("aws.s3.copy_source")
+
+ // AWSS3DeleteKey is the attribute Key conforming to the "aws.s3.delete"
+ // semantic conventions. It represents the delete request container that
+ // specifies the objects to be deleted.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // "Objects=[{Key=string,VersionId=string},{Key=string,VersionId=string}],Quiet=boolean"
+ // Note: The `delete` attribute is only applicable to the [delete-object]
+ // operation.
+ // The `delete` attribute corresponds to the `--delete` parameter of the
+ // [delete-objects operation within the S3 API].
+ //
+ // [delete-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html
+ // [delete-objects operation within the S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html
+ AWSS3DeleteKey = attribute.Key("aws.s3.delete")
+
+ // AWSS3KeyKey is the attribute Key conforming to the "aws.s3.key" semantic
+ // conventions. It represents the S3 object key the request refers to.
+ // Corresponds to the `--key` parameter of the [S3 API] operations.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "someFile.yml"
+ // Note: The `key` attribute is applicable to all object-related S3 operations,
+ // i.e. that require the object key as a mandatory parameter.
+ // This applies in particular to the following operations:
+ //
+ // - [copy-object]
+ // - [delete-object]
+ // - [get-object]
+ // - [head-object]
+ // - [put-object]
+ // - [restore-object]
+ // - [select-object-content]
+ // - [abort-multipart-upload]
+ // - [complete-multipart-upload]
+ // - [create-multipart-upload]
+ // - [list-parts]
+ // - [upload-part]
+ // - [upload-part-copy]
+ //
+ //
+ // [S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html
+ // [copy-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html
+ // [delete-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html
+ // [get-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html
+ // [head-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html
+ // [put-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html
+ // [restore-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html
+ // [select-object-content]: https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html
+ // [abort-multipart-upload]: https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html
+ // [complete-multipart-upload]: https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html
+ // [create-multipart-upload]: https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html
+ // [list-parts]: https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html
+ // [upload-part]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html
+ // [upload-part-copy]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html
+ AWSS3KeyKey = attribute.Key("aws.s3.key")
+
+ // AWSS3PartNumberKey is the attribute Key conforming to the
+ // "aws.s3.part_number" semantic conventions. It represents the part number of
+ // the part being uploaded in a multipart-upload operation. This is a positive
+ // integer between 1 and 10,000.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 3456
+ // Note: The `part_number` attribute is only applicable to the [upload-part]
+ // and [upload-part-copy] operations.
+ // The `part_number` attribute corresponds to the `--part-number` parameter of
+ // the
+ // [upload-part operation within the S3 API].
+ //
+ // [upload-part]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html
+ // [upload-part-copy]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html
+ // [upload-part operation within the S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html
+ AWSS3PartNumberKey = attribute.Key("aws.s3.part_number")
+
+ // AWSS3UploadIDKey is the attribute Key conforming to the "aws.s3.upload_id"
+ // semantic conventions. It represents the upload ID that identifies the
+ // multipart upload.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ"
+ // Note: The `upload_id` attribute applies to S3 multipart-upload operations and
+ // corresponds to the `--upload-id` parameter
+ // of the [S3 API] multipart operations.
+ // This applies in particular to the following operations:
+ //
+ // - [abort-multipart-upload]
+ // - [complete-multipart-upload]
+ // - [list-parts]
+ // - [upload-part]
+ // - [upload-part-copy]
+ //
+ //
+ // [S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html
+ // [abort-multipart-upload]: https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html
+ // [complete-multipart-upload]: https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html
+ // [list-parts]: https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html
+ // [upload-part]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html
+ // [upload-part-copy]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html
+ AWSS3UploadIDKey = attribute.Key("aws.s3.upload_id")
+
+ // AWSSecretsmanagerSecretARNKey is the attribute Key conforming to the
+ // "aws.secretsmanager.secret.arn" semantic conventions. It represents the ARN
+ // of the Secret stored in the Secrets Mangger.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // "arn:aws:secretsmanager:us-east-1:123456789012:secret:SecretName-6RandomCharacters"
+ AWSSecretsmanagerSecretARNKey = attribute.Key("aws.secretsmanager.secret.arn")
+
+ // AWSSNSTopicARNKey is the attribute Key conforming to the "aws.sns.topic.arn"
+ // semantic conventions. It represents the ARN of the AWS SNS Topic. An Amazon
+ // SNS [topic] is a logical access point that acts as a communication channel.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "arn:aws:sns:us-east-1:123456789012:mystack-mytopic-NZJ5JSMVGFIE"
+ //
+ // [topic]: https://docs.aws.amazon.com/sns/latest/dg/sns-create-topic.html
+ AWSSNSTopicARNKey = attribute.Key("aws.sns.topic.arn")
+
+ // AWSSQSQueueURLKey is the attribute Key conforming to the "aws.sqs.queue.url"
+ // semantic conventions. It represents the URL of the AWS SQS Queue. It's a
+ // unique identifier for a queue in Amazon Simple Queue Service (SQS) and is
+ // used to access the queue and perform actions on it.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "https://sqs.us-east-1.amazonaws.com/123456789012/MyQueue"
+ AWSSQSQueueURLKey = attribute.Key("aws.sqs.queue.url")
+
+ // AWSStepFunctionsActivityARNKey is the attribute Key conforming to the
+ // "aws.step_functions.activity.arn" semantic conventions. It represents the ARN
+ // of the AWS Step Functions Activity.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "arn:aws:states:us-east-1:123456789012:activity:get-greeting"
+ AWSStepFunctionsActivityARNKey = attribute.Key("aws.step_functions.activity.arn")
+
+ // AWSStepFunctionsStateMachineARNKey is the attribute Key conforming to the
+ // "aws.step_functions.state_machine.arn" semantic conventions. It represents
+ // the ARN of the AWS Step Functions State Machine.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // "arn:aws:states:us-east-1:123456789012:stateMachine:myStateMachine:1"
+ AWSStepFunctionsStateMachineARNKey = attribute.Key("aws.step_functions.state_machine.arn")
+)
+
+// AWSBedrockGuardrailID returns an attribute KeyValue conforming to the
+// "aws.bedrock.guardrail.id" semantic conventions. It represents the unique
+// identifier of the AWS Bedrock Guardrail. A [guardrail] helps safeguard and
+// prevent unwanted behavior from model responses or user messages.
+//
+// [guardrail]: https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html
+func AWSBedrockGuardrailID(val string) attribute.KeyValue {
+ return AWSBedrockGuardrailIDKey.String(val)
+}
+
+// AWSBedrockKnowledgeBaseID returns an attribute KeyValue conforming to the
+// "aws.bedrock.knowledge_base.id" semantic conventions. It represents the unique
+// identifier of the AWS Bedrock Knowledge base. A [knowledge base] is a bank of
+// information that can be queried by models to generate more relevant responses
+// and augment prompts.
+//
+// [knowledge base]: https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html
+func AWSBedrockKnowledgeBaseID(val string) attribute.KeyValue {
+ return AWSBedrockKnowledgeBaseIDKey.String(val)
+}
+
+// AWSDynamoDBAttributeDefinitions returns an attribute KeyValue conforming to
+// the "aws.dynamodb.attribute_definitions" semantic conventions. It represents
+// the JSON-serialized value of each item in the `AttributeDefinitions` request
+// field.
+func AWSDynamoDBAttributeDefinitions(val ...string) attribute.KeyValue {
+ return AWSDynamoDBAttributeDefinitionsKey.StringSlice(val)
+}
+
+// AWSDynamoDBAttributesToGet returns an attribute KeyValue conforming to the
+// "aws.dynamodb.attributes_to_get" semantic conventions. It represents the value
+// of the `AttributesToGet` request parameter.
+func AWSDynamoDBAttributesToGet(val ...string) attribute.KeyValue {
+ return AWSDynamoDBAttributesToGetKey.StringSlice(val)
+}
+
+// AWSDynamoDBConsistentRead returns an attribute KeyValue conforming to the
+// "aws.dynamodb.consistent_read" semantic conventions. It represents the value
+// of the `ConsistentRead` request parameter.
+func AWSDynamoDBConsistentRead(val bool) attribute.KeyValue {
+ return AWSDynamoDBConsistentReadKey.Bool(val)
+}
+
+// AWSDynamoDBConsumedCapacity returns an attribute KeyValue conforming to the
+// "aws.dynamodb.consumed_capacity" semantic conventions. It represents the
+// JSON-serialized value of each item in the `ConsumedCapacity` response field.
+func AWSDynamoDBConsumedCapacity(val ...string) attribute.KeyValue {
+ return AWSDynamoDBConsumedCapacityKey.StringSlice(val)
+}
+
+// AWSDynamoDBCount returns an attribute KeyValue conforming to the
+// "aws.dynamodb.count" semantic conventions. It represents the value of the
+// `Count` response parameter.
+func AWSDynamoDBCount(val int) attribute.KeyValue {
+ return AWSDynamoDBCountKey.Int(val)
+}
+
+// AWSDynamoDBExclusiveStartTable returns an attribute KeyValue conforming to the
+// "aws.dynamodb.exclusive_start_table" semantic conventions. It represents the
+// value of the `ExclusiveStartTableName` request parameter.
+func AWSDynamoDBExclusiveStartTable(val string) attribute.KeyValue {
+ return AWSDynamoDBExclusiveStartTableKey.String(val)
+}
+
+// AWSDynamoDBGlobalSecondaryIndexUpdates returns an attribute KeyValue
+// conforming to the "aws.dynamodb.global_secondary_index_updates" semantic
+// conventions. It represents the JSON-serialized value of each item in the
+// `GlobalSecondaryIndexUpdates` request field.
+func AWSDynamoDBGlobalSecondaryIndexUpdates(val ...string) attribute.KeyValue {
+ return AWSDynamoDBGlobalSecondaryIndexUpdatesKey.StringSlice(val)
+}
+
+// AWSDynamoDBGlobalSecondaryIndexes returns an attribute KeyValue conforming to
+// the "aws.dynamodb.global_secondary_indexes" semantic conventions. It
+// represents the JSON-serialized value of each item of the
+// `GlobalSecondaryIndexes` request field.
+func AWSDynamoDBGlobalSecondaryIndexes(val ...string) attribute.KeyValue {
+ return AWSDynamoDBGlobalSecondaryIndexesKey.StringSlice(val)
+}
+
+// AWSDynamoDBIndexName returns an attribute KeyValue conforming to the
+// "aws.dynamodb.index_name" semantic conventions. It represents the value of the
+// `IndexName` request parameter.
+func AWSDynamoDBIndexName(val string) attribute.KeyValue {
+ return AWSDynamoDBIndexNameKey.String(val)
+}
+
+// AWSDynamoDBItemCollectionMetrics returns an attribute KeyValue conforming to
+// the "aws.dynamodb.item_collection_metrics" semantic conventions. It represents
+// the JSON-serialized value of the `ItemCollectionMetrics` response field.
+func AWSDynamoDBItemCollectionMetrics(val string) attribute.KeyValue {
+ return AWSDynamoDBItemCollectionMetricsKey.String(val)
+}
+
+// AWSDynamoDBLimit returns an attribute KeyValue conforming to the
+// "aws.dynamodb.limit" semantic conventions. It represents the value of the
+// `Limit` request parameter.
+func AWSDynamoDBLimit(val int) attribute.KeyValue {
+ return AWSDynamoDBLimitKey.Int(val)
+}
+
+// AWSDynamoDBLocalSecondaryIndexes returns an attribute KeyValue conforming to
+// the "aws.dynamodb.local_secondary_indexes" semantic conventions. It represents
+// the JSON-serialized value of each item of the `LocalSecondaryIndexes` request
+// field.
+func AWSDynamoDBLocalSecondaryIndexes(val ...string) attribute.KeyValue {
+ return AWSDynamoDBLocalSecondaryIndexesKey.StringSlice(val)
+}
+
+// AWSDynamoDBProjection returns an attribute KeyValue conforming to the
+// "aws.dynamodb.projection" semantic conventions. It represents the value of the
+// `ProjectionExpression` request parameter.
+func AWSDynamoDBProjection(val string) attribute.KeyValue {
+ return AWSDynamoDBProjectionKey.String(val)
+}
+
+// AWSDynamoDBProvisionedReadCapacity returns an attribute KeyValue conforming to
+// the "aws.dynamodb.provisioned_read_capacity" semantic conventions. It
+// represents the value of the `ProvisionedThroughput.ReadCapacityUnits` request
+// parameter.
+func AWSDynamoDBProvisionedReadCapacity(val float64) attribute.KeyValue {
+ return AWSDynamoDBProvisionedReadCapacityKey.Float64(val)
+}
+
+// AWSDynamoDBProvisionedWriteCapacity returns an attribute KeyValue conforming
+// to the "aws.dynamodb.provisioned_write_capacity" semantic conventions. It
+// represents the value of the `ProvisionedThroughput.WriteCapacityUnits` request
+// parameter.
+func AWSDynamoDBProvisionedWriteCapacity(val float64) attribute.KeyValue {
+ return AWSDynamoDBProvisionedWriteCapacityKey.Float64(val)
+}
+
+// AWSDynamoDBScanForward returns an attribute KeyValue conforming to the
+// "aws.dynamodb.scan_forward" semantic conventions. It represents the value of
+// the `ScanIndexForward` request parameter.
+func AWSDynamoDBScanForward(val bool) attribute.KeyValue {
+ return AWSDynamoDBScanForwardKey.Bool(val)
+}
+
+// AWSDynamoDBScannedCount returns an attribute KeyValue conforming to the
+// "aws.dynamodb.scanned_count" semantic conventions. It represents the value of
+// the `ScannedCount` response parameter.
+func AWSDynamoDBScannedCount(val int) attribute.KeyValue {
+ return AWSDynamoDBScannedCountKey.Int(val)
+}
+
+// AWSDynamoDBSegment returns an attribute KeyValue conforming to the
+// "aws.dynamodb.segment" semantic conventions. It represents the value of the
+// `Segment` request parameter.
+func AWSDynamoDBSegment(val int) attribute.KeyValue {
+ return AWSDynamoDBSegmentKey.Int(val)
+}
+
+// AWSDynamoDBSelect returns an attribute KeyValue conforming to the
+// "aws.dynamodb.select" semantic conventions. It represents the value of the
+// `Select` request parameter.
+func AWSDynamoDBSelect(val string) attribute.KeyValue {
+ return AWSDynamoDBSelectKey.String(val)
+}
+
+// AWSDynamoDBTableCount returns an attribute KeyValue conforming to the
+// "aws.dynamodb.table_count" semantic conventions. It represents the number of
+// items in the `TableNames` response parameter.
+func AWSDynamoDBTableCount(val int) attribute.KeyValue {
+ return AWSDynamoDBTableCountKey.Int(val)
+}
+
+// AWSDynamoDBTableNames returns an attribute KeyValue conforming to the
+// "aws.dynamodb.table_names" semantic conventions. It represents the keys in the
+// `RequestItems` object field.
+func AWSDynamoDBTableNames(val ...string) attribute.KeyValue {
+ return AWSDynamoDBTableNamesKey.StringSlice(val)
+}
+
+// AWSDynamoDBTotalSegments returns an attribute KeyValue conforming to the
+// "aws.dynamodb.total_segments" semantic conventions. It represents the value of
+// the `TotalSegments` request parameter.
+func AWSDynamoDBTotalSegments(val int) attribute.KeyValue {
+ return AWSDynamoDBTotalSegmentsKey.Int(val)
+}
+
+// AWSECSClusterARN returns an attribute KeyValue conforming to the
+// "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an
+// [ECS cluster].
+//
+// [ECS cluster]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html
+func AWSECSClusterARN(val string) attribute.KeyValue {
+ return AWSECSClusterARNKey.String(val)
+}
+
+// AWSECSContainerARN returns an attribute KeyValue conforming to the
+// "aws.ecs.container.arn" semantic conventions. It represents the Amazon
+// Resource Name (ARN) of an [ECS container instance].
+//
+// [ECS container instance]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html
+func AWSECSContainerARN(val string) attribute.KeyValue {
+ return AWSECSContainerARNKey.String(val)
+}
+
+// AWSECSTaskARN returns an attribute KeyValue conforming to the
+// "aws.ecs.task.arn" semantic conventions. It represents the ARN of a running
+// [ECS task].
+//
+// [ECS task]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids
+func AWSECSTaskARN(val string) attribute.KeyValue {
+ return AWSECSTaskARNKey.String(val)
+}
+
+// AWSECSTaskFamily returns an attribute KeyValue conforming to the
+// "aws.ecs.task.family" semantic conventions. It represents the family name of
+// the [ECS task definition] used to create the ECS task.
+//
+// [ECS task definition]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html
+func AWSECSTaskFamily(val string) attribute.KeyValue {
+ return AWSECSTaskFamilyKey.String(val)
+}
+
+// AWSECSTaskID returns an attribute KeyValue conforming to the "aws.ecs.task.id"
+// semantic conventions. It represents the ID of a running ECS task. The ID MUST
+// be extracted from `task.arn`.
+func AWSECSTaskID(val string) attribute.KeyValue {
+ return AWSECSTaskIDKey.String(val)
+}
+
+// AWSECSTaskRevision returns an attribute KeyValue conforming to the
+// "aws.ecs.task.revision" semantic conventions. It represents the revision for
+// the task definition used to create the ECS task.
+func AWSECSTaskRevision(val string) attribute.KeyValue {
+ return AWSECSTaskRevisionKey.String(val)
+}
+
+// AWSEKSClusterARN returns an attribute KeyValue conforming to the
+// "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an EKS
+// cluster.
+func AWSEKSClusterARN(val string) attribute.KeyValue {
+ return AWSEKSClusterARNKey.String(val)
+}
+
+// AWSExtendedRequestID returns an attribute KeyValue conforming to the
+// "aws.extended_request_id" semantic conventions. It represents the AWS extended
+// request ID as returned in the response header `x-amz-id-2`.
+func AWSExtendedRequestID(val string) attribute.KeyValue {
+ return AWSExtendedRequestIDKey.String(val)
+}
+
+// AWSKinesisStreamName returns an attribute KeyValue conforming to the
+// "aws.kinesis.stream_name" semantic conventions. It represents the name of the
+// AWS Kinesis [stream] the request refers to. Corresponds to the `--stream-name`
+// parameter of the Kinesis [describe-stream] operation.
+//
+// [stream]: https://docs.aws.amazon.com/streams/latest/dev/introduction.html
+// [describe-stream]: https://docs.aws.amazon.com/cli/latest/reference/kinesis/describe-stream.html
+func AWSKinesisStreamName(val string) attribute.KeyValue {
+ return AWSKinesisStreamNameKey.String(val)
+}
+
+// AWSLambdaInvokedARN returns an attribute KeyValue conforming to the
+// "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked
+// ARN as provided on the `Context` passed to the function (
+// `Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next`
+// applicable).
+func AWSLambdaInvokedARN(val string) attribute.KeyValue {
+ return AWSLambdaInvokedARNKey.String(val)
+}
+
+// AWSLambdaResourceMappingID returns an attribute KeyValue conforming to the
+// "aws.lambda.resource_mapping.id" semantic conventions. It represents the UUID
+// of the [AWS Lambda EvenSource Mapping]. An event source is mapped to a lambda
+// function. It's contents are read by Lambda and used to trigger a function.
+// This isn't available in the lambda execution context or the lambda runtime
+// environtment. This is going to be populated by the AWS SDK for each language
+// when that UUID is present. Some of these operations are
+// Create/Delete/Get/List/Update EventSourceMapping.
+//
+// [AWS Lambda EvenSource Mapping]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html
+func AWSLambdaResourceMappingID(val string) attribute.KeyValue {
+ return AWSLambdaResourceMappingIDKey.String(val)
+}
+
+// AWSLogGroupARNs returns an attribute KeyValue conforming to the
+// "aws.log.group.arns" semantic conventions. It represents the Amazon Resource
+// Name(s) (ARN) of the AWS log group(s).
+func AWSLogGroupARNs(val ...string) attribute.KeyValue {
+ return AWSLogGroupARNsKey.StringSlice(val)
+}
+
+// AWSLogGroupNames returns an attribute KeyValue conforming to the
+// "aws.log.group.names" semantic conventions. It represents the name(s) of the
+// AWS log group(s) an application is writing to.
+func AWSLogGroupNames(val ...string) attribute.KeyValue {
+ return AWSLogGroupNamesKey.StringSlice(val)
+}
+
+// AWSLogStreamARNs returns an attribute KeyValue conforming to the
+// "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of the
+// AWS log stream(s).
+func AWSLogStreamARNs(val ...string) attribute.KeyValue {
+ return AWSLogStreamARNsKey.StringSlice(val)
+}
+
+// AWSLogStreamNames returns an attribute KeyValue conforming to the
+// "aws.log.stream.names" semantic conventions. It represents the name(s) of the
+// AWS log stream(s) an application is writing to.
+func AWSLogStreamNames(val ...string) attribute.KeyValue {
+ return AWSLogStreamNamesKey.StringSlice(val)
+}
+
+// AWSRequestID returns an attribute KeyValue conforming to the "aws.request_id"
+// semantic conventions. It represents the AWS request ID as returned in the
+// response headers `x-amzn-requestid`, `x-amzn-request-id` or `x-amz-request-id`
+// .
+func AWSRequestID(val string) attribute.KeyValue {
+ return AWSRequestIDKey.String(val)
+}
+
+// AWSS3Bucket returns an attribute KeyValue conforming to the "aws.s3.bucket"
+// semantic conventions. It represents the S3 bucket name the request refers to.
+// Corresponds to the `--bucket` parameter of the [S3 API] operations.
+//
+// [S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html
+func AWSS3Bucket(val string) attribute.KeyValue {
+ return AWSS3BucketKey.String(val)
+}
+
+// AWSS3CopySource returns an attribute KeyValue conforming to the
+// "aws.s3.copy_source" semantic conventions. It represents the source object (in
+// the form `bucket`/`key`) for the copy operation.
+func AWSS3CopySource(val string) attribute.KeyValue {
+ return AWSS3CopySourceKey.String(val)
+}
+
+// AWSS3Delete returns an attribute KeyValue conforming to the "aws.s3.delete"
+// semantic conventions. It represents the delete request container that
+// specifies the objects to be deleted.
+func AWSS3Delete(val string) attribute.KeyValue {
+ return AWSS3DeleteKey.String(val)
+}
+
+// AWSS3Key returns an attribute KeyValue conforming to the "aws.s3.key" semantic
+// conventions. It represents the S3 object key the request refers to.
+// Corresponds to the `--key` parameter of the [S3 API] operations.
+//
+// [S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html
+func AWSS3Key(val string) attribute.KeyValue {
+ return AWSS3KeyKey.String(val)
+}
+
+// AWSS3PartNumber returns an attribute KeyValue conforming to the
+// "aws.s3.part_number" semantic conventions. It represents the part number of
+// the part being uploaded in a multipart-upload operation. This is a positive
+// integer between 1 and 10,000.
+func AWSS3PartNumber(val int) attribute.KeyValue {
+ return AWSS3PartNumberKey.Int(val)
+}
+
+// AWSS3UploadID returns an attribute KeyValue conforming to the
+// "aws.s3.upload_id" semantic conventions. It represents the upload ID that
+// identifies the multipart upload.
+func AWSS3UploadID(val string) attribute.KeyValue {
+ return AWSS3UploadIDKey.String(val)
+}
+
+// AWSSecretsmanagerSecretARN returns an attribute KeyValue conforming to the
+// "aws.secretsmanager.secret.arn" semantic conventions. It represents the ARN of
+// the Secret stored in the Secrets Mangger.
+func AWSSecretsmanagerSecretARN(val string) attribute.KeyValue {
+ return AWSSecretsmanagerSecretARNKey.String(val)
+}
+
+// AWSSNSTopicARN returns an attribute KeyValue conforming to the
+// "aws.sns.topic.arn" semantic conventions. It represents the ARN of the AWS SNS
+// Topic. An Amazon SNS [topic] is a logical access point that acts as a
+// communication channel.
+//
+// [topic]: https://docs.aws.amazon.com/sns/latest/dg/sns-create-topic.html
+func AWSSNSTopicARN(val string) attribute.KeyValue {
+ return AWSSNSTopicARNKey.String(val)
+}
+
+// AWSSQSQueueURL returns an attribute KeyValue conforming to the
+// "aws.sqs.queue.url" semantic conventions. It represents the URL of the AWS SQS
+// Queue. It's a unique identifier for a queue in Amazon Simple Queue Service
+// (SQS) and is used to access the queue and perform actions on it.
+func AWSSQSQueueURL(val string) attribute.KeyValue {
+ return AWSSQSQueueURLKey.String(val)
+}
+
+// AWSStepFunctionsActivityARN returns an attribute KeyValue conforming to the
+// "aws.step_functions.activity.arn" semantic conventions. It represents the ARN
+// of the AWS Step Functions Activity.
+func AWSStepFunctionsActivityARN(val string) attribute.KeyValue {
+ return AWSStepFunctionsActivityARNKey.String(val)
+}
+
+// AWSStepFunctionsStateMachineARN returns an attribute KeyValue conforming to
+// the "aws.step_functions.state_machine.arn" semantic conventions. It represents
+// the ARN of the AWS Step Functions State Machine.
+func AWSStepFunctionsStateMachineARN(val string) attribute.KeyValue {
+ return AWSStepFunctionsStateMachineARNKey.String(val)
+}
+
+// Enum values for aws.ecs.launchtype
+var (
+ // Amazon EC2
+ // Stability: development
+ AWSECSLaunchtypeEC2 = AWSECSLaunchtypeKey.String("ec2")
+ // Amazon Fargate
+ // Stability: development
+ AWSECSLaunchtypeFargate = AWSECSLaunchtypeKey.String("fargate")
+)
+
+// Namespace: azure
+const (
+ // AzureClientIDKey is the attribute Key conforming to the "azure.client.id"
+ // semantic conventions. It represents the unique identifier of the client
+ // instance.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "3ba4827d-4422-483f-b59f-85b74211c11d", "storage-client-1"
+ AzureClientIDKey = attribute.Key("azure.client.id")
+
+ // AzureCosmosDBConnectionModeKey is the attribute Key conforming to the
+ // "azure.cosmosdb.connection.mode" semantic conventions. It represents the
+ // cosmos client connection mode.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ AzureCosmosDBConnectionModeKey = attribute.Key("azure.cosmosdb.connection.mode")
+
+ // AzureCosmosDBConsistencyLevelKey is the attribute Key conforming to the
+ // "azure.cosmosdb.consistency.level" semantic conventions. It represents the
+ // account or request [consistency level].
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Eventual", "ConsistentPrefix", "BoundedStaleness", "Strong",
+ // "Session"
+ //
+ // [consistency level]: https://learn.microsoft.com/azure/cosmos-db/consistency-levels
+ AzureCosmosDBConsistencyLevelKey = attribute.Key("azure.cosmosdb.consistency.level")
+
+ // AzureCosmosDBOperationContactedRegionsKey is the attribute Key conforming to
+ // the "azure.cosmosdb.operation.contacted_regions" semantic conventions. It
+ // represents the list of regions contacted during operation in the order that
+ // they were contacted. If there is more than one region listed, it indicates
+ // that the operation was performed on multiple regions i.e. cross-regional
+ // call.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "North Central US", "Australia East", "Australia Southeast"
+ // Note: Region name matches the format of `displayName` in [Azure Location API]
+ //
+ // [Azure Location API]: https://learn.microsoft.com/rest/api/subscription/subscriptions/list-locations?view=rest-subscription-2021-10-01&tabs=HTTP#location
+ AzureCosmosDBOperationContactedRegionsKey = attribute.Key("azure.cosmosdb.operation.contacted_regions")
+
+ // AzureCosmosDBOperationRequestChargeKey is the attribute Key conforming to the
+ // "azure.cosmosdb.operation.request_charge" semantic conventions. It represents
+ // the number of request units consumed by the operation.
+ //
+ // Type: double
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 46.18, 1.0
+ AzureCosmosDBOperationRequestChargeKey = attribute.Key("azure.cosmosdb.operation.request_charge")
+
+ // AzureCosmosDBRequestBodySizeKey is the attribute Key conforming to the
+ // "azure.cosmosdb.request.body.size" semantic conventions. It represents the
+ // request payload size in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ AzureCosmosDBRequestBodySizeKey = attribute.Key("azure.cosmosdb.request.body.size")
+
+ // AzureCosmosDBResponseSubStatusCodeKey is the attribute Key conforming to the
+ // "azure.cosmosdb.response.sub_status_code" semantic conventions. It represents
+ // the cosmos DB sub status code.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 1000, 1002
+ AzureCosmosDBResponseSubStatusCodeKey = attribute.Key("azure.cosmosdb.response.sub_status_code")
+
+ // AzureResourceProviderNamespaceKey is the attribute Key conforming to the
+ // "azure.resource_provider.namespace" semantic conventions. It represents the
+ // [Azure Resource Provider Namespace] as recognized by the client.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Microsoft.Storage", "Microsoft.KeyVault", "Microsoft.ServiceBus"
+ //
+ // [Azure Resource Provider Namespace]: https://learn.microsoft.com/azure/azure-resource-manager/management/azure-services-resource-providers
+ AzureResourceProviderNamespaceKey = attribute.Key("azure.resource_provider.namespace")
+
+ // AzureServiceRequestIDKey is the attribute Key conforming to the
+ // "azure.service.request.id" semantic conventions. It represents the unique
+ // identifier of the service request. It's generated by the Azure service and
+ // returned with the response.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "00000000-0000-0000-0000-000000000000"
+ AzureServiceRequestIDKey = attribute.Key("azure.service.request.id")
+)
+
+// AzureClientID returns an attribute KeyValue conforming to the
+// "azure.client.id" semantic conventions. It represents the unique identifier of
+// the client instance.
+func AzureClientID(val string) attribute.KeyValue {
+ return AzureClientIDKey.String(val)
+}
+
+// AzureCosmosDBOperationContactedRegions returns an attribute KeyValue
+// conforming to the "azure.cosmosdb.operation.contacted_regions" semantic
+// conventions. It represents the list of regions contacted during operation in
+// the order that they were contacted. If there is more than one region listed,
+// it indicates that the operation was performed on multiple regions i.e.
+// cross-regional call.
+func AzureCosmosDBOperationContactedRegions(val ...string) attribute.KeyValue {
+ return AzureCosmosDBOperationContactedRegionsKey.StringSlice(val)
+}
+
+// AzureCosmosDBOperationRequestCharge returns an attribute KeyValue conforming
+// to the "azure.cosmosdb.operation.request_charge" semantic conventions. It
+// represents the number of request units consumed by the operation.
+func AzureCosmosDBOperationRequestCharge(val float64) attribute.KeyValue {
+ return AzureCosmosDBOperationRequestChargeKey.Float64(val)
+}
+
+// AzureCosmosDBRequestBodySize returns an attribute KeyValue conforming to the
+// "azure.cosmosdb.request.body.size" semantic conventions. It represents the
+// request payload size in bytes.
+func AzureCosmosDBRequestBodySize(val int) attribute.KeyValue {
+ return AzureCosmosDBRequestBodySizeKey.Int(val)
+}
+
+// AzureCosmosDBResponseSubStatusCode returns an attribute KeyValue conforming to
+// the "azure.cosmosdb.response.sub_status_code" semantic conventions. It
+// represents the cosmos DB sub status code.
+func AzureCosmosDBResponseSubStatusCode(val int) attribute.KeyValue {
+ return AzureCosmosDBResponseSubStatusCodeKey.Int(val)
+}
+
+// AzureResourceProviderNamespace returns an attribute KeyValue conforming to the
+// "azure.resource_provider.namespace" semantic conventions. It represents the
+// [Azure Resource Provider Namespace] as recognized by the client.
+//
+// [Azure Resource Provider Namespace]: https://learn.microsoft.com/azure/azure-resource-manager/management/azure-services-resource-providers
+func AzureResourceProviderNamespace(val string) attribute.KeyValue {
+ return AzureResourceProviderNamespaceKey.String(val)
+}
+
+// AzureServiceRequestID returns an attribute KeyValue conforming to the
+// "azure.service.request.id" semantic conventions. It represents the unique
+// identifier of the service request. It's generated by the Azure service and
+// returned with the response.
+func AzureServiceRequestID(val string) attribute.KeyValue {
+ return AzureServiceRequestIDKey.String(val)
+}
+
+// Enum values for azure.cosmosdb.connection.mode
+var (
+ // Gateway (HTTP) connection.
+ // Stability: development
+ AzureCosmosDBConnectionModeGateway = AzureCosmosDBConnectionModeKey.String("gateway")
+ // Direct connection.
+ // Stability: development
+ AzureCosmosDBConnectionModeDirect = AzureCosmosDBConnectionModeKey.String("direct")
+)
+
+// Enum values for azure.cosmosdb.consistency.level
+var (
+ // Strong
+ // Stability: development
+ AzureCosmosDBConsistencyLevelStrong = AzureCosmosDBConsistencyLevelKey.String("Strong")
+ // Bounded Staleness
+ // Stability: development
+ AzureCosmosDBConsistencyLevelBoundedStaleness = AzureCosmosDBConsistencyLevelKey.String("BoundedStaleness")
+ // Session
+ // Stability: development
+ AzureCosmosDBConsistencyLevelSession = AzureCosmosDBConsistencyLevelKey.String("Session")
+ // Eventual
+ // Stability: development
+ AzureCosmosDBConsistencyLevelEventual = AzureCosmosDBConsistencyLevelKey.String("Eventual")
+ // Consistent Prefix
+ // Stability: development
+ AzureCosmosDBConsistencyLevelConsistentPrefix = AzureCosmosDBConsistencyLevelKey.String("ConsistentPrefix")
+)
+
+// Namespace: browser
+const (
+ // BrowserBrandsKey is the attribute Key conforming to the "browser.brands"
+ // semantic conventions. It represents the array of brand name and version
+ // separated by a space.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: " Not A;Brand 99", "Chromium 99", "Chrome 99"
+ // Note: This value is intended to be taken from the [UA client hints API] (
+ // `navigator.userAgentData.brands`).
+ //
+ // [UA client hints API]: https://wicg.github.io/ua-client-hints/#interface
+ BrowserBrandsKey = attribute.Key("browser.brands")
+
+ // BrowserLanguageKey is the attribute Key conforming to the "browser.language"
+ // semantic conventions. It represents the preferred language of the user using
+ // the browser.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "en", "en-US", "fr", "fr-FR"
+ // Note: This value is intended to be taken from the Navigator API
+ // `navigator.language`.
+ BrowserLanguageKey = attribute.Key("browser.language")
+
+ // BrowserMobileKey is the attribute Key conforming to the "browser.mobile"
+ // semantic conventions. It represents a boolean that is true if the browser is
+ // running on a mobile device.
+ //
+ // Type: boolean
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // Note: This value is intended to be taken from the [UA client hints API] (
+ // `navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be
+ // left unset.
+ //
+ // [UA client hints API]: https://wicg.github.io/ua-client-hints/#interface
+ BrowserMobileKey = attribute.Key("browser.mobile")
+
+ // BrowserPlatformKey is the attribute Key conforming to the "browser.platform"
+ // semantic conventions. It represents the platform on which the browser is
+ // running.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Windows", "macOS", "Android"
+ // Note: This value is intended to be taken from the [UA client hints API] (
+ // `navigator.userAgentData.platform`). If unavailable, the legacy
+ // `navigator.platform` API SHOULD NOT be used instead and this attribute SHOULD
+ // be left unset in order for the values to be consistent.
+ // The list of possible values is defined in the
+ // [W3C User-Agent Client Hints specification]. Note that some (but not all) of
+ // these values can overlap with values in the
+ // [`os.type` and `os.name` attributes]. However, for consistency, the values in
+ // the `browser.platform` attribute should capture the exact value that the user
+ // agent provides.
+ //
+ // [UA client hints API]: https://wicg.github.io/ua-client-hints/#interface
+ // [W3C User-Agent Client Hints specification]: https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform
+ // [`os.type` and `os.name` attributes]: ./os.md
+ BrowserPlatformKey = attribute.Key("browser.platform")
+)
+
+// BrowserBrands returns an attribute KeyValue conforming to the "browser.brands"
+// semantic conventions. It represents the array of brand name and version
+// separated by a space.
+func BrowserBrands(val ...string) attribute.KeyValue {
+ return BrowserBrandsKey.StringSlice(val)
+}
+
+// BrowserLanguage returns an attribute KeyValue conforming to the
+// "browser.language" semantic conventions. It represents the preferred language
+// of the user using the browser.
+func BrowserLanguage(val string) attribute.KeyValue {
+ return BrowserLanguageKey.String(val)
+}
+
+// BrowserMobile returns an attribute KeyValue conforming to the "browser.mobile"
+// semantic conventions. It represents a boolean that is true if the browser is
+// running on a mobile device.
+func BrowserMobile(val bool) attribute.KeyValue {
+ return BrowserMobileKey.Bool(val)
+}
+
+// BrowserPlatform returns an attribute KeyValue conforming to the
+// "browser.platform" semantic conventions. It represents the platform on which
+// the browser is running.
+func BrowserPlatform(val string) attribute.KeyValue {
+ return BrowserPlatformKey.String(val)
+}
+
+// Namespace: cassandra
+const (
+ // CassandraConsistencyLevelKey is the attribute Key conforming to the
+ // "cassandra.consistency.level" semantic conventions. It represents the
+ // consistency level of the query. Based on consistency values from [CQL].
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ //
+ // [CQL]: https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html
+ CassandraConsistencyLevelKey = attribute.Key("cassandra.consistency.level")
+
+ // CassandraCoordinatorDCKey is the attribute Key conforming to the
+ // "cassandra.coordinator.dc" semantic conventions. It represents the data
+ // center of the coordinating node for a query.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: us-west-2
+ CassandraCoordinatorDCKey = attribute.Key("cassandra.coordinator.dc")
+
+ // CassandraCoordinatorIDKey is the attribute Key conforming to the
+ // "cassandra.coordinator.id" semantic conventions. It represents the ID of the
+ // coordinating node for a query.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: be13faa2-8574-4d71-926d-27f16cf8a7af
+ CassandraCoordinatorIDKey = attribute.Key("cassandra.coordinator.id")
+
+ // CassandraPageSizeKey is the attribute Key conforming to the
+ // "cassandra.page.size" semantic conventions. It represents the fetch size used
+ // for paging, i.e. how many rows will be returned at once.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 5000
+ CassandraPageSizeKey = attribute.Key("cassandra.page.size")
+
+ // CassandraQueryIdempotentKey is the attribute Key conforming to the
+ // "cassandra.query.idempotent" semantic conventions. It represents the whether
+ // or not the query is idempotent.
+ //
+ // Type: boolean
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ CassandraQueryIdempotentKey = attribute.Key("cassandra.query.idempotent")
+
+ // CassandraSpeculativeExecutionCountKey is the attribute Key conforming to the
+ // "cassandra.speculative_execution.count" semantic conventions. It represents
+ // the number of times a query was speculatively executed. Not set or `0` if the
+ // query was not executed speculatively.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 0, 2
+ CassandraSpeculativeExecutionCountKey = attribute.Key("cassandra.speculative_execution.count")
+)
+
+// CassandraCoordinatorDC returns an attribute KeyValue conforming to the
+// "cassandra.coordinator.dc" semantic conventions. It represents the data center
+// of the coordinating node for a query.
+func CassandraCoordinatorDC(val string) attribute.KeyValue {
+ return CassandraCoordinatorDCKey.String(val)
+}
+
+// CassandraCoordinatorID returns an attribute KeyValue conforming to the
+// "cassandra.coordinator.id" semantic conventions. It represents the ID of the
+// coordinating node for a query.
+func CassandraCoordinatorID(val string) attribute.KeyValue {
+ return CassandraCoordinatorIDKey.String(val)
+}
+
+// CassandraPageSize returns an attribute KeyValue conforming to the
+// "cassandra.page.size" semantic conventions. It represents the fetch size used
+// for paging, i.e. how many rows will be returned at once.
+func CassandraPageSize(val int) attribute.KeyValue {
+ return CassandraPageSizeKey.Int(val)
+}
+
+// CassandraQueryIdempotent returns an attribute KeyValue conforming to the
+// "cassandra.query.idempotent" semantic conventions. It represents the whether
+// or not the query is idempotent.
+func CassandraQueryIdempotent(val bool) attribute.KeyValue {
+ return CassandraQueryIdempotentKey.Bool(val)
+}
+
+// CassandraSpeculativeExecutionCount returns an attribute KeyValue conforming to
+// the "cassandra.speculative_execution.count" semantic conventions. It
+// represents the number of times a query was speculatively executed. Not set or
+// `0` if the query was not executed speculatively.
+func CassandraSpeculativeExecutionCount(val int) attribute.KeyValue {
+ return CassandraSpeculativeExecutionCountKey.Int(val)
+}
+
+// Enum values for cassandra.consistency.level
+var (
+ // All
+ // Stability: development
+ CassandraConsistencyLevelAll = CassandraConsistencyLevelKey.String("all")
+ // Each Quorum
+ // Stability: development
+ CassandraConsistencyLevelEachQuorum = CassandraConsistencyLevelKey.String("each_quorum")
+ // Quorum
+ // Stability: development
+ CassandraConsistencyLevelQuorum = CassandraConsistencyLevelKey.String("quorum")
+ // Local Quorum
+ // Stability: development
+ CassandraConsistencyLevelLocalQuorum = CassandraConsistencyLevelKey.String("local_quorum")
+ // One
+ // Stability: development
+ CassandraConsistencyLevelOne = CassandraConsistencyLevelKey.String("one")
+ // Two
+ // Stability: development
+ CassandraConsistencyLevelTwo = CassandraConsistencyLevelKey.String("two")
+ // Three
+ // Stability: development
+ CassandraConsistencyLevelThree = CassandraConsistencyLevelKey.String("three")
+ // Local One
+ // Stability: development
+ CassandraConsistencyLevelLocalOne = CassandraConsistencyLevelKey.String("local_one")
+ // Any
+ // Stability: development
+ CassandraConsistencyLevelAny = CassandraConsistencyLevelKey.String("any")
+ // Serial
+ // Stability: development
+ CassandraConsistencyLevelSerial = CassandraConsistencyLevelKey.String("serial")
+ // Local Serial
+ // Stability: development
+ CassandraConsistencyLevelLocalSerial = CassandraConsistencyLevelKey.String("local_serial")
+)
+
+// Namespace: cicd
+const (
+ // CICDPipelineActionNameKey is the attribute Key conforming to the
+ // "cicd.pipeline.action.name" semantic conventions. It represents the kind of
+ // action a pipeline run is performing.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "BUILD", "RUN", "SYNC"
+ CICDPipelineActionNameKey = attribute.Key("cicd.pipeline.action.name")
+
+ // CICDPipelineNameKey is the attribute Key conforming to the
+ // "cicd.pipeline.name" semantic conventions. It represents the human readable
+ // name of the pipeline within a CI/CD system.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Build and Test", "Lint", "Deploy Go Project",
+ // "deploy_to_environment"
+ CICDPipelineNameKey = attribute.Key("cicd.pipeline.name")
+
+ // CICDPipelineResultKey is the attribute Key conforming to the
+ // "cicd.pipeline.result" semantic conventions. It represents the result of a
+ // pipeline run.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "success", "failure", "timeout", "skipped"
+ CICDPipelineResultKey = attribute.Key("cicd.pipeline.result")
+
+ // CICDPipelineRunIDKey is the attribute Key conforming to the
+ // "cicd.pipeline.run.id" semantic conventions. It represents the unique
+ // identifier of a pipeline run within a CI/CD system.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "120912"
+ CICDPipelineRunIDKey = attribute.Key("cicd.pipeline.run.id")
+
+ // CICDPipelineRunStateKey is the attribute Key conforming to the
+ // "cicd.pipeline.run.state" semantic conventions. It represents the pipeline
+ // run goes through these states during its lifecycle.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "pending", "executing", "finalizing"
+ CICDPipelineRunStateKey = attribute.Key("cicd.pipeline.run.state")
+
+ // CICDPipelineRunURLFullKey is the attribute Key conforming to the
+ // "cicd.pipeline.run.url.full" semantic conventions. It represents the [URL] of
+ // the pipeline run, providing the complete address in order to locate and
+ // identify the pipeline run.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // "https://github.com/open-telemetry/semantic-conventions/actions/runs/9753949763?pr=1075"
+ //
+ // [URL]: https://wikipedia.org/wiki/URL
+ CICDPipelineRunURLFullKey = attribute.Key("cicd.pipeline.run.url.full")
+
+ // CICDPipelineTaskNameKey is the attribute Key conforming to the
+ // "cicd.pipeline.task.name" semantic conventions. It represents the human
+ // readable name of a task within a pipeline. Task here most closely aligns with
+ // a [computing process] in a pipeline. Other terms for tasks include commands,
+ // steps, and procedures.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Run GoLang Linter", "Go Build", "go-test", "deploy_binary"
+ //
+ // [computing process]: https://wikipedia.org/wiki/Pipeline_(computing)
+ CICDPipelineTaskNameKey = attribute.Key("cicd.pipeline.task.name")
+
+ // CICDPipelineTaskRunIDKey is the attribute Key conforming to the
+ // "cicd.pipeline.task.run.id" semantic conventions. It represents the unique
+ // identifier of a task run within a pipeline.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "12097"
+ CICDPipelineTaskRunIDKey = attribute.Key("cicd.pipeline.task.run.id")
+
+ // CICDPipelineTaskRunResultKey is the attribute Key conforming to the
+ // "cicd.pipeline.task.run.result" semantic conventions. It represents the
+ // result of a task run.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "success", "failure", "timeout", "skipped"
+ CICDPipelineTaskRunResultKey = attribute.Key("cicd.pipeline.task.run.result")
+
+ // CICDPipelineTaskRunURLFullKey is the attribute Key conforming to the
+ // "cicd.pipeline.task.run.url.full" semantic conventions. It represents the
+ // [URL] of the pipeline task run, providing the complete address in order to
+ // locate and identify the pipeline task run.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // "https://github.com/open-telemetry/semantic-conventions/actions/runs/9753949763/job/26920038674?pr=1075"
+ //
+ // [URL]: https://wikipedia.org/wiki/URL
+ CICDPipelineTaskRunURLFullKey = attribute.Key("cicd.pipeline.task.run.url.full")
+
+ // CICDPipelineTaskTypeKey is the attribute Key conforming to the
+ // "cicd.pipeline.task.type" semantic conventions. It represents the type of the
+ // task within a pipeline.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "build", "test", "deploy"
+ CICDPipelineTaskTypeKey = attribute.Key("cicd.pipeline.task.type")
+
+ // CICDSystemComponentKey is the attribute Key conforming to the
+ // "cicd.system.component" semantic conventions. It represents the name of a
+ // component of the CICD system.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "controller", "scheduler", "agent"
+ CICDSystemComponentKey = attribute.Key("cicd.system.component")
+
+ // CICDWorkerIDKey is the attribute Key conforming to the "cicd.worker.id"
+ // semantic conventions. It represents the unique identifier of a worker within
+ // a CICD system.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "abc123", "10.0.1.2", "controller"
+ CICDWorkerIDKey = attribute.Key("cicd.worker.id")
+
+ // CICDWorkerNameKey is the attribute Key conforming to the "cicd.worker.name"
+ // semantic conventions. It represents the name of a worker within a CICD
+ // system.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "agent-abc", "controller", "Ubuntu LTS"
+ CICDWorkerNameKey = attribute.Key("cicd.worker.name")
+
+ // CICDWorkerStateKey is the attribute Key conforming to the "cicd.worker.state"
+ // semantic conventions. It represents the state of a CICD worker / agent.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "idle", "busy", "down"
+ CICDWorkerStateKey = attribute.Key("cicd.worker.state")
+
+ // CICDWorkerURLFullKey is the attribute Key conforming to the
+ // "cicd.worker.url.full" semantic conventions. It represents the [URL] of the
+ // worker, providing the complete address in order to locate and identify the
+ // worker.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "https://cicd.example.org/worker/abc123"
+ //
+ // [URL]: https://wikipedia.org/wiki/URL
+ CICDWorkerURLFullKey = attribute.Key("cicd.worker.url.full")
+)
+
+// CICDPipelineName returns an attribute KeyValue conforming to the
+// "cicd.pipeline.name" semantic conventions. It represents the human readable
+// name of the pipeline within a CI/CD system.
+func CICDPipelineName(val string) attribute.KeyValue {
+ return CICDPipelineNameKey.String(val)
+}
+
+// CICDPipelineRunID returns an attribute KeyValue conforming to the
+// "cicd.pipeline.run.id" semantic conventions. It represents the unique
+// identifier of a pipeline run within a CI/CD system.
+func CICDPipelineRunID(val string) attribute.KeyValue {
+ return CICDPipelineRunIDKey.String(val)
+}
+
+// CICDPipelineRunURLFull returns an attribute KeyValue conforming to the
+// "cicd.pipeline.run.url.full" semantic conventions. It represents the [URL] of
+// the pipeline run, providing the complete address in order to locate and
+// identify the pipeline run.
+//
+// [URL]: https://wikipedia.org/wiki/URL
+func CICDPipelineRunURLFull(val string) attribute.KeyValue {
+ return CICDPipelineRunURLFullKey.String(val)
+}
+
+// CICDPipelineTaskName returns an attribute KeyValue conforming to the
+// "cicd.pipeline.task.name" semantic conventions. It represents the human
+// readable name of a task within a pipeline. Task here most closely aligns with
+// a [computing process] in a pipeline. Other terms for tasks include commands,
+// steps, and procedures.
+//
+// [computing process]: https://wikipedia.org/wiki/Pipeline_(computing)
+func CICDPipelineTaskName(val string) attribute.KeyValue {
+ return CICDPipelineTaskNameKey.String(val)
+}
+
+// CICDPipelineTaskRunID returns an attribute KeyValue conforming to the
+// "cicd.pipeline.task.run.id" semantic conventions. It represents the unique
+// identifier of a task run within a pipeline.
+func CICDPipelineTaskRunID(val string) attribute.KeyValue {
+ return CICDPipelineTaskRunIDKey.String(val)
+}
+
+// CICDPipelineTaskRunURLFull returns an attribute KeyValue conforming to the
+// "cicd.pipeline.task.run.url.full" semantic conventions. It represents the
+// [URL] of the pipeline task run, providing the complete address in order to
+// locate and identify the pipeline task run.
+//
+// [URL]: https://wikipedia.org/wiki/URL
+func CICDPipelineTaskRunURLFull(val string) attribute.KeyValue {
+ return CICDPipelineTaskRunURLFullKey.String(val)
+}
+
+// CICDSystemComponent returns an attribute KeyValue conforming to the
+// "cicd.system.component" semantic conventions. It represents the name of a
+// component of the CICD system.
+func CICDSystemComponent(val string) attribute.KeyValue {
+ return CICDSystemComponentKey.String(val)
+}
+
+// CICDWorkerID returns an attribute KeyValue conforming to the "cicd.worker.id"
+// semantic conventions. It represents the unique identifier of a worker within a
+// CICD system.
+func CICDWorkerID(val string) attribute.KeyValue {
+ return CICDWorkerIDKey.String(val)
+}
+
+// CICDWorkerName returns an attribute KeyValue conforming to the
+// "cicd.worker.name" semantic conventions. It represents the name of a worker
+// within a CICD system.
+func CICDWorkerName(val string) attribute.KeyValue {
+ return CICDWorkerNameKey.String(val)
+}
+
+// CICDWorkerURLFull returns an attribute KeyValue conforming to the
+// "cicd.worker.url.full" semantic conventions. It represents the [URL] of the
+// worker, providing the complete address in order to locate and identify the
+// worker.
+//
+// [URL]: https://wikipedia.org/wiki/URL
+func CICDWorkerURLFull(val string) attribute.KeyValue {
+ return CICDWorkerURLFullKey.String(val)
+}
+
+// Enum values for cicd.pipeline.action.name
+var (
+ // The pipeline run is executing a build.
+ // Stability: development
+ CICDPipelineActionNameBuild = CICDPipelineActionNameKey.String("BUILD")
+ // The pipeline run is executing.
+ // Stability: development
+ CICDPipelineActionNameRun = CICDPipelineActionNameKey.String("RUN")
+ // The pipeline run is executing a sync.
+ // Stability: development
+ CICDPipelineActionNameSync = CICDPipelineActionNameKey.String("SYNC")
+)
+
+// Enum values for cicd.pipeline.result
+var (
+ // The pipeline run finished successfully.
+ // Stability: development
+ CICDPipelineResultSuccess = CICDPipelineResultKey.String("success")
+ // The pipeline run did not finish successfully, eg. due to a compile error or a
+ // failing test. Such failures are usually detected by non-zero exit codes of
+ // the tools executed in the pipeline run.
+ // Stability: development
+ CICDPipelineResultFailure = CICDPipelineResultKey.String("failure")
+ // The pipeline run failed due to an error in the CICD system, eg. due to the
+ // worker being killed.
+ // Stability: development
+ CICDPipelineResultError = CICDPipelineResultKey.String("error")
+ // A timeout caused the pipeline run to be interrupted.
+ // Stability: development
+ CICDPipelineResultTimeout = CICDPipelineResultKey.String("timeout")
+ // The pipeline run was cancelled, eg. by a user manually cancelling the
+ // pipeline run.
+ // Stability: development
+ CICDPipelineResultCancellation = CICDPipelineResultKey.String("cancellation")
+ // The pipeline run was skipped, eg. due to a precondition not being met.
+ // Stability: development
+ CICDPipelineResultSkip = CICDPipelineResultKey.String("skip")
+)
+
+// Enum values for cicd.pipeline.run.state
+var (
+ // The run pending state spans from the event triggering the pipeline run until
+ // the execution of the run starts (eg. time spent in a queue, provisioning
+ // agents, creating run resources).
+ //
+ // Stability: development
+ CICDPipelineRunStatePending = CICDPipelineRunStateKey.String("pending")
+ // The executing state spans the execution of any run tasks (eg. build, test).
+ // Stability: development
+ CICDPipelineRunStateExecuting = CICDPipelineRunStateKey.String("executing")
+ // The finalizing state spans from when the run has finished executing (eg.
+ // cleanup of run resources).
+ // Stability: development
+ CICDPipelineRunStateFinalizing = CICDPipelineRunStateKey.String("finalizing")
+)
+
+// Enum values for cicd.pipeline.task.run.result
+var (
+ // The task run finished successfully.
+ // Stability: development
+ CICDPipelineTaskRunResultSuccess = CICDPipelineTaskRunResultKey.String("success")
+ // The task run did not finish successfully, eg. due to a compile error or a
+ // failing test. Such failures are usually detected by non-zero exit codes of
+ // the tools executed in the task run.
+ // Stability: development
+ CICDPipelineTaskRunResultFailure = CICDPipelineTaskRunResultKey.String("failure")
+ // The task run failed due to an error in the CICD system, eg. due to the worker
+ // being killed.
+ // Stability: development
+ CICDPipelineTaskRunResultError = CICDPipelineTaskRunResultKey.String("error")
+ // A timeout caused the task run to be interrupted.
+ // Stability: development
+ CICDPipelineTaskRunResultTimeout = CICDPipelineTaskRunResultKey.String("timeout")
+ // The task run was cancelled, eg. by a user manually cancelling the task run.
+ // Stability: development
+ CICDPipelineTaskRunResultCancellation = CICDPipelineTaskRunResultKey.String("cancellation")
+ // The task run was skipped, eg. due to a precondition not being met.
+ // Stability: development
+ CICDPipelineTaskRunResultSkip = CICDPipelineTaskRunResultKey.String("skip")
+)
+
+// Enum values for cicd.pipeline.task.type
+var (
+ // build
+ // Stability: development
+ CICDPipelineTaskTypeBuild = CICDPipelineTaskTypeKey.String("build")
+ // test
+ // Stability: development
+ CICDPipelineTaskTypeTest = CICDPipelineTaskTypeKey.String("test")
+ // deploy
+ // Stability: development
+ CICDPipelineTaskTypeDeploy = CICDPipelineTaskTypeKey.String("deploy")
+)
+
+// Enum values for cicd.worker.state
+var (
+ // The worker is not performing work for the CICD system. It is available to the
+ // CICD system to perform work on (online / idle).
+ // Stability: development
+ CICDWorkerStateAvailable = CICDWorkerStateKey.String("available")
+ // The worker is performing work for the CICD system.
+ // Stability: development
+ CICDWorkerStateBusy = CICDWorkerStateKey.String("busy")
+ // The worker is not available to the CICD system (disconnected / down).
+ // Stability: development
+ CICDWorkerStateOffline = CICDWorkerStateKey.String("offline")
+)
+
+// Namespace: client
+const (
+ // ClientAddressKey is the attribute Key conforming to the "client.address"
+ // semantic conventions. It represents the client address - domain name if
+ // available without reverse DNS lookup; otherwise, IP address or Unix domain
+ // socket name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "client.example.com", "10.1.2.80", "/tmp/my.sock"
+ // Note: When observed from the server side, and when communicating through an
+ // intermediary, `client.address` SHOULD represent the client address behind any
+ // intermediaries, for example proxies, if it's available.
+ ClientAddressKey = attribute.Key("client.address")
+
+ // ClientPortKey is the attribute Key conforming to the "client.port" semantic
+ // conventions. It represents the client port number.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: 65123
+ // Note: When observed from the server side, and when communicating through an
+ // intermediary, `client.port` SHOULD represent the client port behind any
+ // intermediaries, for example proxies, if it's available.
+ ClientPortKey = attribute.Key("client.port")
+)
+
+// ClientAddress returns an attribute KeyValue conforming to the "client.address"
+// semantic conventions. It represents the client address - domain name if
+// available without reverse DNS lookup; otherwise, IP address or Unix domain
+// socket name.
+func ClientAddress(val string) attribute.KeyValue {
+ return ClientAddressKey.String(val)
+}
+
+// ClientPort returns an attribute KeyValue conforming to the "client.port"
+// semantic conventions. It represents the client port number.
+func ClientPort(val int) attribute.KeyValue {
+ return ClientPortKey.Int(val)
+}
+
+// Namespace: cloud
+const (
+ // CloudAccountIDKey is the attribute Key conforming to the "cloud.account.id"
+ // semantic conventions. It represents the cloud account ID the resource is
+ // assigned to.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "111111111111", "opentelemetry"
+ CloudAccountIDKey = attribute.Key("cloud.account.id")
+
+ // CloudAvailabilityZoneKey is the attribute Key conforming to the
+ // "cloud.availability_zone" semantic conventions. It represents the cloud
+ // regions often have multiple, isolated locations known as zones to increase
+ // availability. Availability zone represents the zone where the resource is
+ // running.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "us-east-1c"
+ // Note: Availability zones are called "zones" on Alibaba Cloud and Google
+ // Cloud.
+ CloudAvailabilityZoneKey = attribute.Key("cloud.availability_zone")
+
+ // CloudPlatformKey is the attribute Key conforming to the "cloud.platform"
+ // semantic conventions. It represents the cloud platform in use.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // Note: The prefix of the service SHOULD match the one specified in
+ // `cloud.provider`.
+ CloudPlatformKey = attribute.Key("cloud.platform")
+
+ // CloudProviderKey is the attribute Key conforming to the "cloud.provider"
+ // semantic conventions. It represents the name of the cloud provider.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ CloudProviderKey = attribute.Key("cloud.provider")
+
+ // CloudRegionKey is the attribute Key conforming to the "cloud.region" semantic
+ // conventions. It represents the geographical region within a cloud provider.
+ // When associated with a resource, this attribute specifies the region where
+ // the resource operates. When calling services or APIs deployed on a cloud,
+ // this attribute identifies the region where the called destination is
+ // deployed.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "us-central1", "us-east-1"
+ // Note: Refer to your provider's docs to see the available regions, for example
+ // [Alibaba Cloud regions], [AWS regions], [Azure regions],
+ // [Google Cloud regions], or [Tencent Cloud regions].
+ //
+ // [Alibaba Cloud regions]: https://www.alibabacloud.com/help/doc-detail/40654.htm
+ // [AWS regions]: https://aws.amazon.com/about-aws/global-infrastructure/regions_az/
+ // [Azure regions]: https://azure.microsoft.com/global-infrastructure/geographies/
+ // [Google Cloud regions]: https://cloud.google.com/about/locations
+ // [Tencent Cloud regions]: https://www.tencentcloud.com/document/product/213/6091
+ CloudRegionKey = attribute.Key("cloud.region")
+
+ // CloudResourceIDKey is the attribute Key conforming to the "cloud.resource_id"
+ // semantic conventions. It represents the cloud provider-specific native
+ // identifier of the monitored cloud resource (e.g. an [ARN] on AWS, a
+ // [fully qualified resource ID] on Azure, a [full resource name] on GCP).
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function",
+ // "//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID",
+ // "/subscriptions//resourceGroups/
+ // /providers/Microsoft.Web/sites//functions/"
+ // Note: On some cloud providers, it may not be possible to determine the full
+ // ID at startup,
+ // so it may be necessary to set `cloud.resource_id` as a span attribute
+ // instead.
+ //
+ // The exact value to use for `cloud.resource_id` depends on the cloud provider.
+ // The following well-known definitions MUST be used if you set this attribute
+ // and they apply:
+ //
+ // - **AWS Lambda:** The function [ARN].
+ // Take care not to use the "invoked ARN" directly but replace any
+ // [alias suffix]
+ // with the resolved function version, as the same runtime instance may be
+ // invocable with
+ // multiple different aliases.
+ // - **GCP:** The [URI of the resource]
+ // - **Azure:** The [Fully Qualified Resource ID] of the invoked function,
+ // *not* the function app, having the form
+ //
+ // `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`
+ // .
+ // This means that a span attribute MUST be used, as an Azure function app
+ // can host multiple functions that would usually share
+ // a TracerProvider.
+ //
+ //
+ // [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
+ // [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id
+ // [full resource name]: https://google.aip.dev/122#full-resource-names
+ // [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
+ // [alias suffix]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html
+ // [URI of the resource]: https://cloud.google.com/iam/docs/full-resource-names
+ // [Fully Qualified Resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id
+ CloudResourceIDKey = attribute.Key("cloud.resource_id")
+)
+
+// CloudAccountID returns an attribute KeyValue conforming to the
+// "cloud.account.id" semantic conventions. It represents the cloud account ID
+// the resource is assigned to.
+func CloudAccountID(val string) attribute.KeyValue {
+ return CloudAccountIDKey.String(val)
+}
+
+// CloudAvailabilityZone returns an attribute KeyValue conforming to the
+// "cloud.availability_zone" semantic conventions. It represents the cloud
+// regions often have multiple, isolated locations known as zones to increase
+// availability. Availability zone represents the zone where the resource is
+// running.
+func CloudAvailabilityZone(val string) attribute.KeyValue {
+ return CloudAvailabilityZoneKey.String(val)
+}
+
+// CloudRegion returns an attribute KeyValue conforming to the "cloud.region"
+// semantic conventions. It represents the geographical region within a cloud
+// provider. When associated with a resource, this attribute specifies the region
+// where the resource operates. When calling services or APIs deployed on a
+// cloud, this attribute identifies the region where the called destination is
+// deployed.
+func CloudRegion(val string) attribute.KeyValue {
+ return CloudRegionKey.String(val)
+}
+
+// CloudResourceID returns an attribute KeyValue conforming to the
+// "cloud.resource_id" semantic conventions. It represents the cloud
+// provider-specific native identifier of the monitored cloud resource (e.g. an
+// [ARN] on AWS, a [fully qualified resource ID] on Azure, a [full resource name]
+// on GCP).
+//
+// [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
+// [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id
+// [full resource name]: https://google.aip.dev/122#full-resource-names
+func CloudResourceID(val string) attribute.KeyValue {
+ return CloudResourceIDKey.String(val)
+}
+
+// Enum values for cloud.platform
+var (
+ // Alibaba Cloud Elastic Compute Service
+ // Stability: development
+ CloudPlatformAlibabaCloudECS = CloudPlatformKey.String("alibaba_cloud_ecs")
+ // Alibaba Cloud Function Compute
+ // Stability: development
+ CloudPlatformAlibabaCloudFC = CloudPlatformKey.String("alibaba_cloud_fc")
+ // Red Hat OpenShift on Alibaba Cloud
+ // Stability: development
+ CloudPlatformAlibabaCloudOpenShift = CloudPlatformKey.String("alibaba_cloud_openshift")
+ // AWS Elastic Compute Cloud
+ // Stability: development
+ CloudPlatformAWSEC2 = CloudPlatformKey.String("aws_ec2")
+ // AWS Elastic Container Service
+ // Stability: development
+ CloudPlatformAWSECS = CloudPlatformKey.String("aws_ecs")
+ // AWS Elastic Kubernetes Service
+ // Stability: development
+ CloudPlatformAWSEKS = CloudPlatformKey.String("aws_eks")
+ // AWS Lambda
+ // Stability: development
+ CloudPlatformAWSLambda = CloudPlatformKey.String("aws_lambda")
+ // AWS Elastic Beanstalk
+ // Stability: development
+ CloudPlatformAWSElasticBeanstalk = CloudPlatformKey.String("aws_elastic_beanstalk")
+ // AWS App Runner
+ // Stability: development
+ CloudPlatformAWSAppRunner = CloudPlatformKey.String("aws_app_runner")
+ // Red Hat OpenShift on AWS (ROSA)
+ // Stability: development
+ CloudPlatformAWSOpenShift = CloudPlatformKey.String("aws_openshift")
+ // Azure Virtual Machines
+ // Stability: development
+ CloudPlatformAzureVM = CloudPlatformKey.String("azure.vm")
+ // Azure Container Apps
+ // Stability: development
+ CloudPlatformAzureContainerApps = CloudPlatformKey.String("azure.container_apps")
+ // Azure Container Instances
+ // Stability: development
+ CloudPlatformAzureContainerInstances = CloudPlatformKey.String("azure.container_instances")
+ // Azure Kubernetes Service
+ // Stability: development
+ CloudPlatformAzureAKS = CloudPlatformKey.String("azure.aks")
+ // Azure Functions
+ // Stability: development
+ CloudPlatformAzureFunctions = CloudPlatformKey.String("azure.functions")
+ // Azure App Service
+ // Stability: development
+ CloudPlatformAzureAppService = CloudPlatformKey.String("azure.app_service")
+ // Azure Red Hat OpenShift
+ // Stability: development
+ CloudPlatformAzureOpenShift = CloudPlatformKey.String("azure.openshift")
+ // Google Bare Metal Solution (BMS)
+ // Stability: development
+ CloudPlatformGCPBareMetalSolution = CloudPlatformKey.String("gcp_bare_metal_solution")
+ // Google Cloud Compute Engine (GCE)
+ // Stability: development
+ CloudPlatformGCPComputeEngine = CloudPlatformKey.String("gcp_compute_engine")
+ // Google Cloud Run
+ // Stability: development
+ CloudPlatformGCPCloudRun = CloudPlatformKey.String("gcp_cloud_run")
+ // Google Cloud Kubernetes Engine (GKE)
+ // Stability: development
+ CloudPlatformGCPKubernetesEngine = CloudPlatformKey.String("gcp_kubernetes_engine")
+ // Google Cloud Functions (GCF)
+ // Stability: development
+ CloudPlatformGCPCloudFunctions = CloudPlatformKey.String("gcp_cloud_functions")
+ // Google Cloud App Engine (GAE)
+ // Stability: development
+ CloudPlatformGCPAppEngine = CloudPlatformKey.String("gcp_app_engine")
+ // Red Hat OpenShift on Google Cloud
+ // Stability: development
+ CloudPlatformGCPOpenShift = CloudPlatformKey.String("gcp_openshift")
+ // Red Hat OpenShift on IBM Cloud
+ // Stability: development
+ CloudPlatformIBMCloudOpenShift = CloudPlatformKey.String("ibm_cloud_openshift")
+ // Compute on Oracle Cloud Infrastructure (OCI)
+ // Stability: development
+ CloudPlatformOracleCloudCompute = CloudPlatformKey.String("oracle_cloud_compute")
+ // Kubernetes Engine (OKE) on Oracle Cloud Infrastructure (OCI)
+ // Stability: development
+ CloudPlatformOracleCloudOKE = CloudPlatformKey.String("oracle_cloud_oke")
+ // Tencent Cloud Cloud Virtual Machine (CVM)
+ // Stability: development
+ CloudPlatformTencentCloudCVM = CloudPlatformKey.String("tencent_cloud_cvm")
+ // Tencent Cloud Elastic Kubernetes Service (EKS)
+ // Stability: development
+ CloudPlatformTencentCloudEKS = CloudPlatformKey.String("tencent_cloud_eks")
+ // Tencent Cloud Serverless Cloud Function (SCF)
+ // Stability: development
+ CloudPlatformTencentCloudSCF = CloudPlatformKey.String("tencent_cloud_scf")
+)
+
+// Enum values for cloud.provider
+var (
+ // Alibaba Cloud
+ // Stability: development
+ CloudProviderAlibabaCloud = CloudProviderKey.String("alibaba_cloud")
+ // Amazon Web Services
+ // Stability: development
+ CloudProviderAWS = CloudProviderKey.String("aws")
+ // Microsoft Azure
+ // Stability: development
+ CloudProviderAzure = CloudProviderKey.String("azure")
+ // Google Cloud Platform
+ // Stability: development
+ CloudProviderGCP = CloudProviderKey.String("gcp")
+ // Heroku Platform as a Service
+ // Stability: development
+ CloudProviderHeroku = CloudProviderKey.String("heroku")
+ // IBM Cloud
+ // Stability: development
+ CloudProviderIBMCloud = CloudProviderKey.String("ibm_cloud")
+ // Oracle Cloud Infrastructure (OCI)
+ // Stability: development
+ CloudProviderOracleCloud = CloudProviderKey.String("oracle_cloud")
+ // Tencent Cloud
+ // Stability: development
+ CloudProviderTencentCloud = CloudProviderKey.String("tencent_cloud")
+)
+
+// Namespace: cloudevents
+const (
+ // CloudEventsEventIDKey is the attribute Key conforming to the
+ // "cloudevents.event_id" semantic conventions. It represents the [event_id]
+ // uniquely identifies the event.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "123e4567-e89b-12d3-a456-426614174000", "0001"
+ //
+ // [event_id]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id
+ CloudEventsEventIDKey = attribute.Key("cloudevents.event_id")
+
+ // CloudEventsEventSourceKey is the attribute Key conforming to the
+ // "cloudevents.event_source" semantic conventions. It represents the [source]
+ // identifies the context in which an event happened.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "https://github.com/cloudevents", "/cloudevents/spec/pull/123",
+ // "my-service"
+ //
+ // [source]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1
+ CloudEventsEventSourceKey = attribute.Key("cloudevents.event_source")
+
+ // CloudEventsEventSpecVersionKey is the attribute Key conforming to the
+ // "cloudevents.event_spec_version" semantic conventions. It represents the
+ // [version of the CloudEvents specification] which the event uses.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 1.0
+ //
+ // [version of the CloudEvents specification]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion
+ CloudEventsEventSpecVersionKey = attribute.Key("cloudevents.event_spec_version")
+
+ // CloudEventsEventSubjectKey is the attribute Key conforming to the
+ // "cloudevents.event_subject" semantic conventions. It represents the [subject]
+ // of the event in the context of the event producer (identified by source).
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: mynewfile.jpg
+ //
+ // [subject]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject
+ CloudEventsEventSubjectKey = attribute.Key("cloudevents.event_subject")
+
+ // CloudEventsEventTypeKey is the attribute Key conforming to the
+ // "cloudevents.event_type" semantic conventions. It represents the [event_type]
+ // contains a value describing the type of event related to the originating
+ // occurrence.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "com.github.pull_request.opened", "com.example.object.deleted.v2"
+ //
+ // [event_type]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type
+ CloudEventsEventTypeKey = attribute.Key("cloudevents.event_type")
+)
+
+// CloudEventsEventID returns an attribute KeyValue conforming to the
+// "cloudevents.event_id" semantic conventions. It represents the [event_id]
+// uniquely identifies the event.
+//
+// [event_id]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id
+func CloudEventsEventID(val string) attribute.KeyValue {
+ return CloudEventsEventIDKey.String(val)
+}
+
+// CloudEventsEventSource returns an attribute KeyValue conforming to the
+// "cloudevents.event_source" semantic conventions. It represents the [source]
+// identifies the context in which an event happened.
+//
+// [source]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1
+func CloudEventsEventSource(val string) attribute.KeyValue {
+ return CloudEventsEventSourceKey.String(val)
+}
+
+// CloudEventsEventSpecVersion returns an attribute KeyValue conforming to the
+// "cloudevents.event_spec_version" semantic conventions. It represents the
+// [version of the CloudEvents specification] which the event uses.
+//
+// [version of the CloudEvents specification]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion
+func CloudEventsEventSpecVersion(val string) attribute.KeyValue {
+ return CloudEventsEventSpecVersionKey.String(val)
+}
+
+// CloudEventsEventSubject returns an attribute KeyValue conforming to the
+// "cloudevents.event_subject" semantic conventions. It represents the [subject]
+// of the event in the context of the event producer (identified by source).
+//
+// [subject]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject
+func CloudEventsEventSubject(val string) attribute.KeyValue {
+ return CloudEventsEventSubjectKey.String(val)
+}
+
+// CloudEventsEventType returns an attribute KeyValue conforming to the
+// "cloudevents.event_type" semantic conventions. It represents the [event_type]
+// contains a value describing the type of event related to the originating
+// occurrence.
+//
+// [event_type]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type
+func CloudEventsEventType(val string) attribute.KeyValue {
+ return CloudEventsEventTypeKey.String(val)
+}
+
+// Namespace: cloudfoundry
+const (
+ // CloudFoundryAppIDKey is the attribute Key conforming to the
+ // "cloudfoundry.app.id" semantic conventions. It represents the guid of the
+ // application.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d"
+ // Note: Application instrumentation should use the value from environment
+ // variable `VCAP_APPLICATION.application_id`. This is the same value as
+ // reported by `cf app --guid`.
+ CloudFoundryAppIDKey = attribute.Key("cloudfoundry.app.id")
+
+ // CloudFoundryAppInstanceIDKey is the attribute Key conforming to the
+ // "cloudfoundry.app.instance.id" semantic conventions. It represents the index
+ // of the application instance. 0 when just one instance is active.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "0", "1"
+ // Note: CloudFoundry defines the `instance_id` in the [Loggregator v2 envelope]
+ // .
+ // It is used for logs and metrics emitted by CloudFoundry. It is
+ // supposed to contain the application instance index for applications
+ // deployed on the runtime.
+ //
+ // Application instrumentation should use the value from environment
+ // variable `CF_INSTANCE_INDEX`.
+ //
+ // [Loggregator v2 envelope]: https://github.com/cloudfoundry/loggregator-api#v2-envelope
+ CloudFoundryAppInstanceIDKey = attribute.Key("cloudfoundry.app.instance.id")
+
+ // CloudFoundryAppNameKey is the attribute Key conforming to the
+ // "cloudfoundry.app.name" semantic conventions. It represents the name of the
+ // application.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "my-app-name"
+ // Note: Application instrumentation should use the value from environment
+ // variable `VCAP_APPLICATION.application_name`. This is the same value
+ // as reported by `cf apps`.
+ CloudFoundryAppNameKey = attribute.Key("cloudfoundry.app.name")
+
+ // CloudFoundryOrgIDKey is the attribute Key conforming to the
+ // "cloudfoundry.org.id" semantic conventions. It represents the guid of the
+ // CloudFoundry org the application is running in.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d"
+ // Note: Application instrumentation should use the value from environment
+ // variable `VCAP_APPLICATION.org_id`. This is the same value as
+ // reported by `cf org --guid`.
+ CloudFoundryOrgIDKey = attribute.Key("cloudfoundry.org.id")
+
+ // CloudFoundryOrgNameKey is the attribute Key conforming to the
+ // "cloudfoundry.org.name" semantic conventions. It represents the name of the
+ // CloudFoundry organization the app is running in.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "my-org-name"
+ // Note: Application instrumentation should use the value from environment
+ // variable `VCAP_APPLICATION.org_name`. This is the same value as
+ // reported by `cf orgs`.
+ CloudFoundryOrgNameKey = attribute.Key("cloudfoundry.org.name")
+
+ // CloudFoundryProcessIDKey is the attribute Key conforming to the
+ // "cloudfoundry.process.id" semantic conventions. It represents the UID
+ // identifying the process.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d"
+ // Note: Application instrumentation should use the value from environment
+ // variable `VCAP_APPLICATION.process_id`. It is supposed to be equal to
+ // `VCAP_APPLICATION.app_id` for applications deployed to the runtime.
+ // For system components, this could be the actual PID.
+ CloudFoundryProcessIDKey = attribute.Key("cloudfoundry.process.id")
+
+ // CloudFoundryProcessTypeKey is the attribute Key conforming to the
+ // "cloudfoundry.process.type" semantic conventions. It represents the type of
+ // process.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "web"
+ // Note: CloudFoundry applications can consist of multiple jobs. Usually the
+ // main process will be of type `web`. There can be additional background
+ // tasks or side-cars with different process types.
+ CloudFoundryProcessTypeKey = attribute.Key("cloudfoundry.process.type")
+
+ // CloudFoundrySpaceIDKey is the attribute Key conforming to the
+ // "cloudfoundry.space.id" semantic conventions. It represents the guid of the
+ // CloudFoundry space the application is running in.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d"
+ // Note: Application instrumentation should use the value from environment
+ // variable `VCAP_APPLICATION.space_id`. This is the same value as
+ // reported by `cf space --guid`.
+ CloudFoundrySpaceIDKey = attribute.Key("cloudfoundry.space.id")
+
+ // CloudFoundrySpaceNameKey is the attribute Key conforming to the
+ // "cloudfoundry.space.name" semantic conventions. It represents the name of the
+ // CloudFoundry space the application is running in.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "my-space-name"
+ // Note: Application instrumentation should use the value from environment
+ // variable `VCAP_APPLICATION.space_name`. This is the same value as
+ // reported by `cf spaces`.
+ CloudFoundrySpaceNameKey = attribute.Key("cloudfoundry.space.name")
+
+ // CloudFoundrySystemIDKey is the attribute Key conforming to the
+ // "cloudfoundry.system.id" semantic conventions. It represents a guid or
+ // another name describing the event source.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "cf/gorouter"
+ // Note: CloudFoundry defines the `source_id` in the [Loggregator v2 envelope].
+ // It is used for logs and metrics emitted by CloudFoundry. It is
+ // supposed to contain the component name, e.g. "gorouter", for
+ // CloudFoundry components.
+ //
+ // When system components are instrumented, values from the
+ // [Bosh spec]
+ // should be used. The `system.id` should be set to
+ // `spec.deployment/spec.name`.
+ //
+ // [Loggregator v2 envelope]: https://github.com/cloudfoundry/loggregator-api#v2-envelope
+ // [Bosh spec]: https://bosh.io/docs/jobs/#properties-spec
+ CloudFoundrySystemIDKey = attribute.Key("cloudfoundry.system.id")
+
+ // CloudFoundrySystemInstanceIDKey is the attribute Key conforming to the
+ // "cloudfoundry.system.instance.id" semantic conventions. It represents a guid
+ // describing the concrete instance of the event source.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d"
+ // Note: CloudFoundry defines the `instance_id` in the [Loggregator v2 envelope]
+ // .
+ // It is used for logs and metrics emitted by CloudFoundry. It is
+ // supposed to contain the vm id for CloudFoundry components.
+ //
+ // When system components are instrumented, values from the
+ // [Bosh spec]
+ // should be used. The `system.instance.id` should be set to `spec.id`.
+ //
+ // [Loggregator v2 envelope]: https://github.com/cloudfoundry/loggregator-api#v2-envelope
+ // [Bosh spec]: https://bosh.io/docs/jobs/#properties-spec
+ CloudFoundrySystemInstanceIDKey = attribute.Key("cloudfoundry.system.instance.id")
+)
+
+// CloudFoundryAppID returns an attribute KeyValue conforming to the
+// "cloudfoundry.app.id" semantic conventions. It represents the guid of the
+// application.
+func CloudFoundryAppID(val string) attribute.KeyValue {
+ return CloudFoundryAppIDKey.String(val)
+}
+
+// CloudFoundryAppInstanceID returns an attribute KeyValue conforming to the
+// "cloudfoundry.app.instance.id" semantic conventions. It represents the index
+// of the application instance. 0 when just one instance is active.
+func CloudFoundryAppInstanceID(val string) attribute.KeyValue {
+ return CloudFoundryAppInstanceIDKey.String(val)
+}
+
+// CloudFoundryAppName returns an attribute KeyValue conforming to the
+// "cloudfoundry.app.name" semantic conventions. It represents the name of the
+// application.
+func CloudFoundryAppName(val string) attribute.KeyValue {
+ return CloudFoundryAppNameKey.String(val)
+}
+
+// CloudFoundryOrgID returns an attribute KeyValue conforming to the
+// "cloudfoundry.org.id" semantic conventions. It represents the guid of the
+// CloudFoundry org the application is running in.
+func CloudFoundryOrgID(val string) attribute.KeyValue {
+ return CloudFoundryOrgIDKey.String(val)
+}
+
+// CloudFoundryOrgName returns an attribute KeyValue conforming to the
+// "cloudfoundry.org.name" semantic conventions. It represents the name of the
+// CloudFoundry organization the app is running in.
+func CloudFoundryOrgName(val string) attribute.KeyValue {
+ return CloudFoundryOrgNameKey.String(val)
+}
+
+// CloudFoundryProcessID returns an attribute KeyValue conforming to the
+// "cloudfoundry.process.id" semantic conventions. It represents the UID
+// identifying the process.
+func CloudFoundryProcessID(val string) attribute.KeyValue {
+ return CloudFoundryProcessIDKey.String(val)
+}
+
+// CloudFoundryProcessType returns an attribute KeyValue conforming to the
+// "cloudfoundry.process.type" semantic conventions. It represents the type of
+// process.
+func CloudFoundryProcessType(val string) attribute.KeyValue {
+ return CloudFoundryProcessTypeKey.String(val)
+}
+
+// CloudFoundrySpaceID returns an attribute KeyValue conforming to the
+// "cloudfoundry.space.id" semantic conventions. It represents the guid of the
+// CloudFoundry space the application is running in.
+func CloudFoundrySpaceID(val string) attribute.KeyValue {
+ return CloudFoundrySpaceIDKey.String(val)
+}
+
+// CloudFoundrySpaceName returns an attribute KeyValue conforming to the
+// "cloudfoundry.space.name" semantic conventions. It represents the name of the
+// CloudFoundry space the application is running in.
+func CloudFoundrySpaceName(val string) attribute.KeyValue {
+ return CloudFoundrySpaceNameKey.String(val)
+}
+
+// CloudFoundrySystemID returns an attribute KeyValue conforming to the
+// "cloudfoundry.system.id" semantic conventions. It represents a guid or another
+// name describing the event source.
+func CloudFoundrySystemID(val string) attribute.KeyValue {
+ return CloudFoundrySystemIDKey.String(val)
+}
+
+// CloudFoundrySystemInstanceID returns an attribute KeyValue conforming to the
+// "cloudfoundry.system.instance.id" semantic conventions. It represents a guid
+// describing the concrete instance of the event source.
+func CloudFoundrySystemInstanceID(val string) attribute.KeyValue {
+ return CloudFoundrySystemInstanceIDKey.String(val)
+}
+
+// Namespace: code
+const (
+ // CodeColumnNumberKey is the attribute Key conforming to the
+ // "code.column.number" semantic conventions. It represents the column number in
+ // `code.file.path` best representing the operation. It SHOULD point within the
+ // code unit named in `code.function.name`. This attribute MUST NOT be used on
+ // the Profile signal since the data is already captured in 'message Line'. This
+ // constraint is imposed to prevent redundancy and maintain data integrity.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ CodeColumnNumberKey = attribute.Key("code.column.number")
+
+ // CodeFilePathKey is the attribute Key conforming to the "code.file.path"
+ // semantic conventions. It represents the source code file name that identifies
+ // the code unit as uniquely as possible (preferably an absolute file path).
+ // This attribute MUST NOT be used on the Profile signal since the data is
+ // already captured in 'message Function'. This constraint is imposed to prevent
+ // redundancy and maintain data integrity.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: /usr/local/MyApplication/content_root/app/index.php
+ CodeFilePathKey = attribute.Key("code.file.path")
+
+ // CodeFunctionNameKey is the attribute Key conforming to the
+ // "code.function.name" semantic conventions. It represents the method or
+ // function fully-qualified name without arguments. The value should fit the
+ // natural representation of the language runtime, which is also likely the same
+ // used within `code.stacktrace` attribute value. This attribute MUST NOT be
+ // used on the Profile signal since the data is already captured in 'message
+ // Function'. This constraint is imposed to prevent redundancy and maintain data
+ // integrity.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "com.example.MyHttpService.serveRequest",
+ // "GuzzleHttp\Client::transfer", "fopen"
+ // Note: Values and format depends on each language runtime, thus it is
+ // impossible to provide an exhaustive list of examples.
+ // The values are usually the same (or prefixes of) the ones found in native
+ // stack trace representation stored in
+ // `code.stacktrace` without information on arguments.
+ //
+ // Examples:
+ //
+ // - Java method: `com.example.MyHttpService.serveRequest`
+ // - Java anonymous class method: `com.mycompany.Main$1.myMethod`
+ // - Java lambda method:
+ // `com.mycompany.Main$$Lambda/0x0000748ae4149c00.myMethod`
+ // - PHP function: `GuzzleHttp\Client::transfer`
+ // - Go function: `github.com/my/repo/pkg.foo.func5`
+ // - Elixir: `OpenTelemetry.Ctx.new`
+ // - Erlang: `opentelemetry_ctx:new`
+ // - Rust: `playground::my_module::my_cool_func`
+ // - C function: `fopen`
+ CodeFunctionNameKey = attribute.Key("code.function.name")
+
+ // CodeLineNumberKey is the attribute Key conforming to the "code.line.number"
+ // semantic conventions. It represents the line number in `code.file.path` best
+ // representing the operation. It SHOULD point within the code unit named in
+ // `code.function.name`. This attribute MUST NOT be used on the Profile signal
+ // since the data is already captured in 'message Line'. This constraint is
+ // imposed to prevent redundancy and maintain data integrity.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ CodeLineNumberKey = attribute.Key("code.line.number")
+
+ // CodeStacktraceKey is the attribute Key conforming to the "code.stacktrace"
+ // semantic conventions. It represents a stacktrace as a string in the natural
+ // representation for the language runtime. The representation is identical to
+ // [`exception.stacktrace`]. This attribute MUST NOT be used on the Profile
+ // signal since the data is already captured in 'message Location'. This
+ // constraint is imposed to prevent redundancy and maintain data integrity.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at
+ // com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at
+ // com.example.GenerateTrace.main(GenerateTrace.java:5)
+ //
+ // [`exception.stacktrace`]: /docs/exceptions/exceptions-spans.md#stacktrace-representation
+ CodeStacktraceKey = attribute.Key("code.stacktrace")
+)
+
+// CodeColumnNumber returns an attribute KeyValue conforming to the
+// "code.column.number" semantic conventions. It represents the column number in
+// `code.file.path` best representing the operation. It SHOULD point within the
+// code unit named in `code.function.name`. This attribute MUST NOT be used on
+// the Profile signal since the data is already captured in 'message Line'. This
+// constraint is imposed to prevent redundancy and maintain data integrity.
+func CodeColumnNumber(val int) attribute.KeyValue {
+ return CodeColumnNumberKey.Int(val)
+}
+
+// CodeFilePath returns an attribute KeyValue conforming to the "code.file.path"
+// semantic conventions. It represents the source code file name that identifies
+// the code unit as uniquely as possible (preferably an absolute file path). This
+// attribute MUST NOT be used on the Profile signal since the data is already
+// captured in 'message Function'. This constraint is imposed to prevent
+// redundancy and maintain data integrity.
+func CodeFilePath(val string) attribute.KeyValue {
+ return CodeFilePathKey.String(val)
+}
+
+// CodeFunctionName returns an attribute KeyValue conforming to the
+// "code.function.name" semantic conventions. It represents the method or
+// function fully-qualified name without arguments. The value should fit the
+// natural representation of the language runtime, which is also likely the same
+// used within `code.stacktrace` attribute value. This attribute MUST NOT be used
+// on the Profile signal since the data is already captured in 'message
+// Function'. This constraint is imposed to prevent redundancy and maintain data
+// integrity.
+func CodeFunctionName(val string) attribute.KeyValue {
+ return CodeFunctionNameKey.String(val)
+}
+
+// CodeLineNumber returns an attribute KeyValue conforming to the
+// "code.line.number" semantic conventions. It represents the line number in
+// `code.file.path` best representing the operation. It SHOULD point within the
+// code unit named in `code.function.name`. This attribute MUST NOT be used on
+// the Profile signal since the data is already captured in 'message Line'. This
+// constraint is imposed to prevent redundancy and maintain data integrity.
+func CodeLineNumber(val int) attribute.KeyValue {
+ return CodeLineNumberKey.Int(val)
+}
+
+// CodeStacktrace returns an attribute KeyValue conforming to the
+// "code.stacktrace" semantic conventions. It represents a stacktrace as a string
+// in the natural representation for the language runtime. The representation is
+// identical to [`exception.stacktrace`]. This attribute MUST NOT be used on the
+// Profile signal since the data is already captured in 'message Location'. This
+// constraint is imposed to prevent redundancy and maintain data integrity.
+//
+// [`exception.stacktrace`]: /docs/exceptions/exceptions-spans.md#stacktrace-representation
+func CodeStacktrace(val string) attribute.KeyValue {
+ return CodeStacktraceKey.String(val)
+}
+
+// Namespace: container
+const (
+ // ContainerCommandKey is the attribute Key conforming to the
+ // "container.command" semantic conventions. It represents the command used to
+ // run the container (i.e. the command name).
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "otelcontribcol"
+ // Note: If using embedded credentials or sensitive data, it is recommended to
+ // remove them to prevent potential leakage.
+ ContainerCommandKey = attribute.Key("container.command")
+
+ // ContainerCommandArgsKey is the attribute Key conforming to the
+ // "container.command_args" semantic conventions. It represents the all the
+ // command arguments (including the command/executable itself) run by the
+ // container.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "otelcontribcol", "--config", "config.yaml"
+ ContainerCommandArgsKey = attribute.Key("container.command_args")
+
+ // ContainerCommandLineKey is the attribute Key conforming to the
+ // "container.command_line" semantic conventions. It represents the full command
+ // run by the container as a single string representing the full command.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "otelcontribcol --config config.yaml"
+ ContainerCommandLineKey = attribute.Key("container.command_line")
+
+ // ContainerCSIPluginNameKey is the attribute Key conforming to the
+ // "container.csi.plugin.name" semantic conventions. It represents the name of
+ // the CSI ([Container Storage Interface]) plugin used by the volume.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "pd.csi.storage.gke.io"
+ // Note: This can sometimes be referred to as a "driver" in CSI implementations.
+ // This should represent the `name` field of the GetPluginInfo RPC.
+ //
+ // [Container Storage Interface]: https://github.com/container-storage-interface/spec
+ ContainerCSIPluginNameKey = attribute.Key("container.csi.plugin.name")
+
+ // ContainerCSIVolumeIDKey is the attribute Key conforming to the
+ // "container.csi.volume.id" semantic conventions. It represents the unique
+ // volume ID returned by the CSI ([Container Storage Interface]) plugin.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "projects/my-gcp-project/zones/my-gcp-zone/disks/my-gcp-disk"
+ // Note: This can sometimes be referred to as a "volume handle" in CSI
+ // implementations. This should represent the `Volume.volume_id` field in CSI
+ // spec.
+ //
+ // [Container Storage Interface]: https://github.com/container-storage-interface/spec
+ ContainerCSIVolumeIDKey = attribute.Key("container.csi.volume.id")
+
+ // ContainerIDKey is the attribute Key conforming to the "container.id" semantic
+ // conventions. It represents the container ID. Usually a UUID, as for example
+ // used to [identify Docker containers]. The UUID might be abbreviated.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "a3bf90e006b2"
+ //
+ // [identify Docker containers]: https://docs.docker.com/engine/containers/run/#container-identification
+ ContainerIDKey = attribute.Key("container.id")
+
+ // ContainerImageIDKey is the attribute Key conforming to the
+ // "container.image.id" semantic conventions. It represents the runtime specific
+ // image identifier. Usually a hash algorithm followed by a UUID.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // "sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f"
+ // Note: Docker defines a sha256 of the image id; `container.image.id`
+ // corresponds to the `Image` field from the Docker container inspect [API]
+ // endpoint.
+ // K8s defines a link to the container registry repository with digest
+ // `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`
+ // .
+ // The ID is assigned by the container runtime and can vary in different
+ // environments. Consider using `oci.manifest.digest` if it is important to
+ // identify the same image in different environments/runtimes.
+ //
+ // [API]: https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect
+ ContainerImageIDKey = attribute.Key("container.image.id")
+
+ // ContainerImageNameKey is the attribute Key conforming to the
+ // "container.image.name" semantic conventions. It represents the name of the
+ // image the container was built on.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "gcr.io/opentelemetry/operator"
+ ContainerImageNameKey = attribute.Key("container.image.name")
+
+ // ContainerImageRepoDigestsKey is the attribute Key conforming to the
+ // "container.image.repo_digests" semantic conventions. It represents the repo
+ // digests of the container image as provided by the container runtime.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb",
+ // "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578"
+ // Note: [Docker] and [CRI] report those under the `RepoDigests` field.
+ //
+ // [Docker]: https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect
+ // [CRI]: https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238
+ ContainerImageRepoDigestsKey = attribute.Key("container.image.repo_digests")
+
+ // ContainerImageTagsKey is the attribute Key conforming to the
+ // "container.image.tags" semantic conventions. It represents the container
+ // image tags. An example can be found in [Docker Image Inspect]. Should be only
+ // the `` section of the full name for example from
+ // `registry.example.com/my-org/my-image:`.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "v1.27.1", "3.5.7-0"
+ //
+ // [Docker Image Inspect]: https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect
+ ContainerImageTagsKey = attribute.Key("container.image.tags")
+
+ // ContainerNameKey is the attribute Key conforming to the "container.name"
+ // semantic conventions. It represents the container name used by container
+ // runtime.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "opentelemetry-autoconf"
+ ContainerNameKey = attribute.Key("container.name")
+
+ // ContainerRuntimeDescriptionKey is the attribute Key conforming to the
+ // "container.runtime.description" semantic conventions. It represents a
+ // description about the runtime which could include, for example details about
+ // the CRI/API version being used or other customisations.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "docker://19.3.1 - CRI: 1.22.0"
+ ContainerRuntimeDescriptionKey = attribute.Key("container.runtime.description")
+
+ // ContainerRuntimeNameKey is the attribute Key conforming to the
+ // "container.runtime.name" semantic conventions. It represents the container
+ // runtime managing this container.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "docker", "containerd", "rkt"
+ ContainerRuntimeNameKey = attribute.Key("container.runtime.name")
+
+ // ContainerRuntimeVersionKey is the attribute Key conforming to the
+ // "container.runtime.version" semantic conventions. It represents the version
+ // of the runtime of this process, as returned by the runtime without
+ // modification.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 1.0.0
+ ContainerRuntimeVersionKey = attribute.Key("container.runtime.version")
+)
+
+// ContainerCommand returns an attribute KeyValue conforming to the
+// "container.command" semantic conventions. It represents the command used to
+// run the container (i.e. the command name).
+func ContainerCommand(val string) attribute.KeyValue {
+ return ContainerCommandKey.String(val)
+}
+
+// ContainerCommandArgs returns an attribute KeyValue conforming to the
+// "container.command_args" semantic conventions. It represents the all the
+// command arguments (including the command/executable itself) run by the
+// container.
+func ContainerCommandArgs(val ...string) attribute.KeyValue {
+ return ContainerCommandArgsKey.StringSlice(val)
+}
+
+// ContainerCommandLine returns an attribute KeyValue conforming to the
+// "container.command_line" semantic conventions. It represents the full command
+// run by the container as a single string representing the full command.
+func ContainerCommandLine(val string) attribute.KeyValue {
+ return ContainerCommandLineKey.String(val)
+}
+
+// ContainerCSIPluginName returns an attribute KeyValue conforming to the
+// "container.csi.plugin.name" semantic conventions. It represents the name of
+// the CSI ([Container Storage Interface]) plugin used by the volume.
+//
+// [Container Storage Interface]: https://github.com/container-storage-interface/spec
+func ContainerCSIPluginName(val string) attribute.KeyValue {
+ return ContainerCSIPluginNameKey.String(val)
+}
+
+// ContainerCSIVolumeID returns an attribute KeyValue conforming to the
+// "container.csi.volume.id" semantic conventions. It represents the unique
+// volume ID returned by the CSI ([Container Storage Interface]) plugin.
+//
+// [Container Storage Interface]: https://github.com/container-storage-interface/spec
+func ContainerCSIVolumeID(val string) attribute.KeyValue {
+ return ContainerCSIVolumeIDKey.String(val)
+}
+
+// ContainerID returns an attribute KeyValue conforming to the "container.id"
+// semantic conventions. It represents the container ID. Usually a UUID, as for
+// example used to [identify Docker containers]. The UUID might be abbreviated.
+//
+// [identify Docker containers]: https://docs.docker.com/engine/containers/run/#container-identification
+func ContainerID(val string) attribute.KeyValue {
+ return ContainerIDKey.String(val)
+}
+
+// ContainerImageID returns an attribute KeyValue conforming to the
+// "container.image.id" semantic conventions. It represents the runtime specific
+// image identifier. Usually a hash algorithm followed by a UUID.
+func ContainerImageID(val string) attribute.KeyValue {
+ return ContainerImageIDKey.String(val)
+}
+
+// ContainerImageName returns an attribute KeyValue conforming to the
+// "container.image.name" semantic conventions. It represents the name of the
+// image the container was built on.
+func ContainerImageName(val string) attribute.KeyValue {
+ return ContainerImageNameKey.String(val)
+}
+
+// ContainerImageRepoDigests returns an attribute KeyValue conforming to the
+// "container.image.repo_digests" semantic conventions. It represents the repo
+// digests of the container image as provided by the container runtime.
+func ContainerImageRepoDigests(val ...string) attribute.KeyValue {
+ return ContainerImageRepoDigestsKey.StringSlice(val)
+}
+
+// ContainerImageTags returns an attribute KeyValue conforming to the
+// "container.image.tags" semantic conventions. It represents the container image
+// tags. An example can be found in [Docker Image Inspect]. Should be only the
+// `` section of the full name for example from
+// `registry.example.com/my-org/my-image:`.
+//
+// [Docker Image Inspect]: https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect
+func ContainerImageTags(val ...string) attribute.KeyValue {
+ return ContainerImageTagsKey.StringSlice(val)
+}
+
+// ContainerLabel returns an attribute KeyValue conforming to the
+// "container.label" semantic conventions. It represents the container labels,
+// `` being the label name, the value being the label value.
+func ContainerLabel(key string, val string) attribute.KeyValue {
+ return attribute.String("container.label."+key, val)
+}
+
+// ContainerName returns an attribute KeyValue conforming to the "container.name"
+// semantic conventions. It represents the container name used by container
+// runtime.
+func ContainerName(val string) attribute.KeyValue {
+ return ContainerNameKey.String(val)
+}
+
+// ContainerRuntimeDescription returns an attribute KeyValue conforming to the
+// "container.runtime.description" semantic conventions. It represents a
+// description about the runtime which could include, for example details about
+// the CRI/API version being used or other customisations.
+func ContainerRuntimeDescription(val string) attribute.KeyValue {
+ return ContainerRuntimeDescriptionKey.String(val)
+}
+
+// ContainerRuntimeName returns an attribute KeyValue conforming to the
+// "container.runtime.name" semantic conventions. It represents the container
+// runtime managing this container.
+func ContainerRuntimeName(val string) attribute.KeyValue {
+ return ContainerRuntimeNameKey.String(val)
+}
+
+// ContainerRuntimeVersion returns an attribute KeyValue conforming to the
+// "container.runtime.version" semantic conventions. It represents the version of
+// the runtime of this process, as returned by the runtime without modification.
+func ContainerRuntimeVersion(val string) attribute.KeyValue {
+ return ContainerRuntimeVersionKey.String(val)
+}
+
+// Namespace: cpu
+const (
+ // CPULogicalNumberKey is the attribute Key conforming to the
+ // "cpu.logical_number" semantic conventions. It represents the logical CPU
+ // number [0..n-1].
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 1
+ CPULogicalNumberKey = attribute.Key("cpu.logical_number")
+
+ // CPUModeKey is the attribute Key conforming to the "cpu.mode" semantic
+ // conventions. It represents the mode of the CPU.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "user", "system"
+ CPUModeKey = attribute.Key("cpu.mode")
+)
+
+// CPULogicalNumber returns an attribute KeyValue conforming to the
+// "cpu.logical_number" semantic conventions. It represents the logical CPU
+// number [0..n-1].
+func CPULogicalNumber(val int) attribute.KeyValue {
+ return CPULogicalNumberKey.Int(val)
+}
+
+// Enum values for cpu.mode
+var (
+ // User
+ // Stability: development
+ CPUModeUser = CPUModeKey.String("user")
+ // System
+ // Stability: development
+ CPUModeSystem = CPUModeKey.String("system")
+ // Nice
+ // Stability: development
+ CPUModeNice = CPUModeKey.String("nice")
+ // Idle
+ // Stability: development
+ CPUModeIdle = CPUModeKey.String("idle")
+ // IO Wait
+ // Stability: development
+ CPUModeIOWait = CPUModeKey.String("iowait")
+ // Interrupt
+ // Stability: development
+ CPUModeInterrupt = CPUModeKey.String("interrupt")
+ // Steal
+ // Stability: development
+ CPUModeSteal = CPUModeKey.String("steal")
+ // Kernel
+ // Stability: development
+ CPUModeKernel = CPUModeKey.String("kernel")
+)
+
+// Namespace: db
+const (
+ // DBClientConnectionPoolNameKey is the attribute Key conforming to the
+ // "db.client.connection.pool.name" semantic conventions. It represents the name
+ // of the connection pool; unique within the instrumented application. In case
+ // the connection pool implementation doesn't provide a name, instrumentation
+ // SHOULD use a combination of parameters that would make the name unique, for
+ // example, combining attributes `server.address`, `server.port`, and
+ // `db.namespace`, formatted as `server.address:server.port/db.namespace`.
+ // Instrumentations that generate connection pool name following different
+ // patterns SHOULD document it.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "myDataSource"
+ DBClientConnectionPoolNameKey = attribute.Key("db.client.connection.pool.name")
+
+ // DBClientConnectionStateKey is the attribute Key conforming to the
+ // "db.client.connection.state" semantic conventions. It represents the state of
+ // a connection in the pool.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "idle"
+ DBClientConnectionStateKey = attribute.Key("db.client.connection.state")
+
+ // DBCollectionNameKey is the attribute Key conforming to the
+ // "db.collection.name" semantic conventions. It represents the name of a
+ // collection (table, container) within the database.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "public.users", "customers"
+ // Note: It is RECOMMENDED to capture the value as provided by the application
+ // without attempting to do any case normalization.
+ //
+ // The collection name SHOULD NOT be extracted from `db.query.text`,
+ // when the database system supports query text with multiple collections
+ // in non-batch operations.
+ //
+ // For batch operations, if the individual operations are known to have the same
+ // collection name then that collection name SHOULD be used.
+ DBCollectionNameKey = attribute.Key("db.collection.name")
+
+ // DBNamespaceKey is the attribute Key conforming to the "db.namespace" semantic
+ // conventions. It represents the name of the database, fully qualified within
+ // the server address and port.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "customers", "test.users"
+ // Note: If a database system has multiple namespace components, they SHOULD be
+ // concatenated from the most general to the most specific namespace component,
+ // using `|` as a separator between the components. Any missing components (and
+ // their associated separators) SHOULD be omitted.
+ // Semantic conventions for individual database systems SHOULD document what
+ // `db.namespace` means in the context of that system.
+ // It is RECOMMENDED to capture the value as provided by the application without
+ // attempting to do any case normalization.
+ DBNamespaceKey = attribute.Key("db.namespace")
+
+ // DBOperationBatchSizeKey is the attribute Key conforming to the
+ // "db.operation.batch.size" semantic conventions. It represents the number of
+ // queries included in a batch operation.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: 2, 3, 4
+ // Note: Operations are only considered batches when they contain two or more
+ // operations, and so `db.operation.batch.size` SHOULD never be `1`.
+ DBOperationBatchSizeKey = attribute.Key("db.operation.batch.size")
+
+ // DBOperationNameKey is the attribute Key conforming to the "db.operation.name"
+ // semantic conventions. It represents the name of the operation or command
+ // being executed.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "findAndModify", "HMSET", "SELECT"
+ // Note: It is RECOMMENDED to capture the value as provided by the application
+ // without attempting to do any case normalization.
+ //
+ // The operation name SHOULD NOT be extracted from `db.query.text`,
+ // when the database system supports query text with multiple operations
+ // in non-batch operations.
+ //
+ // If spaces can occur in the operation name, multiple consecutive spaces
+ // SHOULD be normalized to a single space.
+ //
+ // For batch operations, if the individual operations are known to have the same
+ // operation name
+ // then that operation name SHOULD be used prepended by `BATCH `,
+ // otherwise `db.operation.name` SHOULD be `BATCH` or some other database
+ // system specific term if more applicable.
+ DBOperationNameKey = attribute.Key("db.operation.name")
+
+ // DBQuerySummaryKey is the attribute Key conforming to the "db.query.summary"
+ // semantic conventions. It represents the low cardinality summary of a database
+ // query.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "SELECT wuser_table", "INSERT shipping_details SELECT orders", "get
+ // user by id"
+ // Note: The query summary describes a class of database queries and is useful
+ // as a grouping key, especially when analyzing telemetry for database
+ // calls involving complex queries.
+ //
+ // Summary may be available to the instrumentation through
+ // instrumentation hooks or other means. If it is not available,
+ // instrumentations
+ // that support query parsing SHOULD generate a summary following
+ // [Generating query summary]
+ // section.
+ //
+ // [Generating query summary]: /docs/database/database-spans.md#generating-a-summary-of-the-query
+ DBQuerySummaryKey = attribute.Key("db.query.summary")
+
+ // DBQueryTextKey is the attribute Key conforming to the "db.query.text"
+ // semantic conventions. It represents the database query being executed.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "SELECT * FROM wuser_table where username = ?", "SET mykey ?"
+ // Note: For sanitization see [Sanitization of `db.query.text`].
+ // For batch operations, if the individual operations are known to have the same
+ // query text then that query text SHOULD be used, otherwise all of the
+ // individual query texts SHOULD be concatenated with separator `; ` or some
+ // other database system specific separator if more applicable.
+ // Parameterized query text SHOULD NOT be sanitized. Even though parameterized
+ // query text can potentially have sensitive data, by using a parameterized
+ // query the user is giving a strong signal that any sensitive data will be
+ // passed as parameter values, and the benefit to observability of capturing the
+ // static part of the query text by default outweighs the risk.
+ //
+ // [Sanitization of `db.query.text`]: /docs/database/database-spans.md#sanitization-of-dbquerytext
+ DBQueryTextKey = attribute.Key("db.query.text")
+
+ // DBResponseReturnedRowsKey is the attribute Key conforming to the
+ // "db.response.returned_rows" semantic conventions. It represents the number of
+ // rows returned by the operation.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 10, 30, 1000
+ DBResponseReturnedRowsKey = attribute.Key("db.response.returned_rows")
+
+ // DBResponseStatusCodeKey is the attribute Key conforming to the
+ // "db.response.status_code" semantic conventions. It represents the database
+ // response status code.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "102", "ORA-17002", "08P01", "404"
+ // Note: The status code returned by the database. Usually it represents an
+ // error code, but may also represent partial success, warning, or differentiate
+ // between various types of successful outcomes.
+ // Semantic conventions for individual database systems SHOULD document what
+ // `db.response.status_code` means in the context of that system.
+ DBResponseStatusCodeKey = attribute.Key("db.response.status_code")
+
+ // DBStoredProcedureNameKey is the attribute Key conforming to the
+ // "db.stored_procedure.name" semantic conventions. It represents the name of a
+ // stored procedure within the database.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "GetCustomer"
+ // Note: It is RECOMMENDED to capture the value as provided by the application
+ // without attempting to do any case normalization.
+ //
+ // For batch operations, if the individual operations are known to have the same
+ // stored procedure name then that stored procedure name SHOULD be used.
+ DBStoredProcedureNameKey = attribute.Key("db.stored_procedure.name")
+
+ // DBSystemNameKey is the attribute Key conforming to the "db.system.name"
+ // semantic conventions. It represents the database management system (DBMS)
+ // product as identified by the client instrumentation.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples:
+ // Note: The actual DBMS may differ from the one identified by the client. For
+ // example, when using PostgreSQL client libraries to connect to a CockroachDB,
+ // the `db.system.name` is set to `postgresql` based on the instrumentation's
+ // best knowledge.
+ DBSystemNameKey = attribute.Key("db.system.name")
+)
+
+// DBClientConnectionPoolName returns an attribute KeyValue conforming to the
+// "db.client.connection.pool.name" semantic conventions. It represents the name
+// of the connection pool; unique within the instrumented application. In case
+// the connection pool implementation doesn't provide a name, instrumentation
+// SHOULD use a combination of parameters that would make the name unique, for
+// example, combining attributes `server.address`, `server.port`, and
+// `db.namespace`, formatted as `server.address:server.port/db.namespace`.
+// Instrumentations that generate connection pool name following different
+// patterns SHOULD document it.
+func DBClientConnectionPoolName(val string) attribute.KeyValue {
+ return DBClientConnectionPoolNameKey.String(val)
+}
+
+// DBCollectionName returns an attribute KeyValue conforming to the
+// "db.collection.name" semantic conventions. It represents the name of a
+// collection (table, container) within the database.
+func DBCollectionName(val string) attribute.KeyValue {
+ return DBCollectionNameKey.String(val)
+}
+
+// DBNamespace returns an attribute KeyValue conforming to the "db.namespace"
+// semantic conventions. It represents the name of the database, fully qualified
+// within the server address and port.
+func DBNamespace(val string) attribute.KeyValue {
+ return DBNamespaceKey.String(val)
+}
+
+// DBOperationBatchSize returns an attribute KeyValue conforming to the
+// "db.operation.batch.size" semantic conventions. It represents the number of
+// queries included in a batch operation.
+func DBOperationBatchSize(val int) attribute.KeyValue {
+ return DBOperationBatchSizeKey.Int(val)
+}
+
+// DBOperationName returns an attribute KeyValue conforming to the
+// "db.operation.name" semantic conventions. It represents the name of the
+// operation or command being executed.
+func DBOperationName(val string) attribute.KeyValue {
+ return DBOperationNameKey.String(val)
+}
+
+// DBOperationParameter returns an attribute KeyValue conforming to the
+// "db.operation.parameter" semantic conventions. It represents a database
+// operation parameter, with `` being the parameter name, and the attribute
+// value being a string representation of the parameter value.
+func DBOperationParameter(key string, val string) attribute.KeyValue {
+ return attribute.String("db.operation.parameter."+key, val)
+}
+
+// DBQueryParameter returns an attribute KeyValue conforming to the
+// "db.query.parameter" semantic conventions. It represents a database query
+// parameter, with `` being the parameter name, and the attribute value
+// being a string representation of the parameter value.
+func DBQueryParameter(key string, val string) attribute.KeyValue {
+ return attribute.String("db.query.parameter."+key, val)
+}
+
+// DBQuerySummary returns an attribute KeyValue conforming to the
+// "db.query.summary" semantic conventions. It represents the low cardinality
+// summary of a database query.
+func DBQuerySummary(val string) attribute.KeyValue {
+ return DBQuerySummaryKey.String(val)
+}
+
+// DBQueryText returns an attribute KeyValue conforming to the "db.query.text"
+// semantic conventions. It represents the database query being executed.
+func DBQueryText(val string) attribute.KeyValue {
+ return DBQueryTextKey.String(val)
+}
+
+// DBResponseReturnedRows returns an attribute KeyValue conforming to the
+// "db.response.returned_rows" semantic conventions. It represents the number of
+// rows returned by the operation.
+func DBResponseReturnedRows(val int) attribute.KeyValue {
+ return DBResponseReturnedRowsKey.Int(val)
+}
+
+// DBResponseStatusCode returns an attribute KeyValue conforming to the
+// "db.response.status_code" semantic conventions. It represents the database
+// response status code.
+func DBResponseStatusCode(val string) attribute.KeyValue {
+ return DBResponseStatusCodeKey.String(val)
+}
+
+// DBStoredProcedureName returns an attribute KeyValue conforming to the
+// "db.stored_procedure.name" semantic conventions. It represents the name of a
+// stored procedure within the database.
+func DBStoredProcedureName(val string) attribute.KeyValue {
+ return DBStoredProcedureNameKey.String(val)
+}
+
+// Enum values for db.client.connection.state
+var (
+ // idle
+ // Stability: development
+ DBClientConnectionStateIdle = DBClientConnectionStateKey.String("idle")
+ // used
+ // Stability: development
+ DBClientConnectionStateUsed = DBClientConnectionStateKey.String("used")
+)
+
+// Enum values for db.system.name
+var (
+ // Some other SQL database. Fallback only.
+ // Stability: development
+ DBSystemNameOtherSQL = DBSystemNameKey.String("other_sql")
+ // [Adabas (Adaptable Database System)]
+ // Stability: development
+ //
+ // [Adabas (Adaptable Database System)]: https://documentation.softwareag.com/?pf=adabas
+ DBSystemNameSoftwareagAdabas = DBSystemNameKey.String("softwareag.adabas")
+ // [Actian Ingres]
+ // Stability: development
+ //
+ // [Actian Ingres]: https://www.actian.com/databases/ingres/
+ DBSystemNameActianIngres = DBSystemNameKey.String("actian.ingres")
+ // [Amazon DynamoDB]
+ // Stability: development
+ //
+ // [Amazon DynamoDB]: https://aws.amazon.com/pm/dynamodb/
+ DBSystemNameAWSDynamoDB = DBSystemNameKey.String("aws.dynamodb")
+ // [Amazon Redshift]
+ // Stability: development
+ //
+ // [Amazon Redshift]: https://aws.amazon.com/redshift/
+ DBSystemNameAWSRedshift = DBSystemNameKey.String("aws.redshift")
+ // [Azure Cosmos DB]
+ // Stability: development
+ //
+ // [Azure Cosmos DB]: https://learn.microsoft.com/azure/cosmos-db
+ DBSystemNameAzureCosmosDB = DBSystemNameKey.String("azure.cosmosdb")
+ // [InterSystems Caché]
+ // Stability: development
+ //
+ // [InterSystems Caché]: https://www.intersystems.com/products/cache/
+ DBSystemNameIntersystemsCache = DBSystemNameKey.String("intersystems.cache")
+ // [Apache Cassandra]
+ // Stability: development
+ //
+ // [Apache Cassandra]: https://cassandra.apache.org/
+ DBSystemNameCassandra = DBSystemNameKey.String("cassandra")
+ // [ClickHouse]
+ // Stability: development
+ //
+ // [ClickHouse]: https://clickhouse.com/
+ DBSystemNameClickHouse = DBSystemNameKey.String("clickhouse")
+ // [CockroachDB]
+ // Stability: development
+ //
+ // [CockroachDB]: https://www.cockroachlabs.com/
+ DBSystemNameCockroachDB = DBSystemNameKey.String("cockroachdb")
+ // [Couchbase]
+ // Stability: development
+ //
+ // [Couchbase]: https://www.couchbase.com/
+ DBSystemNameCouchbase = DBSystemNameKey.String("couchbase")
+ // [Apache CouchDB]
+ // Stability: development
+ //
+ // [Apache CouchDB]: https://couchdb.apache.org/
+ DBSystemNameCouchDB = DBSystemNameKey.String("couchdb")
+ // [Apache Derby]
+ // Stability: development
+ //
+ // [Apache Derby]: https://db.apache.org/derby/
+ DBSystemNameDerby = DBSystemNameKey.String("derby")
+ // [Elasticsearch]
+ // Stability: development
+ //
+ // [Elasticsearch]: https://www.elastic.co/elasticsearch
+ DBSystemNameElasticsearch = DBSystemNameKey.String("elasticsearch")
+ // [Firebird]
+ // Stability: development
+ //
+ // [Firebird]: https://www.firebirdsql.org/
+ DBSystemNameFirebirdSQL = DBSystemNameKey.String("firebirdsql")
+ // [Google Cloud Spanner]
+ // Stability: development
+ //
+ // [Google Cloud Spanner]: https://cloud.google.com/spanner
+ DBSystemNameGCPSpanner = DBSystemNameKey.String("gcp.spanner")
+ // [Apache Geode]
+ // Stability: development
+ //
+ // [Apache Geode]: https://geode.apache.org/
+ DBSystemNameGeode = DBSystemNameKey.String("geode")
+ // [H2 Database]
+ // Stability: development
+ //
+ // [H2 Database]: https://h2database.com/
+ DBSystemNameH2database = DBSystemNameKey.String("h2database")
+ // [Apache HBase]
+ // Stability: development
+ //
+ // [Apache HBase]: https://hbase.apache.org/
+ DBSystemNameHBase = DBSystemNameKey.String("hbase")
+ // [Apache Hive]
+ // Stability: development
+ //
+ // [Apache Hive]: https://hive.apache.org/
+ DBSystemNameHive = DBSystemNameKey.String("hive")
+ // [HyperSQL Database]
+ // Stability: development
+ //
+ // [HyperSQL Database]: https://hsqldb.org/
+ DBSystemNameHSQLDB = DBSystemNameKey.String("hsqldb")
+ // [IBM Db2]
+ // Stability: development
+ //
+ // [IBM Db2]: https://www.ibm.com/db2
+ DBSystemNameIBMDB2 = DBSystemNameKey.String("ibm.db2")
+ // [IBM Informix]
+ // Stability: development
+ //
+ // [IBM Informix]: https://www.ibm.com/products/informix
+ DBSystemNameIBMInformix = DBSystemNameKey.String("ibm.informix")
+ // [IBM Netezza]
+ // Stability: development
+ //
+ // [IBM Netezza]: https://www.ibm.com/products/netezza
+ DBSystemNameIBMNetezza = DBSystemNameKey.String("ibm.netezza")
+ // [InfluxDB]
+ // Stability: development
+ //
+ // [InfluxDB]: https://www.influxdata.com/
+ DBSystemNameInfluxDB = DBSystemNameKey.String("influxdb")
+ // [Instant]
+ // Stability: development
+ //
+ // [Instant]: https://www.instantdb.com/
+ DBSystemNameInstantDB = DBSystemNameKey.String("instantdb")
+ // [MariaDB]
+ // Stability: stable
+ //
+ // [MariaDB]: https://mariadb.org/
+ DBSystemNameMariaDB = DBSystemNameKey.String("mariadb")
+ // [Memcached]
+ // Stability: development
+ //
+ // [Memcached]: https://memcached.org/
+ DBSystemNameMemcached = DBSystemNameKey.String("memcached")
+ // [MongoDB]
+ // Stability: development
+ //
+ // [MongoDB]: https://www.mongodb.com/
+ DBSystemNameMongoDB = DBSystemNameKey.String("mongodb")
+ // [Microsoft SQL Server]
+ // Stability: stable
+ //
+ // [Microsoft SQL Server]: https://www.microsoft.com/sql-server
+ DBSystemNameMicrosoftSQLServer = DBSystemNameKey.String("microsoft.sql_server")
+ // [MySQL]
+ // Stability: stable
+ //
+ // [MySQL]: https://www.mysql.com/
+ DBSystemNameMySQL = DBSystemNameKey.String("mysql")
+ // [Neo4j]
+ // Stability: development
+ //
+ // [Neo4j]: https://neo4j.com/
+ DBSystemNameNeo4j = DBSystemNameKey.String("neo4j")
+ // [OpenSearch]
+ // Stability: development
+ //
+ // [OpenSearch]: https://opensearch.org/
+ DBSystemNameOpenSearch = DBSystemNameKey.String("opensearch")
+ // [Oracle Database]
+ // Stability: development
+ //
+ // [Oracle Database]: https://www.oracle.com/database/
+ DBSystemNameOracleDB = DBSystemNameKey.String("oracle.db")
+ // [PostgreSQL]
+ // Stability: stable
+ //
+ // [PostgreSQL]: https://www.postgresql.org/
+ DBSystemNamePostgreSQL = DBSystemNameKey.String("postgresql")
+ // [Redis]
+ // Stability: development
+ //
+ // [Redis]: https://redis.io/
+ DBSystemNameRedis = DBSystemNameKey.String("redis")
+ // [SAP HANA]
+ // Stability: development
+ //
+ // [SAP HANA]: https://www.sap.com/products/technology-platform/hana/what-is-sap-hana.html
+ DBSystemNameSAPHANA = DBSystemNameKey.String("sap.hana")
+ // [SAP MaxDB]
+ // Stability: development
+ //
+ // [SAP MaxDB]: https://maxdb.sap.com/
+ DBSystemNameSAPMaxDB = DBSystemNameKey.String("sap.maxdb")
+ // [SQLite]
+ // Stability: development
+ //
+ // [SQLite]: https://www.sqlite.org/
+ DBSystemNameSQLite = DBSystemNameKey.String("sqlite")
+ // [Teradata]
+ // Stability: development
+ //
+ // [Teradata]: https://www.teradata.com/
+ DBSystemNameTeradata = DBSystemNameKey.String("teradata")
+ // [Trino]
+ // Stability: development
+ //
+ // [Trino]: https://trino.io/
+ DBSystemNameTrino = DBSystemNameKey.String("trino")
+)
+
+// Namespace: deployment
+const (
+ // DeploymentEnvironmentNameKey is the attribute Key conforming to the
+ // "deployment.environment.name" semantic conventions. It represents the name of
+ // the [deployment environment] (aka deployment tier).
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "staging", "production"
+ // Note: `deployment.environment.name` does not affect the uniqueness
+ // constraints defined through
+ // the `service.namespace`, `service.name` and `service.instance.id` resource
+ // attributes.
+ // This implies that resources carrying the following attribute combinations
+ // MUST be
+ // considered to be identifying the same service:
+ //
+ // - `service.name=frontend`, `deployment.environment.name=production`
+ // - `service.name=frontend`, `deployment.environment.name=staging`.
+ //
+ //
+ // [deployment environment]: https://wikipedia.org/wiki/Deployment_environment
+ DeploymentEnvironmentNameKey = attribute.Key("deployment.environment.name")
+
+ // DeploymentIDKey is the attribute Key conforming to the "deployment.id"
+ // semantic conventions. It represents the id of the deployment.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "1208"
+ DeploymentIDKey = attribute.Key("deployment.id")
+
+ // DeploymentNameKey is the attribute Key conforming to the "deployment.name"
+ // semantic conventions. It represents the name of the deployment.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "deploy my app", "deploy-frontend"
+ DeploymentNameKey = attribute.Key("deployment.name")
+
+ // DeploymentStatusKey is the attribute Key conforming to the
+ // "deployment.status" semantic conventions. It represents the status of the
+ // deployment.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ DeploymentStatusKey = attribute.Key("deployment.status")
+)
+
+// DeploymentEnvironmentName returns an attribute KeyValue conforming to the
+// "deployment.environment.name" semantic conventions. It represents the name of
+// the [deployment environment] (aka deployment tier).
+//
+// [deployment environment]: https://wikipedia.org/wiki/Deployment_environment
+func DeploymentEnvironmentName(val string) attribute.KeyValue {
+ return DeploymentEnvironmentNameKey.String(val)
+}
+
+// DeploymentID returns an attribute KeyValue conforming to the "deployment.id"
+// semantic conventions. It represents the id of the deployment.
+func DeploymentID(val string) attribute.KeyValue {
+ return DeploymentIDKey.String(val)
+}
+
+// DeploymentName returns an attribute KeyValue conforming to the
+// "deployment.name" semantic conventions. It represents the name of the
+// deployment.
+func DeploymentName(val string) attribute.KeyValue {
+ return DeploymentNameKey.String(val)
+}
+
+// Enum values for deployment.status
+var (
+ // failed
+ // Stability: development
+ DeploymentStatusFailed = DeploymentStatusKey.String("failed")
+ // succeeded
+ // Stability: development
+ DeploymentStatusSucceeded = DeploymentStatusKey.String("succeeded")
+)
+
+// Namespace: destination
+const (
+ // DestinationAddressKey is the attribute Key conforming to the
+ // "destination.address" semantic conventions. It represents the destination
+ // address - domain name if available without reverse DNS lookup; otherwise, IP
+ // address or Unix domain socket name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "destination.example.com", "10.1.2.80", "/tmp/my.sock"
+ // Note: When observed from the source side, and when communicating through an
+ // intermediary, `destination.address` SHOULD represent the destination address
+ // behind any intermediaries, for example proxies, if it's available.
+ DestinationAddressKey = attribute.Key("destination.address")
+
+ // DestinationPortKey is the attribute Key conforming to the "destination.port"
+ // semantic conventions. It represents the destination port number.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 3389, 2888
+ DestinationPortKey = attribute.Key("destination.port")
+)
+
+// DestinationAddress returns an attribute KeyValue conforming to the
+// "destination.address" semantic conventions. It represents the destination
+// address - domain name if available without reverse DNS lookup; otherwise, IP
+// address or Unix domain socket name.
+func DestinationAddress(val string) attribute.KeyValue {
+ return DestinationAddressKey.String(val)
+}
+
+// DestinationPort returns an attribute KeyValue conforming to the
+// "destination.port" semantic conventions. It represents the destination port
+// number.
+func DestinationPort(val int) attribute.KeyValue {
+ return DestinationPortKey.Int(val)
+}
+
+// Namespace: device
+const (
+ // DeviceIDKey is the attribute Key conforming to the "device.id" semantic
+ // conventions. It represents a unique identifier representing the device.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "123456789012345", "01:23:45:67:89:AB"
+ // Note: Its value SHOULD be identical for all apps on a device and it SHOULD
+ // NOT change if an app is uninstalled and re-installed.
+ // However, it might be resettable by the user for all apps on a device.
+ // Hardware IDs (e.g. vendor-specific serial number, IMEI or MAC address) MAY be
+ // used as values.
+ //
+ // More information about Android identifier best practices can be found in the
+ // [Android user data IDs guide].
+ //
+ // > [!WARNING]> This attribute may contain sensitive (PII) information. Caution
+ // > should be taken when storing personal data or anything which can identify a
+ // > user. GDPR and data protection laws may apply,
+ // > ensure you do your own due diligence.> Due to these reasons, this
+ // > identifier is not recommended for consumer applications and will likely
+ // > result in rejection from both Google Play and App Store.
+ // > However, it may be appropriate for specific enterprise scenarios, such as
+ // > kiosk devices or enterprise-managed devices, with appropriate compliance
+ // > clearance.
+ // > Any instrumentation providing this identifier MUST implement it as an
+ // > opt-in feature.> See [`app.installation.id`]> for a more
+ // > privacy-preserving alternative.
+ //
+ // [Android user data IDs guide]: https://developer.android.com/training/articles/user-data-ids
+ // [`app.installation.id`]: /docs/registry/attributes/app.md#app-installation-id
+ DeviceIDKey = attribute.Key("device.id")
+
+ // DeviceManufacturerKey is the attribute Key conforming to the
+ // "device.manufacturer" semantic conventions. It represents the name of the
+ // device manufacturer.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Apple", "Samsung"
+ // Note: The Android OS provides this field via [Build]. iOS apps SHOULD
+ // hardcode the value `Apple`.
+ //
+ // [Build]: https://developer.android.com/reference/android/os/Build#MANUFACTURER
+ DeviceManufacturerKey = attribute.Key("device.manufacturer")
+
+ // DeviceModelIdentifierKey is the attribute Key conforming to the
+ // "device.model.identifier" semantic conventions. It represents the model
+ // identifier for the device.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "iPhone3,4", "SM-G920F"
+ // Note: It's recommended this value represents a machine-readable version of
+ // the model identifier rather than the market or consumer-friendly name of the
+ // device.
+ DeviceModelIdentifierKey = attribute.Key("device.model.identifier")
+
+ // DeviceModelNameKey is the attribute Key conforming to the "device.model.name"
+ // semantic conventions. It represents the marketing name for the device model.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "iPhone 6s Plus", "Samsung Galaxy S6"
+ // Note: It's recommended this value represents a human-readable version of the
+ // device model rather than a machine-readable alternative.
+ DeviceModelNameKey = attribute.Key("device.model.name")
+)
+
+// DeviceID returns an attribute KeyValue conforming to the "device.id" semantic
+// conventions. It represents a unique identifier representing the device.
+func DeviceID(val string) attribute.KeyValue {
+ return DeviceIDKey.String(val)
+}
+
+// DeviceManufacturer returns an attribute KeyValue conforming to the
+// "device.manufacturer" semantic conventions. It represents the name of the
+// device manufacturer.
+func DeviceManufacturer(val string) attribute.KeyValue {
+ return DeviceManufacturerKey.String(val)
+}
+
+// DeviceModelIdentifier returns an attribute KeyValue conforming to the
+// "device.model.identifier" semantic conventions. It represents the model
+// identifier for the device.
+func DeviceModelIdentifier(val string) attribute.KeyValue {
+ return DeviceModelIdentifierKey.String(val)
+}
+
+// DeviceModelName returns an attribute KeyValue conforming to the
+// "device.model.name" semantic conventions. It represents the marketing name for
+// the device model.
+func DeviceModelName(val string) attribute.KeyValue {
+ return DeviceModelNameKey.String(val)
+}
+
+// Namespace: disk
+const (
+ // DiskIODirectionKey is the attribute Key conforming to the "disk.io.direction"
+ // semantic conventions. It represents the disk IO operation direction.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "read"
+ DiskIODirectionKey = attribute.Key("disk.io.direction")
+)
+
+// Enum values for disk.io.direction
+var (
+ // read
+ // Stability: development
+ DiskIODirectionRead = DiskIODirectionKey.String("read")
+ // write
+ // Stability: development
+ DiskIODirectionWrite = DiskIODirectionKey.String("write")
+)
+
+// Namespace: dns
+const (
+ // DNSAnswersKey is the attribute Key conforming to the "dns.answers" semantic
+ // conventions. It represents the list of IPv4 or IPv6 addresses resolved during
+ // DNS lookup.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "10.0.0.1", "2001:0db8:85a3:0000:0000:8a2e:0370:7334"
+ DNSAnswersKey = attribute.Key("dns.answers")
+
+ // DNSQuestionNameKey is the attribute Key conforming to the "dns.question.name"
+ // semantic conventions. It represents the name being queried.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "www.example.com", "opentelemetry.io"
+ // Note: If the name field contains non-printable characters (below 32 or above
+ // 126), those characters should be represented as escaped base 10 integers
+ // (\DDD). Back slashes and quotes should be escaped. Tabs, carriage returns,
+ // and line feeds should be converted to \t, \r, and \n respectively.
+ DNSQuestionNameKey = attribute.Key("dns.question.name")
+)
+
+// DNSAnswers returns an attribute KeyValue conforming to the "dns.answers"
+// semantic conventions. It represents the list of IPv4 or IPv6 addresses
+// resolved during DNS lookup.
+func DNSAnswers(val ...string) attribute.KeyValue {
+ return DNSAnswersKey.StringSlice(val)
+}
+
+// DNSQuestionName returns an attribute KeyValue conforming to the
+// "dns.question.name" semantic conventions. It represents the name being
+// queried.
+func DNSQuestionName(val string) attribute.KeyValue {
+ return DNSQuestionNameKey.String(val)
+}
+
+// Namespace: elasticsearch
+const (
+ // ElasticsearchNodeNameKey is the attribute Key conforming to the
+ // "elasticsearch.node.name" semantic conventions. It represents the represents
+ // the human-readable identifier of the node/instance to which a request was
+ // routed.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "instance-0000000001"
+ ElasticsearchNodeNameKey = attribute.Key("elasticsearch.node.name")
+)
+
+// ElasticsearchNodeName returns an attribute KeyValue conforming to the
+// "elasticsearch.node.name" semantic conventions. It represents the represents
+// the human-readable identifier of the node/instance to which a request was
+// routed.
+func ElasticsearchNodeName(val string) attribute.KeyValue {
+ return ElasticsearchNodeNameKey.String(val)
+}
+
+// Namespace: enduser
+const (
+ // EnduserIDKey is the attribute Key conforming to the "enduser.id" semantic
+ // conventions. It represents the unique identifier of an end user in the
+ // system. It maybe a username, email address, or other identifier.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "username"
+ // Note: Unique identifier of an end user in the system.
+ //
+ // > [!Warning]
+ // > This field contains sensitive (PII) information.
+ EnduserIDKey = attribute.Key("enduser.id")
+
+ // EnduserPseudoIDKey is the attribute Key conforming to the "enduser.pseudo.id"
+ // semantic conventions. It represents the pseudonymous identifier of an end
+ // user. This identifier should be a random value that is not directly linked or
+ // associated with the end user's actual identity.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "QdH5CAWJgqVT4rOr0qtumf"
+ // Note: Pseudonymous identifier of an end user.
+ //
+ // > [!Warning]
+ // > This field contains sensitive (linkable PII) information.
+ EnduserPseudoIDKey = attribute.Key("enduser.pseudo.id")
+)
+
+// EnduserID returns an attribute KeyValue conforming to the "enduser.id"
+// semantic conventions. It represents the unique identifier of an end user in
+// the system. It maybe a username, email address, or other identifier.
+func EnduserID(val string) attribute.KeyValue {
+ return EnduserIDKey.String(val)
+}
+
+// EnduserPseudoID returns an attribute KeyValue conforming to the
+// "enduser.pseudo.id" semantic conventions. It represents the pseudonymous
+// identifier of an end user. This identifier should be a random value that is
+// not directly linked or associated with the end user's actual identity.
+func EnduserPseudoID(val string) attribute.KeyValue {
+ return EnduserPseudoIDKey.String(val)
+}
+
+// Namespace: error
+const (
+ // ErrorMessageKey is the attribute Key conforming to the "error.message"
+ // semantic conventions. It represents a message providing more detail about an
+ // error in human-readable form.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Unexpected input type: string", "The user has exceeded their
+ // storage quota"
+ // Note: `error.message` should provide additional context and detail about an
+ // error.
+ // It is NOT RECOMMENDED to duplicate the value of `error.type` in
+ // `error.message`.
+ // It is also NOT RECOMMENDED to duplicate the value of `exception.message` in
+ // `error.message`.
+ //
+ // `error.message` is NOT RECOMMENDED for metrics or spans due to its unbounded
+ // cardinality and overlap with span status.
+ ErrorMessageKey = attribute.Key("error.message")
+
+ // ErrorTypeKey is the attribute Key conforming to the "error.type" semantic
+ // conventions. It represents the describes a class of error the operation ended
+ // with.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "timeout", "java.net.UnknownHostException",
+ // "server_certificate_invalid", "500"
+ // Note: The `error.type` SHOULD be predictable, and SHOULD have low
+ // cardinality.
+ //
+ // When `error.type` is set to a type (e.g., an exception type), its
+ // canonical class name identifying the type within the artifact SHOULD be used.
+ //
+ // Instrumentations SHOULD document the list of errors they report.
+ //
+ // The cardinality of `error.type` within one instrumentation library SHOULD be
+ // low.
+ // Telemetry consumers that aggregate data from multiple instrumentation
+ // libraries and applications
+ // should be prepared for `error.type` to have high cardinality at query time
+ // when no
+ // additional filters are applied.
+ //
+ // If the operation has completed successfully, instrumentations SHOULD NOT set
+ // `error.type`.
+ //
+ // If a specific domain defines its own set of error identifiers (such as HTTP
+ // or gRPC status codes),
+ // it's RECOMMENDED to:
+ //
+ // - Use a domain-specific attribute
+ // - Set `error.type` to capture all errors, regardless of whether they are
+ // defined within the domain-specific set or not.
+ ErrorTypeKey = attribute.Key("error.type")
+)
+
+// ErrorMessage returns an attribute KeyValue conforming to the "error.message"
+// semantic conventions. It represents a message providing more detail about an
+// error in human-readable form.
+func ErrorMessage(val string) attribute.KeyValue {
+ return ErrorMessageKey.String(val)
+}
+
+// Enum values for error.type
+var (
+ // A fallback error value to be used when the instrumentation doesn't define a
+ // custom value.
+ //
+ // Stability: stable
+ ErrorTypeOther = ErrorTypeKey.String("_OTHER")
+)
+
+// Namespace: exception
+const (
+ // ExceptionMessageKey is the attribute Key conforming to the
+ // "exception.message" semantic conventions. It represents the exception
+ // message.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "Division by zero", "Can't convert 'int' object to str implicitly"
+ ExceptionMessageKey = attribute.Key("exception.message")
+
+ // ExceptionStacktraceKey is the attribute Key conforming to the
+ // "exception.stacktrace" semantic conventions. It represents a stacktrace as a
+ // string in the natural representation for the language runtime. The
+ // representation is to be determined and documented by each language SIG.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: Exception in thread "main" java.lang.RuntimeException: Test
+ // exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at
+ // com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at
+ // com.example.GenerateTrace.main(GenerateTrace.java:5)
+ ExceptionStacktraceKey = attribute.Key("exception.stacktrace")
+
+ // ExceptionTypeKey is the attribute Key conforming to the "exception.type"
+ // semantic conventions. It represents the type of the exception (its
+ // fully-qualified class name, if applicable). The dynamic type of the exception
+ // should be preferred over the static type in languages that support it.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "java.net.ConnectException", "OSError"
+ ExceptionTypeKey = attribute.Key("exception.type")
+)
+
+// ExceptionMessage returns an attribute KeyValue conforming to the
+// "exception.message" semantic conventions. It represents the exception message.
+func ExceptionMessage(val string) attribute.KeyValue {
+ return ExceptionMessageKey.String(val)
+}
+
+// ExceptionStacktrace returns an attribute KeyValue conforming to the
+// "exception.stacktrace" semantic conventions. It represents a stacktrace as a
+// string in the natural representation for the language runtime. The
+// representation is to be determined and documented by each language SIG.
+func ExceptionStacktrace(val string) attribute.KeyValue {
+ return ExceptionStacktraceKey.String(val)
+}
+
+// ExceptionType returns an attribute KeyValue conforming to the "exception.type"
+// semantic conventions. It represents the type of the exception (its
+// fully-qualified class name, if applicable). The dynamic type of the exception
+// should be preferred over the static type in languages that support it.
+func ExceptionType(val string) attribute.KeyValue {
+ return ExceptionTypeKey.String(val)
+}
+
+// Namespace: faas
+const (
+ // FaaSColdstartKey is the attribute Key conforming to the "faas.coldstart"
+ // semantic conventions. It represents a boolean that is true if the serverless
+ // function is executed for the first time (aka cold-start).
+ //
+ // Type: boolean
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ FaaSColdstartKey = attribute.Key("faas.coldstart")
+
+ // FaaSCronKey is the attribute Key conforming to the "faas.cron" semantic
+ // conventions. It represents a string containing the schedule period as
+ // [Cron Expression].
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 0/5 * * * ? *
+ //
+ // [Cron Expression]: https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm
+ FaaSCronKey = attribute.Key("faas.cron")
+
+ // FaaSDocumentCollectionKey is the attribute Key conforming to the
+ // "faas.document.collection" semantic conventions. It represents the name of
+ // the source on which the triggering operation was performed. For example, in
+ // Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the
+ // database name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "myBucketName", "myDbName"
+ FaaSDocumentCollectionKey = attribute.Key("faas.document.collection")
+
+ // FaaSDocumentNameKey is the attribute Key conforming to the
+ // "faas.document.name" semantic conventions. It represents the document
+ // name/table subjected to the operation. For example, in Cloud Storage or S3 is
+ // the name of the file, and in Cosmos DB the table name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "myFile.txt", "myTableName"
+ FaaSDocumentNameKey = attribute.Key("faas.document.name")
+
+ // FaaSDocumentOperationKey is the attribute Key conforming to the
+ // "faas.document.operation" semantic conventions. It represents the describes
+ // the type of the operation that was performed on the data.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ FaaSDocumentOperationKey = attribute.Key("faas.document.operation")
+
+ // FaaSDocumentTimeKey is the attribute Key conforming to the
+ // "faas.document.time" semantic conventions. It represents a string containing
+ // the time when the data was accessed in the [ISO 8601] format expressed in
+ // [UTC].
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 2020-01-23T13:47:06Z
+ //
+ // [ISO 8601]: https://www.iso.org/iso-8601-date-and-time-format.html
+ // [UTC]: https://www.w3.org/TR/NOTE-datetime
+ FaaSDocumentTimeKey = attribute.Key("faas.document.time")
+
+ // FaaSInstanceKey is the attribute Key conforming to the "faas.instance"
+ // semantic conventions. It represents the execution environment ID as a string,
+ // that will be potentially reused for other invocations to the same
+ // function/function version.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de"
+ // Note: - **AWS Lambda:** Use the (full) log stream name.
+ FaaSInstanceKey = attribute.Key("faas.instance")
+
+ // FaaSInvocationIDKey is the attribute Key conforming to the
+ // "faas.invocation_id" semantic conventions. It represents the invocation ID of
+ // the current function invocation.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: af9d5aa4-a685-4c5f-a22b-444f80b3cc28
+ FaaSInvocationIDKey = attribute.Key("faas.invocation_id")
+
+ // FaaSInvokedNameKey is the attribute Key conforming to the "faas.invoked_name"
+ // semantic conventions. It represents the name of the invoked function.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: my-function
+ // Note: SHOULD be equal to the `faas.name` resource attribute of the invoked
+ // function.
+ FaaSInvokedNameKey = attribute.Key("faas.invoked_name")
+
+ // FaaSInvokedProviderKey is the attribute Key conforming to the
+ // "faas.invoked_provider" semantic conventions. It represents the cloud
+ // provider of the invoked function.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // Note: SHOULD be equal to the `cloud.provider` resource attribute of the
+ // invoked function.
+ FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider")
+
+ // FaaSInvokedRegionKey is the attribute Key conforming to the
+ // "faas.invoked_region" semantic conventions. It represents the cloud region of
+ // the invoked function.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: eu-central-1
+ // Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked
+ // function.
+ FaaSInvokedRegionKey = attribute.Key("faas.invoked_region")
+
+ // FaaSMaxMemoryKey is the attribute Key conforming to the "faas.max_memory"
+ // semantic conventions. It represents the amount of memory available to the
+ // serverless function converted to Bytes.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Note: It's recommended to set this attribute since e.g. too little memory can
+ // easily stop a Java AWS Lambda function from working correctly. On AWS Lambda,
+ // the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this
+ // information (which must be multiplied by 1,048,576).
+ FaaSMaxMemoryKey = attribute.Key("faas.max_memory")
+
+ // FaaSNameKey is the attribute Key conforming to the "faas.name" semantic
+ // conventions. It represents the name of the single function that this runtime
+ // instance executes.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "my-function", "myazurefunctionapp/some-function-name"
+ // Note: This is the name of the function as configured/deployed on the FaaS
+ // platform and is usually different from the name of the callback
+ // function (which may be stored in the
+ // [`code.namespace`/`code.function.name`]
+ // span attributes).
+ //
+ // For some cloud providers, the above definition is ambiguous. The following
+ // definition of function name MUST be used for this attribute
+ // (and consequently the span name) for the listed cloud providers/products:
+ //
+ // - **Azure:** The full name `/`, i.e., function app name
+ // followed by a forward slash followed by the function name (this form
+ // can also be seen in the resource JSON for the function).
+ // This means that a span attribute MUST be used, as an Azure function
+ // app can host multiple functions that would usually share
+ // a TracerProvider (see also the `cloud.resource_id` attribute).
+ //
+ //
+ // [`code.namespace`/`code.function.name`]: /docs/general/attributes.md#source-code-attributes
+ FaaSNameKey = attribute.Key("faas.name")
+
+ // FaaSTimeKey is the attribute Key conforming to the "faas.time" semantic
+ // conventions. It represents a string containing the function invocation time
+ // in the [ISO 8601] format expressed in [UTC].
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 2020-01-23T13:47:06Z
+ //
+ // [ISO 8601]: https://www.iso.org/iso-8601-date-and-time-format.html
+ // [UTC]: https://www.w3.org/TR/NOTE-datetime
+ FaaSTimeKey = attribute.Key("faas.time")
+
+ // FaaSTriggerKey is the attribute Key conforming to the "faas.trigger" semantic
+ // conventions. It represents the type of the trigger which caused this function
+ // invocation.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ FaaSTriggerKey = attribute.Key("faas.trigger")
+
+ // FaaSVersionKey is the attribute Key conforming to the "faas.version" semantic
+ // conventions. It represents the immutable version of the function being
+ // executed.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "26", "pinkfroid-00002"
+ // Note: Depending on the cloud provider and platform, use:
+ //
+ // - **AWS Lambda:** The [function version]
+ // (an integer represented as a decimal string).
+ // - **Google Cloud Run (Services):** The [revision]
+ // (i.e., the function name plus the revision suffix).
+ // - **Google Cloud Functions:** The value of the
+ // [`K_REVISION` environment variable].
+ // - **Azure Functions:** Not applicable. Do not set this attribute.
+ //
+ //
+ // [function version]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html
+ // [revision]: https://cloud.google.com/run/docs/managing/revisions
+ // [`K_REVISION` environment variable]: https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically
+ FaaSVersionKey = attribute.Key("faas.version")
+)
+
+// FaaSColdstart returns an attribute KeyValue conforming to the "faas.coldstart"
+// semantic conventions. It represents a boolean that is true if the serverless
+// function is executed for the first time (aka cold-start).
+func FaaSColdstart(val bool) attribute.KeyValue {
+ return FaaSColdstartKey.Bool(val)
+}
+
+// FaaSCron returns an attribute KeyValue conforming to the "faas.cron" semantic
+// conventions. It represents a string containing the schedule period as
+// [Cron Expression].
+//
+// [Cron Expression]: https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm
+func FaaSCron(val string) attribute.KeyValue {
+ return FaaSCronKey.String(val)
+}
+
+// FaaSDocumentCollection returns an attribute KeyValue conforming to the
+// "faas.document.collection" semantic conventions. It represents the name of the
+// source on which the triggering operation was performed. For example, in Cloud
+// Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database
+// name.
+func FaaSDocumentCollection(val string) attribute.KeyValue {
+ return FaaSDocumentCollectionKey.String(val)
+}
+
+// FaaSDocumentName returns an attribute KeyValue conforming to the
+// "faas.document.name" semantic conventions. It represents the document
+// name/table subjected to the operation. For example, in Cloud Storage or S3 is
+// the name of the file, and in Cosmos DB the table name.
+func FaaSDocumentName(val string) attribute.KeyValue {
+ return FaaSDocumentNameKey.String(val)
+}
+
+// FaaSDocumentTime returns an attribute KeyValue conforming to the
+// "faas.document.time" semantic conventions. It represents a string containing
+// the time when the data was accessed in the [ISO 8601] format expressed in
+// [UTC].
+//
+// [ISO 8601]: https://www.iso.org/iso-8601-date-and-time-format.html
+// [UTC]: https://www.w3.org/TR/NOTE-datetime
+func FaaSDocumentTime(val string) attribute.KeyValue {
+ return FaaSDocumentTimeKey.String(val)
+}
+
+// FaaSInstance returns an attribute KeyValue conforming to the "faas.instance"
+// semantic conventions. It represents the execution environment ID as a string,
+// that will be potentially reused for other invocations to the same
+// function/function version.
+func FaaSInstance(val string) attribute.KeyValue {
+ return FaaSInstanceKey.String(val)
+}
+
+// FaaSInvocationID returns an attribute KeyValue conforming to the
+// "faas.invocation_id" semantic conventions. It represents the invocation ID of
+// the current function invocation.
+func FaaSInvocationID(val string) attribute.KeyValue {
+ return FaaSInvocationIDKey.String(val)
+}
+
+// FaaSInvokedName returns an attribute KeyValue conforming to the
+// "faas.invoked_name" semantic conventions. It represents the name of the
+// invoked function.
+func FaaSInvokedName(val string) attribute.KeyValue {
+ return FaaSInvokedNameKey.String(val)
+}
+
+// FaaSInvokedRegion returns an attribute KeyValue conforming to the
+// "faas.invoked_region" semantic conventions. It represents the cloud region of
+// the invoked function.
+func FaaSInvokedRegion(val string) attribute.KeyValue {
+ return FaaSInvokedRegionKey.String(val)
+}
+
+// FaaSMaxMemory returns an attribute KeyValue conforming to the
+// "faas.max_memory" semantic conventions. It represents the amount of memory
+// available to the serverless function converted to Bytes.
+func FaaSMaxMemory(val int) attribute.KeyValue {
+ return FaaSMaxMemoryKey.Int(val)
+}
+
+// FaaSName returns an attribute KeyValue conforming to the "faas.name" semantic
+// conventions. It represents the name of the single function that this runtime
+// instance executes.
+func FaaSName(val string) attribute.KeyValue {
+ return FaaSNameKey.String(val)
+}
+
+// FaaSTime returns an attribute KeyValue conforming to the "faas.time" semantic
+// conventions. It represents a string containing the function invocation time in
+// the [ISO 8601] format expressed in [UTC].
+//
+// [ISO 8601]: https://www.iso.org/iso-8601-date-and-time-format.html
+// [UTC]: https://www.w3.org/TR/NOTE-datetime
+func FaaSTime(val string) attribute.KeyValue {
+ return FaaSTimeKey.String(val)
+}
+
+// FaaSVersion returns an attribute KeyValue conforming to the "faas.version"
+// semantic conventions. It represents the immutable version of the function
+// being executed.
+func FaaSVersion(val string) attribute.KeyValue {
+ return FaaSVersionKey.String(val)
+}
+
+// Enum values for faas.document.operation
+var (
+ // When a new object is created.
+ // Stability: development
+ FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert")
+ // When an object is modified.
+ // Stability: development
+ FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit")
+ // When an object is deleted.
+ // Stability: development
+ FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete")
+)
+
+// Enum values for faas.invoked_provider
+var (
+ // Alibaba Cloud
+ // Stability: development
+ FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud")
+ // Amazon Web Services
+ // Stability: development
+ FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws")
+ // Microsoft Azure
+ // Stability: development
+ FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure")
+ // Google Cloud Platform
+ // Stability: development
+ FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp")
+ // Tencent Cloud
+ // Stability: development
+ FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud")
+)
+
+// Enum values for faas.trigger
+var (
+ // A response to some data source operation such as a database or filesystem
+ // read/write
+ // Stability: development
+ FaaSTriggerDatasource = FaaSTriggerKey.String("datasource")
+ // To provide an answer to an inbound HTTP request
+ // Stability: development
+ FaaSTriggerHTTP = FaaSTriggerKey.String("http")
+ // A function is set to be executed when messages are sent to a messaging system
+ // Stability: development
+ FaaSTriggerPubSub = FaaSTriggerKey.String("pubsub")
+ // A function is scheduled to be executed regularly
+ // Stability: development
+ FaaSTriggerTimer = FaaSTriggerKey.String("timer")
+ // If none of the others apply
+ // Stability: development
+ FaaSTriggerOther = FaaSTriggerKey.String("other")
+)
+
+// Namespace: feature_flag
+const (
+ // FeatureFlagContextIDKey is the attribute Key conforming to the
+ // "feature_flag.context.id" semantic conventions. It represents the unique
+ // identifier for the flag evaluation context. For example, the targeting key.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Release_Candidate
+ //
+ // Examples: "5157782b-2203-4c80-a857-dbbd5e7761db"
+ FeatureFlagContextIDKey = attribute.Key("feature_flag.context.id")
+
+ // FeatureFlagKeyKey is the attribute Key conforming to the "feature_flag.key"
+ // semantic conventions. It represents the lookup key of the feature flag.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Release_Candidate
+ //
+ // Examples: "logo-color"
+ FeatureFlagKeyKey = attribute.Key("feature_flag.key")
+
+ // FeatureFlagProviderNameKey is the attribute Key conforming to the
+ // "feature_flag.provider.name" semantic conventions. It represents the
+ // identifies the feature flag provider.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Release_Candidate
+ //
+ // Examples: "Flag Manager"
+ FeatureFlagProviderNameKey = attribute.Key("feature_flag.provider.name")
+
+ // FeatureFlagResultReasonKey is the attribute Key conforming to the
+ // "feature_flag.result.reason" semantic conventions. It represents the reason
+ // code which shows how a feature flag value was determined.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Release_Candidate
+ //
+ // Examples: "static", "targeting_match", "error", "default"
+ FeatureFlagResultReasonKey = attribute.Key("feature_flag.result.reason")
+
+ // FeatureFlagResultValueKey is the attribute Key conforming to the
+ // "feature_flag.result.value" semantic conventions. It represents the evaluated
+ // value of the feature flag.
+ //
+ // Type: any
+ // RequirementLevel: Recommended
+ // Stability: Release_Candidate
+ //
+ // Examples: "#ff0000", true, 3
+ // Note: With some feature flag providers, feature flag results can be quite
+ // large or contain private or sensitive details.
+ // Because of this, `feature_flag.result.variant` is often the preferred
+ // attribute if it is available.
+ //
+ // It may be desirable to redact or otherwise limit the size and scope of
+ // `feature_flag.result.value` if possible.
+ // Because the evaluated flag value is unstructured and may be any type, it is
+ // left to the instrumentation author to determine how best to achieve this.
+ FeatureFlagResultValueKey = attribute.Key("feature_flag.result.value")
+
+ // FeatureFlagResultVariantKey is the attribute Key conforming to the
+ // "feature_flag.result.variant" semantic conventions. It represents a semantic
+ // identifier for an evaluated flag value.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Release_Candidate
+ //
+ // Examples: "red", "true", "on"
+ // Note: A semantic identifier, commonly referred to as a variant, provides a
+ // means
+ // for referring to a value without including the value itself. This can
+ // provide additional context for understanding the meaning behind a value.
+ // For example, the variant `red` maybe be used for the value `#c05543`.
+ FeatureFlagResultVariantKey = attribute.Key("feature_flag.result.variant")
+
+ // FeatureFlagSetIDKey is the attribute Key conforming to the
+ // "feature_flag.set.id" semantic conventions. It represents the identifier of
+ // the [flag set] to which the feature flag belongs.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Release_Candidate
+ //
+ // Examples: "proj-1", "ab98sgs", "service1/dev"
+ //
+ // [flag set]: https://openfeature.dev/specification/glossary/#flag-set
+ FeatureFlagSetIDKey = attribute.Key("feature_flag.set.id")
+
+ // FeatureFlagVersionKey is the attribute Key conforming to the
+ // "feature_flag.version" semantic conventions. It represents the version of the
+ // ruleset used during the evaluation. This may be any stable value which
+ // uniquely identifies the ruleset.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Release_Candidate
+ //
+ // Examples: "1", "01ABCDEF"
+ FeatureFlagVersionKey = attribute.Key("feature_flag.version")
+)
+
+// FeatureFlagContextID returns an attribute KeyValue conforming to the
+// "feature_flag.context.id" semantic conventions. It represents the unique
+// identifier for the flag evaluation context. For example, the targeting key.
+func FeatureFlagContextID(val string) attribute.KeyValue {
+ return FeatureFlagContextIDKey.String(val)
+}
+
+// FeatureFlagKey returns an attribute KeyValue conforming to the
+// "feature_flag.key" semantic conventions. It represents the lookup key of the
+// feature flag.
+func FeatureFlagKey(val string) attribute.KeyValue {
+ return FeatureFlagKeyKey.String(val)
+}
+
+// FeatureFlagProviderName returns an attribute KeyValue conforming to the
+// "feature_flag.provider.name" semantic conventions. It represents the
+// identifies the feature flag provider.
+func FeatureFlagProviderName(val string) attribute.KeyValue {
+ return FeatureFlagProviderNameKey.String(val)
+}
+
+// FeatureFlagResultVariant returns an attribute KeyValue conforming to the
+// "feature_flag.result.variant" semantic conventions. It represents a semantic
+// identifier for an evaluated flag value.
+func FeatureFlagResultVariant(val string) attribute.KeyValue {
+ return FeatureFlagResultVariantKey.String(val)
+}
+
+// FeatureFlagSetID returns an attribute KeyValue conforming to the
+// "feature_flag.set.id" semantic conventions. It represents the identifier of
+// the [flag set] to which the feature flag belongs.
+//
+// [flag set]: https://openfeature.dev/specification/glossary/#flag-set
+func FeatureFlagSetID(val string) attribute.KeyValue {
+ return FeatureFlagSetIDKey.String(val)
+}
+
+// FeatureFlagVersion returns an attribute KeyValue conforming to the
+// "feature_flag.version" semantic conventions. It represents the version of the
+// ruleset used during the evaluation. This may be any stable value which
+// uniquely identifies the ruleset.
+func FeatureFlagVersion(val string) attribute.KeyValue {
+ return FeatureFlagVersionKey.String(val)
+}
+
+// Enum values for feature_flag.result.reason
+var (
+ // The resolved value is static (no dynamic evaluation).
+ // Stability: release_candidate
+ FeatureFlagResultReasonStatic = FeatureFlagResultReasonKey.String("static")
+ // The resolved value fell back to a pre-configured value (no dynamic evaluation
+ // occurred or dynamic evaluation yielded no result).
+ // Stability: release_candidate
+ FeatureFlagResultReasonDefault = FeatureFlagResultReasonKey.String("default")
+ // The resolved value was the result of a dynamic evaluation, such as a rule or
+ // specific user-targeting.
+ // Stability: release_candidate
+ FeatureFlagResultReasonTargetingMatch = FeatureFlagResultReasonKey.String("targeting_match")
+ // The resolved value was the result of pseudorandom assignment.
+ // Stability: release_candidate
+ FeatureFlagResultReasonSplit = FeatureFlagResultReasonKey.String("split")
+ // The resolved value was retrieved from cache.
+ // Stability: release_candidate
+ FeatureFlagResultReasonCached = FeatureFlagResultReasonKey.String("cached")
+ // The resolved value was the result of the flag being disabled in the
+ // management system.
+ // Stability: release_candidate
+ FeatureFlagResultReasonDisabled = FeatureFlagResultReasonKey.String("disabled")
+ // The reason for the resolved value could not be determined.
+ // Stability: release_candidate
+ FeatureFlagResultReasonUnknown = FeatureFlagResultReasonKey.String("unknown")
+ // The resolved value is non-authoritative or possibly out of date
+ // Stability: release_candidate
+ FeatureFlagResultReasonStale = FeatureFlagResultReasonKey.String("stale")
+ // The resolved value was the result of an error.
+ // Stability: release_candidate
+ FeatureFlagResultReasonError = FeatureFlagResultReasonKey.String("error")
+)
+
+// Namespace: file
+const (
+ // FileAccessedKey is the attribute Key conforming to the "file.accessed"
+ // semantic conventions. It represents the time when the file was last accessed,
+ // in ISO 8601 format.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "2021-01-01T12:00:00Z"
+ // Note: This attribute might not be supported by some file systems — NFS,
+ // FAT32, in embedded OS, etc.
+ FileAccessedKey = attribute.Key("file.accessed")
+
+ // FileAttributesKey is the attribute Key conforming to the "file.attributes"
+ // semantic conventions. It represents the array of file attributes.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "readonly", "hidden"
+ // Note: Attributes names depend on the OS or file system. Here’s a
+ // non-exhaustive list of values expected for this attribute: `archive`,
+ // `compressed`, `directory`, `encrypted`, `execute`, `hidden`, `immutable`,
+ // `journaled`, `read`, `readonly`, `symbolic link`, `system`, `temporary`,
+ // `write`.
+ FileAttributesKey = attribute.Key("file.attributes")
+
+ // FileChangedKey is the attribute Key conforming to the "file.changed" semantic
+ // conventions. It represents the time when the file attributes or metadata was
+ // last changed, in ISO 8601 format.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "2021-01-01T12:00:00Z"
+ // Note: `file.changed` captures the time when any of the file's properties or
+ // attributes (including the content) are changed, while `file.modified`
+ // captures the timestamp when the file content is modified.
+ FileChangedKey = attribute.Key("file.changed")
+
+ // FileCreatedKey is the attribute Key conforming to the "file.created" semantic
+ // conventions. It represents the time when the file was created, in ISO 8601
+ // format.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "2021-01-01T12:00:00Z"
+ // Note: This attribute might not be supported by some file systems — NFS,
+ // FAT32, in embedded OS, etc.
+ FileCreatedKey = attribute.Key("file.created")
+
+ // FileDirectoryKey is the attribute Key conforming to the "file.directory"
+ // semantic conventions. It represents the directory where the file is located.
+ // It should include the drive letter, when appropriate.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "/home/user", "C:\Program Files\MyApp"
+ FileDirectoryKey = attribute.Key("file.directory")
+
+ // FileExtensionKey is the attribute Key conforming to the "file.extension"
+ // semantic conventions. It represents the file extension, excluding the leading
+ // dot.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "png", "gz"
+ // Note: When the file name has multiple extensions (example.tar.gz), only the
+ // last one should be captured ("gz", not "tar.gz").
+ FileExtensionKey = attribute.Key("file.extension")
+
+ // FileForkNameKey is the attribute Key conforming to the "file.fork_name"
+ // semantic conventions. It represents the name of the fork. A fork is
+ // additional data associated with a filesystem object.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Zone.Identifier"
+ // Note: On Linux, a resource fork is used to store additional data with a
+ // filesystem object. A file always has at least one fork for the data portion,
+ // and additional forks may exist.
+ // On NTFS, this is analogous to an Alternate Data Stream (ADS), and the default
+ // data stream for a file is just called $DATA. Zone.Identifier is commonly used
+ // by Windows to track contents downloaded from the Internet. An ADS is
+ // typically of the form: C:\path\to\filename.extension:some_fork_name, and
+ // some_fork_name is the value that should populate `fork_name`.
+ // `filename.extension` should populate `file.name`, and `extension` should
+ // populate `file.extension`. The full path, `file.path`, will include the fork
+ // name.
+ FileForkNameKey = attribute.Key("file.fork_name")
+
+ // FileGroupIDKey is the attribute Key conforming to the "file.group.id"
+ // semantic conventions. It represents the primary Group ID (GID) of the file.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "1000"
+ FileGroupIDKey = attribute.Key("file.group.id")
+
+ // FileGroupNameKey is the attribute Key conforming to the "file.group.name"
+ // semantic conventions. It represents the primary group name of the file.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "users"
+ FileGroupNameKey = attribute.Key("file.group.name")
+
+ // FileInodeKey is the attribute Key conforming to the "file.inode" semantic
+ // conventions. It represents the inode representing the file in the filesystem.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "256383"
+ FileInodeKey = attribute.Key("file.inode")
+
+ // FileModeKey is the attribute Key conforming to the "file.mode" semantic
+ // conventions. It represents the mode of the file in octal representation.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "0640"
+ FileModeKey = attribute.Key("file.mode")
+
+ // FileModifiedKey is the attribute Key conforming to the "file.modified"
+ // semantic conventions. It represents the time when the file content was last
+ // modified, in ISO 8601 format.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "2021-01-01T12:00:00Z"
+ FileModifiedKey = attribute.Key("file.modified")
+
+ // FileNameKey is the attribute Key conforming to the "file.name" semantic
+ // conventions. It represents the name of the file including the extension,
+ // without the directory.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "example.png"
+ FileNameKey = attribute.Key("file.name")
+
+ // FileOwnerIDKey is the attribute Key conforming to the "file.owner.id"
+ // semantic conventions. It represents the user ID (UID) or security identifier
+ // (SID) of the file owner.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "1000"
+ FileOwnerIDKey = attribute.Key("file.owner.id")
+
+ // FileOwnerNameKey is the attribute Key conforming to the "file.owner.name"
+ // semantic conventions. It represents the username of the file owner.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "root"
+ FileOwnerNameKey = attribute.Key("file.owner.name")
+
+ // FilePathKey is the attribute Key conforming to the "file.path" semantic
+ // conventions. It represents the full path to the file, including the file
+ // name. It should include the drive letter, when appropriate.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "/home/alice/example.png", "C:\Program Files\MyApp\myapp.exe"
+ FilePathKey = attribute.Key("file.path")
+
+ // FileSizeKey is the attribute Key conforming to the "file.size" semantic
+ // conventions. It represents the file size in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ FileSizeKey = attribute.Key("file.size")
+
+ // FileSymbolicLinkTargetPathKey is the attribute Key conforming to the
+ // "file.symbolic_link.target_path" semantic conventions. It represents the path
+ // to the target of a symbolic link.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "/usr/bin/python3"
+ // Note: This attribute is only applicable to symbolic links.
+ FileSymbolicLinkTargetPathKey = attribute.Key("file.symbolic_link.target_path")
+)
+
+// FileAccessed returns an attribute KeyValue conforming to the "file.accessed"
+// semantic conventions. It represents the time when the file was last accessed,
+// in ISO 8601 format.
+func FileAccessed(val string) attribute.KeyValue {
+ return FileAccessedKey.String(val)
+}
+
+// FileAttributes returns an attribute KeyValue conforming to the
+// "file.attributes" semantic conventions. It represents the array of file
+// attributes.
+func FileAttributes(val ...string) attribute.KeyValue {
+ return FileAttributesKey.StringSlice(val)
+}
+
+// FileChanged returns an attribute KeyValue conforming to the "file.changed"
+// semantic conventions. It represents the time when the file attributes or
+// metadata was last changed, in ISO 8601 format.
+func FileChanged(val string) attribute.KeyValue {
+ return FileChangedKey.String(val)
+}
+
+// FileCreated returns an attribute KeyValue conforming to the "file.created"
+// semantic conventions. It represents the time when the file was created, in ISO
+// 8601 format.
+func FileCreated(val string) attribute.KeyValue {
+ return FileCreatedKey.String(val)
+}
+
+// FileDirectory returns an attribute KeyValue conforming to the "file.directory"
+// semantic conventions. It represents the directory where the file is located.
+// It should include the drive letter, when appropriate.
+func FileDirectory(val string) attribute.KeyValue {
+ return FileDirectoryKey.String(val)
+}
+
+// FileExtension returns an attribute KeyValue conforming to the "file.extension"
+// semantic conventions. It represents the file extension, excluding the leading
+// dot.
+func FileExtension(val string) attribute.KeyValue {
+ return FileExtensionKey.String(val)
+}
+
+// FileForkName returns an attribute KeyValue conforming to the "file.fork_name"
+// semantic conventions. It represents the name of the fork. A fork is additional
+// data associated with a filesystem object.
+func FileForkName(val string) attribute.KeyValue {
+ return FileForkNameKey.String(val)
+}
+
+// FileGroupID returns an attribute KeyValue conforming to the "file.group.id"
+// semantic conventions. It represents the primary Group ID (GID) of the file.
+func FileGroupID(val string) attribute.KeyValue {
+ return FileGroupIDKey.String(val)
+}
+
+// FileGroupName returns an attribute KeyValue conforming to the
+// "file.group.name" semantic conventions. It represents the primary group name
+// of the file.
+func FileGroupName(val string) attribute.KeyValue {
+ return FileGroupNameKey.String(val)
+}
+
+// FileInode returns an attribute KeyValue conforming to the "file.inode"
+// semantic conventions. It represents the inode representing the file in the
+// filesystem.
+func FileInode(val string) attribute.KeyValue {
+ return FileInodeKey.String(val)
+}
+
+// FileMode returns an attribute KeyValue conforming to the "file.mode" semantic
+// conventions. It represents the mode of the file in octal representation.
+func FileMode(val string) attribute.KeyValue {
+ return FileModeKey.String(val)
+}
+
+// FileModified returns an attribute KeyValue conforming to the "file.modified"
+// semantic conventions. It represents the time when the file content was last
+// modified, in ISO 8601 format.
+func FileModified(val string) attribute.KeyValue {
+ return FileModifiedKey.String(val)
+}
+
+// FileName returns an attribute KeyValue conforming to the "file.name" semantic
+// conventions. It represents the name of the file including the extension,
+// without the directory.
+func FileName(val string) attribute.KeyValue {
+ return FileNameKey.String(val)
+}
+
+// FileOwnerID returns an attribute KeyValue conforming to the "file.owner.id"
+// semantic conventions. It represents the user ID (UID) or security identifier
+// (SID) of the file owner.
+func FileOwnerID(val string) attribute.KeyValue {
+ return FileOwnerIDKey.String(val)
+}
+
+// FileOwnerName returns an attribute KeyValue conforming to the
+// "file.owner.name" semantic conventions. It represents the username of the file
+// owner.
+func FileOwnerName(val string) attribute.KeyValue {
+ return FileOwnerNameKey.String(val)
+}
+
+// FilePath returns an attribute KeyValue conforming to the "file.path" semantic
+// conventions. It represents the full path to the file, including the file name.
+// It should include the drive letter, when appropriate.
+func FilePath(val string) attribute.KeyValue {
+ return FilePathKey.String(val)
+}
+
+// FileSize returns an attribute KeyValue conforming to the "file.size" semantic
+// conventions. It represents the file size in bytes.
+func FileSize(val int) attribute.KeyValue {
+ return FileSizeKey.Int(val)
+}
+
+// FileSymbolicLinkTargetPath returns an attribute KeyValue conforming to the
+// "file.symbolic_link.target_path" semantic conventions. It represents the path
+// to the target of a symbolic link.
+func FileSymbolicLinkTargetPath(val string) attribute.KeyValue {
+ return FileSymbolicLinkTargetPathKey.String(val)
+}
+
+// Namespace: gcp
+const (
+ // GCPAppHubApplicationContainerKey is the attribute Key conforming to the
+ // "gcp.apphub.application.container" semantic conventions. It represents the
+ // container within GCP where the AppHub application is defined.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "projects/my-container-project"
+ GCPAppHubApplicationContainerKey = attribute.Key("gcp.apphub.application.container")
+
+ // GCPAppHubApplicationIDKey is the attribute Key conforming to the
+ // "gcp.apphub.application.id" semantic conventions. It represents the name of
+ // the application as configured in AppHub.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "my-application"
+ GCPAppHubApplicationIDKey = attribute.Key("gcp.apphub.application.id")
+
+ // GCPAppHubApplicationLocationKey is the attribute Key conforming to the
+ // "gcp.apphub.application.location" semantic conventions. It represents the GCP
+ // zone or region where the application is defined.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "us-central1"
+ GCPAppHubApplicationLocationKey = attribute.Key("gcp.apphub.application.location")
+
+ // GCPAppHubServiceCriticalityTypeKey is the attribute Key conforming to the
+ // "gcp.apphub.service.criticality_type" semantic conventions. It represents the
+ // criticality of a service indicates its importance to the business.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // Note: [See AppHub type enum]
+ //
+ // [See AppHub type enum]: https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type
+ GCPAppHubServiceCriticalityTypeKey = attribute.Key("gcp.apphub.service.criticality_type")
+
+ // GCPAppHubServiceEnvironmentTypeKey is the attribute Key conforming to the
+ // "gcp.apphub.service.environment_type" semantic conventions. It represents the
+ // environment of a service is the stage of a software lifecycle.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // Note: [See AppHub environment type]
+ //
+ // [See AppHub environment type]: https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type_1
+ GCPAppHubServiceEnvironmentTypeKey = attribute.Key("gcp.apphub.service.environment_type")
+
+ // GCPAppHubServiceIDKey is the attribute Key conforming to the
+ // "gcp.apphub.service.id" semantic conventions. It represents the name of the
+ // service as configured in AppHub.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "my-service"
+ GCPAppHubServiceIDKey = attribute.Key("gcp.apphub.service.id")
+
+ // GCPAppHubWorkloadCriticalityTypeKey is the attribute Key conforming to the
+ // "gcp.apphub.workload.criticality_type" semantic conventions. It represents
+ // the criticality of a workload indicates its importance to the business.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // Note: [See AppHub type enum]
+ //
+ // [See AppHub type enum]: https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type
+ GCPAppHubWorkloadCriticalityTypeKey = attribute.Key("gcp.apphub.workload.criticality_type")
+
+ // GCPAppHubWorkloadEnvironmentTypeKey is the attribute Key conforming to the
+ // "gcp.apphub.workload.environment_type" semantic conventions. It represents
+ // the environment of a workload is the stage of a software lifecycle.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // Note: [See AppHub environment type]
+ //
+ // [See AppHub environment type]: https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type_1
+ GCPAppHubWorkloadEnvironmentTypeKey = attribute.Key("gcp.apphub.workload.environment_type")
+
+ // GCPAppHubWorkloadIDKey is the attribute Key conforming to the
+ // "gcp.apphub.workload.id" semantic conventions. It represents the name of the
+ // workload as configured in AppHub.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "my-workload"
+ GCPAppHubWorkloadIDKey = attribute.Key("gcp.apphub.workload.id")
+
+ // GCPClientServiceKey is the attribute Key conforming to the
+ // "gcp.client.service" semantic conventions. It represents the identifies the
+ // Google Cloud service for which the official client library is intended.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "appengine", "run", "firestore", "alloydb", "spanner"
+ // Note: Intended to be a stable identifier for Google Cloud client libraries
+ // that is uniform across implementation languages. The value should be derived
+ // from the canonical service domain for the service; for example,
+ // 'foo.googleapis.com' should result in a value of 'foo'.
+ GCPClientServiceKey = attribute.Key("gcp.client.service")
+
+ // GCPCloudRunJobExecutionKey is the attribute Key conforming to the
+ // "gcp.cloud_run.job.execution" semantic conventions. It represents the name of
+ // the Cloud Run [execution] being run for the Job, as set by the
+ // [`CLOUD_RUN_EXECUTION`] environment variable.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "job-name-xxxx", "sample-job-mdw84"
+ //
+ // [execution]: https://cloud.google.com/run/docs/managing/job-executions
+ // [`CLOUD_RUN_EXECUTION`]: https://cloud.google.com/run/docs/container-contract#jobs-env-vars
+ GCPCloudRunJobExecutionKey = attribute.Key("gcp.cloud_run.job.execution")
+
+ // GCPCloudRunJobTaskIndexKey is the attribute Key conforming to the
+ // "gcp.cloud_run.job.task_index" semantic conventions. It represents the index
+ // for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`]
+ // environment variable.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 0, 1
+ //
+ // [`CLOUD_RUN_TASK_INDEX`]: https://cloud.google.com/run/docs/container-contract#jobs-env-vars
+ GCPCloudRunJobTaskIndexKey = attribute.Key("gcp.cloud_run.job.task_index")
+
+ // GCPGCEInstanceHostnameKey is the attribute Key conforming to the
+ // "gcp.gce.instance.hostname" semantic conventions. It represents the hostname
+ // of a GCE instance. This is the full value of the default or [custom hostname]
+ // .
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "my-host1234.example.com",
+ // "sample-vm.us-west1-b.c.my-project.internal"
+ //
+ // [custom hostname]: https://cloud.google.com/compute/docs/instances/custom-hostname-vm
+ GCPGCEInstanceHostnameKey = attribute.Key("gcp.gce.instance.hostname")
+
+ // GCPGCEInstanceNameKey is the attribute Key conforming to the
+ // "gcp.gce.instance.name" semantic conventions. It represents the instance name
+ // of a GCE instance. This is the value provided by `host.name`, the visible
+ // name of the instance in the Cloud Console UI, and the prefix for the default
+ // hostname of the instance as defined by the [default internal DNS name].
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "instance-1", "my-vm-name"
+ //
+ // [default internal DNS name]: https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names
+ GCPGCEInstanceNameKey = attribute.Key("gcp.gce.instance.name")
+)
+
+// GCPAppHubApplicationContainer returns an attribute KeyValue conforming to the
+// "gcp.apphub.application.container" semantic conventions. It represents the
+// container within GCP where the AppHub application is defined.
+func GCPAppHubApplicationContainer(val string) attribute.KeyValue {
+ return GCPAppHubApplicationContainerKey.String(val)
+}
+
+// GCPAppHubApplicationID returns an attribute KeyValue conforming to the
+// "gcp.apphub.application.id" semantic conventions. It represents the name of
+// the application as configured in AppHub.
+func GCPAppHubApplicationID(val string) attribute.KeyValue {
+ return GCPAppHubApplicationIDKey.String(val)
+}
+
+// GCPAppHubApplicationLocation returns an attribute KeyValue conforming to the
+// "gcp.apphub.application.location" semantic conventions. It represents the GCP
+// zone or region where the application is defined.
+func GCPAppHubApplicationLocation(val string) attribute.KeyValue {
+ return GCPAppHubApplicationLocationKey.String(val)
+}
+
+// GCPAppHubServiceID returns an attribute KeyValue conforming to the
+// "gcp.apphub.service.id" semantic conventions. It represents the name of the
+// service as configured in AppHub.
+func GCPAppHubServiceID(val string) attribute.KeyValue {
+ return GCPAppHubServiceIDKey.String(val)
+}
+
+// GCPAppHubWorkloadID returns an attribute KeyValue conforming to the
+// "gcp.apphub.workload.id" semantic conventions. It represents the name of the
+// workload as configured in AppHub.
+func GCPAppHubWorkloadID(val string) attribute.KeyValue {
+ return GCPAppHubWorkloadIDKey.String(val)
+}
+
+// GCPClientService returns an attribute KeyValue conforming to the
+// "gcp.client.service" semantic conventions. It represents the identifies the
+// Google Cloud service for which the official client library is intended.
+func GCPClientService(val string) attribute.KeyValue {
+ return GCPClientServiceKey.String(val)
+}
+
+// GCPCloudRunJobExecution returns an attribute KeyValue conforming to the
+// "gcp.cloud_run.job.execution" semantic conventions. It represents the name of
+// the Cloud Run [execution] being run for the Job, as set by the
+// [`CLOUD_RUN_EXECUTION`] environment variable.
+//
+// [execution]: https://cloud.google.com/run/docs/managing/job-executions
+// [`CLOUD_RUN_EXECUTION`]: https://cloud.google.com/run/docs/container-contract#jobs-env-vars
+func GCPCloudRunJobExecution(val string) attribute.KeyValue {
+ return GCPCloudRunJobExecutionKey.String(val)
+}
+
+// GCPCloudRunJobTaskIndex returns an attribute KeyValue conforming to the
+// "gcp.cloud_run.job.task_index" semantic conventions. It represents the index
+// for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`]
+// environment variable.
+//
+// [`CLOUD_RUN_TASK_INDEX`]: https://cloud.google.com/run/docs/container-contract#jobs-env-vars
+func GCPCloudRunJobTaskIndex(val int) attribute.KeyValue {
+ return GCPCloudRunJobTaskIndexKey.Int(val)
+}
+
+// GCPGCEInstanceHostname returns an attribute KeyValue conforming to the
+// "gcp.gce.instance.hostname" semantic conventions. It represents the hostname
+// of a GCE instance. This is the full value of the default or [custom hostname]
+// .
+//
+// [custom hostname]: https://cloud.google.com/compute/docs/instances/custom-hostname-vm
+func GCPGCEInstanceHostname(val string) attribute.KeyValue {
+ return GCPGCEInstanceHostnameKey.String(val)
+}
+
+// GCPGCEInstanceName returns an attribute KeyValue conforming to the
+// "gcp.gce.instance.name" semantic conventions. It represents the instance name
+// of a GCE instance. This is the value provided by `host.name`, the visible name
+// of the instance in the Cloud Console UI, and the prefix for the default
+// hostname of the instance as defined by the [default internal DNS name].
+//
+// [default internal DNS name]: https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names
+func GCPGCEInstanceName(val string) attribute.KeyValue {
+ return GCPGCEInstanceNameKey.String(val)
+}
+
+// Enum values for gcp.apphub.service.criticality_type
+var (
+ // Mission critical service.
+ // Stability: development
+ GCPAppHubServiceCriticalityTypeMissionCritical = GCPAppHubServiceCriticalityTypeKey.String("MISSION_CRITICAL")
+ // High impact.
+ // Stability: development
+ GCPAppHubServiceCriticalityTypeHigh = GCPAppHubServiceCriticalityTypeKey.String("HIGH")
+ // Medium impact.
+ // Stability: development
+ GCPAppHubServiceCriticalityTypeMedium = GCPAppHubServiceCriticalityTypeKey.String("MEDIUM")
+ // Low impact.
+ // Stability: development
+ GCPAppHubServiceCriticalityTypeLow = GCPAppHubServiceCriticalityTypeKey.String("LOW")
+)
+
+// Enum values for gcp.apphub.service.environment_type
+var (
+ // Production environment.
+ // Stability: development
+ GCPAppHubServiceEnvironmentTypeProduction = GCPAppHubServiceEnvironmentTypeKey.String("PRODUCTION")
+ // Staging environment.
+ // Stability: development
+ GCPAppHubServiceEnvironmentTypeStaging = GCPAppHubServiceEnvironmentTypeKey.String("STAGING")
+ // Test environment.
+ // Stability: development
+ GCPAppHubServiceEnvironmentTypeTest = GCPAppHubServiceEnvironmentTypeKey.String("TEST")
+ // Development environment.
+ // Stability: development
+ GCPAppHubServiceEnvironmentTypeDevelopment = GCPAppHubServiceEnvironmentTypeKey.String("DEVELOPMENT")
+)
+
+// Enum values for gcp.apphub.workload.criticality_type
+var (
+ // Mission critical service.
+ // Stability: development
+ GCPAppHubWorkloadCriticalityTypeMissionCritical = GCPAppHubWorkloadCriticalityTypeKey.String("MISSION_CRITICAL")
+ // High impact.
+ // Stability: development
+ GCPAppHubWorkloadCriticalityTypeHigh = GCPAppHubWorkloadCriticalityTypeKey.String("HIGH")
+ // Medium impact.
+ // Stability: development
+ GCPAppHubWorkloadCriticalityTypeMedium = GCPAppHubWorkloadCriticalityTypeKey.String("MEDIUM")
+ // Low impact.
+ // Stability: development
+ GCPAppHubWorkloadCriticalityTypeLow = GCPAppHubWorkloadCriticalityTypeKey.String("LOW")
+)
+
+// Enum values for gcp.apphub.workload.environment_type
+var (
+ // Production environment.
+ // Stability: development
+ GCPAppHubWorkloadEnvironmentTypeProduction = GCPAppHubWorkloadEnvironmentTypeKey.String("PRODUCTION")
+ // Staging environment.
+ // Stability: development
+ GCPAppHubWorkloadEnvironmentTypeStaging = GCPAppHubWorkloadEnvironmentTypeKey.String("STAGING")
+ // Test environment.
+ // Stability: development
+ GCPAppHubWorkloadEnvironmentTypeTest = GCPAppHubWorkloadEnvironmentTypeKey.String("TEST")
+ // Development environment.
+ // Stability: development
+ GCPAppHubWorkloadEnvironmentTypeDevelopment = GCPAppHubWorkloadEnvironmentTypeKey.String("DEVELOPMENT")
+)
+
+// Namespace: gen_ai
+const (
+ // GenAIAgentDescriptionKey is the attribute Key conforming to the
+ // "gen_ai.agent.description" semantic conventions. It represents the free-form
+ // description of the GenAI agent provided by the application.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Helps with math problems", "Generates fiction stories"
+ GenAIAgentDescriptionKey = attribute.Key("gen_ai.agent.description")
+
+ // GenAIAgentIDKey is the attribute Key conforming to the "gen_ai.agent.id"
+ // semantic conventions. It represents the unique identifier of the GenAI agent.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "asst_5j66UpCpwteGg4YSxUnt7lPY"
+ GenAIAgentIDKey = attribute.Key("gen_ai.agent.id")
+
+ // GenAIAgentNameKey is the attribute Key conforming to the "gen_ai.agent.name"
+ // semantic conventions. It represents the human-readable name of the GenAI
+ // agent provided by the application.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Math Tutor", "Fiction Writer"
+ GenAIAgentNameKey = attribute.Key("gen_ai.agent.name")
+
+ // GenAIConversationIDKey is the attribute Key conforming to the
+ // "gen_ai.conversation.id" semantic conventions. It represents the unique
+ // identifier for a conversation (session, thread), used to store and correlate
+ // messages within this conversation.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "conv_5j66UpCpwteGg4YSxUnt7lPY"
+ GenAIConversationIDKey = attribute.Key("gen_ai.conversation.id")
+
+ // GenAIDataSourceIDKey is the attribute Key conforming to the
+ // "gen_ai.data_source.id" semantic conventions. It represents the data source
+ // identifier.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "H7STPQYOND"
+ // Note: Data sources are used by AI agents and RAG applications to store
+ // grounding data. A data source may be an external database, object store,
+ // document collection, website, or any other storage system used by the GenAI
+ // agent or application. The `gen_ai.data_source.id` SHOULD match the identifier
+ // used by the GenAI system rather than a name specific to the external storage,
+ // such as a database or object store. Semantic conventions referencing
+ // `gen_ai.data_source.id` MAY also leverage additional attributes, such as
+ // `db.*`, to further identify and describe the data source.
+ GenAIDataSourceIDKey = attribute.Key("gen_ai.data_source.id")
+
+ // GenAIInputMessagesKey is the attribute Key conforming to the
+ // "gen_ai.input.messages" semantic conventions. It represents the chat history
+ // provided to the model as an input.
+ //
+ // Type: any
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "[\n {\n "role": "user",\n "parts": [\n {\n "type": "text",\n
+ // "content": "Weather in Paris?"\n }\n ]\n },\n {\n "role": "assistant",\n
+ // "parts": [\n {\n "type": "tool_call",\n "id":
+ // "call_VSPygqKTWdrhaFErNvMV18Yl",\n "name": "get_weather",\n "arguments": {\n
+ // "location": "Paris"\n }\n }\n ]\n },\n {\n "role": "tool",\n "parts": [\n {\n
+ // "type": "tool_call_response",\n "id": " call_VSPygqKTWdrhaFErNvMV18Yl",\n
+ // "result": "rainy, 57°F"\n }\n ]\n }\n]\n"
+ // Note: Instrumentations MUST follow [Input messages JSON schema].
+ // When the attribute is recorded on events, it MUST be recorded in structured
+ // form. When recorded on spans, it MAY be recorded as a JSON string if
+ // structured
+ // format is not supported and SHOULD be recorded in structured form otherwise.
+ //
+ // Messages MUST be provided in the order they were sent to the model.
+ // Instrumentations MAY provide a way for users to filter or truncate
+ // input messages.
+ //
+ // > [!Warning]
+ // > This attribute is likely to contain sensitive information including
+ // > user/PII data.
+ //
+ // See [Recording content on attributes]
+ // section for more details.
+ //
+ // [Input messages JSON schema]: /docs/gen-ai/gen-ai-input-messages.json
+ // [Recording content on attributes]: /docs/gen-ai/gen-ai-spans.md#recording-content-on-attributes
+ GenAIInputMessagesKey = attribute.Key("gen_ai.input.messages")
+
+ // GenAIOperationNameKey is the attribute Key conforming to the
+ // "gen_ai.operation.name" semantic conventions. It represents the name of the
+ // operation being performed.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // Note: If one of the predefined values applies, but specific system uses a
+ // different name it's RECOMMENDED to document it in the semantic conventions
+ // for specific GenAI system and use system-specific name in the
+ // instrumentation. If a different name is not documented, instrumentation
+ // libraries SHOULD use applicable predefined value.
+ GenAIOperationNameKey = attribute.Key("gen_ai.operation.name")
+
+ // GenAIOutputMessagesKey is the attribute Key conforming to the
+ // "gen_ai.output.messages" semantic conventions. It represents the messages
+ // returned by the model where each message represents a specific model response
+ // (choice, candidate).
+ //
+ // Type: any
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "[\n {\n "role": "assistant",\n "parts": [\n {\n "type": "text",\n
+ // "content": "The weather in Paris is currently rainy with a temperature of
+ // 57°F."\n }\n ],\n "finish_reason": "stop"\n }\n]\n"
+ // Note: Instrumentations MUST follow [Output messages JSON schema]
+ //
+ // Each message represents a single output choice/candidate generated by
+ // the model. Each message corresponds to exactly one generation
+ // (choice/candidate) and vice versa - one choice cannot be split across
+ // multiple messages or one message cannot contain parts from multiple choices.
+ //
+ // When the attribute is recorded on events, it MUST be recorded in structured
+ // form. When recorded on spans, it MAY be recorded as a JSON string if
+ // structured
+ // format is not supported and SHOULD be recorded in structured form otherwise.
+ //
+ // Instrumentations MAY provide a way for users to filter or truncate
+ // output messages.
+ //
+ // > [!Warning]
+ // > This attribute is likely to contain sensitive information including
+ // > user/PII data.
+ //
+ // See [Recording content on attributes]
+ // section for more details.
+ //
+ // [Output messages JSON schema]: /docs/gen-ai/gen-ai-output-messages.json
+ // [Recording content on attributes]: /docs/gen-ai/gen-ai-spans.md#recording-content-on-attributes
+ GenAIOutputMessagesKey = attribute.Key("gen_ai.output.messages")
+
+ // GenAIOutputTypeKey is the attribute Key conforming to the
+ // "gen_ai.output.type" semantic conventions. It represents the represents the
+ // content type requested by the client.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // Note: This attribute SHOULD be used when the client requests output of a
+ // specific type. The model may return zero or more outputs of this type.
+ // This attribute specifies the output modality and not the actual output
+ // format. For example, if an image is requested, the actual output could be a
+ // URL pointing to an image file.
+ // Additional output format details may be recorded in the future in the
+ // `gen_ai.output.{type}.*` attributes.
+ GenAIOutputTypeKey = attribute.Key("gen_ai.output.type")
+
+ // GenAIProviderNameKey is the attribute Key conforming to the
+ // "gen_ai.provider.name" semantic conventions. It represents the Generative AI
+ // provider as identified by the client or server instrumentation.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // Note: The attribute SHOULD be set based on the instrumentation's best
+ // knowledge and may differ from the actual model provider.
+ //
+ // Multiple providers, including Azure OpenAI, Gemini, and AI hosting platforms
+ // are accessible using the OpenAI REST API and corresponding client libraries,
+ // but may proxy or host models from different providers.
+ //
+ // The `gen_ai.request.model`, `gen_ai.response.model`, and `server.address`
+ // attributes may help identify the actual system in use.
+ //
+ // The `gen_ai.provider.name` attribute acts as a discriminator that
+ // identifies the GenAI telemetry format flavor specific to that provider
+ // within GenAI semantic conventions.
+ // It SHOULD be set consistently with provider-specific attributes and signals.
+ // For example, GenAI spans, metrics, and events related to AWS Bedrock
+ // should have the `gen_ai.provider.name` set to `aws.bedrock` and include
+ // applicable `aws.bedrock.*` attributes and are not expected to include
+ // `openai.*` attributes.
+ GenAIProviderNameKey = attribute.Key("gen_ai.provider.name")
+
+ // GenAIRequestChoiceCountKey is the attribute Key conforming to the
+ // "gen_ai.request.choice.count" semantic conventions. It represents the target
+ // number of candidate completions to return.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 3
+ GenAIRequestChoiceCountKey = attribute.Key("gen_ai.request.choice.count")
+
+ // GenAIRequestEncodingFormatsKey is the attribute Key conforming to the
+ // "gen_ai.request.encoding_formats" semantic conventions. It represents the
+ // encoding formats requested in an embeddings operation, if specified.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "base64"], ["float", "binary"
+ // Note: In some GenAI systems the encoding formats are called embedding types.
+ // Also, some GenAI systems only accept a single format per request.
+ GenAIRequestEncodingFormatsKey = attribute.Key("gen_ai.request.encoding_formats")
+
+ // GenAIRequestFrequencyPenaltyKey is the attribute Key conforming to the
+ // "gen_ai.request.frequency_penalty" semantic conventions. It represents the
+ // frequency penalty setting for the GenAI request.
+ //
+ // Type: double
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 0.1
+ GenAIRequestFrequencyPenaltyKey = attribute.Key("gen_ai.request.frequency_penalty")
+
+ // GenAIRequestMaxTokensKey is the attribute Key conforming to the
+ // "gen_ai.request.max_tokens" semantic conventions. It represents the maximum
+ // number of tokens the model generates for a request.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 100
+ GenAIRequestMaxTokensKey = attribute.Key("gen_ai.request.max_tokens")
+
+ // GenAIRequestModelKey is the attribute Key conforming to the
+ // "gen_ai.request.model" semantic conventions. It represents the name of the
+ // GenAI model a request is being made to.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: gpt-4
+ GenAIRequestModelKey = attribute.Key("gen_ai.request.model")
+
+ // GenAIRequestPresencePenaltyKey is the attribute Key conforming to the
+ // "gen_ai.request.presence_penalty" semantic conventions. It represents the
+ // presence penalty setting for the GenAI request.
+ //
+ // Type: double
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 0.1
+ GenAIRequestPresencePenaltyKey = attribute.Key("gen_ai.request.presence_penalty")
+
+ // GenAIRequestSeedKey is the attribute Key conforming to the
+ // "gen_ai.request.seed" semantic conventions. It represents the requests with
+ // same seed value more likely to return same result.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 100
+ GenAIRequestSeedKey = attribute.Key("gen_ai.request.seed")
+
+ // GenAIRequestStopSequencesKey is the attribute Key conforming to the
+ // "gen_ai.request.stop_sequences" semantic conventions. It represents the list
+ // of sequences that the model will use to stop generating further tokens.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "forest", "lived"
+ GenAIRequestStopSequencesKey = attribute.Key("gen_ai.request.stop_sequences")
+
+ // GenAIRequestTemperatureKey is the attribute Key conforming to the
+ // "gen_ai.request.temperature" semantic conventions. It represents the
+ // temperature setting for the GenAI request.
+ //
+ // Type: double
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 0.0
+ GenAIRequestTemperatureKey = attribute.Key("gen_ai.request.temperature")
+
+ // GenAIRequestTopKKey is the attribute Key conforming to the
+ // "gen_ai.request.top_k" semantic conventions. It represents the top_k sampling
+ // setting for the GenAI request.
+ //
+ // Type: double
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 1.0
+ GenAIRequestTopKKey = attribute.Key("gen_ai.request.top_k")
+
+ // GenAIRequestTopPKey is the attribute Key conforming to the
+ // "gen_ai.request.top_p" semantic conventions. It represents the top_p sampling
+ // setting for the GenAI request.
+ //
+ // Type: double
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 1.0
+ GenAIRequestTopPKey = attribute.Key("gen_ai.request.top_p")
+
+ // GenAIResponseFinishReasonsKey is the attribute Key conforming to the
+ // "gen_ai.response.finish_reasons" semantic conventions. It represents the
+ // array of reasons the model stopped generating tokens, corresponding to each
+ // generation received.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "stop"], ["stop", "length"
+ GenAIResponseFinishReasonsKey = attribute.Key("gen_ai.response.finish_reasons")
+
+ // GenAIResponseIDKey is the attribute Key conforming to the
+ // "gen_ai.response.id" semantic conventions. It represents the unique
+ // identifier for the completion.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "chatcmpl-123"
+ GenAIResponseIDKey = attribute.Key("gen_ai.response.id")
+
+ // GenAIResponseModelKey is the attribute Key conforming to the
+ // "gen_ai.response.model" semantic conventions. It represents the name of the
+ // model that generated the response.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "gpt-4-0613"
+ GenAIResponseModelKey = attribute.Key("gen_ai.response.model")
+
+ // GenAISystemInstructionsKey is the attribute Key conforming to the
+ // "gen_ai.system_instructions" semantic conventions. It represents the system
+ // message or instructions provided to the GenAI model separately from the chat
+ // history.
+ //
+ // Type: any
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "[\n {\n "type": "text",\n "content": "You are an Agent that greet
+ // users, always use greetings tool to respond"\n }\n]\n", "[\n {\n "type":
+ // "text",\n "content": "You are a language translator."\n },\n {\n "type":
+ // "text",\n "content": "Your mission is to translate text in English to
+ // French."\n }\n]\n"
+ // Note: This attribute SHOULD be used when the corresponding provider or API
+ // allows to provide system instructions or messages separately from the
+ // chat history.
+ //
+ // Instructions that are part of the chat history SHOULD be recorded in
+ // `gen_ai.input.messages` attribute instead.
+ //
+ // Instrumentations MUST follow [System instructions JSON schema].
+ //
+ // When recorded on spans, it MAY be recorded as a JSON string if structured
+ // format is not supported and SHOULD be recorded in structured form otherwise.
+ //
+ // Instrumentations MAY provide a way for users to filter or truncate
+ // system instructions.
+ //
+ // > [!Warning]
+ // > This attribute may contain sensitive information.
+ //
+ // See [Recording content on attributes]
+ // section for more details.
+ //
+ // [System instructions JSON schema]: /docs/gen-ai/gen-ai-system-instructions.json
+ // [Recording content on attributes]: /docs/gen-ai/gen-ai-spans.md#recording-content-on-attributes
+ GenAISystemInstructionsKey = attribute.Key("gen_ai.system_instructions")
+
+ // GenAITokenTypeKey is the attribute Key conforming to the "gen_ai.token.type"
+ // semantic conventions. It represents the type of token being counted.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "input", "output"
+ GenAITokenTypeKey = attribute.Key("gen_ai.token.type")
+
+ // GenAIToolCallIDKey is the attribute Key conforming to the
+ // "gen_ai.tool.call.id" semantic conventions. It represents the tool call
+ // identifier.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "call_mszuSIzqtI65i1wAUOE8w5H4"
+ GenAIToolCallIDKey = attribute.Key("gen_ai.tool.call.id")
+
+ // GenAIToolDescriptionKey is the attribute Key conforming to the
+ // "gen_ai.tool.description" semantic conventions. It represents the tool
+ // description.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Multiply two numbers"
+ GenAIToolDescriptionKey = attribute.Key("gen_ai.tool.description")
+
+ // GenAIToolNameKey is the attribute Key conforming to the "gen_ai.tool.name"
+ // semantic conventions. It represents the name of the tool utilized by the
+ // agent.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Flights"
+ GenAIToolNameKey = attribute.Key("gen_ai.tool.name")
+
+ // GenAIToolTypeKey is the attribute Key conforming to the "gen_ai.tool.type"
+ // semantic conventions. It represents the type of the tool utilized by the
+ // agent.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "function", "extension", "datastore"
+ // Note: Extension: A tool executed on the agent-side to directly call external
+ // APIs, bridging the gap between the agent and real-world systems.
+ // Agent-side operations involve actions that are performed by the agent on the
+ // server or within the agent's controlled environment.
+ // Function: A tool executed on the client-side, where the agent generates
+ // parameters for a predefined function, and the client executes the logic.
+ // Client-side operations are actions taken on the user's end or within the
+ // client application.
+ // Datastore: A tool used by the agent to access and query structured or
+ // unstructured external data for retrieval-augmented tasks or knowledge
+ // updates.
+ GenAIToolTypeKey = attribute.Key("gen_ai.tool.type")
+
+ // GenAIUsageInputTokensKey is the attribute Key conforming to the
+ // "gen_ai.usage.input_tokens" semantic conventions. It represents the number of
+ // tokens used in the GenAI input (prompt).
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 100
+ GenAIUsageInputTokensKey = attribute.Key("gen_ai.usage.input_tokens")
+
+ // GenAIUsageOutputTokensKey is the attribute Key conforming to the
+ // "gen_ai.usage.output_tokens" semantic conventions. It represents the number
+ // of tokens used in the GenAI response (completion).
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 180
+ GenAIUsageOutputTokensKey = attribute.Key("gen_ai.usage.output_tokens")
+)
+
+// GenAIAgentDescription returns an attribute KeyValue conforming to the
+// "gen_ai.agent.description" semantic conventions. It represents the free-form
+// description of the GenAI agent provided by the application.
+func GenAIAgentDescription(val string) attribute.KeyValue {
+ return GenAIAgentDescriptionKey.String(val)
+}
+
+// GenAIAgentID returns an attribute KeyValue conforming to the "gen_ai.agent.id"
+// semantic conventions. It represents the unique identifier of the GenAI agent.
+func GenAIAgentID(val string) attribute.KeyValue {
+ return GenAIAgentIDKey.String(val)
+}
+
+// GenAIAgentName returns an attribute KeyValue conforming to the
+// "gen_ai.agent.name" semantic conventions. It represents the human-readable
+// name of the GenAI agent provided by the application.
+func GenAIAgentName(val string) attribute.KeyValue {
+ return GenAIAgentNameKey.String(val)
+}
+
+// GenAIConversationID returns an attribute KeyValue conforming to the
+// "gen_ai.conversation.id" semantic conventions. It represents the unique
+// identifier for a conversation (session, thread), used to store and correlate
+// messages within this conversation.
+func GenAIConversationID(val string) attribute.KeyValue {
+ return GenAIConversationIDKey.String(val)
+}
+
+// GenAIDataSourceID returns an attribute KeyValue conforming to the
+// "gen_ai.data_source.id" semantic conventions. It represents the data source
+// identifier.
+func GenAIDataSourceID(val string) attribute.KeyValue {
+ return GenAIDataSourceIDKey.String(val)
+}
+
+// GenAIRequestChoiceCount returns an attribute KeyValue conforming to the
+// "gen_ai.request.choice.count" semantic conventions. It represents the target
+// number of candidate completions to return.
+func GenAIRequestChoiceCount(val int) attribute.KeyValue {
+ return GenAIRequestChoiceCountKey.Int(val)
+}
+
+// GenAIRequestEncodingFormats returns an attribute KeyValue conforming to the
+// "gen_ai.request.encoding_formats" semantic conventions. It represents the
+// encoding formats requested in an embeddings operation, if specified.
+func GenAIRequestEncodingFormats(val ...string) attribute.KeyValue {
+ return GenAIRequestEncodingFormatsKey.StringSlice(val)
+}
+
+// GenAIRequestFrequencyPenalty returns an attribute KeyValue conforming to the
+// "gen_ai.request.frequency_penalty" semantic conventions. It represents the
+// frequency penalty setting for the GenAI request.
+func GenAIRequestFrequencyPenalty(val float64) attribute.KeyValue {
+ return GenAIRequestFrequencyPenaltyKey.Float64(val)
+}
+
+// GenAIRequestMaxTokens returns an attribute KeyValue conforming to the
+// "gen_ai.request.max_tokens" semantic conventions. It represents the maximum
+// number of tokens the model generates for a request.
+func GenAIRequestMaxTokens(val int) attribute.KeyValue {
+ return GenAIRequestMaxTokensKey.Int(val)
+}
+
+// GenAIRequestModel returns an attribute KeyValue conforming to the
+// "gen_ai.request.model" semantic conventions. It represents the name of the
+// GenAI model a request is being made to.
+func GenAIRequestModel(val string) attribute.KeyValue {
+ return GenAIRequestModelKey.String(val)
+}
+
+// GenAIRequestPresencePenalty returns an attribute KeyValue conforming to the
+// "gen_ai.request.presence_penalty" semantic conventions. It represents the
+// presence penalty setting for the GenAI request.
+func GenAIRequestPresencePenalty(val float64) attribute.KeyValue {
+ return GenAIRequestPresencePenaltyKey.Float64(val)
+}
+
+// GenAIRequestSeed returns an attribute KeyValue conforming to the
+// "gen_ai.request.seed" semantic conventions. It represents the requests with
+// same seed value more likely to return same result.
+func GenAIRequestSeed(val int) attribute.KeyValue {
+ return GenAIRequestSeedKey.Int(val)
+}
+
+// GenAIRequestStopSequences returns an attribute KeyValue conforming to the
+// "gen_ai.request.stop_sequences" semantic conventions. It represents the list
+// of sequences that the model will use to stop generating further tokens.
+func GenAIRequestStopSequences(val ...string) attribute.KeyValue {
+ return GenAIRequestStopSequencesKey.StringSlice(val)
+}
+
+// GenAIRequestTemperature returns an attribute KeyValue conforming to the
+// "gen_ai.request.temperature" semantic conventions. It represents the
+// temperature setting for the GenAI request.
+func GenAIRequestTemperature(val float64) attribute.KeyValue {
+ return GenAIRequestTemperatureKey.Float64(val)
+}
+
+// GenAIRequestTopK returns an attribute KeyValue conforming to the
+// "gen_ai.request.top_k" semantic conventions. It represents the top_k sampling
+// setting for the GenAI request.
+func GenAIRequestTopK(val float64) attribute.KeyValue {
+ return GenAIRequestTopKKey.Float64(val)
+}
+
+// GenAIRequestTopP returns an attribute KeyValue conforming to the
+// "gen_ai.request.top_p" semantic conventions. It represents the top_p sampling
+// setting for the GenAI request.
+func GenAIRequestTopP(val float64) attribute.KeyValue {
+ return GenAIRequestTopPKey.Float64(val)
+}
+
+// GenAIResponseFinishReasons returns an attribute KeyValue conforming to the
+// "gen_ai.response.finish_reasons" semantic conventions. It represents the array
+// of reasons the model stopped generating tokens, corresponding to each
+// generation received.
+func GenAIResponseFinishReasons(val ...string) attribute.KeyValue {
+ return GenAIResponseFinishReasonsKey.StringSlice(val)
+}
+
+// GenAIResponseID returns an attribute KeyValue conforming to the
+// "gen_ai.response.id" semantic conventions. It represents the unique identifier
+// for the completion.
+func GenAIResponseID(val string) attribute.KeyValue {
+ return GenAIResponseIDKey.String(val)
+}
+
+// GenAIResponseModel returns an attribute KeyValue conforming to the
+// "gen_ai.response.model" semantic conventions. It represents the name of the
+// model that generated the response.
+func GenAIResponseModel(val string) attribute.KeyValue {
+ return GenAIResponseModelKey.String(val)
+}
+
+// GenAIToolCallID returns an attribute KeyValue conforming to the
+// "gen_ai.tool.call.id" semantic conventions. It represents the tool call
+// identifier.
+func GenAIToolCallID(val string) attribute.KeyValue {
+ return GenAIToolCallIDKey.String(val)
+}
+
+// GenAIToolDescription returns an attribute KeyValue conforming to the
+// "gen_ai.tool.description" semantic conventions. It represents the tool
+// description.
+func GenAIToolDescription(val string) attribute.KeyValue {
+ return GenAIToolDescriptionKey.String(val)
+}
+
+// GenAIToolName returns an attribute KeyValue conforming to the
+// "gen_ai.tool.name" semantic conventions. It represents the name of the tool
+// utilized by the agent.
+func GenAIToolName(val string) attribute.KeyValue {
+ return GenAIToolNameKey.String(val)
+}
+
+// GenAIToolType returns an attribute KeyValue conforming to the
+// "gen_ai.tool.type" semantic conventions. It represents the type of the tool
+// utilized by the agent.
+func GenAIToolType(val string) attribute.KeyValue {
+ return GenAIToolTypeKey.String(val)
+}
+
+// GenAIUsageInputTokens returns an attribute KeyValue conforming to the
+// "gen_ai.usage.input_tokens" semantic conventions. It represents the number of
+// tokens used in the GenAI input (prompt).
+func GenAIUsageInputTokens(val int) attribute.KeyValue {
+ return GenAIUsageInputTokensKey.Int(val)
+}
+
+// GenAIUsageOutputTokens returns an attribute KeyValue conforming to the
+// "gen_ai.usage.output_tokens" semantic conventions. It represents the number of
+// tokens used in the GenAI response (completion).
+func GenAIUsageOutputTokens(val int) attribute.KeyValue {
+ return GenAIUsageOutputTokensKey.Int(val)
+}
+
+// Enum values for gen_ai.operation.name
+var (
+ // Chat completion operation such as [OpenAI Chat API]
+ // Stability: development
+ //
+ // [OpenAI Chat API]: https://platform.openai.com/docs/api-reference/chat
+ GenAIOperationNameChat = GenAIOperationNameKey.String("chat")
+ // Multimodal content generation operation such as [Gemini Generate Content]
+ // Stability: development
+ //
+ // [Gemini Generate Content]: https://ai.google.dev/api/generate-content
+ GenAIOperationNameGenerateContent = GenAIOperationNameKey.String("generate_content")
+ // Text completions operation such as [OpenAI Completions API (Legacy)]
+ // Stability: development
+ //
+ // [OpenAI Completions API (Legacy)]: https://platform.openai.com/docs/api-reference/completions
+ GenAIOperationNameTextCompletion = GenAIOperationNameKey.String("text_completion")
+ // Embeddings operation such as [OpenAI Create embeddings API]
+ // Stability: development
+ //
+ // [OpenAI Create embeddings API]: https://platform.openai.com/docs/api-reference/embeddings/create
+ GenAIOperationNameEmbeddings = GenAIOperationNameKey.String("embeddings")
+ // Create GenAI agent
+ // Stability: development
+ GenAIOperationNameCreateAgent = GenAIOperationNameKey.String("create_agent")
+ // Invoke GenAI agent
+ // Stability: development
+ GenAIOperationNameInvokeAgent = GenAIOperationNameKey.String("invoke_agent")
+ // Execute a tool
+ // Stability: development
+ GenAIOperationNameExecuteTool = GenAIOperationNameKey.String("execute_tool")
+)
+
+// Enum values for gen_ai.output.type
+var (
+ // Plain text
+ // Stability: development
+ GenAIOutputTypeText = GenAIOutputTypeKey.String("text")
+ // JSON object with known or unknown schema
+ // Stability: development
+ GenAIOutputTypeJSON = GenAIOutputTypeKey.String("json")
+ // Image
+ // Stability: development
+ GenAIOutputTypeImage = GenAIOutputTypeKey.String("image")
+ // Speech
+ // Stability: development
+ GenAIOutputTypeSpeech = GenAIOutputTypeKey.String("speech")
+)
+
+// Enum values for gen_ai.provider.name
+var (
+ // [OpenAI]
+ // Stability: development
+ //
+ // [OpenAI]: https://openai.com/
+ GenAIProviderNameOpenAI = GenAIProviderNameKey.String("openai")
+ // Any Google generative AI endpoint
+ // Stability: development
+ GenAIProviderNameGCPGenAI = GenAIProviderNameKey.String("gcp.gen_ai")
+ // [Vertex AI]
+ // Stability: development
+ //
+ // [Vertex AI]: https://cloud.google.com/vertex-ai
+ GenAIProviderNameGCPVertexAI = GenAIProviderNameKey.String("gcp.vertex_ai")
+ // [Gemini]
+ // Stability: development
+ //
+ // [Gemini]: https://cloud.google.com/products/gemini
+ GenAIProviderNameGCPGemini = GenAIProviderNameKey.String("gcp.gemini")
+ // [Anthropic]
+ // Stability: development
+ //
+ // [Anthropic]: https://www.anthropic.com/
+ GenAIProviderNameAnthropic = GenAIProviderNameKey.String("anthropic")
+ // [Cohere]
+ // Stability: development
+ //
+ // [Cohere]: https://cohere.com/
+ GenAIProviderNameCohere = GenAIProviderNameKey.String("cohere")
+ // Azure AI Inference
+ // Stability: development
+ GenAIProviderNameAzureAIInference = GenAIProviderNameKey.String("azure.ai.inference")
+ // [Azure OpenAI]
+ // Stability: development
+ //
+ // [Azure OpenAI]: https://azure.microsoft.com/products/ai-services/openai-service/
+ GenAIProviderNameAzureAIOpenAI = GenAIProviderNameKey.String("azure.ai.openai")
+ // [IBM Watsonx AI]
+ // Stability: development
+ //
+ // [IBM Watsonx AI]: https://www.ibm.com/products/watsonx-ai
+ GenAIProviderNameIBMWatsonxAI = GenAIProviderNameKey.String("ibm.watsonx.ai")
+ // [AWS Bedrock]
+ // Stability: development
+ //
+ // [AWS Bedrock]: https://aws.amazon.com/bedrock
+ GenAIProviderNameAWSBedrock = GenAIProviderNameKey.String("aws.bedrock")
+ // [Perplexity]
+ // Stability: development
+ //
+ // [Perplexity]: https://www.perplexity.ai/
+ GenAIProviderNamePerplexity = GenAIProviderNameKey.String("perplexity")
+ // [xAI]
+ // Stability: development
+ //
+ // [xAI]: https://x.ai/
+ GenAIProviderNameXAI = GenAIProviderNameKey.String("x_ai")
+ // [DeepSeek]
+ // Stability: development
+ //
+ // [DeepSeek]: https://www.deepseek.com/
+ GenAIProviderNameDeepseek = GenAIProviderNameKey.String("deepseek")
+ // [Groq]
+ // Stability: development
+ //
+ // [Groq]: https://groq.com/
+ GenAIProviderNameGroq = GenAIProviderNameKey.String("groq")
+ // [Mistral AI]
+ // Stability: development
+ //
+ // [Mistral AI]: https://mistral.ai/
+ GenAIProviderNameMistralAI = GenAIProviderNameKey.String("mistral_ai")
+)
+
+// Enum values for gen_ai.token.type
+var (
+ // Input tokens (prompt, input, etc.)
+ // Stability: development
+ GenAITokenTypeInput = GenAITokenTypeKey.String("input")
+ // Output tokens (completion, response, etc.)
+ // Stability: development
+ GenAITokenTypeOutput = GenAITokenTypeKey.String("output")
+)
+
+// Namespace: geo
+const (
+ // GeoContinentCodeKey is the attribute Key conforming to the
+ // "geo.continent.code" semantic conventions. It represents the two-letter code
+ // representing continent’s name.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ GeoContinentCodeKey = attribute.Key("geo.continent.code")
+
+ // GeoCountryISOCodeKey is the attribute Key conforming to the
+ // "geo.country.iso_code" semantic conventions. It represents the two-letter ISO
+ // Country Code ([ISO 3166-1 alpha2]).
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "CA"
+ //
+ // [ISO 3166-1 alpha2]: https://wikipedia.org/wiki/ISO_3166-1#Codes
+ GeoCountryISOCodeKey = attribute.Key("geo.country.iso_code")
+
+ // GeoLocalityNameKey is the attribute Key conforming to the "geo.locality.name"
+ // semantic conventions. It represents the locality name. Represents the name of
+ // a city, town, village, or similar populated place.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Montreal", "Berlin"
+ GeoLocalityNameKey = attribute.Key("geo.locality.name")
+
+ // GeoLocationLatKey is the attribute Key conforming to the "geo.location.lat"
+ // semantic conventions. It represents the latitude of the geo location in
+ // [WGS84].
+ //
+ // Type: double
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 45.505918
+ //
+ // [WGS84]: https://wikipedia.org/wiki/World_Geodetic_System#WGS84
+ GeoLocationLatKey = attribute.Key("geo.location.lat")
+
+ // GeoLocationLonKey is the attribute Key conforming to the "geo.location.lon"
+ // semantic conventions. It represents the longitude of the geo location in
+ // [WGS84].
+ //
+ // Type: double
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: -73.61483
+ //
+ // [WGS84]: https://wikipedia.org/wiki/World_Geodetic_System#WGS84
+ GeoLocationLonKey = attribute.Key("geo.location.lon")
+
+ // GeoPostalCodeKey is the attribute Key conforming to the "geo.postal_code"
+ // semantic conventions. It represents the postal code associated with the
+ // location. Values appropriate for this field may also be known as a postcode
+ // or ZIP code and will vary widely from country to country.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "94040"
+ GeoPostalCodeKey = attribute.Key("geo.postal_code")
+
+ // GeoRegionISOCodeKey is the attribute Key conforming to the
+ // "geo.region.iso_code" semantic conventions. It represents the region ISO code
+ // ([ISO 3166-2]).
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "CA-QC"
+ //
+ // [ISO 3166-2]: https://wikipedia.org/wiki/ISO_3166-2
+ GeoRegionISOCodeKey = attribute.Key("geo.region.iso_code")
+)
+
+// GeoCountryISOCode returns an attribute KeyValue conforming to the
+// "geo.country.iso_code" semantic conventions. It represents the two-letter ISO
+// Country Code ([ISO 3166-1 alpha2]).
+//
+// [ISO 3166-1 alpha2]: https://wikipedia.org/wiki/ISO_3166-1#Codes
+func GeoCountryISOCode(val string) attribute.KeyValue {
+ return GeoCountryISOCodeKey.String(val)
+}
+
+// GeoLocalityName returns an attribute KeyValue conforming to the
+// "geo.locality.name" semantic conventions. It represents the locality name.
+// Represents the name of a city, town, village, or similar populated place.
+func GeoLocalityName(val string) attribute.KeyValue {
+ return GeoLocalityNameKey.String(val)
+}
+
+// GeoLocationLat returns an attribute KeyValue conforming to the
+// "geo.location.lat" semantic conventions. It represents the latitude of the geo
+// location in [WGS84].
+//
+// [WGS84]: https://wikipedia.org/wiki/World_Geodetic_System#WGS84
+func GeoLocationLat(val float64) attribute.KeyValue {
+ return GeoLocationLatKey.Float64(val)
+}
+
+// GeoLocationLon returns an attribute KeyValue conforming to the
+// "geo.location.lon" semantic conventions. It represents the longitude of the
+// geo location in [WGS84].
+//
+// [WGS84]: https://wikipedia.org/wiki/World_Geodetic_System#WGS84
+func GeoLocationLon(val float64) attribute.KeyValue {
+ return GeoLocationLonKey.Float64(val)
+}
+
+// GeoPostalCode returns an attribute KeyValue conforming to the
+// "geo.postal_code" semantic conventions. It represents the postal code
+// associated with the location. Values appropriate for this field may also be
+// known as a postcode or ZIP code and will vary widely from country to country.
+func GeoPostalCode(val string) attribute.KeyValue {
+ return GeoPostalCodeKey.String(val)
+}
+
+// GeoRegionISOCode returns an attribute KeyValue conforming to the
+// "geo.region.iso_code" semantic conventions. It represents the region ISO code
+// ([ISO 3166-2]).
+//
+// [ISO 3166-2]: https://wikipedia.org/wiki/ISO_3166-2
+func GeoRegionISOCode(val string) attribute.KeyValue {
+ return GeoRegionISOCodeKey.String(val)
+}
+
+// Enum values for geo.continent.code
+var (
+ // Africa
+ // Stability: development
+ GeoContinentCodeAf = GeoContinentCodeKey.String("AF")
+ // Antarctica
+ // Stability: development
+ GeoContinentCodeAn = GeoContinentCodeKey.String("AN")
+ // Asia
+ // Stability: development
+ GeoContinentCodeAs = GeoContinentCodeKey.String("AS")
+ // Europe
+ // Stability: development
+ GeoContinentCodeEu = GeoContinentCodeKey.String("EU")
+ // North America
+ // Stability: development
+ GeoContinentCodeNa = GeoContinentCodeKey.String("NA")
+ // Oceania
+ // Stability: development
+ GeoContinentCodeOc = GeoContinentCodeKey.String("OC")
+ // South America
+ // Stability: development
+ GeoContinentCodeSa = GeoContinentCodeKey.String("SA")
+)
+
+// Namespace: go
+const (
+ // GoMemoryTypeKey is the attribute Key conforming to the "go.memory.type"
+ // semantic conventions. It represents the type of memory.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "other", "stack"
+ GoMemoryTypeKey = attribute.Key("go.memory.type")
+)
+
+// Enum values for go.memory.type
+var (
+ // Memory allocated from the heap that is reserved for stack space, whether or
+ // not it is currently in-use.
+ // Stability: development
+ GoMemoryTypeStack = GoMemoryTypeKey.String("stack")
+ // Memory used by the Go runtime, excluding other categories of memory usage
+ // described in this enumeration.
+ // Stability: development
+ GoMemoryTypeOther = GoMemoryTypeKey.String("other")
+)
+
+// Namespace: graphql
+const (
+ // GraphQLDocumentKey is the attribute Key conforming to the "graphql.document"
+ // semantic conventions. It represents the GraphQL document being executed.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: query findBookById { bookById(id: ?) { name } }
+ // Note: The value may be sanitized to exclude sensitive information.
+ GraphQLDocumentKey = attribute.Key("graphql.document")
+
+ // GraphQLOperationNameKey is the attribute Key conforming to the
+ // "graphql.operation.name" semantic conventions. It represents the name of the
+ // operation being executed.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: findBookById
+ GraphQLOperationNameKey = attribute.Key("graphql.operation.name")
+
+ // GraphQLOperationTypeKey is the attribute Key conforming to the
+ // "graphql.operation.type" semantic conventions. It represents the type of the
+ // operation being executed.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "query", "mutation", "subscription"
+ GraphQLOperationTypeKey = attribute.Key("graphql.operation.type")
+)
+
+// GraphQLDocument returns an attribute KeyValue conforming to the
+// "graphql.document" semantic conventions. It represents the GraphQL document
+// being executed.
+func GraphQLDocument(val string) attribute.KeyValue {
+ return GraphQLDocumentKey.String(val)
+}
+
+// GraphQLOperationName returns an attribute KeyValue conforming to the
+// "graphql.operation.name" semantic conventions. It represents the name of the
+// operation being executed.
+func GraphQLOperationName(val string) attribute.KeyValue {
+ return GraphQLOperationNameKey.String(val)
+}
+
+// Enum values for graphql.operation.type
+var (
+ // GraphQL query
+ // Stability: development
+ GraphQLOperationTypeQuery = GraphQLOperationTypeKey.String("query")
+ // GraphQL mutation
+ // Stability: development
+ GraphQLOperationTypeMutation = GraphQLOperationTypeKey.String("mutation")
+ // GraphQL subscription
+ // Stability: development
+ GraphQLOperationTypeSubscription = GraphQLOperationTypeKey.String("subscription")
+)
+
+// Namespace: heroku
+const (
+ // HerokuAppIDKey is the attribute Key conforming to the "heroku.app.id"
+ // semantic conventions. It represents the unique identifier for the
+ // application.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "2daa2797-e42b-4624-9322-ec3f968df4da"
+ HerokuAppIDKey = attribute.Key("heroku.app.id")
+
+ // HerokuReleaseCommitKey is the attribute Key conforming to the
+ // "heroku.release.commit" semantic conventions. It represents the commit hash
+ // for the current release.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "e6134959463efd8966b20e75b913cafe3f5ec"
+ HerokuReleaseCommitKey = attribute.Key("heroku.release.commit")
+
+ // HerokuReleaseCreationTimestampKey is the attribute Key conforming to the
+ // "heroku.release.creation_timestamp" semantic conventions. It represents the
+ // time and date the release was created.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "2022-10-23T18:00:42Z"
+ HerokuReleaseCreationTimestampKey = attribute.Key("heroku.release.creation_timestamp")
+)
+
+// HerokuAppID returns an attribute KeyValue conforming to the "heroku.app.id"
+// semantic conventions. It represents the unique identifier for the application.
+func HerokuAppID(val string) attribute.KeyValue {
+ return HerokuAppIDKey.String(val)
+}
+
+// HerokuReleaseCommit returns an attribute KeyValue conforming to the
+// "heroku.release.commit" semantic conventions. It represents the commit hash
+// for the current release.
+func HerokuReleaseCommit(val string) attribute.KeyValue {
+ return HerokuReleaseCommitKey.String(val)
+}
+
+// HerokuReleaseCreationTimestamp returns an attribute KeyValue conforming to the
+// "heroku.release.creation_timestamp" semantic conventions. It represents the
+// time and date the release was created.
+func HerokuReleaseCreationTimestamp(val string) attribute.KeyValue {
+ return HerokuReleaseCreationTimestampKey.String(val)
+}
+
+// Namespace: host
+const (
+ // HostArchKey is the attribute Key conforming to the "host.arch" semantic
+ // conventions. It represents the CPU architecture the host system is running
+ // on.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ HostArchKey = attribute.Key("host.arch")
+
+ // HostCPUCacheL2SizeKey is the attribute Key conforming to the
+ // "host.cpu.cache.l2.size" semantic conventions. It represents the amount of
+ // level 2 memory cache available to the processor (in Bytes).
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 12288000
+ HostCPUCacheL2SizeKey = attribute.Key("host.cpu.cache.l2.size")
+
+ // HostCPUFamilyKey is the attribute Key conforming to the "host.cpu.family"
+ // semantic conventions. It represents the family or generation of the CPU.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "6", "PA-RISC 1.1e"
+ HostCPUFamilyKey = attribute.Key("host.cpu.family")
+
+ // HostCPUModelIDKey is the attribute Key conforming to the "host.cpu.model.id"
+ // semantic conventions. It represents the model identifier. It provides more
+ // granular information about the CPU, distinguishing it from other CPUs within
+ // the same family.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "6", "9000/778/B180L"
+ HostCPUModelIDKey = attribute.Key("host.cpu.model.id")
+
+ // HostCPUModelNameKey is the attribute Key conforming to the
+ // "host.cpu.model.name" semantic conventions. It represents the model
+ // designation of the processor.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz"
+ HostCPUModelNameKey = attribute.Key("host.cpu.model.name")
+
+ // HostCPUSteppingKey is the attribute Key conforming to the "host.cpu.stepping"
+ // semantic conventions. It represents the stepping or core revisions.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "1", "r1p1"
+ HostCPUSteppingKey = attribute.Key("host.cpu.stepping")
+
+ // HostCPUVendorIDKey is the attribute Key conforming to the
+ // "host.cpu.vendor.id" semantic conventions. It represents the processor
+ // manufacturer identifier. A maximum 12-character string.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "GenuineIntel"
+ // Note: [CPUID] command returns the vendor ID string in EBX, EDX and ECX
+ // registers. Writing these to memory in this order results in a 12-character
+ // string.
+ //
+ // [CPUID]: https://wiki.osdev.org/CPUID
+ HostCPUVendorIDKey = attribute.Key("host.cpu.vendor.id")
+
+ // HostIDKey is the attribute Key conforming to the "host.id" semantic
+ // conventions. It represents the unique host ID. For Cloud, this must be the
+ // instance_id assigned by the cloud provider. For non-containerized systems,
+ // this should be the `machine-id`. See the table below for the sources to use
+ // to determine the `machine-id` based on operating system.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "fdbf79e8af94cb7f9e8df36789187052"
+ HostIDKey = attribute.Key("host.id")
+
+ // HostImageIDKey is the attribute Key conforming to the "host.image.id"
+ // semantic conventions. It represents the VM image ID or host OS image ID. For
+ // Cloud, this value is from the provider.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "ami-07b06b442921831e5"
+ HostImageIDKey = attribute.Key("host.image.id")
+
+ // HostImageNameKey is the attribute Key conforming to the "host.image.name"
+ // semantic conventions. It represents the name of the VM image or OS install
+ // the host was instantiated from.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "infra-ami-eks-worker-node-7d4ec78312", "CentOS-8-x86_64-1905"
+ HostImageNameKey = attribute.Key("host.image.name")
+
+ // HostImageVersionKey is the attribute Key conforming to the
+ // "host.image.version" semantic conventions. It represents the version string
+ // of the VM image or host OS as defined in [Version Attributes].
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "0.1"
+ //
+ // [Version Attributes]: /docs/resource/README.md#version-attributes
+ HostImageVersionKey = attribute.Key("host.image.version")
+
+ // HostIPKey is the attribute Key conforming to the "host.ip" semantic
+ // conventions. It represents the available IP addresses of the host, excluding
+ // loopback interfaces.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "192.168.1.140", "fe80::abc2:4a28:737a:609e"
+ // Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6
+ // addresses MUST be specified in the [RFC 5952] format.
+ //
+ // [RFC 5952]: https://www.rfc-editor.org/rfc/rfc5952.html
+ HostIPKey = attribute.Key("host.ip")
+
+ // HostMacKey is the attribute Key conforming to the "host.mac" semantic
+ // conventions. It represents the available MAC addresses of the host, excluding
+ // loopback interfaces.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "AC-DE-48-23-45-67", "AC-DE-48-23-45-67-01-9F"
+ // Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal form]: as
+ // hyphen-separated octets in uppercase hexadecimal form from most to least
+ // significant.
+ //
+ // [IEEE RA hexadecimal form]: https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf
+ HostMacKey = attribute.Key("host.mac")
+
+ // HostNameKey is the attribute Key conforming to the "host.name" semantic
+ // conventions. It represents the name of the host. On Unix systems, it may
+ // contain what the hostname command returns, or the fully qualified hostname,
+ // or another name specified by the user.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "opentelemetry-test"
+ HostNameKey = attribute.Key("host.name")
+
+ // HostTypeKey is the attribute Key conforming to the "host.type" semantic
+ // conventions. It represents the type of host. For Cloud, this must be the
+ // machine type.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "n1-standard-1"
+ HostTypeKey = attribute.Key("host.type")
+)
+
+// HostCPUCacheL2Size returns an attribute KeyValue conforming to the
+// "host.cpu.cache.l2.size" semantic conventions. It represents the amount of
+// level 2 memory cache available to the processor (in Bytes).
+func HostCPUCacheL2Size(val int) attribute.KeyValue {
+ return HostCPUCacheL2SizeKey.Int(val)
+}
+
+// HostCPUFamily returns an attribute KeyValue conforming to the
+// "host.cpu.family" semantic conventions. It represents the family or generation
+// of the CPU.
+func HostCPUFamily(val string) attribute.KeyValue {
+ return HostCPUFamilyKey.String(val)
+}
+
+// HostCPUModelID returns an attribute KeyValue conforming to the
+// "host.cpu.model.id" semantic conventions. It represents the model identifier.
+// It provides more granular information about the CPU, distinguishing it from
+// other CPUs within the same family.
+func HostCPUModelID(val string) attribute.KeyValue {
+ return HostCPUModelIDKey.String(val)
+}
+
+// HostCPUModelName returns an attribute KeyValue conforming to the
+// "host.cpu.model.name" semantic conventions. It represents the model
+// designation of the processor.
+func HostCPUModelName(val string) attribute.KeyValue {
+ return HostCPUModelNameKey.String(val)
+}
+
+// HostCPUStepping returns an attribute KeyValue conforming to the
+// "host.cpu.stepping" semantic conventions. It represents the stepping or core
+// revisions.
+func HostCPUStepping(val string) attribute.KeyValue {
+ return HostCPUSteppingKey.String(val)
+}
+
+// HostCPUVendorID returns an attribute KeyValue conforming to the
+// "host.cpu.vendor.id" semantic conventions. It represents the processor
+// manufacturer identifier. A maximum 12-character string.
+func HostCPUVendorID(val string) attribute.KeyValue {
+ return HostCPUVendorIDKey.String(val)
+}
+
+// HostID returns an attribute KeyValue conforming to the "host.id" semantic
+// conventions. It represents the unique host ID. For Cloud, this must be the
+// instance_id assigned by the cloud provider. For non-containerized systems,
+// this should be the `machine-id`. See the table below for the sources to use to
+// determine the `machine-id` based on operating system.
+func HostID(val string) attribute.KeyValue {
+ return HostIDKey.String(val)
+}
+
+// HostImageID returns an attribute KeyValue conforming to the "host.image.id"
+// semantic conventions. It represents the VM image ID or host OS image ID. For
+// Cloud, this value is from the provider.
+func HostImageID(val string) attribute.KeyValue {
+ return HostImageIDKey.String(val)
+}
+
+// HostImageName returns an attribute KeyValue conforming to the
+// "host.image.name" semantic conventions. It represents the name of the VM image
+// or OS install the host was instantiated from.
+func HostImageName(val string) attribute.KeyValue {
+ return HostImageNameKey.String(val)
+}
+
+// HostImageVersion returns an attribute KeyValue conforming to the
+// "host.image.version" semantic conventions. It represents the version string of
+// the VM image or host OS as defined in [Version Attributes].
+//
+// [Version Attributes]: /docs/resource/README.md#version-attributes
+func HostImageVersion(val string) attribute.KeyValue {
+ return HostImageVersionKey.String(val)
+}
+
+// HostIP returns an attribute KeyValue conforming to the "host.ip" semantic
+// conventions. It represents the available IP addresses of the host, excluding
+// loopback interfaces.
+func HostIP(val ...string) attribute.KeyValue {
+ return HostIPKey.StringSlice(val)
+}
+
+// HostMac returns an attribute KeyValue conforming to the "host.mac" semantic
+// conventions. It represents the available MAC addresses of the host, excluding
+// loopback interfaces.
+func HostMac(val ...string) attribute.KeyValue {
+ return HostMacKey.StringSlice(val)
+}
+
+// HostName returns an attribute KeyValue conforming to the "host.name" semantic
+// conventions. It represents the name of the host. On Unix systems, it may
+// contain what the hostname command returns, or the fully qualified hostname, or
+// another name specified by the user.
+func HostName(val string) attribute.KeyValue {
+ return HostNameKey.String(val)
+}
+
+// HostType returns an attribute KeyValue conforming to the "host.type" semantic
+// conventions. It represents the type of host. For Cloud, this must be the
+// machine type.
+func HostType(val string) attribute.KeyValue {
+ return HostTypeKey.String(val)
+}
+
+// Enum values for host.arch
+var (
+ // AMD64
+ // Stability: development
+ HostArchAMD64 = HostArchKey.String("amd64")
+ // ARM32
+ // Stability: development
+ HostArchARM32 = HostArchKey.String("arm32")
+ // ARM64
+ // Stability: development
+ HostArchARM64 = HostArchKey.String("arm64")
+ // Itanium
+ // Stability: development
+ HostArchIA64 = HostArchKey.String("ia64")
+ // 32-bit PowerPC
+ // Stability: development
+ HostArchPPC32 = HostArchKey.String("ppc32")
+ // 64-bit PowerPC
+ // Stability: development
+ HostArchPPC64 = HostArchKey.String("ppc64")
+ // IBM z/Architecture
+ // Stability: development
+ HostArchS390x = HostArchKey.String("s390x")
+ // 32-bit x86
+ // Stability: development
+ HostArchX86 = HostArchKey.String("x86")
+)
+
+// Namespace: http
+const (
+ // HTTPConnectionStateKey is the attribute Key conforming to the
+ // "http.connection.state" semantic conventions. It represents the state of the
+ // HTTP connection in the HTTP connection pool.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "active", "idle"
+ HTTPConnectionStateKey = attribute.Key("http.connection.state")
+
+ // HTTPRequestBodySizeKey is the attribute Key conforming to the
+ // "http.request.body.size" semantic conventions. It represents the size of the
+ // request payload body in bytes. This is the number of bytes transferred
+ // excluding headers and is often, but not always, present as the
+ // [Content-Length] header. For requests using transport encoding, this should
+ // be the compressed size.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length
+ HTTPRequestBodySizeKey = attribute.Key("http.request.body.size")
+
+ // HTTPRequestMethodKey is the attribute Key conforming to the
+ // "http.request.method" semantic conventions. It represents the HTTP request
+ // method.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "GET", "POST", "HEAD"
+ // Note: HTTP request method value SHOULD be "known" to the instrumentation.
+ // By default, this convention defines "known" methods as the ones listed in
+ // [RFC9110]
+ // and the PATCH method defined in [RFC5789].
+ //
+ // If the HTTP request method is not known to instrumentation, it MUST set the
+ // `http.request.method` attribute to `_OTHER`.
+ //
+ // If the HTTP instrumentation could end up converting valid HTTP request
+ // methods to `_OTHER`, then it MUST provide a way to override
+ // the list of known HTTP methods. If this override is done via environment
+ // variable, then the environment variable MUST be named
+ // OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of
+ // case-sensitive known HTTP methods
+ // (this list MUST be a full override of the default known method, it is not a
+ // list of known methods in addition to the defaults).
+ //
+ // HTTP method names are case-sensitive and `http.request.method` attribute
+ // value MUST match a known HTTP method name exactly.
+ // Instrumentations for specific web frameworks that consider HTTP methods to be
+ // case insensitive, SHOULD populate a canonical equivalent.
+ // Tracing instrumentations that do so, MUST also set
+ // `http.request.method_original` to the original value.
+ //
+ // [RFC9110]: https://www.rfc-editor.org/rfc/rfc9110.html#name-methods
+ // [RFC5789]: https://www.rfc-editor.org/rfc/rfc5789.html
+ HTTPRequestMethodKey = attribute.Key("http.request.method")
+
+ // HTTPRequestMethodOriginalKey is the attribute Key conforming to the
+ // "http.request.method_original" semantic conventions. It represents the
+ // original HTTP method sent by the client in the request line.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "GeT", "ACL", "foo"
+ HTTPRequestMethodOriginalKey = attribute.Key("http.request.method_original")
+
+ // HTTPRequestResendCountKey is the attribute Key conforming to the
+ // "http.request.resend_count" semantic conventions. It represents the ordinal
+ // number of request resending attempt (for any reason, including redirects).
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Note: The resend count SHOULD be updated each time an HTTP request gets
+ // resent by the client, regardless of what was the cause of the resending (e.g.
+ // redirection, authorization failure, 503 Server Unavailable, network issues,
+ // or any other).
+ HTTPRequestResendCountKey = attribute.Key("http.request.resend_count")
+
+ // HTTPRequestSizeKey is the attribute Key conforming to the "http.request.size"
+ // semantic conventions. It represents the total size of the request in bytes.
+ // This should be the total number of bytes sent over the wire, including the
+ // request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request
+ // body if any.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ HTTPRequestSizeKey = attribute.Key("http.request.size")
+
+ // HTTPResponseBodySizeKey is the attribute Key conforming to the
+ // "http.response.body.size" semantic conventions. It represents the size of the
+ // response payload body in bytes. This is the number of bytes transferred
+ // excluding headers and is often, but not always, present as the
+ // [Content-Length] header. For requests using transport encoding, this should
+ // be the compressed size.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length
+ HTTPResponseBodySizeKey = attribute.Key("http.response.body.size")
+
+ // HTTPResponseSizeKey is the attribute Key conforming to the
+ // "http.response.size" semantic conventions. It represents the total size of
+ // the response in bytes. This should be the total number of bytes sent over the
+ // wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3),
+ // headers, and response body and trailers if any.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ HTTPResponseSizeKey = attribute.Key("http.response.size")
+
+ // HTTPResponseStatusCodeKey is the attribute Key conforming to the
+ // "http.response.status_code" semantic conventions. It represents the
+ // [HTTP response status code].
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: 200
+ //
+ // [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6
+ HTTPResponseStatusCodeKey = attribute.Key("http.response.status_code")
+
+ // HTTPRouteKey is the attribute Key conforming to the "http.route" semantic
+ // conventions. It represents the matched route, that is, the path template in
+ // the format used by the respective server framework.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "/users/:userID?", "{controller}/{action}/{id?}"
+ // Note: MUST NOT be populated when this is not supported by the HTTP server
+ // framework as the route attribute should have low-cardinality and the URI path
+ // can NOT substitute it.
+ // SHOULD include the [application root] if there is one.
+ //
+ // [application root]: /docs/http/http-spans.md#http-server-definitions
+ HTTPRouteKey = attribute.Key("http.route")
+)
+
+// HTTPRequestBodySize returns an attribute KeyValue conforming to the
+// "http.request.body.size" semantic conventions. It represents the size of the
+// request payload body in bytes. This is the number of bytes transferred
+// excluding headers and is often, but not always, present as the
+// [Content-Length] header. For requests using transport encoding, this should be
+// the compressed size.
+//
+// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length
+func HTTPRequestBodySize(val int) attribute.KeyValue {
+ return HTTPRequestBodySizeKey.Int(val)
+}
+
+// HTTPRequestHeader returns an attribute KeyValue conforming to the
+// "http.request.header" semantic conventions. It represents the HTTP request
+// headers, `` being the normalized HTTP Header name (lowercase), the value
+// being the header values.
+func HTTPRequestHeader(key string, val ...string) attribute.KeyValue {
+ return attribute.StringSlice("http.request.header."+key, val)
+}
+
+// HTTPRequestMethodOriginal returns an attribute KeyValue conforming to the
+// "http.request.method_original" semantic conventions. It represents the
+// original HTTP method sent by the client in the request line.
+func HTTPRequestMethodOriginal(val string) attribute.KeyValue {
+ return HTTPRequestMethodOriginalKey.String(val)
+}
+
+// HTTPRequestResendCount returns an attribute KeyValue conforming to the
+// "http.request.resend_count" semantic conventions. It represents the ordinal
+// number of request resending attempt (for any reason, including redirects).
+func HTTPRequestResendCount(val int) attribute.KeyValue {
+ return HTTPRequestResendCountKey.Int(val)
+}
+
+// HTTPRequestSize returns an attribute KeyValue conforming to the
+// "http.request.size" semantic conventions. It represents the total size of the
+// request in bytes. This should be the total number of bytes sent over the wire,
+// including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers,
+// and request body if any.
+func HTTPRequestSize(val int) attribute.KeyValue {
+ return HTTPRequestSizeKey.Int(val)
+}
+
+// HTTPResponseBodySize returns an attribute KeyValue conforming to the
+// "http.response.body.size" semantic conventions. It represents the size of the
+// response payload body in bytes. This is the number of bytes transferred
+// excluding headers and is often, but not always, present as the
+// [Content-Length] header. For requests using transport encoding, this should be
+// the compressed size.
+//
+// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length
+func HTTPResponseBodySize(val int) attribute.KeyValue {
+ return HTTPResponseBodySizeKey.Int(val)
+}
+
+// HTTPResponseHeader returns an attribute KeyValue conforming to the
+// "http.response.header" semantic conventions. It represents the HTTP response
+// headers, `` being the normalized HTTP Header name (lowercase), the value
+// being the header values.
+func HTTPResponseHeader(key string, val ...string) attribute.KeyValue {
+ return attribute.StringSlice("http.response.header."+key, val)
+}
+
+// HTTPResponseSize returns an attribute KeyValue conforming to the
+// "http.response.size" semantic conventions. It represents the total size of the
+// response in bytes. This should be the total number of bytes sent over the
+// wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3),
+// headers, and response body and trailers if any.
+func HTTPResponseSize(val int) attribute.KeyValue {
+ return HTTPResponseSizeKey.Int(val)
+}
+
+// HTTPResponseStatusCode returns an attribute KeyValue conforming to the
+// "http.response.status_code" semantic conventions. It represents the
+// [HTTP response status code].
+//
+// [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6
+func HTTPResponseStatusCode(val int) attribute.KeyValue {
+ return HTTPResponseStatusCodeKey.Int(val)
+}
+
+// HTTPRoute returns an attribute KeyValue conforming to the "http.route"
+// semantic conventions. It represents the matched route, that is, the path
+// template in the format used by the respective server framework.
+func HTTPRoute(val string) attribute.KeyValue {
+ return HTTPRouteKey.String(val)
+}
+
+// Enum values for http.connection.state
+var (
+ // active state.
+ // Stability: development
+ HTTPConnectionStateActive = HTTPConnectionStateKey.String("active")
+ // idle state.
+ // Stability: development
+ HTTPConnectionStateIdle = HTTPConnectionStateKey.String("idle")
+)
+
+// Enum values for http.request.method
+var (
+ // CONNECT method.
+ // Stability: stable
+ HTTPRequestMethodConnect = HTTPRequestMethodKey.String("CONNECT")
+ // DELETE method.
+ // Stability: stable
+ HTTPRequestMethodDelete = HTTPRequestMethodKey.String("DELETE")
+ // GET method.
+ // Stability: stable
+ HTTPRequestMethodGet = HTTPRequestMethodKey.String("GET")
+ // HEAD method.
+ // Stability: stable
+ HTTPRequestMethodHead = HTTPRequestMethodKey.String("HEAD")
+ // OPTIONS method.
+ // Stability: stable
+ HTTPRequestMethodOptions = HTTPRequestMethodKey.String("OPTIONS")
+ // PATCH method.
+ // Stability: stable
+ HTTPRequestMethodPatch = HTTPRequestMethodKey.String("PATCH")
+ // POST method.
+ // Stability: stable
+ HTTPRequestMethodPost = HTTPRequestMethodKey.String("POST")
+ // PUT method.
+ // Stability: stable
+ HTTPRequestMethodPut = HTTPRequestMethodKey.String("PUT")
+ // TRACE method.
+ // Stability: stable
+ HTTPRequestMethodTrace = HTTPRequestMethodKey.String("TRACE")
+ // Any HTTP method that the instrumentation has no prior knowledge of.
+ // Stability: stable
+ HTTPRequestMethodOther = HTTPRequestMethodKey.String("_OTHER")
+)
+
+// Namespace: hw
+const (
+ // HwBatteryCapacityKey is the attribute Key conforming to the
+ // "hw.battery.capacity" semantic conventions. It represents the design capacity
+ // in Watts-hours or Amper-hours.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "9.3Ah", "50Wh"
+ HwBatteryCapacityKey = attribute.Key("hw.battery.capacity")
+
+ // HwBatteryChemistryKey is the attribute Key conforming to the
+ // "hw.battery.chemistry" semantic conventions. It represents the battery
+ // [chemistry], e.g. Lithium-Ion, Nickel-Cadmium, etc.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Li-ion", "NiMH"
+ //
+ // [chemistry]: https://schemas.dmtf.org/wbem/cim-html/2.31.0/CIM_Battery.html
+ HwBatteryChemistryKey = attribute.Key("hw.battery.chemistry")
+
+ // HwBatteryStateKey is the attribute Key conforming to the "hw.battery.state"
+ // semantic conventions. It represents the current state of the battery.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ HwBatteryStateKey = attribute.Key("hw.battery.state")
+
+ // HwBiosVersionKey is the attribute Key conforming to the "hw.bios_version"
+ // semantic conventions. It represents the BIOS version of the hardware
+ // component.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "1.2.3"
+ HwBiosVersionKey = attribute.Key("hw.bios_version")
+
+ // HwDriverVersionKey is the attribute Key conforming to the "hw.driver_version"
+ // semantic conventions. It represents the driver version for the hardware
+ // component.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "10.2.1-3"
+ HwDriverVersionKey = attribute.Key("hw.driver_version")
+
+ // HwEnclosureTypeKey is the attribute Key conforming to the "hw.enclosure.type"
+ // semantic conventions. It represents the type of the enclosure (useful for
+ // modular systems).
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Computer", "Storage", "Switch"
+ HwEnclosureTypeKey = attribute.Key("hw.enclosure.type")
+
+ // HwFirmwareVersionKey is the attribute Key conforming to the
+ // "hw.firmware_version" semantic conventions. It represents the firmware
+ // version of the hardware component.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "2.0.1"
+ HwFirmwareVersionKey = attribute.Key("hw.firmware_version")
+
+ // HwGpuTaskKey is the attribute Key conforming to the "hw.gpu.task" semantic
+ // conventions. It represents the type of task the GPU is performing.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ HwGpuTaskKey = attribute.Key("hw.gpu.task")
+
+ // HwIDKey is the attribute Key conforming to the "hw.id" semantic conventions.
+ // It represents an identifier for the hardware component, unique within the
+ // monitored host.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "win32battery_battery_testsysa33_1"
+ HwIDKey = attribute.Key("hw.id")
+
+ // HwLimitTypeKey is the attribute Key conforming to the "hw.limit_type"
+ // semantic conventions. It represents the type of limit for hardware
+ // components.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ HwLimitTypeKey = attribute.Key("hw.limit_type")
+
+ // HwLogicalDiskRaidLevelKey is the attribute Key conforming to the
+ // "hw.logical_disk.raid_level" semantic conventions. It represents the RAID
+ // Level of the logical disk.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "RAID0+1", "RAID5", "RAID10"
+ HwLogicalDiskRaidLevelKey = attribute.Key("hw.logical_disk.raid_level")
+
+ // HwLogicalDiskStateKey is the attribute Key conforming to the
+ // "hw.logical_disk.state" semantic conventions. It represents the state of the
+ // logical disk space usage.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ HwLogicalDiskStateKey = attribute.Key("hw.logical_disk.state")
+
+ // HwMemoryTypeKey is the attribute Key conforming to the "hw.memory.type"
+ // semantic conventions. It represents the type of the memory module.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "DDR4", "DDR5", "LPDDR5"
+ HwMemoryTypeKey = attribute.Key("hw.memory.type")
+
+ // HwModelKey is the attribute Key conforming to the "hw.model" semantic
+ // conventions. It represents the descriptive model name of the hardware
+ // component.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "PERC H740P", "Intel(R) Core(TM) i7-10700K", "Dell XPS 15 Battery"
+ HwModelKey = attribute.Key("hw.model")
+
+ // HwNameKey is the attribute Key conforming to the "hw.name" semantic
+ // conventions. It represents an easily-recognizable name for the hardware
+ // component.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "eth0"
+ HwNameKey = attribute.Key("hw.name")
+
+ // HwNetworkLogicalAddressesKey is the attribute Key conforming to the
+ // "hw.network.logical_addresses" semantic conventions. It represents the
+ // logical addresses of the adapter (e.g. IP address, or WWPN).
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "172.16.8.21", "57.11.193.42"
+ HwNetworkLogicalAddressesKey = attribute.Key("hw.network.logical_addresses")
+
+ // HwNetworkPhysicalAddressKey is the attribute Key conforming to the
+ // "hw.network.physical_address" semantic conventions. It represents the
+ // physical address of the adapter (e.g. MAC address, or WWNN).
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "00-90-F5-E9-7B-36"
+ HwNetworkPhysicalAddressKey = attribute.Key("hw.network.physical_address")
+
+ // HwParentKey is the attribute Key conforming to the "hw.parent" semantic
+ // conventions. It represents the unique identifier of the parent component
+ // (typically the `hw.id` attribute of the enclosure, or disk controller).
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "dellStorage_perc_0"
+ HwParentKey = attribute.Key("hw.parent")
+
+ // HwPhysicalDiskSmartAttributeKey is the attribute Key conforming to the
+ // "hw.physical_disk.smart_attribute" semantic conventions. It represents the
+ // [S.M.A.R.T.] (Self-Monitoring, Analysis, and Reporting Technology) attribute
+ // of the physical disk.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Spin Retry Count", "Seek Error Rate", "Raw Read Error Rate"
+ //
+ // [S.M.A.R.T.]: https://wikipedia.org/wiki/S.M.A.R.T.
+ HwPhysicalDiskSmartAttributeKey = attribute.Key("hw.physical_disk.smart_attribute")
+
+ // HwPhysicalDiskStateKey is the attribute Key conforming to the
+ // "hw.physical_disk.state" semantic conventions. It represents the state of the
+ // physical disk endurance utilization.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ HwPhysicalDiskStateKey = attribute.Key("hw.physical_disk.state")
+
+ // HwPhysicalDiskTypeKey is the attribute Key conforming to the
+ // "hw.physical_disk.type" semantic conventions. It represents the type of the
+ // physical disk.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "HDD", "SSD", "10K"
+ HwPhysicalDiskTypeKey = attribute.Key("hw.physical_disk.type")
+
+ // HwSensorLocationKey is the attribute Key conforming to the
+ // "hw.sensor_location" semantic conventions. It represents the location of the
+ // sensor.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "cpu0", "ps1", "INLET", "CPU0_DIE", "AMBIENT", "MOTHERBOARD", "PS0
+ // V3_3", "MAIN_12V", "CPU_VCORE"
+ HwSensorLocationKey = attribute.Key("hw.sensor_location")
+
+ // HwSerialNumberKey is the attribute Key conforming to the "hw.serial_number"
+ // semantic conventions. It represents the serial number of the hardware
+ // component.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "CNFCP0123456789"
+ HwSerialNumberKey = attribute.Key("hw.serial_number")
+
+ // HwStateKey is the attribute Key conforming to the "hw.state" semantic
+ // conventions. It represents the current state of the component.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ HwStateKey = attribute.Key("hw.state")
+
+ // HwTapeDriveOperationTypeKey is the attribute Key conforming to the
+ // "hw.tape_drive.operation_type" semantic conventions. It represents the type
+ // of tape drive operation.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ HwTapeDriveOperationTypeKey = attribute.Key("hw.tape_drive.operation_type")
+
+ // HwTypeKey is the attribute Key conforming to the "hw.type" semantic
+ // conventions. It represents the type of the component.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // Note: Describes the category of the hardware component for which `hw.state`
+ // is being reported. For example, `hw.type=temperature` along with
+ // `hw.state=degraded` would indicate that the temperature of the hardware
+ // component has been reported as `degraded`.
+ HwTypeKey = attribute.Key("hw.type")
+
+ // HwVendorKey is the attribute Key conforming to the "hw.vendor" semantic
+ // conventions. It represents the vendor name of the hardware component.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Dell", "HP", "Intel", "AMD", "LSI", "Lenovo"
+ HwVendorKey = attribute.Key("hw.vendor")
+)
+
+// HwBatteryCapacity returns an attribute KeyValue conforming to the
+// "hw.battery.capacity" semantic conventions. It represents the design capacity
+// in Watts-hours or Amper-hours.
+func HwBatteryCapacity(val string) attribute.KeyValue {
+ return HwBatteryCapacityKey.String(val)
+}
+
+// HwBatteryChemistry returns an attribute KeyValue conforming to the
+// "hw.battery.chemistry" semantic conventions. It represents the battery
+// [chemistry], e.g. Lithium-Ion, Nickel-Cadmium, etc.
+//
+// [chemistry]: https://schemas.dmtf.org/wbem/cim-html/2.31.0/CIM_Battery.html
+func HwBatteryChemistry(val string) attribute.KeyValue {
+ return HwBatteryChemistryKey.String(val)
+}
+
+// HwBiosVersion returns an attribute KeyValue conforming to the
+// "hw.bios_version" semantic conventions. It represents the BIOS version of the
+// hardware component.
+func HwBiosVersion(val string) attribute.KeyValue {
+ return HwBiosVersionKey.String(val)
+}
+
+// HwDriverVersion returns an attribute KeyValue conforming to the
+// "hw.driver_version" semantic conventions. It represents the driver version for
+// the hardware component.
+func HwDriverVersion(val string) attribute.KeyValue {
+ return HwDriverVersionKey.String(val)
+}
+
+// HwEnclosureType returns an attribute KeyValue conforming to the
+// "hw.enclosure.type" semantic conventions. It represents the type of the
+// enclosure (useful for modular systems).
+func HwEnclosureType(val string) attribute.KeyValue {
+ return HwEnclosureTypeKey.String(val)
+}
+
+// HwFirmwareVersion returns an attribute KeyValue conforming to the
+// "hw.firmware_version" semantic conventions. It represents the firmware version
+// of the hardware component.
+func HwFirmwareVersion(val string) attribute.KeyValue {
+ return HwFirmwareVersionKey.String(val)
+}
+
+// HwID returns an attribute KeyValue conforming to the "hw.id" semantic
+// conventions. It represents an identifier for the hardware component, unique
+// within the monitored host.
+func HwID(val string) attribute.KeyValue {
+ return HwIDKey.String(val)
+}
+
+// HwLogicalDiskRaidLevel returns an attribute KeyValue conforming to the
+// "hw.logical_disk.raid_level" semantic conventions. It represents the RAID
+// Level of the logical disk.
+func HwLogicalDiskRaidLevel(val string) attribute.KeyValue {
+ return HwLogicalDiskRaidLevelKey.String(val)
+}
+
+// HwMemoryType returns an attribute KeyValue conforming to the "hw.memory.type"
+// semantic conventions. It represents the type of the memory module.
+func HwMemoryType(val string) attribute.KeyValue {
+ return HwMemoryTypeKey.String(val)
+}
+
+// HwModel returns an attribute KeyValue conforming to the "hw.model" semantic
+// conventions. It represents the descriptive model name of the hardware
+// component.
+func HwModel(val string) attribute.KeyValue {
+ return HwModelKey.String(val)
+}
+
+// HwName returns an attribute KeyValue conforming to the "hw.name" semantic
+// conventions. It represents an easily-recognizable name for the hardware
+// component.
+func HwName(val string) attribute.KeyValue {
+ return HwNameKey.String(val)
+}
+
+// HwNetworkLogicalAddresses returns an attribute KeyValue conforming to the
+// "hw.network.logical_addresses" semantic conventions. It represents the logical
+// addresses of the adapter (e.g. IP address, or WWPN).
+func HwNetworkLogicalAddresses(val ...string) attribute.KeyValue {
+ return HwNetworkLogicalAddressesKey.StringSlice(val)
+}
+
+// HwNetworkPhysicalAddress returns an attribute KeyValue conforming to the
+// "hw.network.physical_address" semantic conventions. It represents the physical
+// address of the adapter (e.g. MAC address, or WWNN).
+func HwNetworkPhysicalAddress(val string) attribute.KeyValue {
+ return HwNetworkPhysicalAddressKey.String(val)
+}
+
+// HwParent returns an attribute KeyValue conforming to the "hw.parent" semantic
+// conventions. It represents the unique identifier of the parent component
+// (typically the `hw.id` attribute of the enclosure, or disk controller).
+func HwParent(val string) attribute.KeyValue {
+ return HwParentKey.String(val)
+}
+
+// HwPhysicalDiskSmartAttribute returns an attribute KeyValue conforming to the
+// "hw.physical_disk.smart_attribute" semantic conventions. It represents the
+// [S.M.A.R.T.] (Self-Monitoring, Analysis, and Reporting Technology) attribute
+// of the physical disk.
+//
+// [S.M.A.R.T.]: https://wikipedia.org/wiki/S.M.A.R.T.
+func HwPhysicalDiskSmartAttribute(val string) attribute.KeyValue {
+ return HwPhysicalDiskSmartAttributeKey.String(val)
+}
+
+// HwPhysicalDiskType returns an attribute KeyValue conforming to the
+// "hw.physical_disk.type" semantic conventions. It represents the type of the
+// physical disk.
+func HwPhysicalDiskType(val string) attribute.KeyValue {
+ return HwPhysicalDiskTypeKey.String(val)
+}
+
+// HwSensorLocation returns an attribute KeyValue conforming to the
+// "hw.sensor_location" semantic conventions. It represents the location of the
+// sensor.
+func HwSensorLocation(val string) attribute.KeyValue {
+ return HwSensorLocationKey.String(val)
+}
+
+// HwSerialNumber returns an attribute KeyValue conforming to the
+// "hw.serial_number" semantic conventions. It represents the serial number of
+// the hardware component.
+func HwSerialNumber(val string) attribute.KeyValue {
+ return HwSerialNumberKey.String(val)
+}
+
+// HwVendor returns an attribute KeyValue conforming to the "hw.vendor" semantic
+// conventions. It represents the vendor name of the hardware component.
+func HwVendor(val string) attribute.KeyValue {
+ return HwVendorKey.String(val)
+}
+
+// Enum values for hw.battery.state
+var (
+ // Charging
+ // Stability: development
+ HwBatteryStateCharging = HwBatteryStateKey.String("charging")
+ // Discharging
+ // Stability: development
+ HwBatteryStateDischarging = HwBatteryStateKey.String("discharging")
+)
+
+// Enum values for hw.gpu.task
+var (
+ // Decoder
+ // Stability: development
+ HwGpuTaskDecoder = HwGpuTaskKey.String("decoder")
+ // Encoder
+ // Stability: development
+ HwGpuTaskEncoder = HwGpuTaskKey.String("encoder")
+ // General
+ // Stability: development
+ HwGpuTaskGeneral = HwGpuTaskKey.String("general")
+)
+
+// Enum values for hw.limit_type
+var (
+ // Critical
+ // Stability: development
+ HwLimitTypeCritical = HwLimitTypeKey.String("critical")
+ // Degraded
+ // Stability: development
+ HwLimitTypeDegraded = HwLimitTypeKey.String("degraded")
+ // High Critical
+ // Stability: development
+ HwLimitTypeHighCritical = HwLimitTypeKey.String("high.critical")
+ // High Degraded
+ // Stability: development
+ HwLimitTypeHighDegraded = HwLimitTypeKey.String("high.degraded")
+ // Low Critical
+ // Stability: development
+ HwLimitTypeLowCritical = HwLimitTypeKey.String("low.critical")
+ // Low Degraded
+ // Stability: development
+ HwLimitTypeLowDegraded = HwLimitTypeKey.String("low.degraded")
+ // Maximum
+ // Stability: development
+ HwLimitTypeMax = HwLimitTypeKey.String("max")
+ // Throttled
+ // Stability: development
+ HwLimitTypeThrottled = HwLimitTypeKey.String("throttled")
+ // Turbo
+ // Stability: development
+ HwLimitTypeTurbo = HwLimitTypeKey.String("turbo")
+)
+
+// Enum values for hw.logical_disk.state
+var (
+ // Used
+ // Stability: development
+ HwLogicalDiskStateUsed = HwLogicalDiskStateKey.String("used")
+ // Free
+ // Stability: development
+ HwLogicalDiskStateFree = HwLogicalDiskStateKey.String("free")
+)
+
+// Enum values for hw.physical_disk.state
+var (
+ // Remaining
+ // Stability: development
+ HwPhysicalDiskStateRemaining = HwPhysicalDiskStateKey.String("remaining")
+)
+
+// Enum values for hw.state
+var (
+ // Degraded
+ // Stability: development
+ HwStateDegraded = HwStateKey.String("degraded")
+ // Failed
+ // Stability: development
+ HwStateFailed = HwStateKey.String("failed")
+ // Needs Cleaning
+ // Stability: development
+ HwStateNeedsCleaning = HwStateKey.String("needs_cleaning")
+ // OK
+ // Stability: development
+ HwStateOk = HwStateKey.String("ok")
+ // Predicted Failure
+ // Stability: development
+ HwStatePredictedFailure = HwStateKey.String("predicted_failure")
+)
+
+// Enum values for hw.tape_drive.operation_type
+var (
+ // Mount
+ // Stability: development
+ HwTapeDriveOperationTypeMount = HwTapeDriveOperationTypeKey.String("mount")
+ // Unmount
+ // Stability: development
+ HwTapeDriveOperationTypeUnmount = HwTapeDriveOperationTypeKey.String("unmount")
+ // Clean
+ // Stability: development
+ HwTapeDriveOperationTypeClean = HwTapeDriveOperationTypeKey.String("clean")
+)
+
+// Enum values for hw.type
+var (
+ // Battery
+ // Stability: development
+ HwTypeBattery = HwTypeKey.String("battery")
+ // CPU
+ // Stability: development
+ HwTypeCPU = HwTypeKey.String("cpu")
+ // Disk controller
+ // Stability: development
+ HwTypeDiskController = HwTypeKey.String("disk_controller")
+ // Enclosure
+ // Stability: development
+ HwTypeEnclosure = HwTypeKey.String("enclosure")
+ // Fan
+ // Stability: development
+ HwTypeFan = HwTypeKey.String("fan")
+ // GPU
+ // Stability: development
+ HwTypeGpu = HwTypeKey.String("gpu")
+ // Logical disk
+ // Stability: development
+ HwTypeLogicalDisk = HwTypeKey.String("logical_disk")
+ // Memory
+ // Stability: development
+ HwTypeMemory = HwTypeKey.String("memory")
+ // Network
+ // Stability: development
+ HwTypeNetwork = HwTypeKey.String("network")
+ // Physical disk
+ // Stability: development
+ HwTypePhysicalDisk = HwTypeKey.String("physical_disk")
+ // Power supply
+ // Stability: development
+ HwTypePowerSupply = HwTypeKey.String("power_supply")
+ // Tape drive
+ // Stability: development
+ HwTypeTapeDrive = HwTypeKey.String("tape_drive")
+ // Temperature
+ // Stability: development
+ HwTypeTemperature = HwTypeKey.String("temperature")
+ // Voltage
+ // Stability: development
+ HwTypeVoltage = HwTypeKey.String("voltage")
+)
+
+// Namespace: ios
+const (
+ // IOSAppStateKey is the attribute Key conforming to the "ios.app.state"
+ // semantic conventions. It represents the this attribute represents the state
+ // of the application.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // Note: The iOS lifecycle states are defined in the
+ // [UIApplicationDelegate documentation], and from which the `OS terminology`
+ // column values are derived.
+ //
+ // [UIApplicationDelegate documentation]: https://developer.apple.com/documentation/uikit/uiapplicationdelegate
+ IOSAppStateKey = attribute.Key("ios.app.state")
+)
+
+// Enum values for ios.app.state
+var (
+ // The app has become `active`. Associated with UIKit notification
+ // `applicationDidBecomeActive`.
+ //
+ // Stability: development
+ IOSAppStateActive = IOSAppStateKey.String("active")
+ // The app is now `inactive`. Associated with UIKit notification
+ // `applicationWillResignActive`.
+ //
+ // Stability: development
+ IOSAppStateInactive = IOSAppStateKey.String("inactive")
+ // The app is now in the background. This value is associated with UIKit
+ // notification `applicationDidEnterBackground`.
+ //
+ // Stability: development
+ IOSAppStateBackground = IOSAppStateKey.String("background")
+ // The app is now in the foreground. This value is associated with UIKit
+ // notification `applicationWillEnterForeground`.
+ //
+ // Stability: development
+ IOSAppStateForeground = IOSAppStateKey.String("foreground")
+ // The app is about to terminate. Associated with UIKit notification
+ // `applicationWillTerminate`.
+ //
+ // Stability: development
+ IOSAppStateTerminate = IOSAppStateKey.String("terminate")
+)
+
+// Namespace: k8s
+const (
+ // K8SClusterNameKey is the attribute Key conforming to the "k8s.cluster.name"
+ // semantic conventions. It represents the name of the cluster.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "opentelemetry-cluster"
+ K8SClusterNameKey = attribute.Key("k8s.cluster.name")
+
+ // K8SClusterUIDKey is the attribute Key conforming to the "k8s.cluster.uid"
+ // semantic conventions. It represents a pseudo-ID for the cluster, set to the
+ // UID of the `kube-system` namespace.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d"
+ // Note: K8s doesn't have support for obtaining a cluster ID. If this is ever
+ // added, we will recommend collecting the `k8s.cluster.uid` through the
+ // official APIs. In the meantime, we are able to use the `uid` of the
+ // `kube-system` namespace as a proxy for cluster ID. Read on for the
+ // rationale.
+ //
+ // Every object created in a K8s cluster is assigned a distinct UID. The
+ // `kube-system` namespace is used by Kubernetes itself and will exist
+ // for the lifetime of the cluster. Using the `uid` of the `kube-system`
+ // namespace is a reasonable proxy for the K8s ClusterID as it will only
+ // change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are
+ // UUIDs as standardized by
+ // [ISO/IEC 9834-8 and ITU-T X.667].
+ // Which states:
+ //
+ // > If generated according to one of the mechanisms defined in Rec.
+ // > ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be
+ // > different from all other UUIDs generated before 3603 A.D., or is
+ // > extremely likely to be different (depending on the mechanism chosen).
+ //
+ // Therefore, UIDs between clusters should be extremely unlikely to
+ // conflict.
+ //
+ // [ISO/IEC 9834-8 and ITU-T X.667]: https://www.itu.int/ITU-T/studygroups/com17/oid.html
+ K8SClusterUIDKey = attribute.Key("k8s.cluster.uid")
+
+ // K8SContainerNameKey is the attribute Key conforming to the
+ // "k8s.container.name" semantic conventions. It represents the name of the
+ // Container from Pod specification, must be unique within a Pod. Container
+ // runtime usually uses different globally unique name (`container.name`).
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "redis"
+ K8SContainerNameKey = attribute.Key("k8s.container.name")
+
+ // K8SContainerRestartCountKey is the attribute Key conforming to the
+ // "k8s.container.restart_count" semantic conventions. It represents the number
+ // of times the container was restarted. This attribute can be used to identify
+ // a particular container (running or stopped) within a container spec.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ K8SContainerRestartCountKey = attribute.Key("k8s.container.restart_count")
+
+ // K8SContainerStatusLastTerminatedReasonKey is the attribute Key conforming to
+ // the "k8s.container.status.last_terminated_reason" semantic conventions. It
+ // represents the last terminated reason of the Container.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Evicted", "Error"
+ K8SContainerStatusLastTerminatedReasonKey = attribute.Key("k8s.container.status.last_terminated_reason")
+
+ // K8SContainerStatusReasonKey is the attribute Key conforming to the
+ // "k8s.container.status.reason" semantic conventions. It represents the reason
+ // for the container state. Corresponds to the `reason` field of the:
+ // [K8s ContainerStateWaiting] or [K8s ContainerStateTerminated].
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "ContainerCreating", "CrashLoopBackOff",
+ // "CreateContainerConfigError", "ErrImagePull", "ImagePullBackOff",
+ // "OOMKilled", "Completed", "Error", "ContainerCannotRun"
+ //
+ // [K8s ContainerStateWaiting]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#containerstatewaiting-v1-core
+ // [K8s ContainerStateTerminated]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#containerstateterminated-v1-core
+ K8SContainerStatusReasonKey = attribute.Key("k8s.container.status.reason")
+
+ // K8SContainerStatusStateKey is the attribute Key conforming to the
+ // "k8s.container.status.state" semantic conventions. It represents the state of
+ // the container. [K8s ContainerState].
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "terminated", "running", "waiting"
+ //
+ // [K8s ContainerState]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#containerstate-v1-core
+ K8SContainerStatusStateKey = attribute.Key("k8s.container.status.state")
+
+ // K8SCronJobNameKey is the attribute Key conforming to the "k8s.cronjob.name"
+ // semantic conventions. It represents the name of the CronJob.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "opentelemetry"
+ K8SCronJobNameKey = attribute.Key("k8s.cronjob.name")
+
+ // K8SCronJobUIDKey is the attribute Key conforming to the "k8s.cronjob.uid"
+ // semantic conventions. It represents the UID of the CronJob.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff"
+ K8SCronJobUIDKey = attribute.Key("k8s.cronjob.uid")
+
+ // K8SDaemonSetNameKey is the attribute Key conforming to the
+ // "k8s.daemonset.name" semantic conventions. It represents the name of the
+ // DaemonSet.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "opentelemetry"
+ K8SDaemonSetNameKey = attribute.Key("k8s.daemonset.name")
+
+ // K8SDaemonSetUIDKey is the attribute Key conforming to the "k8s.daemonset.uid"
+ // semantic conventions. It represents the UID of the DaemonSet.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff"
+ K8SDaemonSetUIDKey = attribute.Key("k8s.daemonset.uid")
+
+ // K8SDeploymentNameKey is the attribute Key conforming to the
+ // "k8s.deployment.name" semantic conventions. It represents the name of the
+ // Deployment.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "opentelemetry"
+ K8SDeploymentNameKey = attribute.Key("k8s.deployment.name")
+
+ // K8SDeploymentUIDKey is the attribute Key conforming to the
+ // "k8s.deployment.uid" semantic conventions. It represents the UID of the
+ // Deployment.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff"
+ K8SDeploymentUIDKey = attribute.Key("k8s.deployment.uid")
+
+ // K8SHPAMetricTypeKey is the attribute Key conforming to the
+ // "k8s.hpa.metric.type" semantic conventions. It represents the type of metric
+ // source for the horizontal pod autoscaler.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Resource", "ContainerResource"
+ // Note: This attribute reflects the `type` field of spec.metrics[] in the HPA.
+ K8SHPAMetricTypeKey = attribute.Key("k8s.hpa.metric.type")
+
+ // K8SHPANameKey is the attribute Key conforming to the "k8s.hpa.name" semantic
+ // conventions. It represents the name of the horizontal pod autoscaler.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "opentelemetry"
+ K8SHPANameKey = attribute.Key("k8s.hpa.name")
+
+ // K8SHPAScaletargetrefAPIVersionKey is the attribute Key conforming to the
+ // "k8s.hpa.scaletargetref.api_version" semantic conventions. It represents the
+ // API version of the target resource to scale for the HorizontalPodAutoscaler.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "apps/v1", "autoscaling/v2"
+ // Note: This maps to the `apiVersion` field in the `scaleTargetRef` of the HPA
+ // spec.
+ K8SHPAScaletargetrefAPIVersionKey = attribute.Key("k8s.hpa.scaletargetref.api_version")
+
+ // K8SHPAScaletargetrefKindKey is the attribute Key conforming to the
+ // "k8s.hpa.scaletargetref.kind" semantic conventions. It represents the kind of
+ // the target resource to scale for the HorizontalPodAutoscaler.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Deployment", "StatefulSet"
+ // Note: This maps to the `kind` field in the `scaleTargetRef` of the HPA spec.
+ K8SHPAScaletargetrefKindKey = attribute.Key("k8s.hpa.scaletargetref.kind")
+
+ // K8SHPAScaletargetrefNameKey is the attribute Key conforming to the
+ // "k8s.hpa.scaletargetref.name" semantic conventions. It represents the name of
+ // the target resource to scale for the HorizontalPodAutoscaler.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "my-deployment", "my-statefulset"
+ // Note: This maps to the `name` field in the `scaleTargetRef` of the HPA spec.
+ K8SHPAScaletargetrefNameKey = attribute.Key("k8s.hpa.scaletargetref.name")
+
+ // K8SHPAUIDKey is the attribute Key conforming to the "k8s.hpa.uid" semantic
+ // conventions. It represents the UID of the horizontal pod autoscaler.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff"
+ K8SHPAUIDKey = attribute.Key("k8s.hpa.uid")
+
+ // K8SHugepageSizeKey is the attribute Key conforming to the "k8s.hugepage.size"
+ // semantic conventions. It represents the size (identifier) of the K8s huge
+ // page.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "2Mi"
+ K8SHugepageSizeKey = attribute.Key("k8s.hugepage.size")
+
+ // K8SJobNameKey is the attribute Key conforming to the "k8s.job.name" semantic
+ // conventions. It represents the name of the Job.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "opentelemetry"
+ K8SJobNameKey = attribute.Key("k8s.job.name")
+
+ // K8SJobUIDKey is the attribute Key conforming to the "k8s.job.uid" semantic
+ // conventions. It represents the UID of the Job.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff"
+ K8SJobUIDKey = attribute.Key("k8s.job.uid")
+
+ // K8SNamespaceNameKey is the attribute Key conforming to the
+ // "k8s.namespace.name" semantic conventions. It represents the name of the
+ // namespace that the pod is running in.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "default"
+ K8SNamespaceNameKey = attribute.Key("k8s.namespace.name")
+
+ // K8SNamespacePhaseKey is the attribute Key conforming to the
+ // "k8s.namespace.phase" semantic conventions. It represents the phase of the
+ // K8s namespace.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "active", "terminating"
+ // Note: This attribute aligns with the `phase` field of the
+ // [K8s NamespaceStatus]
+ //
+ // [K8s NamespaceStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#namespacestatus-v1-core
+ K8SNamespacePhaseKey = attribute.Key("k8s.namespace.phase")
+
+ // K8SNodeConditionStatusKey is the attribute Key conforming to the
+ // "k8s.node.condition.status" semantic conventions. It represents the status of
+ // the condition, one of True, False, Unknown.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "true", "false", "unknown"
+ // Note: This attribute aligns with the `status` field of the
+ // [NodeCondition]
+ //
+ // [NodeCondition]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#nodecondition-v1-core
+ K8SNodeConditionStatusKey = attribute.Key("k8s.node.condition.status")
+
+ // K8SNodeConditionTypeKey is the attribute Key conforming to the
+ // "k8s.node.condition.type" semantic conventions. It represents the condition
+ // type of a K8s Node.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Ready", "DiskPressure"
+ // Note: K8s Node conditions as described
+ // by [K8s documentation].
+ //
+ // This attribute aligns with the `type` field of the
+ // [NodeCondition]
+ //
+ // The set of possible values is not limited to those listed here. Managed
+ // Kubernetes environments,
+ // or custom controllers MAY introduce additional node condition types.
+ // When this occurs, the exact value as reported by the Kubernetes API SHOULD be
+ // used.
+ //
+ // [K8s documentation]: https://v1-32.docs.kubernetes.io/docs/reference/node/node-status/#condition
+ // [NodeCondition]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#nodecondition-v1-core
+ K8SNodeConditionTypeKey = attribute.Key("k8s.node.condition.type")
+
+ // K8SNodeNameKey is the attribute Key conforming to the "k8s.node.name"
+ // semantic conventions. It represents the name of the Node.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "node-1"
+ K8SNodeNameKey = attribute.Key("k8s.node.name")
+
+ // K8SNodeUIDKey is the attribute Key conforming to the "k8s.node.uid" semantic
+ // conventions. It represents the UID of the Node.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2"
+ K8SNodeUIDKey = attribute.Key("k8s.node.uid")
+
+ // K8SPodNameKey is the attribute Key conforming to the "k8s.pod.name" semantic
+ // conventions. It represents the name of the Pod.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "opentelemetry-pod-autoconf"
+ K8SPodNameKey = attribute.Key("k8s.pod.name")
+
+ // K8SPodUIDKey is the attribute Key conforming to the "k8s.pod.uid" semantic
+ // conventions. It represents the UID of the Pod.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff"
+ K8SPodUIDKey = attribute.Key("k8s.pod.uid")
+
+ // K8SReplicaSetNameKey is the attribute Key conforming to the
+ // "k8s.replicaset.name" semantic conventions. It represents the name of the
+ // ReplicaSet.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "opentelemetry"
+ K8SReplicaSetNameKey = attribute.Key("k8s.replicaset.name")
+
+ // K8SReplicaSetUIDKey is the attribute Key conforming to the
+ // "k8s.replicaset.uid" semantic conventions. It represents the UID of the
+ // ReplicaSet.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff"
+ K8SReplicaSetUIDKey = attribute.Key("k8s.replicaset.uid")
+
+ // K8SReplicationControllerNameKey is the attribute Key conforming to the
+ // "k8s.replicationcontroller.name" semantic conventions. It represents the name
+ // of the replication controller.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "opentelemetry"
+ K8SReplicationControllerNameKey = attribute.Key("k8s.replicationcontroller.name")
+
+ // K8SReplicationControllerUIDKey is the attribute Key conforming to the
+ // "k8s.replicationcontroller.uid" semantic conventions. It represents the UID
+ // of the replication controller.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff"
+ K8SReplicationControllerUIDKey = attribute.Key("k8s.replicationcontroller.uid")
+
+ // K8SResourceQuotaNameKey is the attribute Key conforming to the
+ // "k8s.resourcequota.name" semantic conventions. It represents the name of the
+ // resource quota.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "opentelemetry"
+ K8SResourceQuotaNameKey = attribute.Key("k8s.resourcequota.name")
+
+ // K8SResourceQuotaResourceNameKey is the attribute Key conforming to the
+ // "k8s.resourcequota.resource_name" semantic conventions. It represents the
+ // name of the K8s resource a resource quota defines.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "count/replicationcontrollers"
+ // Note: The value for this attribute can be either the full
+ // `count/[.]` string (e.g., count/deployments.apps,
+ // count/pods), or, for certain core Kubernetes resources, just the resource
+ // name (e.g., pods, services, configmaps). Both forms are supported by
+ // Kubernetes for object count quotas. See
+ // [Kubernetes Resource Quotas documentation] for more details.
+ //
+ // [Kubernetes Resource Quotas documentation]: https://kubernetes.io/docs/concepts/policy/resource-quotas/#object-count-quota
+ K8SResourceQuotaResourceNameKey = attribute.Key("k8s.resourcequota.resource_name")
+
+ // K8SResourceQuotaUIDKey is the attribute Key conforming to the
+ // "k8s.resourcequota.uid" semantic conventions. It represents the UID of the
+ // resource quota.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff"
+ K8SResourceQuotaUIDKey = attribute.Key("k8s.resourcequota.uid")
+
+ // K8SStatefulSetNameKey is the attribute Key conforming to the
+ // "k8s.statefulset.name" semantic conventions. It represents the name of the
+ // StatefulSet.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "opentelemetry"
+ K8SStatefulSetNameKey = attribute.Key("k8s.statefulset.name")
+
+ // K8SStatefulSetUIDKey is the attribute Key conforming to the
+ // "k8s.statefulset.uid" semantic conventions. It represents the UID of the
+ // StatefulSet.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff"
+ K8SStatefulSetUIDKey = attribute.Key("k8s.statefulset.uid")
+
+ // K8SStorageclassNameKey is the attribute Key conforming to the
+ // "k8s.storageclass.name" semantic conventions. It represents the name of K8s
+ // [StorageClass] object.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "gold.storageclass.storage.k8s.io"
+ //
+ // [StorageClass]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#storageclass-v1-storage-k8s-io
+ K8SStorageclassNameKey = attribute.Key("k8s.storageclass.name")
+
+ // K8SVolumeNameKey is the attribute Key conforming to the "k8s.volume.name"
+ // semantic conventions. It represents the name of the K8s volume.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "volume0"
+ K8SVolumeNameKey = attribute.Key("k8s.volume.name")
+
+ // K8SVolumeTypeKey is the attribute Key conforming to the "k8s.volume.type"
+ // semantic conventions. It represents the type of the K8s volume.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "emptyDir", "persistentVolumeClaim"
+ K8SVolumeTypeKey = attribute.Key("k8s.volume.type")
+)
+
+// K8SClusterName returns an attribute KeyValue conforming to the
+// "k8s.cluster.name" semantic conventions. It represents the name of the
+// cluster.
+func K8SClusterName(val string) attribute.KeyValue {
+ return K8SClusterNameKey.String(val)
+}
+
+// K8SClusterUID returns an attribute KeyValue conforming to the
+// "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for the
+// cluster, set to the UID of the `kube-system` namespace.
+func K8SClusterUID(val string) attribute.KeyValue {
+ return K8SClusterUIDKey.String(val)
+}
+
+// K8SContainerName returns an attribute KeyValue conforming to the
+// "k8s.container.name" semantic conventions. It represents the name of the
+// Container from Pod specification, must be unique within a Pod. Container
+// runtime usually uses different globally unique name (`container.name`).
+func K8SContainerName(val string) attribute.KeyValue {
+ return K8SContainerNameKey.String(val)
+}
+
+// K8SContainerRestartCount returns an attribute KeyValue conforming to the
+// "k8s.container.restart_count" semantic conventions. It represents the number
+// of times the container was restarted. This attribute can be used to identify a
+// particular container (running or stopped) within a container spec.
+func K8SContainerRestartCount(val int) attribute.KeyValue {
+ return K8SContainerRestartCountKey.Int(val)
+}
+
+// K8SContainerStatusLastTerminatedReason returns an attribute KeyValue
+// conforming to the "k8s.container.status.last_terminated_reason" semantic
+// conventions. It represents the last terminated reason of the Container.
+func K8SContainerStatusLastTerminatedReason(val string) attribute.KeyValue {
+ return K8SContainerStatusLastTerminatedReasonKey.String(val)
+}
+
+// K8SCronJobAnnotation returns an attribute KeyValue conforming to the
+// "k8s.cronjob.annotation" semantic conventions. It represents the cronjob
+// annotation placed on the CronJob, the `` being the annotation name, the
+// value being the annotation value.
+func K8SCronJobAnnotation(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.cronjob.annotation."+key, val)
+}
+
+// K8SCronJobLabel returns an attribute KeyValue conforming to the
+// "k8s.cronjob.label" semantic conventions. It represents the label placed on
+// the CronJob, the `` being the label name, the value being the label
+// value.
+func K8SCronJobLabel(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.cronjob.label."+key, val)
+}
+
+// K8SCronJobName returns an attribute KeyValue conforming to the
+// "k8s.cronjob.name" semantic conventions. It represents the name of the
+// CronJob.
+func K8SCronJobName(val string) attribute.KeyValue {
+ return K8SCronJobNameKey.String(val)
+}
+
+// K8SCronJobUID returns an attribute KeyValue conforming to the
+// "k8s.cronjob.uid" semantic conventions. It represents the UID of the CronJob.
+func K8SCronJobUID(val string) attribute.KeyValue {
+ return K8SCronJobUIDKey.String(val)
+}
+
+// K8SDaemonSetAnnotation returns an attribute KeyValue conforming to the
+// "k8s.daemonset.annotation" semantic conventions. It represents the annotation
+// placed on the DaemonSet, the `` being the annotation name, the value
+// being the annotation value, even if the value is empty.
+func K8SDaemonSetAnnotation(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.daemonset.annotation."+key, val)
+}
+
+// K8SDaemonSetLabel returns an attribute KeyValue conforming to the
+// "k8s.daemonset.label" semantic conventions. It represents the label placed on
+// the DaemonSet, the `` being the label name, the value being the label
+// value, even if the value is empty.
+func K8SDaemonSetLabel(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.daemonset.label."+key, val)
+}
+
+// K8SDaemonSetName returns an attribute KeyValue conforming to the
+// "k8s.daemonset.name" semantic conventions. It represents the name of the
+// DaemonSet.
+func K8SDaemonSetName(val string) attribute.KeyValue {
+ return K8SDaemonSetNameKey.String(val)
+}
+
+// K8SDaemonSetUID returns an attribute KeyValue conforming to the
+// "k8s.daemonset.uid" semantic conventions. It represents the UID of the
+// DaemonSet.
+func K8SDaemonSetUID(val string) attribute.KeyValue {
+ return K8SDaemonSetUIDKey.String(val)
+}
+
+// K8SDeploymentAnnotation returns an attribute KeyValue conforming to the
+// "k8s.deployment.annotation" semantic conventions. It represents the annotation
+// placed on the Deployment, the `` being the annotation name, the value
+// being the annotation value, even if the value is empty.
+func K8SDeploymentAnnotation(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.deployment.annotation."+key, val)
+}
+
+// K8SDeploymentLabel returns an attribute KeyValue conforming to the
+// "k8s.deployment.label" semantic conventions. It represents the label placed on
+// the Deployment, the `` being the label name, the value being the label
+// value, even if the value is empty.
+func K8SDeploymentLabel(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.deployment.label."+key, val)
+}
+
+// K8SDeploymentName returns an attribute KeyValue conforming to the
+// "k8s.deployment.name" semantic conventions. It represents the name of the
+// Deployment.
+func K8SDeploymentName(val string) attribute.KeyValue {
+ return K8SDeploymentNameKey.String(val)
+}
+
+// K8SDeploymentUID returns an attribute KeyValue conforming to the
+// "k8s.deployment.uid" semantic conventions. It represents the UID of the
+// Deployment.
+func K8SDeploymentUID(val string) attribute.KeyValue {
+ return K8SDeploymentUIDKey.String(val)
+}
+
+// K8SHPAMetricType returns an attribute KeyValue conforming to the
+// "k8s.hpa.metric.type" semantic conventions. It represents the type of metric
+// source for the horizontal pod autoscaler.
+func K8SHPAMetricType(val string) attribute.KeyValue {
+ return K8SHPAMetricTypeKey.String(val)
+}
+
+// K8SHPAName returns an attribute KeyValue conforming to the "k8s.hpa.name"
+// semantic conventions. It represents the name of the horizontal pod autoscaler.
+func K8SHPAName(val string) attribute.KeyValue {
+ return K8SHPANameKey.String(val)
+}
+
+// K8SHPAScaletargetrefAPIVersion returns an attribute KeyValue conforming to the
+// "k8s.hpa.scaletargetref.api_version" semantic conventions. It represents the
+// API version of the target resource to scale for the HorizontalPodAutoscaler.
+func K8SHPAScaletargetrefAPIVersion(val string) attribute.KeyValue {
+ return K8SHPAScaletargetrefAPIVersionKey.String(val)
+}
+
+// K8SHPAScaletargetrefKind returns an attribute KeyValue conforming to the
+// "k8s.hpa.scaletargetref.kind" semantic conventions. It represents the kind of
+// the target resource to scale for the HorizontalPodAutoscaler.
+func K8SHPAScaletargetrefKind(val string) attribute.KeyValue {
+ return K8SHPAScaletargetrefKindKey.String(val)
+}
+
+// K8SHPAScaletargetrefName returns an attribute KeyValue conforming to the
+// "k8s.hpa.scaletargetref.name" semantic conventions. It represents the name of
+// the target resource to scale for the HorizontalPodAutoscaler.
+func K8SHPAScaletargetrefName(val string) attribute.KeyValue {
+ return K8SHPAScaletargetrefNameKey.String(val)
+}
+
+// K8SHPAUID returns an attribute KeyValue conforming to the "k8s.hpa.uid"
+// semantic conventions. It represents the UID of the horizontal pod autoscaler.
+func K8SHPAUID(val string) attribute.KeyValue {
+ return K8SHPAUIDKey.String(val)
+}
+
+// K8SHugepageSize returns an attribute KeyValue conforming to the
+// "k8s.hugepage.size" semantic conventions. It represents the size (identifier)
+// of the K8s huge page.
+func K8SHugepageSize(val string) attribute.KeyValue {
+ return K8SHugepageSizeKey.String(val)
+}
+
+// K8SJobAnnotation returns an attribute KeyValue conforming to the
+// "k8s.job.annotation" semantic conventions. It represents the annotation placed
+// on the Job, the `` being the annotation name, the value being the
+// annotation value, even if the value is empty.
+func K8SJobAnnotation(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.job.annotation."+key, val)
+}
+
+// K8SJobLabel returns an attribute KeyValue conforming to the "k8s.job.label"
+// semantic conventions. It represents the label placed on the Job, the ``
+// being the label name, the value being the label value, even if the value is
+// empty.
+func K8SJobLabel(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.job.label."+key, val)
+}
+
+// K8SJobName returns an attribute KeyValue conforming to the "k8s.job.name"
+// semantic conventions. It represents the name of the Job.
+func K8SJobName(val string) attribute.KeyValue {
+ return K8SJobNameKey.String(val)
+}
+
+// K8SJobUID returns an attribute KeyValue conforming to the "k8s.job.uid"
+// semantic conventions. It represents the UID of the Job.
+func K8SJobUID(val string) attribute.KeyValue {
+ return K8SJobUIDKey.String(val)
+}
+
+// K8SNamespaceAnnotation returns an attribute KeyValue conforming to the
+// "k8s.namespace.annotation" semantic conventions. It represents the annotation
+// placed on the Namespace, the `` being the annotation name, the value
+// being the annotation value, even if the value is empty.
+func K8SNamespaceAnnotation(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.namespace.annotation."+key, val)
+}
+
+// K8SNamespaceLabel returns an attribute KeyValue conforming to the
+// "k8s.namespace.label" semantic conventions. It represents the label placed on
+// the Namespace, the `` being the label name, the value being the label
+// value, even if the value is empty.
+func K8SNamespaceLabel(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.namespace.label."+key, val)
+}
+
+// K8SNamespaceName returns an attribute KeyValue conforming to the
+// "k8s.namespace.name" semantic conventions. It represents the name of the
+// namespace that the pod is running in.
+func K8SNamespaceName(val string) attribute.KeyValue {
+ return K8SNamespaceNameKey.String(val)
+}
+
+// K8SNodeAnnotation returns an attribute KeyValue conforming to the
+// "k8s.node.annotation" semantic conventions. It represents the annotation
+// placed on the Node, the `` being the annotation name, the value being the
+// annotation value, even if the value is empty.
+func K8SNodeAnnotation(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.node.annotation."+key, val)
+}
+
+// K8SNodeLabel returns an attribute KeyValue conforming to the "k8s.node.label"
+// semantic conventions. It represents the label placed on the Node, the ``
+// being the label name, the value being the label value, even if the value is
+// empty.
+func K8SNodeLabel(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.node.label."+key, val)
+}
+
+// K8SNodeName returns an attribute KeyValue conforming to the "k8s.node.name"
+// semantic conventions. It represents the name of the Node.
+func K8SNodeName(val string) attribute.KeyValue {
+ return K8SNodeNameKey.String(val)
+}
+
+// K8SNodeUID returns an attribute KeyValue conforming to the "k8s.node.uid"
+// semantic conventions. It represents the UID of the Node.
+func K8SNodeUID(val string) attribute.KeyValue {
+ return K8SNodeUIDKey.String(val)
+}
+
+// K8SPodAnnotation returns an attribute KeyValue conforming to the
+// "k8s.pod.annotation" semantic conventions. It represents the annotation placed
+// on the Pod, the `` being the annotation name, the value being the
+// annotation value.
+func K8SPodAnnotation(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.pod.annotation."+key, val)
+}
+
+// K8SPodLabel returns an attribute KeyValue conforming to the "k8s.pod.label"
+// semantic conventions. It represents the label placed on the Pod, the ``
+// being the label name, the value being the label value.
+func K8SPodLabel(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.pod.label."+key, val)
+}
+
+// K8SPodName returns an attribute KeyValue conforming to the "k8s.pod.name"
+// semantic conventions. It represents the name of the Pod.
+func K8SPodName(val string) attribute.KeyValue {
+ return K8SPodNameKey.String(val)
+}
+
+// K8SPodUID returns an attribute KeyValue conforming to the "k8s.pod.uid"
+// semantic conventions. It represents the UID of the Pod.
+func K8SPodUID(val string) attribute.KeyValue {
+ return K8SPodUIDKey.String(val)
+}
+
+// K8SReplicaSetAnnotation returns an attribute KeyValue conforming to the
+// "k8s.replicaset.annotation" semantic conventions. It represents the annotation
+// placed on the ReplicaSet, the `` being the annotation name, the value
+// being the annotation value, even if the value is empty.
+func K8SReplicaSetAnnotation(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.replicaset.annotation."+key, val)
+}
+
+// K8SReplicaSetLabel returns an attribute KeyValue conforming to the
+// "k8s.replicaset.label" semantic conventions. It represents the label placed on
+// the ReplicaSet, the `` being the label name, the value being the label
+// value, even if the value is empty.
+func K8SReplicaSetLabel(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.replicaset.label."+key, val)
+}
+
+// K8SReplicaSetName returns an attribute KeyValue conforming to the
+// "k8s.replicaset.name" semantic conventions. It represents the name of the
+// ReplicaSet.
+func K8SReplicaSetName(val string) attribute.KeyValue {
+ return K8SReplicaSetNameKey.String(val)
+}
+
+// K8SReplicaSetUID returns an attribute KeyValue conforming to the
+// "k8s.replicaset.uid" semantic conventions. It represents the UID of the
+// ReplicaSet.
+func K8SReplicaSetUID(val string) attribute.KeyValue {
+ return K8SReplicaSetUIDKey.String(val)
+}
+
+// K8SReplicationControllerName returns an attribute KeyValue conforming to the
+// "k8s.replicationcontroller.name" semantic conventions. It represents the name
+// of the replication controller.
+func K8SReplicationControllerName(val string) attribute.KeyValue {
+ return K8SReplicationControllerNameKey.String(val)
+}
+
+// K8SReplicationControllerUID returns an attribute KeyValue conforming to the
+// "k8s.replicationcontroller.uid" semantic conventions. It represents the UID of
+// the replication controller.
+func K8SReplicationControllerUID(val string) attribute.KeyValue {
+ return K8SReplicationControllerUIDKey.String(val)
+}
+
+// K8SResourceQuotaName returns an attribute KeyValue conforming to the
+// "k8s.resourcequota.name" semantic conventions. It represents the name of the
+// resource quota.
+func K8SResourceQuotaName(val string) attribute.KeyValue {
+ return K8SResourceQuotaNameKey.String(val)
+}
+
+// K8SResourceQuotaResourceName returns an attribute KeyValue conforming to the
+// "k8s.resourcequota.resource_name" semantic conventions. It represents the name
+// of the K8s resource a resource quota defines.
+func K8SResourceQuotaResourceName(val string) attribute.KeyValue {
+ return K8SResourceQuotaResourceNameKey.String(val)
+}
+
+// K8SResourceQuotaUID returns an attribute KeyValue conforming to the
+// "k8s.resourcequota.uid" semantic conventions. It represents the UID of the
+// resource quota.
+func K8SResourceQuotaUID(val string) attribute.KeyValue {
+ return K8SResourceQuotaUIDKey.String(val)
+}
+
+// K8SStatefulSetAnnotation returns an attribute KeyValue conforming to the
+// "k8s.statefulset.annotation" semantic conventions. It represents the
+// annotation placed on the StatefulSet, the `` being the annotation name,
+// the value being the annotation value, even if the value is empty.
+func K8SStatefulSetAnnotation(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.statefulset.annotation."+key, val)
+}
+
+// K8SStatefulSetLabel returns an attribute KeyValue conforming to the
+// "k8s.statefulset.label" semantic conventions. It represents the label placed
+// on the StatefulSet, the `` being the label name, the value being the
+// label value, even if the value is empty.
+func K8SStatefulSetLabel(key string, val string) attribute.KeyValue {
+ return attribute.String("k8s.statefulset.label."+key, val)
+}
+
+// K8SStatefulSetName returns an attribute KeyValue conforming to the
+// "k8s.statefulset.name" semantic conventions. It represents the name of the
+// StatefulSet.
+func K8SStatefulSetName(val string) attribute.KeyValue {
+ return K8SStatefulSetNameKey.String(val)
+}
+
+// K8SStatefulSetUID returns an attribute KeyValue conforming to the
+// "k8s.statefulset.uid" semantic conventions. It represents the UID of the
+// StatefulSet.
+func K8SStatefulSetUID(val string) attribute.KeyValue {
+ return K8SStatefulSetUIDKey.String(val)
+}
+
+// K8SStorageclassName returns an attribute KeyValue conforming to the
+// "k8s.storageclass.name" semantic conventions. It represents the name of K8s
+// [StorageClass] object.
+//
+// [StorageClass]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#storageclass-v1-storage-k8s-io
+func K8SStorageclassName(val string) attribute.KeyValue {
+ return K8SStorageclassNameKey.String(val)
+}
+
+// K8SVolumeName returns an attribute KeyValue conforming to the
+// "k8s.volume.name" semantic conventions. It represents the name of the K8s
+// volume.
+func K8SVolumeName(val string) attribute.KeyValue {
+ return K8SVolumeNameKey.String(val)
+}
+
+// Enum values for k8s.container.status.reason
+var (
+ // The container is being created.
+ // Stability: development
+ K8SContainerStatusReasonContainerCreating = K8SContainerStatusReasonKey.String("ContainerCreating")
+ // The container is in a crash loop back off state.
+ // Stability: development
+ K8SContainerStatusReasonCrashLoopBackOff = K8SContainerStatusReasonKey.String("CrashLoopBackOff")
+ // There was an error creating the container configuration.
+ // Stability: development
+ K8SContainerStatusReasonCreateContainerConfigError = K8SContainerStatusReasonKey.String("CreateContainerConfigError")
+ // There was an error pulling the container image.
+ // Stability: development
+ K8SContainerStatusReasonErrImagePull = K8SContainerStatusReasonKey.String("ErrImagePull")
+ // The container image pull is in back off state.
+ // Stability: development
+ K8SContainerStatusReasonImagePullBackOff = K8SContainerStatusReasonKey.String("ImagePullBackOff")
+ // The container was killed due to out of memory.
+ // Stability: development
+ K8SContainerStatusReasonOomKilled = K8SContainerStatusReasonKey.String("OOMKilled")
+ // The container has completed execution.
+ // Stability: development
+ K8SContainerStatusReasonCompleted = K8SContainerStatusReasonKey.String("Completed")
+ // There was an error with the container.
+ // Stability: development
+ K8SContainerStatusReasonError = K8SContainerStatusReasonKey.String("Error")
+ // The container cannot run.
+ // Stability: development
+ K8SContainerStatusReasonContainerCannotRun = K8SContainerStatusReasonKey.String("ContainerCannotRun")
+)
+
+// Enum values for k8s.container.status.state
+var (
+ // The container has terminated.
+ // Stability: development
+ K8SContainerStatusStateTerminated = K8SContainerStatusStateKey.String("terminated")
+ // The container is running.
+ // Stability: development
+ K8SContainerStatusStateRunning = K8SContainerStatusStateKey.String("running")
+ // The container is waiting.
+ // Stability: development
+ K8SContainerStatusStateWaiting = K8SContainerStatusStateKey.String("waiting")
+)
+
+// Enum values for k8s.namespace.phase
+var (
+ // Active namespace phase as described by [K8s API]
+ // Stability: development
+ //
+ // [K8s API]: https://pkg.go.dev/k8s.io/api@v0.31.3/core/v1#NamespacePhase
+ K8SNamespacePhaseActive = K8SNamespacePhaseKey.String("active")
+ // Terminating namespace phase as described by [K8s API]
+ // Stability: development
+ //
+ // [K8s API]: https://pkg.go.dev/k8s.io/api@v0.31.3/core/v1#NamespacePhase
+ K8SNamespacePhaseTerminating = K8SNamespacePhaseKey.String("terminating")
+)
+
+// Enum values for k8s.node.condition.status
+var (
+ // condition_true
+ // Stability: development
+ K8SNodeConditionStatusConditionTrue = K8SNodeConditionStatusKey.String("true")
+ // condition_false
+ // Stability: development
+ K8SNodeConditionStatusConditionFalse = K8SNodeConditionStatusKey.String("false")
+ // condition_unknown
+ // Stability: development
+ K8SNodeConditionStatusConditionUnknown = K8SNodeConditionStatusKey.String("unknown")
+)
+
+// Enum values for k8s.node.condition.type
+var (
+ // The node is healthy and ready to accept pods
+ // Stability: development
+ K8SNodeConditionTypeReady = K8SNodeConditionTypeKey.String("Ready")
+ // Pressure exists on the disk size—that is, if the disk capacity is low
+ // Stability: development
+ K8SNodeConditionTypeDiskPressure = K8SNodeConditionTypeKey.String("DiskPressure")
+ // Pressure exists on the node memory—that is, if the node memory is low
+ // Stability: development
+ K8SNodeConditionTypeMemoryPressure = K8SNodeConditionTypeKey.String("MemoryPressure")
+ // Pressure exists on the processes—that is, if there are too many processes
+ // on the node
+ // Stability: development
+ K8SNodeConditionTypePIDPressure = K8SNodeConditionTypeKey.String("PIDPressure")
+ // The network for the node is not correctly configured
+ // Stability: development
+ K8SNodeConditionTypeNetworkUnavailable = K8SNodeConditionTypeKey.String("NetworkUnavailable")
+)
+
+// Enum values for k8s.volume.type
+var (
+ // A [persistentVolumeClaim] volume
+ // Stability: development
+ //
+ // [persistentVolumeClaim]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#persistentvolumeclaim
+ K8SVolumeTypePersistentVolumeClaim = K8SVolumeTypeKey.String("persistentVolumeClaim")
+ // A [configMap] volume
+ // Stability: development
+ //
+ // [configMap]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#configmap
+ K8SVolumeTypeConfigMap = K8SVolumeTypeKey.String("configMap")
+ // A [downwardAPI] volume
+ // Stability: development
+ //
+ // [downwardAPI]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#downwardapi
+ K8SVolumeTypeDownwardAPI = K8SVolumeTypeKey.String("downwardAPI")
+ // An [emptyDir] volume
+ // Stability: development
+ //
+ // [emptyDir]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#emptydir
+ K8SVolumeTypeEmptyDir = K8SVolumeTypeKey.String("emptyDir")
+ // A [secret] volume
+ // Stability: development
+ //
+ // [secret]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#secret
+ K8SVolumeTypeSecret = K8SVolumeTypeKey.String("secret")
+ // A [local] volume
+ // Stability: development
+ //
+ // [local]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#local
+ K8SVolumeTypeLocal = K8SVolumeTypeKey.String("local")
+)
+
+// Namespace: linux
+const (
+ // LinuxMemorySlabStateKey is the attribute Key conforming to the
+ // "linux.memory.slab.state" semantic conventions. It represents the Linux Slab
+ // memory state.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "reclaimable", "unreclaimable"
+ LinuxMemorySlabStateKey = attribute.Key("linux.memory.slab.state")
+)
+
+// Enum values for linux.memory.slab.state
+var (
+ // reclaimable
+ // Stability: development
+ LinuxMemorySlabStateReclaimable = LinuxMemorySlabStateKey.String("reclaimable")
+ // unreclaimable
+ // Stability: development
+ LinuxMemorySlabStateUnreclaimable = LinuxMemorySlabStateKey.String("unreclaimable")
+)
+
+// Namespace: log
+const (
+ // LogFileNameKey is the attribute Key conforming to the "log.file.name"
+ // semantic conventions. It represents the basename of the file.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "audit.log"
+ LogFileNameKey = attribute.Key("log.file.name")
+
+ // LogFileNameResolvedKey is the attribute Key conforming to the
+ // "log.file.name_resolved" semantic conventions. It represents the basename of
+ // the file, with symlinks resolved.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "uuid.log"
+ LogFileNameResolvedKey = attribute.Key("log.file.name_resolved")
+
+ // LogFilePathKey is the attribute Key conforming to the "log.file.path"
+ // semantic conventions. It represents the full path to the file.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "/var/log/mysql/audit.log"
+ LogFilePathKey = attribute.Key("log.file.path")
+
+ // LogFilePathResolvedKey is the attribute Key conforming to the
+ // "log.file.path_resolved" semantic conventions. It represents the full path to
+ // the file, with symlinks resolved.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "/var/lib/docker/uuid.log"
+ LogFilePathResolvedKey = attribute.Key("log.file.path_resolved")
+
+ // LogIostreamKey is the attribute Key conforming to the "log.iostream" semantic
+ // conventions. It represents the stream associated with the log. See below for
+ // a list of well-known values.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ LogIostreamKey = attribute.Key("log.iostream")
+
+ // LogRecordOriginalKey is the attribute Key conforming to the
+ // "log.record.original" semantic conventions. It represents the complete
+ // original Log Record.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "77 <86>1 2015-08-06T21:58:59.694Z 192.168.2.133 inactive - - -
+ // Something happened", "[INFO] 8/3/24 12:34:56 Something happened"
+ // Note: This value MAY be added when processing a Log Record which was
+ // originally transmitted as a string or equivalent data type AND the Body field
+ // of the Log Record does not contain the same value. (e.g. a syslog or a log
+ // record read from a file.)
+ LogRecordOriginalKey = attribute.Key("log.record.original")
+
+ // LogRecordUIDKey is the attribute Key conforming to the "log.record.uid"
+ // semantic conventions. It represents a unique identifier for the Log Record.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "01ARZ3NDEKTSV4RRFFQ69G5FAV"
+ // Note: If an id is provided, other log records with the same id will be
+ // considered duplicates and can be removed safely. This means, that two
+ // distinguishable log records MUST have different values.
+ // The id MAY be an
+ // [Universally Unique Lexicographically Sortable Identifier (ULID)], but other
+ // identifiers (e.g. UUID) may be used as needed.
+ //
+ // [Universally Unique Lexicographically Sortable Identifier (ULID)]: https://github.com/ulid/spec
+ LogRecordUIDKey = attribute.Key("log.record.uid")
+)
+
+// LogFileName returns an attribute KeyValue conforming to the "log.file.name"
+// semantic conventions. It represents the basename of the file.
+func LogFileName(val string) attribute.KeyValue {
+ return LogFileNameKey.String(val)
+}
+
+// LogFileNameResolved returns an attribute KeyValue conforming to the
+// "log.file.name_resolved" semantic conventions. It represents the basename of
+// the file, with symlinks resolved.
+func LogFileNameResolved(val string) attribute.KeyValue {
+ return LogFileNameResolvedKey.String(val)
+}
+
+// LogFilePath returns an attribute KeyValue conforming to the "log.file.path"
+// semantic conventions. It represents the full path to the file.
+func LogFilePath(val string) attribute.KeyValue {
+ return LogFilePathKey.String(val)
+}
+
+// LogFilePathResolved returns an attribute KeyValue conforming to the
+// "log.file.path_resolved" semantic conventions. It represents the full path to
+// the file, with symlinks resolved.
+func LogFilePathResolved(val string) attribute.KeyValue {
+ return LogFilePathResolvedKey.String(val)
+}
+
+// LogRecordOriginal returns an attribute KeyValue conforming to the
+// "log.record.original" semantic conventions. It represents the complete
+// original Log Record.
+func LogRecordOriginal(val string) attribute.KeyValue {
+ return LogRecordOriginalKey.String(val)
+}
+
+// LogRecordUID returns an attribute KeyValue conforming to the "log.record.uid"
+// semantic conventions. It represents a unique identifier for the Log Record.
+func LogRecordUID(val string) attribute.KeyValue {
+ return LogRecordUIDKey.String(val)
+}
+
+// Enum values for log.iostream
+var (
+ // Logs from stdout stream
+ // Stability: development
+ LogIostreamStdout = LogIostreamKey.String("stdout")
+ // Events from stderr stream
+ // Stability: development
+ LogIostreamStderr = LogIostreamKey.String("stderr")
+)
+
+// Namespace: mainframe
+const (
+ // MainframeLparNameKey is the attribute Key conforming to the
+ // "mainframe.lpar.name" semantic conventions. It represents the name of the
+ // logical partition that hosts a systems with a mainframe operating system.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "LPAR01"
+ MainframeLparNameKey = attribute.Key("mainframe.lpar.name")
+)
+
+// MainframeLparName returns an attribute KeyValue conforming to the
+// "mainframe.lpar.name" semantic conventions. It represents the name of the
+// logical partition that hosts a systems with a mainframe operating system.
+func MainframeLparName(val string) attribute.KeyValue {
+ return MainframeLparNameKey.String(val)
+}
+
+// Namespace: messaging
+const (
+ // MessagingBatchMessageCountKey is the attribute Key conforming to the
+ // "messaging.batch.message_count" semantic conventions. It represents the
+ // number of messages sent, received, or processed in the scope of the batching
+ // operation.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 0, 1, 2
+ // Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on
+ // spans that operate with a single message. When a messaging client library
+ // supports both batch and single-message API for the same operation,
+ // instrumentations SHOULD use `messaging.batch.message_count` for batching APIs
+ // and SHOULD NOT use it for single-message APIs.
+ MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count")
+
+ // MessagingClientIDKey is the attribute Key conforming to the
+ // "messaging.client.id" semantic conventions. It represents a unique identifier
+ // for the client that consumes or produces a message.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "client-5", "myhost@8742@s8083jm"
+ MessagingClientIDKey = attribute.Key("messaging.client.id")
+
+ // MessagingConsumerGroupNameKey is the attribute Key conforming to the
+ // "messaging.consumer.group.name" semantic conventions. It represents the name
+ // of the consumer group with which a consumer is associated.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "my-group", "indexer"
+ // Note: Semantic conventions for individual messaging systems SHOULD document
+ // whether `messaging.consumer.group.name` is applicable and what it means in
+ // the context of that system.
+ MessagingConsumerGroupNameKey = attribute.Key("messaging.consumer.group.name")
+
+ // MessagingDestinationAnonymousKey is the attribute Key conforming to the
+ // "messaging.destination.anonymous" semantic conventions. It represents a
+ // boolean that is true if the message destination is anonymous (could be
+ // unnamed or have auto-generated name).
+ //
+ // Type: boolean
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous")
+
+ // MessagingDestinationNameKey is the attribute Key conforming to the
+ // "messaging.destination.name" semantic conventions. It represents the message
+ // destination name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "MyQueue", "MyTopic"
+ // Note: Destination name SHOULD uniquely identify a specific queue, topic or
+ // other entity within the broker. If
+ // the broker doesn't have such notion, the destination name SHOULD uniquely
+ // identify the broker.
+ MessagingDestinationNameKey = attribute.Key("messaging.destination.name")
+
+ // MessagingDestinationPartitionIDKey is the attribute Key conforming to the
+ // "messaging.destination.partition.id" semantic conventions. It represents the
+ // identifier of the partition messages are sent to or received from, unique
+ // within the `messaging.destination.name`.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 1
+ MessagingDestinationPartitionIDKey = attribute.Key("messaging.destination.partition.id")
+
+ // MessagingDestinationSubscriptionNameKey is the attribute Key conforming to
+ // the "messaging.destination.subscription.name" semantic conventions. It
+ // represents the name of the destination subscription from which a message is
+ // consumed.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "subscription-a"
+ // Note: Semantic conventions for individual messaging systems SHOULD document
+ // whether `messaging.destination.subscription.name` is applicable and what it
+ // means in the context of that system.
+ MessagingDestinationSubscriptionNameKey = attribute.Key("messaging.destination.subscription.name")
+
+ // MessagingDestinationTemplateKey is the attribute Key conforming to the
+ // "messaging.destination.template" semantic conventions. It represents the low
+ // cardinality representation of the messaging destination name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "/customers/{customerId}"
+ // Note: Destination names could be constructed from templates. An example would
+ // be a destination name involving a user name or product id. Although the
+ // destination name in this case is of high cardinality, the underlying template
+ // is of low cardinality and can be effectively used for grouping and
+ // aggregation.
+ MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template")
+
+ // MessagingDestinationTemporaryKey is the attribute Key conforming to the
+ // "messaging.destination.temporary" semantic conventions. It represents a
+ // boolean that is true if the message destination is temporary and might not
+ // exist anymore after messages are processed.
+ //
+ // Type: boolean
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary")
+
+ // MessagingEventHubsMessageEnqueuedTimeKey is the attribute Key conforming to
+ // the "messaging.eventhubs.message.enqueued_time" semantic conventions. It
+ // represents the UTC epoch seconds at which the message has been accepted and
+ // stored in the entity.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ MessagingEventHubsMessageEnqueuedTimeKey = attribute.Key("messaging.eventhubs.message.enqueued_time")
+
+ // MessagingGCPPubSubMessageAckDeadlineKey is the attribute Key conforming to
+ // the "messaging.gcp_pubsub.message.ack_deadline" semantic conventions. It
+ // represents the ack deadline in seconds set for the modify ack deadline
+ // request.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ MessagingGCPPubSubMessageAckDeadlineKey = attribute.Key("messaging.gcp_pubsub.message.ack_deadline")
+
+ // MessagingGCPPubSubMessageAckIDKey is the attribute Key conforming to the
+ // "messaging.gcp_pubsub.message.ack_id" semantic conventions. It represents the
+ // ack id for a given message.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: ack_id
+ MessagingGCPPubSubMessageAckIDKey = attribute.Key("messaging.gcp_pubsub.message.ack_id")
+
+ // MessagingGCPPubSubMessageDeliveryAttemptKey is the attribute Key conforming
+ // to the "messaging.gcp_pubsub.message.delivery_attempt" semantic conventions.
+ // It represents the delivery attempt for a given message.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ MessagingGCPPubSubMessageDeliveryAttemptKey = attribute.Key("messaging.gcp_pubsub.message.delivery_attempt")
+
+ // MessagingGCPPubSubMessageOrderingKeyKey is the attribute Key conforming to
+ // the "messaging.gcp_pubsub.message.ordering_key" semantic conventions. It
+ // represents the ordering key for a given message. If the attribute is not
+ // present, the message does not have an ordering key.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: ordering_key
+ MessagingGCPPubSubMessageOrderingKeyKey = attribute.Key("messaging.gcp_pubsub.message.ordering_key")
+
+ // MessagingKafkaMessageKeyKey is the attribute Key conforming to the
+ // "messaging.kafka.message.key" semantic conventions. It represents the message
+ // keys in Kafka are used for grouping alike messages to ensure they're
+ // processed on the same partition. They differ from `messaging.message.id` in
+ // that they're not unique. If the key is `null`, the attribute MUST NOT be set.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: myKey
+ // Note: If the key type is not string, it's string representation has to be
+ // supplied for the attribute. If the key has no unambiguous, canonical string
+ // form, don't include its value.
+ MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key")
+
+ // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the
+ // "messaging.kafka.message.tombstone" semantic conventions. It represents a
+ // boolean that is true if the message is a tombstone.
+ //
+ // Type: boolean
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone")
+
+ // MessagingKafkaOffsetKey is the attribute Key conforming to the
+ // "messaging.kafka.offset" semantic conventions. It represents the offset of a
+ // record in the corresponding Kafka partition.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ MessagingKafkaOffsetKey = attribute.Key("messaging.kafka.offset")
+
+ // MessagingMessageBodySizeKey is the attribute Key conforming to the
+ // "messaging.message.body.size" semantic conventions. It represents the size of
+ // the message body in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Note: This can refer to both the compressed or uncompressed body size. If
+ // both sizes are known, the uncompressed
+ // body size should be used.
+ MessagingMessageBodySizeKey = attribute.Key("messaging.message.body.size")
+
+ // MessagingMessageConversationIDKey is the attribute Key conforming to the
+ // "messaging.message.conversation_id" semantic conventions. It represents the
+ // conversation ID identifying the conversation to which the message belongs,
+ // represented as a string. Sometimes called "Correlation ID".
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: MyConversationId
+ MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id")
+
+ // MessagingMessageEnvelopeSizeKey is the attribute Key conforming to the
+ // "messaging.message.envelope.size" semantic conventions. It represents the
+ // size of the message body and metadata in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Note: This can refer to both the compressed or uncompressed size. If both
+ // sizes are known, the uncompressed
+ // size should be used.
+ MessagingMessageEnvelopeSizeKey = attribute.Key("messaging.message.envelope.size")
+
+ // MessagingMessageIDKey is the attribute Key conforming to the
+ // "messaging.message.id" semantic conventions. It represents a value used by
+ // the messaging system as an identifier for the message, represented as a
+ // string.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 452a7c7c7c7048c2f887f61572b18fc2
+ MessagingMessageIDKey = attribute.Key("messaging.message.id")
+
+ // MessagingOperationNameKey is the attribute Key conforming to the
+ // "messaging.operation.name" semantic conventions. It represents the
+ // system-specific name of the messaging operation.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "ack", "nack", "send"
+ MessagingOperationNameKey = attribute.Key("messaging.operation.name")
+
+ // MessagingOperationTypeKey is the attribute Key conforming to the
+ // "messaging.operation.type" semantic conventions. It represents a string
+ // identifying the type of the messaging operation.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // Note: If a custom value is used, it MUST be of low cardinality.
+ MessagingOperationTypeKey = attribute.Key("messaging.operation.type")
+
+ // MessagingRabbitMQDestinationRoutingKeyKey is the attribute Key conforming to
+ // the "messaging.rabbitmq.destination.routing_key" semantic conventions. It
+ // represents the rabbitMQ message routing key.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: myKey
+ MessagingRabbitMQDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key")
+
+ // MessagingRabbitMQMessageDeliveryTagKey is the attribute Key conforming to the
+ // "messaging.rabbitmq.message.delivery_tag" semantic conventions. It represents
+ // the rabbitMQ message delivery tag.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ MessagingRabbitMQMessageDeliveryTagKey = attribute.Key("messaging.rabbitmq.message.delivery_tag")
+
+ // MessagingRocketMQConsumptionModelKey is the attribute Key conforming to the
+ // "messaging.rocketmq.consumption_model" semantic conventions. It represents
+ // the model of message consumption. This only applies to consumer spans.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ MessagingRocketMQConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model")
+
+ // MessagingRocketMQMessageDelayTimeLevelKey is the attribute Key conforming to
+ // the "messaging.rocketmq.message.delay_time_level" semantic conventions. It
+ // represents the delay time level for delay message, which determines the
+ // message delay time.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ MessagingRocketMQMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level")
+
+ // MessagingRocketMQMessageDeliveryTimestampKey is the attribute Key conforming
+ // to the "messaging.rocketmq.message.delivery_timestamp" semantic conventions.
+ // It represents the timestamp in milliseconds that the delay message is
+ // expected to be delivered to consumer.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ MessagingRocketMQMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp")
+
+ // MessagingRocketMQMessageGroupKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.group" semantic conventions. It represents the it
+ // is essential for FIFO message. Messages that belong to the same message group
+ // are always processed one by one within the same consumer group.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: myMessageGroup
+ MessagingRocketMQMessageGroupKey = attribute.Key("messaging.rocketmq.message.group")
+
+ // MessagingRocketMQMessageKeysKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.keys" semantic conventions. It represents the
+ // key(s) of message, another way to mark message besides message id.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "keyA", "keyB"
+ MessagingRocketMQMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys")
+
+ // MessagingRocketMQMessageTagKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.tag" semantic conventions. It represents the
+ // secondary classifier of message besides topic.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: tagA
+ MessagingRocketMQMessageTagKey = attribute.Key("messaging.rocketmq.message.tag")
+
+ // MessagingRocketMQMessageTypeKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.type" semantic conventions. It represents the
+ // type of message.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ MessagingRocketMQMessageTypeKey = attribute.Key("messaging.rocketmq.message.type")
+
+ // MessagingRocketMQNamespaceKey is the attribute Key conforming to the
+ // "messaging.rocketmq.namespace" semantic conventions. It represents the
+ // namespace of RocketMQ resources, resources in different namespaces are
+ // individual.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: myNamespace
+ MessagingRocketMQNamespaceKey = attribute.Key("messaging.rocketmq.namespace")
+
+ // MessagingServiceBusDispositionStatusKey is the attribute Key conforming to
+ // the "messaging.servicebus.disposition_status" semantic conventions. It
+ // represents the describes the [settlement type].
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ //
+ // [settlement type]: https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock
+ MessagingServiceBusDispositionStatusKey = attribute.Key("messaging.servicebus.disposition_status")
+
+ // MessagingServiceBusMessageDeliveryCountKey is the attribute Key conforming to
+ // the "messaging.servicebus.message.delivery_count" semantic conventions. It
+ // represents the number of deliveries that have been attempted for this
+ // message.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ MessagingServiceBusMessageDeliveryCountKey = attribute.Key("messaging.servicebus.message.delivery_count")
+
+ // MessagingServiceBusMessageEnqueuedTimeKey is the attribute Key conforming to
+ // the "messaging.servicebus.message.enqueued_time" semantic conventions. It
+ // represents the UTC epoch seconds at which the message has been accepted and
+ // stored in the entity.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ MessagingServiceBusMessageEnqueuedTimeKey = attribute.Key("messaging.servicebus.message.enqueued_time")
+
+ // MessagingSystemKey is the attribute Key conforming to the "messaging.system"
+ // semantic conventions. It represents the messaging system as identified by the
+ // client instrumentation.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // Note: The actual messaging system may differ from the one known by the
+ // client. For example, when using Kafka client libraries to communicate with
+ // Azure Event Hubs, the `messaging.system` is set to `kafka` based on the
+ // instrumentation's best knowledge.
+ MessagingSystemKey = attribute.Key("messaging.system")
+)
+
+// MessagingBatchMessageCount returns an attribute KeyValue conforming to the
+// "messaging.batch.message_count" semantic conventions. It represents the number
+// of messages sent, received, or processed in the scope of the batching
+// operation.
+func MessagingBatchMessageCount(val int) attribute.KeyValue {
+ return MessagingBatchMessageCountKey.Int(val)
+}
+
+// MessagingClientID returns an attribute KeyValue conforming to the
+// "messaging.client.id" semantic conventions. It represents a unique identifier
+// for the client that consumes or produces a message.
+func MessagingClientID(val string) attribute.KeyValue {
+ return MessagingClientIDKey.String(val)
+}
+
+// MessagingConsumerGroupName returns an attribute KeyValue conforming to the
+// "messaging.consumer.group.name" semantic conventions. It represents the name
+// of the consumer group with which a consumer is associated.
+func MessagingConsumerGroupName(val string) attribute.KeyValue {
+ return MessagingConsumerGroupNameKey.String(val)
+}
+
+// MessagingDestinationAnonymous returns an attribute KeyValue conforming to the
+// "messaging.destination.anonymous" semantic conventions. It represents a
+// boolean that is true if the message destination is anonymous (could be unnamed
+// or have auto-generated name).
+func MessagingDestinationAnonymous(val bool) attribute.KeyValue {
+ return MessagingDestinationAnonymousKey.Bool(val)
+}
+
+// MessagingDestinationName returns an attribute KeyValue conforming to the
+// "messaging.destination.name" semantic conventions. It represents the message
+// destination name.
+func MessagingDestinationName(val string) attribute.KeyValue {
+ return MessagingDestinationNameKey.String(val)
+}
+
+// MessagingDestinationPartitionID returns an attribute KeyValue conforming to
+// the "messaging.destination.partition.id" semantic conventions. It represents
+// the identifier of the partition messages are sent to or received from, unique
+// within the `messaging.destination.name`.
+func MessagingDestinationPartitionID(val string) attribute.KeyValue {
+ return MessagingDestinationPartitionIDKey.String(val)
+}
+
+// MessagingDestinationSubscriptionName returns an attribute KeyValue conforming
+// to the "messaging.destination.subscription.name" semantic conventions. It
+// represents the name of the destination subscription from which a message is
+// consumed.
+func MessagingDestinationSubscriptionName(val string) attribute.KeyValue {
+ return MessagingDestinationSubscriptionNameKey.String(val)
+}
+
+// MessagingDestinationTemplate returns an attribute KeyValue conforming to the
+// "messaging.destination.template" semantic conventions. It represents the low
+// cardinality representation of the messaging destination name.
+func MessagingDestinationTemplate(val string) attribute.KeyValue {
+ return MessagingDestinationTemplateKey.String(val)
+}
+
+// MessagingDestinationTemporary returns an attribute KeyValue conforming to the
+// "messaging.destination.temporary" semantic conventions. It represents a
+// boolean that is true if the message destination is temporary and might not
+// exist anymore after messages are processed.
+func MessagingDestinationTemporary(val bool) attribute.KeyValue {
+ return MessagingDestinationTemporaryKey.Bool(val)
+}
+
+// MessagingEventHubsMessageEnqueuedTime returns an attribute KeyValue conforming
+// to the "messaging.eventhubs.message.enqueued_time" semantic conventions. It
+// represents the UTC epoch seconds at which the message has been accepted and
+// stored in the entity.
+func MessagingEventHubsMessageEnqueuedTime(val int) attribute.KeyValue {
+ return MessagingEventHubsMessageEnqueuedTimeKey.Int(val)
+}
+
+// MessagingGCPPubSubMessageAckDeadline returns an attribute KeyValue conforming
+// to the "messaging.gcp_pubsub.message.ack_deadline" semantic conventions. It
+// represents the ack deadline in seconds set for the modify ack deadline
+// request.
+func MessagingGCPPubSubMessageAckDeadline(val int) attribute.KeyValue {
+ return MessagingGCPPubSubMessageAckDeadlineKey.Int(val)
+}
+
+// MessagingGCPPubSubMessageAckID returns an attribute KeyValue conforming to the
+// "messaging.gcp_pubsub.message.ack_id" semantic conventions. It represents the
+// ack id for a given message.
+func MessagingGCPPubSubMessageAckID(val string) attribute.KeyValue {
+ return MessagingGCPPubSubMessageAckIDKey.String(val)
+}
+
+// MessagingGCPPubSubMessageDeliveryAttempt returns an attribute KeyValue
+// conforming to the "messaging.gcp_pubsub.message.delivery_attempt" semantic
+// conventions. It represents the delivery attempt for a given message.
+func MessagingGCPPubSubMessageDeliveryAttempt(val int) attribute.KeyValue {
+ return MessagingGCPPubSubMessageDeliveryAttemptKey.Int(val)
+}
+
+// MessagingGCPPubSubMessageOrderingKey returns an attribute KeyValue conforming
+// to the "messaging.gcp_pubsub.message.ordering_key" semantic conventions. It
+// represents the ordering key for a given message. If the attribute is not
+// present, the message does not have an ordering key.
+func MessagingGCPPubSubMessageOrderingKey(val string) attribute.KeyValue {
+ return MessagingGCPPubSubMessageOrderingKeyKey.String(val)
+}
+
+// MessagingKafkaMessageKey returns an attribute KeyValue conforming to the
+// "messaging.kafka.message.key" semantic conventions. It represents the message
+// keys in Kafka are used for grouping alike messages to ensure they're processed
+// on the same partition. They differ from `messaging.message.id` in that they're
+// not unique. If the key is `null`, the attribute MUST NOT be set.
+func MessagingKafkaMessageKey(val string) attribute.KeyValue {
+ return MessagingKafkaMessageKeyKey.String(val)
+}
+
+// MessagingKafkaMessageTombstone returns an attribute KeyValue conforming to the
+// "messaging.kafka.message.tombstone" semantic conventions. It represents a
+// boolean that is true if the message is a tombstone.
+func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue {
+ return MessagingKafkaMessageTombstoneKey.Bool(val)
+}
+
+// MessagingKafkaOffset returns an attribute KeyValue conforming to the
+// "messaging.kafka.offset" semantic conventions. It represents the offset of a
+// record in the corresponding Kafka partition.
+func MessagingKafkaOffset(val int) attribute.KeyValue {
+ return MessagingKafkaOffsetKey.Int(val)
+}
+
+// MessagingMessageBodySize returns an attribute KeyValue conforming to the
+// "messaging.message.body.size" semantic conventions. It represents the size of
+// the message body in bytes.
+func MessagingMessageBodySize(val int) attribute.KeyValue {
+ return MessagingMessageBodySizeKey.Int(val)
+}
+
+// MessagingMessageConversationID returns an attribute KeyValue conforming to the
+// "messaging.message.conversation_id" semantic conventions. It represents the
+// conversation ID identifying the conversation to which the message belongs,
+// represented as a string. Sometimes called "Correlation ID".
+func MessagingMessageConversationID(val string) attribute.KeyValue {
+ return MessagingMessageConversationIDKey.String(val)
+}
+
+// MessagingMessageEnvelopeSize returns an attribute KeyValue conforming to the
+// "messaging.message.envelope.size" semantic conventions. It represents the size
+// of the message body and metadata in bytes.
+func MessagingMessageEnvelopeSize(val int) attribute.KeyValue {
+ return MessagingMessageEnvelopeSizeKey.Int(val)
+}
+
+// MessagingMessageID returns an attribute KeyValue conforming to the
+// "messaging.message.id" semantic conventions. It represents a value used by the
+// messaging system as an identifier for the message, represented as a string.
+func MessagingMessageID(val string) attribute.KeyValue {
+ return MessagingMessageIDKey.String(val)
+}
+
+// MessagingOperationName returns an attribute KeyValue conforming to the
+// "messaging.operation.name" semantic conventions. It represents the
+// system-specific name of the messaging operation.
+func MessagingOperationName(val string) attribute.KeyValue {
+ return MessagingOperationNameKey.String(val)
+}
+
+// MessagingRabbitMQDestinationRoutingKey returns an attribute KeyValue
+// conforming to the "messaging.rabbitmq.destination.routing_key" semantic
+// conventions. It represents the rabbitMQ message routing key.
+func MessagingRabbitMQDestinationRoutingKey(val string) attribute.KeyValue {
+ return MessagingRabbitMQDestinationRoutingKeyKey.String(val)
+}
+
+// MessagingRabbitMQMessageDeliveryTag returns an attribute KeyValue conforming
+// to the "messaging.rabbitmq.message.delivery_tag" semantic conventions. It
+// represents the rabbitMQ message delivery tag.
+func MessagingRabbitMQMessageDeliveryTag(val int) attribute.KeyValue {
+ return MessagingRabbitMQMessageDeliveryTagKey.Int(val)
+}
+
+// MessagingRocketMQMessageDelayTimeLevel returns an attribute KeyValue
+// conforming to the "messaging.rocketmq.message.delay_time_level" semantic
+// conventions. It represents the delay time level for delay message, which
+// determines the message delay time.
+func MessagingRocketMQMessageDelayTimeLevel(val int) attribute.KeyValue {
+ return MessagingRocketMQMessageDelayTimeLevelKey.Int(val)
+}
+
+// MessagingRocketMQMessageDeliveryTimestamp returns an attribute KeyValue
+// conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic
+// conventions. It represents the timestamp in milliseconds that the delay
+// message is expected to be delivered to consumer.
+func MessagingRocketMQMessageDeliveryTimestamp(val int) attribute.KeyValue {
+ return MessagingRocketMQMessageDeliveryTimestampKey.Int(val)
+}
+
+// MessagingRocketMQMessageGroup returns an attribute KeyValue conforming to the
+// "messaging.rocketmq.message.group" semantic conventions. It represents the it
+// is essential for FIFO message. Messages that belong to the same message group
+// are always processed one by one within the same consumer group.
+func MessagingRocketMQMessageGroup(val string) attribute.KeyValue {
+ return MessagingRocketMQMessageGroupKey.String(val)
+}
+
+// MessagingRocketMQMessageKeys returns an attribute KeyValue conforming to the
+// "messaging.rocketmq.message.keys" semantic conventions. It represents the
+// key(s) of message, another way to mark message besides message id.
+func MessagingRocketMQMessageKeys(val ...string) attribute.KeyValue {
+ return MessagingRocketMQMessageKeysKey.StringSlice(val)
+}
+
+// MessagingRocketMQMessageTag returns an attribute KeyValue conforming to the
+// "messaging.rocketmq.message.tag" semantic conventions. It represents the
+// secondary classifier of message besides topic.
+func MessagingRocketMQMessageTag(val string) attribute.KeyValue {
+ return MessagingRocketMQMessageTagKey.String(val)
+}
+
+// MessagingRocketMQNamespace returns an attribute KeyValue conforming to the
+// "messaging.rocketmq.namespace" semantic conventions. It represents the
+// namespace of RocketMQ resources, resources in different namespaces are
+// individual.
+func MessagingRocketMQNamespace(val string) attribute.KeyValue {
+ return MessagingRocketMQNamespaceKey.String(val)
+}
+
+// MessagingServiceBusMessageDeliveryCount returns an attribute KeyValue
+// conforming to the "messaging.servicebus.message.delivery_count" semantic
+// conventions. It represents the number of deliveries that have been attempted
+// for this message.
+func MessagingServiceBusMessageDeliveryCount(val int) attribute.KeyValue {
+ return MessagingServiceBusMessageDeliveryCountKey.Int(val)
+}
+
+// MessagingServiceBusMessageEnqueuedTime returns an attribute KeyValue
+// conforming to the "messaging.servicebus.message.enqueued_time" semantic
+// conventions. It represents the UTC epoch seconds at which the message has been
+// accepted and stored in the entity.
+func MessagingServiceBusMessageEnqueuedTime(val int) attribute.KeyValue {
+ return MessagingServiceBusMessageEnqueuedTimeKey.Int(val)
+}
+
+// Enum values for messaging.operation.type
+var (
+ // A message is created. "Create" spans always refer to a single message and are
+ // used to provide a unique creation context for messages in batch sending
+ // scenarios.
+ //
+ // Stability: development
+ MessagingOperationTypeCreate = MessagingOperationTypeKey.String("create")
+ // One or more messages are provided for sending to an intermediary. If a single
+ // message is sent, the context of the "Send" span can be used as the creation
+ // context and no "Create" span needs to be created.
+ //
+ // Stability: development
+ MessagingOperationTypeSend = MessagingOperationTypeKey.String("send")
+ // One or more messages are requested by a consumer. This operation refers to
+ // pull-based scenarios, where consumers explicitly call methods of messaging
+ // SDKs to receive messages.
+ //
+ // Stability: development
+ MessagingOperationTypeReceive = MessagingOperationTypeKey.String("receive")
+ // One or more messages are processed by a consumer.
+ //
+ // Stability: development
+ MessagingOperationTypeProcess = MessagingOperationTypeKey.String("process")
+ // One or more messages are settled.
+ //
+ // Stability: development
+ MessagingOperationTypeSettle = MessagingOperationTypeKey.String("settle")
+)
+
+// Enum values for messaging.rocketmq.consumption_model
+var (
+ // Clustering consumption model
+ // Stability: development
+ MessagingRocketMQConsumptionModelClustering = MessagingRocketMQConsumptionModelKey.String("clustering")
+ // Broadcasting consumption model
+ // Stability: development
+ MessagingRocketMQConsumptionModelBroadcasting = MessagingRocketMQConsumptionModelKey.String("broadcasting")
+)
+
+// Enum values for messaging.rocketmq.message.type
+var (
+ // Normal message
+ // Stability: development
+ MessagingRocketMQMessageTypeNormal = MessagingRocketMQMessageTypeKey.String("normal")
+ // FIFO message
+ // Stability: development
+ MessagingRocketMQMessageTypeFifo = MessagingRocketMQMessageTypeKey.String("fifo")
+ // Delay message
+ // Stability: development
+ MessagingRocketMQMessageTypeDelay = MessagingRocketMQMessageTypeKey.String("delay")
+ // Transaction message
+ // Stability: development
+ MessagingRocketMQMessageTypeTransaction = MessagingRocketMQMessageTypeKey.String("transaction")
+)
+
+// Enum values for messaging.servicebus.disposition_status
+var (
+ // Message is completed
+ // Stability: development
+ MessagingServiceBusDispositionStatusComplete = MessagingServiceBusDispositionStatusKey.String("complete")
+ // Message is abandoned
+ // Stability: development
+ MessagingServiceBusDispositionStatusAbandon = MessagingServiceBusDispositionStatusKey.String("abandon")
+ // Message is sent to dead letter queue
+ // Stability: development
+ MessagingServiceBusDispositionStatusDeadLetter = MessagingServiceBusDispositionStatusKey.String("dead_letter")
+ // Message is deferred
+ // Stability: development
+ MessagingServiceBusDispositionStatusDefer = MessagingServiceBusDispositionStatusKey.String("defer")
+)
+
+// Enum values for messaging.system
+var (
+ // Apache ActiveMQ
+ // Stability: development
+ MessagingSystemActiveMQ = MessagingSystemKey.String("activemq")
+ // Amazon Simple Notification Service (SNS)
+ // Stability: development
+ MessagingSystemAWSSNS = MessagingSystemKey.String("aws.sns")
+ // Amazon Simple Queue Service (SQS)
+ // Stability: development
+ MessagingSystemAWSSQS = MessagingSystemKey.String("aws_sqs")
+ // Azure Event Grid
+ // Stability: development
+ MessagingSystemEventGrid = MessagingSystemKey.String("eventgrid")
+ // Azure Event Hubs
+ // Stability: development
+ MessagingSystemEventHubs = MessagingSystemKey.String("eventhubs")
+ // Azure Service Bus
+ // Stability: development
+ MessagingSystemServiceBus = MessagingSystemKey.String("servicebus")
+ // Google Cloud Pub/Sub
+ // Stability: development
+ MessagingSystemGCPPubSub = MessagingSystemKey.String("gcp_pubsub")
+ // Java Message Service
+ // Stability: development
+ MessagingSystemJMS = MessagingSystemKey.String("jms")
+ // Apache Kafka
+ // Stability: development
+ MessagingSystemKafka = MessagingSystemKey.String("kafka")
+ // RabbitMQ
+ // Stability: development
+ MessagingSystemRabbitMQ = MessagingSystemKey.String("rabbitmq")
+ // Apache RocketMQ
+ // Stability: development
+ MessagingSystemRocketMQ = MessagingSystemKey.String("rocketmq")
+ // Apache Pulsar
+ // Stability: development
+ MessagingSystemPulsar = MessagingSystemKey.String("pulsar")
+)
+
+// Namespace: network
+const (
+ // NetworkCarrierICCKey is the attribute Key conforming to the
+ // "network.carrier.icc" semantic conventions. It represents the ISO 3166-1
+ // alpha-2 2-character country code associated with the mobile carrier network.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: DE
+ NetworkCarrierICCKey = attribute.Key("network.carrier.icc")
+
+ // NetworkCarrierMCCKey is the attribute Key conforming to the
+ // "network.carrier.mcc" semantic conventions. It represents the mobile carrier
+ // country code.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 310
+ NetworkCarrierMCCKey = attribute.Key("network.carrier.mcc")
+
+ // NetworkCarrierMNCKey is the attribute Key conforming to the
+ // "network.carrier.mnc" semantic conventions. It represents the mobile carrier
+ // network code.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 001
+ NetworkCarrierMNCKey = attribute.Key("network.carrier.mnc")
+
+ // NetworkCarrierNameKey is the attribute Key conforming to the
+ // "network.carrier.name" semantic conventions. It represents the name of the
+ // mobile carrier.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: sprint
+ NetworkCarrierNameKey = attribute.Key("network.carrier.name")
+
+ // NetworkConnectionStateKey is the attribute Key conforming to the
+ // "network.connection.state" semantic conventions. It represents the state of
+ // network connection.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "close_wait"
+ // Note: Connection states are defined as part of the [rfc9293]
+ //
+ // [rfc9293]: https://datatracker.ietf.org/doc/html/rfc9293#section-3.3.2
+ NetworkConnectionStateKey = attribute.Key("network.connection.state")
+
+ // NetworkConnectionSubtypeKey is the attribute Key conforming to the
+ // "network.connection.subtype" semantic conventions. It represents the this
+ // describes more details regarding the connection.type. It may be the type of
+ // cell technology connection, but it could be used for describing details about
+ // a wifi connection.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: LTE
+ NetworkConnectionSubtypeKey = attribute.Key("network.connection.subtype")
+
+ // NetworkConnectionTypeKey is the attribute Key conforming to the
+ // "network.connection.type" semantic conventions. It represents the internet
+ // connection type.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: wifi
+ NetworkConnectionTypeKey = attribute.Key("network.connection.type")
+
+ // NetworkInterfaceNameKey is the attribute Key conforming to the
+ // "network.interface.name" semantic conventions. It represents the network
+ // interface name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "lo", "eth0"
+ NetworkInterfaceNameKey = attribute.Key("network.interface.name")
+
+ // NetworkIODirectionKey is the attribute Key conforming to the
+ // "network.io.direction" semantic conventions. It represents the network IO
+ // operation direction.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "transmit"
+ NetworkIODirectionKey = attribute.Key("network.io.direction")
+
+ // NetworkLocalAddressKey is the attribute Key conforming to the
+ // "network.local.address" semantic conventions. It represents the local address
+ // of the network connection - IP address or Unix domain socket name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "10.1.2.80", "/tmp/my.sock"
+ NetworkLocalAddressKey = attribute.Key("network.local.address")
+
+ // NetworkLocalPortKey is the attribute Key conforming to the
+ // "network.local.port" semantic conventions. It represents the local port
+ // number of the network connection.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: 65123
+ NetworkLocalPortKey = attribute.Key("network.local.port")
+
+ // NetworkPeerAddressKey is the attribute Key conforming to the
+ // "network.peer.address" semantic conventions. It represents the peer address
+ // of the network connection - IP address or Unix domain socket name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "10.1.2.80", "/tmp/my.sock"
+ NetworkPeerAddressKey = attribute.Key("network.peer.address")
+
+ // NetworkPeerPortKey is the attribute Key conforming to the "network.peer.port"
+ // semantic conventions. It represents the peer port number of the network
+ // connection.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: 65123
+ NetworkPeerPortKey = attribute.Key("network.peer.port")
+
+ // NetworkProtocolNameKey is the attribute Key conforming to the
+ // "network.protocol.name" semantic conventions. It represents the
+ // [OSI application layer] or non-OSI equivalent.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "amqp", "http", "mqtt"
+ // Note: The value SHOULD be normalized to lowercase.
+ //
+ // [OSI application layer]: https://wikipedia.org/wiki/Application_layer
+ NetworkProtocolNameKey = attribute.Key("network.protocol.name")
+
+ // NetworkProtocolVersionKey is the attribute Key conforming to the
+ // "network.protocol.version" semantic conventions. It represents the actual
+ // version of the protocol used for network communication.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "1.1", "2"
+ // Note: If protocol version is subject to negotiation (for example using [ALPN]
+ // ), this attribute SHOULD be set to the negotiated version. If the actual
+ // protocol version is not known, this attribute SHOULD NOT be set.
+ //
+ // [ALPN]: https://www.rfc-editor.org/rfc/rfc7301.html
+ NetworkProtocolVersionKey = attribute.Key("network.protocol.version")
+
+ // NetworkTransportKey is the attribute Key conforming to the
+ // "network.transport" semantic conventions. It represents the
+ // [OSI transport layer] or [inter-process communication method].
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "tcp", "udp"
+ // Note: The value SHOULD be normalized to lowercase.
+ //
+ // Consider always setting the transport when setting a port number, since
+ // a port number is ambiguous without knowing the transport. For example
+ // different processes could be listening on TCP port 12345 and UDP port 12345.
+ //
+ // [OSI transport layer]: https://wikipedia.org/wiki/Transport_layer
+ // [inter-process communication method]: https://wikipedia.org/wiki/Inter-process_communication
+ NetworkTransportKey = attribute.Key("network.transport")
+
+ // NetworkTypeKey is the attribute Key conforming to the "network.type" semantic
+ // conventions. It represents the [OSI network layer] or non-OSI equivalent.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "ipv4", "ipv6"
+ // Note: The value SHOULD be normalized to lowercase.
+ //
+ // [OSI network layer]: https://wikipedia.org/wiki/Network_layer
+ NetworkTypeKey = attribute.Key("network.type")
+)
+
+// NetworkCarrierICC returns an attribute KeyValue conforming to the
+// "network.carrier.icc" semantic conventions. It represents the ISO 3166-1
+// alpha-2 2-character country code associated with the mobile carrier network.
+func NetworkCarrierICC(val string) attribute.KeyValue {
+ return NetworkCarrierICCKey.String(val)
+}
+
+// NetworkCarrierMCC returns an attribute KeyValue conforming to the
+// "network.carrier.mcc" semantic conventions. It represents the mobile carrier
+// country code.
+func NetworkCarrierMCC(val string) attribute.KeyValue {
+ return NetworkCarrierMCCKey.String(val)
+}
+
+// NetworkCarrierMNC returns an attribute KeyValue conforming to the
+// "network.carrier.mnc" semantic conventions. It represents the mobile carrier
+// network code.
+func NetworkCarrierMNC(val string) attribute.KeyValue {
+ return NetworkCarrierMNCKey.String(val)
+}
+
+// NetworkCarrierName returns an attribute KeyValue conforming to the
+// "network.carrier.name" semantic conventions. It represents the name of the
+// mobile carrier.
+func NetworkCarrierName(val string) attribute.KeyValue {
+ return NetworkCarrierNameKey.String(val)
+}
+
+// NetworkInterfaceName returns an attribute KeyValue conforming to the
+// "network.interface.name" semantic conventions. It represents the network
+// interface name.
+func NetworkInterfaceName(val string) attribute.KeyValue {
+ return NetworkInterfaceNameKey.String(val)
+}
+
+// NetworkLocalAddress returns an attribute KeyValue conforming to the
+// "network.local.address" semantic conventions. It represents the local address
+// of the network connection - IP address or Unix domain socket name.
+func NetworkLocalAddress(val string) attribute.KeyValue {
+ return NetworkLocalAddressKey.String(val)
+}
+
+// NetworkLocalPort returns an attribute KeyValue conforming to the
+// "network.local.port" semantic conventions. It represents the local port number
+// of the network connection.
+func NetworkLocalPort(val int) attribute.KeyValue {
+ return NetworkLocalPortKey.Int(val)
+}
+
+// NetworkPeerAddress returns an attribute KeyValue conforming to the
+// "network.peer.address" semantic conventions. It represents the peer address of
+// the network connection - IP address or Unix domain socket name.
+func NetworkPeerAddress(val string) attribute.KeyValue {
+ return NetworkPeerAddressKey.String(val)
+}
+
+// NetworkPeerPort returns an attribute KeyValue conforming to the
+// "network.peer.port" semantic conventions. It represents the peer port number
+// of the network connection.
+func NetworkPeerPort(val int) attribute.KeyValue {
+ return NetworkPeerPortKey.Int(val)
+}
+
+// NetworkProtocolName returns an attribute KeyValue conforming to the
+// "network.protocol.name" semantic conventions. It represents the
+// [OSI application layer] or non-OSI equivalent.
+//
+// [OSI application layer]: https://wikipedia.org/wiki/Application_layer
+func NetworkProtocolName(val string) attribute.KeyValue {
+ return NetworkProtocolNameKey.String(val)
+}
+
+// NetworkProtocolVersion returns an attribute KeyValue conforming to the
+// "network.protocol.version" semantic conventions. It represents the actual
+// version of the protocol used for network communication.
+func NetworkProtocolVersion(val string) attribute.KeyValue {
+ return NetworkProtocolVersionKey.String(val)
+}
+
+// Enum values for network.connection.state
+var (
+ // closed
+ // Stability: development
+ NetworkConnectionStateClosed = NetworkConnectionStateKey.String("closed")
+ // close_wait
+ // Stability: development
+ NetworkConnectionStateCloseWait = NetworkConnectionStateKey.String("close_wait")
+ // closing
+ // Stability: development
+ NetworkConnectionStateClosing = NetworkConnectionStateKey.String("closing")
+ // established
+ // Stability: development
+ NetworkConnectionStateEstablished = NetworkConnectionStateKey.String("established")
+ // fin_wait_1
+ // Stability: development
+ NetworkConnectionStateFinWait1 = NetworkConnectionStateKey.String("fin_wait_1")
+ // fin_wait_2
+ // Stability: development
+ NetworkConnectionStateFinWait2 = NetworkConnectionStateKey.String("fin_wait_2")
+ // last_ack
+ // Stability: development
+ NetworkConnectionStateLastAck = NetworkConnectionStateKey.String("last_ack")
+ // listen
+ // Stability: development
+ NetworkConnectionStateListen = NetworkConnectionStateKey.String("listen")
+ // syn_received
+ // Stability: development
+ NetworkConnectionStateSynReceived = NetworkConnectionStateKey.String("syn_received")
+ // syn_sent
+ // Stability: development
+ NetworkConnectionStateSynSent = NetworkConnectionStateKey.String("syn_sent")
+ // time_wait
+ // Stability: development
+ NetworkConnectionStateTimeWait = NetworkConnectionStateKey.String("time_wait")
+)
+
+// Enum values for network.connection.subtype
+var (
+ // GPRS
+ // Stability: development
+ NetworkConnectionSubtypeGprs = NetworkConnectionSubtypeKey.String("gprs")
+ // EDGE
+ // Stability: development
+ NetworkConnectionSubtypeEdge = NetworkConnectionSubtypeKey.String("edge")
+ // UMTS
+ // Stability: development
+ NetworkConnectionSubtypeUmts = NetworkConnectionSubtypeKey.String("umts")
+ // CDMA
+ // Stability: development
+ NetworkConnectionSubtypeCdma = NetworkConnectionSubtypeKey.String("cdma")
+ // EVDO Rel. 0
+ // Stability: development
+ NetworkConnectionSubtypeEvdo0 = NetworkConnectionSubtypeKey.String("evdo_0")
+ // EVDO Rev. A
+ // Stability: development
+ NetworkConnectionSubtypeEvdoA = NetworkConnectionSubtypeKey.String("evdo_a")
+ // CDMA2000 1XRTT
+ // Stability: development
+ NetworkConnectionSubtypeCdma20001xrtt = NetworkConnectionSubtypeKey.String("cdma2000_1xrtt")
+ // HSDPA
+ // Stability: development
+ NetworkConnectionSubtypeHsdpa = NetworkConnectionSubtypeKey.String("hsdpa")
+ // HSUPA
+ // Stability: development
+ NetworkConnectionSubtypeHsupa = NetworkConnectionSubtypeKey.String("hsupa")
+ // HSPA
+ // Stability: development
+ NetworkConnectionSubtypeHspa = NetworkConnectionSubtypeKey.String("hspa")
+ // IDEN
+ // Stability: development
+ NetworkConnectionSubtypeIden = NetworkConnectionSubtypeKey.String("iden")
+ // EVDO Rev. B
+ // Stability: development
+ NetworkConnectionSubtypeEvdoB = NetworkConnectionSubtypeKey.String("evdo_b")
+ // LTE
+ // Stability: development
+ NetworkConnectionSubtypeLte = NetworkConnectionSubtypeKey.String("lte")
+ // EHRPD
+ // Stability: development
+ NetworkConnectionSubtypeEhrpd = NetworkConnectionSubtypeKey.String("ehrpd")
+ // HSPAP
+ // Stability: development
+ NetworkConnectionSubtypeHspap = NetworkConnectionSubtypeKey.String("hspap")
+ // GSM
+ // Stability: development
+ NetworkConnectionSubtypeGsm = NetworkConnectionSubtypeKey.String("gsm")
+ // TD-SCDMA
+ // Stability: development
+ NetworkConnectionSubtypeTdScdma = NetworkConnectionSubtypeKey.String("td_scdma")
+ // IWLAN
+ // Stability: development
+ NetworkConnectionSubtypeIwlan = NetworkConnectionSubtypeKey.String("iwlan")
+ // 5G NR (New Radio)
+ // Stability: development
+ NetworkConnectionSubtypeNr = NetworkConnectionSubtypeKey.String("nr")
+ // 5G NRNSA (New Radio Non-Standalone)
+ // Stability: development
+ NetworkConnectionSubtypeNrnsa = NetworkConnectionSubtypeKey.String("nrnsa")
+ // LTE CA
+ // Stability: development
+ NetworkConnectionSubtypeLteCa = NetworkConnectionSubtypeKey.String("lte_ca")
+)
+
+// Enum values for network.connection.type
+var (
+ // wifi
+ // Stability: development
+ NetworkConnectionTypeWifi = NetworkConnectionTypeKey.String("wifi")
+ // wired
+ // Stability: development
+ NetworkConnectionTypeWired = NetworkConnectionTypeKey.String("wired")
+ // cell
+ // Stability: development
+ NetworkConnectionTypeCell = NetworkConnectionTypeKey.String("cell")
+ // unavailable
+ // Stability: development
+ NetworkConnectionTypeUnavailable = NetworkConnectionTypeKey.String("unavailable")
+ // unknown
+ // Stability: development
+ NetworkConnectionTypeUnknown = NetworkConnectionTypeKey.String("unknown")
+)
+
+// Enum values for network.io.direction
+var (
+ // transmit
+ // Stability: development
+ NetworkIODirectionTransmit = NetworkIODirectionKey.String("transmit")
+ // receive
+ // Stability: development
+ NetworkIODirectionReceive = NetworkIODirectionKey.String("receive")
+)
+
+// Enum values for network.transport
+var (
+ // TCP
+ // Stability: stable
+ NetworkTransportTCP = NetworkTransportKey.String("tcp")
+ // UDP
+ // Stability: stable
+ NetworkTransportUDP = NetworkTransportKey.String("udp")
+ // Named or anonymous pipe.
+ // Stability: stable
+ NetworkTransportPipe = NetworkTransportKey.String("pipe")
+ // Unix domain socket
+ // Stability: stable
+ NetworkTransportUnix = NetworkTransportKey.String("unix")
+ // QUIC
+ // Stability: stable
+ NetworkTransportQUIC = NetworkTransportKey.String("quic")
+)
+
+// Enum values for network.type
+var (
+ // IPv4
+ // Stability: stable
+ NetworkTypeIPv4 = NetworkTypeKey.String("ipv4")
+ // IPv6
+ // Stability: stable
+ NetworkTypeIPv6 = NetworkTypeKey.String("ipv6")
+)
+
+// Namespace: oci
+const (
+ // OCIManifestDigestKey is the attribute Key conforming to the
+ // "oci.manifest.digest" semantic conventions. It represents the digest of the
+ // OCI image manifest. For container images specifically is the digest by which
+ // the container image is known.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // "sha256:e4ca62c0d62f3e886e684806dfe9d4e0cda60d54986898173c1083856cfda0f4"
+ // Note: Follows [OCI Image Manifest Specification], and specifically the
+ // [Digest property].
+ // An example can be found in [Example Image Manifest].
+ //
+ // [OCI Image Manifest Specification]: https://github.com/opencontainers/image-spec/blob/main/manifest.md
+ // [Digest property]: https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests
+ // [Example Image Manifest]: https://github.com/opencontainers/image-spec/blob/main/manifest.md#example-image-manifest
+ OCIManifestDigestKey = attribute.Key("oci.manifest.digest")
+)
+
+// OCIManifestDigest returns an attribute KeyValue conforming to the
+// "oci.manifest.digest" semantic conventions. It represents the digest of the
+// OCI image manifest. For container images specifically is the digest by which
+// the container image is known.
+func OCIManifestDigest(val string) attribute.KeyValue {
+ return OCIManifestDigestKey.String(val)
+}
+
+// Namespace: openai
+const (
+ // OpenAIRequestServiceTierKey is the attribute Key conforming to the
+ // "openai.request.service_tier" semantic conventions. It represents the service
+ // tier requested. May be a specific tier, default, or auto.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "auto", "default"
+ OpenAIRequestServiceTierKey = attribute.Key("openai.request.service_tier")
+
+ // OpenAIResponseServiceTierKey is the attribute Key conforming to the
+ // "openai.response.service_tier" semantic conventions. It represents the
+ // service tier used for the response.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "scale", "default"
+ OpenAIResponseServiceTierKey = attribute.Key("openai.response.service_tier")
+
+ // OpenAIResponseSystemFingerprintKey is the attribute Key conforming to the
+ // "openai.response.system_fingerprint" semantic conventions. It represents a
+ // fingerprint to track any eventual change in the Generative AI environment.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "fp_44709d6fcb"
+ OpenAIResponseSystemFingerprintKey = attribute.Key("openai.response.system_fingerprint")
+)
+
+// OpenAIResponseServiceTier returns an attribute KeyValue conforming to the
+// "openai.response.service_tier" semantic conventions. It represents the service
+// tier used for the response.
+func OpenAIResponseServiceTier(val string) attribute.KeyValue {
+ return OpenAIResponseServiceTierKey.String(val)
+}
+
+// OpenAIResponseSystemFingerprint returns an attribute KeyValue conforming to
+// the "openai.response.system_fingerprint" semantic conventions. It represents a
+// fingerprint to track any eventual change in the Generative AI environment.
+func OpenAIResponseSystemFingerprint(val string) attribute.KeyValue {
+ return OpenAIResponseSystemFingerprintKey.String(val)
+}
+
+// Enum values for openai.request.service_tier
+var (
+ // The system will utilize scale tier credits until they are exhausted.
+ // Stability: development
+ OpenAIRequestServiceTierAuto = OpenAIRequestServiceTierKey.String("auto")
+ // The system will utilize the default scale tier.
+ // Stability: development
+ OpenAIRequestServiceTierDefault = OpenAIRequestServiceTierKey.String("default")
+)
+
+// Namespace: opentracing
+const (
+ // OpenTracingRefTypeKey is the attribute Key conforming to the
+ // "opentracing.ref_type" semantic conventions. It represents the parent-child
+ // Reference type.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // Note: The causal relationship between a child Span and a parent Span.
+ OpenTracingRefTypeKey = attribute.Key("opentracing.ref_type")
+)
+
+// Enum values for opentracing.ref_type
+var (
+ // The parent Span depends on the child Span in some capacity
+ // Stability: development
+ OpenTracingRefTypeChildOf = OpenTracingRefTypeKey.String("child_of")
+ // The parent Span doesn't depend in any way on the result of the child Span
+ // Stability: development
+ OpenTracingRefTypeFollowsFrom = OpenTracingRefTypeKey.String("follows_from")
+)
+
+// Namespace: os
+const (
+ // OSBuildIDKey is the attribute Key conforming to the "os.build_id" semantic
+ // conventions. It represents the unique identifier for a particular build or
+ // compilation of the operating system.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "TQ3C.230805.001.B2", "20E247", "22621"
+ OSBuildIDKey = attribute.Key("os.build_id")
+
+ // OSDescriptionKey is the attribute Key conforming to the "os.description"
+ // semantic conventions. It represents the human readable (not intended to be
+ // parsed) OS version information, like e.g. reported by `ver` or
+ // `lsb_release -a` commands.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Microsoft Windows [Version 10.0.18363.778]", "Ubuntu 18.04.1 LTS"
+ OSDescriptionKey = attribute.Key("os.description")
+
+ // OSNameKey is the attribute Key conforming to the "os.name" semantic
+ // conventions. It represents the human readable operating system name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "iOS", "Android", "Ubuntu"
+ OSNameKey = attribute.Key("os.name")
+
+ // OSTypeKey is the attribute Key conforming to the "os.type" semantic
+ // conventions. It represents the operating system type.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ OSTypeKey = attribute.Key("os.type")
+
+ // OSVersionKey is the attribute Key conforming to the "os.version" semantic
+ // conventions. It represents the version string of the operating system as
+ // defined in [Version Attributes].
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "14.2.1", "18.04.1"
+ //
+ // [Version Attributes]: /docs/resource/README.md#version-attributes
+ OSVersionKey = attribute.Key("os.version")
+)
+
+// OSBuildID returns an attribute KeyValue conforming to the "os.build_id"
+// semantic conventions. It represents the unique identifier for a particular
+// build or compilation of the operating system.
+func OSBuildID(val string) attribute.KeyValue {
+ return OSBuildIDKey.String(val)
+}
+
+// OSDescription returns an attribute KeyValue conforming to the "os.description"
+// semantic conventions. It represents the human readable (not intended to be
+// parsed) OS version information, like e.g. reported by `ver` or
+// `lsb_release -a` commands.
+func OSDescription(val string) attribute.KeyValue {
+ return OSDescriptionKey.String(val)
+}
+
+// OSName returns an attribute KeyValue conforming to the "os.name" semantic
+// conventions. It represents the human readable operating system name.
+func OSName(val string) attribute.KeyValue {
+ return OSNameKey.String(val)
+}
+
+// OSVersion returns an attribute KeyValue conforming to the "os.version"
+// semantic conventions. It represents the version string of the operating system
+// as defined in [Version Attributes].
+//
+// [Version Attributes]: /docs/resource/README.md#version-attributes
+func OSVersion(val string) attribute.KeyValue {
+ return OSVersionKey.String(val)
+}
+
+// Enum values for os.type
+var (
+ // Microsoft Windows
+ // Stability: development
+ OSTypeWindows = OSTypeKey.String("windows")
+ // Linux
+ // Stability: development
+ OSTypeLinux = OSTypeKey.String("linux")
+ // Apple Darwin
+ // Stability: development
+ OSTypeDarwin = OSTypeKey.String("darwin")
+ // FreeBSD
+ // Stability: development
+ OSTypeFreeBSD = OSTypeKey.String("freebsd")
+ // NetBSD
+ // Stability: development
+ OSTypeNetBSD = OSTypeKey.String("netbsd")
+ // OpenBSD
+ // Stability: development
+ OSTypeOpenBSD = OSTypeKey.String("openbsd")
+ // DragonFly BSD
+ // Stability: development
+ OSTypeDragonflyBSD = OSTypeKey.String("dragonflybsd")
+ // HP-UX (Hewlett Packard Unix)
+ // Stability: development
+ OSTypeHPUX = OSTypeKey.String("hpux")
+ // AIX (Advanced Interactive eXecutive)
+ // Stability: development
+ OSTypeAIX = OSTypeKey.String("aix")
+ // SunOS, Oracle Solaris
+ // Stability: development
+ OSTypeSolaris = OSTypeKey.String("solaris")
+ // IBM z/OS
+ // Stability: development
+ OSTypeZOS = OSTypeKey.String("zos")
+)
+
+// Namespace: otel
+const (
+ // OTelComponentNameKey is the attribute Key conforming to the
+ // "otel.component.name" semantic conventions. It represents a name uniquely
+ // identifying the instance of the OpenTelemetry component within its containing
+ // SDK instance.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "otlp_grpc_span_exporter/0", "custom-name"
+ // Note: Implementations SHOULD ensure a low cardinality for this attribute,
+ // even across application or SDK restarts.
+ // E.g. implementations MUST NOT use UUIDs as values for this attribute.
+ //
+ // Implementations MAY achieve these goals by following a
+ // `/` pattern, e.g.
+ // `batching_span_processor/0`.
+ // Hereby `otel.component.type` refers to the corresponding attribute value of
+ // the component.
+ //
+ // The value of `instance-counter` MAY be automatically assigned by the
+ // component and uniqueness within the enclosing SDK instance MUST be
+ // guaranteed.
+ // For example, `` MAY be implemented by using a monotonically
+ // increasing counter (starting with `0`), which is incremented every time an
+ // instance of the given component type is started.
+ //
+ // With this implementation, for example the first Batching Span Processor would
+ // have `batching_span_processor/0`
+ // as `otel.component.name`, the second one `batching_span_processor/1` and so
+ // on.
+ // These values will therefore be reused in the case of an application restart.
+ OTelComponentNameKey = attribute.Key("otel.component.name")
+
+ // OTelComponentTypeKey is the attribute Key conforming to the
+ // "otel.component.type" semantic conventions. It represents a name identifying
+ // the type of the OpenTelemetry component.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "batching_span_processor", "com.example.MySpanExporter"
+ // Note: If none of the standardized values apply, implementations SHOULD use
+ // the language-defined name of the type.
+ // E.g. for Java the fully qualified classname SHOULD be used in this case.
+ OTelComponentTypeKey = attribute.Key("otel.component.type")
+
+ // OTelScopeNameKey is the attribute Key conforming to the "otel.scope.name"
+ // semantic conventions. It represents the name of the instrumentation scope - (
+ // `InstrumentationScope.Name` in OTLP).
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "io.opentelemetry.contrib.mongodb"
+ OTelScopeNameKey = attribute.Key("otel.scope.name")
+
+ // OTelScopeSchemaURLKey is the attribute Key conforming to the
+ // "otel.scope.schema_url" semantic conventions. It represents the schema URL of
+ // the instrumentation scope.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "https://opentelemetry.io/schemas/1.31.0"
+ OTelScopeSchemaURLKey = attribute.Key("otel.scope.schema_url")
+
+ // OTelScopeVersionKey is the attribute Key conforming to the
+ // "otel.scope.version" semantic conventions. It represents the version of the
+ // instrumentation scope - (`InstrumentationScope.Version` in OTLP).
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "1.0.0"
+ OTelScopeVersionKey = attribute.Key("otel.scope.version")
+
+ // OTelSpanParentOriginKey is the attribute Key conforming to the
+ // "otel.span.parent.origin" semantic conventions. It represents the determines
+ // whether the span has a parent span, and if so,
+ // [whether it is a remote parent].
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ //
+ // [whether it is a remote parent]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote
+ OTelSpanParentOriginKey = attribute.Key("otel.span.parent.origin")
+
+ // OTelSpanSamplingResultKey is the attribute Key conforming to the
+ // "otel.span.sampling_result" semantic conventions. It represents the result
+ // value of the sampler for this span.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ OTelSpanSamplingResultKey = attribute.Key("otel.span.sampling_result")
+
+ // OTelStatusCodeKey is the attribute Key conforming to the "otel.status_code"
+ // semantic conventions. It represents the name of the code, either "OK" or
+ // "ERROR". MUST NOT be set if the status code is UNSET.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples:
+ OTelStatusCodeKey = attribute.Key("otel.status_code")
+
+ // OTelStatusDescriptionKey is the attribute Key conforming to the
+ // "otel.status_description" semantic conventions. It represents the description
+ // of the Status if it has a value, otherwise not set.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "resource not found"
+ OTelStatusDescriptionKey = attribute.Key("otel.status_description")
+)
+
+// OTelComponentName returns an attribute KeyValue conforming to the
+// "otel.component.name" semantic conventions. It represents a name uniquely
+// identifying the instance of the OpenTelemetry component within its containing
+// SDK instance.
+func OTelComponentName(val string) attribute.KeyValue {
+ return OTelComponentNameKey.String(val)
+}
+
+// OTelScopeName returns an attribute KeyValue conforming to the
+// "otel.scope.name" semantic conventions. It represents the name of the
+// instrumentation scope - (`InstrumentationScope.Name` in OTLP).
+func OTelScopeName(val string) attribute.KeyValue {
+ return OTelScopeNameKey.String(val)
+}
+
+// OTelScopeSchemaURL returns an attribute KeyValue conforming to the
+// "otel.scope.schema_url" semantic conventions. It represents the schema URL of
+// the instrumentation scope.
+func OTelScopeSchemaURL(val string) attribute.KeyValue {
+ return OTelScopeSchemaURLKey.String(val)
+}
+
+// OTelScopeVersion returns an attribute KeyValue conforming to the
+// "otel.scope.version" semantic conventions. It represents the version of the
+// instrumentation scope - (`InstrumentationScope.Version` in OTLP).
+func OTelScopeVersion(val string) attribute.KeyValue {
+ return OTelScopeVersionKey.String(val)
+}
+
+// OTelStatusDescription returns an attribute KeyValue conforming to the
+// "otel.status_description" semantic conventions. It represents the description
+// of the Status if it has a value, otherwise not set.
+func OTelStatusDescription(val string) attribute.KeyValue {
+ return OTelStatusDescriptionKey.String(val)
+}
+
+// Enum values for otel.component.type
+var (
+ // The builtin SDK batching span processor
+ //
+ // Stability: development
+ OTelComponentTypeBatchingSpanProcessor = OTelComponentTypeKey.String("batching_span_processor")
+ // The builtin SDK simple span processor
+ //
+ // Stability: development
+ OTelComponentTypeSimpleSpanProcessor = OTelComponentTypeKey.String("simple_span_processor")
+ // The builtin SDK batching log record processor
+ //
+ // Stability: development
+ OTelComponentTypeBatchingLogProcessor = OTelComponentTypeKey.String("batching_log_processor")
+ // The builtin SDK simple log record processor
+ //
+ // Stability: development
+ OTelComponentTypeSimpleLogProcessor = OTelComponentTypeKey.String("simple_log_processor")
+ // OTLP span exporter over gRPC with protobuf serialization
+ //
+ // Stability: development
+ OTelComponentTypeOtlpGRPCSpanExporter = OTelComponentTypeKey.String("otlp_grpc_span_exporter")
+ // OTLP span exporter over HTTP with protobuf serialization
+ //
+ // Stability: development
+ OTelComponentTypeOtlpHTTPSpanExporter = OTelComponentTypeKey.String("otlp_http_span_exporter")
+ // OTLP span exporter over HTTP with JSON serialization
+ //
+ // Stability: development
+ OTelComponentTypeOtlpHTTPJSONSpanExporter = OTelComponentTypeKey.String("otlp_http_json_span_exporter")
+ // Zipkin span exporter over HTTP
+ //
+ // Stability: development
+ OTelComponentTypeZipkinHTTPSpanExporter = OTelComponentTypeKey.String("zipkin_http_span_exporter")
+ // OTLP log record exporter over gRPC with protobuf serialization
+ //
+ // Stability: development
+ OTelComponentTypeOtlpGRPCLogExporter = OTelComponentTypeKey.String("otlp_grpc_log_exporter")
+ // OTLP log record exporter over HTTP with protobuf serialization
+ //
+ // Stability: development
+ OTelComponentTypeOtlpHTTPLogExporter = OTelComponentTypeKey.String("otlp_http_log_exporter")
+ // OTLP log record exporter over HTTP with JSON serialization
+ //
+ // Stability: development
+ OTelComponentTypeOtlpHTTPJSONLogExporter = OTelComponentTypeKey.String("otlp_http_json_log_exporter")
+ // The builtin SDK periodically exporting metric reader
+ //
+ // Stability: development
+ OTelComponentTypePeriodicMetricReader = OTelComponentTypeKey.String("periodic_metric_reader")
+ // OTLP metric exporter over gRPC with protobuf serialization
+ //
+ // Stability: development
+ OTelComponentTypeOtlpGRPCMetricExporter = OTelComponentTypeKey.String("otlp_grpc_metric_exporter")
+ // OTLP metric exporter over HTTP with protobuf serialization
+ //
+ // Stability: development
+ OTelComponentTypeOtlpHTTPMetricExporter = OTelComponentTypeKey.String("otlp_http_metric_exporter")
+ // OTLP metric exporter over HTTP with JSON serialization
+ //
+ // Stability: development
+ OTelComponentTypeOtlpHTTPJSONMetricExporter = OTelComponentTypeKey.String("otlp_http_json_metric_exporter")
+ // Prometheus metric exporter over HTTP with the default text-based format
+ //
+ // Stability: development
+ OTelComponentTypePrometheusHTTPTextMetricExporter = OTelComponentTypeKey.String("prometheus_http_text_metric_exporter")
+)
+
+// Enum values for otel.span.parent.origin
+var (
+ // The span does not have a parent, it is a root span
+ // Stability: development
+ OTelSpanParentOriginNone = OTelSpanParentOriginKey.String("none")
+ // The span has a parent and the parent's span context [isRemote()] is false
+ // Stability: development
+ //
+ // [isRemote()]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote
+ OTelSpanParentOriginLocal = OTelSpanParentOriginKey.String("local")
+ // The span has a parent and the parent's span context [isRemote()] is true
+ // Stability: development
+ //
+ // [isRemote()]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote
+ OTelSpanParentOriginRemote = OTelSpanParentOriginKey.String("remote")
+)
+
+// Enum values for otel.span.sampling_result
+var (
+ // The span is not sampled and not recording
+ // Stability: development
+ OTelSpanSamplingResultDrop = OTelSpanSamplingResultKey.String("DROP")
+ // The span is not sampled, but recording
+ // Stability: development
+ OTelSpanSamplingResultRecordOnly = OTelSpanSamplingResultKey.String("RECORD_ONLY")
+ // The span is sampled and recording
+ // Stability: development
+ OTelSpanSamplingResultRecordAndSample = OTelSpanSamplingResultKey.String("RECORD_AND_SAMPLE")
+)
+
+// Enum values for otel.status_code
+var (
+ // The operation has been validated by an Application developer or Operator to
+ // have completed successfully.
+ // Stability: stable
+ OTelStatusCodeOk = OTelStatusCodeKey.String("OK")
+ // The operation contains an error.
+ // Stability: stable
+ OTelStatusCodeError = OTelStatusCodeKey.String("ERROR")
+)
+
+// Namespace: peer
+const (
+ // PeerServiceKey is the attribute Key conforming to the "peer.service" semantic
+ // conventions. It represents the [`service.name`] of the remote service. SHOULD
+ // be equal to the actual `service.name` resource attribute of the remote
+ // service if any.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: AuthTokenCache
+ //
+ // [`service.name`]: /docs/resource/README.md#service
+ PeerServiceKey = attribute.Key("peer.service")
+)
+
+// PeerService returns an attribute KeyValue conforming to the "peer.service"
+// semantic conventions. It represents the [`service.name`] of the remote
+// service. SHOULD be equal to the actual `service.name` resource attribute of
+// the remote service if any.
+//
+// [`service.name`]: /docs/resource/README.md#service
+func PeerService(val string) attribute.KeyValue {
+ return PeerServiceKey.String(val)
+}
+
+// Namespace: process
+const (
+ // ProcessArgsCountKey is the attribute Key conforming to the
+ // "process.args_count" semantic conventions. It represents the length of the
+ // process.command_args array.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 4
+ // Note: This field can be useful for querying or performing bucket analysis on
+ // how many arguments were provided to start a process. More arguments may be an
+ // indication of suspicious activity.
+ ProcessArgsCountKey = attribute.Key("process.args_count")
+
+ // ProcessCommandKey is the attribute Key conforming to the "process.command"
+ // semantic conventions. It represents the command used to launch the process
+ // (i.e. the command name). On Linux based systems, can be set to the zeroth
+ // string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter
+ // extracted from `GetCommandLineW`.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "cmd/otelcol"
+ ProcessCommandKey = attribute.Key("process.command")
+
+ // ProcessCommandArgsKey is the attribute Key conforming to the
+ // "process.command_args" semantic conventions. It represents the all the
+ // command arguments (including the command/executable itself) as received by
+ // the process. On Linux-based systems (and some other Unixoid systems
+ // supporting procfs), can be set according to the list of null-delimited
+ // strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this
+ // would be the full argv vector passed to `main`. SHOULD NOT be collected by
+ // default unless there is sanitization that excludes sensitive data.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "cmd/otecol", "--config=config.yaml"
+ ProcessCommandArgsKey = attribute.Key("process.command_args")
+
+ // ProcessCommandLineKey is the attribute Key conforming to the
+ // "process.command_line" semantic conventions. It represents the full command
+ // used to launch the process as a single string representing the full command.
+ // On Windows, can be set to the result of `GetCommandLineW`. Do not set this if
+ // you have to assemble it just for monitoring; use `process.command_args`
+ // instead. SHOULD NOT be collected by default unless there is sanitization that
+ // excludes sensitive data.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "C:\cmd\otecol --config="my directory\config.yaml""
+ ProcessCommandLineKey = attribute.Key("process.command_line")
+
+ // ProcessContextSwitchTypeKey is the attribute Key conforming to the
+ // "process.context_switch_type" semantic conventions. It represents the
+ // specifies whether the context switches for this data point were voluntary or
+ // involuntary.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ ProcessContextSwitchTypeKey = attribute.Key("process.context_switch_type")
+
+ // ProcessCreationTimeKey is the attribute Key conforming to the
+ // "process.creation.time" semantic conventions. It represents the date and time
+ // the process was created, in ISO 8601 format.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "2023-11-21T09:25:34.853Z"
+ ProcessCreationTimeKey = attribute.Key("process.creation.time")
+
+ // ProcessExecutableBuildIDGNUKey is the attribute Key conforming to the
+ // "process.executable.build_id.gnu" semantic conventions. It represents the GNU
+ // build ID as found in the `.note.gnu.build-id` ELF section (hex string).
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "c89b11207f6479603b0d49bf291c092c2b719293"
+ ProcessExecutableBuildIDGNUKey = attribute.Key("process.executable.build_id.gnu")
+
+ // ProcessExecutableBuildIDGoKey is the attribute Key conforming to the
+ // "process.executable.build_id.go" semantic conventions. It represents the Go
+ // build ID as retrieved by `go tool buildid `.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // "foh3mEXu7BLZjsN9pOwG/kATcXlYVCDEFouRMQed_/WwRFB1hPo9LBkekthSPG/x8hMC8emW2cCjXD0_1aY"
+ ProcessExecutableBuildIDGoKey = attribute.Key("process.executable.build_id.go")
+
+ // ProcessExecutableBuildIDHtlhashKey is the attribute Key conforming to the
+ // "process.executable.build_id.htlhash" semantic conventions. It represents the
+ // profiling specific build ID for executables. See the OTel specification for
+ // Profiles for more information.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "600DCAFE4A110000F2BF38C493F5FB92"
+ ProcessExecutableBuildIDHtlhashKey = attribute.Key("process.executable.build_id.htlhash")
+
+ // ProcessExecutableNameKey is the attribute Key conforming to the
+ // "process.executable.name" semantic conventions. It represents the name of the
+ // process executable. On Linux based systems, this SHOULD be set to the base
+ // name of the target of `/proc/[pid]/exe`. On Windows, this SHOULD be set to
+ // the base name of `GetProcessImageFileNameW`.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "otelcol"
+ ProcessExecutableNameKey = attribute.Key("process.executable.name")
+
+ // ProcessExecutablePathKey is the attribute Key conforming to the
+ // "process.executable.path" semantic conventions. It represents the full path
+ // to the process executable. On Linux based systems, can be set to the target
+ // of `proc/[pid]/exe`. On Windows, can be set to the result of
+ // `GetProcessImageFileNameW`.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "/usr/bin/cmd/otelcol"
+ ProcessExecutablePathKey = attribute.Key("process.executable.path")
+
+ // ProcessExitCodeKey is the attribute Key conforming to the "process.exit.code"
+ // semantic conventions. It represents the exit code of the process.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 127
+ ProcessExitCodeKey = attribute.Key("process.exit.code")
+
+ // ProcessExitTimeKey is the attribute Key conforming to the "process.exit.time"
+ // semantic conventions. It represents the date and time the process exited, in
+ // ISO 8601 format.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "2023-11-21T09:26:12.315Z"
+ ProcessExitTimeKey = attribute.Key("process.exit.time")
+
+ // ProcessGroupLeaderPIDKey is the attribute Key conforming to the
+ // "process.group_leader.pid" semantic conventions. It represents the PID of the
+ // process's group leader. This is also the process group ID (PGID) of the
+ // process.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 23
+ ProcessGroupLeaderPIDKey = attribute.Key("process.group_leader.pid")
+
+ // ProcessInteractiveKey is the attribute Key conforming to the
+ // "process.interactive" semantic conventions. It represents the whether the
+ // process is connected to an interactive shell.
+ //
+ // Type: boolean
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ ProcessInteractiveKey = attribute.Key("process.interactive")
+
+ // ProcessLinuxCgroupKey is the attribute Key conforming to the
+ // "process.linux.cgroup" semantic conventions. It represents the control group
+ // associated with the process.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "1:name=systemd:/user.slice/user-1000.slice/session-3.scope",
+ // "0::/user.slice/user-1000.slice/user@1000.service/tmux-spawn-0267755b-4639-4a27-90ed-f19f88e53748.scope"
+ // Note: Control groups (cgroups) are a kernel feature used to organize and
+ // manage process resources. This attribute provides the path(s) to the
+ // cgroup(s) associated with the process, which should match the contents of the
+ // [/proc/[PID]/cgroup] file.
+ //
+ // [/proc/[PID]/cgroup]: https://man7.org/linux/man-pages/man7/cgroups.7.html
+ ProcessLinuxCgroupKey = attribute.Key("process.linux.cgroup")
+
+ // ProcessOwnerKey is the attribute Key conforming to the "process.owner"
+ // semantic conventions. It represents the username of the user that owns the
+ // process.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "root"
+ ProcessOwnerKey = attribute.Key("process.owner")
+
+ // ProcessPagingFaultTypeKey is the attribute Key conforming to the
+ // "process.paging.fault_type" semantic conventions. It represents the type of
+ // page fault for this data point. Type `major` is for major/hard page faults,
+ // and `minor` is for minor/soft page faults.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ ProcessPagingFaultTypeKey = attribute.Key("process.paging.fault_type")
+
+ // ProcessParentPIDKey is the attribute Key conforming to the
+ // "process.parent_pid" semantic conventions. It represents the parent Process
+ // identifier (PPID).
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 111
+ ProcessParentPIDKey = attribute.Key("process.parent_pid")
+
+ // ProcessPIDKey is the attribute Key conforming to the "process.pid" semantic
+ // conventions. It represents the process identifier (PID).
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 1234
+ ProcessPIDKey = attribute.Key("process.pid")
+
+ // ProcessRealUserIDKey is the attribute Key conforming to the
+ // "process.real_user.id" semantic conventions. It represents the real user ID
+ // (RUID) of the process.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 1000
+ ProcessRealUserIDKey = attribute.Key("process.real_user.id")
+
+ // ProcessRealUserNameKey is the attribute Key conforming to the
+ // "process.real_user.name" semantic conventions. It represents the username of
+ // the real user of the process.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "operator"
+ ProcessRealUserNameKey = attribute.Key("process.real_user.name")
+
+ // ProcessRuntimeDescriptionKey is the attribute Key conforming to the
+ // "process.runtime.description" semantic conventions. It represents an
+ // additional description about the runtime of the process, for example a
+ // specific vendor customization of the runtime environment.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0
+ ProcessRuntimeDescriptionKey = attribute.Key("process.runtime.description")
+
+ // ProcessRuntimeNameKey is the attribute Key conforming to the
+ // "process.runtime.name" semantic conventions. It represents the name of the
+ // runtime of this process.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "OpenJDK Runtime Environment"
+ ProcessRuntimeNameKey = attribute.Key("process.runtime.name")
+
+ // ProcessRuntimeVersionKey is the attribute Key conforming to the
+ // "process.runtime.version" semantic conventions. It represents the version of
+ // the runtime of this process, as returned by the runtime without modification.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 14.0.2
+ ProcessRuntimeVersionKey = attribute.Key("process.runtime.version")
+
+ // ProcessSavedUserIDKey is the attribute Key conforming to the
+ // "process.saved_user.id" semantic conventions. It represents the saved user ID
+ // (SUID) of the process.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 1002
+ ProcessSavedUserIDKey = attribute.Key("process.saved_user.id")
+
+ // ProcessSavedUserNameKey is the attribute Key conforming to the
+ // "process.saved_user.name" semantic conventions. It represents the username of
+ // the saved user.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "operator"
+ ProcessSavedUserNameKey = attribute.Key("process.saved_user.name")
+
+ // ProcessSessionLeaderPIDKey is the attribute Key conforming to the
+ // "process.session_leader.pid" semantic conventions. It represents the PID of
+ // the process's session leader. This is also the session ID (SID) of the
+ // process.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 14
+ ProcessSessionLeaderPIDKey = attribute.Key("process.session_leader.pid")
+
+ // ProcessTitleKey is the attribute Key conforming to the "process.title"
+ // semantic conventions. It represents the process title (proctitle).
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "cat /etc/hostname", "xfce4-session", "bash"
+ // Note: In many Unix-like systems, process title (proctitle), is the string
+ // that represents the name or command line of a running process, displayed by
+ // system monitoring tools like ps, top, and htop.
+ ProcessTitleKey = attribute.Key("process.title")
+
+ // ProcessUserIDKey is the attribute Key conforming to the "process.user.id"
+ // semantic conventions. It represents the effective user ID (EUID) of the
+ // process.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 1001
+ ProcessUserIDKey = attribute.Key("process.user.id")
+
+ // ProcessUserNameKey is the attribute Key conforming to the "process.user.name"
+ // semantic conventions. It represents the username of the effective user of the
+ // process.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "root"
+ ProcessUserNameKey = attribute.Key("process.user.name")
+
+ // ProcessVpidKey is the attribute Key conforming to the "process.vpid" semantic
+ // conventions. It represents the virtual process identifier.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 12
+ // Note: The process ID within a PID namespace. This is not necessarily unique
+ // across all processes on the host but it is unique within the process
+ // namespace that the process exists within.
+ ProcessVpidKey = attribute.Key("process.vpid")
+
+ // ProcessWorkingDirectoryKey is the attribute Key conforming to the
+ // "process.working_directory" semantic conventions. It represents the working
+ // directory of the process.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "/root"
+ ProcessWorkingDirectoryKey = attribute.Key("process.working_directory")
+)
+
+// ProcessArgsCount returns an attribute KeyValue conforming to the
+// "process.args_count" semantic conventions. It represents the length of the
+// process.command_args array.
+func ProcessArgsCount(val int) attribute.KeyValue {
+ return ProcessArgsCountKey.Int(val)
+}
+
+// ProcessCommand returns an attribute KeyValue conforming to the
+// "process.command" semantic conventions. It represents the command used to
+// launch the process (i.e. the command name). On Linux based systems, can be set
+// to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the
+// first parameter extracted from `GetCommandLineW`.
+func ProcessCommand(val string) attribute.KeyValue {
+ return ProcessCommandKey.String(val)
+}
+
+// ProcessCommandArgs returns an attribute KeyValue conforming to the
+// "process.command_args" semantic conventions. It represents the all the command
+// arguments (including the command/executable itself) as received by the
+// process. On Linux-based systems (and some other Unixoid systems supporting
+// procfs), can be set according to the list of null-delimited strings extracted
+// from `proc/[pid]/cmdline`. For libc-based executables, this would be the full
+// argv vector passed to `main`. SHOULD NOT be collected by default unless there
+// is sanitization that excludes sensitive data.
+func ProcessCommandArgs(val ...string) attribute.KeyValue {
+ return ProcessCommandArgsKey.StringSlice(val)
+}
+
+// ProcessCommandLine returns an attribute KeyValue conforming to the
+// "process.command_line" semantic conventions. It represents the full command
+// used to launch the process as a single string representing the full command.
+// On Windows, can be set to the result of `GetCommandLineW`. Do not set this if
+// you have to assemble it just for monitoring; use `process.command_args`
+// instead. SHOULD NOT be collected by default unless there is sanitization that
+// excludes sensitive data.
+func ProcessCommandLine(val string) attribute.KeyValue {
+ return ProcessCommandLineKey.String(val)
+}
+
+// ProcessCreationTime returns an attribute KeyValue conforming to the
+// "process.creation.time" semantic conventions. It represents the date and time
+// the process was created, in ISO 8601 format.
+func ProcessCreationTime(val string) attribute.KeyValue {
+ return ProcessCreationTimeKey.String(val)
+}
+
+// ProcessEnvironmentVariable returns an attribute KeyValue conforming to the
+// "process.environment_variable" semantic conventions. It represents the process
+// environment variables, `` being the environment variable name, the value
+// being the environment variable value.
+func ProcessEnvironmentVariable(key string, val string) attribute.KeyValue {
+ return attribute.String("process.environment_variable."+key, val)
+}
+
+// ProcessExecutableBuildIDGNU returns an attribute KeyValue conforming to the
+// "process.executable.build_id.gnu" semantic conventions. It represents the GNU
+// build ID as found in the `.note.gnu.build-id` ELF section (hex string).
+func ProcessExecutableBuildIDGNU(val string) attribute.KeyValue {
+ return ProcessExecutableBuildIDGNUKey.String(val)
+}
+
+// ProcessExecutableBuildIDGo returns an attribute KeyValue conforming to the
+// "process.executable.build_id.go" semantic conventions. It represents the Go
+// build ID as retrieved by `go tool buildid `.
+func ProcessExecutableBuildIDGo(val string) attribute.KeyValue {
+ return ProcessExecutableBuildIDGoKey.String(val)
+}
+
+// ProcessExecutableBuildIDHtlhash returns an attribute KeyValue conforming to
+// the "process.executable.build_id.htlhash" semantic conventions. It represents
+// the profiling specific build ID for executables. See the OTel specification
+// for Profiles for more information.
+func ProcessExecutableBuildIDHtlhash(val string) attribute.KeyValue {
+ return ProcessExecutableBuildIDHtlhashKey.String(val)
+}
+
+// ProcessExecutableName returns an attribute KeyValue conforming to the
+// "process.executable.name" semantic conventions. It represents the name of the
+// process executable. On Linux based systems, this SHOULD be set to the base
+// name of the target of `/proc/[pid]/exe`. On Windows, this SHOULD be set to the
+// base name of `GetProcessImageFileNameW`.
+func ProcessExecutableName(val string) attribute.KeyValue {
+ return ProcessExecutableNameKey.String(val)
+}
+
+// ProcessExecutablePath returns an attribute KeyValue conforming to the
+// "process.executable.path" semantic conventions. It represents the full path to
+// the process executable. On Linux based systems, can be set to the target of
+// `proc/[pid]/exe`. On Windows, can be set to the result of
+// `GetProcessImageFileNameW`.
+func ProcessExecutablePath(val string) attribute.KeyValue {
+ return ProcessExecutablePathKey.String(val)
+}
+
+// ProcessExitCode returns an attribute KeyValue conforming to the
+// "process.exit.code" semantic conventions. It represents the exit code of the
+// process.
+func ProcessExitCode(val int) attribute.KeyValue {
+ return ProcessExitCodeKey.Int(val)
+}
+
+// ProcessExitTime returns an attribute KeyValue conforming to the
+// "process.exit.time" semantic conventions. It represents the date and time the
+// process exited, in ISO 8601 format.
+func ProcessExitTime(val string) attribute.KeyValue {
+ return ProcessExitTimeKey.String(val)
+}
+
+// ProcessGroupLeaderPID returns an attribute KeyValue conforming to the
+// "process.group_leader.pid" semantic conventions. It represents the PID of the
+// process's group leader. This is also the process group ID (PGID) of the
+// process.
+func ProcessGroupLeaderPID(val int) attribute.KeyValue {
+ return ProcessGroupLeaderPIDKey.Int(val)
+}
+
+// ProcessInteractive returns an attribute KeyValue conforming to the
+// "process.interactive" semantic conventions. It represents the whether the
+// process is connected to an interactive shell.
+func ProcessInteractive(val bool) attribute.KeyValue {
+ return ProcessInteractiveKey.Bool(val)
+}
+
+// ProcessLinuxCgroup returns an attribute KeyValue conforming to the
+// "process.linux.cgroup" semantic conventions. It represents the control group
+// associated with the process.
+func ProcessLinuxCgroup(val string) attribute.KeyValue {
+ return ProcessLinuxCgroupKey.String(val)
+}
+
+// ProcessOwner returns an attribute KeyValue conforming to the "process.owner"
+// semantic conventions. It represents the username of the user that owns the
+// process.
+func ProcessOwner(val string) attribute.KeyValue {
+ return ProcessOwnerKey.String(val)
+}
+
+// ProcessParentPID returns an attribute KeyValue conforming to the
+// "process.parent_pid" semantic conventions. It represents the parent Process
+// identifier (PPID).
+func ProcessParentPID(val int) attribute.KeyValue {
+ return ProcessParentPIDKey.Int(val)
+}
+
+// ProcessPID returns an attribute KeyValue conforming to the "process.pid"
+// semantic conventions. It represents the process identifier (PID).
+func ProcessPID(val int) attribute.KeyValue {
+ return ProcessPIDKey.Int(val)
+}
+
+// ProcessRealUserID returns an attribute KeyValue conforming to the
+// "process.real_user.id" semantic conventions. It represents the real user ID
+// (RUID) of the process.
+func ProcessRealUserID(val int) attribute.KeyValue {
+ return ProcessRealUserIDKey.Int(val)
+}
+
+// ProcessRealUserName returns an attribute KeyValue conforming to the
+// "process.real_user.name" semantic conventions. It represents the username of
+// the real user of the process.
+func ProcessRealUserName(val string) attribute.KeyValue {
+ return ProcessRealUserNameKey.String(val)
+}
+
+// ProcessRuntimeDescription returns an attribute KeyValue conforming to the
+// "process.runtime.description" semantic conventions. It represents an
+// additional description about the runtime of the process, for example a
+// specific vendor customization of the runtime environment.
+func ProcessRuntimeDescription(val string) attribute.KeyValue {
+ return ProcessRuntimeDescriptionKey.String(val)
+}
+
+// ProcessRuntimeName returns an attribute KeyValue conforming to the
+// "process.runtime.name" semantic conventions. It represents the name of the
+// runtime of this process.
+func ProcessRuntimeName(val string) attribute.KeyValue {
+ return ProcessRuntimeNameKey.String(val)
+}
+
+// ProcessRuntimeVersion returns an attribute KeyValue conforming to the
+// "process.runtime.version" semantic conventions. It represents the version of
+// the runtime of this process, as returned by the runtime without modification.
+func ProcessRuntimeVersion(val string) attribute.KeyValue {
+ return ProcessRuntimeVersionKey.String(val)
+}
+
+// ProcessSavedUserID returns an attribute KeyValue conforming to the
+// "process.saved_user.id" semantic conventions. It represents the saved user ID
+// (SUID) of the process.
+func ProcessSavedUserID(val int) attribute.KeyValue {
+ return ProcessSavedUserIDKey.Int(val)
+}
+
+// ProcessSavedUserName returns an attribute KeyValue conforming to the
+// "process.saved_user.name" semantic conventions. It represents the username of
+// the saved user.
+func ProcessSavedUserName(val string) attribute.KeyValue {
+ return ProcessSavedUserNameKey.String(val)
+}
+
+// ProcessSessionLeaderPID returns an attribute KeyValue conforming to the
+// "process.session_leader.pid" semantic conventions. It represents the PID of
+// the process's session leader. This is also the session ID (SID) of the
+// process.
+func ProcessSessionLeaderPID(val int) attribute.KeyValue {
+ return ProcessSessionLeaderPIDKey.Int(val)
+}
+
+// ProcessTitle returns an attribute KeyValue conforming to the "process.title"
+// semantic conventions. It represents the process title (proctitle).
+func ProcessTitle(val string) attribute.KeyValue {
+ return ProcessTitleKey.String(val)
+}
+
+// ProcessUserID returns an attribute KeyValue conforming to the
+// "process.user.id" semantic conventions. It represents the effective user ID
+// (EUID) of the process.
+func ProcessUserID(val int) attribute.KeyValue {
+ return ProcessUserIDKey.Int(val)
+}
+
+// ProcessUserName returns an attribute KeyValue conforming to the
+// "process.user.name" semantic conventions. It represents the username of the
+// effective user of the process.
+func ProcessUserName(val string) attribute.KeyValue {
+ return ProcessUserNameKey.String(val)
+}
+
+// ProcessVpid returns an attribute KeyValue conforming to the "process.vpid"
+// semantic conventions. It represents the virtual process identifier.
+func ProcessVpid(val int) attribute.KeyValue {
+ return ProcessVpidKey.Int(val)
+}
+
+// ProcessWorkingDirectory returns an attribute KeyValue conforming to the
+// "process.working_directory" semantic conventions. It represents the working
+// directory of the process.
+func ProcessWorkingDirectory(val string) attribute.KeyValue {
+ return ProcessWorkingDirectoryKey.String(val)
+}
+
+// Enum values for process.context_switch_type
+var (
+ // voluntary
+ // Stability: development
+ ProcessContextSwitchTypeVoluntary = ProcessContextSwitchTypeKey.String("voluntary")
+ // involuntary
+ // Stability: development
+ ProcessContextSwitchTypeInvoluntary = ProcessContextSwitchTypeKey.String("involuntary")
+)
+
+// Enum values for process.paging.fault_type
+var (
+ // major
+ // Stability: development
+ ProcessPagingFaultTypeMajor = ProcessPagingFaultTypeKey.String("major")
+ // minor
+ // Stability: development
+ ProcessPagingFaultTypeMinor = ProcessPagingFaultTypeKey.String("minor")
+)
+
+// Namespace: profile
+const (
+ // ProfileFrameTypeKey is the attribute Key conforming to the
+ // "profile.frame.type" semantic conventions. It represents the describes the
+ // interpreter or compiler of a single frame.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "cpython"
+ ProfileFrameTypeKey = attribute.Key("profile.frame.type")
+)
+
+// Enum values for profile.frame.type
+var (
+ // [.NET]
+ //
+ // Stability: development
+ //
+ // [.NET]: https://wikipedia.org/wiki/.NET
+ ProfileFrameTypeDotnet = ProfileFrameTypeKey.String("dotnet")
+ // [JVM]
+ //
+ // Stability: development
+ //
+ // [JVM]: https://wikipedia.org/wiki/Java_virtual_machine
+ ProfileFrameTypeJVM = ProfileFrameTypeKey.String("jvm")
+ // [Kernel]
+ //
+ // Stability: development
+ //
+ // [Kernel]: https://wikipedia.org/wiki/Kernel_(operating_system)
+ ProfileFrameTypeKernel = ProfileFrameTypeKey.String("kernel")
+ // Can be one of but not limited to [C], [C++], [Go] or [Rust]. If possible, a
+ // more precise value MUST be used.
+ //
+ // Stability: development
+ //
+ // [C]: https://wikipedia.org/wiki/C_(programming_language)
+ // [C++]: https://wikipedia.org/wiki/C%2B%2B
+ // [Go]: https://wikipedia.org/wiki/Go_(programming_language)
+ // [Rust]: https://wikipedia.org/wiki/Rust_(programming_language)
+ ProfileFrameTypeNative = ProfileFrameTypeKey.String("native")
+ // [Perl]
+ //
+ // Stability: development
+ //
+ // [Perl]: https://wikipedia.org/wiki/Perl
+ ProfileFrameTypePerl = ProfileFrameTypeKey.String("perl")
+ // [PHP]
+ //
+ // Stability: development
+ //
+ // [PHP]: https://wikipedia.org/wiki/PHP
+ ProfileFrameTypePHP = ProfileFrameTypeKey.String("php")
+ // [Python]
+ //
+ // Stability: development
+ //
+ // [Python]: https://wikipedia.org/wiki/Python_(programming_language)
+ ProfileFrameTypeCpython = ProfileFrameTypeKey.String("cpython")
+ // [Ruby]
+ //
+ // Stability: development
+ //
+ // [Ruby]: https://wikipedia.org/wiki/Ruby_(programming_language)
+ ProfileFrameTypeRuby = ProfileFrameTypeKey.String("ruby")
+ // [V8JS]
+ //
+ // Stability: development
+ //
+ // [V8JS]: https://wikipedia.org/wiki/V8_(JavaScript_engine)
+ ProfileFrameTypeV8JS = ProfileFrameTypeKey.String("v8js")
+ // [Erlang]
+ //
+ // Stability: development
+ //
+ // [Erlang]: https://en.wikipedia.org/wiki/BEAM_(Erlang_virtual_machine)
+ ProfileFrameTypeBeam = ProfileFrameTypeKey.String("beam")
+ // [Go],
+ //
+ // Stability: development
+ //
+ // [Go]: https://wikipedia.org/wiki/Go_(programming_language)
+ ProfileFrameTypeGo = ProfileFrameTypeKey.String("go")
+ // [Rust]
+ //
+ // Stability: development
+ //
+ // [Rust]: https://wikipedia.org/wiki/Rust_(programming_language)
+ ProfileFrameTypeRust = ProfileFrameTypeKey.String("rust")
+)
+
+// Namespace: rpc
+const (
+ // RPCConnectRPCErrorCodeKey is the attribute Key conforming to the
+ // "rpc.connect_rpc.error_code" semantic conventions. It represents the
+ // [error codes] of the Connect request. Error codes are always string values.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ //
+ // [error codes]: https://connectrpc.com//docs/protocol/#error-codes
+ RPCConnectRPCErrorCodeKey = attribute.Key("rpc.connect_rpc.error_code")
+
+ // RPCGRPCStatusCodeKey is the attribute Key conforming to the
+ // "rpc.grpc.status_code" semantic conventions. It represents the
+ // [numeric status code] of the gRPC request.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ //
+ // [numeric status code]: https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md
+ RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code")
+
+ // RPCJSONRPCErrorCodeKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.error_code" semantic conventions. It represents the `error.code`
+ // property of response if it is an error response.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: -32700, 100
+ RPCJSONRPCErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code")
+
+ // RPCJSONRPCErrorMessageKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.error_message" semantic conventions. It represents the
+ // `error.message` property of response if it is an error response.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Parse error", "User already exists"
+ RPCJSONRPCErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message")
+
+ // RPCJSONRPCRequestIDKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id`
+ // property of request or response. Since protocol allows id to be int, string,
+ // `null` or missing (for notifications), value is expected to be cast to string
+ // for simplicity. Use empty string in case of `null` value. Omit entirely if
+ // this is a notification.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "10", "request-7", ""
+ RPCJSONRPCRequestIDKey = attribute.Key("rpc.jsonrpc.request_id")
+
+ // RPCJSONRPCVersionKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.version" semantic conventions. It represents the protocol
+ // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0
+ // doesn't specify this, the value can be omitted.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "2.0", "1.0"
+ RPCJSONRPCVersionKey = attribute.Key("rpc.jsonrpc.version")
+
+ // RPCMessageCompressedSizeKey is the attribute Key conforming to the
+ // "rpc.message.compressed_size" semantic conventions. It represents the
+ // compressed size of the message in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ RPCMessageCompressedSizeKey = attribute.Key("rpc.message.compressed_size")
+
+ // RPCMessageIDKey is the attribute Key conforming to the "rpc.message.id"
+ // semantic conventions. It MUST be calculated as two different counters
+ // starting from `1` one for sent messages and one for received message..
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // Note: This way we guarantee that the values will be consistent between
+ // different implementations.
+ RPCMessageIDKey = attribute.Key("rpc.message.id")
+
+ // RPCMessageTypeKey is the attribute Key conforming to the "rpc.message.type"
+ // semantic conventions. It represents the whether this is a received or sent
+ // message.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ RPCMessageTypeKey = attribute.Key("rpc.message.type")
+
+ // RPCMessageUncompressedSizeKey is the attribute Key conforming to the
+ // "rpc.message.uncompressed_size" semantic conventions. It represents the
+ // uncompressed size of the message in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ RPCMessageUncompressedSizeKey = attribute.Key("rpc.message.uncompressed_size")
+
+ // RPCMethodKey is the attribute Key conforming to the "rpc.method" semantic
+ // conventions. It represents the name of the (logical) method being called,
+ // must be equal to the $method part in the span name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: exampleMethod
+ // Note: This is the logical name of the method from the RPC interface
+ // perspective, which can be different from the name of any implementing
+ // method/function. The `code.function.name` attribute may be used to store the
+ // latter (e.g., method actually executing the call on the server side, RPC
+ // client stub method on the client side).
+ RPCMethodKey = attribute.Key("rpc.method")
+
+ // RPCServiceKey is the attribute Key conforming to the "rpc.service" semantic
+ // conventions. It represents the full (logical) name of the service being
+ // called, including its package name, if applicable.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: myservice.EchoService
+ // Note: This is the logical name of the service from the RPC interface
+ // perspective, which can be different from the name of any implementing class.
+ // The `code.namespace` attribute may be used to store the latter (despite the
+ // attribute name, it may include a class name; e.g., class with method actually
+ // executing the call on the server side, RPC client stub class on the client
+ // side).
+ RPCServiceKey = attribute.Key("rpc.service")
+
+ // RPCSystemKey is the attribute Key conforming to the "rpc.system" semantic
+ // conventions. It represents a string identifying the remoting system. See
+ // below for a list of well-known identifiers.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ RPCSystemKey = attribute.Key("rpc.system")
+)
+
+// RPCConnectRPCRequestMetadata returns an attribute KeyValue conforming to the
+// "rpc.connect_rpc.request.metadata" semantic conventions. It represents the
+// connect request metadata, `` being the normalized Connect Metadata key
+// (lowercase), the value being the metadata values.
+func RPCConnectRPCRequestMetadata(key string, val ...string) attribute.KeyValue {
+ return attribute.StringSlice("rpc.connect_rpc.request.metadata."+key, val)
+}
+
+// RPCConnectRPCResponseMetadata returns an attribute KeyValue conforming to the
+// "rpc.connect_rpc.response.metadata" semantic conventions. It represents the
+// connect response metadata, `` being the normalized Connect Metadata key
+// (lowercase), the value being the metadata values.
+func RPCConnectRPCResponseMetadata(key string, val ...string) attribute.KeyValue {
+ return attribute.StringSlice("rpc.connect_rpc.response.metadata."+key, val)
+}
+
+// RPCGRPCRequestMetadata returns an attribute KeyValue conforming to the
+// "rpc.grpc.request.metadata" semantic conventions. It represents the gRPC
+// request metadata, `` being the normalized gRPC Metadata key (lowercase),
+// the value being the metadata values.
+func RPCGRPCRequestMetadata(key string, val ...string) attribute.KeyValue {
+ return attribute.StringSlice("rpc.grpc.request.metadata."+key, val)
+}
+
+// RPCGRPCResponseMetadata returns an attribute KeyValue conforming to the
+// "rpc.grpc.response.metadata" semantic conventions. It represents the gRPC
+// response metadata, `` being the normalized gRPC Metadata key (lowercase),
+// the value being the metadata values.
+func RPCGRPCResponseMetadata(key string, val ...string) attribute.KeyValue {
+ return attribute.StringSlice("rpc.grpc.response.metadata."+key, val)
+}
+
+// RPCJSONRPCErrorCode returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.error_code" semantic conventions. It represents the `error.code`
+// property of response if it is an error response.
+func RPCJSONRPCErrorCode(val int) attribute.KeyValue {
+ return RPCJSONRPCErrorCodeKey.Int(val)
+}
+
+// RPCJSONRPCErrorMessage returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.error_message" semantic conventions. It represents the
+// `error.message` property of response if it is an error response.
+func RPCJSONRPCErrorMessage(val string) attribute.KeyValue {
+ return RPCJSONRPCErrorMessageKey.String(val)
+}
+
+// RPCJSONRPCRequestID returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` property
+// of request or response. Since protocol allows id to be int, string, `null` or
+// missing (for notifications), value is expected to be cast to string for
+// simplicity. Use empty string in case of `null` value. Omit entirely if this is
+// a notification.
+func RPCJSONRPCRequestID(val string) attribute.KeyValue {
+ return RPCJSONRPCRequestIDKey.String(val)
+}
+
+// RPCJSONRPCVersion returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.version" semantic conventions. It represents the protocol version
+// as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't
+// specify this, the value can be omitted.
+func RPCJSONRPCVersion(val string) attribute.KeyValue {
+ return RPCJSONRPCVersionKey.String(val)
+}
+
+// RPCMessageCompressedSize returns an attribute KeyValue conforming to the
+// "rpc.message.compressed_size" semantic conventions. It represents the
+// compressed size of the message in bytes.
+func RPCMessageCompressedSize(val int) attribute.KeyValue {
+ return RPCMessageCompressedSizeKey.Int(val)
+}
+
+// RPCMessageID returns an attribute KeyValue conforming to the "rpc.message.id"
+// semantic conventions. It MUST be calculated as two different counters starting
+// from `1` one for sent messages and one for received message..
+func RPCMessageID(val int) attribute.KeyValue {
+ return RPCMessageIDKey.Int(val)
+}
+
+// RPCMessageUncompressedSize returns an attribute KeyValue conforming to the
+// "rpc.message.uncompressed_size" semantic conventions. It represents the
+// uncompressed size of the message in bytes.
+func RPCMessageUncompressedSize(val int) attribute.KeyValue {
+ return RPCMessageUncompressedSizeKey.Int(val)
+}
+
+// RPCMethod returns an attribute KeyValue conforming to the "rpc.method"
+// semantic conventions. It represents the name of the (logical) method being
+// called, must be equal to the $method part in the span name.
+func RPCMethod(val string) attribute.KeyValue {
+ return RPCMethodKey.String(val)
+}
+
+// RPCService returns an attribute KeyValue conforming to the "rpc.service"
+// semantic conventions. It represents the full (logical) name of the service
+// being called, including its package name, if applicable.
+func RPCService(val string) attribute.KeyValue {
+ return RPCServiceKey.String(val)
+}
+
+// Enum values for rpc.connect_rpc.error_code
+var (
+ // cancelled
+ // Stability: development
+ RPCConnectRPCErrorCodeCancelled = RPCConnectRPCErrorCodeKey.String("cancelled")
+ // unknown
+ // Stability: development
+ RPCConnectRPCErrorCodeUnknown = RPCConnectRPCErrorCodeKey.String("unknown")
+ // invalid_argument
+ // Stability: development
+ RPCConnectRPCErrorCodeInvalidArgument = RPCConnectRPCErrorCodeKey.String("invalid_argument")
+ // deadline_exceeded
+ // Stability: development
+ RPCConnectRPCErrorCodeDeadlineExceeded = RPCConnectRPCErrorCodeKey.String("deadline_exceeded")
+ // not_found
+ // Stability: development
+ RPCConnectRPCErrorCodeNotFound = RPCConnectRPCErrorCodeKey.String("not_found")
+ // already_exists
+ // Stability: development
+ RPCConnectRPCErrorCodeAlreadyExists = RPCConnectRPCErrorCodeKey.String("already_exists")
+ // permission_denied
+ // Stability: development
+ RPCConnectRPCErrorCodePermissionDenied = RPCConnectRPCErrorCodeKey.String("permission_denied")
+ // resource_exhausted
+ // Stability: development
+ RPCConnectRPCErrorCodeResourceExhausted = RPCConnectRPCErrorCodeKey.String("resource_exhausted")
+ // failed_precondition
+ // Stability: development
+ RPCConnectRPCErrorCodeFailedPrecondition = RPCConnectRPCErrorCodeKey.String("failed_precondition")
+ // aborted
+ // Stability: development
+ RPCConnectRPCErrorCodeAborted = RPCConnectRPCErrorCodeKey.String("aborted")
+ // out_of_range
+ // Stability: development
+ RPCConnectRPCErrorCodeOutOfRange = RPCConnectRPCErrorCodeKey.String("out_of_range")
+ // unimplemented
+ // Stability: development
+ RPCConnectRPCErrorCodeUnimplemented = RPCConnectRPCErrorCodeKey.String("unimplemented")
+ // internal
+ // Stability: development
+ RPCConnectRPCErrorCodeInternal = RPCConnectRPCErrorCodeKey.String("internal")
+ // unavailable
+ // Stability: development
+ RPCConnectRPCErrorCodeUnavailable = RPCConnectRPCErrorCodeKey.String("unavailable")
+ // data_loss
+ // Stability: development
+ RPCConnectRPCErrorCodeDataLoss = RPCConnectRPCErrorCodeKey.String("data_loss")
+ // unauthenticated
+ // Stability: development
+ RPCConnectRPCErrorCodeUnauthenticated = RPCConnectRPCErrorCodeKey.String("unauthenticated")
+)
+
+// Enum values for rpc.grpc.status_code
+var (
+ // OK
+ // Stability: development
+ RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0)
+ // CANCELLED
+ // Stability: development
+ RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1)
+ // UNKNOWN
+ // Stability: development
+ RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2)
+ // INVALID_ARGUMENT
+ // Stability: development
+ RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3)
+ // DEADLINE_EXCEEDED
+ // Stability: development
+ RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4)
+ // NOT_FOUND
+ // Stability: development
+ RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5)
+ // ALREADY_EXISTS
+ // Stability: development
+ RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6)
+ // PERMISSION_DENIED
+ // Stability: development
+ RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7)
+ // RESOURCE_EXHAUSTED
+ // Stability: development
+ RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8)
+ // FAILED_PRECONDITION
+ // Stability: development
+ RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9)
+ // ABORTED
+ // Stability: development
+ RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10)
+ // OUT_OF_RANGE
+ // Stability: development
+ RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11)
+ // UNIMPLEMENTED
+ // Stability: development
+ RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12)
+ // INTERNAL
+ // Stability: development
+ RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13)
+ // UNAVAILABLE
+ // Stability: development
+ RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14)
+ // DATA_LOSS
+ // Stability: development
+ RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15)
+ // UNAUTHENTICATED
+ // Stability: development
+ RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16)
+)
+
+// Enum values for rpc.message.type
+var (
+ // sent
+ // Stability: development
+ RPCMessageTypeSent = RPCMessageTypeKey.String("SENT")
+ // received
+ // Stability: development
+ RPCMessageTypeReceived = RPCMessageTypeKey.String("RECEIVED")
+)
+
+// Enum values for rpc.system
+var (
+ // gRPC
+ // Stability: development
+ RPCSystemGRPC = RPCSystemKey.String("grpc")
+ // Java RMI
+ // Stability: development
+ RPCSystemJavaRmi = RPCSystemKey.String("java_rmi")
+ // .NET WCF
+ // Stability: development
+ RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf")
+ // Apache Dubbo
+ // Stability: development
+ RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo")
+ // Connect RPC
+ // Stability: development
+ RPCSystemConnectRPC = RPCSystemKey.String("connect_rpc")
+)
+
+// Namespace: security_rule
+const (
+ // SecurityRuleCategoryKey is the attribute Key conforming to the
+ // "security_rule.category" semantic conventions. It represents a categorization
+ // value keyword used by the entity using the rule for detection of this event.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Attempted Information Leak"
+ SecurityRuleCategoryKey = attribute.Key("security_rule.category")
+
+ // SecurityRuleDescriptionKey is the attribute Key conforming to the
+ // "security_rule.description" semantic conventions. It represents the
+ // description of the rule generating the event.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Block requests to public DNS over HTTPS / TLS protocols"
+ SecurityRuleDescriptionKey = attribute.Key("security_rule.description")
+
+ // SecurityRuleLicenseKey is the attribute Key conforming to the
+ // "security_rule.license" semantic conventions. It represents the name of the
+ // license under which the rule used to generate this event is made available.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Apache 2.0"
+ SecurityRuleLicenseKey = attribute.Key("security_rule.license")
+
+ // SecurityRuleNameKey is the attribute Key conforming to the
+ // "security_rule.name" semantic conventions. It represents the name of the rule
+ // or signature generating the event.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "BLOCK_DNS_over_TLS"
+ SecurityRuleNameKey = attribute.Key("security_rule.name")
+
+ // SecurityRuleReferenceKey is the attribute Key conforming to the
+ // "security_rule.reference" semantic conventions. It represents the reference
+ // URL to additional information about the rule used to generate this event.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "https://en.wikipedia.org/wiki/DNS_over_TLS"
+ // Note: The URL can point to the vendor’s documentation about the rule. If
+ // that’s not available, it can also be a link to a more general page
+ // describing this type of alert.
+ SecurityRuleReferenceKey = attribute.Key("security_rule.reference")
+
+ // SecurityRuleRulesetNameKey is the attribute Key conforming to the
+ // "security_rule.ruleset.name" semantic conventions. It represents the name of
+ // the ruleset, policy, group, or parent category in which the rule used to
+ // generate this event is a member.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Standard_Protocol_Filters"
+ SecurityRuleRulesetNameKey = attribute.Key("security_rule.ruleset.name")
+
+ // SecurityRuleUUIDKey is the attribute Key conforming to the
+ // "security_rule.uuid" semantic conventions. It represents a rule ID that is
+ // unique within the scope of a set or group of agents, observers, or other
+ // entities using the rule for detection of this event.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "550e8400-e29b-41d4-a716-446655440000", "1100110011"
+ SecurityRuleUUIDKey = attribute.Key("security_rule.uuid")
+
+ // SecurityRuleVersionKey is the attribute Key conforming to the
+ // "security_rule.version" semantic conventions. It represents the version /
+ // revision of the rule being used for analysis.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "1.0.0"
+ SecurityRuleVersionKey = attribute.Key("security_rule.version")
+)
+
+// SecurityRuleCategory returns an attribute KeyValue conforming to the
+// "security_rule.category" semantic conventions. It represents a categorization
+// value keyword used by the entity using the rule for detection of this event.
+func SecurityRuleCategory(val string) attribute.KeyValue {
+ return SecurityRuleCategoryKey.String(val)
+}
+
+// SecurityRuleDescription returns an attribute KeyValue conforming to the
+// "security_rule.description" semantic conventions. It represents the
+// description of the rule generating the event.
+func SecurityRuleDescription(val string) attribute.KeyValue {
+ return SecurityRuleDescriptionKey.String(val)
+}
+
+// SecurityRuleLicense returns an attribute KeyValue conforming to the
+// "security_rule.license" semantic conventions. It represents the name of the
+// license under which the rule used to generate this event is made available.
+func SecurityRuleLicense(val string) attribute.KeyValue {
+ return SecurityRuleLicenseKey.String(val)
+}
+
+// SecurityRuleName returns an attribute KeyValue conforming to the
+// "security_rule.name" semantic conventions. It represents the name of the rule
+// or signature generating the event.
+func SecurityRuleName(val string) attribute.KeyValue {
+ return SecurityRuleNameKey.String(val)
+}
+
+// SecurityRuleReference returns an attribute KeyValue conforming to the
+// "security_rule.reference" semantic conventions. It represents the reference
+// URL to additional information about the rule used to generate this event.
+func SecurityRuleReference(val string) attribute.KeyValue {
+ return SecurityRuleReferenceKey.String(val)
+}
+
+// SecurityRuleRulesetName returns an attribute KeyValue conforming to the
+// "security_rule.ruleset.name" semantic conventions. It represents the name of
+// the ruleset, policy, group, or parent category in which the rule used to
+// generate this event is a member.
+func SecurityRuleRulesetName(val string) attribute.KeyValue {
+ return SecurityRuleRulesetNameKey.String(val)
+}
+
+// SecurityRuleUUID returns an attribute KeyValue conforming to the
+// "security_rule.uuid" semantic conventions. It represents a rule ID that is
+// unique within the scope of a set or group of agents, observers, or other
+// entities using the rule for detection of this event.
+func SecurityRuleUUID(val string) attribute.KeyValue {
+ return SecurityRuleUUIDKey.String(val)
+}
+
+// SecurityRuleVersion returns an attribute KeyValue conforming to the
+// "security_rule.version" semantic conventions. It represents the version /
+// revision of the rule being used for analysis.
+func SecurityRuleVersion(val string) attribute.KeyValue {
+ return SecurityRuleVersionKey.String(val)
+}
+
+// Namespace: server
+const (
+ // ServerAddressKey is the attribute Key conforming to the "server.address"
+ // semantic conventions. It represents the server domain name if available
+ // without reverse DNS lookup; otherwise, IP address or Unix domain socket name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "example.com", "10.1.2.80", "/tmp/my.sock"
+ // Note: When observed from the client side, and when communicating through an
+ // intermediary, `server.address` SHOULD represent the server address behind any
+ // intermediaries, for example proxies, if it's available.
+ ServerAddressKey = attribute.Key("server.address")
+
+ // ServerPortKey is the attribute Key conforming to the "server.port" semantic
+ // conventions. It represents the server port number.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: 80, 8080, 443
+ // Note: When observed from the client side, and when communicating through an
+ // intermediary, `server.port` SHOULD represent the server port behind any
+ // intermediaries, for example proxies, if it's available.
+ ServerPortKey = attribute.Key("server.port")
+)
+
+// ServerAddress returns an attribute KeyValue conforming to the "server.address"
+// semantic conventions. It represents the server domain name if available
+// without reverse DNS lookup; otherwise, IP address or Unix domain socket name.
+func ServerAddress(val string) attribute.KeyValue {
+ return ServerAddressKey.String(val)
+}
+
+// ServerPort returns an attribute KeyValue conforming to the "server.port"
+// semantic conventions. It represents the server port number.
+func ServerPort(val int) attribute.KeyValue {
+ return ServerPortKey.Int(val)
+}
+
+// Namespace: service
+const (
+ // ServiceInstanceIDKey is the attribute Key conforming to the
+ // "service.instance.id" semantic conventions. It represents the string ID of
+ // the service instance.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "627cc493-f310-47de-96bd-71410b7dec09"
+ // Note: MUST be unique for each instance of the same
+ // `service.namespace,service.name` pair (in other words
+ // `service.namespace,service.name,service.instance.id` triplet MUST be globally
+ // unique). The ID helps to
+ // distinguish instances of the same service that exist at the same time (e.g.
+ // instances of a horizontally scaled
+ // service).
+ //
+ // Implementations, such as SDKs, are recommended to generate a random Version 1
+ // or Version 4 [RFC
+ // 4122] UUID, but are free to use an inherent unique ID as
+ // the source of
+ // this value if stability is desirable. In that case, the ID SHOULD be used as
+ // source of a UUID Version 5 and
+ // SHOULD use the following UUID as the namespace:
+ // `4d63009a-8d0f-11ee-aad7-4c796ed8e320`.
+ //
+ // UUIDs are typically recommended, as only an opaque value for the purposes of
+ // identifying a service instance is
+ // needed. Similar to what can be seen in the man page for the
+ // [`/etc/machine-id`] file, the underlying
+ // data, such as pod name and namespace should be treated as confidential, being
+ // the user's choice to expose it
+ // or not via another resource attribute.
+ //
+ // For applications running behind an application server (like unicorn), we do
+ // not recommend using one identifier
+ // for all processes participating in the application. Instead, it's recommended
+ // each division (e.g. a worker
+ // thread in unicorn) to have its own instance.id.
+ //
+ // It's not recommended for a Collector to set `service.instance.id` if it can't
+ // unambiguously determine the
+ // service instance that is generating that telemetry. For instance, creating an
+ // UUID based on `pod.name` will
+ // likely be wrong, as the Collector might not know from which container within
+ // that pod the telemetry originated.
+ // However, Collectors can set the `service.instance.id` if they can
+ // unambiguously determine the service instance
+ // for that telemetry. This is typically the case for scraping receivers, as
+ // they know the target address and
+ // port.
+ //
+ // [RFC
+ // 4122]: https://www.ietf.org/rfc/rfc4122.txt
+ // [`/etc/machine-id`]: https://www.freedesktop.org/software/systemd/man/latest/machine-id.html
+ ServiceInstanceIDKey = attribute.Key("service.instance.id")
+
+ // ServiceNameKey is the attribute Key conforming to the "service.name" semantic
+ // conventions. It represents the logical name of the service.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "shoppingcart"
+ // Note: MUST be the same for all instances of horizontally scaled services. If
+ // the value was not specified, SDKs MUST fallback to `unknown_service:`
+ // concatenated with [`process.executable.name`], e.g. `unknown_service:bash`.
+ // If `process.executable.name` is not available, the value MUST be set to
+ // `unknown_service`.
+ //
+ // [`process.executable.name`]: process.md
+ ServiceNameKey = attribute.Key("service.name")
+
+ // ServiceNamespaceKey is the attribute Key conforming to the
+ // "service.namespace" semantic conventions. It represents a namespace for
+ // `service.name`.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Shop"
+ // Note: A string value having a meaning that helps to distinguish a group of
+ // services, for example the team name that owns a group of services.
+ // `service.name` is expected to be unique within the same namespace. If
+ // `service.namespace` is not specified in the Resource then `service.name` is
+ // expected to be unique for all services that have no explicit namespace
+ // defined (so the empty/unspecified namespace is simply one more valid
+ // namespace). Zero-length namespace string is assumed equal to unspecified
+ // namespace.
+ ServiceNamespaceKey = attribute.Key("service.namespace")
+
+ // ServiceVersionKey is the attribute Key conforming to the "service.version"
+ // semantic conventions. It represents the version string of the service API or
+ // implementation. The format is not defined by these conventions.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "2.0.0", "a01dbef8a"
+ ServiceVersionKey = attribute.Key("service.version")
+)
+
+// ServiceInstanceID returns an attribute KeyValue conforming to the
+// "service.instance.id" semantic conventions. It represents the string ID of the
+// service instance.
+func ServiceInstanceID(val string) attribute.KeyValue {
+ return ServiceInstanceIDKey.String(val)
+}
+
+// ServiceName returns an attribute KeyValue conforming to the "service.name"
+// semantic conventions. It represents the logical name of the service.
+func ServiceName(val string) attribute.KeyValue {
+ return ServiceNameKey.String(val)
+}
+
+// ServiceNamespace returns an attribute KeyValue conforming to the
+// "service.namespace" semantic conventions. It represents a namespace for
+// `service.name`.
+func ServiceNamespace(val string) attribute.KeyValue {
+ return ServiceNamespaceKey.String(val)
+}
+
+// ServiceVersion returns an attribute KeyValue conforming to the
+// "service.version" semantic conventions. It represents the version string of
+// the service API or implementation. The format is not defined by these
+// conventions.
+func ServiceVersion(val string) attribute.KeyValue {
+ return ServiceVersionKey.String(val)
+}
+
+// Namespace: session
+const (
+ // SessionIDKey is the attribute Key conforming to the "session.id" semantic
+ // conventions. It represents a unique id to identify a session.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 00112233-4455-6677-8899-aabbccddeeff
+ SessionIDKey = attribute.Key("session.id")
+
+ // SessionPreviousIDKey is the attribute Key conforming to the
+ // "session.previous_id" semantic conventions. It represents the previous
+ // `session.id` for this user, when known.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 00112233-4455-6677-8899-aabbccddeeff
+ SessionPreviousIDKey = attribute.Key("session.previous_id")
+)
+
+// SessionID returns an attribute KeyValue conforming to the "session.id"
+// semantic conventions. It represents a unique id to identify a session.
+func SessionID(val string) attribute.KeyValue {
+ return SessionIDKey.String(val)
+}
+
+// SessionPreviousID returns an attribute KeyValue conforming to the
+// "session.previous_id" semantic conventions. It represents the previous
+// `session.id` for this user, when known.
+func SessionPreviousID(val string) attribute.KeyValue {
+ return SessionPreviousIDKey.String(val)
+}
+
+// Namespace: signalr
+const (
+ // SignalRConnectionStatusKey is the attribute Key conforming to the
+ // "signalr.connection.status" semantic conventions. It represents the signalR
+ // HTTP connection closure status.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "app_shutdown", "timeout"
+ SignalRConnectionStatusKey = attribute.Key("signalr.connection.status")
+
+ // SignalRTransportKey is the attribute Key conforming to the
+ // "signalr.transport" semantic conventions. It represents the
+ // [SignalR transport type].
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "web_sockets", "long_polling"
+ //
+ // [SignalR transport type]: https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md
+ SignalRTransportKey = attribute.Key("signalr.transport")
+)
+
+// Enum values for signalr.connection.status
+var (
+ // The connection was closed normally.
+ // Stability: stable
+ SignalRConnectionStatusNormalClosure = SignalRConnectionStatusKey.String("normal_closure")
+ // The connection was closed due to a timeout.
+ // Stability: stable
+ SignalRConnectionStatusTimeout = SignalRConnectionStatusKey.String("timeout")
+ // The connection was closed because the app is shutting down.
+ // Stability: stable
+ SignalRConnectionStatusAppShutdown = SignalRConnectionStatusKey.String("app_shutdown")
+)
+
+// Enum values for signalr.transport
+var (
+ // ServerSentEvents protocol
+ // Stability: stable
+ SignalRTransportServerSentEvents = SignalRTransportKey.String("server_sent_events")
+ // LongPolling protocol
+ // Stability: stable
+ SignalRTransportLongPolling = SignalRTransportKey.String("long_polling")
+ // WebSockets protocol
+ // Stability: stable
+ SignalRTransportWebSockets = SignalRTransportKey.String("web_sockets")
+)
+
+// Namespace: source
+const (
+ // SourceAddressKey is the attribute Key conforming to the "source.address"
+ // semantic conventions. It represents the source address - domain name if
+ // available without reverse DNS lookup; otherwise, IP address or Unix domain
+ // socket name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "source.example.com", "10.1.2.80", "/tmp/my.sock"
+ // Note: When observed from the destination side, and when communicating through
+ // an intermediary, `source.address` SHOULD represent the source address behind
+ // any intermediaries, for example proxies, if it's available.
+ SourceAddressKey = attribute.Key("source.address")
+
+ // SourcePortKey is the attribute Key conforming to the "source.port" semantic
+ // conventions. It represents the source port number.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 3389, 2888
+ SourcePortKey = attribute.Key("source.port")
+)
+
+// SourceAddress returns an attribute KeyValue conforming to the "source.address"
+// semantic conventions. It represents the source address - domain name if
+// available without reverse DNS lookup; otherwise, IP address or Unix domain
+// socket name.
+func SourceAddress(val string) attribute.KeyValue {
+ return SourceAddressKey.String(val)
+}
+
+// SourcePort returns an attribute KeyValue conforming to the "source.port"
+// semantic conventions. It represents the source port number.
+func SourcePort(val int) attribute.KeyValue {
+ return SourcePortKey.Int(val)
+}
+
+// Namespace: system
+const (
+ // SystemCPULogicalNumberKey is the attribute Key conforming to the
+ // "system.cpu.logical_number" semantic conventions. It represents the
+ // deprecated, use `cpu.logical_number` instead.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 1
+ SystemCPULogicalNumberKey = attribute.Key("system.cpu.logical_number")
+
+ // SystemDeviceKey is the attribute Key conforming to the "system.device"
+ // semantic conventions. It represents the device identifier.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "(identifier)"
+ SystemDeviceKey = attribute.Key("system.device")
+
+ // SystemFilesystemModeKey is the attribute Key conforming to the
+ // "system.filesystem.mode" semantic conventions. It represents the filesystem
+ // mode.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "rw, ro"
+ SystemFilesystemModeKey = attribute.Key("system.filesystem.mode")
+
+ // SystemFilesystemMountpointKey is the attribute Key conforming to the
+ // "system.filesystem.mountpoint" semantic conventions. It represents the
+ // filesystem mount path.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "/mnt/data"
+ SystemFilesystemMountpointKey = attribute.Key("system.filesystem.mountpoint")
+
+ // SystemFilesystemStateKey is the attribute Key conforming to the
+ // "system.filesystem.state" semantic conventions. It represents the filesystem
+ // state.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "used"
+ SystemFilesystemStateKey = attribute.Key("system.filesystem.state")
+
+ // SystemFilesystemTypeKey is the attribute Key conforming to the
+ // "system.filesystem.type" semantic conventions. It represents the filesystem
+ // type.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "ext4"
+ SystemFilesystemTypeKey = attribute.Key("system.filesystem.type")
+
+ // SystemMemoryStateKey is the attribute Key conforming to the
+ // "system.memory.state" semantic conventions. It represents the memory state.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "free", "cached"
+ SystemMemoryStateKey = attribute.Key("system.memory.state")
+
+ // SystemPagingDirectionKey is the attribute Key conforming to the
+ // "system.paging.direction" semantic conventions. It represents the paging
+ // access direction.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "in"
+ SystemPagingDirectionKey = attribute.Key("system.paging.direction")
+
+ // SystemPagingStateKey is the attribute Key conforming to the
+ // "system.paging.state" semantic conventions. It represents the memory paging
+ // state.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "free"
+ SystemPagingStateKey = attribute.Key("system.paging.state")
+
+ // SystemPagingTypeKey is the attribute Key conforming to the
+ // "system.paging.type" semantic conventions. It represents the memory paging
+ // type.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "minor"
+ SystemPagingTypeKey = attribute.Key("system.paging.type")
+
+ // SystemProcessStatusKey is the attribute Key conforming to the
+ // "system.process.status" semantic conventions. It represents the process
+ // state, e.g., [Linux Process State Codes].
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "running"
+ //
+ // [Linux Process State Codes]: https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES
+ SystemProcessStatusKey = attribute.Key("system.process.status")
+)
+
+// SystemCPULogicalNumber returns an attribute KeyValue conforming to the
+// "system.cpu.logical_number" semantic conventions. It represents the
+// deprecated, use `cpu.logical_number` instead.
+func SystemCPULogicalNumber(val int) attribute.KeyValue {
+ return SystemCPULogicalNumberKey.Int(val)
+}
+
+// SystemDevice returns an attribute KeyValue conforming to the "system.device"
+// semantic conventions. It represents the device identifier.
+func SystemDevice(val string) attribute.KeyValue {
+ return SystemDeviceKey.String(val)
+}
+
+// SystemFilesystemMode returns an attribute KeyValue conforming to the
+// "system.filesystem.mode" semantic conventions. It represents the filesystem
+// mode.
+func SystemFilesystemMode(val string) attribute.KeyValue {
+ return SystemFilesystemModeKey.String(val)
+}
+
+// SystemFilesystemMountpoint returns an attribute KeyValue conforming to the
+// "system.filesystem.mountpoint" semantic conventions. It represents the
+// filesystem mount path.
+func SystemFilesystemMountpoint(val string) attribute.KeyValue {
+ return SystemFilesystemMountpointKey.String(val)
+}
+
+// Enum values for system.filesystem.state
+var (
+ // used
+ // Stability: development
+ SystemFilesystemStateUsed = SystemFilesystemStateKey.String("used")
+ // free
+ // Stability: development
+ SystemFilesystemStateFree = SystemFilesystemStateKey.String("free")
+ // reserved
+ // Stability: development
+ SystemFilesystemStateReserved = SystemFilesystemStateKey.String("reserved")
+)
+
+// Enum values for system.filesystem.type
+var (
+ // fat32
+ // Stability: development
+ SystemFilesystemTypeFat32 = SystemFilesystemTypeKey.String("fat32")
+ // exfat
+ // Stability: development
+ SystemFilesystemTypeExfat = SystemFilesystemTypeKey.String("exfat")
+ // ntfs
+ // Stability: development
+ SystemFilesystemTypeNtfs = SystemFilesystemTypeKey.String("ntfs")
+ // refs
+ // Stability: development
+ SystemFilesystemTypeRefs = SystemFilesystemTypeKey.String("refs")
+ // hfsplus
+ // Stability: development
+ SystemFilesystemTypeHfsplus = SystemFilesystemTypeKey.String("hfsplus")
+ // ext4
+ // Stability: development
+ SystemFilesystemTypeExt4 = SystemFilesystemTypeKey.String("ext4")
+)
+
+// Enum values for system.memory.state
+var (
+ // Actual used virtual memory in bytes.
+ // Stability: development
+ SystemMemoryStateUsed = SystemMemoryStateKey.String("used")
+ // free
+ // Stability: development
+ SystemMemoryStateFree = SystemMemoryStateKey.String("free")
+ // buffers
+ // Stability: development
+ SystemMemoryStateBuffers = SystemMemoryStateKey.String("buffers")
+ // cached
+ // Stability: development
+ SystemMemoryStateCached = SystemMemoryStateKey.String("cached")
+)
+
+// Enum values for system.paging.direction
+var (
+ // in
+ // Stability: development
+ SystemPagingDirectionIn = SystemPagingDirectionKey.String("in")
+ // out
+ // Stability: development
+ SystemPagingDirectionOut = SystemPagingDirectionKey.String("out")
+)
+
+// Enum values for system.paging.state
+var (
+ // used
+ // Stability: development
+ SystemPagingStateUsed = SystemPagingStateKey.String("used")
+ // free
+ // Stability: development
+ SystemPagingStateFree = SystemPagingStateKey.String("free")
+)
+
+// Enum values for system.paging.type
+var (
+ // major
+ // Stability: development
+ SystemPagingTypeMajor = SystemPagingTypeKey.String("major")
+ // minor
+ // Stability: development
+ SystemPagingTypeMinor = SystemPagingTypeKey.String("minor")
+)
+
+// Enum values for system.process.status
+var (
+ // running
+ // Stability: development
+ SystemProcessStatusRunning = SystemProcessStatusKey.String("running")
+ // sleeping
+ // Stability: development
+ SystemProcessStatusSleeping = SystemProcessStatusKey.String("sleeping")
+ // stopped
+ // Stability: development
+ SystemProcessStatusStopped = SystemProcessStatusKey.String("stopped")
+ // defunct
+ // Stability: development
+ SystemProcessStatusDefunct = SystemProcessStatusKey.String("defunct")
+)
+
+// Namespace: telemetry
+const (
+ // TelemetryDistroNameKey is the attribute Key conforming to the
+ // "telemetry.distro.name" semantic conventions. It represents the name of the
+ // auto instrumentation agent or distribution, if used.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "parts-unlimited-java"
+ // Note: Official auto instrumentation agents and distributions SHOULD set the
+ // `telemetry.distro.name` attribute to
+ // a string starting with `opentelemetry-`, e.g.
+ // `opentelemetry-java-instrumentation`.
+ TelemetryDistroNameKey = attribute.Key("telemetry.distro.name")
+
+ // TelemetryDistroVersionKey is the attribute Key conforming to the
+ // "telemetry.distro.version" semantic conventions. It represents the version
+ // string of the auto instrumentation agent or distribution, if used.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "1.2.3"
+ TelemetryDistroVersionKey = attribute.Key("telemetry.distro.version")
+
+ // TelemetrySDKLanguageKey is the attribute Key conforming to the
+ // "telemetry.sdk.language" semantic conventions. It represents the language of
+ // the telemetry SDK.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples:
+ TelemetrySDKLanguageKey = attribute.Key("telemetry.sdk.language")
+
+ // TelemetrySDKNameKey is the attribute Key conforming to the
+ // "telemetry.sdk.name" semantic conventions. It represents the name of the
+ // telemetry SDK as defined above.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "opentelemetry"
+ // Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to
+ // `opentelemetry`.
+ // If another SDK, like a fork or a vendor-provided implementation, is used,
+ // this SDK MUST set the
+ // `telemetry.sdk.name` attribute to the fully-qualified class or module name of
+ // this SDK's main entry point
+ // or another suitable identifier depending on the language.
+ // The identifier `opentelemetry` is reserved and MUST NOT be used in this case.
+ // All custom identifiers SHOULD be stable across different versions of an
+ // implementation.
+ TelemetrySDKNameKey = attribute.Key("telemetry.sdk.name")
+
+ // TelemetrySDKVersionKey is the attribute Key conforming to the
+ // "telemetry.sdk.version" semantic conventions. It represents the version
+ // string of the telemetry SDK.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "1.2.3"
+ TelemetrySDKVersionKey = attribute.Key("telemetry.sdk.version")
+)
+
+// TelemetryDistroName returns an attribute KeyValue conforming to the
+// "telemetry.distro.name" semantic conventions. It represents the name of the
+// auto instrumentation agent or distribution, if used.
+func TelemetryDistroName(val string) attribute.KeyValue {
+ return TelemetryDistroNameKey.String(val)
+}
+
+// TelemetryDistroVersion returns an attribute KeyValue conforming to the
+// "telemetry.distro.version" semantic conventions. It represents the version
+// string of the auto instrumentation agent or distribution, if used.
+func TelemetryDistroVersion(val string) attribute.KeyValue {
+ return TelemetryDistroVersionKey.String(val)
+}
+
+// TelemetrySDKName returns an attribute KeyValue conforming to the
+// "telemetry.sdk.name" semantic conventions. It represents the name of the
+// telemetry SDK as defined above.
+func TelemetrySDKName(val string) attribute.KeyValue {
+ return TelemetrySDKNameKey.String(val)
+}
+
+// TelemetrySDKVersion returns an attribute KeyValue conforming to the
+// "telemetry.sdk.version" semantic conventions. It represents the version string
+// of the telemetry SDK.
+func TelemetrySDKVersion(val string) attribute.KeyValue {
+ return TelemetrySDKVersionKey.String(val)
+}
+
+// Enum values for telemetry.sdk.language
+var (
+ // cpp
+ // Stability: stable
+ TelemetrySDKLanguageCPP = TelemetrySDKLanguageKey.String("cpp")
+ // dotnet
+ // Stability: stable
+ TelemetrySDKLanguageDotnet = TelemetrySDKLanguageKey.String("dotnet")
+ // erlang
+ // Stability: stable
+ TelemetrySDKLanguageErlang = TelemetrySDKLanguageKey.String("erlang")
+ // go
+ // Stability: stable
+ TelemetrySDKLanguageGo = TelemetrySDKLanguageKey.String("go")
+ // java
+ // Stability: stable
+ TelemetrySDKLanguageJava = TelemetrySDKLanguageKey.String("java")
+ // nodejs
+ // Stability: stable
+ TelemetrySDKLanguageNodejs = TelemetrySDKLanguageKey.String("nodejs")
+ // php
+ // Stability: stable
+ TelemetrySDKLanguagePHP = TelemetrySDKLanguageKey.String("php")
+ // python
+ // Stability: stable
+ TelemetrySDKLanguagePython = TelemetrySDKLanguageKey.String("python")
+ // ruby
+ // Stability: stable
+ TelemetrySDKLanguageRuby = TelemetrySDKLanguageKey.String("ruby")
+ // rust
+ // Stability: stable
+ TelemetrySDKLanguageRust = TelemetrySDKLanguageKey.String("rust")
+ // swift
+ // Stability: stable
+ TelemetrySDKLanguageSwift = TelemetrySDKLanguageKey.String("swift")
+ // webjs
+ // Stability: stable
+ TelemetrySDKLanguageWebJS = TelemetrySDKLanguageKey.String("webjs")
+)
+
+// Namespace: test
+const (
+ // TestCaseNameKey is the attribute Key conforming to the "test.case.name"
+ // semantic conventions. It represents the fully qualified human readable name
+ // of the [test case].
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "org.example.TestCase1.test1", "example/tests/TestCase1.test1",
+ // "ExampleTestCase1_test1"
+ //
+ // [test case]: https://wikipedia.org/wiki/Test_case
+ TestCaseNameKey = attribute.Key("test.case.name")
+
+ // TestCaseResultStatusKey is the attribute Key conforming to the
+ // "test.case.result.status" semantic conventions. It represents the status of
+ // the actual test case result from test execution.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "pass", "fail"
+ TestCaseResultStatusKey = attribute.Key("test.case.result.status")
+
+ // TestSuiteNameKey is the attribute Key conforming to the "test.suite.name"
+ // semantic conventions. It represents the human readable name of a [test suite]
+ // .
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "TestSuite1"
+ //
+ // [test suite]: https://wikipedia.org/wiki/Test_suite
+ TestSuiteNameKey = attribute.Key("test.suite.name")
+
+ // TestSuiteRunStatusKey is the attribute Key conforming to the
+ // "test.suite.run.status" semantic conventions. It represents the status of the
+ // test suite run.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "success", "failure", "skipped", "aborted", "timed_out",
+ // "in_progress"
+ TestSuiteRunStatusKey = attribute.Key("test.suite.run.status")
+)
+
+// TestCaseName returns an attribute KeyValue conforming to the "test.case.name"
+// semantic conventions. It represents the fully qualified human readable name of
+// the [test case].
+//
+// [test case]: https://wikipedia.org/wiki/Test_case
+func TestCaseName(val string) attribute.KeyValue {
+ return TestCaseNameKey.String(val)
+}
+
+// TestSuiteName returns an attribute KeyValue conforming to the
+// "test.suite.name" semantic conventions. It represents the human readable name
+// of a [test suite].
+//
+// [test suite]: https://wikipedia.org/wiki/Test_suite
+func TestSuiteName(val string) attribute.KeyValue {
+ return TestSuiteNameKey.String(val)
+}
+
+// Enum values for test.case.result.status
+var (
+ // pass
+ // Stability: development
+ TestCaseResultStatusPass = TestCaseResultStatusKey.String("pass")
+ // fail
+ // Stability: development
+ TestCaseResultStatusFail = TestCaseResultStatusKey.String("fail")
+)
+
+// Enum values for test.suite.run.status
+var (
+ // success
+ // Stability: development
+ TestSuiteRunStatusSuccess = TestSuiteRunStatusKey.String("success")
+ // failure
+ // Stability: development
+ TestSuiteRunStatusFailure = TestSuiteRunStatusKey.String("failure")
+ // skipped
+ // Stability: development
+ TestSuiteRunStatusSkipped = TestSuiteRunStatusKey.String("skipped")
+ // aborted
+ // Stability: development
+ TestSuiteRunStatusAborted = TestSuiteRunStatusKey.String("aborted")
+ // timed_out
+ // Stability: development
+ TestSuiteRunStatusTimedOut = TestSuiteRunStatusKey.String("timed_out")
+ // in_progress
+ // Stability: development
+ TestSuiteRunStatusInProgress = TestSuiteRunStatusKey.String("in_progress")
+)
+
+// Namespace: thread
+const (
+ // ThreadIDKey is the attribute Key conforming to the "thread.id" semantic
+ // conventions. It represents the current "managed" thread ID (as opposed to OS
+ // thread ID).
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ ThreadIDKey = attribute.Key("thread.id")
+
+ // ThreadNameKey is the attribute Key conforming to the "thread.name" semantic
+ // conventions. It represents the current thread name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: main
+ ThreadNameKey = attribute.Key("thread.name")
+)
+
+// ThreadID returns an attribute KeyValue conforming to the "thread.id" semantic
+// conventions. It represents the current "managed" thread ID (as opposed to OS
+// thread ID).
+func ThreadID(val int) attribute.KeyValue {
+ return ThreadIDKey.Int(val)
+}
+
+// ThreadName returns an attribute KeyValue conforming to the "thread.name"
+// semantic conventions. It represents the current thread name.
+func ThreadName(val string) attribute.KeyValue {
+ return ThreadNameKey.String(val)
+}
+
+// Namespace: tls
+const (
+ // TLSCipherKey is the attribute Key conforming to the "tls.cipher" semantic
+ // conventions. It represents the string indicating the [cipher] used during the
+ // current connection.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "TLS_RSA_WITH_3DES_EDE_CBC_SHA",
+ // "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"
+ // Note: The values allowed for `tls.cipher` MUST be one of the `Descriptions`
+ // of the [registered TLS Cipher Suits].
+ //
+ // [cipher]: https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5
+ // [registered TLS Cipher Suits]: https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4
+ TLSCipherKey = attribute.Key("tls.cipher")
+
+ // TLSClientCertificateKey is the attribute Key conforming to the
+ // "tls.client.certificate" semantic conventions. It represents the PEM-encoded
+ // stand-alone certificate offered by the client. This is usually
+ // mutually-exclusive of `client.certificate_chain` since this value also exists
+ // in that list.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "MII..."
+ TLSClientCertificateKey = attribute.Key("tls.client.certificate")
+
+ // TLSClientCertificateChainKey is the attribute Key conforming to the
+ // "tls.client.certificate_chain" semantic conventions. It represents the array
+ // of PEM-encoded certificates that make up the certificate chain offered by the
+ // client. This is usually mutually-exclusive of `client.certificate` since that
+ // value should be the first certificate in the chain.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "MII...", "MI..."
+ TLSClientCertificateChainKey = attribute.Key("tls.client.certificate_chain")
+
+ // TLSClientHashMd5Key is the attribute Key conforming to the
+ // "tls.client.hash.md5" semantic conventions. It represents the certificate
+ // fingerprint using the MD5 digest of DER-encoded version of certificate
+ // offered by the client. For consistency with other hash values, this value
+ // should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC"
+ TLSClientHashMd5Key = attribute.Key("tls.client.hash.md5")
+
+ // TLSClientHashSha1Key is the attribute Key conforming to the
+ // "tls.client.hash.sha1" semantic conventions. It represents the certificate
+ // fingerprint using the SHA1 digest of DER-encoded version of certificate
+ // offered by the client. For consistency with other hash values, this value
+ // should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "9E393D93138888D288266C2D915214D1D1CCEB2A"
+ TLSClientHashSha1Key = attribute.Key("tls.client.hash.sha1")
+
+ // TLSClientHashSha256Key is the attribute Key conforming to the
+ // "tls.client.hash.sha256" semantic conventions. It represents the certificate
+ // fingerprint using the SHA256 digest of DER-encoded version of certificate
+ // offered by the client. For consistency with other hash values, this value
+ // should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0"
+ TLSClientHashSha256Key = attribute.Key("tls.client.hash.sha256")
+
+ // TLSClientIssuerKey is the attribute Key conforming to the "tls.client.issuer"
+ // semantic conventions. It represents the distinguished name of [subject] of
+ // the issuer of the x.509 certificate presented by the client.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "CN=Example Root CA, OU=Infrastructure Team, DC=example, DC=com"
+ //
+ // [subject]: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6
+ TLSClientIssuerKey = attribute.Key("tls.client.issuer")
+
+ // TLSClientJa3Key is the attribute Key conforming to the "tls.client.ja3"
+ // semantic conventions. It represents a hash that identifies clients based on
+ // how they perform an SSL/TLS handshake.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "d4e5b18d6b55c71272893221c96ba240"
+ TLSClientJa3Key = attribute.Key("tls.client.ja3")
+
+ // TLSClientNotAfterKey is the attribute Key conforming to the
+ // "tls.client.not_after" semantic conventions. It represents the date/Time
+ // indicating when client certificate is no longer considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "2021-01-01T00:00:00.000Z"
+ TLSClientNotAfterKey = attribute.Key("tls.client.not_after")
+
+ // TLSClientNotBeforeKey is the attribute Key conforming to the
+ // "tls.client.not_before" semantic conventions. It represents the date/Time
+ // indicating when client certificate is first considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "1970-01-01T00:00:00.000Z"
+ TLSClientNotBeforeKey = attribute.Key("tls.client.not_before")
+
+ // TLSClientSubjectKey is the attribute Key conforming to the
+ // "tls.client.subject" semantic conventions. It represents the distinguished
+ // name of subject of the x.509 certificate presented by the client.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "CN=myclient, OU=Documentation Team, DC=example, DC=com"
+ TLSClientSubjectKey = attribute.Key("tls.client.subject")
+
+ // TLSClientSupportedCiphersKey is the attribute Key conforming to the
+ // "tls.client.supported_ciphers" semantic conventions. It represents the array
+ // of ciphers offered by the client during the client hello.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
+ // "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"
+ TLSClientSupportedCiphersKey = attribute.Key("tls.client.supported_ciphers")
+
+ // TLSCurveKey is the attribute Key conforming to the "tls.curve" semantic
+ // conventions. It represents the string indicating the curve used for the given
+ // cipher, when applicable.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "secp256r1"
+ TLSCurveKey = attribute.Key("tls.curve")
+
+ // TLSEstablishedKey is the attribute Key conforming to the "tls.established"
+ // semantic conventions. It represents the boolean flag indicating if the TLS
+ // negotiation was successful and transitioned to an encrypted tunnel.
+ //
+ // Type: boolean
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: true
+ TLSEstablishedKey = attribute.Key("tls.established")
+
+ // TLSNextProtocolKey is the attribute Key conforming to the "tls.next_protocol"
+ // semantic conventions. It represents the string indicating the protocol being
+ // tunneled. Per the values in the [IANA registry], this string should be lower
+ // case.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "http/1.1"
+ //
+ // [IANA registry]: https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids
+ TLSNextProtocolKey = attribute.Key("tls.next_protocol")
+
+ // TLSProtocolNameKey is the attribute Key conforming to the "tls.protocol.name"
+ // semantic conventions. It represents the normalized lowercase protocol name
+ // parsed from original string of the negotiated [SSL/TLS protocol version].
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ //
+ // [SSL/TLS protocol version]: https://docs.openssl.org/1.1.1/man3/SSL_get_version/#return-values
+ TLSProtocolNameKey = attribute.Key("tls.protocol.name")
+
+ // TLSProtocolVersionKey is the attribute Key conforming to the
+ // "tls.protocol.version" semantic conventions. It represents the numeric part
+ // of the version parsed from the original string of the negotiated
+ // [SSL/TLS protocol version].
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "1.2", "3"
+ //
+ // [SSL/TLS protocol version]: https://docs.openssl.org/1.1.1/man3/SSL_get_version/#return-values
+ TLSProtocolVersionKey = attribute.Key("tls.protocol.version")
+
+ // TLSResumedKey is the attribute Key conforming to the "tls.resumed" semantic
+ // conventions. It represents the boolean flag indicating if this TLS connection
+ // was resumed from an existing TLS negotiation.
+ //
+ // Type: boolean
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: true
+ TLSResumedKey = attribute.Key("tls.resumed")
+
+ // TLSServerCertificateKey is the attribute Key conforming to the
+ // "tls.server.certificate" semantic conventions. It represents the PEM-encoded
+ // stand-alone certificate offered by the server. This is usually
+ // mutually-exclusive of `server.certificate_chain` since this value also exists
+ // in that list.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "MII..."
+ TLSServerCertificateKey = attribute.Key("tls.server.certificate")
+
+ // TLSServerCertificateChainKey is the attribute Key conforming to the
+ // "tls.server.certificate_chain" semantic conventions. It represents the array
+ // of PEM-encoded certificates that make up the certificate chain offered by the
+ // server. This is usually mutually-exclusive of `server.certificate` since that
+ // value should be the first certificate in the chain.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "MII...", "MI..."
+ TLSServerCertificateChainKey = attribute.Key("tls.server.certificate_chain")
+
+ // TLSServerHashMd5Key is the attribute Key conforming to the
+ // "tls.server.hash.md5" semantic conventions. It represents the certificate
+ // fingerprint using the MD5 digest of DER-encoded version of certificate
+ // offered by the server. For consistency with other hash values, this value
+ // should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC"
+ TLSServerHashMd5Key = attribute.Key("tls.server.hash.md5")
+
+ // TLSServerHashSha1Key is the attribute Key conforming to the
+ // "tls.server.hash.sha1" semantic conventions. It represents the certificate
+ // fingerprint using the SHA1 digest of DER-encoded version of certificate
+ // offered by the server. For consistency with other hash values, this value
+ // should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "9E393D93138888D288266C2D915214D1D1CCEB2A"
+ TLSServerHashSha1Key = attribute.Key("tls.server.hash.sha1")
+
+ // TLSServerHashSha256Key is the attribute Key conforming to the
+ // "tls.server.hash.sha256" semantic conventions. It represents the certificate
+ // fingerprint using the SHA256 digest of DER-encoded version of certificate
+ // offered by the server. For consistency with other hash values, this value
+ // should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0"
+ TLSServerHashSha256Key = attribute.Key("tls.server.hash.sha256")
+
+ // TLSServerIssuerKey is the attribute Key conforming to the "tls.server.issuer"
+ // semantic conventions. It represents the distinguished name of [subject] of
+ // the issuer of the x.509 certificate presented by the client.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "CN=Example Root CA, OU=Infrastructure Team, DC=example, DC=com"
+ //
+ // [subject]: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6
+ TLSServerIssuerKey = attribute.Key("tls.server.issuer")
+
+ // TLSServerJa3sKey is the attribute Key conforming to the "tls.server.ja3s"
+ // semantic conventions. It represents a hash that identifies servers based on
+ // how they perform an SSL/TLS handshake.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "d4e5b18d6b55c71272893221c96ba240"
+ TLSServerJa3sKey = attribute.Key("tls.server.ja3s")
+
+ // TLSServerNotAfterKey is the attribute Key conforming to the
+ // "tls.server.not_after" semantic conventions. It represents the date/Time
+ // indicating when server certificate is no longer considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "2021-01-01T00:00:00.000Z"
+ TLSServerNotAfterKey = attribute.Key("tls.server.not_after")
+
+ // TLSServerNotBeforeKey is the attribute Key conforming to the
+ // "tls.server.not_before" semantic conventions. It represents the date/Time
+ // indicating when server certificate is first considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "1970-01-01T00:00:00.000Z"
+ TLSServerNotBeforeKey = attribute.Key("tls.server.not_before")
+
+ // TLSServerSubjectKey is the attribute Key conforming to the
+ // "tls.server.subject" semantic conventions. It represents the distinguished
+ // name of subject of the x.509 certificate presented by the server.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "CN=myserver, OU=Documentation Team, DC=example, DC=com"
+ TLSServerSubjectKey = attribute.Key("tls.server.subject")
+)
+
+// TLSCipher returns an attribute KeyValue conforming to the "tls.cipher"
+// semantic conventions. It represents the string indicating the [cipher] used
+// during the current connection.
+//
+// [cipher]: https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5
+func TLSCipher(val string) attribute.KeyValue {
+ return TLSCipherKey.String(val)
+}
+
+// TLSClientCertificate returns an attribute KeyValue conforming to the
+// "tls.client.certificate" semantic conventions. It represents the PEM-encoded
+// stand-alone certificate offered by the client. This is usually
+// mutually-exclusive of `client.certificate_chain` since this value also exists
+// in that list.
+func TLSClientCertificate(val string) attribute.KeyValue {
+ return TLSClientCertificateKey.String(val)
+}
+
+// TLSClientCertificateChain returns an attribute KeyValue conforming to the
+// "tls.client.certificate_chain" semantic conventions. It represents the array
+// of PEM-encoded certificates that make up the certificate chain offered by the
+// client. This is usually mutually-exclusive of `client.certificate` since that
+// value should be the first certificate in the chain.
+func TLSClientCertificateChain(val ...string) attribute.KeyValue {
+ return TLSClientCertificateChainKey.StringSlice(val)
+}
+
+// TLSClientHashMd5 returns an attribute KeyValue conforming to the
+// "tls.client.hash.md5" semantic conventions. It represents the certificate
+// fingerprint using the MD5 digest of DER-encoded version of certificate offered
+// by the client. For consistency with other hash values, this value should be
+// formatted as an uppercase hash.
+func TLSClientHashMd5(val string) attribute.KeyValue {
+ return TLSClientHashMd5Key.String(val)
+}
+
+// TLSClientHashSha1 returns an attribute KeyValue conforming to the
+// "tls.client.hash.sha1" semantic conventions. It represents the certificate
+// fingerprint using the SHA1 digest of DER-encoded version of certificate
+// offered by the client. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSClientHashSha1(val string) attribute.KeyValue {
+ return TLSClientHashSha1Key.String(val)
+}
+
+// TLSClientHashSha256 returns an attribute KeyValue conforming to the
+// "tls.client.hash.sha256" semantic conventions. It represents the certificate
+// fingerprint using the SHA256 digest of DER-encoded version of certificate
+// offered by the client. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSClientHashSha256(val string) attribute.KeyValue {
+ return TLSClientHashSha256Key.String(val)
+}
+
+// TLSClientIssuer returns an attribute KeyValue conforming to the
+// "tls.client.issuer" semantic conventions. It represents the distinguished name
+// of [subject] of the issuer of the x.509 certificate presented by the client.
+//
+// [subject]: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6
+func TLSClientIssuer(val string) attribute.KeyValue {
+ return TLSClientIssuerKey.String(val)
+}
+
+// TLSClientJa3 returns an attribute KeyValue conforming to the "tls.client.ja3"
+// semantic conventions. It represents a hash that identifies clients based on
+// how they perform an SSL/TLS handshake.
+func TLSClientJa3(val string) attribute.KeyValue {
+ return TLSClientJa3Key.String(val)
+}
+
+// TLSClientNotAfter returns an attribute KeyValue conforming to the
+// "tls.client.not_after" semantic conventions. It represents the date/Time
+// indicating when client certificate is no longer considered valid.
+func TLSClientNotAfter(val string) attribute.KeyValue {
+ return TLSClientNotAfterKey.String(val)
+}
+
+// TLSClientNotBefore returns an attribute KeyValue conforming to the
+// "tls.client.not_before" semantic conventions. It represents the date/Time
+// indicating when client certificate is first considered valid.
+func TLSClientNotBefore(val string) attribute.KeyValue {
+ return TLSClientNotBeforeKey.String(val)
+}
+
+// TLSClientSubject returns an attribute KeyValue conforming to the
+// "tls.client.subject" semantic conventions. It represents the distinguished
+// name of subject of the x.509 certificate presented by the client.
+func TLSClientSubject(val string) attribute.KeyValue {
+ return TLSClientSubjectKey.String(val)
+}
+
+// TLSClientSupportedCiphers returns an attribute KeyValue conforming to the
+// "tls.client.supported_ciphers" semantic conventions. It represents the array
+// of ciphers offered by the client during the client hello.
+func TLSClientSupportedCiphers(val ...string) attribute.KeyValue {
+ return TLSClientSupportedCiphersKey.StringSlice(val)
+}
+
+// TLSCurve returns an attribute KeyValue conforming to the "tls.curve" semantic
+// conventions. It represents the string indicating the curve used for the given
+// cipher, when applicable.
+func TLSCurve(val string) attribute.KeyValue {
+ return TLSCurveKey.String(val)
+}
+
+// TLSEstablished returns an attribute KeyValue conforming to the
+// "tls.established" semantic conventions. It represents the boolean flag
+// indicating if the TLS negotiation was successful and transitioned to an
+// encrypted tunnel.
+func TLSEstablished(val bool) attribute.KeyValue {
+ return TLSEstablishedKey.Bool(val)
+}
+
+// TLSNextProtocol returns an attribute KeyValue conforming to the
+// "tls.next_protocol" semantic conventions. It represents the string indicating
+// the protocol being tunneled. Per the values in the [IANA registry], this
+// string should be lower case.
+//
+// [IANA registry]: https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids
+func TLSNextProtocol(val string) attribute.KeyValue {
+ return TLSNextProtocolKey.String(val)
+}
+
+// TLSProtocolVersion returns an attribute KeyValue conforming to the
+// "tls.protocol.version" semantic conventions. It represents the numeric part of
+// the version parsed from the original string of the negotiated
+// [SSL/TLS protocol version].
+//
+// [SSL/TLS protocol version]: https://docs.openssl.org/1.1.1/man3/SSL_get_version/#return-values
+func TLSProtocolVersion(val string) attribute.KeyValue {
+ return TLSProtocolVersionKey.String(val)
+}
+
+// TLSResumed returns an attribute KeyValue conforming to the "tls.resumed"
+// semantic conventions. It represents the boolean flag indicating if this TLS
+// connection was resumed from an existing TLS negotiation.
+func TLSResumed(val bool) attribute.KeyValue {
+ return TLSResumedKey.Bool(val)
+}
+
+// TLSServerCertificate returns an attribute KeyValue conforming to the
+// "tls.server.certificate" semantic conventions. It represents the PEM-encoded
+// stand-alone certificate offered by the server. This is usually
+// mutually-exclusive of `server.certificate_chain` since this value also exists
+// in that list.
+func TLSServerCertificate(val string) attribute.KeyValue {
+ return TLSServerCertificateKey.String(val)
+}
+
+// TLSServerCertificateChain returns an attribute KeyValue conforming to the
+// "tls.server.certificate_chain" semantic conventions. It represents the array
+// of PEM-encoded certificates that make up the certificate chain offered by the
+// server. This is usually mutually-exclusive of `server.certificate` since that
+// value should be the first certificate in the chain.
+func TLSServerCertificateChain(val ...string) attribute.KeyValue {
+ return TLSServerCertificateChainKey.StringSlice(val)
+}
+
+// TLSServerHashMd5 returns an attribute KeyValue conforming to the
+// "tls.server.hash.md5" semantic conventions. It represents the certificate
+// fingerprint using the MD5 digest of DER-encoded version of certificate offered
+// by the server. For consistency with other hash values, this value should be
+// formatted as an uppercase hash.
+func TLSServerHashMd5(val string) attribute.KeyValue {
+ return TLSServerHashMd5Key.String(val)
+}
+
+// TLSServerHashSha1 returns an attribute KeyValue conforming to the
+// "tls.server.hash.sha1" semantic conventions. It represents the certificate
+// fingerprint using the SHA1 digest of DER-encoded version of certificate
+// offered by the server. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSServerHashSha1(val string) attribute.KeyValue {
+ return TLSServerHashSha1Key.String(val)
+}
+
+// TLSServerHashSha256 returns an attribute KeyValue conforming to the
+// "tls.server.hash.sha256" semantic conventions. It represents the certificate
+// fingerprint using the SHA256 digest of DER-encoded version of certificate
+// offered by the server. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSServerHashSha256(val string) attribute.KeyValue {
+ return TLSServerHashSha256Key.String(val)
+}
+
+// TLSServerIssuer returns an attribute KeyValue conforming to the
+// "tls.server.issuer" semantic conventions. It represents the distinguished name
+// of [subject] of the issuer of the x.509 certificate presented by the client.
+//
+// [subject]: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6
+func TLSServerIssuer(val string) attribute.KeyValue {
+ return TLSServerIssuerKey.String(val)
+}
+
+// TLSServerJa3s returns an attribute KeyValue conforming to the
+// "tls.server.ja3s" semantic conventions. It represents a hash that identifies
+// servers based on how they perform an SSL/TLS handshake.
+func TLSServerJa3s(val string) attribute.KeyValue {
+ return TLSServerJa3sKey.String(val)
+}
+
+// TLSServerNotAfter returns an attribute KeyValue conforming to the
+// "tls.server.not_after" semantic conventions. It represents the date/Time
+// indicating when server certificate is no longer considered valid.
+func TLSServerNotAfter(val string) attribute.KeyValue {
+ return TLSServerNotAfterKey.String(val)
+}
+
+// TLSServerNotBefore returns an attribute KeyValue conforming to the
+// "tls.server.not_before" semantic conventions. It represents the date/Time
+// indicating when server certificate is first considered valid.
+func TLSServerNotBefore(val string) attribute.KeyValue {
+ return TLSServerNotBeforeKey.String(val)
+}
+
+// TLSServerSubject returns an attribute KeyValue conforming to the
+// "tls.server.subject" semantic conventions. It represents the distinguished
+// name of subject of the x.509 certificate presented by the server.
+func TLSServerSubject(val string) attribute.KeyValue {
+ return TLSServerSubjectKey.String(val)
+}
+
+// Enum values for tls.protocol.name
+var (
+ // ssl
+ // Stability: development
+ TLSProtocolNameSsl = TLSProtocolNameKey.String("ssl")
+ // tls
+ // Stability: development
+ TLSProtocolNameTLS = TLSProtocolNameKey.String("tls")
+)
+
+// Namespace: url
+const (
+ // URLDomainKey is the attribute Key conforming to the "url.domain" semantic
+ // conventions. It represents the domain extracted from the `url.full`, such as
+ // "opentelemetry.io".
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "www.foo.bar", "opentelemetry.io", "3.12.167.2",
+ // "[1080:0:0:0:8:800:200C:417A]"
+ // Note: In some cases a URL may refer to an IP and/or port directly, without a
+ // domain name. In this case, the IP address would go to the domain field. If
+ // the URL contains a [literal IPv6 address] enclosed by `[` and `]`, the `[`
+ // and `]` characters should also be captured in the domain field.
+ //
+ // [literal IPv6 address]: https://www.rfc-editor.org/rfc/rfc2732#section-2
+ URLDomainKey = attribute.Key("url.domain")
+
+ // URLExtensionKey is the attribute Key conforming to the "url.extension"
+ // semantic conventions. It represents the file extension extracted from the
+ // `url.full`, excluding the leading dot.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "png", "gz"
+ // Note: The file extension is only set if it exists, as not every url has a
+ // file extension. When the file name has multiple extensions `example.tar.gz`,
+ // only the last one should be captured `gz`, not `tar.gz`.
+ URLExtensionKey = attribute.Key("url.extension")
+
+ // URLFragmentKey is the attribute Key conforming to the "url.fragment" semantic
+ // conventions. It represents the [URI fragment] component.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "SemConv"
+ //
+ // [URI fragment]: https://www.rfc-editor.org/rfc/rfc3986#section-3.5
+ URLFragmentKey = attribute.Key("url.fragment")
+
+ // URLFullKey is the attribute Key conforming to the "url.full" semantic
+ // conventions. It represents the absolute URL describing a network resource
+ // according to [RFC3986].
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "https://www.foo.bar/search?q=OpenTelemetry#SemConv", "//localhost"
+ // Note: For network calls, URL usually has
+ // `scheme://host[:port][path][?query][#fragment]` format, where the fragment
+ // is not transmitted over HTTP, but if it is known, it SHOULD be included
+ // nevertheless.
+ //
+ // `url.full` MUST NOT contain credentials passed via URL in form of
+ // `https://username:password@www.example.com/`.
+ // In such case username and password SHOULD be redacted and attribute's value
+ // SHOULD be `https://REDACTED:REDACTED@www.example.com/`.
+ //
+ // `url.full` SHOULD capture the absolute URL when it is available (or can be
+ // reconstructed).
+ //
+ // Sensitive content provided in `url.full` SHOULD be scrubbed when
+ // instrumentations can identify it.
+ //
+ //
+ // Query string values for the following keys SHOULD be redacted by default and
+ // replaced by the
+ // value `REDACTED`:
+ //
+ // - [`AWSAccessKeyId`]
+ // - [`Signature`]
+ // - [`sig`]
+ // - [`X-Goog-Signature`]
+ //
+ // This list is subject to change over time.
+ //
+ // When a query string value is redacted, the query string key SHOULD still be
+ // preserved, e.g.
+ // `https://www.example.com/path?color=blue&sig=REDACTED`.
+ //
+ // [RFC3986]: https://www.rfc-editor.org/rfc/rfc3986
+ // [`AWSAccessKeyId`]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth
+ // [`Signature`]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth
+ // [`sig`]: https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token
+ // [`X-Goog-Signature`]: https://cloud.google.com/storage/docs/access-control/signed-urls
+ URLFullKey = attribute.Key("url.full")
+
+ // URLOriginalKey is the attribute Key conforming to the "url.original" semantic
+ // conventions. It represents the unmodified original URL as seen in the event
+ // source.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "https://www.foo.bar/search?q=OpenTelemetry#SemConv",
+ // "search?q=OpenTelemetry"
+ // Note: In network monitoring, the observed URL may be a full URL, whereas in
+ // access logs, the URL is often just represented as a path. This field is meant
+ // to represent the URL as it was observed, complete or not.
+ // `url.original` might contain credentials passed via URL in form of
+ // `https://username:password@www.example.com/`. In such case password and
+ // username SHOULD NOT be redacted and attribute's value SHOULD remain the same.
+ URLOriginalKey = attribute.Key("url.original")
+
+ // URLPathKey is the attribute Key conforming to the "url.path" semantic
+ // conventions. It represents the [URI path] component.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "/search"
+ // Note: Sensitive content provided in `url.path` SHOULD be scrubbed when
+ // instrumentations can identify it.
+ //
+ // [URI path]: https://www.rfc-editor.org/rfc/rfc3986#section-3.3
+ URLPathKey = attribute.Key("url.path")
+
+ // URLPortKey is the attribute Key conforming to the "url.port" semantic
+ // conventions. It represents the port extracted from the `url.full`.
+ //
+ // Type: int
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: 443
+ URLPortKey = attribute.Key("url.port")
+
+ // URLQueryKey is the attribute Key conforming to the "url.query" semantic
+ // conventions. It represents the [URI query] component.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "q=OpenTelemetry"
+ // Note: Sensitive content provided in `url.query` SHOULD be scrubbed when
+ // instrumentations can identify it.
+ //
+ //
+ // Query string values for the following keys SHOULD be redacted by default and
+ // replaced by the value `REDACTED`:
+ //
+ // - [`AWSAccessKeyId`]
+ // - [`Signature`]
+ // - [`sig`]
+ // - [`X-Goog-Signature`]
+ //
+ // This list is subject to change over time.
+ //
+ // When a query string value is redacted, the query string key SHOULD still be
+ // preserved, e.g.
+ // `q=OpenTelemetry&sig=REDACTED`.
+ //
+ // [URI query]: https://www.rfc-editor.org/rfc/rfc3986#section-3.4
+ // [`AWSAccessKeyId`]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth
+ // [`Signature`]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth
+ // [`sig`]: https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token
+ // [`X-Goog-Signature`]: https://cloud.google.com/storage/docs/access-control/signed-urls
+ URLQueryKey = attribute.Key("url.query")
+
+ // URLRegisteredDomainKey is the attribute Key conforming to the
+ // "url.registered_domain" semantic conventions. It represents the highest
+ // registered url domain, stripped of the subdomain.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "example.com", "foo.co.uk"
+ // Note: This value can be determined precisely with the [public suffix list].
+ // For example, the registered domain for `foo.example.com` is `example.com`.
+ // Trying to approximate this by simply taking the last two labels will not work
+ // well for TLDs such as `co.uk`.
+ //
+ // [public suffix list]: https://publicsuffix.org/
+ URLRegisteredDomainKey = attribute.Key("url.registered_domain")
+
+ // URLSchemeKey is the attribute Key conforming to the "url.scheme" semantic
+ // conventions. It represents the [URI scheme] component identifying the used
+ // protocol.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "https", "ftp", "telnet"
+ //
+ // [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
+ URLSchemeKey = attribute.Key("url.scheme")
+
+ // URLSubdomainKey is the attribute Key conforming to the "url.subdomain"
+ // semantic conventions. It represents the subdomain portion of a fully
+ // qualified domain name includes all of the names except the host name under
+ // the registered_domain. In a partially qualified domain, or if the
+ // qualification level of the full name cannot be determined, subdomain contains
+ // all of the names below the registered domain.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "east", "sub2.sub1"
+ // Note: The subdomain portion of `www.east.mydomain.co.uk` is `east`. If the
+ // domain has multiple levels of subdomain, such as `sub2.sub1.example.com`, the
+ // subdomain field should contain `sub2.sub1`, with no trailing period.
+ URLSubdomainKey = attribute.Key("url.subdomain")
+
+ // URLTemplateKey is the attribute Key conforming to the "url.template" semantic
+ // conventions. It represents the low-cardinality template of an
+ // [absolute path reference].
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "/users/{id}", "/users/:id", "/users?id={id}"
+ //
+ // [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2
+ URLTemplateKey = attribute.Key("url.template")
+
+ // URLTopLevelDomainKey is the attribute Key conforming to the
+ // "url.top_level_domain" semantic conventions. It represents the effective top
+ // level domain (eTLD), also known as the domain suffix, is the last part of the
+ // domain name. For example, the top level domain for example.com is `com`.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "com", "co.uk"
+ // Note: This value can be determined precisely with the [public suffix list].
+ //
+ // [public suffix list]: https://publicsuffix.org/
+ URLTopLevelDomainKey = attribute.Key("url.top_level_domain")
+)
+
+// URLDomain returns an attribute KeyValue conforming to the "url.domain"
+// semantic conventions. It represents the domain extracted from the `url.full`,
+// such as "opentelemetry.io".
+func URLDomain(val string) attribute.KeyValue {
+ return URLDomainKey.String(val)
+}
+
+// URLExtension returns an attribute KeyValue conforming to the "url.extension"
+// semantic conventions. It represents the file extension extracted from the
+// `url.full`, excluding the leading dot.
+func URLExtension(val string) attribute.KeyValue {
+ return URLExtensionKey.String(val)
+}
+
+// URLFragment returns an attribute KeyValue conforming to the "url.fragment"
+// semantic conventions. It represents the [URI fragment] component.
+//
+// [URI fragment]: https://www.rfc-editor.org/rfc/rfc3986#section-3.5
+func URLFragment(val string) attribute.KeyValue {
+ return URLFragmentKey.String(val)
+}
+
+// URLFull returns an attribute KeyValue conforming to the "url.full" semantic
+// conventions. It represents the absolute URL describing a network resource
+// according to [RFC3986].
+//
+// [RFC3986]: https://www.rfc-editor.org/rfc/rfc3986
+func URLFull(val string) attribute.KeyValue {
+ return URLFullKey.String(val)
+}
+
+// URLOriginal returns an attribute KeyValue conforming to the "url.original"
+// semantic conventions. It represents the unmodified original URL as seen in the
+// event source.
+func URLOriginal(val string) attribute.KeyValue {
+ return URLOriginalKey.String(val)
+}
+
+// URLPath returns an attribute KeyValue conforming to the "url.path" semantic
+// conventions. It represents the [URI path] component.
+//
+// [URI path]: https://www.rfc-editor.org/rfc/rfc3986#section-3.3
+func URLPath(val string) attribute.KeyValue {
+ return URLPathKey.String(val)
+}
+
+// URLPort returns an attribute KeyValue conforming to the "url.port" semantic
+// conventions. It represents the port extracted from the `url.full`.
+func URLPort(val int) attribute.KeyValue {
+ return URLPortKey.Int(val)
+}
+
+// URLQuery returns an attribute KeyValue conforming to the "url.query" semantic
+// conventions. It represents the [URI query] component.
+//
+// [URI query]: https://www.rfc-editor.org/rfc/rfc3986#section-3.4
+func URLQuery(val string) attribute.KeyValue {
+ return URLQueryKey.String(val)
+}
+
+// URLRegisteredDomain returns an attribute KeyValue conforming to the
+// "url.registered_domain" semantic conventions. It represents the highest
+// registered url domain, stripped of the subdomain.
+func URLRegisteredDomain(val string) attribute.KeyValue {
+ return URLRegisteredDomainKey.String(val)
+}
+
+// URLScheme returns an attribute KeyValue conforming to the "url.scheme"
+// semantic conventions. It represents the [URI scheme] component identifying the
+// used protocol.
+//
+// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
+func URLScheme(val string) attribute.KeyValue {
+ return URLSchemeKey.String(val)
+}
+
+// URLSubdomain returns an attribute KeyValue conforming to the "url.subdomain"
+// semantic conventions. It represents the subdomain portion of a fully qualified
+// domain name includes all of the names except the host name under the
+// registered_domain. In a partially qualified domain, or if the qualification
+// level of the full name cannot be determined, subdomain contains all of the
+// names below the registered domain.
+func URLSubdomain(val string) attribute.KeyValue {
+ return URLSubdomainKey.String(val)
+}
+
+// URLTemplate returns an attribute KeyValue conforming to the "url.template"
+// semantic conventions. It represents the low-cardinality template of an
+// [absolute path reference].
+//
+// [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2
+func URLTemplate(val string) attribute.KeyValue {
+ return URLTemplateKey.String(val)
+}
+
+// URLTopLevelDomain returns an attribute KeyValue conforming to the
+// "url.top_level_domain" semantic conventions. It represents the effective top
+// level domain (eTLD), also known as the domain suffix, is the last part of the
+// domain name. For example, the top level domain for example.com is `com`.
+func URLTopLevelDomain(val string) attribute.KeyValue {
+ return URLTopLevelDomainKey.String(val)
+}
+
+// Namespace: user
+const (
+ // UserEmailKey is the attribute Key conforming to the "user.email" semantic
+ // conventions. It represents the user email address.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "a.einstein@example.com"
+ UserEmailKey = attribute.Key("user.email")
+
+ // UserFullNameKey is the attribute Key conforming to the "user.full_name"
+ // semantic conventions. It represents the user's full name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Albert Einstein"
+ UserFullNameKey = attribute.Key("user.full_name")
+
+ // UserHashKey is the attribute Key conforming to the "user.hash" semantic
+ // conventions. It represents the unique user hash to correlate information for
+ // a user in anonymized form.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "364fc68eaf4c8acec74a4e52d7d1feaa"
+ // Note: Useful if `user.id` or `user.name` contain confidential information and
+ // cannot be used.
+ UserHashKey = attribute.Key("user.hash")
+
+ // UserIDKey is the attribute Key conforming to the "user.id" semantic
+ // conventions. It represents the unique identifier of the user.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "S-1-5-21-202424912787-2692429404-2351956786-1000"
+ UserIDKey = attribute.Key("user.id")
+
+ // UserNameKey is the attribute Key conforming to the "user.name" semantic
+ // conventions. It represents the short name or login/username of the user.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "a.einstein"
+ UserNameKey = attribute.Key("user.name")
+
+ // UserRolesKey is the attribute Key conforming to the "user.roles" semantic
+ // conventions. It represents the array of user roles at the time of the event.
+ //
+ // Type: string[]
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "admin", "reporting_user"
+ UserRolesKey = attribute.Key("user.roles")
+)
+
+// UserEmail returns an attribute KeyValue conforming to the "user.email"
+// semantic conventions. It represents the user email address.
+func UserEmail(val string) attribute.KeyValue {
+ return UserEmailKey.String(val)
+}
+
+// UserFullName returns an attribute KeyValue conforming to the "user.full_name"
+// semantic conventions. It represents the user's full name.
+func UserFullName(val string) attribute.KeyValue {
+ return UserFullNameKey.String(val)
+}
+
+// UserHash returns an attribute KeyValue conforming to the "user.hash" semantic
+// conventions. It represents the unique user hash to correlate information for a
+// user in anonymized form.
+func UserHash(val string) attribute.KeyValue {
+ return UserHashKey.String(val)
+}
+
+// UserID returns an attribute KeyValue conforming to the "user.id" semantic
+// conventions. It represents the unique identifier of the user.
+func UserID(val string) attribute.KeyValue {
+ return UserIDKey.String(val)
+}
+
+// UserName returns an attribute KeyValue conforming to the "user.name" semantic
+// conventions. It represents the short name or login/username of the user.
+func UserName(val string) attribute.KeyValue {
+ return UserNameKey.String(val)
+}
+
+// UserRoles returns an attribute KeyValue conforming to the "user.roles"
+// semantic conventions. It represents the array of user roles at the time of the
+// event.
+func UserRoles(val ...string) attribute.KeyValue {
+ return UserRolesKey.StringSlice(val)
+}
+
+// Namespace: user_agent
+const (
+ // UserAgentNameKey is the attribute Key conforming to the "user_agent.name"
+ // semantic conventions. It represents the name of the user-agent extracted from
+ // original. Usually refers to the browser's name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Safari", "YourApp"
+ // Note: [Example] of extracting browser's name from original string. In the
+ // case of using a user-agent for non-browser products, such as microservices
+ // with multiple names/versions inside the `user_agent.original`, the most
+ // significant name SHOULD be selected. In such a scenario it should align with
+ // `user_agent.version`
+ //
+ // [Example]: https://www.whatsmyua.info
+ UserAgentNameKey = attribute.Key("user_agent.name")
+
+ // UserAgentOriginalKey is the attribute Key conforming to the
+ // "user_agent.original" semantic conventions. It represents the value of the
+ // [HTTP User-Agent] header sent by the client.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Stable
+ //
+ // Examples: "CERN-LineMode/2.15 libwww/2.17b3", "Mozilla/5.0 (iPhone; CPU
+ // iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko)
+ // Version/14.1.2 Mobile/15E148 Safari/604.1", "YourApp/1.0.0
+ // grpc-java-okhttp/1.27.2"
+ //
+ // [HTTP User-Agent]: https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent
+ UserAgentOriginalKey = attribute.Key("user_agent.original")
+
+ // UserAgentOSNameKey is the attribute Key conforming to the
+ // "user_agent.os.name" semantic conventions. It represents the human readable
+ // operating system name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "iOS", "Android", "Ubuntu"
+ // Note: For mapping user agent strings to OS names, libraries such as
+ // [ua-parser] can be utilized.
+ //
+ // [ua-parser]: https://github.com/ua-parser
+ UserAgentOSNameKey = attribute.Key("user_agent.os.name")
+
+ // UserAgentOSVersionKey is the attribute Key conforming to the
+ // "user_agent.os.version" semantic conventions. It represents the version
+ // string of the operating system as defined in [Version Attributes].
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "14.2.1", "18.04.1"
+ // Note: For mapping user agent strings to OS versions, libraries such as
+ // [ua-parser] can be utilized.
+ //
+ // [Version Attributes]: /docs/resource/README.md#version-attributes
+ // [ua-parser]: https://github.com/ua-parser
+ UserAgentOSVersionKey = attribute.Key("user_agent.os.version")
+
+ // UserAgentSyntheticTypeKey is the attribute Key conforming to the
+ // "user_agent.synthetic.type" semantic conventions. It represents the specifies
+ // the category of synthetic traffic, such as tests or bots.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // Note: This attribute MAY be derived from the contents of the
+ // `user_agent.original` attribute. Components that populate the attribute are
+ // responsible for determining what they consider to be synthetic bot or test
+ // traffic. This attribute can either be set for self-identification purposes,
+ // or on telemetry detected to be generated as a result of a synthetic request.
+ // This attribute is useful for distinguishing between genuine client traffic
+ // and synthetic traffic generated by bots or tests.
+ UserAgentSyntheticTypeKey = attribute.Key("user_agent.synthetic.type")
+
+ // UserAgentVersionKey is the attribute Key conforming to the
+ // "user_agent.version" semantic conventions. It represents the version of the
+ // user-agent extracted from original. Usually refers to the browser's version.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "14.1.2", "1.0.0"
+ // Note: [Example] of extracting browser's version from original string. In the
+ // case of using a user-agent for non-browser products, such as microservices
+ // with multiple names/versions inside the `user_agent.original`, the most
+ // significant version SHOULD be selected. In such a scenario it should align
+ // with `user_agent.name`
+ //
+ // [Example]: https://www.whatsmyua.info
+ UserAgentVersionKey = attribute.Key("user_agent.version")
+)
+
+// UserAgentName returns an attribute KeyValue conforming to the
+// "user_agent.name" semantic conventions. It represents the name of the
+// user-agent extracted from original. Usually refers to the browser's name.
+func UserAgentName(val string) attribute.KeyValue {
+ return UserAgentNameKey.String(val)
+}
+
+// UserAgentOriginal returns an attribute KeyValue conforming to the
+// "user_agent.original" semantic conventions. It represents the value of the
+// [HTTP User-Agent] header sent by the client.
+//
+// [HTTP User-Agent]: https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent
+func UserAgentOriginal(val string) attribute.KeyValue {
+ return UserAgentOriginalKey.String(val)
+}
+
+// UserAgentOSName returns an attribute KeyValue conforming to the
+// "user_agent.os.name" semantic conventions. It represents the human readable
+// operating system name.
+func UserAgentOSName(val string) attribute.KeyValue {
+ return UserAgentOSNameKey.String(val)
+}
+
+// UserAgentOSVersion returns an attribute KeyValue conforming to the
+// "user_agent.os.version" semantic conventions. It represents the version string
+// of the operating system as defined in [Version Attributes].
+//
+// [Version Attributes]: /docs/resource/README.md#version-attributes
+func UserAgentOSVersion(val string) attribute.KeyValue {
+ return UserAgentOSVersionKey.String(val)
+}
+
+// UserAgentVersion returns an attribute KeyValue conforming to the
+// "user_agent.version" semantic conventions. It represents the version of the
+// user-agent extracted from original. Usually refers to the browser's version.
+func UserAgentVersion(val string) attribute.KeyValue {
+ return UserAgentVersionKey.String(val)
+}
+
+// Enum values for user_agent.synthetic.type
+var (
+ // Bot source.
+ // Stability: development
+ UserAgentSyntheticTypeBot = UserAgentSyntheticTypeKey.String("bot")
+ // Synthetic test source.
+ // Stability: development
+ UserAgentSyntheticTypeTest = UserAgentSyntheticTypeKey.String("test")
+)
+
+// Namespace: vcs
+const (
+ // VCSChangeIDKey is the attribute Key conforming to the "vcs.change.id"
+ // semantic conventions. It represents the ID of the change (pull request/merge
+ // request/changelist) if applicable. This is usually a unique (within
+ // repository) identifier generated by the VCS system.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "123"
+ VCSChangeIDKey = attribute.Key("vcs.change.id")
+
+ // VCSChangeStateKey is the attribute Key conforming to the "vcs.change.state"
+ // semantic conventions. It represents the state of the change (pull
+ // request/merge request/changelist).
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "open", "closed", "merged"
+ VCSChangeStateKey = attribute.Key("vcs.change.state")
+
+ // VCSChangeTitleKey is the attribute Key conforming to the "vcs.change.title"
+ // semantic conventions. It represents the human readable title of the change
+ // (pull request/merge request/changelist). This title is often a brief summary
+ // of the change and may get merged in to a ref as the commit summary.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "Fixes broken thing", "feat: add my new feature", "[chore] update
+ // dependency"
+ VCSChangeTitleKey = attribute.Key("vcs.change.title")
+
+ // VCSLineChangeTypeKey is the attribute Key conforming to the
+ // "vcs.line_change.type" semantic conventions. It represents the type of line
+ // change being measured on a branch or change.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "added", "removed"
+ VCSLineChangeTypeKey = attribute.Key("vcs.line_change.type")
+
+ // VCSOwnerNameKey is the attribute Key conforming to the "vcs.owner.name"
+ // semantic conventions. It represents the group owner within the version
+ // control system.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "my-org", "myteam", "business-unit"
+ VCSOwnerNameKey = attribute.Key("vcs.owner.name")
+
+ // VCSProviderNameKey is the attribute Key conforming to the "vcs.provider.name"
+ // semantic conventions. It represents the name of the version control system
+ // provider.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "github", "gitlab", "gitea", "bitbucket"
+ VCSProviderNameKey = attribute.Key("vcs.provider.name")
+
+ // VCSRefBaseNameKey is the attribute Key conforming to the "vcs.ref.base.name"
+ // semantic conventions. It represents the name of the [reference] such as
+ // **branch** or **tag** in the repository.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "my-feature-branch", "tag-1-test"
+ // Note: `base` refers to the starting point of a change. For example, `main`
+ // would be the base reference of type branch if you've created a new
+ // reference of type branch from it and created new commits.
+ //
+ // [reference]: https://git-scm.com/docs/gitglossary#def_ref
+ VCSRefBaseNameKey = attribute.Key("vcs.ref.base.name")
+
+ // VCSRefBaseRevisionKey is the attribute Key conforming to the
+ // "vcs.ref.base.revision" semantic conventions. It represents the revision,
+ // literally [revised version], The revision most often refers to a commit
+ // object in Git, or a revision number in SVN.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "9d59409acf479dfa0df1aa568182e43e43df8bbe28d60fcf2bc52e30068802cc",
+ // "main", "123", "HEAD"
+ // Note: `base` refers to the starting point of a change. For example, `main`
+ // would be the base reference of type branch if you've created a new
+ // reference of type branch from it and created new commits. The
+ // revision can be a full [hash value (see
+ // glossary)],
+ // of the recorded change to a ref within a repository pointing to a
+ // commit [commit] object. It does
+ // not necessarily have to be a hash; it can simply define a [revision
+ // number]
+ // which is an integer that is monotonically increasing. In cases where
+ // it is identical to the `ref.base.name`, it SHOULD still be included.
+ // It is up to the implementer to decide which value to set as the
+ // revision based on the VCS system and situational context.
+ //
+ // [revised version]: https://www.merriam-webster.com/dictionary/revision
+ // [hash value (see
+ // glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf
+ // [commit]: https://git-scm.com/docs/git-commit
+ // [revision
+ // number]: https://svnbook.red-bean.com/en/1.7/svn.tour.revs.specifiers.html
+ VCSRefBaseRevisionKey = attribute.Key("vcs.ref.base.revision")
+
+ // VCSRefBaseTypeKey is the attribute Key conforming to the "vcs.ref.base.type"
+ // semantic conventions. It represents the type of the [reference] in the
+ // repository.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "branch", "tag"
+ // Note: `base` refers to the starting point of a change. For example, `main`
+ // would be the base reference of type branch if you've created a new
+ // reference of type branch from it and created new commits.
+ //
+ // [reference]: https://git-scm.com/docs/gitglossary#def_ref
+ VCSRefBaseTypeKey = attribute.Key("vcs.ref.base.type")
+
+ // VCSRefHeadNameKey is the attribute Key conforming to the "vcs.ref.head.name"
+ // semantic conventions. It represents the name of the [reference] such as
+ // **branch** or **tag** in the repository.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "my-feature-branch", "tag-1-test"
+ // Note: `head` refers to where you are right now; the current reference at a
+ // given time.
+ //
+ // [reference]: https://git-scm.com/docs/gitglossary#def_ref
+ VCSRefHeadNameKey = attribute.Key("vcs.ref.head.name")
+
+ // VCSRefHeadRevisionKey is the attribute Key conforming to the
+ // "vcs.ref.head.revision" semantic conventions. It represents the revision,
+ // literally [revised version], The revision most often refers to a commit
+ // object in Git, or a revision number in SVN.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "9d59409acf479dfa0df1aa568182e43e43df8bbe28d60fcf2bc52e30068802cc",
+ // "main", "123", "HEAD"
+ // Note: `head` refers to where you are right now; the current reference at a
+ // given time.The revision can be a full [hash value (see
+ // glossary)],
+ // of the recorded change to a ref within a repository pointing to a
+ // commit [commit] object. It does
+ // not necessarily have to be a hash; it can simply define a [revision
+ // number]
+ // which is an integer that is monotonically increasing. In cases where
+ // it is identical to the `ref.head.name`, it SHOULD still be included.
+ // It is up to the implementer to decide which value to set as the
+ // revision based on the VCS system and situational context.
+ //
+ // [revised version]: https://www.merriam-webster.com/dictionary/revision
+ // [hash value (see
+ // glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf
+ // [commit]: https://git-scm.com/docs/git-commit
+ // [revision
+ // number]: https://svnbook.red-bean.com/en/1.7/svn.tour.revs.specifiers.html
+ VCSRefHeadRevisionKey = attribute.Key("vcs.ref.head.revision")
+
+ // VCSRefHeadTypeKey is the attribute Key conforming to the "vcs.ref.head.type"
+ // semantic conventions. It represents the type of the [reference] in the
+ // repository.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "branch", "tag"
+ // Note: `head` refers to where you are right now; the current reference at a
+ // given time.
+ //
+ // [reference]: https://git-scm.com/docs/gitglossary#def_ref
+ VCSRefHeadTypeKey = attribute.Key("vcs.ref.head.type")
+
+ // VCSRefTypeKey is the attribute Key conforming to the "vcs.ref.type" semantic
+ // conventions. It represents the type of the [reference] in the repository.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "branch", "tag"
+ //
+ // [reference]: https://git-scm.com/docs/gitglossary#def_ref
+ VCSRefTypeKey = attribute.Key("vcs.ref.type")
+
+ // VCSRepositoryNameKey is the attribute Key conforming to the
+ // "vcs.repository.name" semantic conventions. It represents the human readable
+ // name of the repository. It SHOULD NOT include any additional identifier like
+ // Group/SubGroup in GitLab or organization in GitHub.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "semantic-conventions", "my-cool-repo"
+ // Note: Due to it only being the name, it can clash with forks of the same
+ // repository if collecting telemetry across multiple orgs or groups in
+ // the same backends.
+ VCSRepositoryNameKey = attribute.Key("vcs.repository.name")
+
+ // VCSRepositoryURLFullKey is the attribute Key conforming to the
+ // "vcs.repository.url.full" semantic conventions. It represents the
+ // [canonical URL] of the repository providing the complete HTTP(S) address in
+ // order to locate and identify the repository through a browser.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples:
+ // "https://github.com/opentelemetry/open-telemetry-collector-contrib",
+ // "https://gitlab.com/my-org/my-project/my-projects-project/repo"
+ // Note: In Git Version Control Systems, the canonical URL SHOULD NOT include
+ // the `.git` extension.
+ //
+ // [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical.
+ VCSRepositoryURLFullKey = attribute.Key("vcs.repository.url.full")
+
+ // VCSRevisionDeltaDirectionKey is the attribute Key conforming to the
+ // "vcs.revision_delta.direction" semantic conventions. It represents the type
+ // of revision comparison.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "ahead", "behind"
+ VCSRevisionDeltaDirectionKey = attribute.Key("vcs.revision_delta.direction")
+)
+
+// VCSChangeID returns an attribute KeyValue conforming to the "vcs.change.id"
+// semantic conventions. It represents the ID of the change (pull request/merge
+// request/changelist) if applicable. This is usually a unique (within
+// repository) identifier generated by the VCS system.
+func VCSChangeID(val string) attribute.KeyValue {
+ return VCSChangeIDKey.String(val)
+}
+
+// VCSChangeTitle returns an attribute KeyValue conforming to the
+// "vcs.change.title" semantic conventions. It represents the human readable
+// title of the change (pull request/merge request/changelist). This title is
+// often a brief summary of the change and may get merged in to a ref as the
+// commit summary.
+func VCSChangeTitle(val string) attribute.KeyValue {
+ return VCSChangeTitleKey.String(val)
+}
+
+// VCSOwnerName returns an attribute KeyValue conforming to the "vcs.owner.name"
+// semantic conventions. It represents the group owner within the version control
+// system.
+func VCSOwnerName(val string) attribute.KeyValue {
+ return VCSOwnerNameKey.String(val)
+}
+
+// VCSRefBaseName returns an attribute KeyValue conforming to the
+// "vcs.ref.base.name" semantic conventions. It represents the name of the
+// [reference] such as **branch** or **tag** in the repository.
+//
+// [reference]: https://git-scm.com/docs/gitglossary#def_ref
+func VCSRefBaseName(val string) attribute.KeyValue {
+ return VCSRefBaseNameKey.String(val)
+}
+
+// VCSRefBaseRevision returns an attribute KeyValue conforming to the
+// "vcs.ref.base.revision" semantic conventions. It represents the revision,
+// literally [revised version], The revision most often refers to a commit object
+// in Git, or a revision number in SVN.
+//
+// [revised version]: https://www.merriam-webster.com/dictionary/revision
+func VCSRefBaseRevision(val string) attribute.KeyValue {
+ return VCSRefBaseRevisionKey.String(val)
+}
+
+// VCSRefHeadName returns an attribute KeyValue conforming to the
+// "vcs.ref.head.name" semantic conventions. It represents the name of the
+// [reference] such as **branch** or **tag** in the repository.
+//
+// [reference]: https://git-scm.com/docs/gitglossary#def_ref
+func VCSRefHeadName(val string) attribute.KeyValue {
+ return VCSRefHeadNameKey.String(val)
+}
+
+// VCSRefHeadRevision returns an attribute KeyValue conforming to the
+// "vcs.ref.head.revision" semantic conventions. It represents the revision,
+// literally [revised version], The revision most often refers to a commit object
+// in Git, or a revision number in SVN.
+//
+// [revised version]: https://www.merriam-webster.com/dictionary/revision
+func VCSRefHeadRevision(val string) attribute.KeyValue {
+ return VCSRefHeadRevisionKey.String(val)
+}
+
+// VCSRepositoryName returns an attribute KeyValue conforming to the
+// "vcs.repository.name" semantic conventions. It represents the human readable
+// name of the repository. It SHOULD NOT include any additional identifier like
+// Group/SubGroup in GitLab or organization in GitHub.
+func VCSRepositoryName(val string) attribute.KeyValue {
+ return VCSRepositoryNameKey.String(val)
+}
+
+// VCSRepositoryURLFull returns an attribute KeyValue conforming to the
+// "vcs.repository.url.full" semantic conventions. It represents the
+// [canonical URL] of the repository providing the complete HTTP(S) address in
+// order to locate and identify the repository through a browser.
+//
+// [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical.
+func VCSRepositoryURLFull(val string) attribute.KeyValue {
+ return VCSRepositoryURLFullKey.String(val)
+}
+
+// Enum values for vcs.change.state
+var (
+ // Open means the change is currently active and under review. It hasn't been
+ // merged into the target branch yet, and it's still possible to make changes or
+ // add comments.
+ // Stability: development
+ VCSChangeStateOpen = VCSChangeStateKey.String("open")
+ // WIP (work-in-progress, draft) means the change is still in progress and not
+ // yet ready for a full review. It might still undergo significant changes.
+ // Stability: development
+ VCSChangeStateWip = VCSChangeStateKey.String("wip")
+ // Closed means the merge request has been closed without merging. This can
+ // happen for various reasons, such as the changes being deemed unnecessary, the
+ // issue being resolved in another way, or the author deciding to withdraw the
+ // request.
+ // Stability: development
+ VCSChangeStateClosed = VCSChangeStateKey.String("closed")
+ // Merged indicates that the change has been successfully integrated into the
+ // target codebase.
+ // Stability: development
+ VCSChangeStateMerged = VCSChangeStateKey.String("merged")
+)
+
+// Enum values for vcs.line_change.type
+var (
+ // How many lines were added.
+ // Stability: development
+ VCSLineChangeTypeAdded = VCSLineChangeTypeKey.String("added")
+ // How many lines were removed.
+ // Stability: development
+ VCSLineChangeTypeRemoved = VCSLineChangeTypeKey.String("removed")
+)
+
+// Enum values for vcs.provider.name
+var (
+ // [GitHub]
+ // Stability: development
+ //
+ // [GitHub]: https://github.com
+ VCSProviderNameGithub = VCSProviderNameKey.String("github")
+ // [GitLab]
+ // Stability: development
+ //
+ // [GitLab]: https://gitlab.com
+ VCSProviderNameGitlab = VCSProviderNameKey.String("gitlab")
+ // [Gitea]
+ // Stability: development
+ //
+ // [Gitea]: https://gitea.io
+ VCSProviderNameGitea = VCSProviderNameKey.String("gitea")
+ // [Bitbucket]
+ // Stability: development
+ //
+ // [Bitbucket]: https://bitbucket.org
+ VCSProviderNameBitbucket = VCSProviderNameKey.String("bitbucket")
+)
+
+// Enum values for vcs.ref.base.type
+var (
+ // [branch]
+ // Stability: development
+ //
+ // [branch]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch
+ VCSRefBaseTypeBranch = VCSRefBaseTypeKey.String("branch")
+ // [tag]
+ // Stability: development
+ //
+ // [tag]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag
+ VCSRefBaseTypeTag = VCSRefBaseTypeKey.String("tag")
+)
+
+// Enum values for vcs.ref.head.type
+var (
+ // [branch]
+ // Stability: development
+ //
+ // [branch]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch
+ VCSRefHeadTypeBranch = VCSRefHeadTypeKey.String("branch")
+ // [tag]
+ // Stability: development
+ //
+ // [tag]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag
+ VCSRefHeadTypeTag = VCSRefHeadTypeKey.String("tag")
+)
+
+// Enum values for vcs.ref.type
+var (
+ // [branch]
+ // Stability: development
+ //
+ // [branch]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch
+ VCSRefTypeBranch = VCSRefTypeKey.String("branch")
+ // [tag]
+ // Stability: development
+ //
+ // [tag]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag
+ VCSRefTypeTag = VCSRefTypeKey.String("tag")
+)
+
+// Enum values for vcs.revision_delta.direction
+var (
+ // How many revisions the change is behind the target ref.
+ // Stability: development
+ VCSRevisionDeltaDirectionBehind = VCSRevisionDeltaDirectionKey.String("behind")
+ // How many revisions the change is ahead of the target ref.
+ // Stability: development
+ VCSRevisionDeltaDirectionAhead = VCSRevisionDeltaDirectionKey.String("ahead")
+)
+
+// Namespace: webengine
+const (
+ // WebEngineDescriptionKey is the attribute Key conforming to the
+ // "webengine.description" semantic conventions. It represents the additional
+ // description of the web engine (e.g. detailed version and edition
+ // information).
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) -
+ // 2.2.2.Final"
+ WebEngineDescriptionKey = attribute.Key("webengine.description")
+
+ // WebEngineNameKey is the attribute Key conforming to the "webengine.name"
+ // semantic conventions. It represents the name of the web engine.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "WildFly"
+ WebEngineNameKey = attribute.Key("webengine.name")
+
+ // WebEngineVersionKey is the attribute Key conforming to the
+ // "webengine.version" semantic conventions. It represents the version of the
+ // web engine.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "21.0.0"
+ WebEngineVersionKey = attribute.Key("webengine.version")
+)
+
+// WebEngineDescription returns an attribute KeyValue conforming to the
+// "webengine.description" semantic conventions. It represents the additional
+// description of the web engine (e.g. detailed version and edition information).
+func WebEngineDescription(val string) attribute.KeyValue {
+ return WebEngineDescriptionKey.String(val)
+}
+
+// WebEngineName returns an attribute KeyValue conforming to the "webengine.name"
+// semantic conventions. It represents the name of the web engine.
+func WebEngineName(val string) attribute.KeyValue {
+ return WebEngineNameKey.String(val)
+}
+
+// WebEngineVersion returns an attribute KeyValue conforming to the
+// "webengine.version" semantic conventions. It represents the version of the web
+// engine.
+func WebEngineVersion(val string) attribute.KeyValue {
+ return WebEngineVersionKey.String(val)
+}
+
+// Namespace: zos
+const (
+ // ZOSSmfIDKey is the attribute Key conforming to the "zos.smf.id" semantic
+ // conventions. It represents the System Management Facility (SMF) Identifier
+ // uniquely identified a z/OS system within a SYSPLEX or mainframe environment
+ // and is used for system and performance analysis.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "SYS1"
+ ZOSSmfIDKey = attribute.Key("zos.smf.id")
+
+ // ZOSSysplexNameKey is the attribute Key conforming to the "zos.sysplex.name"
+ // semantic conventions. It represents the name of the SYSPLEX to which the z/OS
+ // system belongs too.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: Development
+ //
+ // Examples: "SYSPLEX1"
+ ZOSSysplexNameKey = attribute.Key("zos.sysplex.name")
+)
+
+// ZOSSmfID returns an attribute KeyValue conforming to the "zos.smf.id" semantic
+// conventions. It represents the System Management Facility (SMF) Identifier
+// uniquely identified a z/OS system within a SYSPLEX or mainframe environment
+// and is used for system and performance analysis.
+func ZOSSmfID(val string) attribute.KeyValue {
+ return ZOSSmfIDKey.String(val)
+}
+
+// ZOSSysplexName returns an attribute KeyValue conforming to the
+// "zos.sysplex.name" semantic conventions. It represents the name of the SYSPLEX
+// to which the z/OS system belongs too.
+func ZOSSysplexName(val string) attribute.KeyValue {
+ return ZOSSysplexNameKey.String(val)
+}
\ No newline at end of file
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/doc.go
new file mode 100644
index 0000000000..1110103210
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/doc.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Package semconv implements OpenTelemetry semantic conventions.
+//
+// OpenTelemetry semantic conventions are agreed standardized naming
+// patterns for OpenTelemetry things. This package represents the v1.37.0
+// version of the OpenTelemetry semantic conventions.
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.37.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/error_type.go b/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/error_type.go
new file mode 100644
index 0000000000..666bded4ba
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/error_type.go
@@ -0,0 +1,31 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.37.0"
+
+import (
+ "fmt"
+ "reflect"
+
+ "go.opentelemetry.io/otel/attribute"
+)
+
+// ErrorType returns an [attribute.KeyValue] identifying the error type of err.
+func ErrorType(err error) attribute.KeyValue {
+ if err == nil {
+ return ErrorTypeOther
+ }
+ t := reflect.TypeOf(err)
+ var value string
+ if t.PkgPath() == "" && t.Name() == "" {
+ // Likely a builtin type.
+ value = t.String()
+ } else {
+ value = fmt.Sprintf("%s.%s", t.PkgPath(), t.Name())
+ }
+
+ if value == "" {
+ return ErrorTypeOther
+ }
+ return ErrorTypeKey.String(value)
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/exception.go
new file mode 100644
index 0000000000..e67469a4f6
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/exception.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.37.0"
+
+const (
+ // ExceptionEventName is the name of the Span event representing an exception.
+ ExceptionEventName = "exception"
+)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/otelconv/metric.go b/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/otelconv/metric.go
new file mode 100644
index 0000000000..a78eafd1fa
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/otelconv/metric.go
@@ -0,0 +1,2126 @@
+// Code generated from semantic convention specification. DO NOT EDIT.
+
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Package httpconv provides types and functionality for OpenTelemetry semantic
+// conventions in the "otel" namespace.
+package otelconv
+
+import (
+ "context"
+ "sync"
+
+ "go.opentelemetry.io/otel/attribute"
+ "go.opentelemetry.io/otel/metric"
+ "go.opentelemetry.io/otel/metric/noop"
+)
+
+var (
+ addOptPool = &sync.Pool{New: func() any { return &[]metric.AddOption{} }}
+ recOptPool = &sync.Pool{New: func() any { return &[]metric.RecordOption{} }}
+)
+
+// ErrorTypeAttr is an attribute conforming to the error.type semantic
+// conventions. It represents the describes a class of error the operation ended
+// with.
+type ErrorTypeAttr string
+
+var (
+ // ErrorTypeOther is a fallback error value to be used when the instrumentation
+ // doesn't define a custom value.
+ ErrorTypeOther ErrorTypeAttr = "_OTHER"
+)
+
+// ComponentTypeAttr is an attribute conforming to the otel.component.type
+// semantic conventions. It represents a name identifying the type of the
+// OpenTelemetry component.
+type ComponentTypeAttr string
+
+var (
+ // ComponentTypeBatchingSpanProcessor is the builtin SDK batching span
+ // processor.
+ ComponentTypeBatchingSpanProcessor ComponentTypeAttr = "batching_span_processor"
+ // ComponentTypeSimpleSpanProcessor is the builtin SDK simple span processor.
+ ComponentTypeSimpleSpanProcessor ComponentTypeAttr = "simple_span_processor"
+ // ComponentTypeBatchingLogProcessor is the builtin SDK batching log record
+ // processor.
+ ComponentTypeBatchingLogProcessor ComponentTypeAttr = "batching_log_processor"
+ // ComponentTypeSimpleLogProcessor is the builtin SDK simple log record
+ // processor.
+ ComponentTypeSimpleLogProcessor ComponentTypeAttr = "simple_log_processor"
+ // ComponentTypeOtlpGRPCSpanExporter is the OTLP span exporter over gRPC with
+ // protobuf serialization.
+ ComponentTypeOtlpGRPCSpanExporter ComponentTypeAttr = "otlp_grpc_span_exporter"
+ // ComponentTypeOtlpHTTPSpanExporter is the OTLP span exporter over HTTP with
+ // protobuf serialization.
+ ComponentTypeOtlpHTTPSpanExporter ComponentTypeAttr = "otlp_http_span_exporter"
+ // ComponentTypeOtlpHTTPJSONSpanExporter is the OTLP span exporter over HTTP
+ // with JSON serialization.
+ ComponentTypeOtlpHTTPJSONSpanExporter ComponentTypeAttr = "otlp_http_json_span_exporter"
+ // ComponentTypeZipkinHTTPSpanExporter is the zipkin span exporter over HTTP.
+ ComponentTypeZipkinHTTPSpanExporter ComponentTypeAttr = "zipkin_http_span_exporter"
+ // ComponentTypeOtlpGRPCLogExporter is the OTLP log record exporter over gRPC
+ // with protobuf serialization.
+ ComponentTypeOtlpGRPCLogExporter ComponentTypeAttr = "otlp_grpc_log_exporter"
+ // ComponentTypeOtlpHTTPLogExporter is the OTLP log record exporter over HTTP
+ // with protobuf serialization.
+ ComponentTypeOtlpHTTPLogExporter ComponentTypeAttr = "otlp_http_log_exporter"
+ // ComponentTypeOtlpHTTPJSONLogExporter is the OTLP log record exporter over
+ // HTTP with JSON serialization.
+ ComponentTypeOtlpHTTPJSONLogExporter ComponentTypeAttr = "otlp_http_json_log_exporter"
+ // ComponentTypePeriodicMetricReader is the builtin SDK periodically exporting
+ // metric reader.
+ ComponentTypePeriodicMetricReader ComponentTypeAttr = "periodic_metric_reader"
+ // ComponentTypeOtlpGRPCMetricExporter is the OTLP metric exporter over gRPC
+ // with protobuf serialization.
+ ComponentTypeOtlpGRPCMetricExporter ComponentTypeAttr = "otlp_grpc_metric_exporter"
+ // ComponentTypeOtlpHTTPMetricExporter is the OTLP metric exporter over HTTP
+ // with protobuf serialization.
+ ComponentTypeOtlpHTTPMetricExporter ComponentTypeAttr = "otlp_http_metric_exporter"
+ // ComponentTypeOtlpHTTPJSONMetricExporter is the OTLP metric exporter over HTTP
+ // with JSON serialization.
+ ComponentTypeOtlpHTTPJSONMetricExporter ComponentTypeAttr = "otlp_http_json_metric_exporter"
+ // ComponentTypePrometheusHTTPTextMetricExporter is the prometheus metric
+ // exporter over HTTP with the default text-based format.
+ ComponentTypePrometheusHTTPTextMetricExporter ComponentTypeAttr = "prometheus_http_text_metric_exporter"
+)
+
+// SpanParentOriginAttr is an attribute conforming to the otel.span.parent.origin
+// semantic conventions. It represents the determines whether the span has a
+// parent span, and if so, [whether it is a remote parent].
+//
+// [whether it is a remote parent]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote
+type SpanParentOriginAttr string
+
+var (
+ // SpanParentOriginNone is the span does not have a parent, it is a root span.
+ SpanParentOriginNone SpanParentOriginAttr = "none"
+ // SpanParentOriginLocal is the span has a parent and the parent's span context
+ // [isRemote()] is false.
+ //
+ // [isRemote()]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote
+ SpanParentOriginLocal SpanParentOriginAttr = "local"
+ // SpanParentOriginRemote is the span has a parent and the parent's span context
+ // [isRemote()] is true.
+ //
+ // [isRemote()]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote
+ SpanParentOriginRemote SpanParentOriginAttr = "remote"
+)
+
+// SpanSamplingResultAttr is an attribute conforming to the
+// otel.span.sampling_result semantic conventions. It represents the result value
+// of the sampler for this span.
+type SpanSamplingResultAttr string
+
+var (
+ // SpanSamplingResultDrop is the span is not sampled and not recording.
+ SpanSamplingResultDrop SpanSamplingResultAttr = "DROP"
+ // SpanSamplingResultRecordOnly is the span is not sampled, but recording.
+ SpanSamplingResultRecordOnly SpanSamplingResultAttr = "RECORD_ONLY"
+ // SpanSamplingResultRecordAndSample is the span is sampled and recording.
+ SpanSamplingResultRecordAndSample SpanSamplingResultAttr = "RECORD_AND_SAMPLE"
+)
+
+// RPCGRPCStatusCodeAttr is an attribute conforming to the rpc.grpc.status_code
+// semantic conventions. It represents the gRPC status code of the last gRPC
+// requests performed in scope of this export call.
+type RPCGRPCStatusCodeAttr int64
+
+var (
+ // RPCGRPCStatusCodeOk is the OK.
+ RPCGRPCStatusCodeOk RPCGRPCStatusCodeAttr = 0
+ // RPCGRPCStatusCodeCancelled is the CANCELLED.
+ RPCGRPCStatusCodeCancelled RPCGRPCStatusCodeAttr = 1
+ // RPCGRPCStatusCodeUnknown is the UNKNOWN.
+ RPCGRPCStatusCodeUnknown RPCGRPCStatusCodeAttr = 2
+ // RPCGRPCStatusCodeInvalidArgument is the INVALID_ARGUMENT.
+ RPCGRPCStatusCodeInvalidArgument RPCGRPCStatusCodeAttr = 3
+ // RPCGRPCStatusCodeDeadlineExceeded is the DEADLINE_EXCEEDED.
+ RPCGRPCStatusCodeDeadlineExceeded RPCGRPCStatusCodeAttr = 4
+ // RPCGRPCStatusCodeNotFound is the NOT_FOUND.
+ RPCGRPCStatusCodeNotFound RPCGRPCStatusCodeAttr = 5
+ // RPCGRPCStatusCodeAlreadyExists is the ALREADY_EXISTS.
+ RPCGRPCStatusCodeAlreadyExists RPCGRPCStatusCodeAttr = 6
+ // RPCGRPCStatusCodePermissionDenied is the PERMISSION_DENIED.
+ RPCGRPCStatusCodePermissionDenied RPCGRPCStatusCodeAttr = 7
+ // RPCGRPCStatusCodeResourceExhausted is the RESOURCE_EXHAUSTED.
+ RPCGRPCStatusCodeResourceExhausted RPCGRPCStatusCodeAttr = 8
+ // RPCGRPCStatusCodeFailedPrecondition is the FAILED_PRECONDITION.
+ RPCGRPCStatusCodeFailedPrecondition RPCGRPCStatusCodeAttr = 9
+ // RPCGRPCStatusCodeAborted is the ABORTED.
+ RPCGRPCStatusCodeAborted RPCGRPCStatusCodeAttr = 10
+ // RPCGRPCStatusCodeOutOfRange is the OUT_OF_RANGE.
+ RPCGRPCStatusCodeOutOfRange RPCGRPCStatusCodeAttr = 11
+ // RPCGRPCStatusCodeUnimplemented is the UNIMPLEMENTED.
+ RPCGRPCStatusCodeUnimplemented RPCGRPCStatusCodeAttr = 12
+ // RPCGRPCStatusCodeInternal is the INTERNAL.
+ RPCGRPCStatusCodeInternal RPCGRPCStatusCodeAttr = 13
+ // RPCGRPCStatusCodeUnavailable is the UNAVAILABLE.
+ RPCGRPCStatusCodeUnavailable RPCGRPCStatusCodeAttr = 14
+ // RPCGRPCStatusCodeDataLoss is the DATA_LOSS.
+ RPCGRPCStatusCodeDataLoss RPCGRPCStatusCodeAttr = 15
+ // RPCGRPCStatusCodeUnauthenticated is the UNAUTHENTICATED.
+ RPCGRPCStatusCodeUnauthenticated RPCGRPCStatusCodeAttr = 16
+)
+
+// SDKExporterLogExported is an instrument used to record metric values
+// conforming to the "otel.sdk.exporter.log.exported" semantic conventions. It
+// represents the number of log records for which the export has finished, either
+// successful or failed.
+type SDKExporterLogExported struct {
+ metric.Int64Counter
+}
+
+// NewSDKExporterLogExported returns a new SDKExporterLogExported instrument.
+func NewSDKExporterLogExported(
+ m metric.Meter,
+ opt ...metric.Int64CounterOption,
+) (SDKExporterLogExported, error) {
+ // Check if the meter is nil.
+ if m == nil {
+ return SDKExporterLogExported{noop.Int64Counter{}}, nil
+ }
+
+ i, err := m.Int64Counter(
+ "otel.sdk.exporter.log.exported",
+ append([]metric.Int64CounterOption{
+ metric.WithDescription("The number of log records for which the export has finished, either successful or failed."),
+ metric.WithUnit("{log_record}"),
+ }, opt...)...,
+ )
+ if err != nil {
+ return SDKExporterLogExported{noop.Int64Counter{}}, err
+ }
+ return SDKExporterLogExported{i}, nil
+}
+
+// Inst returns the underlying metric instrument.
+func (m SDKExporterLogExported) Inst() metric.Int64Counter {
+ return m.Int64Counter
+}
+
+// Name returns the semantic convention name of the instrument.
+func (SDKExporterLogExported) Name() string {
+ return "otel.sdk.exporter.log.exported"
+}
+
+// Unit returns the semantic convention unit of the instrument
+func (SDKExporterLogExported) Unit() string {
+ return "{log_record}"
+}
+
+// Description returns the semantic convention description of the instrument
+func (SDKExporterLogExported) Description() string {
+ return "The number of log records for which the export has finished, either successful or failed."
+}
+
+// Add adds incr to the existing count for attrs.
+//
+// All additional attrs passed are included in the recorded value.
+//
+// For successful exports, `error.type` MUST NOT be set. For failed exports,
+// `error.type` MUST contain the failure cause.
+// For exporters with partial success semantics (e.g. OTLP with
+// `rejected_log_records`), rejected log records MUST count as failed and only
+// non-rejected log records count as success.
+// If no rejection reason is available, `rejected` SHOULD be used as value for
+// `error.type`.
+func (m SDKExporterLogExported) Add(
+ ctx context.Context,
+ incr int64,
+ attrs ...attribute.KeyValue,
+) {
+ if len(attrs) == 0 {
+ m.Int64Counter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(
+ *o,
+ metric.WithAttributes(
+ attrs...,
+ ),
+ )
+
+ m.Int64Counter.Add(ctx, incr, *o...)
+}
+
+// AddSet adds incr to the existing count for set.
+//
+// For successful exports, `error.type` MUST NOT be set. For failed exports,
+// `error.type` MUST contain the failure cause.
+// For exporters with partial success semantics (e.g. OTLP with
+// `rejected_log_records`), rejected log records MUST count as failed and only
+// non-rejected log records count as success.
+// If no rejection reason is available, `rejected` SHOULD be used as value for
+// `error.type`.
+func (m SDKExporterLogExported) AddSet(ctx context.Context, incr int64, set attribute.Set) {
+ if set.Len() == 0 {
+ m.Int64Counter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(*o, metric.WithAttributeSet(set))
+ m.Int64Counter.Add(ctx, incr, *o...)
+}
+
+// AttrErrorType returns an optional attribute for the "error.type" semantic
+// convention. It represents the describes a class of error the operation ended
+// with.
+func (SDKExporterLogExported) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue {
+ return attribute.String("error.type", string(val))
+}
+
+// AttrComponentName returns an optional attribute for the "otel.component.name"
+// semantic convention. It represents a name uniquely identifying the instance of
+// the OpenTelemetry component within its containing SDK instance.
+func (SDKExporterLogExported) AttrComponentName(val string) attribute.KeyValue {
+ return attribute.String("otel.component.name", val)
+}
+
+// AttrComponentType returns an optional attribute for the "otel.component.type"
+// semantic convention. It represents a name identifying the type of the
+// OpenTelemetry component.
+func (SDKExporterLogExported) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
+ return attribute.String("otel.component.type", string(val))
+}
+
+// AttrServerAddress returns an optional attribute for the "server.address"
+// semantic convention. It represents the server domain name if available without
+// reverse DNS lookup; otherwise, IP address or Unix domain socket name.
+func (SDKExporterLogExported) AttrServerAddress(val string) attribute.KeyValue {
+ return attribute.String("server.address", val)
+}
+
+// AttrServerPort returns an optional attribute for the "server.port" semantic
+// convention. It represents the server port number.
+func (SDKExporterLogExported) AttrServerPort(val int) attribute.KeyValue {
+ return attribute.Int("server.port", val)
+}
+
+// SDKExporterLogInflight is an instrument used to record metric values
+// conforming to the "otel.sdk.exporter.log.inflight" semantic conventions. It
+// represents the number of log records which were passed to the exporter, but
+// that have not been exported yet (neither successful, nor failed).
+type SDKExporterLogInflight struct {
+ metric.Int64UpDownCounter
+}
+
+// NewSDKExporterLogInflight returns a new SDKExporterLogInflight instrument.
+func NewSDKExporterLogInflight(
+ m metric.Meter,
+ opt ...metric.Int64UpDownCounterOption,
+) (SDKExporterLogInflight, error) {
+ // Check if the meter is nil.
+ if m == nil {
+ return SDKExporterLogInflight{noop.Int64UpDownCounter{}}, nil
+ }
+
+ i, err := m.Int64UpDownCounter(
+ "otel.sdk.exporter.log.inflight",
+ append([]metric.Int64UpDownCounterOption{
+ metric.WithDescription("The number of log records which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)."),
+ metric.WithUnit("{log_record}"),
+ }, opt...)...,
+ )
+ if err != nil {
+ return SDKExporterLogInflight{noop.Int64UpDownCounter{}}, err
+ }
+ return SDKExporterLogInflight{i}, nil
+}
+
+// Inst returns the underlying metric instrument.
+func (m SDKExporterLogInflight) Inst() metric.Int64UpDownCounter {
+ return m.Int64UpDownCounter
+}
+
+// Name returns the semantic convention name of the instrument.
+func (SDKExporterLogInflight) Name() string {
+ return "otel.sdk.exporter.log.inflight"
+}
+
+// Unit returns the semantic convention unit of the instrument
+func (SDKExporterLogInflight) Unit() string {
+ return "{log_record}"
+}
+
+// Description returns the semantic convention description of the instrument
+func (SDKExporterLogInflight) Description() string {
+ return "The number of log records which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)."
+}
+
+// Add adds incr to the existing count for attrs.
+//
+// All additional attrs passed are included in the recorded value.
+//
+// For successful exports, `error.type` MUST NOT be set. For failed exports,
+// `error.type` MUST contain the failure cause.
+func (m SDKExporterLogInflight) Add(
+ ctx context.Context,
+ incr int64,
+ attrs ...attribute.KeyValue,
+) {
+ if len(attrs) == 0 {
+ m.Int64UpDownCounter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(
+ *o,
+ metric.WithAttributes(
+ attrs...,
+ ),
+ )
+
+ m.Int64UpDownCounter.Add(ctx, incr, *o...)
+}
+
+// AddSet adds incr to the existing count for set.
+//
+// For successful exports, `error.type` MUST NOT be set. For failed exports,
+// `error.type` MUST contain the failure cause.
+func (m SDKExporterLogInflight) AddSet(ctx context.Context, incr int64, set attribute.Set) {
+ if set.Len() == 0 {
+ m.Int64UpDownCounter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(*o, metric.WithAttributeSet(set))
+ m.Int64UpDownCounter.Add(ctx, incr, *o...)
+}
+
+// AttrComponentName returns an optional attribute for the "otel.component.name"
+// semantic convention. It represents a name uniquely identifying the instance of
+// the OpenTelemetry component within its containing SDK instance.
+func (SDKExporterLogInflight) AttrComponentName(val string) attribute.KeyValue {
+ return attribute.String("otel.component.name", val)
+}
+
+// AttrComponentType returns an optional attribute for the "otel.component.type"
+// semantic convention. It represents a name identifying the type of the
+// OpenTelemetry component.
+func (SDKExporterLogInflight) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
+ return attribute.String("otel.component.type", string(val))
+}
+
+// AttrServerAddress returns an optional attribute for the "server.address"
+// semantic convention. It represents the server domain name if available without
+// reverse DNS lookup; otherwise, IP address or Unix domain socket name.
+func (SDKExporterLogInflight) AttrServerAddress(val string) attribute.KeyValue {
+ return attribute.String("server.address", val)
+}
+
+// AttrServerPort returns an optional attribute for the "server.port" semantic
+// convention. It represents the server port number.
+func (SDKExporterLogInflight) AttrServerPort(val int) attribute.KeyValue {
+ return attribute.Int("server.port", val)
+}
+
+// SDKExporterMetricDataPointExported is an instrument used to record metric
+// values conforming to the "otel.sdk.exporter.metric_data_point.exported"
+// semantic conventions. It represents the number of metric data points for which
+// the export has finished, either successful or failed.
+type SDKExporterMetricDataPointExported struct {
+ metric.Int64Counter
+}
+
+// NewSDKExporterMetricDataPointExported returns a new
+// SDKExporterMetricDataPointExported instrument.
+func NewSDKExporterMetricDataPointExported(
+ m metric.Meter,
+ opt ...metric.Int64CounterOption,
+) (SDKExporterMetricDataPointExported, error) {
+ // Check if the meter is nil.
+ if m == nil {
+ return SDKExporterMetricDataPointExported{noop.Int64Counter{}}, nil
+ }
+
+ i, err := m.Int64Counter(
+ "otel.sdk.exporter.metric_data_point.exported",
+ append([]metric.Int64CounterOption{
+ metric.WithDescription("The number of metric data points for which the export has finished, either successful or failed."),
+ metric.WithUnit("{data_point}"),
+ }, opt...)...,
+ )
+ if err != nil {
+ return SDKExporterMetricDataPointExported{noop.Int64Counter{}}, err
+ }
+ return SDKExporterMetricDataPointExported{i}, nil
+}
+
+// Inst returns the underlying metric instrument.
+func (m SDKExporterMetricDataPointExported) Inst() metric.Int64Counter {
+ return m.Int64Counter
+}
+
+// Name returns the semantic convention name of the instrument.
+func (SDKExporterMetricDataPointExported) Name() string {
+ return "otel.sdk.exporter.metric_data_point.exported"
+}
+
+// Unit returns the semantic convention unit of the instrument
+func (SDKExporterMetricDataPointExported) Unit() string {
+ return "{data_point}"
+}
+
+// Description returns the semantic convention description of the instrument
+func (SDKExporterMetricDataPointExported) Description() string {
+ return "The number of metric data points for which the export has finished, either successful or failed."
+}
+
+// Add adds incr to the existing count for attrs.
+//
+// All additional attrs passed are included in the recorded value.
+//
+// For successful exports, `error.type` MUST NOT be set. For failed exports,
+// `error.type` MUST contain the failure cause.
+// For exporters with partial success semantics (e.g. OTLP with
+// `rejected_data_points`), rejected data points MUST count as failed and only
+// non-rejected data points count as success.
+// If no rejection reason is available, `rejected` SHOULD be used as value for
+// `error.type`.
+func (m SDKExporterMetricDataPointExported) Add(
+ ctx context.Context,
+ incr int64,
+ attrs ...attribute.KeyValue,
+) {
+ if len(attrs) == 0 {
+ m.Int64Counter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(
+ *o,
+ metric.WithAttributes(
+ attrs...,
+ ),
+ )
+
+ m.Int64Counter.Add(ctx, incr, *o...)
+}
+
+// AddSet adds incr to the existing count for set.
+//
+// For successful exports, `error.type` MUST NOT be set. For failed exports,
+// `error.type` MUST contain the failure cause.
+// For exporters with partial success semantics (e.g. OTLP with
+// `rejected_data_points`), rejected data points MUST count as failed and only
+// non-rejected data points count as success.
+// If no rejection reason is available, `rejected` SHOULD be used as value for
+// `error.type`.
+func (m SDKExporterMetricDataPointExported) AddSet(ctx context.Context, incr int64, set attribute.Set) {
+ if set.Len() == 0 {
+ m.Int64Counter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(*o, metric.WithAttributeSet(set))
+ m.Int64Counter.Add(ctx, incr, *o...)
+}
+
+// AttrErrorType returns an optional attribute for the "error.type" semantic
+// convention. It represents the describes a class of error the operation ended
+// with.
+func (SDKExporterMetricDataPointExported) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue {
+ return attribute.String("error.type", string(val))
+}
+
+// AttrComponentName returns an optional attribute for the "otel.component.name"
+// semantic convention. It represents a name uniquely identifying the instance of
+// the OpenTelemetry component within its containing SDK instance.
+func (SDKExporterMetricDataPointExported) AttrComponentName(val string) attribute.KeyValue {
+ return attribute.String("otel.component.name", val)
+}
+
+// AttrComponentType returns an optional attribute for the "otel.component.type"
+// semantic convention. It represents a name identifying the type of the
+// OpenTelemetry component.
+func (SDKExporterMetricDataPointExported) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
+ return attribute.String("otel.component.type", string(val))
+}
+
+// AttrServerAddress returns an optional attribute for the "server.address"
+// semantic convention. It represents the server domain name if available without
+// reverse DNS lookup; otherwise, IP address or Unix domain socket name.
+func (SDKExporterMetricDataPointExported) AttrServerAddress(val string) attribute.KeyValue {
+ return attribute.String("server.address", val)
+}
+
+// AttrServerPort returns an optional attribute for the "server.port" semantic
+// convention. It represents the server port number.
+func (SDKExporterMetricDataPointExported) AttrServerPort(val int) attribute.KeyValue {
+ return attribute.Int("server.port", val)
+}
+
+// SDKExporterMetricDataPointInflight is an instrument used to record metric
+// values conforming to the "otel.sdk.exporter.metric_data_point.inflight"
+// semantic conventions. It represents the number of metric data points which
+// were passed to the exporter, but that have not been exported yet (neither
+// successful, nor failed).
+type SDKExporterMetricDataPointInflight struct {
+ metric.Int64UpDownCounter
+}
+
+// NewSDKExporterMetricDataPointInflight returns a new
+// SDKExporterMetricDataPointInflight instrument.
+func NewSDKExporterMetricDataPointInflight(
+ m metric.Meter,
+ opt ...metric.Int64UpDownCounterOption,
+) (SDKExporterMetricDataPointInflight, error) {
+ // Check if the meter is nil.
+ if m == nil {
+ return SDKExporterMetricDataPointInflight{noop.Int64UpDownCounter{}}, nil
+ }
+
+ i, err := m.Int64UpDownCounter(
+ "otel.sdk.exporter.metric_data_point.inflight",
+ append([]metric.Int64UpDownCounterOption{
+ metric.WithDescription("The number of metric data points which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)."),
+ metric.WithUnit("{data_point}"),
+ }, opt...)...,
+ )
+ if err != nil {
+ return SDKExporterMetricDataPointInflight{noop.Int64UpDownCounter{}}, err
+ }
+ return SDKExporterMetricDataPointInflight{i}, nil
+}
+
+// Inst returns the underlying metric instrument.
+func (m SDKExporterMetricDataPointInflight) Inst() metric.Int64UpDownCounter {
+ return m.Int64UpDownCounter
+}
+
+// Name returns the semantic convention name of the instrument.
+func (SDKExporterMetricDataPointInflight) Name() string {
+ return "otel.sdk.exporter.metric_data_point.inflight"
+}
+
+// Unit returns the semantic convention unit of the instrument
+func (SDKExporterMetricDataPointInflight) Unit() string {
+ return "{data_point}"
+}
+
+// Description returns the semantic convention description of the instrument
+func (SDKExporterMetricDataPointInflight) Description() string {
+ return "The number of metric data points which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)."
+}
+
+// Add adds incr to the existing count for attrs.
+//
+// All additional attrs passed are included in the recorded value.
+//
+// For successful exports, `error.type` MUST NOT be set. For failed exports,
+// `error.type` MUST contain the failure cause.
+func (m SDKExporterMetricDataPointInflight) Add(
+ ctx context.Context,
+ incr int64,
+ attrs ...attribute.KeyValue,
+) {
+ if len(attrs) == 0 {
+ m.Int64UpDownCounter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(
+ *o,
+ metric.WithAttributes(
+ attrs...,
+ ),
+ )
+
+ m.Int64UpDownCounter.Add(ctx, incr, *o...)
+}
+
+// AddSet adds incr to the existing count for set.
+//
+// For successful exports, `error.type` MUST NOT be set. For failed exports,
+// `error.type` MUST contain the failure cause.
+func (m SDKExporterMetricDataPointInflight) AddSet(ctx context.Context, incr int64, set attribute.Set) {
+ if set.Len() == 0 {
+ m.Int64UpDownCounter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(*o, metric.WithAttributeSet(set))
+ m.Int64UpDownCounter.Add(ctx, incr, *o...)
+}
+
+// AttrComponentName returns an optional attribute for the "otel.component.name"
+// semantic convention. It represents a name uniquely identifying the instance of
+// the OpenTelemetry component within its containing SDK instance.
+func (SDKExporterMetricDataPointInflight) AttrComponentName(val string) attribute.KeyValue {
+ return attribute.String("otel.component.name", val)
+}
+
+// AttrComponentType returns an optional attribute for the "otel.component.type"
+// semantic convention. It represents a name identifying the type of the
+// OpenTelemetry component.
+func (SDKExporterMetricDataPointInflight) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
+ return attribute.String("otel.component.type", string(val))
+}
+
+// AttrServerAddress returns an optional attribute for the "server.address"
+// semantic convention. It represents the server domain name if available without
+// reverse DNS lookup; otherwise, IP address or Unix domain socket name.
+func (SDKExporterMetricDataPointInflight) AttrServerAddress(val string) attribute.KeyValue {
+ return attribute.String("server.address", val)
+}
+
+// AttrServerPort returns an optional attribute for the "server.port" semantic
+// convention. It represents the server port number.
+func (SDKExporterMetricDataPointInflight) AttrServerPort(val int) attribute.KeyValue {
+ return attribute.Int("server.port", val)
+}
+
+// SDKExporterOperationDuration is an instrument used to record metric values
+// conforming to the "otel.sdk.exporter.operation.duration" semantic conventions.
+// It represents the duration of exporting a batch of telemetry records.
+type SDKExporterOperationDuration struct {
+ metric.Float64Histogram
+}
+
+// NewSDKExporterOperationDuration returns a new SDKExporterOperationDuration
+// instrument.
+func NewSDKExporterOperationDuration(
+ m metric.Meter,
+ opt ...metric.Float64HistogramOption,
+) (SDKExporterOperationDuration, error) {
+ // Check if the meter is nil.
+ if m == nil {
+ return SDKExporterOperationDuration{noop.Float64Histogram{}}, nil
+ }
+
+ i, err := m.Float64Histogram(
+ "otel.sdk.exporter.operation.duration",
+ append([]metric.Float64HistogramOption{
+ metric.WithDescription("The duration of exporting a batch of telemetry records."),
+ metric.WithUnit("s"),
+ }, opt...)...,
+ )
+ if err != nil {
+ return SDKExporterOperationDuration{noop.Float64Histogram{}}, err
+ }
+ return SDKExporterOperationDuration{i}, nil
+}
+
+// Inst returns the underlying metric instrument.
+func (m SDKExporterOperationDuration) Inst() metric.Float64Histogram {
+ return m.Float64Histogram
+}
+
+// Name returns the semantic convention name of the instrument.
+func (SDKExporterOperationDuration) Name() string {
+ return "otel.sdk.exporter.operation.duration"
+}
+
+// Unit returns the semantic convention unit of the instrument
+func (SDKExporterOperationDuration) Unit() string {
+ return "s"
+}
+
+// Description returns the semantic convention description of the instrument
+func (SDKExporterOperationDuration) Description() string {
+ return "The duration of exporting a batch of telemetry records."
+}
+
+// Record records val to the current distribution for attrs.
+//
+// All additional attrs passed are included in the recorded value.
+//
+// This metric defines successful operations using the full success definitions
+// for [http]
+// and [grpc]. Anything else is defined as an unsuccessful operation. For
+// successful
+// operations, `error.type` MUST NOT be set. For unsuccessful export operations,
+// `error.type` MUST contain a relevant failure cause.
+//
+// [http]: https://github.com/open-telemetry/opentelemetry-proto/blob/v1.5.0/docs/specification.md#full-success-1
+// [grpc]: https://github.com/open-telemetry/opentelemetry-proto/blob/v1.5.0/docs/specification.md#full-success
+func (m SDKExporterOperationDuration) Record(
+ ctx context.Context,
+ val float64,
+ attrs ...attribute.KeyValue,
+) {
+ if len(attrs) == 0 {
+ m.Float64Histogram.Record(ctx, val)
+ return
+ }
+
+ o := recOptPool.Get().(*[]metric.RecordOption)
+ defer func() {
+ *o = (*o)[:0]
+ recOptPool.Put(o)
+ }()
+
+ *o = append(
+ *o,
+ metric.WithAttributes(
+ attrs...,
+ ),
+ )
+
+ m.Float64Histogram.Record(ctx, val, *o...)
+}
+
+// RecordSet records val to the current distribution for set.
+//
+// This metric defines successful operations using the full success definitions
+// for [http]
+// and [grpc]. Anything else is defined as an unsuccessful operation. For
+// successful
+// operations, `error.type` MUST NOT be set. For unsuccessful export operations,
+// `error.type` MUST contain a relevant failure cause.
+//
+// [http]: https://github.com/open-telemetry/opentelemetry-proto/blob/v1.5.0/docs/specification.md#full-success-1
+// [grpc]: https://github.com/open-telemetry/opentelemetry-proto/blob/v1.5.0/docs/specification.md#full-success
+func (m SDKExporterOperationDuration) RecordSet(ctx context.Context, val float64, set attribute.Set) {
+ if set.Len() == 0 {
+ m.Float64Histogram.Record(ctx, val)
+ }
+
+ o := recOptPool.Get().(*[]metric.RecordOption)
+ defer func() {
+ *o = (*o)[:0]
+ recOptPool.Put(o)
+ }()
+
+ *o = append(*o, metric.WithAttributeSet(set))
+ m.Float64Histogram.Record(ctx, val, *o...)
+}
+
+// AttrErrorType returns an optional attribute for the "error.type" semantic
+// convention. It represents the describes a class of error the operation ended
+// with.
+func (SDKExporterOperationDuration) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue {
+ return attribute.String("error.type", string(val))
+}
+
+// AttrHTTPResponseStatusCode returns an optional attribute for the
+// "http.response.status_code" semantic convention. It represents the HTTP status
+// code of the last HTTP request performed in scope of this export call.
+func (SDKExporterOperationDuration) AttrHTTPResponseStatusCode(val int) attribute.KeyValue {
+ return attribute.Int("http.response.status_code", val)
+}
+
+// AttrComponentName returns an optional attribute for the "otel.component.name"
+// semantic convention. It represents a name uniquely identifying the instance of
+// the OpenTelemetry component within its containing SDK instance.
+func (SDKExporterOperationDuration) AttrComponentName(val string) attribute.KeyValue {
+ return attribute.String("otel.component.name", val)
+}
+
+// AttrComponentType returns an optional attribute for the "otel.component.type"
+// semantic convention. It represents a name identifying the type of the
+// OpenTelemetry component.
+func (SDKExporterOperationDuration) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
+ return attribute.String("otel.component.type", string(val))
+}
+
+// AttrRPCGRPCStatusCode returns an optional attribute for the
+// "rpc.grpc.status_code" semantic convention. It represents the gRPC status code
+// of the last gRPC requests performed in scope of this export call.
+func (SDKExporterOperationDuration) AttrRPCGRPCStatusCode(val RPCGRPCStatusCodeAttr) attribute.KeyValue {
+ return attribute.Int64("rpc.grpc.status_code", int64(val))
+}
+
+// AttrServerAddress returns an optional attribute for the "server.address"
+// semantic convention. It represents the server domain name if available without
+// reverse DNS lookup; otherwise, IP address or Unix domain socket name.
+func (SDKExporterOperationDuration) AttrServerAddress(val string) attribute.KeyValue {
+ return attribute.String("server.address", val)
+}
+
+// AttrServerPort returns an optional attribute for the "server.port" semantic
+// convention. It represents the server port number.
+func (SDKExporterOperationDuration) AttrServerPort(val int) attribute.KeyValue {
+ return attribute.Int("server.port", val)
+}
+
+// SDKExporterSpanExported is an instrument used to record metric values
+// conforming to the "otel.sdk.exporter.span.exported" semantic conventions. It
+// represents the number of spans for which the export has finished, either
+// successful or failed.
+type SDKExporterSpanExported struct {
+ metric.Int64Counter
+}
+
+// NewSDKExporterSpanExported returns a new SDKExporterSpanExported instrument.
+func NewSDKExporterSpanExported(
+ m metric.Meter,
+ opt ...metric.Int64CounterOption,
+) (SDKExporterSpanExported, error) {
+ // Check if the meter is nil.
+ if m == nil {
+ return SDKExporterSpanExported{noop.Int64Counter{}}, nil
+ }
+
+ i, err := m.Int64Counter(
+ "otel.sdk.exporter.span.exported",
+ append([]metric.Int64CounterOption{
+ metric.WithDescription("The number of spans for which the export has finished, either successful or failed."),
+ metric.WithUnit("{span}"),
+ }, opt...)...,
+ )
+ if err != nil {
+ return SDKExporterSpanExported{noop.Int64Counter{}}, err
+ }
+ return SDKExporterSpanExported{i}, nil
+}
+
+// Inst returns the underlying metric instrument.
+func (m SDKExporterSpanExported) Inst() metric.Int64Counter {
+ return m.Int64Counter
+}
+
+// Name returns the semantic convention name of the instrument.
+func (SDKExporterSpanExported) Name() string {
+ return "otel.sdk.exporter.span.exported"
+}
+
+// Unit returns the semantic convention unit of the instrument
+func (SDKExporterSpanExported) Unit() string {
+ return "{span}"
+}
+
+// Description returns the semantic convention description of the instrument
+func (SDKExporterSpanExported) Description() string {
+ return "The number of spans for which the export has finished, either successful or failed."
+}
+
+// Add adds incr to the existing count for attrs.
+//
+// All additional attrs passed are included in the recorded value.
+//
+// For successful exports, `error.type` MUST NOT be set. For failed exports,
+// `error.type` MUST contain the failure cause.
+// For exporters with partial success semantics (e.g. OTLP with `rejected_spans`
+// ), rejected spans MUST count as failed and only non-rejected spans count as
+// success.
+// If no rejection reason is available, `rejected` SHOULD be used as value for
+// `error.type`.
+func (m SDKExporterSpanExported) Add(
+ ctx context.Context,
+ incr int64,
+ attrs ...attribute.KeyValue,
+) {
+ if len(attrs) == 0 {
+ m.Int64Counter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(
+ *o,
+ metric.WithAttributes(
+ attrs...,
+ ),
+ )
+
+ m.Int64Counter.Add(ctx, incr, *o...)
+}
+
+// AddSet adds incr to the existing count for set.
+//
+// For successful exports, `error.type` MUST NOT be set. For failed exports,
+// `error.type` MUST contain the failure cause.
+// For exporters with partial success semantics (e.g. OTLP with `rejected_spans`
+// ), rejected spans MUST count as failed and only non-rejected spans count as
+// success.
+// If no rejection reason is available, `rejected` SHOULD be used as value for
+// `error.type`.
+func (m SDKExporterSpanExported) AddSet(ctx context.Context, incr int64, set attribute.Set) {
+ if set.Len() == 0 {
+ m.Int64Counter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(*o, metric.WithAttributeSet(set))
+ m.Int64Counter.Add(ctx, incr, *o...)
+}
+
+// AttrErrorType returns an optional attribute for the "error.type" semantic
+// convention. It represents the describes a class of error the operation ended
+// with.
+func (SDKExporterSpanExported) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue {
+ return attribute.String("error.type", string(val))
+}
+
+// AttrComponentName returns an optional attribute for the "otel.component.name"
+// semantic convention. It represents a name uniquely identifying the instance of
+// the OpenTelemetry component within its containing SDK instance.
+func (SDKExporterSpanExported) AttrComponentName(val string) attribute.KeyValue {
+ return attribute.String("otel.component.name", val)
+}
+
+// AttrComponentType returns an optional attribute for the "otel.component.type"
+// semantic convention. It represents a name identifying the type of the
+// OpenTelemetry component.
+func (SDKExporterSpanExported) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
+ return attribute.String("otel.component.type", string(val))
+}
+
+// AttrServerAddress returns an optional attribute for the "server.address"
+// semantic convention. It represents the server domain name if available without
+// reverse DNS lookup; otherwise, IP address or Unix domain socket name.
+func (SDKExporterSpanExported) AttrServerAddress(val string) attribute.KeyValue {
+ return attribute.String("server.address", val)
+}
+
+// AttrServerPort returns an optional attribute for the "server.port" semantic
+// convention. It represents the server port number.
+func (SDKExporterSpanExported) AttrServerPort(val int) attribute.KeyValue {
+ return attribute.Int("server.port", val)
+}
+
+// SDKExporterSpanInflight is an instrument used to record metric values
+// conforming to the "otel.sdk.exporter.span.inflight" semantic conventions. It
+// represents the number of spans which were passed to the exporter, but that
+// have not been exported yet (neither successful, nor failed).
+type SDKExporterSpanInflight struct {
+ metric.Int64UpDownCounter
+}
+
+// NewSDKExporterSpanInflight returns a new SDKExporterSpanInflight instrument.
+func NewSDKExporterSpanInflight(
+ m metric.Meter,
+ opt ...metric.Int64UpDownCounterOption,
+) (SDKExporterSpanInflight, error) {
+ // Check if the meter is nil.
+ if m == nil {
+ return SDKExporterSpanInflight{noop.Int64UpDownCounter{}}, nil
+ }
+
+ i, err := m.Int64UpDownCounter(
+ "otel.sdk.exporter.span.inflight",
+ append([]metric.Int64UpDownCounterOption{
+ metric.WithDescription("The number of spans which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)."),
+ metric.WithUnit("{span}"),
+ }, opt...)...,
+ )
+ if err != nil {
+ return SDKExporterSpanInflight{noop.Int64UpDownCounter{}}, err
+ }
+ return SDKExporterSpanInflight{i}, nil
+}
+
+// Inst returns the underlying metric instrument.
+func (m SDKExporterSpanInflight) Inst() metric.Int64UpDownCounter {
+ return m.Int64UpDownCounter
+}
+
+// Name returns the semantic convention name of the instrument.
+func (SDKExporterSpanInflight) Name() string {
+ return "otel.sdk.exporter.span.inflight"
+}
+
+// Unit returns the semantic convention unit of the instrument
+func (SDKExporterSpanInflight) Unit() string {
+ return "{span}"
+}
+
+// Description returns the semantic convention description of the instrument
+func (SDKExporterSpanInflight) Description() string {
+ return "The number of spans which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)."
+}
+
+// Add adds incr to the existing count for attrs.
+//
+// All additional attrs passed are included in the recorded value.
+//
+// For successful exports, `error.type` MUST NOT be set. For failed exports,
+// `error.type` MUST contain the failure cause.
+func (m SDKExporterSpanInflight) Add(
+ ctx context.Context,
+ incr int64,
+ attrs ...attribute.KeyValue,
+) {
+ if len(attrs) == 0 {
+ m.Int64UpDownCounter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(
+ *o,
+ metric.WithAttributes(
+ attrs...,
+ ),
+ )
+
+ m.Int64UpDownCounter.Add(ctx, incr, *o...)
+}
+
+// AddSet adds incr to the existing count for set.
+//
+// For successful exports, `error.type` MUST NOT be set. For failed exports,
+// `error.type` MUST contain the failure cause.
+func (m SDKExporterSpanInflight) AddSet(ctx context.Context, incr int64, set attribute.Set) {
+ if set.Len() == 0 {
+ m.Int64UpDownCounter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(*o, metric.WithAttributeSet(set))
+ m.Int64UpDownCounter.Add(ctx, incr, *o...)
+}
+
+// AttrComponentName returns an optional attribute for the "otel.component.name"
+// semantic convention. It represents a name uniquely identifying the instance of
+// the OpenTelemetry component within its containing SDK instance.
+func (SDKExporterSpanInflight) AttrComponentName(val string) attribute.KeyValue {
+ return attribute.String("otel.component.name", val)
+}
+
+// AttrComponentType returns an optional attribute for the "otel.component.type"
+// semantic convention. It represents a name identifying the type of the
+// OpenTelemetry component.
+func (SDKExporterSpanInflight) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
+ return attribute.String("otel.component.type", string(val))
+}
+
+// AttrServerAddress returns an optional attribute for the "server.address"
+// semantic convention. It represents the server domain name if available without
+// reverse DNS lookup; otherwise, IP address or Unix domain socket name.
+func (SDKExporterSpanInflight) AttrServerAddress(val string) attribute.KeyValue {
+ return attribute.String("server.address", val)
+}
+
+// AttrServerPort returns an optional attribute for the "server.port" semantic
+// convention. It represents the server port number.
+func (SDKExporterSpanInflight) AttrServerPort(val int) attribute.KeyValue {
+ return attribute.Int("server.port", val)
+}
+
+// SDKLogCreated is an instrument used to record metric values conforming to the
+// "otel.sdk.log.created" semantic conventions. It represents the number of logs
+// submitted to enabled SDK Loggers.
+type SDKLogCreated struct {
+ metric.Int64Counter
+}
+
+// NewSDKLogCreated returns a new SDKLogCreated instrument.
+func NewSDKLogCreated(
+ m metric.Meter,
+ opt ...metric.Int64CounterOption,
+) (SDKLogCreated, error) {
+ // Check if the meter is nil.
+ if m == nil {
+ return SDKLogCreated{noop.Int64Counter{}}, nil
+ }
+
+ i, err := m.Int64Counter(
+ "otel.sdk.log.created",
+ append([]metric.Int64CounterOption{
+ metric.WithDescription("The number of logs submitted to enabled SDK Loggers."),
+ metric.WithUnit("{log_record}"),
+ }, opt...)...,
+ )
+ if err != nil {
+ return SDKLogCreated{noop.Int64Counter{}}, err
+ }
+ return SDKLogCreated{i}, nil
+}
+
+// Inst returns the underlying metric instrument.
+func (m SDKLogCreated) Inst() metric.Int64Counter {
+ return m.Int64Counter
+}
+
+// Name returns the semantic convention name of the instrument.
+func (SDKLogCreated) Name() string {
+ return "otel.sdk.log.created"
+}
+
+// Unit returns the semantic convention unit of the instrument
+func (SDKLogCreated) Unit() string {
+ return "{log_record}"
+}
+
+// Description returns the semantic convention description of the instrument
+func (SDKLogCreated) Description() string {
+ return "The number of logs submitted to enabled SDK Loggers."
+}
+
+// Add adds incr to the existing count for attrs.
+func (m SDKLogCreated) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue) {
+ if len(attrs) == 0 {
+ m.Int64Counter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(*o, metric.WithAttributes(attrs...))
+ m.Int64Counter.Add(ctx, incr, *o...)
+}
+
+// AddSet adds incr to the existing count for set.
+func (m SDKLogCreated) AddSet(ctx context.Context, incr int64, set attribute.Set) {
+ if set.Len() == 0 {
+ m.Int64Counter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(*o, metric.WithAttributeSet(set))
+ m.Int64Counter.Add(ctx, incr, *o...)
+}
+
+// SDKMetricReaderCollectionDuration is an instrument used to record metric
+// values conforming to the "otel.sdk.metric_reader.collection.duration" semantic
+// conventions. It represents the duration of the collect operation of the metric
+// reader.
+type SDKMetricReaderCollectionDuration struct {
+ metric.Float64Histogram
+}
+
+// NewSDKMetricReaderCollectionDuration returns a new
+// SDKMetricReaderCollectionDuration instrument.
+func NewSDKMetricReaderCollectionDuration(
+ m metric.Meter,
+ opt ...metric.Float64HistogramOption,
+) (SDKMetricReaderCollectionDuration, error) {
+ // Check if the meter is nil.
+ if m == nil {
+ return SDKMetricReaderCollectionDuration{noop.Float64Histogram{}}, nil
+ }
+
+ i, err := m.Float64Histogram(
+ "otel.sdk.metric_reader.collection.duration",
+ append([]metric.Float64HistogramOption{
+ metric.WithDescription("The duration of the collect operation of the metric reader."),
+ metric.WithUnit("s"),
+ }, opt...)...,
+ )
+ if err != nil {
+ return SDKMetricReaderCollectionDuration{noop.Float64Histogram{}}, err
+ }
+ return SDKMetricReaderCollectionDuration{i}, nil
+}
+
+// Inst returns the underlying metric instrument.
+func (m SDKMetricReaderCollectionDuration) Inst() metric.Float64Histogram {
+ return m.Float64Histogram
+}
+
+// Name returns the semantic convention name of the instrument.
+func (SDKMetricReaderCollectionDuration) Name() string {
+ return "otel.sdk.metric_reader.collection.duration"
+}
+
+// Unit returns the semantic convention unit of the instrument
+func (SDKMetricReaderCollectionDuration) Unit() string {
+ return "s"
+}
+
+// Description returns the semantic convention description of the instrument
+func (SDKMetricReaderCollectionDuration) Description() string {
+ return "The duration of the collect operation of the metric reader."
+}
+
+// Record records val to the current distribution for attrs.
+//
+// All additional attrs passed are included in the recorded value.
+//
+// For successful collections, `error.type` MUST NOT be set. For failed
+// collections, `error.type` SHOULD contain the failure cause.
+// It can happen that metrics collection is successful for some MetricProducers,
+// while others fail. In that case `error.type` SHOULD be set to any of the
+// failure causes.
+func (m SDKMetricReaderCollectionDuration) Record(
+ ctx context.Context,
+ val float64,
+ attrs ...attribute.KeyValue,
+) {
+ if len(attrs) == 0 {
+ m.Float64Histogram.Record(ctx, val)
+ return
+ }
+
+ o := recOptPool.Get().(*[]metric.RecordOption)
+ defer func() {
+ *o = (*o)[:0]
+ recOptPool.Put(o)
+ }()
+
+ *o = append(
+ *o,
+ metric.WithAttributes(
+ attrs...,
+ ),
+ )
+
+ m.Float64Histogram.Record(ctx, val, *o...)
+}
+
+// RecordSet records val to the current distribution for set.
+//
+// For successful collections, `error.type` MUST NOT be set. For failed
+// collections, `error.type` SHOULD contain the failure cause.
+// It can happen that metrics collection is successful for some MetricProducers,
+// while others fail. In that case `error.type` SHOULD be set to any of the
+// failure causes.
+func (m SDKMetricReaderCollectionDuration) RecordSet(ctx context.Context, val float64, set attribute.Set) {
+ if set.Len() == 0 {
+ m.Float64Histogram.Record(ctx, val)
+ }
+
+ o := recOptPool.Get().(*[]metric.RecordOption)
+ defer func() {
+ *o = (*o)[:0]
+ recOptPool.Put(o)
+ }()
+
+ *o = append(*o, metric.WithAttributeSet(set))
+ m.Float64Histogram.Record(ctx, val, *o...)
+}
+
+// AttrErrorType returns an optional attribute for the "error.type" semantic
+// convention. It represents the describes a class of error the operation ended
+// with.
+func (SDKMetricReaderCollectionDuration) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue {
+ return attribute.String("error.type", string(val))
+}
+
+// AttrComponentName returns an optional attribute for the "otel.component.name"
+// semantic convention. It represents a name uniquely identifying the instance of
+// the OpenTelemetry component within its containing SDK instance.
+func (SDKMetricReaderCollectionDuration) AttrComponentName(val string) attribute.KeyValue {
+ return attribute.String("otel.component.name", val)
+}
+
+// AttrComponentType returns an optional attribute for the "otel.component.type"
+// semantic convention. It represents a name identifying the type of the
+// OpenTelemetry component.
+func (SDKMetricReaderCollectionDuration) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
+ return attribute.String("otel.component.type", string(val))
+}
+
+// SDKProcessorLogProcessed is an instrument used to record metric values
+// conforming to the "otel.sdk.processor.log.processed" semantic conventions. It
+// represents the number of log records for which the processing has finished,
+// either successful or failed.
+type SDKProcessorLogProcessed struct {
+ metric.Int64Counter
+}
+
+// NewSDKProcessorLogProcessed returns a new SDKProcessorLogProcessed instrument.
+func NewSDKProcessorLogProcessed(
+ m metric.Meter,
+ opt ...metric.Int64CounterOption,
+) (SDKProcessorLogProcessed, error) {
+ // Check if the meter is nil.
+ if m == nil {
+ return SDKProcessorLogProcessed{noop.Int64Counter{}}, nil
+ }
+
+ i, err := m.Int64Counter(
+ "otel.sdk.processor.log.processed",
+ append([]metric.Int64CounterOption{
+ metric.WithDescription("The number of log records for which the processing has finished, either successful or failed."),
+ metric.WithUnit("{log_record}"),
+ }, opt...)...,
+ )
+ if err != nil {
+ return SDKProcessorLogProcessed{noop.Int64Counter{}}, err
+ }
+ return SDKProcessorLogProcessed{i}, nil
+}
+
+// Inst returns the underlying metric instrument.
+func (m SDKProcessorLogProcessed) Inst() metric.Int64Counter {
+ return m.Int64Counter
+}
+
+// Name returns the semantic convention name of the instrument.
+func (SDKProcessorLogProcessed) Name() string {
+ return "otel.sdk.processor.log.processed"
+}
+
+// Unit returns the semantic convention unit of the instrument
+func (SDKProcessorLogProcessed) Unit() string {
+ return "{log_record}"
+}
+
+// Description returns the semantic convention description of the instrument
+func (SDKProcessorLogProcessed) Description() string {
+ return "The number of log records for which the processing has finished, either successful or failed."
+}
+
+// Add adds incr to the existing count for attrs.
+//
+// All additional attrs passed are included in the recorded value.
+//
+// For successful processing, `error.type` MUST NOT be set. For failed
+// processing, `error.type` MUST contain the failure cause.
+// For the SDK Simple and Batching Log Record Processor a log record is
+// considered to be processed already when it has been submitted to the exporter,
+// not when the corresponding export call has finished.
+func (m SDKProcessorLogProcessed) Add(
+ ctx context.Context,
+ incr int64,
+ attrs ...attribute.KeyValue,
+) {
+ if len(attrs) == 0 {
+ m.Int64Counter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(
+ *o,
+ metric.WithAttributes(
+ attrs...,
+ ),
+ )
+
+ m.Int64Counter.Add(ctx, incr, *o...)
+}
+
+// AddSet adds incr to the existing count for set.
+//
+// For successful processing, `error.type` MUST NOT be set. For failed
+// processing, `error.type` MUST contain the failure cause.
+// For the SDK Simple and Batching Log Record Processor a log record is
+// considered to be processed already when it has been submitted to the exporter,
+// not when the corresponding export call has finished.
+func (m SDKProcessorLogProcessed) AddSet(ctx context.Context, incr int64, set attribute.Set) {
+ if set.Len() == 0 {
+ m.Int64Counter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(*o, metric.WithAttributeSet(set))
+ m.Int64Counter.Add(ctx, incr, *o...)
+}
+
+// AttrErrorType returns an optional attribute for the "error.type" semantic
+// convention. It represents a low-cardinality description of the failure reason.
+// SDK Batching Log Record Processors MUST use `queue_full` for log records
+// dropped due to a full queue.
+func (SDKProcessorLogProcessed) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue {
+ return attribute.String("error.type", string(val))
+}
+
+// AttrComponentName returns an optional attribute for the "otel.component.name"
+// semantic convention. It represents a name uniquely identifying the instance of
+// the OpenTelemetry component within its containing SDK instance.
+func (SDKProcessorLogProcessed) AttrComponentName(val string) attribute.KeyValue {
+ return attribute.String("otel.component.name", val)
+}
+
+// AttrComponentType returns an optional attribute for the "otel.component.type"
+// semantic convention. It represents a name identifying the type of the
+// OpenTelemetry component.
+func (SDKProcessorLogProcessed) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
+ return attribute.String("otel.component.type", string(val))
+}
+
+// SDKProcessorLogQueueCapacity is an instrument used to record metric values
+// conforming to the "otel.sdk.processor.log.queue.capacity" semantic
+// conventions. It represents the maximum number of log records the queue of a
+// given instance of an SDK Log Record processor can hold.
+type SDKProcessorLogQueueCapacity struct {
+ metric.Int64ObservableUpDownCounter
+}
+
+// NewSDKProcessorLogQueueCapacity returns a new SDKProcessorLogQueueCapacity
+// instrument.
+func NewSDKProcessorLogQueueCapacity(
+ m metric.Meter,
+ opt ...metric.Int64ObservableUpDownCounterOption,
+) (SDKProcessorLogQueueCapacity, error) {
+ // Check if the meter is nil.
+ if m == nil {
+ return SDKProcessorLogQueueCapacity{noop.Int64ObservableUpDownCounter{}}, nil
+ }
+
+ i, err := m.Int64ObservableUpDownCounter(
+ "otel.sdk.processor.log.queue.capacity",
+ append([]metric.Int64ObservableUpDownCounterOption{
+ metric.WithDescription("The maximum number of log records the queue of a given instance of an SDK Log Record processor can hold."),
+ metric.WithUnit("{log_record}"),
+ }, opt...)...,
+ )
+ if err != nil {
+ return SDKProcessorLogQueueCapacity{noop.Int64ObservableUpDownCounter{}}, err
+ }
+ return SDKProcessorLogQueueCapacity{i}, nil
+}
+
+// Inst returns the underlying metric instrument.
+func (m SDKProcessorLogQueueCapacity) Inst() metric.Int64ObservableUpDownCounter {
+ return m.Int64ObservableUpDownCounter
+}
+
+// Name returns the semantic convention name of the instrument.
+func (SDKProcessorLogQueueCapacity) Name() string {
+ return "otel.sdk.processor.log.queue.capacity"
+}
+
+// Unit returns the semantic convention unit of the instrument
+func (SDKProcessorLogQueueCapacity) Unit() string {
+ return "{log_record}"
+}
+
+// Description returns the semantic convention description of the instrument
+func (SDKProcessorLogQueueCapacity) Description() string {
+ return "The maximum number of log records the queue of a given instance of an SDK Log Record processor can hold."
+}
+
+// AttrComponentName returns an optional attribute for the "otel.component.name"
+// semantic convention. It represents a name uniquely identifying the instance of
+// the OpenTelemetry component within its containing SDK instance.
+func (SDKProcessorLogQueueCapacity) AttrComponentName(val string) attribute.KeyValue {
+ return attribute.String("otel.component.name", val)
+}
+
+// AttrComponentType returns an optional attribute for the "otel.component.type"
+// semantic convention. It represents a name identifying the type of the
+// OpenTelemetry component.
+func (SDKProcessorLogQueueCapacity) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
+ return attribute.String("otel.component.type", string(val))
+}
+
+// SDKProcessorLogQueueSize is an instrument used to record metric values
+// conforming to the "otel.sdk.processor.log.queue.size" semantic conventions. It
+// represents the number of log records in the queue of a given instance of an
+// SDK log processor.
+type SDKProcessorLogQueueSize struct {
+ metric.Int64ObservableUpDownCounter
+}
+
+// NewSDKProcessorLogQueueSize returns a new SDKProcessorLogQueueSize instrument.
+func NewSDKProcessorLogQueueSize(
+ m metric.Meter,
+ opt ...metric.Int64ObservableUpDownCounterOption,
+) (SDKProcessorLogQueueSize, error) {
+ // Check if the meter is nil.
+ if m == nil {
+ return SDKProcessorLogQueueSize{noop.Int64ObservableUpDownCounter{}}, nil
+ }
+
+ i, err := m.Int64ObservableUpDownCounter(
+ "otel.sdk.processor.log.queue.size",
+ append([]metric.Int64ObservableUpDownCounterOption{
+ metric.WithDescription("The number of log records in the queue of a given instance of an SDK log processor."),
+ metric.WithUnit("{log_record}"),
+ }, opt...)...,
+ )
+ if err != nil {
+ return SDKProcessorLogQueueSize{noop.Int64ObservableUpDownCounter{}}, err
+ }
+ return SDKProcessorLogQueueSize{i}, nil
+}
+
+// Inst returns the underlying metric instrument.
+func (m SDKProcessorLogQueueSize) Inst() metric.Int64ObservableUpDownCounter {
+ return m.Int64ObservableUpDownCounter
+}
+
+// Name returns the semantic convention name of the instrument.
+func (SDKProcessorLogQueueSize) Name() string {
+ return "otel.sdk.processor.log.queue.size"
+}
+
+// Unit returns the semantic convention unit of the instrument
+func (SDKProcessorLogQueueSize) Unit() string {
+ return "{log_record}"
+}
+
+// Description returns the semantic convention description of the instrument
+func (SDKProcessorLogQueueSize) Description() string {
+ return "The number of log records in the queue of a given instance of an SDK log processor."
+}
+
+// AttrComponentName returns an optional attribute for the "otel.component.name"
+// semantic convention. It represents a name uniquely identifying the instance of
+// the OpenTelemetry component within its containing SDK instance.
+func (SDKProcessorLogQueueSize) AttrComponentName(val string) attribute.KeyValue {
+ return attribute.String("otel.component.name", val)
+}
+
+// AttrComponentType returns an optional attribute for the "otel.component.type"
+// semantic convention. It represents a name identifying the type of the
+// OpenTelemetry component.
+func (SDKProcessorLogQueueSize) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
+ return attribute.String("otel.component.type", string(val))
+}
+
+// SDKProcessorSpanProcessed is an instrument used to record metric values
+// conforming to the "otel.sdk.processor.span.processed" semantic conventions. It
+// represents the number of spans for which the processing has finished, either
+// successful or failed.
+type SDKProcessorSpanProcessed struct {
+ metric.Int64Counter
+}
+
+// NewSDKProcessorSpanProcessed returns a new SDKProcessorSpanProcessed
+// instrument.
+func NewSDKProcessorSpanProcessed(
+ m metric.Meter,
+ opt ...metric.Int64CounterOption,
+) (SDKProcessorSpanProcessed, error) {
+ // Check if the meter is nil.
+ if m == nil {
+ return SDKProcessorSpanProcessed{noop.Int64Counter{}}, nil
+ }
+
+ i, err := m.Int64Counter(
+ "otel.sdk.processor.span.processed",
+ append([]metric.Int64CounterOption{
+ metric.WithDescription("The number of spans for which the processing has finished, either successful or failed."),
+ metric.WithUnit("{span}"),
+ }, opt...)...,
+ )
+ if err != nil {
+ return SDKProcessorSpanProcessed{noop.Int64Counter{}}, err
+ }
+ return SDKProcessorSpanProcessed{i}, nil
+}
+
+// Inst returns the underlying metric instrument.
+func (m SDKProcessorSpanProcessed) Inst() metric.Int64Counter {
+ return m.Int64Counter
+}
+
+// Name returns the semantic convention name of the instrument.
+func (SDKProcessorSpanProcessed) Name() string {
+ return "otel.sdk.processor.span.processed"
+}
+
+// Unit returns the semantic convention unit of the instrument
+func (SDKProcessorSpanProcessed) Unit() string {
+ return "{span}"
+}
+
+// Description returns the semantic convention description of the instrument
+func (SDKProcessorSpanProcessed) Description() string {
+ return "The number of spans for which the processing has finished, either successful or failed."
+}
+
+// Add adds incr to the existing count for attrs.
+//
+// All additional attrs passed are included in the recorded value.
+//
+// For successful processing, `error.type` MUST NOT be set. For failed
+// processing, `error.type` MUST contain the failure cause.
+// For the SDK Simple and Batching Span Processor a span is considered to be
+// processed already when it has been submitted to the exporter, not when the
+// corresponding export call has finished.
+func (m SDKProcessorSpanProcessed) Add(
+ ctx context.Context,
+ incr int64,
+ attrs ...attribute.KeyValue,
+) {
+ if len(attrs) == 0 {
+ m.Int64Counter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(
+ *o,
+ metric.WithAttributes(
+ attrs...,
+ ),
+ )
+
+ m.Int64Counter.Add(ctx, incr, *o...)
+}
+
+// AddSet adds incr to the existing count for set.
+//
+// For successful processing, `error.type` MUST NOT be set. For failed
+// processing, `error.type` MUST contain the failure cause.
+// For the SDK Simple and Batching Span Processor a span is considered to be
+// processed already when it has been submitted to the exporter, not when the
+// corresponding export call has finished.
+func (m SDKProcessorSpanProcessed) AddSet(ctx context.Context, incr int64, set attribute.Set) {
+ if set.Len() == 0 {
+ m.Int64Counter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(*o, metric.WithAttributeSet(set))
+ m.Int64Counter.Add(ctx, incr, *o...)
+}
+
+// AttrErrorType returns an optional attribute for the "error.type" semantic
+// convention. It represents a low-cardinality description of the failure reason.
+// SDK Batching Span Processors MUST use `queue_full` for spans dropped due to a
+// full queue.
+func (SDKProcessorSpanProcessed) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue {
+ return attribute.String("error.type", string(val))
+}
+
+// AttrComponentName returns an optional attribute for the "otel.component.name"
+// semantic convention. It represents a name uniquely identifying the instance of
+// the OpenTelemetry component within its containing SDK instance.
+func (SDKProcessorSpanProcessed) AttrComponentName(val string) attribute.KeyValue {
+ return attribute.String("otel.component.name", val)
+}
+
+// AttrComponentType returns an optional attribute for the "otel.component.type"
+// semantic convention. It represents a name identifying the type of the
+// OpenTelemetry component.
+func (SDKProcessorSpanProcessed) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
+ return attribute.String("otel.component.type", string(val))
+}
+
+// SDKProcessorSpanQueueCapacity is an instrument used to record metric values
+// conforming to the "otel.sdk.processor.span.queue.capacity" semantic
+// conventions. It represents the maximum number of spans the queue of a given
+// instance of an SDK span processor can hold.
+type SDKProcessorSpanQueueCapacity struct {
+ metric.Int64ObservableUpDownCounter
+}
+
+// NewSDKProcessorSpanQueueCapacity returns a new SDKProcessorSpanQueueCapacity
+// instrument.
+func NewSDKProcessorSpanQueueCapacity(
+ m metric.Meter,
+ opt ...metric.Int64ObservableUpDownCounterOption,
+) (SDKProcessorSpanQueueCapacity, error) {
+ // Check if the meter is nil.
+ if m == nil {
+ return SDKProcessorSpanQueueCapacity{noop.Int64ObservableUpDownCounter{}}, nil
+ }
+
+ i, err := m.Int64ObservableUpDownCounter(
+ "otel.sdk.processor.span.queue.capacity",
+ append([]metric.Int64ObservableUpDownCounterOption{
+ metric.WithDescription("The maximum number of spans the queue of a given instance of an SDK span processor can hold."),
+ metric.WithUnit("{span}"),
+ }, opt...)...,
+ )
+ if err != nil {
+ return SDKProcessorSpanQueueCapacity{noop.Int64ObservableUpDownCounter{}}, err
+ }
+ return SDKProcessorSpanQueueCapacity{i}, nil
+}
+
+// Inst returns the underlying metric instrument.
+func (m SDKProcessorSpanQueueCapacity) Inst() metric.Int64ObservableUpDownCounter {
+ return m.Int64ObservableUpDownCounter
+}
+
+// Name returns the semantic convention name of the instrument.
+func (SDKProcessorSpanQueueCapacity) Name() string {
+ return "otel.sdk.processor.span.queue.capacity"
+}
+
+// Unit returns the semantic convention unit of the instrument
+func (SDKProcessorSpanQueueCapacity) Unit() string {
+ return "{span}"
+}
+
+// Description returns the semantic convention description of the instrument
+func (SDKProcessorSpanQueueCapacity) Description() string {
+ return "The maximum number of spans the queue of a given instance of an SDK span processor can hold."
+}
+
+// AttrComponentName returns an optional attribute for the "otel.component.name"
+// semantic convention. It represents a name uniquely identifying the instance of
+// the OpenTelemetry component within its containing SDK instance.
+func (SDKProcessorSpanQueueCapacity) AttrComponentName(val string) attribute.KeyValue {
+ return attribute.String("otel.component.name", val)
+}
+
+// AttrComponentType returns an optional attribute for the "otel.component.type"
+// semantic convention. It represents a name identifying the type of the
+// OpenTelemetry component.
+func (SDKProcessorSpanQueueCapacity) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
+ return attribute.String("otel.component.type", string(val))
+}
+
+// SDKProcessorSpanQueueSize is an instrument used to record metric values
+// conforming to the "otel.sdk.processor.span.queue.size" semantic conventions.
+// It represents the number of spans in the queue of a given instance of an SDK
+// span processor.
+type SDKProcessorSpanQueueSize struct {
+ metric.Int64ObservableUpDownCounter
+}
+
+// NewSDKProcessorSpanQueueSize returns a new SDKProcessorSpanQueueSize
+// instrument.
+func NewSDKProcessorSpanQueueSize(
+ m metric.Meter,
+ opt ...metric.Int64ObservableUpDownCounterOption,
+) (SDKProcessorSpanQueueSize, error) {
+ // Check if the meter is nil.
+ if m == nil {
+ return SDKProcessorSpanQueueSize{noop.Int64ObservableUpDownCounter{}}, nil
+ }
+
+ i, err := m.Int64ObservableUpDownCounter(
+ "otel.sdk.processor.span.queue.size",
+ append([]metric.Int64ObservableUpDownCounterOption{
+ metric.WithDescription("The number of spans in the queue of a given instance of an SDK span processor."),
+ metric.WithUnit("{span}"),
+ }, opt...)...,
+ )
+ if err != nil {
+ return SDKProcessorSpanQueueSize{noop.Int64ObservableUpDownCounter{}}, err
+ }
+ return SDKProcessorSpanQueueSize{i}, nil
+}
+
+// Inst returns the underlying metric instrument.
+func (m SDKProcessorSpanQueueSize) Inst() metric.Int64ObservableUpDownCounter {
+ return m.Int64ObservableUpDownCounter
+}
+
+// Name returns the semantic convention name of the instrument.
+func (SDKProcessorSpanQueueSize) Name() string {
+ return "otel.sdk.processor.span.queue.size"
+}
+
+// Unit returns the semantic convention unit of the instrument
+func (SDKProcessorSpanQueueSize) Unit() string {
+ return "{span}"
+}
+
+// Description returns the semantic convention description of the instrument
+func (SDKProcessorSpanQueueSize) Description() string {
+ return "The number of spans in the queue of a given instance of an SDK span processor."
+}
+
+// AttrComponentName returns an optional attribute for the "otel.component.name"
+// semantic convention. It represents a name uniquely identifying the instance of
+// the OpenTelemetry component within its containing SDK instance.
+func (SDKProcessorSpanQueueSize) AttrComponentName(val string) attribute.KeyValue {
+ return attribute.String("otel.component.name", val)
+}
+
+// AttrComponentType returns an optional attribute for the "otel.component.type"
+// semantic convention. It represents a name identifying the type of the
+// OpenTelemetry component.
+func (SDKProcessorSpanQueueSize) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
+ return attribute.String("otel.component.type", string(val))
+}
+
+// SDKSpanLive is an instrument used to record metric values conforming to the
+// "otel.sdk.span.live" semantic conventions. It represents the number of created
+// spans with `recording=true` for which the end operation has not been called
+// yet.
+type SDKSpanLive struct {
+ metric.Int64UpDownCounter
+}
+
+// NewSDKSpanLive returns a new SDKSpanLive instrument.
+func NewSDKSpanLive(
+ m metric.Meter,
+ opt ...metric.Int64UpDownCounterOption,
+) (SDKSpanLive, error) {
+ // Check if the meter is nil.
+ if m == nil {
+ return SDKSpanLive{noop.Int64UpDownCounter{}}, nil
+ }
+
+ i, err := m.Int64UpDownCounter(
+ "otel.sdk.span.live",
+ append([]metric.Int64UpDownCounterOption{
+ metric.WithDescription("The number of created spans with `recording=true` for which the end operation has not been called yet."),
+ metric.WithUnit("{span}"),
+ }, opt...)...,
+ )
+ if err != nil {
+ return SDKSpanLive{noop.Int64UpDownCounter{}}, err
+ }
+ return SDKSpanLive{i}, nil
+}
+
+// Inst returns the underlying metric instrument.
+func (m SDKSpanLive) Inst() metric.Int64UpDownCounter {
+ return m.Int64UpDownCounter
+}
+
+// Name returns the semantic convention name of the instrument.
+func (SDKSpanLive) Name() string {
+ return "otel.sdk.span.live"
+}
+
+// Unit returns the semantic convention unit of the instrument
+func (SDKSpanLive) Unit() string {
+ return "{span}"
+}
+
+// Description returns the semantic convention description of the instrument
+func (SDKSpanLive) Description() string {
+ return "The number of created spans with `recording=true` for which the end operation has not been called yet."
+}
+
+// Add adds incr to the existing count for attrs.
+//
+// All additional attrs passed are included in the recorded value.
+func (m SDKSpanLive) Add(
+ ctx context.Context,
+ incr int64,
+ attrs ...attribute.KeyValue,
+) {
+ if len(attrs) == 0 {
+ m.Int64UpDownCounter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(
+ *o,
+ metric.WithAttributes(
+ attrs...,
+ ),
+ )
+
+ m.Int64UpDownCounter.Add(ctx, incr, *o...)
+}
+
+// AddSet adds incr to the existing count for set.
+func (m SDKSpanLive) AddSet(ctx context.Context, incr int64, set attribute.Set) {
+ if set.Len() == 0 {
+ m.Int64UpDownCounter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(*o, metric.WithAttributeSet(set))
+ m.Int64UpDownCounter.Add(ctx, incr, *o...)
+}
+
+// AttrSpanSamplingResult returns an optional attribute for the
+// "otel.span.sampling_result" semantic convention. It represents the result
+// value of the sampler for this span.
+func (SDKSpanLive) AttrSpanSamplingResult(val SpanSamplingResultAttr) attribute.KeyValue {
+ return attribute.String("otel.span.sampling_result", string(val))
+}
+
+// SDKSpanStarted is an instrument used to record metric values conforming to the
+// "otel.sdk.span.started" semantic conventions. It represents the number of
+// created spans.
+type SDKSpanStarted struct {
+ metric.Int64Counter
+}
+
+// NewSDKSpanStarted returns a new SDKSpanStarted instrument.
+func NewSDKSpanStarted(
+ m metric.Meter,
+ opt ...metric.Int64CounterOption,
+) (SDKSpanStarted, error) {
+ // Check if the meter is nil.
+ if m == nil {
+ return SDKSpanStarted{noop.Int64Counter{}}, nil
+ }
+
+ i, err := m.Int64Counter(
+ "otel.sdk.span.started",
+ append([]metric.Int64CounterOption{
+ metric.WithDescription("The number of created spans."),
+ metric.WithUnit("{span}"),
+ }, opt...)...,
+ )
+ if err != nil {
+ return SDKSpanStarted{noop.Int64Counter{}}, err
+ }
+ return SDKSpanStarted{i}, nil
+}
+
+// Inst returns the underlying metric instrument.
+func (m SDKSpanStarted) Inst() metric.Int64Counter {
+ return m.Int64Counter
+}
+
+// Name returns the semantic convention name of the instrument.
+func (SDKSpanStarted) Name() string {
+ return "otel.sdk.span.started"
+}
+
+// Unit returns the semantic convention unit of the instrument
+func (SDKSpanStarted) Unit() string {
+ return "{span}"
+}
+
+// Description returns the semantic convention description of the instrument
+func (SDKSpanStarted) Description() string {
+ return "The number of created spans."
+}
+
+// Add adds incr to the existing count for attrs.
+//
+// All additional attrs passed are included in the recorded value.
+//
+// Implementations MUST record this metric for all spans, even for non-recording
+// ones.
+func (m SDKSpanStarted) Add(
+ ctx context.Context,
+ incr int64,
+ attrs ...attribute.KeyValue,
+) {
+ if len(attrs) == 0 {
+ m.Int64Counter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(
+ *o,
+ metric.WithAttributes(
+ attrs...,
+ ),
+ )
+
+ m.Int64Counter.Add(ctx, incr, *o...)
+}
+
+// AddSet adds incr to the existing count for set.
+//
+// Implementations MUST record this metric for all spans, even for non-recording
+// ones.
+func (m SDKSpanStarted) AddSet(ctx context.Context, incr int64, set attribute.Set) {
+ if set.Len() == 0 {
+ m.Int64Counter.Add(ctx, incr)
+ return
+ }
+
+ o := addOptPool.Get().(*[]metric.AddOption)
+ defer func() {
+ *o = (*o)[:0]
+ addOptPool.Put(o)
+ }()
+
+ *o = append(*o, metric.WithAttributeSet(set))
+ m.Int64Counter.Add(ctx, incr, *o...)
+}
+
+// AttrSpanParentOrigin returns an optional attribute for the
+// "otel.span.parent.origin" semantic convention. It represents the determines
+// whether the span has a parent span, and if so, [whether it is a remote parent]
+// .
+//
+// [whether it is a remote parent]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote
+func (SDKSpanStarted) AttrSpanParentOrigin(val SpanParentOriginAttr) attribute.KeyValue {
+ return attribute.String("otel.span.parent.origin", string(val))
+}
+
+// AttrSpanSamplingResult returns an optional attribute for the
+// "otel.span.sampling_result" semantic convention. It represents the result
+// value of the sampler for this span.
+func (SDKSpanStarted) AttrSpanSamplingResult(val SpanSamplingResultAttr) attribute.KeyValue {
+ return attribute.String("otel.span.sampling_result", string(val))
+}
\ No newline at end of file
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/schema.go
new file mode 100644
index 0000000000..f8a0b70441
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/schema.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.37.0"
+
+// SchemaURL is the schema URL that matches the version of the semantic conventions
+// that this package defines. Semconv packages starting from v1.4.0 must declare
+// non-empty schema URL in the form https://opentelemetry.io/schemas/
+const SchemaURL = "https://opentelemetry.io/schemas/1.37.0"
diff --git a/vendor/go.opentelemetry.io/otel/trace/LICENSE b/vendor/go.opentelemetry.io/otel/trace/LICENSE
index 261eeb9e9f..f1aee0f110 100644
--- a/vendor/go.opentelemetry.io/otel/trace/LICENSE
+++ b/vendor/go.opentelemetry.io/otel/trace/LICENSE
@@ -199,3 +199,33 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+
+--------------------------------------------------------------------------------
+
+Copyright 2009 The Go Authors.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google LLC nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/vendor/go.opentelemetry.io/otel/trace/auto.go b/vendor/go.opentelemetry.io/otel/trace/auto.go
index f3aa398138..8763936a84 100644
--- a/vendor/go.opentelemetry.io/otel/trace/auto.go
+++ b/vendor/go.opentelemetry.io/otel/trace/auto.go
@@ -20,7 +20,7 @@ import (
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
- semconv "go.opentelemetry.io/otel/semconv/v1.34.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.37.0"
"go.opentelemetry.io/otel/trace/embedded"
"go.opentelemetry.io/otel/trace/internal/telemetry"
)
@@ -39,7 +39,7 @@ type autoTracerProvider struct{ embedded.TracerProvider }
var _ TracerProvider = autoTracerProvider{}
-func (p autoTracerProvider) Tracer(name string, opts ...TracerOption) Tracer {
+func (autoTracerProvider) Tracer(name string, opts ...TracerOption) Tracer {
cfg := NewTracerConfig(opts...)
return autoTracer{
name: name,
@@ -81,7 +81,7 @@ func (t autoTracer) Start(ctx context.Context, name string, opts ...SpanStartOpt
// Expected to be implemented in eBPF.
//
//go:noinline
-func (t *autoTracer) start(
+func (*autoTracer) start(
ctx context.Context,
spanPtr *autoSpan,
psc *SpanContext,
diff --git a/vendor/go.opentelemetry.io/otel/trace/config.go b/vendor/go.opentelemetry.io/otel/trace/config.go
index 9c0b720a4d..aea11a2b52 100644
--- a/vendor/go.opentelemetry.io/otel/trace/config.go
+++ b/vendor/go.opentelemetry.io/otel/trace/config.go
@@ -73,7 +73,7 @@ func (cfg *SpanConfig) Timestamp() time.Time {
return cfg.timestamp
}
-// StackTrace checks whether stack trace capturing is enabled.
+// StackTrace reports whether stack trace capturing is enabled.
func (cfg *SpanConfig) StackTrace() bool {
return cfg.stackTrace
}
@@ -154,7 +154,7 @@ func (cfg *EventConfig) Timestamp() time.Time {
return cfg.timestamp
}
-// StackTrace checks whether stack trace capturing is enabled.
+// StackTrace reports whether stack trace capturing is enabled.
func (cfg *EventConfig) StackTrace() bool {
return cfg.stackTrace
}
diff --git a/vendor/go.opentelemetry.io/otel/trace/hex.go b/vendor/go.opentelemetry.io/otel/trace/hex.go
new file mode 100644
index 0000000000..1cbef1d4b9
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/trace/hex.go
@@ -0,0 +1,38 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package trace // import "go.opentelemetry.io/otel/trace"
+
+const (
+ // hexLU is a hex lookup table of the 16 lowercase hex digits.
+ // The character values of the string are indexed at the equivalent
+ // hexadecimal value they represent. This table efficiently encodes byte data
+ // into a string representation of hexadecimal.
+ hexLU = "0123456789abcdef"
+
+ // hexRev is a reverse hex lookup table for lowercase hex digits.
+ // The table is efficiently decodes a hexadecimal string into bytes.
+ // Valid hexadecimal characters are indexed at their respective values. All
+ // other invalid ASCII characters are represented with '\xff'.
+ //
+ // The '\xff' character is used as invalid because no valid character has
+ // the upper 4 bits set. Meaning, an efficient validation can be performed
+ // over multiple character parsing by checking these bits remain zero.
+ hexRev = "" +
+ "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" +
+ "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" +
+ "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" +
+ "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\xff\xff\xff\xff\xff\xff" +
+ "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" +
+ "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" +
+ "\xff\x0a\x0b\x0c\x0d\x0e\x0f\xff\xff\xff\xff\xff\xff\xff\xff\xff" +
+ "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" +
+ "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" +
+ "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" +
+ "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" +
+ "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" +
+ "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" +
+ "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" +
+ "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" +
+ "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
+)
diff --git a/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/attr.go b/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/attr.go
index f663547b4e..ff0f6eac62 100644
--- a/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/attr.go
+++ b/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/attr.go
@@ -52,7 +52,7 @@ func Map(key string, value ...Attr) Attr {
return Attr{key, MapValue(value...)}
}
-// Equal returns if a is equal to b.
+// Equal reports whether a is equal to b.
func (a Attr) Equal(b Attr) bool {
return a.Key == b.Key && a.Value.Equal(b.Value)
}
diff --git a/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/id.go b/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/id.go
index 7b1ae3c4ea..bea56f2e7d 100644
--- a/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/id.go
+++ b/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/id.go
@@ -22,7 +22,7 @@ func (tid TraceID) String() string {
return hex.EncodeToString(tid[:])
}
-// IsEmpty returns false if id contains at least one non-zero byte.
+// IsEmpty reports whether the TraceID contains only zero bytes.
func (tid TraceID) IsEmpty() bool {
return tid == [traceIDSize]byte{}
}
@@ -50,7 +50,7 @@ func (sid SpanID) String() string {
return hex.EncodeToString(sid[:])
}
-// IsEmpty returns true if the span ID contains at least one non-zero byte.
+// IsEmpty reports whether the SpanID contains only zero bytes.
func (sid SpanID) IsEmpty() bool {
return sid == [spanIDSize]byte{}
}
@@ -82,7 +82,7 @@ func marshalJSON(id []byte) ([]byte, error) {
}
// unmarshalJSON inflates trace id from hex string, possibly enclosed in quotes.
-func unmarshalJSON(dst []byte, src []byte) error {
+func unmarshalJSON(dst, src []byte) error {
if l := len(src); l >= 2 && src[0] == '"' && src[l-1] == '"' {
src = src[1 : l-1]
}
diff --git a/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/value.go b/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/value.go
index ae9ce102a9..cb7927b816 100644
--- a/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/value.go
+++ b/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/value.go
@@ -257,10 +257,10 @@ func (v Value) Kind() ValueKind {
}
}
-// Empty returns if v does not hold any value.
+// Empty reports whether v does not hold any value.
func (v Value) Empty() bool { return v.Kind() == ValueKindEmpty }
-// Equal returns if v is equal to w.
+// Equal reports whether v is equal to w.
func (v Value) Equal(w Value) bool {
k1 := v.Kind()
k2 := w.Kind()
diff --git a/vendor/go.opentelemetry.io/otel/trace/noop.go b/vendor/go.opentelemetry.io/otel/trace/noop.go
index 0f56e4dbb3..400fab1238 100644
--- a/vendor/go.opentelemetry.io/otel/trace/noop.go
+++ b/vendor/go.opentelemetry.io/otel/trace/noop.go
@@ -26,7 +26,7 @@ type noopTracerProvider struct{ embedded.TracerProvider }
var _ TracerProvider = noopTracerProvider{}
// Tracer returns noop implementation of Tracer.
-func (p noopTracerProvider) Tracer(string, ...TracerOption) Tracer {
+func (noopTracerProvider) Tracer(string, ...TracerOption) Tracer {
return noopTracer{}
}
@@ -37,7 +37,7 @@ var _ Tracer = noopTracer{}
// Start carries forward a non-recording Span, if one is present in the context, otherwise it
// creates a no-op Span.
-func (t noopTracer) Start(ctx context.Context, name string, _ ...SpanStartOption) (context.Context, Span) {
+func (noopTracer) Start(ctx context.Context, _ string, _ ...SpanStartOption) (context.Context, Span) {
span := SpanFromContext(ctx)
if _, ok := span.(nonRecordingSpan); !ok {
// span is likely already a noopSpan, but let's be sure
diff --git a/vendor/go.opentelemetry.io/otel/trace/noop/noop.go b/vendor/go.opentelemetry.io/otel/trace/noop/noop.go
index 64a4f1b362..689d220df7 100644
--- a/vendor/go.opentelemetry.io/otel/trace/noop/noop.go
+++ b/vendor/go.opentelemetry.io/otel/trace/noop/noop.go
@@ -51,7 +51,7 @@ type Tracer struct{ embedded.Tracer }
// If ctx contains a span context, the returned span will also contain that
// span context. If the span context in ctx is for a non-recording span, that
// span instance will be returned directly.
-func (t Tracer) Start(ctx context.Context, _ string, _ ...trace.SpanStartOption) (context.Context, trace.Span) {
+func (Tracer) Start(ctx context.Context, _ string, _ ...trace.SpanStartOption) (context.Context, trace.Span) {
span := trace.SpanFromContext(ctx)
// If the parent context contains a non-zero span context, that span
diff --git a/vendor/go.opentelemetry.io/otel/trace/trace.go b/vendor/go.opentelemetry.io/otel/trace/trace.go
index d49adf671b..ee6f4bcb2a 100644
--- a/vendor/go.opentelemetry.io/otel/trace/trace.go
+++ b/vendor/go.opentelemetry.io/otel/trace/trace.go
@@ -4,8 +4,6 @@
package trace // import "go.opentelemetry.io/otel/trace"
import (
- "bytes"
- "encoding/hex"
"encoding/json"
)
@@ -38,21 +36,47 @@ var (
_ json.Marshaler = nilTraceID
)
-// IsValid checks whether the trace TraceID is valid. A valid trace ID does
+// IsValid reports whether the trace TraceID is valid. A valid trace ID does
// not consist of zeros only.
func (t TraceID) IsValid() bool {
- return !bytes.Equal(t[:], nilTraceID[:])
+ return t != nilTraceID
}
// MarshalJSON implements a custom marshal function to encode TraceID
// as a hex string.
func (t TraceID) MarshalJSON() ([]byte, error) {
- return json.Marshal(t.String())
+ b := [32 + 2]byte{0: '"', 33: '"'}
+ h := t.hexBytes()
+ copy(b[1:], h[:])
+ return b[:], nil
}
// String returns the hex string representation form of a TraceID.
func (t TraceID) String() string {
- return hex.EncodeToString(t[:])
+ h := t.hexBytes()
+ return string(h[:])
+}
+
+// hexBytes returns the hex string representation form of a TraceID.
+func (t TraceID) hexBytes() [32]byte {
+ return [32]byte{
+ hexLU[t[0x0]>>4], hexLU[t[0x0]&0xf],
+ hexLU[t[0x1]>>4], hexLU[t[0x1]&0xf],
+ hexLU[t[0x2]>>4], hexLU[t[0x2]&0xf],
+ hexLU[t[0x3]>>4], hexLU[t[0x3]&0xf],
+ hexLU[t[0x4]>>4], hexLU[t[0x4]&0xf],
+ hexLU[t[0x5]>>4], hexLU[t[0x5]&0xf],
+ hexLU[t[0x6]>>4], hexLU[t[0x6]&0xf],
+ hexLU[t[0x7]>>4], hexLU[t[0x7]&0xf],
+ hexLU[t[0x8]>>4], hexLU[t[0x8]&0xf],
+ hexLU[t[0x9]>>4], hexLU[t[0x9]&0xf],
+ hexLU[t[0xa]>>4], hexLU[t[0xa]&0xf],
+ hexLU[t[0xb]>>4], hexLU[t[0xb]&0xf],
+ hexLU[t[0xc]>>4], hexLU[t[0xc]&0xf],
+ hexLU[t[0xd]>>4], hexLU[t[0xd]&0xf],
+ hexLU[t[0xe]>>4], hexLU[t[0xe]&0xf],
+ hexLU[t[0xf]>>4], hexLU[t[0xf]&0xf],
+ }
}
// SpanID is a unique identity of a span in a trace.
@@ -63,21 +87,38 @@ var (
_ json.Marshaler = nilSpanID
)
-// IsValid checks whether the SpanID is valid. A valid SpanID does not consist
+// IsValid reports whether the SpanID is valid. A valid SpanID does not consist
// of zeros only.
func (s SpanID) IsValid() bool {
- return !bytes.Equal(s[:], nilSpanID[:])
+ return s != nilSpanID
}
// MarshalJSON implements a custom marshal function to encode SpanID
// as a hex string.
func (s SpanID) MarshalJSON() ([]byte, error) {
- return json.Marshal(s.String())
+ b := [16 + 2]byte{0: '"', 17: '"'}
+ h := s.hexBytes()
+ copy(b[1:], h[:])
+ return b[:], nil
}
// String returns the hex string representation form of a SpanID.
func (s SpanID) String() string {
- return hex.EncodeToString(s[:])
+ b := s.hexBytes()
+ return string(b[:])
+}
+
+func (s SpanID) hexBytes() [16]byte {
+ return [16]byte{
+ hexLU[s[0]>>4], hexLU[s[0]&0xf],
+ hexLU[s[1]>>4], hexLU[s[1]&0xf],
+ hexLU[s[2]>>4], hexLU[s[2]&0xf],
+ hexLU[s[3]>>4], hexLU[s[3]&0xf],
+ hexLU[s[4]>>4], hexLU[s[4]&0xf],
+ hexLU[s[5]>>4], hexLU[s[5]&0xf],
+ hexLU[s[6]>>4], hexLU[s[6]&0xf],
+ hexLU[s[7]>>4], hexLU[s[7]&0xf],
+ }
}
// TraceIDFromHex returns a TraceID from a hex string if it is compliant with
@@ -85,65 +126,58 @@ func (s SpanID) String() string {
// https://www.w3.org/TR/trace-context/#trace-id
// nolint:revive // revive complains about stutter of `trace.TraceIDFromHex`.
func TraceIDFromHex(h string) (TraceID, error) {
- t := TraceID{}
if len(h) != 32 {
- return t, errInvalidTraceIDLength
+ return [16]byte{}, errInvalidTraceIDLength
}
-
- if err := decodeHex(h, t[:]); err != nil {
- return t, err
+ var b [16]byte
+ invalidMark := byte(0)
+ for i := 0; i < len(h); i += 4 {
+ b[i/2] = (hexRev[h[i]] << 4) | hexRev[h[i+1]]
+ b[i/2+1] = (hexRev[h[i+2]] << 4) | hexRev[h[i+3]]
+ invalidMark |= hexRev[h[i]] | hexRev[h[i+1]] | hexRev[h[i+2]] | hexRev[h[i+3]]
}
-
- if !t.IsValid() {
- return t, errNilTraceID
+ // If the upper 4 bits of any byte are not zero, there was an invalid hex
+ // character since invalid hex characters are 0xff in hexRev.
+ if invalidMark&0xf0 != 0 {
+ return [16]byte{}, errInvalidHexID
+ }
+ // If we didn't set any bits, then h was all zeros.
+ if invalidMark == 0 {
+ return [16]byte{}, errNilTraceID
}
- return t, nil
+ return b, nil
}
// SpanIDFromHex returns a SpanID from a hex string if it is compliant
// with the w3c trace-context specification.
// See more at https://www.w3.org/TR/trace-context/#parent-id
func SpanIDFromHex(h string) (SpanID, error) {
- s := SpanID{}
if len(h) != 16 {
- return s, errInvalidSpanIDLength
- }
-
- if err := decodeHex(h, s[:]); err != nil {
- return s, err
+ return [8]byte{}, errInvalidSpanIDLength
}
-
- if !s.IsValid() {
- return s, errNilSpanID
+ var b [8]byte
+ invalidMark := byte(0)
+ for i := 0; i < len(h); i += 4 {
+ b[i/2] = (hexRev[h[i]] << 4) | hexRev[h[i+1]]
+ b[i/2+1] = (hexRev[h[i+2]] << 4) | hexRev[h[i+3]]
+ invalidMark |= hexRev[h[i]] | hexRev[h[i+1]] | hexRev[h[i+2]] | hexRev[h[i+3]]
}
- return s, nil
-}
-
-func decodeHex(h string, b []byte) error {
- for _, r := range h {
- switch {
- case 'a' <= r && r <= 'f':
- continue
- case '0' <= r && r <= '9':
- continue
- default:
- return errInvalidHexID
- }
+ // If the upper 4 bits of any byte are not zero, there was an invalid hex
+ // character since invalid hex characters are 0xff in hexRev.
+ if invalidMark&0xf0 != 0 {
+ return [8]byte{}, errInvalidHexID
}
-
- decoded, err := hex.DecodeString(h)
- if err != nil {
- return err
+ // If we didn't set any bits, then h was all zeros.
+ if invalidMark == 0 {
+ return [8]byte{}, errNilSpanID
}
-
- copy(b, decoded)
- return nil
+ return b, nil
}
// TraceFlags contains flags that can be set on a SpanContext.
type TraceFlags byte //nolint:revive // revive complains about stutter of `trace.TraceFlags`.
-// IsSampled returns if the sampling bit is set in the TraceFlags.
+// IsSampled reports whether the sampling bit is set in the TraceFlags.
func (tf TraceFlags) IsSampled() bool {
return tf&FlagsSampled == FlagsSampled
}
@@ -160,12 +194,20 @@ func (tf TraceFlags) WithSampled(sampled bool) TraceFlags { // nolint:revive //
// MarshalJSON implements a custom marshal function to encode TraceFlags
// as a hex string.
func (tf TraceFlags) MarshalJSON() ([]byte, error) {
- return json.Marshal(tf.String())
+ b := [2 + 2]byte{0: '"', 3: '"'}
+ h := tf.hexBytes()
+ copy(b[1:], h[:])
+ return b[:], nil
}
// String returns the hex string representation form of TraceFlags.
func (tf TraceFlags) String() string {
- return hex.EncodeToString([]byte{byte(tf)}[:])
+ h := tf.hexBytes()
+ return string(h[:])
+}
+
+func (tf TraceFlags) hexBytes() [2]byte {
+ return [2]byte{hexLU[tf>>4], hexLU[tf&0xf]}
}
// SpanContextConfig contains mutable fields usable for constructing
@@ -201,13 +243,13 @@ type SpanContext struct {
var _ json.Marshaler = SpanContext{}
-// IsValid returns if the SpanContext is valid. A valid span context has a
+// IsValid reports whether the SpanContext is valid. A valid span context has a
// valid TraceID and SpanID.
func (sc SpanContext) IsValid() bool {
return sc.HasTraceID() && sc.HasSpanID()
}
-// IsRemote indicates whether the SpanContext represents a remotely-created Span.
+// IsRemote reports whether the SpanContext represents a remotely-created Span.
func (sc SpanContext) IsRemote() bool {
return sc.remote
}
@@ -228,7 +270,7 @@ func (sc SpanContext) TraceID() TraceID {
return sc.traceID
}
-// HasTraceID checks if the SpanContext has a valid TraceID.
+// HasTraceID reports whether the SpanContext has a valid TraceID.
func (sc SpanContext) HasTraceID() bool {
return sc.traceID.IsValid()
}
@@ -249,7 +291,7 @@ func (sc SpanContext) SpanID() SpanID {
return sc.spanID
}
-// HasSpanID checks if the SpanContext has a valid SpanID.
+// HasSpanID reports whether the SpanContext has a valid SpanID.
func (sc SpanContext) HasSpanID() bool {
return sc.spanID.IsValid()
}
@@ -270,7 +312,7 @@ func (sc SpanContext) TraceFlags() TraceFlags {
return sc.traceFlags
}
-// IsSampled returns if the sampling bit is set in the SpanContext's TraceFlags.
+// IsSampled reports whether the sampling bit is set in the SpanContext's TraceFlags.
func (sc SpanContext) IsSampled() bool {
return sc.traceFlags.IsSampled()
}
@@ -302,7 +344,7 @@ func (sc SpanContext) WithTraceState(state TraceState) SpanContext {
}
}
-// Equal is a predicate that determines whether two SpanContext values are equal.
+// Equal reports whether two SpanContext values are equal.
func (sc SpanContext) Equal(other SpanContext) bool {
return sc.traceID == other.traceID &&
sc.spanID == other.spanID &&
diff --git a/vendor/go.opentelemetry.io/otel/trace/tracestate.go b/vendor/go.opentelemetry.io/otel/trace/tracestate.go
index dc5e34cad0..073adae2fa 100644
--- a/vendor/go.opentelemetry.io/otel/trace/tracestate.go
+++ b/vendor/go.opentelemetry.io/otel/trace/tracestate.go
@@ -80,7 +80,7 @@ func checkKeyRemain(key string) bool {
//
// param n is remain part length, should be 255 in simple-key or 13 in system-id.
func checkKeyPart(key string, n int) bool {
- if len(key) == 0 {
+ if key == "" {
return false
}
first := key[0] // key's first char
@@ -102,7 +102,7 @@ func isAlphaNum(c byte) bool {
//
// param n is remain part length, should be 240 exactly.
func checkKeyTenant(key string, n int) bool {
- if len(key) == 0 {
+ if key == "" {
return false
}
return isAlphaNum(key[0]) && len(key[1:]) <= n && checkKeyRemain(key[1:])
@@ -191,7 +191,7 @@ func ParseTraceState(ts string) (TraceState, error) {
for ts != "" {
var memberStr string
memberStr, ts, _ = strings.Cut(ts, listDelimiters)
- if len(memberStr) == 0 {
+ if memberStr == "" {
continue
}
diff --git a/vendor/go.opentelemetry.io/otel/version.go b/vendor/go.opentelemetry.io/otel/version.go
index 7afe92b598..bcaa5aa537 100644
--- a/vendor/go.opentelemetry.io/otel/version.go
+++ b/vendor/go.opentelemetry.io/otel/version.go
@@ -5,5 +5,5 @@ package otel // import "go.opentelemetry.io/otel"
// Version is the current release version of OpenTelemetry in use.
func Version() string {
- return "1.37.0"
+ return "1.38.0"
}
diff --git a/vendor/go.opentelemetry.io/otel/versions.yaml b/vendor/go.opentelemetry.io/otel/versions.yaml
index 9d4742a176..07145e254b 100644
--- a/vendor/go.opentelemetry.io/otel/versions.yaml
+++ b/vendor/go.opentelemetry.io/otel/versions.yaml
@@ -3,7 +3,7 @@
module-sets:
stable-v1:
- version: v1.37.0
+ version: v1.38.0
modules:
- go.opentelemetry.io/otel
- go.opentelemetry.io/otel/bridge/opencensus
@@ -22,11 +22,11 @@ module-sets:
- go.opentelemetry.io/otel/sdk/metric
- go.opentelemetry.io/otel/trace
experimental-metrics:
- version: v0.59.0
+ version: v0.60.0
modules:
- go.opentelemetry.io/otel/exporters/prometheus
experimental-logs:
- version: v0.13.0
+ version: v0.14.0
modules:
- go.opentelemetry.io/otel/log
- go.opentelemetry.io/otel/log/logtest
@@ -36,7 +36,7 @@ module-sets:
- go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp
- go.opentelemetry.io/otel/exporters/stdout/stdoutlog
experimental-schema:
- version: v0.0.12
+ version: v0.0.13
modules:
- go.opentelemetry.io/otel/schema
excluded-modules:
diff --git a/vendor/golang.org/x/crypto/pkcs12/pkcs12.go b/vendor/golang.org/x/crypto/pkcs12/pkcs12.go
index 3a89bdb3e3..374d9facf8 100644
--- a/vendor/golang.org/x/crypto/pkcs12/pkcs12.go
+++ b/vendor/golang.org/x/crypto/pkcs12/pkcs12.go
@@ -4,12 +4,16 @@
// Package pkcs12 implements some of PKCS#12.
//
-// This implementation is distilled from https://tools.ietf.org/html/rfc7292
-// and referenced documents. It is intended for decoding P12/PFX-stored
-// certificates and keys for use with the crypto/tls package.
+// This implementation is distilled from [RFC 7292] and referenced documents.
+// It is intended for decoding P12/PFX-stored certificates and keys for use
+// with the crypto/tls package.
//
-// This package is frozen. If it's missing functionality you need, consider
-// an alternative like software.sslmate.com/src/go-pkcs12.
+// The pkcs12 package is [frozen] and is not accepting new features.
+// If it's missing functionality you need, consider an alternative like
+// software.sslmate.com/src/go-pkcs12.
+//
+// [RFC 7292]: https://datatracker.ietf.org/doc/html/rfc7292
+// [frozen]: https://go.dev/wiki/Frozen
package pkcs12
import (
diff --git a/vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go b/vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go
index 3685b34458..75df77406d 100644
--- a/vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go
+++ b/vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go
@@ -3,6 +3,10 @@
// license that can be found in the LICENSE file.
// Package salsa provides low-level access to functions in the Salsa family.
+//
+// Deprecated: this package exposes unsafe low-level operations. New applications
+// should consider using the AEAD construction in golang.org/x/crypto/chacha20poly1305
+// instead. Existing users should migrate to golang.org/x/crypto/salsa20.
package salsa
import "math/bits"
diff --git a/vendor/golang.org/x/net/context/context.go b/vendor/golang.org/x/net/context/context.go
index db1c95fab1..24cea68820 100644
--- a/vendor/golang.org/x/net/context/context.go
+++ b/vendor/golang.org/x/net/context/context.go
@@ -2,44 +2,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Package context defines the Context type, which carries deadlines,
-// cancellation signals, and other request-scoped values across API boundaries
-// and between processes.
-// As of Go 1.7 this package is available in the standard library under the
-// name [context], and migrating to it can be done automatically with [go fix].
-//
-// Incoming requests to a server should create a [Context], and outgoing
-// calls to servers should accept a Context. The chain of function
-// calls between them must propagate the Context, optionally replacing
-// it with a derived Context created using [WithCancel], [WithDeadline],
-// [WithTimeout], or [WithValue].
-//
-// Programs that use Contexts should follow these rules to keep interfaces
-// consistent across packages and enable static analysis tools to check context
-// propagation:
-//
-// Do not store Contexts inside a struct type; instead, pass a Context
-// explicitly to each function that needs it. This is discussed further in
-// https://go.dev/blog/context-and-structs. The Context should be the first
-// parameter, typically named ctx:
-//
-// func DoSomething(ctx context.Context, arg Arg) error {
-// // ... use ctx ...
-// }
-//
-// Do not pass a nil [Context], even if a function permits it. Pass [context.TODO]
-// if you are unsure about which Context to use.
-//
-// Use context Values only for request-scoped data that transits processes and
-// APIs, not for passing optional parameters to functions.
+// Package context has been superseded by the standard library [context] package.
//
-// The same Context may be passed to functions running in different goroutines;
-// Contexts are safe for simultaneous use by multiple goroutines.
-//
-// See https://go.dev/blog/context for example code for a server that uses
-// Contexts.
-//
-// [go fix]: https://go.dev/cmd/go#hdr-Update_packages_to_use_new_APIs
+// Deprecated: Use the standard library context package instead.
package context
import (
@@ -51,36 +16,37 @@ import (
// API boundaries.
//
// Context's methods may be called by multiple goroutines simultaneously.
+//
+//go:fix inline
type Context = context.Context
// Canceled is the error returned by [Context.Err] when the context is canceled
// for some reason other than its deadline passing.
+//
+//go:fix inline
var Canceled = context.Canceled
// DeadlineExceeded is the error returned by [Context.Err] when the context is canceled
// due to its deadline passing.
+//
+//go:fix inline
var DeadlineExceeded = context.DeadlineExceeded
// Background returns a non-nil, empty Context. It is never canceled, has no
// values, and has no deadline. It is typically used by the main function,
// initialization, and tests, and as the top-level Context for incoming
// requests.
-func Background() Context {
- return background
-}
+//
+//go:fix inline
+func Background() Context { return context.Background() }
// TODO returns a non-nil, empty Context. Code should use context.TODO when
// it's unclear which Context to use or it is not yet available (because the
// surrounding function has not yet been extended to accept a Context
// parameter).
-func TODO() Context {
- return todo
-}
-
-var (
- background = context.Background()
- todo = context.TODO()
-)
+//
+//go:fix inline
+func TODO() Context { return context.TODO() }
// A CancelFunc tells an operation to abandon its work.
// A CancelFunc does not wait for the work to stop.
@@ -95,6 +61,8 @@ type CancelFunc = context.CancelFunc
//
// Canceling this context releases resources associated with it, so code should
// call cancel as soon as the operations running in this [Context] complete.
+//
+//go:fix inline
func WithCancel(parent Context) (ctx Context, cancel CancelFunc) {
return context.WithCancel(parent)
}
@@ -108,6 +76,8 @@ func WithCancel(parent Context) (ctx Context, cancel CancelFunc) {
//
// Canceling this context releases resources associated with it, so code should
// call cancel as soon as the operations running in this [Context] complete.
+//
+//go:fix inline
func WithDeadline(parent Context, d time.Time) (Context, CancelFunc) {
return context.WithDeadline(parent, d)
}
@@ -122,6 +92,8 @@ func WithDeadline(parent Context, d time.Time) (Context, CancelFunc) {
// defer cancel() // releases resources if slowOperation completes before timeout elapses
// return slowOperation(ctx)
// }
+//
+//go:fix inline
func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) {
return context.WithTimeout(parent, timeout)
}
@@ -139,6 +111,8 @@ func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) {
// interface{}, context keys often have concrete type
// struct{}. Alternatively, exported context key variables' static
// type should be a pointer or interface.
+//
+//go:fix inline
func WithValue(parent Context, key, val interface{}) Context {
return context.WithValue(parent, key, val)
}
diff --git a/vendor/golang.org/x/net/http2/config.go b/vendor/golang.org/x/net/http2/config.go
index ca645d9a1a..8a7a89d016 100644
--- a/vendor/golang.org/x/net/http2/config.go
+++ b/vendor/golang.org/x/net/http2/config.go
@@ -27,6 +27,7 @@ import (
// - If the resulting value is zero or out of range, use a default.
type http2Config struct {
MaxConcurrentStreams uint32
+ StrictMaxConcurrentRequests bool
MaxDecoderHeaderTableSize uint32
MaxEncoderHeaderTableSize uint32
MaxReadFrameSize uint32
@@ -55,7 +56,7 @@ func configFromServer(h1 *http.Server, h2 *Server) http2Config {
PermitProhibitedCipherSuites: h2.PermitProhibitedCipherSuites,
CountError: h2.CountError,
}
- fillNetHTTPServerConfig(&conf, h1)
+ fillNetHTTPConfig(&conf, h1.HTTP2)
setConfigDefaults(&conf, true)
return conf
}
@@ -64,12 +65,13 @@ func configFromServer(h1 *http.Server, h2 *Server) http2Config {
// (the net/http Transport).
func configFromTransport(h2 *Transport) http2Config {
conf := http2Config{
- MaxEncoderHeaderTableSize: h2.MaxEncoderHeaderTableSize,
- MaxDecoderHeaderTableSize: h2.MaxDecoderHeaderTableSize,
- MaxReadFrameSize: h2.MaxReadFrameSize,
- SendPingTimeout: h2.ReadIdleTimeout,
- PingTimeout: h2.PingTimeout,
- WriteByteTimeout: h2.WriteByteTimeout,
+ StrictMaxConcurrentRequests: h2.StrictMaxConcurrentStreams,
+ MaxEncoderHeaderTableSize: h2.MaxEncoderHeaderTableSize,
+ MaxDecoderHeaderTableSize: h2.MaxDecoderHeaderTableSize,
+ MaxReadFrameSize: h2.MaxReadFrameSize,
+ SendPingTimeout: h2.ReadIdleTimeout,
+ PingTimeout: h2.PingTimeout,
+ WriteByteTimeout: h2.WriteByteTimeout,
}
// Unlike most config fields, where out-of-range values revert to the default,
@@ -81,7 +83,7 @@ func configFromTransport(h2 *Transport) http2Config {
}
if h2.t1 != nil {
- fillNetHTTPTransportConfig(&conf, h2.t1)
+ fillNetHTTPConfig(&conf, h2.t1.HTTP2)
}
setConfigDefaults(&conf, false)
return conf
@@ -120,3 +122,48 @@ func adjustHTTP1MaxHeaderSize(n int64) int64 {
const typicalHeaders = 10 // conservative
return n + typicalHeaders*perFieldOverhead
}
+
+func fillNetHTTPConfig(conf *http2Config, h2 *http.HTTP2Config) {
+ if h2 == nil {
+ return
+ }
+ if h2.MaxConcurrentStreams != 0 {
+ conf.MaxConcurrentStreams = uint32(h2.MaxConcurrentStreams)
+ }
+ if http2ConfigStrictMaxConcurrentRequests(h2) {
+ conf.StrictMaxConcurrentRequests = true
+ }
+ if h2.MaxEncoderHeaderTableSize != 0 {
+ conf.MaxEncoderHeaderTableSize = uint32(h2.MaxEncoderHeaderTableSize)
+ }
+ if h2.MaxDecoderHeaderTableSize != 0 {
+ conf.MaxDecoderHeaderTableSize = uint32(h2.MaxDecoderHeaderTableSize)
+ }
+ if h2.MaxConcurrentStreams != 0 {
+ conf.MaxConcurrentStreams = uint32(h2.MaxConcurrentStreams)
+ }
+ if h2.MaxReadFrameSize != 0 {
+ conf.MaxReadFrameSize = uint32(h2.MaxReadFrameSize)
+ }
+ if h2.MaxReceiveBufferPerConnection != 0 {
+ conf.MaxUploadBufferPerConnection = int32(h2.MaxReceiveBufferPerConnection)
+ }
+ if h2.MaxReceiveBufferPerStream != 0 {
+ conf.MaxUploadBufferPerStream = int32(h2.MaxReceiveBufferPerStream)
+ }
+ if h2.SendPingTimeout != 0 {
+ conf.SendPingTimeout = h2.SendPingTimeout
+ }
+ if h2.PingTimeout != 0 {
+ conf.PingTimeout = h2.PingTimeout
+ }
+ if h2.WriteByteTimeout != 0 {
+ conf.WriteByteTimeout = h2.WriteByteTimeout
+ }
+ if h2.PermitProhibitedCipherSuites {
+ conf.PermitProhibitedCipherSuites = true
+ }
+ if h2.CountError != nil {
+ conf.CountError = h2.CountError
+ }
+}
diff --git a/vendor/golang.org/x/net/http2/config_go124.go b/vendor/golang.org/x/net/http2/config_go124.go
deleted file mode 100644
index 5b516c55ff..0000000000
--- a/vendor/golang.org/x/net/http2/config_go124.go
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2024 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build go1.24
-
-package http2
-
-import "net/http"
-
-// fillNetHTTPServerConfig sets fields in conf from srv.HTTP2.
-func fillNetHTTPServerConfig(conf *http2Config, srv *http.Server) {
- fillNetHTTPConfig(conf, srv.HTTP2)
-}
-
-// fillNetHTTPTransportConfig sets fields in conf from tr.HTTP2.
-func fillNetHTTPTransportConfig(conf *http2Config, tr *http.Transport) {
- fillNetHTTPConfig(conf, tr.HTTP2)
-}
-
-func fillNetHTTPConfig(conf *http2Config, h2 *http.HTTP2Config) {
- if h2 == nil {
- return
- }
- if h2.MaxConcurrentStreams != 0 {
- conf.MaxConcurrentStreams = uint32(h2.MaxConcurrentStreams)
- }
- if h2.MaxEncoderHeaderTableSize != 0 {
- conf.MaxEncoderHeaderTableSize = uint32(h2.MaxEncoderHeaderTableSize)
- }
- if h2.MaxDecoderHeaderTableSize != 0 {
- conf.MaxDecoderHeaderTableSize = uint32(h2.MaxDecoderHeaderTableSize)
- }
- if h2.MaxConcurrentStreams != 0 {
- conf.MaxConcurrentStreams = uint32(h2.MaxConcurrentStreams)
- }
- if h2.MaxReadFrameSize != 0 {
- conf.MaxReadFrameSize = uint32(h2.MaxReadFrameSize)
- }
- if h2.MaxReceiveBufferPerConnection != 0 {
- conf.MaxUploadBufferPerConnection = int32(h2.MaxReceiveBufferPerConnection)
- }
- if h2.MaxReceiveBufferPerStream != 0 {
- conf.MaxUploadBufferPerStream = int32(h2.MaxReceiveBufferPerStream)
- }
- if h2.SendPingTimeout != 0 {
- conf.SendPingTimeout = h2.SendPingTimeout
- }
- if h2.PingTimeout != 0 {
- conf.PingTimeout = h2.PingTimeout
- }
- if h2.WriteByteTimeout != 0 {
- conf.WriteByteTimeout = h2.WriteByteTimeout
- }
- if h2.PermitProhibitedCipherSuites {
- conf.PermitProhibitedCipherSuites = true
- }
- if h2.CountError != nil {
- conf.CountError = h2.CountError
- }
-}
diff --git a/vendor/golang.org/x/net/http2/config_go125.go b/vendor/golang.org/x/net/http2/config_go125.go
new file mode 100644
index 0000000000..b4373fe33c
--- /dev/null
+++ b/vendor/golang.org/x/net/http2/config_go125.go
@@ -0,0 +1,15 @@
+// Copyright 2025 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build !go1.26
+
+package http2
+
+import (
+ "net/http"
+)
+
+func http2ConfigStrictMaxConcurrentRequests(h2 *http.HTTP2Config) bool {
+ return false
+}
diff --git a/vendor/golang.org/x/net/http2/config_go126.go b/vendor/golang.org/x/net/http2/config_go126.go
new file mode 100644
index 0000000000..6b071c149d
--- /dev/null
+++ b/vendor/golang.org/x/net/http2/config_go126.go
@@ -0,0 +1,15 @@
+// Copyright 2025 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build go1.26
+
+package http2
+
+import (
+ "net/http"
+)
+
+func http2ConfigStrictMaxConcurrentRequests(h2 *http.HTTP2Config) bool {
+ return h2.StrictMaxConcurrentRequests
+}
diff --git a/vendor/golang.org/x/net/http2/config_pre_go124.go b/vendor/golang.org/x/net/http2/config_pre_go124.go
deleted file mode 100644
index 060fd6c64c..0000000000
--- a/vendor/golang.org/x/net/http2/config_pre_go124.go
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2024 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build !go1.24
-
-package http2
-
-import "net/http"
-
-// Pre-Go 1.24 fallback.
-// The Server.HTTP2 and Transport.HTTP2 config fields were added in Go 1.24.
-
-func fillNetHTTPServerConfig(conf *http2Config, srv *http.Server) {}
-
-func fillNetHTTPTransportConfig(conf *http2Config, tr *http.Transport) {}
diff --git a/vendor/golang.org/x/net/http2/frame.go b/vendor/golang.org/x/net/http2/frame.go
index db3264da8c..9a4bd123c9 100644
--- a/vendor/golang.org/x/net/http2/frame.go
+++ b/vendor/golang.org/x/net/http2/frame.go
@@ -280,6 +280,8 @@ type Framer struct {
// lastHeaderStream is non-zero if the last frame was an
// unfinished HEADERS/CONTINUATION.
lastHeaderStream uint32
+ // lastFrameType holds the type of the last frame for verifying frame order.
+ lastFrameType FrameType
maxReadSize uint32
headerBuf [frameHeaderLen]byte
@@ -347,7 +349,7 @@ func (fr *Framer) maxHeaderListSize() uint32 {
func (f *Framer) startWrite(ftype FrameType, flags Flags, streamID uint32) {
// Write the FrameHeader.
f.wbuf = append(f.wbuf[:0],
- 0, // 3 bytes of length, filled in in endWrite
+ 0, // 3 bytes of length, filled in endWrite
0,
0,
byte(ftype),
@@ -488,30 +490,41 @@ func terminalReadFrameError(err error) bool {
return err != nil
}
-// ReadFrame reads a single frame. The returned Frame is only valid
-// until the next call to ReadFrame.
+// ReadFrameHeader reads the header of the next frame.
+// It reads the 9-byte fixed frame header, and does not read any portion of the
+// frame payload. The caller is responsible for consuming the payload, either
+// with ReadFrameForHeader or directly from the Framer's io.Reader.
//
-// If the frame is larger than previously set with SetMaxReadFrameSize, the
-// returned error is ErrFrameTooLarge. Other errors may be of type
-// ConnectionError, StreamError, or anything else from the underlying
-// reader.
+// If the frame is larger than previously set with SetMaxReadFrameSize, it
+// returns the frame header and ErrFrameTooLarge.
//
-// If ReadFrame returns an error and a non-nil Frame, the Frame's StreamID
-// indicates the stream responsible for the error.
-func (fr *Framer) ReadFrame() (Frame, error) {
+// If the returned FrameHeader.StreamID is non-zero, it indicates the stream
+// responsible for the error.
+func (fr *Framer) ReadFrameHeader() (FrameHeader, error) {
fr.errDetail = nil
- if fr.lastFrame != nil {
- fr.lastFrame.invalidate()
- }
fh, err := readFrameHeader(fr.headerBuf[:], fr.r)
if err != nil {
- return nil, err
+ return fh, err
}
if fh.Length > fr.maxReadSize {
if fh == invalidHTTP1LookingFrameHeader() {
- return nil, fmt.Errorf("http2: failed reading the frame payload: %w, note that the frame header looked like an HTTP/1.1 header", ErrFrameTooLarge)
+ return fh, fmt.Errorf("http2: failed reading the frame payload: %w, note that the frame header looked like an HTTP/1.1 header", ErrFrameTooLarge)
}
- return nil, ErrFrameTooLarge
+ return fh, ErrFrameTooLarge
+ }
+ if err := fr.checkFrameOrder(fh); err != nil {
+ return fh, err
+ }
+ return fh, nil
+}
+
+// ReadFrameForHeader reads the payload for the frame with the given FrameHeader.
+//
+// It behaves identically to ReadFrame, other than not checking the maximum
+// frame size.
+func (fr *Framer) ReadFrameForHeader(fh FrameHeader) (Frame, error) {
+ if fr.lastFrame != nil {
+ fr.lastFrame.invalidate()
}
payload := fr.getReadBuf(fh.Length)
if _, err := io.ReadFull(fr.r, payload); err != nil {
@@ -527,9 +540,7 @@ func (fr *Framer) ReadFrame() (Frame, error) {
}
return nil, err
}
- if err := fr.checkFrameOrder(f); err != nil {
- return nil, err
- }
+ fr.lastFrame = f
if fr.logReads {
fr.debugReadLoggerf("http2: Framer %p: read %v", fr, summarizeFrame(f))
}
@@ -539,6 +550,24 @@ func (fr *Framer) ReadFrame() (Frame, error) {
return f, nil
}
+// ReadFrame reads a single frame. The returned Frame is only valid
+// until the next call to ReadFrame or ReadFrameBodyForHeader.
+//
+// If the frame is larger than previously set with SetMaxReadFrameSize, the
+// returned error is ErrFrameTooLarge. Other errors may be of type
+// ConnectionError, StreamError, or anything else from the underlying
+// reader.
+//
+// If ReadFrame returns an error and a non-nil Frame, the Frame's StreamID
+// indicates the stream responsible for the error.
+func (fr *Framer) ReadFrame() (Frame, error) {
+ fh, err := fr.ReadFrameHeader()
+ if err != nil {
+ return nil, err
+ }
+ return fr.ReadFrameForHeader(fh)
+}
+
// connError returns ConnectionError(code) but first
// stashes away a public reason to the caller can optionally relay it
// to the peer before hanging up on them. This might help others debug
@@ -551,20 +580,19 @@ func (fr *Framer) connError(code ErrCode, reason string) error {
// checkFrameOrder reports an error if f is an invalid frame to return
// next from ReadFrame. Mostly it checks whether HEADERS and
// CONTINUATION frames are contiguous.
-func (fr *Framer) checkFrameOrder(f Frame) error {
- last := fr.lastFrame
- fr.lastFrame = f
+func (fr *Framer) checkFrameOrder(fh FrameHeader) error {
+ lastType := fr.lastFrameType
+ fr.lastFrameType = fh.Type
if fr.AllowIllegalReads {
return nil
}
- fh := f.Header()
if fr.lastHeaderStream != 0 {
if fh.Type != FrameContinuation {
return fr.connError(ErrCodeProtocol,
fmt.Sprintf("got %s for stream %d; expected CONTINUATION following %s for stream %d",
fh.Type, fh.StreamID,
- last.Header().Type, fr.lastHeaderStream))
+ lastType, fr.lastHeaderStream))
}
if fh.StreamID != fr.lastHeaderStream {
return fr.connError(ErrCodeProtocol,
@@ -1152,7 +1180,16 @@ type PriorityFrame struct {
PriorityParam
}
-// PriorityParam are the stream prioritzation parameters.
+var defaultRFC9218Priority = PriorityParam{
+ incremental: 0,
+ urgency: 3,
+}
+
+// Note that HTTP/2 has had two different prioritization schemes, and
+// PriorityParam struct below is a superset of both schemes. The exported
+// symbols are from RFC 7540 and the non-exported ones are from RFC 9218.
+
+// PriorityParam are the stream prioritization parameters.
type PriorityParam struct {
// StreamDep is a 31-bit stream identifier for the
// stream that this stream depends on. Zero means no
@@ -1167,6 +1204,20 @@ type PriorityParam struct {
// the spec, "Add one to the value to obtain a weight between
// 1 and 256."
Weight uint8
+
+ // "The urgency (u) parameter value is Integer (see Section 3.3.1 of
+ // [STRUCTURED-FIELDS]), between 0 and 7 inclusive, in descending order of
+ // priority. The default is 3."
+ urgency uint8
+
+ // "The incremental (i) parameter value is Boolean (see Section 3.3.6 of
+ // [STRUCTURED-FIELDS]). It indicates if an HTTP response can be processed
+ // incrementally, i.e., provide some meaningful output as chunks of the
+ // response arrive."
+ //
+ // We use uint8 (i.e. 0 is false, 1 is true) instead of bool so we can
+ // avoid unnecessary type conversions and because either type takes 1 byte.
+ incremental uint8
}
func (p PriorityParam) IsZero() bool {
diff --git a/vendor/golang.org/x/net/http2/gotrack.go b/vendor/golang.org/x/net/http2/gotrack.go
index 9933c9f8c7..9921ca096d 100644
--- a/vendor/golang.org/x/net/http2/gotrack.go
+++ b/vendor/golang.org/x/net/http2/gotrack.go
@@ -15,21 +15,32 @@ import (
"runtime"
"strconv"
"sync"
+ "sync/atomic"
)
var DebugGoroutines = os.Getenv("DEBUG_HTTP2_GOROUTINES") == "1"
+// Setting DebugGoroutines to false during a test to disable goroutine debugging
+// results in race detector complaints when a test leaves goroutines running before
+// returning. Tests shouldn't do this, of course, but when they do it generally shows
+// up as infrequent, hard-to-debug flakes. (See #66519.)
+//
+// Disable goroutine debugging during individual tests with an atomic bool.
+// (Note that it's safe to enable/disable debugging mid-test, so the actual race condition
+// here is harmless.)
+var disableDebugGoroutines atomic.Bool
+
type goroutineLock uint64
func newGoroutineLock() goroutineLock {
- if !DebugGoroutines {
+ if !DebugGoroutines || disableDebugGoroutines.Load() {
return 0
}
return goroutineLock(curGoroutineID())
}
func (g goroutineLock) check() {
- if !DebugGoroutines {
+ if !DebugGoroutines || disableDebugGoroutines.Load() {
return
}
if curGoroutineID() != uint64(g) {
@@ -38,7 +49,7 @@ func (g goroutineLock) check() {
}
func (g goroutineLock) checkNotOn() {
- if !DebugGoroutines {
+ if !DebugGoroutines || disableDebugGoroutines.Load() {
return
}
if curGoroutineID() == uint64(g) {
diff --git a/vendor/golang.org/x/net/http2/http2.go b/vendor/golang.org/x/net/http2/http2.go
index ea5ae629fd..105fe12fef 100644
--- a/vendor/golang.org/x/net/http2/http2.go
+++ b/vendor/golang.org/x/net/http2/http2.go
@@ -15,7 +15,6 @@ package http2 // import "golang.org/x/net/http2"
import (
"bufio"
- "context"
"crypto/tls"
"errors"
"fmt"
@@ -35,7 +34,6 @@ var (
VerboseLogs bool
logFrameWrites bool
logFrameReads bool
- inTests bool
// Enabling extended CONNECT by causes browsers to attempt to use
// WebSockets-over-HTTP/2. This results in problems when the server's websocket
@@ -255,15 +253,13 @@ func (cw closeWaiter) Wait() {
// idle memory usage with many connections.
type bufferedWriter struct {
_ incomparable
- group synctestGroupInterface // immutable
- conn net.Conn // immutable
- bw *bufio.Writer // non-nil when data is buffered
- byteTimeout time.Duration // immutable, WriteByteTimeout
+ conn net.Conn // immutable
+ bw *bufio.Writer // non-nil when data is buffered
+ byteTimeout time.Duration // immutable, WriteByteTimeout
}
-func newBufferedWriter(group synctestGroupInterface, conn net.Conn, timeout time.Duration) *bufferedWriter {
+func newBufferedWriter(conn net.Conn, timeout time.Duration) *bufferedWriter {
return &bufferedWriter{
- group: group,
conn: conn,
byteTimeout: timeout,
}
@@ -314,24 +310,18 @@ func (w *bufferedWriter) Flush() error {
type bufferedWriterTimeoutWriter bufferedWriter
func (w *bufferedWriterTimeoutWriter) Write(p []byte) (n int, err error) {
- return writeWithByteTimeout(w.group, w.conn, w.byteTimeout, p)
+ return writeWithByteTimeout(w.conn, w.byteTimeout, p)
}
// writeWithByteTimeout writes to conn.
// If more than timeout passes without any bytes being written to the connection,
// the write fails.
-func writeWithByteTimeout(group synctestGroupInterface, conn net.Conn, timeout time.Duration, p []byte) (n int, err error) {
+func writeWithByteTimeout(conn net.Conn, timeout time.Duration, p []byte) (n int, err error) {
if timeout <= 0 {
return conn.Write(p)
}
for {
- var now time.Time
- if group == nil {
- now = time.Now()
- } else {
- now = group.Now()
- }
- conn.SetWriteDeadline(now.Add(timeout))
+ conn.SetWriteDeadline(time.Now().Add(timeout))
nn, err := conn.Write(p[n:])
n += nn
if n == len(p) || nn == 0 || !errors.Is(err, os.ErrDeadlineExceeded) {
@@ -417,14 +407,3 @@ func (s *sorter) SortStrings(ss []string) {
// makes that struct also non-comparable, and generally doesn't add
// any size (as long as it's first).
type incomparable [0]func()
-
-// synctestGroupInterface is the methods of synctestGroup used by Server and Transport.
-// It's defined as an interface here to let us keep synctestGroup entirely test-only
-// and not a part of non-test builds.
-type synctestGroupInterface interface {
- Join()
- Now() time.Time
- NewTimer(d time.Duration) timer
- AfterFunc(d time.Duration, f func()) timer
- ContextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc)
-}
diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go
index 51fca38f61..bdc5520ebd 100644
--- a/vendor/golang.org/x/net/http2/server.go
+++ b/vendor/golang.org/x/net/http2/server.go
@@ -176,44 +176,15 @@ type Server struct {
// so that we don't embed a Mutex in this struct, which will make the
// struct non-copyable, which might break some callers.
state *serverInternalState
-
- // Synchronization group used for testing.
- // Outside of tests, this is nil.
- group synctestGroupInterface
-}
-
-func (s *Server) markNewGoroutine() {
- if s.group != nil {
- s.group.Join()
- }
-}
-
-func (s *Server) now() time.Time {
- if s.group != nil {
- return s.group.Now()
- }
- return time.Now()
-}
-
-// newTimer creates a new time.Timer, or a synthetic timer in tests.
-func (s *Server) newTimer(d time.Duration) timer {
- if s.group != nil {
- return s.group.NewTimer(d)
- }
- return timeTimer{time.NewTimer(d)}
-}
-
-// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests.
-func (s *Server) afterFunc(d time.Duration, f func()) timer {
- if s.group != nil {
- return s.group.AfterFunc(d, f)
- }
- return timeTimer{time.AfterFunc(d, f)}
}
type serverInternalState struct {
mu sync.Mutex
activeConns map[*serverConn]struct{}
+
+ // Pool of error channels. This is per-Server rather than global
+ // because channels can't be reused across synctest bubbles.
+ errChanPool sync.Pool
}
func (s *serverInternalState) registerConn(sc *serverConn) {
@@ -245,6 +216,27 @@ func (s *serverInternalState) startGracefulShutdown() {
s.mu.Unlock()
}
+// Global error channel pool used for uninitialized Servers.
+// We use a per-Server pool when possible to avoid using channels across synctest bubbles.
+var errChanPool = sync.Pool{
+ New: func() any { return make(chan error, 1) },
+}
+
+func (s *serverInternalState) getErrChan() chan error {
+ if s == nil {
+ return errChanPool.Get().(chan error) // Server used without calling ConfigureServer
+ }
+ return s.errChanPool.Get().(chan error)
+}
+
+func (s *serverInternalState) putErrChan(ch chan error) {
+ if s == nil {
+ errChanPool.Put(ch) // Server used without calling ConfigureServer
+ return
+ }
+ s.errChanPool.Put(ch)
+}
+
// ConfigureServer adds HTTP/2 support to a net/http Server.
//
// The configuration conf may be nil.
@@ -257,7 +249,10 @@ func ConfigureServer(s *http.Server, conf *Server) error {
if conf == nil {
conf = new(Server)
}
- conf.state = &serverInternalState{activeConns: make(map[*serverConn]struct{})}
+ conf.state = &serverInternalState{
+ activeConns: make(map[*serverConn]struct{}),
+ errChanPool: sync.Pool{New: func() any { return make(chan error, 1) }},
+ }
if h1, h2 := s, conf; h2.IdleTimeout == 0 {
if h1.IdleTimeout != 0 {
h2.IdleTimeout = h1.IdleTimeout
@@ -423,6 +418,9 @@ func (o *ServeConnOpts) handler() http.Handler {
//
// The opts parameter is optional. If nil, default values are used.
func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) {
+ if opts == nil {
+ opts = &ServeConnOpts{}
+ }
s.serveConn(c, opts, nil)
}
@@ -438,7 +436,7 @@ func (s *Server) serveConn(c net.Conn, opts *ServeConnOpts, newf func(*serverCon
conn: c,
baseCtx: baseCtx,
remoteAddrStr: c.RemoteAddr().String(),
- bw: newBufferedWriter(s.group, c, conf.WriteByteTimeout),
+ bw: newBufferedWriter(c, conf.WriteByteTimeout),
handler: opts.handler(),
streams: make(map[uint32]*stream),
readFrameCh: make(chan readFrameResult),
@@ -638,11 +636,11 @@ type serverConn struct {
pingSent bool
sentPingData [8]byte
goAwayCode ErrCode
- shutdownTimer timer // nil until used
- idleTimer timer // nil if unused
+ shutdownTimer *time.Timer // nil until used
+ idleTimer *time.Timer // nil if unused
readIdleTimeout time.Duration
pingTimeout time.Duration
- readIdleTimer timer // nil if unused
+ readIdleTimer *time.Timer // nil if unused
// Owned by the writeFrameAsync goroutine:
headerWriteBuf bytes.Buffer
@@ -687,12 +685,12 @@ type stream struct {
flow outflow // limits writing from Handler to client
inflow inflow // what the client is allowed to POST/etc to us
state streamState
- resetQueued bool // RST_STREAM queued for write; set by sc.resetStream
- gotTrailerHeader bool // HEADER frame for trailers was seen
- wroteHeaders bool // whether we wrote headers (not status 100)
- readDeadline timer // nil if unused
- writeDeadline timer // nil if unused
- closeErr error // set before cw is closed
+ resetQueued bool // RST_STREAM queued for write; set by sc.resetStream
+ gotTrailerHeader bool // HEADER frame for trailers was seen
+ wroteHeaders bool // whether we wrote headers (not status 100)
+ readDeadline *time.Timer // nil if unused
+ writeDeadline *time.Timer // nil if unused
+ closeErr error // set before cw is closed
trailer http.Header // accumulated trailers
reqTrailer http.Header // handler's Request.Trailer
@@ -848,7 +846,6 @@ type readFrameResult struct {
// consumer is done with the frame.
// It's run on its own goroutine.
func (sc *serverConn) readFrames() {
- sc.srv.markNewGoroutine()
gate := make(chan struct{})
gateDone := func() { gate <- struct{}{} }
for {
@@ -881,7 +878,6 @@ type frameWriteResult struct {
// At most one goroutine can be running writeFrameAsync at a time per
// serverConn.
func (sc *serverConn) writeFrameAsync(wr FrameWriteRequest, wd *writeData) {
- sc.srv.markNewGoroutine()
var err error
if wd == nil {
err = wr.write.writeFrame(sc)
@@ -965,22 +961,22 @@ func (sc *serverConn) serve(conf http2Config) {
sc.setConnState(http.StateIdle)
if sc.srv.IdleTimeout > 0 {
- sc.idleTimer = sc.srv.afterFunc(sc.srv.IdleTimeout, sc.onIdleTimer)
+ sc.idleTimer = time.AfterFunc(sc.srv.IdleTimeout, sc.onIdleTimer)
defer sc.idleTimer.Stop()
}
if conf.SendPingTimeout > 0 {
sc.readIdleTimeout = conf.SendPingTimeout
- sc.readIdleTimer = sc.srv.afterFunc(conf.SendPingTimeout, sc.onReadIdleTimer)
+ sc.readIdleTimer = time.AfterFunc(conf.SendPingTimeout, sc.onReadIdleTimer)
defer sc.readIdleTimer.Stop()
}
go sc.readFrames() // closed by defer sc.conn.Close above
- settingsTimer := sc.srv.afterFunc(firstSettingsTimeout, sc.onSettingsTimer)
+ settingsTimer := time.AfterFunc(firstSettingsTimeout, sc.onSettingsTimer)
defer settingsTimer.Stop()
- lastFrameTime := sc.srv.now()
+ lastFrameTime := time.Now()
loopNum := 0
for {
loopNum++
@@ -994,7 +990,7 @@ func (sc *serverConn) serve(conf http2Config) {
case res := <-sc.wroteFrameCh:
sc.wroteFrame(res)
case res := <-sc.readFrameCh:
- lastFrameTime = sc.srv.now()
+ lastFrameTime = time.Now()
// Process any written frames before reading new frames from the client since a
// written frame could have triggered a new stream to be started.
if sc.writingFrameAsync {
@@ -1077,7 +1073,7 @@ func (sc *serverConn) handlePingTimer(lastFrameReadTime time.Time) {
}
pingAt := lastFrameReadTime.Add(sc.readIdleTimeout)
- now := sc.srv.now()
+ now := time.Now()
if pingAt.After(now) {
// We received frames since arming the ping timer.
// Reset it for the next possible timeout.
@@ -1141,10 +1137,10 @@ func (sc *serverConn) readPreface() error {
errc <- nil
}
}()
- timer := sc.srv.newTimer(prefaceTimeout) // TODO: configurable on *Server?
+ timer := time.NewTimer(prefaceTimeout) // TODO: configurable on *Server?
defer timer.Stop()
select {
- case <-timer.C():
+ case <-timer.C:
return errPrefaceTimeout
case err := <-errc:
if err == nil {
@@ -1156,10 +1152,6 @@ func (sc *serverConn) readPreface() error {
}
}
-var errChanPool = sync.Pool{
- New: func() interface{} { return make(chan error, 1) },
-}
-
var writeDataPool = sync.Pool{
New: func() interface{} { return new(writeData) },
}
@@ -1167,7 +1159,7 @@ var writeDataPool = sync.Pool{
// writeDataFromHandler writes DATA response frames from a handler on
// the given stream.
func (sc *serverConn) writeDataFromHandler(stream *stream, data []byte, endStream bool) error {
- ch := errChanPool.Get().(chan error)
+ ch := sc.srv.state.getErrChan()
writeArg := writeDataPool.Get().(*writeData)
*writeArg = writeData{stream.id, data, endStream}
err := sc.writeFrameFromHandler(FrameWriteRequest{
@@ -1199,7 +1191,7 @@ func (sc *serverConn) writeDataFromHandler(stream *stream, data []byte, endStrea
return errStreamClosed
}
}
- errChanPool.Put(ch)
+ sc.srv.state.putErrChan(ch)
if frameWriteDone {
writeDataPool.Put(writeArg)
}
@@ -1513,7 +1505,7 @@ func (sc *serverConn) goAway(code ErrCode) {
func (sc *serverConn) shutDownIn(d time.Duration) {
sc.serveG.check()
- sc.shutdownTimer = sc.srv.afterFunc(d, sc.onShutdownTimer)
+ sc.shutdownTimer = time.AfterFunc(d, sc.onShutdownTimer)
}
func (sc *serverConn) resetStream(se StreamError) {
@@ -2118,7 +2110,7 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error {
// (in Go 1.8), though. That's a more sane option anyway.
if sc.hs.ReadTimeout > 0 {
sc.conn.SetReadDeadline(time.Time{})
- st.readDeadline = sc.srv.afterFunc(sc.hs.ReadTimeout, st.onReadTimeout)
+ st.readDeadline = time.AfterFunc(sc.hs.ReadTimeout, st.onReadTimeout)
}
return sc.scheduleHandler(id, rw, req, handler)
@@ -2216,7 +2208,7 @@ func (sc *serverConn) newStream(id, pusherID uint32, state streamState) *stream
st.flow.add(sc.initialStreamSendWindowSize)
st.inflow.init(sc.initialStreamRecvWindowSize)
if sc.hs.WriteTimeout > 0 {
- st.writeDeadline = sc.srv.afterFunc(sc.hs.WriteTimeout, st.onWriteTimeout)
+ st.writeDeadline = time.AfterFunc(sc.hs.WriteTimeout, st.onWriteTimeout)
}
sc.streams[id] = st
@@ -2405,7 +2397,6 @@ func (sc *serverConn) handlerDone() {
// Run on its own goroutine.
func (sc *serverConn) runHandler(rw *responseWriter, req *http.Request, handler func(http.ResponseWriter, *http.Request)) {
- sc.srv.markNewGoroutine()
defer sc.sendServeMsg(handlerDoneMsg)
didPanic := true
defer func() {
@@ -2454,7 +2445,7 @@ func (sc *serverConn) writeHeaders(st *stream, headerData *writeResHeaders) erro
// waiting for this frame to be written, so an http.Flush mid-handler
// writes out the correct value of keys, before a handler later potentially
// mutates it.
- errc = errChanPool.Get().(chan error)
+ errc = sc.srv.state.getErrChan()
}
if err := sc.writeFrameFromHandler(FrameWriteRequest{
write: headerData,
@@ -2466,7 +2457,7 @@ func (sc *serverConn) writeHeaders(st *stream, headerData *writeResHeaders) erro
if errc != nil {
select {
case err := <-errc:
- errChanPool.Put(errc)
+ sc.srv.state.putErrChan(errc)
return err
case <-sc.doneServing:
return errClientDisconnected
@@ -2573,7 +2564,7 @@ func (b *requestBody) Read(p []byte) (n int, err error) {
if err == io.EOF {
b.sawEOF = true
}
- if b.conn == nil && inTests {
+ if b.conn == nil {
return
}
b.conn.noteBodyReadFromHandler(b.stream, n, err)
@@ -2702,7 +2693,7 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) {
var date string
if _, ok := rws.snapHeader["Date"]; !ok {
// TODO(bradfitz): be faster here, like net/http? measure.
- date = rws.conn.srv.now().UTC().Format(http.TimeFormat)
+ date = time.Now().UTC().Format(http.TimeFormat)
}
for _, v := range rws.snapHeader["Trailer"] {
@@ -2824,7 +2815,7 @@ func (rws *responseWriterState) promoteUndeclaredTrailers() {
func (w *responseWriter) SetReadDeadline(deadline time.Time) error {
st := w.rws.stream
- if !deadline.IsZero() && deadline.Before(w.rws.conn.srv.now()) {
+ if !deadline.IsZero() && deadline.Before(time.Now()) {
// If we're setting a deadline in the past, reset the stream immediately
// so writes after SetWriteDeadline returns will fail.
st.onReadTimeout()
@@ -2840,9 +2831,9 @@ func (w *responseWriter) SetReadDeadline(deadline time.Time) error {
if deadline.IsZero() {
st.readDeadline = nil
} else if st.readDeadline == nil {
- st.readDeadline = sc.srv.afterFunc(deadline.Sub(sc.srv.now()), st.onReadTimeout)
+ st.readDeadline = time.AfterFunc(deadline.Sub(time.Now()), st.onReadTimeout)
} else {
- st.readDeadline.Reset(deadline.Sub(sc.srv.now()))
+ st.readDeadline.Reset(deadline.Sub(time.Now()))
}
})
return nil
@@ -2850,7 +2841,7 @@ func (w *responseWriter) SetReadDeadline(deadline time.Time) error {
func (w *responseWriter) SetWriteDeadline(deadline time.Time) error {
st := w.rws.stream
- if !deadline.IsZero() && deadline.Before(w.rws.conn.srv.now()) {
+ if !deadline.IsZero() && deadline.Before(time.Now()) {
// If we're setting a deadline in the past, reset the stream immediately
// so writes after SetWriteDeadline returns will fail.
st.onWriteTimeout()
@@ -2866,9 +2857,9 @@ func (w *responseWriter) SetWriteDeadline(deadline time.Time) error {
if deadline.IsZero() {
st.writeDeadline = nil
} else if st.writeDeadline == nil {
- st.writeDeadline = sc.srv.afterFunc(deadline.Sub(sc.srv.now()), st.onWriteTimeout)
+ st.writeDeadline = time.AfterFunc(deadline.Sub(time.Now()), st.onWriteTimeout)
} else {
- st.writeDeadline.Reset(deadline.Sub(sc.srv.now()))
+ st.writeDeadline.Reset(deadline.Sub(time.Now()))
}
})
return nil
@@ -3147,7 +3138,7 @@ func (w *responseWriter) Push(target string, opts *http.PushOptions) error {
method: opts.Method,
url: u,
header: cloneHeader(opts.Header),
- done: errChanPool.Get().(chan error),
+ done: sc.srv.state.getErrChan(),
}
select {
@@ -3164,7 +3155,7 @@ func (w *responseWriter) Push(target string, opts *http.PushOptions) error {
case <-st.cw:
return errStreamClosed
case err := <-msg.done:
- errChanPool.Put(msg.done)
+ sc.srv.state.putErrChan(msg.done)
return err
}
}
diff --git a/vendor/golang.org/x/net/http2/timer.go b/vendor/golang.org/x/net/http2/timer.go
deleted file mode 100644
index 0b1c17b812..0000000000
--- a/vendor/golang.org/x/net/http2/timer.go
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2024 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-package http2
-
-import "time"
-
-// A timer is a time.Timer, as an interface which can be replaced in tests.
-type timer = interface {
- C() <-chan time.Time
- Reset(d time.Duration) bool
- Stop() bool
-}
-
-// timeTimer adapts a time.Timer to the timer interface.
-type timeTimer struct {
- *time.Timer
-}
-
-func (t timeTimer) C() <-chan time.Time { return t.Timer.C }
diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go
index f26356b9cd..1965913e54 100644
--- a/vendor/golang.org/x/net/http2/transport.go
+++ b/vendor/golang.org/x/net/http2/transport.go
@@ -9,6 +9,7 @@ package http2
import (
"bufio"
"bytes"
+ "compress/flate"
"compress/gzip"
"context"
"crypto/rand"
@@ -193,50 +194,6 @@ type Transport struct {
type transportTestHooks struct {
newclientconn func(*ClientConn)
- group synctestGroupInterface
-}
-
-func (t *Transport) markNewGoroutine() {
- if t != nil && t.transportTestHooks != nil {
- t.transportTestHooks.group.Join()
- }
-}
-
-func (t *Transport) now() time.Time {
- if t != nil && t.transportTestHooks != nil {
- return t.transportTestHooks.group.Now()
- }
- return time.Now()
-}
-
-func (t *Transport) timeSince(when time.Time) time.Duration {
- if t != nil && t.transportTestHooks != nil {
- return t.now().Sub(when)
- }
- return time.Since(when)
-}
-
-// newTimer creates a new time.Timer, or a synthetic timer in tests.
-func (t *Transport) newTimer(d time.Duration) timer {
- if t.transportTestHooks != nil {
- return t.transportTestHooks.group.NewTimer(d)
- }
- return timeTimer{time.NewTimer(d)}
-}
-
-// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests.
-func (t *Transport) afterFunc(d time.Duration, f func()) timer {
- if t.transportTestHooks != nil {
- return t.transportTestHooks.group.AfterFunc(d, f)
- }
- return timeTimer{time.AfterFunc(d, f)}
-}
-
-func (t *Transport) contextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) {
- if t.transportTestHooks != nil {
- return t.transportTestHooks.group.ContextWithTimeout(ctx, d)
- }
- return context.WithTimeout(ctx, d)
}
func (t *Transport) maxHeaderListSize() uint32 {
@@ -366,7 +323,7 @@ type ClientConn struct {
readerErr error // set before readerDone is closed
idleTimeout time.Duration // or 0 for never
- idleTimer timer
+ idleTimer *time.Timer
mu sync.Mutex // guards following
cond *sync.Cond // hold mu; broadcast on flow/closed changes
@@ -399,6 +356,7 @@ type ClientConn struct {
readIdleTimeout time.Duration
pingTimeout time.Duration
extendedConnectAllowed bool
+ strictMaxConcurrentStreams bool
// rstStreamPingsBlocked works around an unfortunate gRPC behavior.
// gRPC strictly limits the number of PING frames that it will receive.
@@ -534,14 +492,12 @@ func (cs *clientStream) closeReqBodyLocked() {
cs.reqBodyClosed = make(chan struct{})
reqBodyClosed := cs.reqBodyClosed
go func() {
- cs.cc.t.markNewGoroutine()
cs.reqBody.Close()
close(reqBodyClosed)
}()
}
type stickyErrWriter struct {
- group synctestGroupInterface
conn net.Conn
timeout time.Duration
err *error
@@ -551,7 +507,7 @@ func (sew stickyErrWriter) Write(p []byte) (n int, err error) {
if *sew.err != nil {
return 0, *sew.err
}
- n, err = writeWithByteTimeout(sew.group, sew.conn, sew.timeout, p)
+ n, err = writeWithByteTimeout(sew.conn, sew.timeout, p)
*sew.err = err
return n, err
}
@@ -650,9 +606,9 @@ func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res
backoff := float64(uint(1) << (uint(retry) - 1))
backoff += backoff * (0.1 * mathrand.Float64())
d := time.Second * time.Duration(backoff)
- tm := t.newTimer(d)
+ tm := time.NewTimer(d)
select {
- case <-tm.C():
+ case <-tm.C:
t.vlogf("RoundTrip retrying after failure: %v", roundTripErr)
continue
case <-req.Context().Done():
@@ -699,6 +655,7 @@ var (
errClientConnUnusable = errors.New("http2: client conn not usable")
errClientConnNotEstablished = errors.New("http2: client conn could not be established")
errClientConnGotGoAway = errors.New("http2: Transport received Server's graceful shutdown GOAWAY")
+ errClientConnForceClosed = errors.New("http2: client connection force closed via ClientConn.Close")
)
// shouldRetryRequest is called by RoundTrip when a request fails to get
@@ -829,7 +786,8 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro
initialWindowSize: 65535, // spec default
initialStreamRecvWindowSize: conf.MaxUploadBufferPerStream,
maxConcurrentStreams: initialMaxConcurrentStreams, // "infinite", per spec. Use a smaller value until we have received server settings.
- peerMaxHeaderListSize: 0xffffffffffffffff, // "infinite", per spec. Use 2^64-1 instead.
+ strictMaxConcurrentStreams: conf.StrictMaxConcurrentRequests,
+ peerMaxHeaderListSize: 0xffffffffffffffff, // "infinite", per spec. Use 2^64-1 instead.
streams: make(map[uint32]*clientStream),
singleUse: singleUse,
seenSettingsChan: make(chan struct{}),
@@ -838,14 +796,11 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro
pingTimeout: conf.PingTimeout,
pings: make(map[[8]byte]chan struct{}),
reqHeaderMu: make(chan struct{}, 1),
- lastActive: t.now(),
+ lastActive: time.Now(),
}
- var group synctestGroupInterface
if t.transportTestHooks != nil {
- t.markNewGoroutine()
t.transportTestHooks.newclientconn(cc)
c = cc.tconn
- group = t.group
}
if VerboseLogs {
t.vlogf("http2: Transport creating client conn %p to %v", cc, c.RemoteAddr())
@@ -857,7 +812,6 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro
// TODO: adjust this writer size to account for frame size +
// MTU + crypto/tls record padding.
cc.bw = bufio.NewWriter(stickyErrWriter{
- group: group,
conn: c,
timeout: conf.WriteByteTimeout,
err: &cc.werr,
@@ -906,7 +860,7 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro
// Start the idle timer after the connection is fully initialized.
if d := t.idleConnTimeout(); d != 0 {
cc.idleTimeout = d
- cc.idleTimer = t.afterFunc(d, cc.onIdleTimeout)
+ cc.idleTimer = time.AfterFunc(d, cc.onIdleTimeout)
}
go cc.readLoop()
@@ -917,7 +871,7 @@ func (cc *ClientConn) healthCheck() {
pingTimeout := cc.pingTimeout
// We don't need to periodically ping in the health check, because the readLoop of ClientConn will
// trigger the healthCheck again if there is no frame received.
- ctx, cancel := cc.t.contextWithTimeout(context.Background(), pingTimeout)
+ ctx, cancel := context.WithTimeout(context.Background(), pingTimeout)
defer cancel()
cc.vlogf("http2: Transport sending health check")
err := cc.Ping(ctx)
@@ -1067,7 +1021,7 @@ func (cc *ClientConn) idleStateLocked() (st clientConnIdleState) {
return
}
var maxConcurrentOkay bool
- if cc.t.StrictMaxConcurrentStreams {
+ if cc.strictMaxConcurrentStreams {
// We'll tell the caller we can take a new request to
// prevent the caller from dialing a new TCP
// connection, but then we'll block later before
@@ -1120,7 +1074,7 @@ func (cc *ClientConn) tooIdleLocked() bool {
// times are compared based on their wall time. We don't want
// to reuse a connection that's been sitting idle during
// VM/laptop suspend if monotonic time was also frozen.
- return cc.idleTimeout != 0 && !cc.lastIdle.IsZero() && cc.t.timeSince(cc.lastIdle.Round(0)) > cc.idleTimeout
+ return cc.idleTimeout != 0 && !cc.lastIdle.IsZero() && time.Since(cc.lastIdle.Round(0)) > cc.idleTimeout
}
// onIdleTimeout is called from a time.AfterFunc goroutine. It will
@@ -1186,7 +1140,6 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error {
done := make(chan struct{})
cancelled := false // guarded by cc.mu
go func() {
- cc.t.markNewGoroutine()
cc.mu.Lock()
defer cc.mu.Unlock()
for {
@@ -1257,8 +1210,7 @@ func (cc *ClientConn) closeForError(err error) {
//
// In-flight requests are interrupted. For a graceful shutdown, use Shutdown instead.
func (cc *ClientConn) Close() error {
- err := errors.New("http2: client connection force closed via ClientConn.Close")
- cc.closeForError(err)
+ cc.closeForError(errClientConnForceClosed)
return nil
}
@@ -1427,7 +1379,6 @@ func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream))
//
// It sends the request and performs post-request cleanup (closing Request.Body, etc.).
func (cs *clientStream) doRequest(req *http.Request, streamf func(*clientStream)) {
- cs.cc.t.markNewGoroutine()
err := cs.writeRequest(req, streamf)
cs.cleanupWriteRequest(err)
}
@@ -1558,9 +1509,9 @@ func (cs *clientStream) writeRequest(req *http.Request, streamf func(*clientStre
var respHeaderTimer <-chan time.Time
var respHeaderRecv chan struct{}
if d := cc.responseHeaderTimeout(); d != 0 {
- timer := cc.t.newTimer(d)
+ timer := time.NewTimer(d)
defer timer.Stop()
- respHeaderTimer = timer.C()
+ respHeaderTimer = timer.C
respHeaderRecv = cs.respHeaderRecv
}
// Wait until the peer half-closes its end of the stream,
@@ -1753,7 +1704,7 @@ func (cc *ClientConn) awaitOpenSlotForStreamLocked(cs *clientStream) error {
// Return a fatal error which aborts the retry loop.
return errClientConnNotEstablished
}
- cc.lastActive = cc.t.now()
+ cc.lastActive = time.Now()
if cc.closed || !cc.canTakeNewRequestLocked() {
return errClientConnUnusable
}
@@ -2092,10 +2043,10 @@ func (cc *ClientConn) forgetStreamID(id uint32) {
if len(cc.streams) != slen-1 {
panic("forgetting unknown stream id")
}
- cc.lastActive = cc.t.now()
+ cc.lastActive = time.Now()
if len(cc.streams) == 0 && cc.idleTimer != nil {
cc.idleTimer.Reset(cc.idleTimeout)
- cc.lastIdle = cc.t.now()
+ cc.lastIdle = time.Now()
}
// Wake up writeRequestBody via clientStream.awaitFlowControl and
// wake up RoundTrip if there is a pending request.
@@ -2121,7 +2072,6 @@ type clientConnReadLoop struct {
// readLoop runs in its own goroutine and reads and dispatches frames.
func (cc *ClientConn) readLoop() {
- cc.t.markNewGoroutine()
rl := &clientConnReadLoop{cc: cc}
defer rl.cleanup()
cc.readerErr = rl.run()
@@ -2188,9 +2138,9 @@ func (rl *clientConnReadLoop) cleanup() {
if cc.idleTimeout > 0 && unusedWaitTime > cc.idleTimeout {
unusedWaitTime = cc.idleTimeout
}
- idleTime := cc.t.now().Sub(cc.lastActive)
+ idleTime := time.Now().Sub(cc.lastActive)
if atomic.LoadUint32(&cc.atomicReused) == 0 && idleTime < unusedWaitTime && !cc.closedOnIdle {
- cc.idleTimer = cc.t.afterFunc(unusedWaitTime-idleTime, func() {
+ cc.idleTimer = time.AfterFunc(unusedWaitTime-idleTime, func() {
cc.t.connPool().MarkDead(cc)
})
} else {
@@ -2250,9 +2200,9 @@ func (rl *clientConnReadLoop) run() error {
cc := rl.cc
gotSettings := false
readIdleTimeout := cc.readIdleTimeout
- var t timer
+ var t *time.Timer
if readIdleTimeout != 0 {
- t = cc.t.afterFunc(readIdleTimeout, cc.healthCheck)
+ t = time.AfterFunc(readIdleTimeout, cc.healthCheck)
}
for {
f, err := cc.fr.ReadFrame()
@@ -2998,7 +2948,6 @@ func (cc *ClientConn) Ping(ctx context.Context) error {
var pingError error
errc := make(chan struct{})
go func() {
- cc.t.markNewGoroutine()
cc.wmu.Lock()
defer cc.wmu.Unlock()
if pingError = cc.fr.WritePing(false, p); pingError != nil {
@@ -3128,35 +3077,102 @@ type erringRoundTripper struct{ err error }
func (rt erringRoundTripper) RoundTripErr() error { return rt.err }
func (rt erringRoundTripper) RoundTrip(*http.Request) (*http.Response, error) { return nil, rt.err }
+var errConcurrentReadOnResBody = errors.New("http2: concurrent read on response body")
+
// gzipReader wraps a response body so it can lazily
-// call gzip.NewReader on the first call to Read
+// get gzip.Reader from the pool on the first call to Read.
+// After Close is called it puts gzip.Reader to the pool immediately
+// if there is no Read in progress or later when Read completes.
type gzipReader struct {
_ incomparable
body io.ReadCloser // underlying Response.Body
- zr *gzip.Reader // lazily-initialized gzip reader
- zerr error // sticky error
+ mu sync.Mutex // guards zr and zerr
+ zr *gzip.Reader // stores gzip reader from the pool between reads
+ zerr error // sticky gzip reader init error or sentinel value to detect concurrent read and read after close
}
-func (gz *gzipReader) Read(p []byte) (n int, err error) {
+type eofReader struct{}
+
+func (eofReader) Read([]byte) (int, error) { return 0, io.EOF }
+func (eofReader) ReadByte() (byte, error) { return 0, io.EOF }
+
+var gzipPool = sync.Pool{New: func() any { return new(gzip.Reader) }}
+
+// gzipPoolGet gets a gzip.Reader from the pool and resets it to read from r.
+func gzipPoolGet(r io.Reader) (*gzip.Reader, error) {
+ zr := gzipPool.Get().(*gzip.Reader)
+ if err := zr.Reset(r); err != nil {
+ gzipPoolPut(zr)
+ return nil, err
+ }
+ return zr, nil
+}
+
+// gzipPoolPut puts a gzip.Reader back into the pool.
+func gzipPoolPut(zr *gzip.Reader) {
+ // Reset will allocate bufio.Reader if we pass it anything
+ // other than a flate.Reader, so ensure that it's getting one.
+ var r flate.Reader = eofReader{}
+ zr.Reset(r)
+ gzipPool.Put(zr)
+}
+
+// acquire returns a gzip.Reader for reading response body.
+// The reader must be released after use.
+func (gz *gzipReader) acquire() (*gzip.Reader, error) {
+ gz.mu.Lock()
+ defer gz.mu.Unlock()
if gz.zerr != nil {
- return 0, gz.zerr
+ return nil, gz.zerr
}
if gz.zr == nil {
- gz.zr, err = gzip.NewReader(gz.body)
- if err != nil {
- gz.zerr = err
- return 0, err
+ gz.zr, gz.zerr = gzipPoolGet(gz.body)
+ if gz.zerr != nil {
+ return nil, gz.zerr
}
}
- return gz.zr.Read(p)
+ ret := gz.zr
+ gz.zr, gz.zerr = nil, errConcurrentReadOnResBody
+ return ret, nil
}
-func (gz *gzipReader) Close() error {
- if err := gz.body.Close(); err != nil {
- return err
+// release returns the gzip.Reader to the pool if Close was called during Read.
+func (gz *gzipReader) release(zr *gzip.Reader) {
+ gz.mu.Lock()
+ defer gz.mu.Unlock()
+ if gz.zerr == errConcurrentReadOnResBody {
+ gz.zr, gz.zerr = zr, nil
+ } else { // fs.ErrClosed
+ gzipPoolPut(zr)
+ }
+}
+
+// close returns the gzip.Reader to the pool immediately or
+// signals release to do so after Read completes.
+func (gz *gzipReader) close() {
+ gz.mu.Lock()
+ defer gz.mu.Unlock()
+ if gz.zerr == nil && gz.zr != nil {
+ gzipPoolPut(gz.zr)
+ gz.zr = nil
}
gz.zerr = fs.ErrClosed
- return nil
+}
+
+func (gz *gzipReader) Read(p []byte) (n int, err error) {
+ zr, err := gz.acquire()
+ if err != nil {
+ return 0, err
+ }
+ defer gz.release(zr)
+
+ return zr.Read(p)
+}
+
+func (gz *gzipReader) Close() error {
+ gz.close()
+
+ return gz.body.Close()
}
type errorReader struct{ err error }
@@ -3228,7 +3244,7 @@ func traceGotConn(req *http.Request, cc *ClientConn, reused bool) {
cc.mu.Lock()
ci.WasIdle = len(cc.streams) == 0 && reused
if ci.WasIdle && !cc.lastActive.IsZero() {
- ci.IdleTime = cc.t.timeSince(cc.lastActive)
+ ci.IdleTime = time.Since(cc.lastActive)
}
cc.mu.Unlock()
diff --git a/vendor/golang.org/x/net/http2/writesched.go b/vendor/golang.org/x/net/http2/writesched.go
index cc893adc29..7de27be525 100644
--- a/vendor/golang.org/x/net/http2/writesched.go
+++ b/vendor/golang.org/x/net/http2/writesched.go
@@ -42,6 +42,8 @@ type OpenStreamOptions struct {
// PusherID is zero if the stream was initiated by the client. Otherwise,
// PusherID names the stream that pushed the newly opened stream.
PusherID uint32
+ // priority is used to set the priority of the newly opened stream.
+ priority PriorityParam
}
// FrameWriteRequest is a request to write a frame.
@@ -183,45 +185,75 @@ func (wr *FrameWriteRequest) replyToWriter(err error) {
}
// writeQueue is used by implementations of WriteScheduler.
+//
+// Each writeQueue contains a queue of FrameWriteRequests, meant to store all
+// FrameWriteRequests associated with a given stream. This is implemented as a
+// two-stage queue: currQueue[currPos:] and nextQueue. Removing an item is done
+// by incrementing currPos of currQueue. Adding an item is done by appending it
+// to the nextQueue. If currQueue is empty when trying to remove an item, we
+// can swap currQueue and nextQueue to remedy the situation.
+// This two-stage queue is analogous to the use of two lists in Okasaki's
+// purely functional queue but without the overhead of reversing the list when
+// swapping stages.
+//
+// writeQueue also contains prev and next, this can be used by implementations
+// of WriteScheduler to construct data structures that represent the order of
+// writing between different streams (e.g. circular linked list).
type writeQueue struct {
- s []FrameWriteRequest
+ currQueue []FrameWriteRequest
+ nextQueue []FrameWriteRequest
+ currPos int
+
prev, next *writeQueue
}
-func (q *writeQueue) empty() bool { return len(q.s) == 0 }
+func (q *writeQueue) empty() bool {
+ return (len(q.currQueue) - q.currPos + len(q.nextQueue)) == 0
+}
func (q *writeQueue) push(wr FrameWriteRequest) {
- q.s = append(q.s, wr)
+ q.nextQueue = append(q.nextQueue, wr)
}
func (q *writeQueue) shift() FrameWriteRequest {
- if len(q.s) == 0 {
+ if q.empty() {
panic("invalid use of queue")
}
- wr := q.s[0]
- // TODO: less copy-happy queue.
- copy(q.s, q.s[1:])
- q.s[len(q.s)-1] = FrameWriteRequest{}
- q.s = q.s[:len(q.s)-1]
+ if q.currPos >= len(q.currQueue) {
+ q.currQueue, q.currPos, q.nextQueue = q.nextQueue, 0, q.currQueue[:0]
+ }
+ wr := q.currQueue[q.currPos]
+ q.currQueue[q.currPos] = FrameWriteRequest{}
+ q.currPos++
return wr
}
+func (q *writeQueue) peek() *FrameWriteRequest {
+ if q.currPos < len(q.currQueue) {
+ return &q.currQueue[q.currPos]
+ }
+ if len(q.nextQueue) > 0 {
+ return &q.nextQueue[0]
+ }
+ return nil
+}
+
// consume consumes up to n bytes from q.s[0]. If the frame is
// entirely consumed, it is removed from the queue. If the frame
// is partially consumed, the frame is kept with the consumed
// bytes removed. Returns true iff any bytes were consumed.
func (q *writeQueue) consume(n int32) (FrameWriteRequest, bool) {
- if len(q.s) == 0 {
+ if q.empty() {
return FrameWriteRequest{}, false
}
- consumed, rest, numresult := q.s[0].Consume(n)
+ consumed, rest, numresult := q.peek().Consume(n)
switch numresult {
case 0:
return FrameWriteRequest{}, false
case 1:
q.shift()
case 2:
- q.s[0] = rest
+ *q.peek() = rest
}
return consumed, true
}
@@ -230,10 +262,15 @@ type writeQueuePool []*writeQueue
// put inserts an unused writeQueue into the pool.
func (p *writeQueuePool) put(q *writeQueue) {
- for i := range q.s {
- q.s[i] = FrameWriteRequest{}
+ for i := range q.currQueue {
+ q.currQueue[i] = FrameWriteRequest{}
+ }
+ for i := range q.nextQueue {
+ q.nextQueue[i] = FrameWriteRequest{}
}
- q.s = q.s[:0]
+ q.currQueue = q.currQueue[:0]
+ q.nextQueue = q.nextQueue[:0]
+ q.currPos = 0
*p = append(*p, q)
}
diff --git a/vendor/golang.org/x/net/http2/writesched_priority.go b/vendor/golang.org/x/net/http2/writesched_priority_rfc7540.go
similarity index 77%
rename from vendor/golang.org/x/net/http2/writesched_priority.go
rename to vendor/golang.org/x/net/http2/writesched_priority_rfc7540.go
index f6783339d1..4e33c29a24 100644
--- a/vendor/golang.org/x/net/http2/writesched_priority.go
+++ b/vendor/golang.org/x/net/http2/writesched_priority_rfc7540.go
@@ -11,7 +11,7 @@ import (
)
// RFC 7540, Section 5.3.5: the default weight is 16.
-const priorityDefaultWeight = 15 // 16 = 15 + 1
+const priorityDefaultWeightRFC7540 = 15 // 16 = 15 + 1
// PriorityWriteSchedulerConfig configures a priorityWriteScheduler.
type PriorityWriteSchedulerConfig struct {
@@ -66,8 +66,8 @@ func NewPriorityWriteScheduler(cfg *PriorityWriteSchedulerConfig) WriteScheduler
}
}
- ws := &priorityWriteScheduler{
- nodes: make(map[uint32]*priorityNode),
+ ws := &priorityWriteSchedulerRFC7540{
+ nodes: make(map[uint32]*priorityNodeRFC7540),
maxClosedNodesInTree: cfg.MaxClosedNodesInTree,
maxIdleNodesInTree: cfg.MaxIdleNodesInTree,
enableWriteThrottle: cfg.ThrottleOutOfOrderWrites,
@@ -81,32 +81,32 @@ func NewPriorityWriteScheduler(cfg *PriorityWriteSchedulerConfig) WriteScheduler
return ws
}
-type priorityNodeState int
+type priorityNodeStateRFC7540 int
const (
- priorityNodeOpen priorityNodeState = iota
- priorityNodeClosed
- priorityNodeIdle
+ priorityNodeOpenRFC7540 priorityNodeStateRFC7540 = iota
+ priorityNodeClosedRFC7540
+ priorityNodeIdleRFC7540
)
-// priorityNode is a node in an HTTP/2 priority tree.
+// priorityNodeRFC7540 is a node in an HTTP/2 priority tree.
// Each node is associated with a single stream ID.
// See RFC 7540, Section 5.3.
-type priorityNode struct {
- q writeQueue // queue of pending frames to write
- id uint32 // id of the stream, or 0 for the root of the tree
- weight uint8 // the actual weight is weight+1, so the value is in [1,256]
- state priorityNodeState // open | closed | idle
- bytes int64 // number of bytes written by this node, or 0 if closed
- subtreeBytes int64 // sum(node.bytes) of all nodes in this subtree
+type priorityNodeRFC7540 struct {
+ q writeQueue // queue of pending frames to write
+ id uint32 // id of the stream, or 0 for the root of the tree
+ weight uint8 // the actual weight is weight+1, so the value is in [1,256]
+ state priorityNodeStateRFC7540 // open | closed | idle
+ bytes int64 // number of bytes written by this node, or 0 if closed
+ subtreeBytes int64 // sum(node.bytes) of all nodes in this subtree
// These links form the priority tree.
- parent *priorityNode
- kids *priorityNode // start of the kids list
- prev, next *priorityNode // doubly-linked list of siblings
+ parent *priorityNodeRFC7540
+ kids *priorityNodeRFC7540 // start of the kids list
+ prev, next *priorityNodeRFC7540 // doubly-linked list of siblings
}
-func (n *priorityNode) setParent(parent *priorityNode) {
+func (n *priorityNodeRFC7540) setParent(parent *priorityNodeRFC7540) {
if n == parent {
panic("setParent to self")
}
@@ -141,7 +141,7 @@ func (n *priorityNode) setParent(parent *priorityNode) {
}
}
-func (n *priorityNode) addBytes(b int64) {
+func (n *priorityNodeRFC7540) addBytes(b int64) {
n.bytes += b
for ; n != nil; n = n.parent {
n.subtreeBytes += b
@@ -154,7 +154,7 @@ func (n *priorityNode) addBytes(b int64) {
//
// f(n, openParent) takes two arguments: the node to visit, n, and a bool that is true
// if any ancestor p of n is still open (ignoring the root node).
-func (n *priorityNode) walkReadyInOrder(openParent bool, tmp *[]*priorityNode, f func(*priorityNode, bool) bool) bool {
+func (n *priorityNodeRFC7540) walkReadyInOrder(openParent bool, tmp *[]*priorityNodeRFC7540, f func(*priorityNodeRFC7540, bool) bool) bool {
if !n.q.empty() && f(n, openParent) {
return true
}
@@ -165,7 +165,7 @@ func (n *priorityNode) walkReadyInOrder(openParent bool, tmp *[]*priorityNode, f
// Don't consider the root "open" when updating openParent since
// we can't send data frames on the root stream (only control frames).
if n.id != 0 {
- openParent = openParent || (n.state == priorityNodeOpen)
+ openParent = openParent || (n.state == priorityNodeOpenRFC7540)
}
// Common case: only one kid or all kids have the same weight.
@@ -195,7 +195,7 @@ func (n *priorityNode) walkReadyInOrder(openParent bool, tmp *[]*priorityNode, f
*tmp = append(*tmp, n.kids)
n.kids.setParent(nil)
}
- sort.Sort(sortPriorityNodeSiblings(*tmp))
+ sort.Sort(sortPriorityNodeSiblingsRFC7540(*tmp))
for i := len(*tmp) - 1; i >= 0; i-- {
(*tmp)[i].setParent(n) // setParent inserts at the head of n.kids
}
@@ -207,15 +207,15 @@ func (n *priorityNode) walkReadyInOrder(openParent bool, tmp *[]*priorityNode, f
return false
}
-type sortPriorityNodeSiblings []*priorityNode
+type sortPriorityNodeSiblingsRFC7540 []*priorityNodeRFC7540
-func (z sortPriorityNodeSiblings) Len() int { return len(z) }
-func (z sortPriorityNodeSiblings) Swap(i, k int) { z[i], z[k] = z[k], z[i] }
-func (z sortPriorityNodeSiblings) Less(i, k int) bool {
+func (z sortPriorityNodeSiblingsRFC7540) Len() int { return len(z) }
+func (z sortPriorityNodeSiblingsRFC7540) Swap(i, k int) { z[i], z[k] = z[k], z[i] }
+func (z sortPriorityNodeSiblingsRFC7540) Less(i, k int) bool {
// Prefer the subtree that has sent fewer bytes relative to its weight.
// See sections 5.3.2 and 5.3.4.
- wi, bi := float64(z[i].weight+1), float64(z[i].subtreeBytes)
- wk, bk := float64(z[k].weight+1), float64(z[k].subtreeBytes)
+ wi, bi := float64(z[i].weight)+1, float64(z[i].subtreeBytes)
+ wk, bk := float64(z[k].weight)+1, float64(z[k].subtreeBytes)
if bi == 0 && bk == 0 {
return wi >= wk
}
@@ -225,13 +225,13 @@ func (z sortPriorityNodeSiblings) Less(i, k int) bool {
return bi/bk <= wi/wk
}
-type priorityWriteScheduler struct {
+type priorityWriteSchedulerRFC7540 struct {
// root is the root of the priority tree, where root.id = 0.
// The root queues control frames that are not associated with any stream.
- root priorityNode
+ root priorityNodeRFC7540
// nodes maps stream ids to priority tree nodes.
- nodes map[uint32]*priorityNode
+ nodes map[uint32]*priorityNodeRFC7540
// maxID is the maximum stream id in nodes.
maxID uint32
@@ -239,7 +239,7 @@ type priorityWriteScheduler struct {
// lists of nodes that have been closed or are idle, but are kept in
// the tree for improved prioritization. When the lengths exceed either
// maxClosedNodesInTree or maxIdleNodesInTree, old nodes are discarded.
- closedNodes, idleNodes []*priorityNode
+ closedNodes, idleNodes []*priorityNodeRFC7540
// From the config.
maxClosedNodesInTree int
@@ -248,19 +248,19 @@ type priorityWriteScheduler struct {
enableWriteThrottle bool
// tmp is scratch space for priorityNode.walkReadyInOrder to reduce allocations.
- tmp []*priorityNode
+ tmp []*priorityNodeRFC7540
// pool of empty queues for reuse.
queuePool writeQueuePool
}
-func (ws *priorityWriteScheduler) OpenStream(streamID uint32, options OpenStreamOptions) {
+func (ws *priorityWriteSchedulerRFC7540) OpenStream(streamID uint32, options OpenStreamOptions) {
// The stream may be currently idle but cannot be opened or closed.
if curr := ws.nodes[streamID]; curr != nil {
- if curr.state != priorityNodeIdle {
+ if curr.state != priorityNodeIdleRFC7540 {
panic(fmt.Sprintf("stream %d already opened", streamID))
}
- curr.state = priorityNodeOpen
+ curr.state = priorityNodeOpenRFC7540
return
}
@@ -272,11 +272,11 @@ func (ws *priorityWriteScheduler) OpenStream(streamID uint32, options OpenStream
if parent == nil {
parent = &ws.root
}
- n := &priorityNode{
+ n := &priorityNodeRFC7540{
q: *ws.queuePool.get(),
id: streamID,
- weight: priorityDefaultWeight,
- state: priorityNodeOpen,
+ weight: priorityDefaultWeightRFC7540,
+ state: priorityNodeOpenRFC7540,
}
n.setParent(parent)
ws.nodes[streamID] = n
@@ -285,24 +285,23 @@ func (ws *priorityWriteScheduler) OpenStream(streamID uint32, options OpenStream
}
}
-func (ws *priorityWriteScheduler) CloseStream(streamID uint32) {
+func (ws *priorityWriteSchedulerRFC7540) CloseStream(streamID uint32) {
if streamID == 0 {
panic("violation of WriteScheduler interface: cannot close stream 0")
}
if ws.nodes[streamID] == nil {
panic(fmt.Sprintf("violation of WriteScheduler interface: unknown stream %d", streamID))
}
- if ws.nodes[streamID].state != priorityNodeOpen {
+ if ws.nodes[streamID].state != priorityNodeOpenRFC7540 {
panic(fmt.Sprintf("violation of WriteScheduler interface: stream %d already closed", streamID))
}
n := ws.nodes[streamID]
- n.state = priorityNodeClosed
+ n.state = priorityNodeClosedRFC7540
n.addBytes(-n.bytes)
q := n.q
ws.queuePool.put(&q)
- n.q.s = nil
if ws.maxClosedNodesInTree > 0 {
ws.addClosedOrIdleNode(&ws.closedNodes, ws.maxClosedNodesInTree, n)
} else {
@@ -310,7 +309,7 @@ func (ws *priorityWriteScheduler) CloseStream(streamID uint32) {
}
}
-func (ws *priorityWriteScheduler) AdjustStream(streamID uint32, priority PriorityParam) {
+func (ws *priorityWriteSchedulerRFC7540) AdjustStream(streamID uint32, priority PriorityParam) {
if streamID == 0 {
panic("adjustPriority on root")
}
@@ -324,11 +323,11 @@ func (ws *priorityWriteScheduler) AdjustStream(streamID uint32, priority Priorit
return
}
ws.maxID = streamID
- n = &priorityNode{
+ n = &priorityNodeRFC7540{
q: *ws.queuePool.get(),
id: streamID,
- weight: priorityDefaultWeight,
- state: priorityNodeIdle,
+ weight: priorityDefaultWeightRFC7540,
+ state: priorityNodeIdleRFC7540,
}
n.setParent(&ws.root)
ws.nodes[streamID] = n
@@ -340,7 +339,7 @@ func (ws *priorityWriteScheduler) AdjustStream(streamID uint32, priority Priorit
parent := ws.nodes[priority.StreamDep]
if parent == nil {
n.setParent(&ws.root)
- n.weight = priorityDefaultWeight
+ n.weight = priorityDefaultWeightRFC7540
return
}
@@ -381,8 +380,8 @@ func (ws *priorityWriteScheduler) AdjustStream(streamID uint32, priority Priorit
n.weight = priority.Weight
}
-func (ws *priorityWriteScheduler) Push(wr FrameWriteRequest) {
- var n *priorityNode
+func (ws *priorityWriteSchedulerRFC7540) Push(wr FrameWriteRequest) {
+ var n *priorityNodeRFC7540
if wr.isControl() {
n = &ws.root
} else {
@@ -401,8 +400,8 @@ func (ws *priorityWriteScheduler) Push(wr FrameWriteRequest) {
n.q.push(wr)
}
-func (ws *priorityWriteScheduler) Pop() (wr FrameWriteRequest, ok bool) {
- ws.root.walkReadyInOrder(false, &ws.tmp, func(n *priorityNode, openParent bool) bool {
+func (ws *priorityWriteSchedulerRFC7540) Pop() (wr FrameWriteRequest, ok bool) {
+ ws.root.walkReadyInOrder(false, &ws.tmp, func(n *priorityNodeRFC7540, openParent bool) bool {
limit := int32(math.MaxInt32)
if openParent {
limit = ws.writeThrottleLimit
@@ -428,7 +427,7 @@ func (ws *priorityWriteScheduler) Pop() (wr FrameWriteRequest, ok bool) {
return wr, ok
}
-func (ws *priorityWriteScheduler) addClosedOrIdleNode(list *[]*priorityNode, maxSize int, n *priorityNode) {
+func (ws *priorityWriteSchedulerRFC7540) addClosedOrIdleNode(list *[]*priorityNodeRFC7540, maxSize int, n *priorityNodeRFC7540) {
if maxSize == 0 {
return
}
@@ -442,7 +441,7 @@ func (ws *priorityWriteScheduler) addClosedOrIdleNode(list *[]*priorityNode, max
*list = append(*list, n)
}
-func (ws *priorityWriteScheduler) removeNode(n *priorityNode) {
+func (ws *priorityWriteSchedulerRFC7540) removeNode(n *priorityNodeRFC7540) {
for n.kids != nil {
n.kids.setParent(n.parent)
}
diff --git a/vendor/golang.org/x/net/http2/writesched_priority_rfc9218.go b/vendor/golang.org/x/net/http2/writesched_priority_rfc9218.go
new file mode 100644
index 0000000000..cb4cadc32d
--- /dev/null
+++ b/vendor/golang.org/x/net/http2/writesched_priority_rfc9218.go
@@ -0,0 +1,209 @@
+// Copyright 2025 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package http2
+
+import (
+ "fmt"
+ "math"
+)
+
+type streamMetadata struct {
+ location *writeQueue
+ priority PriorityParam
+}
+
+type priorityWriteSchedulerRFC9218 struct {
+ // control contains control frames (SETTINGS, PING, etc.).
+ control writeQueue
+
+ // heads contain the head of a circular list of streams.
+ // We put these heads within a nested array that represents urgency and
+ // incremental, as defined in
+ // https://www.rfc-editor.org/rfc/rfc9218.html#name-priority-parameters.
+ // 8 represents u=0 up to u=7, and 2 represents i=false and i=true.
+ heads [8][2]*writeQueue
+
+ // streams contains a mapping between each stream ID and their metadata, so
+ // we can quickly locate them when needing to, for example, adjust their
+ // priority.
+ streams map[uint32]streamMetadata
+
+ // queuePool are empty queues for reuse.
+ queuePool writeQueuePool
+
+ // prioritizeIncremental is used to determine whether we should prioritize
+ // incremental streams or not, when urgency is the same in a given Pop()
+ // call.
+ prioritizeIncremental bool
+}
+
+func newPriorityWriteSchedulerRFC9218() WriteScheduler {
+ ws := &priorityWriteSchedulerRFC9218{
+ streams: make(map[uint32]streamMetadata),
+ }
+ return ws
+}
+
+func (ws *priorityWriteSchedulerRFC9218) OpenStream(streamID uint32, opt OpenStreamOptions) {
+ if ws.streams[streamID].location != nil {
+ panic(fmt.Errorf("stream %d already opened", streamID))
+ }
+ q := ws.queuePool.get()
+ ws.streams[streamID] = streamMetadata{
+ location: q,
+ priority: opt.priority,
+ }
+
+ u, i := opt.priority.urgency, opt.priority.incremental
+ if ws.heads[u][i] == nil {
+ ws.heads[u][i] = q
+ q.next = q
+ q.prev = q
+ } else {
+ // Queues are stored in a ring.
+ // Insert the new stream before ws.head, putting it at the end of the list.
+ q.prev = ws.heads[u][i].prev
+ q.next = ws.heads[u][i]
+ q.prev.next = q
+ q.next.prev = q
+ }
+}
+
+func (ws *priorityWriteSchedulerRFC9218) CloseStream(streamID uint32) {
+ metadata := ws.streams[streamID]
+ q, u, i := metadata.location, metadata.priority.urgency, metadata.priority.incremental
+ if q == nil {
+ return
+ }
+ if q.next == q {
+ // This was the only open stream.
+ ws.heads[u][i] = nil
+ } else {
+ q.prev.next = q.next
+ q.next.prev = q.prev
+ if ws.heads[u][i] == q {
+ ws.heads[u][i] = q.next
+ }
+ }
+ delete(ws.streams, streamID)
+ ws.queuePool.put(q)
+}
+
+func (ws *priorityWriteSchedulerRFC9218) AdjustStream(streamID uint32, priority PriorityParam) {
+ metadata := ws.streams[streamID]
+ q, u, i := metadata.location, metadata.priority.urgency, metadata.priority.incremental
+ if q == nil {
+ return
+ }
+
+ // Remove stream from current location.
+ if q.next == q {
+ // This was the only open stream.
+ ws.heads[u][i] = nil
+ } else {
+ q.prev.next = q.next
+ q.next.prev = q.prev
+ if ws.heads[u][i] == q {
+ ws.heads[u][i] = q.next
+ }
+ }
+
+ // Insert stream to the new queue.
+ u, i = priority.urgency, priority.incremental
+ if ws.heads[u][i] == nil {
+ ws.heads[u][i] = q
+ q.next = q
+ q.prev = q
+ } else {
+ // Queues are stored in a ring.
+ // Insert the new stream before ws.head, putting it at the end of the list.
+ q.prev = ws.heads[u][i].prev
+ q.next = ws.heads[u][i]
+ q.prev.next = q
+ q.next.prev = q
+ }
+
+ // Update the metadata.
+ ws.streams[streamID] = streamMetadata{
+ location: q,
+ priority: priority,
+ }
+}
+
+func (ws *priorityWriteSchedulerRFC9218) Push(wr FrameWriteRequest) {
+ if wr.isControl() {
+ ws.control.push(wr)
+ return
+ }
+ q := ws.streams[wr.StreamID()].location
+ if q == nil {
+ // This is a closed stream.
+ // wr should not be a HEADERS or DATA frame.
+ // We push the request onto the control queue.
+ if wr.DataSize() > 0 {
+ panic("add DATA on non-open stream")
+ }
+ ws.control.push(wr)
+ return
+ }
+ q.push(wr)
+}
+
+func (ws *priorityWriteSchedulerRFC9218) Pop() (FrameWriteRequest, bool) {
+ // Control and RST_STREAM frames first.
+ if !ws.control.empty() {
+ return ws.control.shift(), true
+ }
+
+ // On the next Pop(), we want to prioritize incremental if we prioritized
+ // non-incremental request of the same urgency this time. Vice-versa.
+ // i.e. when there are incremental and non-incremental requests at the same
+ // priority, we give 50% of our bandwidth to the incremental ones in
+ // aggregate and 50% to the first non-incremental one (since
+ // non-incremental streams do not use round-robin writes).
+ ws.prioritizeIncremental = !ws.prioritizeIncremental
+
+ // Always prioritize lowest u (i.e. highest urgency level).
+ for u := range ws.heads {
+ for i := range ws.heads[u] {
+ // When we want to prioritize incremental, we try to pop i=true
+ // first before i=false when u is the same.
+ if ws.prioritizeIncremental {
+ i = (i + 1) % 2
+ }
+ q := ws.heads[u][i]
+ if q == nil {
+ continue
+ }
+ for {
+ if wr, ok := q.consume(math.MaxInt32); ok {
+ if i == 1 {
+ // For incremental streams, we update head to q.next so
+ // we can round-robin between multiple streams that can
+ // immediately benefit from partial writes.
+ ws.heads[u][i] = q.next
+ } else {
+ // For non-incremental streams, we try to finish one to
+ // completion rather than doing round-robin. However,
+ // we update head here so that if q.consume() is !ok
+ // (e.g. the stream has no more frame to consume), head
+ // is updated to the next q that has frames to consume
+ // on future iterations. This way, we do not prioritize
+ // writing to unavailable stream on next Pop() calls,
+ // preventing head-of-line blocking.
+ ws.heads[u][i] = q
+ }
+ return wr, true
+ }
+ q = q.next
+ if q == ws.heads[u][i] {
+ break
+ }
+ }
+
+ }
+ }
+ return FrameWriteRequest{}, false
+}
diff --git a/vendor/golang.org/x/net/http2/writesched_roundrobin.go b/vendor/golang.org/x/net/http2/writesched_roundrobin.go
index 54fe86322d..737cff9ecb 100644
--- a/vendor/golang.org/x/net/http2/writesched_roundrobin.go
+++ b/vendor/golang.org/x/net/http2/writesched_roundrobin.go
@@ -25,7 +25,7 @@ type roundRobinWriteScheduler struct {
}
// newRoundRobinWriteScheduler constructs a new write scheduler.
-// The round robin scheduler priorizes control frames
+// The round robin scheduler prioritizes control frames
// like SETTINGS and PING over DATA frames.
// When there are no control frames to send, it performs a round-robin
// selection from the ready streams.
diff --git a/vendor/golang.org/x/net/internal/httpcommon/request.go b/vendor/golang.org/x/net/internal/httpcommon/request.go
index 4b70553179..1e10f89ebf 100644
--- a/vendor/golang.org/x/net/internal/httpcommon/request.go
+++ b/vendor/golang.org/x/net/internal/httpcommon/request.go
@@ -51,7 +51,7 @@ type EncodeHeadersParam struct {
DefaultUserAgent string
}
-// EncodeHeadersParam is the result of EncodeHeaders.
+// EncodeHeadersResult is the result of EncodeHeaders.
type EncodeHeadersResult struct {
HasBody bool
HasTrailers bool
@@ -399,7 +399,7 @@ type ServerRequestResult struct {
// If the request should be rejected, this is a short string suitable for passing
// to the http2 package's CountError function.
- // It might be a bit odd to return errors this way rather than returing an error,
+ // It might be a bit odd to return errors this way rather than returning an error,
// but this ensures we don't forget to include a CountError reason.
InvalidReason string
}
diff --git a/vendor/golang.org/x/sync/errgroup/errgroup.go b/vendor/golang.org/x/sync/errgroup/errgroup.go
index 1d8cffae8c..2f45dbc86e 100644
--- a/vendor/golang.org/x/sync/errgroup/errgroup.go
+++ b/vendor/golang.org/x/sync/errgroup/errgroup.go
@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.
// Package errgroup provides synchronization, error propagation, and Context
-// cancelation for groups of goroutines working on subtasks of a common task.
+// cancellation for groups of goroutines working on subtasks of a common task.
//
// [errgroup.Group] is related to [sync.WaitGroup] but adds handling of tasks
// returning errors.
diff --git a/vendor/golang.org/x/sys/cpu/cpu.go b/vendor/golang.org/x/sys/cpu/cpu.go
index 63541994ef..34c9ae76ef 100644
--- a/vendor/golang.org/x/sys/cpu/cpu.go
+++ b/vendor/golang.org/x/sys/cpu/cpu.go
@@ -92,6 +92,9 @@ var ARM64 struct {
HasSHA2 bool // SHA2 hardware implementation
HasCRC32 bool // CRC32 hardware implementation
HasATOMICS bool // Atomic memory operation instruction set
+ HasHPDS bool // Hierarchical permission disables in translations tables
+ HasLOR bool // Limited ordering regions
+ HasPAN bool // Privileged access never
HasFPHP bool // Half precision floating-point instruction set
HasASIMDHP bool // Advanced SIMD half precision instruction set
HasCPUID bool // CPUID identification scheme registers
diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_arm64.go
index af2aa99f9f..f449c679fe 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_arm64.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.go
@@ -65,10 +65,10 @@ func setMinimalFeatures() {
func readARM64Registers() {
Initialized = true
- parseARM64SystemRegisters(getisar0(), getisar1(), getpfr0())
+ parseARM64SystemRegisters(getisar0(), getisar1(), getmmfr1(), getpfr0())
}
-func parseARM64SystemRegisters(isar0, isar1, pfr0 uint64) {
+func parseARM64SystemRegisters(isar0, isar1, mmfr1, pfr0 uint64) {
// ID_AA64ISAR0_EL1
switch extractBits(isar0, 4, 7) {
case 1:
@@ -152,6 +152,22 @@ func parseARM64SystemRegisters(isar0, isar1, pfr0 uint64) {
ARM64.HasI8MM = true
}
+ // ID_AA64MMFR1_EL1
+ switch extractBits(mmfr1, 12, 15) {
+ case 1, 2:
+ ARM64.HasHPDS = true
+ }
+
+ switch extractBits(mmfr1, 16, 19) {
+ case 1:
+ ARM64.HasLOR = true
+ }
+
+ switch extractBits(mmfr1, 20, 23) {
+ case 1, 2, 3:
+ ARM64.HasPAN = true
+ }
+
// ID_AA64PFR0_EL1
switch extractBits(pfr0, 16, 19) {
case 0:
diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.s b/vendor/golang.org/x/sys/cpu/cpu_arm64.s
index 22cc99844a..a4f24b3b0c 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_arm64.s
+++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.s
@@ -9,31 +9,34 @@
// func getisar0() uint64
TEXT ·getisar0(SB),NOSPLIT,$0-8
// get Instruction Set Attributes 0 into x0
- // mrs x0, ID_AA64ISAR0_EL1 = d5380600
- WORD $0xd5380600
+ MRS ID_AA64ISAR0_EL1, R0
MOVD R0, ret+0(FP)
RET
// func getisar1() uint64
TEXT ·getisar1(SB),NOSPLIT,$0-8
// get Instruction Set Attributes 1 into x0
- // mrs x0, ID_AA64ISAR1_EL1 = d5380620
- WORD $0xd5380620
+ MRS ID_AA64ISAR1_EL1, R0
+ MOVD R0, ret+0(FP)
+ RET
+
+// func getmmfr1() uint64
+TEXT ·getmmfr1(SB),NOSPLIT,$0-8
+ // get Memory Model Feature Register 1 into x0
+ MRS ID_AA64MMFR1_EL1, R0
MOVD R0, ret+0(FP)
RET
// func getpfr0() uint64
TEXT ·getpfr0(SB),NOSPLIT,$0-8
// get Processor Feature Register 0 into x0
- // mrs x0, ID_AA64PFR0_EL1 = d5380400
- WORD $0xd5380400
+ MRS ID_AA64PFR0_EL1, R0
MOVD R0, ret+0(FP)
RET
// func getzfr0() uint64
TEXT ·getzfr0(SB),NOSPLIT,$0-8
// get SVE Feature Register 0 into x0
- // mrs x0, ID_AA64ZFR0_EL1 = d5380480
- WORD $0xd5380480
+ MRS ID_AA64ZFR0_EL1, R0
MOVD R0, ret+0(FP)
RET
diff --git a/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go
index 6ac6e1efb2..e3fc5a8d31 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go
@@ -8,5 +8,6 @@ package cpu
func getisar0() uint64
func getisar1() uint64
+func getmmfr1() uint64
func getpfr0() uint64
func getzfr0() uint64
diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go
index 7f1946780b..8df2079e15 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go
@@ -8,4 +8,5 @@ package cpu
func getisar0() uint64 { return 0 }
func getisar1() uint64 { return 0 }
+func getmmfr1() uint64 { return 0 }
func getpfr0() uint64 { return 0 }
diff --git a/vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go
index ebfb3fc8e7..19aea0633e 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go
@@ -167,7 +167,7 @@ func doinit() {
setMinimalFeatures()
return
}
- parseARM64SystemRegisters(cpuid.aa64isar0, cpuid.aa64isar1, cpuid.aa64pfr0)
+ parseARM64SystemRegisters(cpuid.aa64isar0, cpuid.aa64isar1, cpuid.aa64mmfr1, cpuid.aa64pfr0)
Initialized = true
}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go
index 85b64d5ccb..87fd3a7780 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go
@@ -59,7 +59,7 @@ func doinit() {
if !ok {
return
}
- parseARM64SystemRegisters(isar0, isar1, 0)
+ parseARM64SystemRegisters(isar0, isar1, 0, 0)
Initialized = true
}
diff --git a/vendor/golang.org/x/sys/plan9/pwd_go15_plan9.go b/vendor/golang.org/x/sys/plan9/pwd_go15_plan9.go
deleted file mode 100644
index 73687de748..0000000000
--- a/vendor/golang.org/x/sys/plan9/pwd_go15_plan9.go
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build go1.5
-
-package plan9
-
-import "syscall"
-
-func fixwd() {
- syscall.Fixwd()
-}
-
-func Getwd() (wd string, err error) {
- return syscall.Getwd()
-}
-
-func Chdir(path string) error {
- return syscall.Chdir(path)
-}
diff --git a/vendor/golang.org/x/sys/plan9/pwd_plan9.go b/vendor/golang.org/x/sys/plan9/pwd_plan9.go
index fb94582184..7a76489db1 100644
--- a/vendor/golang.org/x/sys/plan9/pwd_plan9.go
+++ b/vendor/golang.org/x/sys/plan9/pwd_plan9.go
@@ -2,22 +2,18 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build !go1.5
-
package plan9
+import "syscall"
+
func fixwd() {
+ syscall.Fixwd()
}
func Getwd() (wd string, err error) {
- fd, err := open(".", O_RDONLY)
- if err != nil {
- return "", err
- }
- defer Close(fd)
- return Fd2path(fd)
+ return syscall.Getwd()
}
func Chdir(path string) error {
- return chdir(path)
+ return syscall.Chdir(path)
}
diff --git a/vendor/golang.org/x/sys/unix/affinity_linux.go b/vendor/golang.org/x/sys/unix/affinity_linux.go
index 6e5c81acd0..3ea470387b 100644
--- a/vendor/golang.org/x/sys/unix/affinity_linux.go
+++ b/vendor/golang.org/x/sys/unix/affinity_linux.go
@@ -38,8 +38,15 @@ func SchedSetaffinity(pid int, set *CPUSet) error {
// Zero clears the set s, so that it contains no CPUs.
func (s *CPUSet) Zero() {
+ clear(s[:])
+}
+
+// Fill adds all possible CPU bits to the set s. On Linux, [SchedSetaffinity]
+// will silently ignore any invalid CPU bits in [CPUSet] so this is an
+// efficient way of resetting the CPU affinity of a process.
+func (s *CPUSet) Fill() {
for i := range s {
- s[i] = 0
+ s[i] = ^cpuMask(0)
}
}
diff --git a/vendor/golang.org/x/sys/unix/fdset.go b/vendor/golang.org/x/sys/unix/fdset.go
index 9e83d18cd0..62ed12645f 100644
--- a/vendor/golang.org/x/sys/unix/fdset.go
+++ b/vendor/golang.org/x/sys/unix/fdset.go
@@ -23,7 +23,5 @@ func (fds *FdSet) IsSet(fd int) bool {
// Zero clears the set fds.
func (fds *FdSet) Zero() {
- for i := range fds.Bits {
- fds.Bits[i] = 0
- }
+ clear(fds.Bits[:])
}
diff --git a/vendor/golang.org/x/sys/unix/ifreq_linux.go b/vendor/golang.org/x/sys/unix/ifreq_linux.go
index 848840ae4c..309f5a2b0c 100644
--- a/vendor/golang.org/x/sys/unix/ifreq_linux.go
+++ b/vendor/golang.org/x/sys/unix/ifreq_linux.go
@@ -111,9 +111,7 @@ func (ifr *Ifreq) SetUint32(v uint32) {
// clear zeroes the ifreq's union field to prevent trailing garbage data from
// being sent to the kernel if an ifreq is reused.
func (ifr *Ifreq) clear() {
- for i := range ifr.raw.Ifru {
- ifr.raw.Ifru[i] = 0
- }
+ clear(ifr.raw.Ifru[:])
}
// TODO(mdlayher): export as IfreqData? For now we can provide helpers such as
diff --git a/vendor/golang.org/x/sys/unix/mkall.sh b/vendor/golang.org/x/sys/unix/mkall.sh
index e6f31d374d..d0ed611912 100644
--- a/vendor/golang.org/x/sys/unix/mkall.sh
+++ b/vendor/golang.org/x/sys/unix/mkall.sh
@@ -49,6 +49,7 @@ esac
if [[ "$GOOS" = "linux" ]]; then
# Use the Docker-based build system
# Files generated through docker (use $cmd so you can Ctl-C the build or run)
+ set -e
$cmd docker build --tag generate:$GOOS $GOOS
$cmd docker run --interactive --tty --volume $(cd -- "$(dirname -- "$0")/.." && pwd):/build generate:$GOOS
exit
diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh
index d1c8b2640e..42517077c4 100644
--- a/vendor/golang.org/x/sys/unix/mkerrors.sh
+++ b/vendor/golang.org/x/sys/unix/mkerrors.sh
@@ -226,6 +226,7 @@ struct ltchars {
#include
#include
#include
+#include
#include
#include
#include
@@ -529,6 +530,7 @@ ccflags="$@"
$2 ~ /^O[CNPFPL][A-Z]+[^_][A-Z]+$/ ||
$2 ~ /^(NL|CR|TAB|BS|VT|FF)DLY$/ ||
$2 ~ /^(NL|CR|TAB|BS|VT|FF)[0-9]$/ ||
+ $2 ~ /^(DT|EI|ELF|EV|NN|NT|PF|SHF|SHN|SHT|STB|STT|VER)_/ ||
$2 ~ /^O?XTABS$/ ||
$2 ~ /^TC[IO](ON|OFF)$/ ||
$2 ~ /^IN_/ ||
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go
index 4958a65708..06c0eea6fb 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux.go
@@ -801,9 +801,7 @@ func (sa *SockaddrPPPoE) sockaddr() (unsafe.Pointer, _Socklen, error) {
// one. The kernel expects SID to be in network byte order.
binary.BigEndian.PutUint16(sa.raw[6:8], sa.SID)
copy(sa.raw[8:14], sa.Remote)
- for i := 14; i < 14+IFNAMSIZ; i++ {
- sa.raw[i] = 0
- }
+ clear(sa.raw[14 : 14+IFNAMSIZ])
copy(sa.raw[14:], sa.Dev)
return unsafe.Pointer(&sa.raw), SizeofSockaddrPPPoX, nil
}
@@ -2645,3 +2643,9 @@ func SchedGetAttr(pid int, flags uint) (*SchedAttr, error) {
//sys Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) (err error)
//sys Mseal(b []byte, flags uint) (err error)
+
+//sys setMemPolicy(mode int, mask *CPUSet, size int) (err error) = SYS_SET_MEMPOLICY
+
+func SetMemPolicy(mode int, mask *CPUSet) error {
+ return setMemPolicy(mode, mask, _CPU_SETSIZE)
+}
diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd.go b/vendor/golang.org/x/sys/unix/syscall_netbsd.go
index 88162099af..34a4676973 100644
--- a/vendor/golang.org/x/sys/unix/syscall_netbsd.go
+++ b/vendor/golang.org/x/sys/unix/syscall_netbsd.go
@@ -248,6 +248,23 @@ func Statvfs(path string, buf *Statvfs_t) (err error) {
return Statvfs1(path, buf, ST_WAIT)
}
+func Getvfsstat(buf []Statvfs_t, flags int) (n int, err error) {
+ var (
+ _p0 unsafe.Pointer
+ bufsize uintptr
+ )
+ if len(buf) > 0 {
+ _p0 = unsafe.Pointer(&buf[0])
+ bufsize = unsafe.Sizeof(Statvfs_t{}) * uintptr(len(buf))
+ }
+ r0, _, e1 := Syscall(SYS_GETVFSSTAT, uintptr(_p0), bufsize, uintptr(flags))
+ n = int(r0)
+ if e1 != 0 {
+ err = e1
+ }
+ return
+}
+
/*
* Exposed directly
*/
diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris.go b/vendor/golang.org/x/sys/unix/syscall_solaris.go
index abc3955477..18a3d9bdab 100644
--- a/vendor/golang.org/x/sys/unix/syscall_solaris.go
+++ b/vendor/golang.org/x/sys/unix/syscall_solaris.go
@@ -629,7 +629,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
//sys Kill(pid int, signum syscall.Signal) (err error)
//sys Lchown(path string, uid int, gid int) (err error)
//sys Link(path string, link string) (err error)
-//sys Listen(s int, backlog int) (err error) = libsocket.__xnet_llisten
+//sys Listen(s int, backlog int) (err error) = libsocket.__xnet_listen
//sys Lstat(path string, stat *Stat_t) (err error)
//sys Madvise(b []byte, advice int) (err error)
//sys Mkdir(path string, mode uint32) (err error)
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go
index b6db27d937..d0a75da572 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go
@@ -853,20 +853,86 @@ const (
DM_VERSION_MAJOR = 0x4
DM_VERSION_MINOR = 0x32
DM_VERSION_PATCHLEVEL = 0x0
+ DT_ADDRRNGHI = 0x6ffffeff
+ DT_ADDRRNGLO = 0x6ffffe00
DT_BLK = 0x6
DT_CHR = 0x2
+ DT_DEBUG = 0x15
DT_DIR = 0x4
+ DT_ENCODING = 0x20
DT_FIFO = 0x1
+ DT_FINI = 0xd
+ DT_FLAGS_1 = 0x6ffffffb
+ DT_GNU_HASH = 0x6ffffef5
+ DT_HASH = 0x4
+ DT_HIOS = 0x6ffff000
+ DT_HIPROC = 0x7fffffff
+ DT_INIT = 0xc
+ DT_JMPREL = 0x17
DT_LNK = 0xa
+ DT_LOOS = 0x6000000d
+ DT_LOPROC = 0x70000000
+ DT_NEEDED = 0x1
+ DT_NULL = 0x0
+ DT_PLTGOT = 0x3
+ DT_PLTREL = 0x14
+ DT_PLTRELSZ = 0x2
DT_REG = 0x8
+ DT_REL = 0x11
+ DT_RELA = 0x7
+ DT_RELACOUNT = 0x6ffffff9
+ DT_RELAENT = 0x9
+ DT_RELASZ = 0x8
+ DT_RELCOUNT = 0x6ffffffa
+ DT_RELENT = 0x13
+ DT_RELSZ = 0x12
+ DT_RPATH = 0xf
DT_SOCK = 0xc
+ DT_SONAME = 0xe
+ DT_STRSZ = 0xa
+ DT_STRTAB = 0x5
+ DT_SYMBOLIC = 0x10
+ DT_SYMENT = 0xb
+ DT_SYMTAB = 0x6
+ DT_TEXTREL = 0x16
DT_UNKNOWN = 0x0
+ DT_VALRNGHI = 0x6ffffdff
+ DT_VALRNGLO = 0x6ffffd00
+ DT_VERDEF = 0x6ffffffc
+ DT_VERDEFNUM = 0x6ffffffd
+ DT_VERNEED = 0x6ffffffe
+ DT_VERNEEDNUM = 0x6fffffff
+ DT_VERSYM = 0x6ffffff0
DT_WHT = 0xe
ECHO = 0x8
ECRYPTFS_SUPER_MAGIC = 0xf15f
EFD_SEMAPHORE = 0x1
EFIVARFS_MAGIC = 0xde5e81e4
EFS_SUPER_MAGIC = 0x414a53
+ EI_CLASS = 0x4
+ EI_DATA = 0x5
+ EI_MAG0 = 0x0
+ EI_MAG1 = 0x1
+ EI_MAG2 = 0x2
+ EI_MAG3 = 0x3
+ EI_NIDENT = 0x10
+ EI_OSABI = 0x7
+ EI_PAD = 0x8
+ EI_VERSION = 0x6
+ ELFCLASS32 = 0x1
+ ELFCLASS64 = 0x2
+ ELFCLASSNONE = 0x0
+ ELFCLASSNUM = 0x3
+ ELFDATA2LSB = 0x1
+ ELFDATA2MSB = 0x2
+ ELFDATANONE = 0x0
+ ELFMAG = "\177ELF"
+ ELFMAG0 = 0x7f
+ ELFMAG1 = 'E'
+ ELFMAG2 = 'L'
+ ELFMAG3 = 'F'
+ ELFOSABI_LINUX = 0x3
+ ELFOSABI_NONE = 0x0
EM_386 = 0x3
EM_486 = 0x6
EM_68K = 0x4
@@ -1152,14 +1218,24 @@ const (
ETH_P_WCCP = 0x883e
ETH_P_X25 = 0x805
ETH_P_XDSA = 0xf8
+ ET_CORE = 0x4
+ ET_DYN = 0x3
+ ET_EXEC = 0x2
+ ET_HIPROC = 0xffff
+ ET_LOPROC = 0xff00
+ ET_NONE = 0x0
+ ET_REL = 0x1
EV_ABS = 0x3
EV_CNT = 0x20
+ EV_CURRENT = 0x1
EV_FF = 0x15
EV_FF_STATUS = 0x17
EV_KEY = 0x1
EV_LED = 0x11
EV_MAX = 0x1f
EV_MSC = 0x4
+ EV_NONE = 0x0
+ EV_NUM = 0x2
EV_PWR = 0x16
EV_REL = 0x2
EV_REP = 0x14
@@ -2276,7 +2352,167 @@ const (
NLM_F_REPLACE = 0x100
NLM_F_REQUEST = 0x1
NLM_F_ROOT = 0x100
+ NN_386_IOPERM = "LINUX"
+ NN_386_TLS = "LINUX"
+ NN_ARC_V2 = "LINUX"
+ NN_ARM_FPMR = "LINUX"
+ NN_ARM_GCS = "LINUX"
+ NN_ARM_HW_BREAK = "LINUX"
+ NN_ARM_HW_WATCH = "LINUX"
+ NN_ARM_PACA_KEYS = "LINUX"
+ NN_ARM_PACG_KEYS = "LINUX"
+ NN_ARM_PAC_ENABLED_KEYS = "LINUX"
+ NN_ARM_PAC_MASK = "LINUX"
+ NN_ARM_POE = "LINUX"
+ NN_ARM_SSVE = "LINUX"
+ NN_ARM_SVE = "LINUX"
+ NN_ARM_SYSTEM_CALL = "LINUX"
+ NN_ARM_TAGGED_ADDR_CTRL = "LINUX"
+ NN_ARM_TLS = "LINUX"
+ NN_ARM_VFP = "LINUX"
+ NN_ARM_ZA = "LINUX"
+ NN_ARM_ZT = "LINUX"
+ NN_AUXV = "CORE"
+ NN_FILE = "CORE"
+ NN_GNU_PROPERTY_TYPE_0 = "GNU"
+ NN_LOONGARCH_CPUCFG = "LINUX"
+ NN_LOONGARCH_CSR = "LINUX"
+ NN_LOONGARCH_HW_BREAK = "LINUX"
+ NN_LOONGARCH_HW_WATCH = "LINUX"
+ NN_LOONGARCH_LASX = "LINUX"
+ NN_LOONGARCH_LBT = "LINUX"
+ NN_LOONGARCH_LSX = "LINUX"
+ NN_MIPS_DSP = "LINUX"
+ NN_MIPS_FP_MODE = "LINUX"
+ NN_MIPS_MSA = "LINUX"
+ NN_PPC_DEXCR = "LINUX"
+ NN_PPC_DSCR = "LINUX"
+ NN_PPC_EBB = "LINUX"
+ NN_PPC_HASHKEYR = "LINUX"
+ NN_PPC_PKEY = "LINUX"
+ NN_PPC_PMU = "LINUX"
+ NN_PPC_PPR = "LINUX"
+ NN_PPC_SPE = "LINUX"
+ NN_PPC_TAR = "LINUX"
+ NN_PPC_TM_CDSCR = "LINUX"
+ NN_PPC_TM_CFPR = "LINUX"
+ NN_PPC_TM_CGPR = "LINUX"
+ NN_PPC_TM_CPPR = "LINUX"
+ NN_PPC_TM_CTAR = "LINUX"
+ NN_PPC_TM_CVMX = "LINUX"
+ NN_PPC_TM_CVSX = "LINUX"
+ NN_PPC_TM_SPR = "LINUX"
+ NN_PPC_VMX = "LINUX"
+ NN_PPC_VSX = "LINUX"
+ NN_PRFPREG = "CORE"
+ NN_PRPSINFO = "CORE"
+ NN_PRSTATUS = "CORE"
+ NN_PRXFPREG = "LINUX"
+ NN_RISCV_CSR = "LINUX"
+ NN_RISCV_TAGGED_ADDR_CTRL = "LINUX"
+ NN_RISCV_VECTOR = "LINUX"
+ NN_S390_CTRS = "LINUX"
+ NN_S390_GS_BC = "LINUX"
+ NN_S390_GS_CB = "LINUX"
+ NN_S390_HIGH_GPRS = "LINUX"
+ NN_S390_LAST_BREAK = "LINUX"
+ NN_S390_PREFIX = "LINUX"
+ NN_S390_PV_CPU_DATA = "LINUX"
+ NN_S390_RI_CB = "LINUX"
+ NN_S390_SYSTEM_CALL = "LINUX"
+ NN_S390_TDB = "LINUX"
+ NN_S390_TIMER = "LINUX"
+ NN_S390_TODCMP = "LINUX"
+ NN_S390_TODPREG = "LINUX"
+ NN_S390_VXRS_HIGH = "LINUX"
+ NN_S390_VXRS_LOW = "LINUX"
+ NN_SIGINFO = "CORE"
+ NN_TASKSTRUCT = "CORE"
+ NN_VMCOREDD = "LINUX"
+ NN_X86_SHSTK = "LINUX"
+ NN_X86_XSAVE_LAYOUT = "LINUX"
+ NN_X86_XSTATE = "LINUX"
NSFS_MAGIC = 0x6e736673
+ NT_386_IOPERM = 0x201
+ NT_386_TLS = 0x200
+ NT_ARC_V2 = 0x600
+ NT_ARM_FPMR = 0x40e
+ NT_ARM_GCS = 0x410
+ NT_ARM_HW_BREAK = 0x402
+ NT_ARM_HW_WATCH = 0x403
+ NT_ARM_PACA_KEYS = 0x407
+ NT_ARM_PACG_KEYS = 0x408
+ NT_ARM_PAC_ENABLED_KEYS = 0x40a
+ NT_ARM_PAC_MASK = 0x406
+ NT_ARM_POE = 0x40f
+ NT_ARM_SSVE = 0x40b
+ NT_ARM_SVE = 0x405
+ NT_ARM_SYSTEM_CALL = 0x404
+ NT_ARM_TAGGED_ADDR_CTRL = 0x409
+ NT_ARM_TLS = 0x401
+ NT_ARM_VFP = 0x400
+ NT_ARM_ZA = 0x40c
+ NT_ARM_ZT = 0x40d
+ NT_AUXV = 0x6
+ NT_FILE = 0x46494c45
+ NT_GNU_PROPERTY_TYPE_0 = 0x5
+ NT_LOONGARCH_CPUCFG = 0xa00
+ NT_LOONGARCH_CSR = 0xa01
+ NT_LOONGARCH_HW_BREAK = 0xa05
+ NT_LOONGARCH_HW_WATCH = 0xa06
+ NT_LOONGARCH_LASX = 0xa03
+ NT_LOONGARCH_LBT = 0xa04
+ NT_LOONGARCH_LSX = 0xa02
+ NT_MIPS_DSP = 0x800
+ NT_MIPS_FP_MODE = 0x801
+ NT_MIPS_MSA = 0x802
+ NT_PPC_DEXCR = 0x111
+ NT_PPC_DSCR = 0x105
+ NT_PPC_EBB = 0x106
+ NT_PPC_HASHKEYR = 0x112
+ NT_PPC_PKEY = 0x110
+ NT_PPC_PMU = 0x107
+ NT_PPC_PPR = 0x104
+ NT_PPC_SPE = 0x101
+ NT_PPC_TAR = 0x103
+ NT_PPC_TM_CDSCR = 0x10f
+ NT_PPC_TM_CFPR = 0x109
+ NT_PPC_TM_CGPR = 0x108
+ NT_PPC_TM_CPPR = 0x10e
+ NT_PPC_TM_CTAR = 0x10d
+ NT_PPC_TM_CVMX = 0x10a
+ NT_PPC_TM_CVSX = 0x10b
+ NT_PPC_TM_SPR = 0x10c
+ NT_PPC_VMX = 0x100
+ NT_PPC_VSX = 0x102
+ NT_PRFPREG = 0x2
+ NT_PRPSINFO = 0x3
+ NT_PRSTATUS = 0x1
+ NT_PRXFPREG = 0x46e62b7f
+ NT_RISCV_CSR = 0x900
+ NT_RISCV_TAGGED_ADDR_CTRL = 0x902
+ NT_RISCV_VECTOR = 0x901
+ NT_S390_CTRS = 0x304
+ NT_S390_GS_BC = 0x30c
+ NT_S390_GS_CB = 0x30b
+ NT_S390_HIGH_GPRS = 0x300
+ NT_S390_LAST_BREAK = 0x306
+ NT_S390_PREFIX = 0x305
+ NT_S390_PV_CPU_DATA = 0x30e
+ NT_S390_RI_CB = 0x30d
+ NT_S390_SYSTEM_CALL = 0x307
+ NT_S390_TDB = 0x308
+ NT_S390_TIMER = 0x301
+ NT_S390_TODCMP = 0x302
+ NT_S390_TODPREG = 0x303
+ NT_S390_VXRS_HIGH = 0x30a
+ NT_S390_VXRS_LOW = 0x309
+ NT_SIGINFO = 0x53494749
+ NT_TASKSTRUCT = 0x4
+ NT_VMCOREDD = 0x700
+ NT_X86_SHSTK = 0x204
+ NT_X86_XSAVE_LAYOUT = 0x205
+ NT_X86_XSTATE = 0x202
OCFS2_SUPER_MAGIC = 0x7461636f
OCRNL = 0x8
OFDEL = 0x80
@@ -2463,6 +2699,59 @@ const (
PERF_RECORD_MISC_USER = 0x2
PERF_SAMPLE_BRANCH_PLM_ALL = 0x7
PERF_SAMPLE_WEIGHT_TYPE = 0x1004000
+ PF_ALG = 0x26
+ PF_APPLETALK = 0x5
+ PF_ASH = 0x12
+ PF_ATMPVC = 0x8
+ PF_ATMSVC = 0x14
+ PF_AX25 = 0x3
+ PF_BLUETOOTH = 0x1f
+ PF_BRIDGE = 0x7
+ PF_CAIF = 0x25
+ PF_CAN = 0x1d
+ PF_DECnet = 0xc
+ PF_ECONET = 0x13
+ PF_FILE = 0x1
+ PF_IB = 0x1b
+ PF_IEEE802154 = 0x24
+ PF_INET = 0x2
+ PF_INET6 = 0xa
+ PF_IPX = 0x4
+ PF_IRDA = 0x17
+ PF_ISDN = 0x22
+ PF_IUCV = 0x20
+ PF_KCM = 0x29
+ PF_KEY = 0xf
+ PF_LLC = 0x1a
+ PF_LOCAL = 0x1
+ PF_MAX = 0x2e
+ PF_MCTP = 0x2d
+ PF_MPLS = 0x1c
+ PF_NETBEUI = 0xd
+ PF_NETLINK = 0x10
+ PF_NETROM = 0x6
+ PF_NFC = 0x27
+ PF_PACKET = 0x11
+ PF_PHONET = 0x23
+ PF_PPPOX = 0x18
+ PF_QIPCRTR = 0x2a
+ PF_R = 0x4
+ PF_RDS = 0x15
+ PF_ROSE = 0xb
+ PF_ROUTE = 0x10
+ PF_RXRPC = 0x21
+ PF_SECURITY = 0xe
+ PF_SMC = 0x2b
+ PF_SNA = 0x16
+ PF_TIPC = 0x1e
+ PF_UNIX = 0x1
+ PF_UNSPEC = 0x0
+ PF_VSOCK = 0x28
+ PF_W = 0x2
+ PF_WANPIPE = 0x19
+ PF_X = 0x1
+ PF_X25 = 0x9
+ PF_XDP = 0x2c
PID_FS_MAGIC = 0x50494446
PIPEFS_MAGIC = 0x50495045
PPPIOCGNPMODE = 0xc008744c
@@ -2758,6 +3047,23 @@ const (
PTRACE_SYSCALL_INFO_NONE = 0x0
PTRACE_SYSCALL_INFO_SECCOMP = 0x3
PTRACE_TRACEME = 0x0
+ PT_AARCH64_MEMTAG_MTE = 0x70000002
+ PT_DYNAMIC = 0x2
+ PT_GNU_EH_FRAME = 0x6474e550
+ PT_GNU_PROPERTY = 0x6474e553
+ PT_GNU_RELRO = 0x6474e552
+ PT_GNU_STACK = 0x6474e551
+ PT_HIOS = 0x6fffffff
+ PT_HIPROC = 0x7fffffff
+ PT_INTERP = 0x3
+ PT_LOAD = 0x1
+ PT_LOOS = 0x60000000
+ PT_LOPROC = 0x70000000
+ PT_NOTE = 0x4
+ PT_NULL = 0x0
+ PT_PHDR = 0x6
+ PT_SHLIB = 0x5
+ PT_TLS = 0x7
P_ALL = 0x0
P_PGID = 0x2
P_PID = 0x1
@@ -3091,6 +3397,47 @@ const (
SEEK_MAX = 0x4
SEEK_SET = 0x0
SELINUX_MAGIC = 0xf97cff8c
+ SHF_ALLOC = 0x2
+ SHF_EXCLUDE = 0x8000000
+ SHF_EXECINSTR = 0x4
+ SHF_GROUP = 0x200
+ SHF_INFO_LINK = 0x40
+ SHF_LINK_ORDER = 0x80
+ SHF_MASKOS = 0xff00000
+ SHF_MASKPROC = 0xf0000000
+ SHF_MERGE = 0x10
+ SHF_ORDERED = 0x4000000
+ SHF_OS_NONCONFORMING = 0x100
+ SHF_RELA_LIVEPATCH = 0x100000
+ SHF_RO_AFTER_INIT = 0x200000
+ SHF_STRINGS = 0x20
+ SHF_TLS = 0x400
+ SHF_WRITE = 0x1
+ SHN_ABS = 0xfff1
+ SHN_COMMON = 0xfff2
+ SHN_HIPROC = 0xff1f
+ SHN_HIRESERVE = 0xffff
+ SHN_LIVEPATCH = 0xff20
+ SHN_LOPROC = 0xff00
+ SHN_LORESERVE = 0xff00
+ SHN_UNDEF = 0x0
+ SHT_DYNAMIC = 0x6
+ SHT_DYNSYM = 0xb
+ SHT_HASH = 0x5
+ SHT_HIPROC = 0x7fffffff
+ SHT_HIUSER = 0xffffffff
+ SHT_LOPROC = 0x70000000
+ SHT_LOUSER = 0x80000000
+ SHT_NOBITS = 0x8
+ SHT_NOTE = 0x7
+ SHT_NULL = 0x0
+ SHT_NUM = 0xc
+ SHT_PROGBITS = 0x1
+ SHT_REL = 0x9
+ SHT_RELA = 0x4
+ SHT_SHLIB = 0xa
+ SHT_STRTAB = 0x3
+ SHT_SYMTAB = 0x2
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
@@ -3317,6 +3664,16 @@ const (
STATX_UID = 0x8
STATX_WRITE_ATOMIC = 0x10000
STATX__RESERVED = 0x80000000
+ STB_GLOBAL = 0x1
+ STB_LOCAL = 0x0
+ STB_WEAK = 0x2
+ STT_COMMON = 0x5
+ STT_FILE = 0x4
+ STT_FUNC = 0x2
+ STT_NOTYPE = 0x0
+ STT_OBJECT = 0x1
+ STT_SECTION = 0x3
+ STT_TLS = 0x6
SYNC_FILE_RANGE_WAIT_AFTER = 0x4
SYNC_FILE_RANGE_WAIT_BEFORE = 0x1
SYNC_FILE_RANGE_WRITE = 0x2
@@ -3553,6 +3910,8 @@ const (
UTIME_OMIT = 0x3ffffffe
V9FS_MAGIC = 0x1021997
VERASE = 0x2
+ VER_FLG_BASE = 0x1
+ VER_FLG_WEAK = 0x2
VINTR = 0x0
VKILL = 0x3
VLNEXT = 0xf
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/vendor/golang.org/x/sys/unix/zsyscall_linux.go
index 5cc1e8eb2f..8935d10a31 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux.go
@@ -2238,3 +2238,13 @@ func Mseal(b []byte, flags uint) (err error) {
}
return
}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func setMemPolicy(mode int, mask *CPUSet, size int) (err error) {
+ _, _, e1 := Syscall(SYS_SET_MEMPOLICY, uintptr(mode), uintptr(unsafe.Pointer(mask)), uintptr(size))
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go
index c6545413c4..b4609c20c2 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go
@@ -72,7 +72,7 @@ import (
//go:cgo_import_dynamic libc_kill kill "libc.so"
//go:cgo_import_dynamic libc_lchown lchown "libc.so"
//go:cgo_import_dynamic libc_link link "libc.so"
-//go:cgo_import_dynamic libc___xnet_llisten __xnet_llisten "libsocket.so"
+//go:cgo_import_dynamic libc___xnet_listen __xnet_listen "libsocket.so"
//go:cgo_import_dynamic libc_lstat lstat "libc.so"
//go:cgo_import_dynamic libc_madvise madvise "libc.so"
//go:cgo_import_dynamic libc_mkdir mkdir "libc.so"
@@ -221,7 +221,7 @@ import (
//go:linkname procKill libc_kill
//go:linkname procLchown libc_lchown
//go:linkname procLink libc_link
-//go:linkname proc__xnet_llisten libc___xnet_llisten
+//go:linkname proc__xnet_listen libc___xnet_listen
//go:linkname procLstat libc_lstat
//go:linkname procMadvise libc_madvise
//go:linkname procMkdir libc_mkdir
@@ -371,7 +371,7 @@ var (
procKill,
procLchown,
procLink,
- proc__xnet_llisten,
+ proc__xnet_listen,
procLstat,
procMadvise,
procMkdir,
@@ -1178,7 +1178,7 @@ func Link(path string, link string) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Listen(s int, backlog int) (err error) {
- _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_llisten)), 2, uintptr(s), uintptr(backlog), 0, 0, 0, 0)
+ _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_listen)), 2, uintptr(s), uintptr(backlog), 0, 0, 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go
index cd236443f6..c1a4670171 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go
@@ -632,6 +632,8 @@ const (
IFA_FLAGS = 0x8
IFA_RT_PRIORITY = 0x9
IFA_TARGET_NETNSID = 0xa
+ IFAL_LABEL = 0x2
+ IFAL_ADDRESS = 0x1
RT_SCOPE_UNIVERSE = 0x0
RT_SCOPE_SITE = 0xc8
RT_SCOPE_LINK = 0xfd
@@ -689,6 +691,7 @@ const (
SizeofRtAttr = 0x4
SizeofIfInfomsg = 0x10
SizeofIfAddrmsg = 0x8
+ SizeofIfAddrlblmsg = 0xc
SizeofIfaCacheinfo = 0x10
SizeofRtMsg = 0xc
SizeofRtNexthop = 0x8
@@ -740,6 +743,15 @@ type IfAddrmsg struct {
Index uint32
}
+type IfAddrlblmsg struct {
+ Family uint8
+ _ uint8
+ Prefixlen uint8
+ Flags uint8
+ Index uint32
+ Seq uint32
+}
+
type IfaCacheinfo struct {
Prefered uint32
Valid uint32
@@ -3052,6 +3064,23 @@ const (
)
const (
+ TCA_UNSPEC = 0x0
+ TCA_KIND = 0x1
+ TCA_OPTIONS = 0x2
+ TCA_STATS = 0x3
+ TCA_XSTATS = 0x4
+ TCA_RATE = 0x5
+ TCA_FCNT = 0x6
+ TCA_STATS2 = 0x7
+ TCA_STAB = 0x8
+ TCA_PAD = 0x9
+ TCA_DUMP_INVISIBLE = 0xa
+ TCA_CHAIN = 0xb
+ TCA_HW_OFFLOAD = 0xc
+ TCA_INGRESS_BLOCK = 0xd
+ TCA_EGRESS_BLOCK = 0xe
+ TCA_DUMP_FLAGS = 0xf
+ TCA_EXT_WARN_MSG = 0x10
RTNLGRP_NONE = 0x0
RTNLGRP_LINK = 0x1
RTNLGRP_NOTIFY = 0x2
@@ -3086,6 +3115,18 @@ const (
RTNLGRP_IPV6_MROUTE_R = 0x1f
RTNLGRP_NEXTHOP = 0x20
RTNLGRP_BRVLAN = 0x21
+ RTNLGRP_MCTP_IFADDR = 0x22
+ RTNLGRP_TUNNEL = 0x23
+ RTNLGRP_STATS = 0x24
+ RTNLGRP_IPV4_MCADDR = 0x25
+ RTNLGRP_IPV6_MCADDR = 0x26
+ RTNLGRP_IPV6_ACADDR = 0x27
+ TCA_ROOT_UNSPEC = 0x0
+ TCA_ROOT_TAB = 0x1
+ TCA_ROOT_FLAGS = 0x2
+ TCA_ROOT_COUNT = 0x3
+ TCA_ROOT_TIME_DELTA = 0x4
+ TCA_ROOT_EXT_WARN_MSG = 0x5
)
type CapUserHeader struct {
@@ -3549,6 +3590,8 @@ type Nhmsg struct {
Flags uint32
}
+const SizeofNhmsg = 0x8
+
type NexthopGrp struct {
Id uint32
Weight uint8
@@ -3556,6 +3599,8 @@ type NexthopGrp struct {
Resvd2 uint16
}
+const SizeofNexthopGrp = 0x8
+
const (
NHA_UNSPEC = 0x0
NHA_ID = 0x1
@@ -6291,3 +6336,30 @@ type SockDiagReq struct {
}
const RTM_NEWNVLAN = 0x70
+
+const (
+ MPOL_BIND = 0x2
+ MPOL_DEFAULT = 0x0
+ MPOL_F_ADDR = 0x2
+ MPOL_F_MEMS_ALLOWED = 0x4
+ MPOL_F_MOF = 0x8
+ MPOL_F_MORON = 0x10
+ MPOL_F_NODE = 0x1
+ MPOL_F_NUMA_BALANCING = 0x2000
+ MPOL_F_RELATIVE_NODES = 0x4000
+ MPOL_F_SHARED = 0x1
+ MPOL_F_STATIC_NODES = 0x8000
+ MPOL_INTERLEAVE = 0x3
+ MPOL_LOCAL = 0x4
+ MPOL_MAX = 0x7
+ MPOL_MF_INTERNAL = 0x10
+ MPOL_MF_LAZY = 0x8
+ MPOL_MF_MOVE_ALL = 0x4
+ MPOL_MF_MOVE = 0x2
+ MPOL_MF_STRICT = 0x1
+ MPOL_MF_VALID = 0x7
+ MPOL_MODE_FLAGS = 0xe000
+ MPOL_PREFERRED = 0x1
+ MPOL_PREFERRED_MANY = 0x5
+ MPOL_WEIGHTED_INTERLEAVE = 0x6
+)
diff --git a/vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go
index fc1835d8a2..bc1ce4360b 100644
--- a/vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go
+++ b/vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go
@@ -52,7 +52,7 @@ var (
)
func regConnectRegistry(machinename *uint16, key syscall.Handle, result *syscall.Handle) (regerrno error) {
- r0, _, _ := syscall.Syscall(procRegConnectRegistryW.Addr(), 3, uintptr(unsafe.Pointer(machinename)), uintptr(key), uintptr(unsafe.Pointer(result)))
+ r0, _, _ := syscall.SyscallN(procRegConnectRegistryW.Addr(), uintptr(unsafe.Pointer(machinename)), uintptr(key), uintptr(unsafe.Pointer(result)))
if r0 != 0 {
regerrno = syscall.Errno(r0)
}
@@ -60,7 +60,7 @@ func regConnectRegistry(machinename *uint16, key syscall.Handle, result *syscall
}
func regCreateKeyEx(key syscall.Handle, subkey *uint16, reserved uint32, class *uint16, options uint32, desired uint32, sa *syscall.SecurityAttributes, result *syscall.Handle, disposition *uint32) (regerrno error) {
- r0, _, _ := syscall.Syscall9(procRegCreateKeyExW.Addr(), 9, uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(reserved), uintptr(unsafe.Pointer(class)), uintptr(options), uintptr(desired), uintptr(unsafe.Pointer(sa)), uintptr(unsafe.Pointer(result)), uintptr(unsafe.Pointer(disposition)))
+ r0, _, _ := syscall.SyscallN(procRegCreateKeyExW.Addr(), uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(reserved), uintptr(unsafe.Pointer(class)), uintptr(options), uintptr(desired), uintptr(unsafe.Pointer(sa)), uintptr(unsafe.Pointer(result)), uintptr(unsafe.Pointer(disposition)))
if r0 != 0 {
regerrno = syscall.Errno(r0)
}
@@ -68,7 +68,7 @@ func regCreateKeyEx(key syscall.Handle, subkey *uint16, reserved uint32, class *
}
func regDeleteKey(key syscall.Handle, subkey *uint16) (regerrno error) {
- r0, _, _ := syscall.Syscall(procRegDeleteKeyW.Addr(), 2, uintptr(key), uintptr(unsafe.Pointer(subkey)), 0)
+ r0, _, _ := syscall.SyscallN(procRegDeleteKeyW.Addr(), uintptr(key), uintptr(unsafe.Pointer(subkey)))
if r0 != 0 {
regerrno = syscall.Errno(r0)
}
@@ -76,7 +76,7 @@ func regDeleteKey(key syscall.Handle, subkey *uint16) (regerrno error) {
}
func regDeleteValue(key syscall.Handle, name *uint16) (regerrno error) {
- r0, _, _ := syscall.Syscall(procRegDeleteValueW.Addr(), 2, uintptr(key), uintptr(unsafe.Pointer(name)), 0)
+ r0, _, _ := syscall.SyscallN(procRegDeleteValueW.Addr(), uintptr(key), uintptr(unsafe.Pointer(name)))
if r0 != 0 {
regerrno = syscall.Errno(r0)
}
@@ -84,7 +84,7 @@ func regDeleteValue(key syscall.Handle, name *uint16) (regerrno error) {
}
func regEnumValue(key syscall.Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) {
- r0, _, _ := syscall.Syscall9(procRegEnumValueW.Addr(), 8, uintptr(key), uintptr(index), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(valtype)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(buflen)), 0)
+ r0, _, _ := syscall.SyscallN(procRegEnumValueW.Addr(), uintptr(key), uintptr(index), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(valtype)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(buflen)))
if r0 != 0 {
regerrno = syscall.Errno(r0)
}
@@ -92,7 +92,7 @@ func regEnumValue(key syscall.Handle, index uint32, name *uint16, nameLen *uint3
}
func regLoadMUIString(key syscall.Handle, name *uint16, buf *uint16, buflen uint32, buflenCopied *uint32, flags uint32, dir *uint16) (regerrno error) {
- r0, _, _ := syscall.Syscall9(procRegLoadMUIStringW.Addr(), 7, uintptr(key), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(unsafe.Pointer(buflenCopied)), uintptr(flags), uintptr(unsafe.Pointer(dir)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procRegLoadMUIStringW.Addr(), uintptr(key), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(unsafe.Pointer(buflenCopied)), uintptr(flags), uintptr(unsafe.Pointer(dir)))
if r0 != 0 {
regerrno = syscall.Errno(r0)
}
@@ -100,7 +100,7 @@ func regLoadMUIString(key syscall.Handle, name *uint16, buf *uint16, buflen uint
}
func regSetValueEx(key syscall.Handle, valueName *uint16, reserved uint32, vtype uint32, buf *byte, bufsize uint32) (regerrno error) {
- r0, _, _ := syscall.Syscall6(procRegSetValueExW.Addr(), 6, uintptr(key), uintptr(unsafe.Pointer(valueName)), uintptr(reserved), uintptr(vtype), uintptr(unsafe.Pointer(buf)), uintptr(bufsize))
+ r0, _, _ := syscall.SyscallN(procRegSetValueExW.Addr(), uintptr(key), uintptr(unsafe.Pointer(valueName)), uintptr(reserved), uintptr(vtype), uintptr(unsafe.Pointer(buf)), uintptr(bufsize))
if r0 != 0 {
regerrno = syscall.Errno(r0)
}
@@ -108,7 +108,7 @@ func regSetValueEx(key syscall.Handle, valueName *uint16, reserved uint32, vtype
}
func expandEnvironmentStrings(src *uint16, dst *uint16, size uint32) (n uint32, err error) {
- r0, _, e1 := syscall.Syscall(procExpandEnvironmentStringsW.Addr(), 3, uintptr(unsafe.Pointer(src)), uintptr(unsafe.Pointer(dst)), uintptr(size))
+ r0, _, e1 := syscall.SyscallN(procExpandEnvironmentStringsW.Addr(), uintptr(unsafe.Pointer(src)), uintptr(unsafe.Pointer(dst)), uintptr(size))
n = uint32(r0)
if n == 0 {
err = errnoErr(e1)
diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go
index 640f6b153f..69439df2a4 100644
--- a/vendor/golang.org/x/sys/windows/syscall_windows.go
+++ b/vendor/golang.org/x/sys/windows/syscall_windows.go
@@ -321,6 +321,8 @@ func NewCallbackCDecl(fn interface{}) uintptr {
//sys SetConsoleOutputCP(cp uint32) (err error) = kernel32.SetConsoleOutputCP
//sys WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) = kernel32.WriteConsoleW
//sys ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) = kernel32.ReadConsoleW
+//sys GetNumberOfConsoleInputEvents(console Handle, numevents *uint32) (err error) = kernel32.GetNumberOfConsoleInputEvents
+//sys FlushConsoleInputBuffer(console Handle) (err error) = kernel32.FlushConsoleInputBuffer
//sys resizePseudoConsole(pconsole Handle, size uint32) (hr error) = kernel32.ResizePseudoConsole
//sys CreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, err error) [failretval==InvalidHandle] = kernel32.CreateToolhelp32Snapshot
//sys Module32First(snapshot Handle, moduleEntry *ModuleEntry32) (err error) = kernel32.Module32FirstW
@@ -890,8 +892,12 @@ const socket_error = uintptr(^uint32(0))
//sys MultiByteToWideChar(codePage uint32, dwFlags uint32, str *byte, nstr int32, wchar *uint16, nwchar int32) (nwrite int32, err error) = kernel32.MultiByteToWideChar
//sys getBestInterfaceEx(sockaddr unsafe.Pointer, pdwBestIfIndex *uint32) (errcode error) = iphlpapi.GetBestInterfaceEx
//sys GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) = iphlpapi.GetIfEntry2Ex
+//sys GetIpForwardEntry2(row *MibIpForwardRow2) (errcode error) = iphlpapi.GetIpForwardEntry2
+//sys GetIpForwardTable2(family uint16, table **MibIpForwardTable2) (errcode error) = iphlpapi.GetIpForwardTable2
//sys GetUnicastIpAddressEntry(row *MibUnicastIpAddressRow) (errcode error) = iphlpapi.GetUnicastIpAddressEntry
+//sys FreeMibTable(memory unsafe.Pointer) = iphlpapi.FreeMibTable
//sys NotifyIpInterfaceChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyIpInterfaceChange
+//sys NotifyRouteChange2(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyRouteChange2
//sys NotifyUnicastIpAddressChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyUnicastIpAddressChange
//sys CancelMibChangeNotify2(notificationHandle Handle) (errcode error) = iphlpapi.CancelMibChangeNotify2
@@ -914,6 +920,17 @@ type RawSockaddrInet6 struct {
Scope_id uint32
}
+// RawSockaddrInet is a union that contains an IPv4, an IPv6 address, or an address family. See
+// https://learn.microsoft.com/en-us/windows/win32/api/ws2ipdef/ns-ws2ipdef-sockaddr_inet.
+//
+// A [*RawSockaddrInet] may be converted to a [*RawSockaddrInet4] or [*RawSockaddrInet6] using
+// unsafe, depending on the address family.
+type RawSockaddrInet struct {
+ Family uint16
+ Port uint16
+ Data [6]uint32
+}
+
type RawSockaddr struct {
Family uint16
Data [14]int8
diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go
index 958bcf47a3..6e4f50eb48 100644
--- a/vendor/golang.org/x/sys/windows/types_windows.go
+++ b/vendor/golang.org/x/sys/windows/types_windows.go
@@ -65,6 +65,22 @@ var signals = [...]string{
15: "terminated",
}
+// File flags for [os.OpenFile]. The O_ prefix is used to indicate
+// that these flags are specific to the OpenFile function.
+const (
+ O_FILE_FLAG_OPEN_NO_RECALL = FILE_FLAG_OPEN_NO_RECALL
+ O_FILE_FLAG_OPEN_REPARSE_POINT = FILE_FLAG_OPEN_REPARSE_POINT
+ O_FILE_FLAG_SESSION_AWARE = FILE_FLAG_SESSION_AWARE
+ O_FILE_FLAG_POSIX_SEMANTICS = FILE_FLAG_POSIX_SEMANTICS
+ O_FILE_FLAG_BACKUP_SEMANTICS = FILE_FLAG_BACKUP_SEMANTICS
+ O_FILE_FLAG_DELETE_ON_CLOSE = FILE_FLAG_DELETE_ON_CLOSE
+ O_FILE_FLAG_SEQUENTIAL_SCAN = FILE_FLAG_SEQUENTIAL_SCAN
+ O_FILE_FLAG_RANDOM_ACCESS = FILE_FLAG_RANDOM_ACCESS
+ O_FILE_FLAG_NO_BUFFERING = FILE_FLAG_NO_BUFFERING
+ O_FILE_FLAG_OVERLAPPED = FILE_FLAG_OVERLAPPED
+ O_FILE_FLAG_WRITE_THROUGH = FILE_FLAG_WRITE_THROUGH
+)
+
const (
FILE_READ_DATA = 0x00000001
FILE_READ_ATTRIBUTES = 0x00000080
@@ -1976,6 +1992,12 @@ const (
SYMBOLIC_LINK_FLAG_DIRECTORY = 0x1
)
+// FILE_ZERO_DATA_INFORMATION from winioctl.h
+type FileZeroDataInformation struct {
+ FileOffset int64
+ BeyondFinalZero int64
+}
+
const (
ComputerNameNetBIOS = 0
ComputerNameDnsHostname = 1
@@ -2298,6 +2320,82 @@ type MibIfRow2 struct {
OutQLen uint64
}
+// IP_ADDRESS_PREFIX stores an IP address prefix. See
+// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-ip_address_prefix.
+type IpAddressPrefix struct {
+ Prefix RawSockaddrInet
+ PrefixLength uint8
+}
+
+// NL_ROUTE_ORIGIN enumeration from nldef.h or
+// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_route_origin.
+const (
+ NlroManual = 0
+ NlroWellKnown = 1
+ NlroDHCP = 2
+ NlroRouterAdvertisement = 3
+ Nlro6to4 = 4
+)
+
+// NL_ROUTE_ORIGIN enumeration from nldef.h or
+// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_route_protocol.
+const (
+ MIB_IPPROTO_OTHER = 1
+ MIB_IPPROTO_LOCAL = 2
+ MIB_IPPROTO_NETMGMT = 3
+ MIB_IPPROTO_ICMP = 4
+ MIB_IPPROTO_EGP = 5
+ MIB_IPPROTO_GGP = 6
+ MIB_IPPROTO_HELLO = 7
+ MIB_IPPROTO_RIP = 8
+ MIB_IPPROTO_IS_IS = 9
+ MIB_IPPROTO_ES_IS = 10
+ MIB_IPPROTO_CISCO = 11
+ MIB_IPPROTO_BBN = 12
+ MIB_IPPROTO_OSPF = 13
+ MIB_IPPROTO_BGP = 14
+ MIB_IPPROTO_IDPR = 15
+ MIB_IPPROTO_EIGRP = 16
+ MIB_IPPROTO_DVMRP = 17
+ MIB_IPPROTO_RPL = 18
+ MIB_IPPROTO_DHCP = 19
+ MIB_IPPROTO_NT_AUTOSTATIC = 10002
+ MIB_IPPROTO_NT_STATIC = 10006
+ MIB_IPPROTO_NT_STATIC_NON_DOD = 10007
+)
+
+// MIB_IPFORWARD_ROW2 stores information about an IP route entry. See
+// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_ipforward_row2.
+type MibIpForwardRow2 struct {
+ InterfaceLuid uint64
+ InterfaceIndex uint32
+ DestinationPrefix IpAddressPrefix
+ NextHop RawSockaddrInet
+ SitePrefixLength uint8
+ ValidLifetime uint32
+ PreferredLifetime uint32
+ Metric uint32
+ Protocol uint32
+ Loopback uint8
+ AutoconfigureAddress uint8
+ Publish uint8
+ Immortal uint8
+ Age uint32
+ Origin uint32
+}
+
+// MIB_IPFORWARD_TABLE2 contains a table of IP route entries. See
+// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_ipforward_table2.
+type MibIpForwardTable2 struct {
+ NumEntries uint32
+ Table [1]MibIpForwardRow2
+}
+
+// Rows returns the IP route entries in the table.
+func (t *MibIpForwardTable2) Rows() []MibIpForwardRow2 {
+ return unsafe.Slice(&t.Table[0], t.NumEntries)
+}
+
// MIB_UNICASTIPADDRESS_ROW stores information about a unicast IP address. See
// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_unicastipaddress_row.
type MibUnicastIpAddressRow struct {
diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go
index a58bc48b8e..f25b7308a1 100644
--- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go
+++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go
@@ -182,13 +182,17 @@ var (
procDwmGetWindowAttribute = moddwmapi.NewProc("DwmGetWindowAttribute")
procDwmSetWindowAttribute = moddwmapi.NewProc("DwmSetWindowAttribute")
procCancelMibChangeNotify2 = modiphlpapi.NewProc("CancelMibChangeNotify2")
+ procFreeMibTable = modiphlpapi.NewProc("FreeMibTable")
procGetAdaptersAddresses = modiphlpapi.NewProc("GetAdaptersAddresses")
procGetAdaptersInfo = modiphlpapi.NewProc("GetAdaptersInfo")
procGetBestInterfaceEx = modiphlpapi.NewProc("GetBestInterfaceEx")
procGetIfEntry = modiphlpapi.NewProc("GetIfEntry")
procGetIfEntry2Ex = modiphlpapi.NewProc("GetIfEntry2Ex")
+ procGetIpForwardEntry2 = modiphlpapi.NewProc("GetIpForwardEntry2")
+ procGetIpForwardTable2 = modiphlpapi.NewProc("GetIpForwardTable2")
procGetUnicastIpAddressEntry = modiphlpapi.NewProc("GetUnicastIpAddressEntry")
procNotifyIpInterfaceChange = modiphlpapi.NewProc("NotifyIpInterfaceChange")
+ procNotifyRouteChange2 = modiphlpapi.NewProc("NotifyRouteChange2")
procNotifyUnicastIpAddressChange = modiphlpapi.NewProc("NotifyUnicastIpAddressChange")
procAddDllDirectory = modkernel32.NewProc("AddDllDirectory")
procAssignProcessToJobObject = modkernel32.NewProc("AssignProcessToJobObject")
@@ -238,6 +242,7 @@ var (
procFindResourceW = modkernel32.NewProc("FindResourceW")
procFindVolumeClose = modkernel32.NewProc("FindVolumeClose")
procFindVolumeMountPointClose = modkernel32.NewProc("FindVolumeMountPointClose")
+ procFlushConsoleInputBuffer = modkernel32.NewProc("FlushConsoleInputBuffer")
procFlushFileBuffers = modkernel32.NewProc("FlushFileBuffers")
procFlushViewOfFile = modkernel32.NewProc("FlushViewOfFile")
procFormatMessageW = modkernel32.NewProc("FormatMessageW")
@@ -284,6 +289,7 @@ var (
procGetNamedPipeHandleStateW = modkernel32.NewProc("GetNamedPipeHandleStateW")
procGetNamedPipeInfo = modkernel32.NewProc("GetNamedPipeInfo")
procGetNamedPipeServerProcessId = modkernel32.NewProc("GetNamedPipeServerProcessId")
+ procGetNumberOfConsoleInputEvents = modkernel32.NewProc("GetNumberOfConsoleInputEvents")
procGetOverlappedResult = modkernel32.NewProc("GetOverlappedResult")
procGetPriorityClass = modkernel32.NewProc("GetPriorityClass")
procGetProcAddress = modkernel32.NewProc("GetProcAddress")
@@ -546,25 +552,25 @@ var (
)
func cm_Get_DevNode_Status(status *uint32, problemNumber *uint32, devInst DEVINST, flags uint32) (ret CONFIGRET) {
- r0, _, _ := syscall.Syscall6(procCM_Get_DevNode_Status.Addr(), 4, uintptr(unsafe.Pointer(status)), uintptr(unsafe.Pointer(problemNumber)), uintptr(devInst), uintptr(flags), 0, 0)
+ r0, _, _ := syscall.SyscallN(procCM_Get_DevNode_Status.Addr(), uintptr(unsafe.Pointer(status)), uintptr(unsafe.Pointer(problemNumber)), uintptr(devInst), uintptr(flags))
ret = CONFIGRET(r0)
return
}
func cm_Get_Device_Interface_List(interfaceClass *GUID, deviceID *uint16, buffer *uint16, bufferLen uint32, flags uint32) (ret CONFIGRET) {
- r0, _, _ := syscall.Syscall6(procCM_Get_Device_Interface_ListW.Addr(), 5, uintptr(unsafe.Pointer(interfaceClass)), uintptr(unsafe.Pointer(deviceID)), uintptr(unsafe.Pointer(buffer)), uintptr(bufferLen), uintptr(flags), 0)
+ r0, _, _ := syscall.SyscallN(procCM_Get_Device_Interface_ListW.Addr(), uintptr(unsafe.Pointer(interfaceClass)), uintptr(unsafe.Pointer(deviceID)), uintptr(unsafe.Pointer(buffer)), uintptr(bufferLen), uintptr(flags))
ret = CONFIGRET(r0)
return
}
func cm_Get_Device_Interface_List_Size(len *uint32, interfaceClass *GUID, deviceID *uint16, flags uint32) (ret CONFIGRET) {
- r0, _, _ := syscall.Syscall6(procCM_Get_Device_Interface_List_SizeW.Addr(), 4, uintptr(unsafe.Pointer(len)), uintptr(unsafe.Pointer(interfaceClass)), uintptr(unsafe.Pointer(deviceID)), uintptr(flags), 0, 0)
+ r0, _, _ := syscall.SyscallN(procCM_Get_Device_Interface_List_SizeW.Addr(), uintptr(unsafe.Pointer(len)), uintptr(unsafe.Pointer(interfaceClass)), uintptr(unsafe.Pointer(deviceID)), uintptr(flags))
ret = CONFIGRET(r0)
return
}
func cm_MapCrToWin32Err(configRet CONFIGRET, defaultWin32Error Errno) (ret Errno) {
- r0, _, _ := syscall.Syscall(procCM_MapCrToWin32Err.Addr(), 2, uintptr(configRet), uintptr(defaultWin32Error), 0)
+ r0, _, _ := syscall.SyscallN(procCM_MapCrToWin32Err.Addr(), uintptr(configRet), uintptr(defaultWin32Error))
ret = Errno(r0)
return
}
@@ -574,7 +580,7 @@ func AdjustTokenGroups(token Token, resetToDefault bool, newstate *Tokengroups,
if resetToDefault {
_p0 = 1
}
- r1, _, e1 := syscall.Syscall6(procAdjustTokenGroups.Addr(), 6, uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(newstate)), uintptr(buflen), uintptr(unsafe.Pointer(prevstate)), uintptr(unsafe.Pointer(returnlen)))
+ r1, _, e1 := syscall.SyscallN(procAdjustTokenGroups.Addr(), uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(newstate)), uintptr(buflen), uintptr(unsafe.Pointer(prevstate)), uintptr(unsafe.Pointer(returnlen)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -586,7 +592,7 @@ func AdjustTokenPrivileges(token Token, disableAllPrivileges bool, newstate *Tok
if disableAllPrivileges {
_p0 = 1
}
- r1, _, e1 := syscall.Syscall6(procAdjustTokenPrivileges.Addr(), 6, uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(newstate)), uintptr(buflen), uintptr(unsafe.Pointer(prevstate)), uintptr(unsafe.Pointer(returnlen)))
+ r1, _, e1 := syscall.SyscallN(procAdjustTokenPrivileges.Addr(), uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(newstate)), uintptr(buflen), uintptr(unsafe.Pointer(prevstate)), uintptr(unsafe.Pointer(returnlen)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -594,7 +600,7 @@ func AdjustTokenPrivileges(token Token, disableAllPrivileges bool, newstate *Tok
}
func AllocateAndInitializeSid(identAuth *SidIdentifierAuthority, subAuth byte, subAuth0 uint32, subAuth1 uint32, subAuth2 uint32, subAuth3 uint32, subAuth4 uint32, subAuth5 uint32, subAuth6 uint32, subAuth7 uint32, sid **SID) (err error) {
- r1, _, e1 := syscall.Syscall12(procAllocateAndInitializeSid.Addr(), 11, uintptr(unsafe.Pointer(identAuth)), uintptr(subAuth), uintptr(subAuth0), uintptr(subAuth1), uintptr(subAuth2), uintptr(subAuth3), uintptr(subAuth4), uintptr(subAuth5), uintptr(subAuth6), uintptr(subAuth7), uintptr(unsafe.Pointer(sid)), 0)
+ r1, _, e1 := syscall.SyscallN(procAllocateAndInitializeSid.Addr(), uintptr(unsafe.Pointer(identAuth)), uintptr(subAuth), uintptr(subAuth0), uintptr(subAuth1), uintptr(subAuth2), uintptr(subAuth3), uintptr(subAuth4), uintptr(subAuth5), uintptr(subAuth6), uintptr(subAuth7), uintptr(unsafe.Pointer(sid)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -602,7 +608,7 @@ func AllocateAndInitializeSid(identAuth *SidIdentifierAuthority, subAuth byte, s
}
func buildSecurityDescriptor(owner *TRUSTEE, group *TRUSTEE, countAccessEntries uint32, accessEntries *EXPLICIT_ACCESS, countAuditEntries uint32, auditEntries *EXPLICIT_ACCESS, oldSecurityDescriptor *SECURITY_DESCRIPTOR, sizeNewSecurityDescriptor *uint32, newSecurityDescriptor **SECURITY_DESCRIPTOR) (ret error) {
- r0, _, _ := syscall.Syscall9(procBuildSecurityDescriptorW.Addr(), 9, uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(countAccessEntries), uintptr(unsafe.Pointer(accessEntries)), uintptr(countAuditEntries), uintptr(unsafe.Pointer(auditEntries)), uintptr(unsafe.Pointer(oldSecurityDescriptor)), uintptr(unsafe.Pointer(sizeNewSecurityDescriptor)), uintptr(unsafe.Pointer(newSecurityDescriptor)))
+ r0, _, _ := syscall.SyscallN(procBuildSecurityDescriptorW.Addr(), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(countAccessEntries), uintptr(unsafe.Pointer(accessEntries)), uintptr(countAuditEntries), uintptr(unsafe.Pointer(auditEntries)), uintptr(unsafe.Pointer(oldSecurityDescriptor)), uintptr(unsafe.Pointer(sizeNewSecurityDescriptor)), uintptr(unsafe.Pointer(newSecurityDescriptor)))
if r0 != 0 {
ret = syscall.Errno(r0)
}
@@ -610,7 +616,7 @@ func buildSecurityDescriptor(owner *TRUSTEE, group *TRUSTEE, countAccessEntries
}
func ChangeServiceConfig2(service Handle, infoLevel uint32, info *byte) (err error) {
- r1, _, e1 := syscall.Syscall(procChangeServiceConfig2W.Addr(), 3, uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(info)))
+ r1, _, e1 := syscall.SyscallN(procChangeServiceConfig2W.Addr(), uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(info)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -618,7 +624,7 @@ func ChangeServiceConfig2(service Handle, infoLevel uint32, info *byte) (err err
}
func ChangeServiceConfig(service Handle, serviceType uint32, startType uint32, errorControl uint32, binaryPathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16, displayName *uint16) (err error) {
- r1, _, e1 := syscall.Syscall12(procChangeServiceConfigW.Addr(), 11, uintptr(service), uintptr(serviceType), uintptr(startType), uintptr(errorControl), uintptr(unsafe.Pointer(binaryPathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password)), uintptr(unsafe.Pointer(displayName)), 0)
+ r1, _, e1 := syscall.SyscallN(procChangeServiceConfigW.Addr(), uintptr(service), uintptr(serviceType), uintptr(startType), uintptr(errorControl), uintptr(unsafe.Pointer(binaryPathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password)), uintptr(unsafe.Pointer(displayName)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -626,7 +632,7 @@ func ChangeServiceConfig(service Handle, serviceType uint32, startType uint32, e
}
func checkTokenMembership(tokenHandle Token, sidToCheck *SID, isMember *int32) (err error) {
- r1, _, e1 := syscall.Syscall(procCheckTokenMembership.Addr(), 3, uintptr(tokenHandle), uintptr(unsafe.Pointer(sidToCheck)), uintptr(unsafe.Pointer(isMember)))
+ r1, _, e1 := syscall.SyscallN(procCheckTokenMembership.Addr(), uintptr(tokenHandle), uintptr(unsafe.Pointer(sidToCheck)), uintptr(unsafe.Pointer(isMember)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -634,7 +640,7 @@ func checkTokenMembership(tokenHandle Token, sidToCheck *SID, isMember *int32) (
}
func CloseServiceHandle(handle Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procCloseServiceHandle.Addr(), 1, uintptr(handle), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procCloseServiceHandle.Addr(), uintptr(handle))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -642,7 +648,7 @@ func CloseServiceHandle(handle Handle) (err error) {
}
func ControlService(service Handle, control uint32, status *SERVICE_STATUS) (err error) {
- r1, _, e1 := syscall.Syscall(procControlService.Addr(), 3, uintptr(service), uintptr(control), uintptr(unsafe.Pointer(status)))
+ r1, _, e1 := syscall.SyscallN(procControlService.Addr(), uintptr(service), uintptr(control), uintptr(unsafe.Pointer(status)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -650,7 +656,7 @@ func ControlService(service Handle, control uint32, status *SERVICE_STATUS) (err
}
func convertSecurityDescriptorToStringSecurityDescriptor(sd *SECURITY_DESCRIPTOR, revision uint32, securityInformation SECURITY_INFORMATION, str **uint16, strLen *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procConvertSecurityDescriptorToStringSecurityDescriptorW.Addr(), 5, uintptr(unsafe.Pointer(sd)), uintptr(revision), uintptr(securityInformation), uintptr(unsafe.Pointer(str)), uintptr(unsafe.Pointer(strLen)), 0)
+ r1, _, e1 := syscall.SyscallN(procConvertSecurityDescriptorToStringSecurityDescriptorW.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(revision), uintptr(securityInformation), uintptr(unsafe.Pointer(str)), uintptr(unsafe.Pointer(strLen)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -658,7 +664,7 @@ func convertSecurityDescriptorToStringSecurityDescriptor(sd *SECURITY_DESCRIPTOR
}
func ConvertSidToStringSid(sid *SID, stringSid **uint16) (err error) {
- r1, _, e1 := syscall.Syscall(procConvertSidToStringSidW.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(stringSid)), 0)
+ r1, _, e1 := syscall.SyscallN(procConvertSidToStringSidW.Addr(), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(stringSid)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -675,7 +681,7 @@ func convertStringSecurityDescriptorToSecurityDescriptor(str string, revision ui
}
func _convertStringSecurityDescriptorToSecurityDescriptor(str *uint16, revision uint32, sd **SECURITY_DESCRIPTOR, size *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procConvertStringSecurityDescriptorToSecurityDescriptorW.Addr(), 4, uintptr(unsafe.Pointer(str)), uintptr(revision), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(size)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procConvertStringSecurityDescriptorToSecurityDescriptorW.Addr(), uintptr(unsafe.Pointer(str)), uintptr(revision), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(size)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -683,7 +689,7 @@ func _convertStringSecurityDescriptorToSecurityDescriptor(str *uint16, revision
}
func ConvertStringSidToSid(stringSid *uint16, sid **SID) (err error) {
- r1, _, e1 := syscall.Syscall(procConvertStringSidToSidW.Addr(), 2, uintptr(unsafe.Pointer(stringSid)), uintptr(unsafe.Pointer(sid)), 0)
+ r1, _, e1 := syscall.SyscallN(procConvertStringSidToSidW.Addr(), uintptr(unsafe.Pointer(stringSid)), uintptr(unsafe.Pointer(sid)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -691,7 +697,7 @@ func ConvertStringSidToSid(stringSid *uint16, sid **SID) (err error) {
}
func CopySid(destSidLen uint32, destSid *SID, srcSid *SID) (err error) {
- r1, _, e1 := syscall.Syscall(procCopySid.Addr(), 3, uintptr(destSidLen), uintptr(unsafe.Pointer(destSid)), uintptr(unsafe.Pointer(srcSid)))
+ r1, _, e1 := syscall.SyscallN(procCopySid.Addr(), uintptr(destSidLen), uintptr(unsafe.Pointer(destSid)), uintptr(unsafe.Pointer(srcSid)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -703,7 +709,7 @@ func CreateProcessAsUser(token Token, appName *uint16, commandLine *uint16, proc
if inheritHandles {
_p0 = 1
}
- r1, _, e1 := syscall.Syscall12(procCreateProcessAsUserW.Addr(), 11, uintptr(token), uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo)), 0)
+ r1, _, e1 := syscall.SyscallN(procCreateProcessAsUserW.Addr(), uintptr(token), uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -711,7 +717,7 @@ func CreateProcessAsUser(token Token, appName *uint16, commandLine *uint16, proc
}
func CreateService(mgr Handle, serviceName *uint16, displayName *uint16, access uint32, srvType uint32, startType uint32, errCtl uint32, pathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall15(procCreateServiceW.Addr(), 13, uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(unsafe.Pointer(displayName)), uintptr(access), uintptr(srvType), uintptr(startType), uintptr(errCtl), uintptr(unsafe.Pointer(pathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password)), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procCreateServiceW.Addr(), uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(unsafe.Pointer(displayName)), uintptr(access), uintptr(srvType), uintptr(startType), uintptr(errCtl), uintptr(unsafe.Pointer(pathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password)))
handle = Handle(r0)
if handle == 0 {
err = errnoErr(e1)
@@ -720,7 +726,7 @@ func CreateService(mgr Handle, serviceName *uint16, displayName *uint16, access
}
func createWellKnownSid(sidType WELL_KNOWN_SID_TYPE, domainSid *SID, sid *SID, sizeSid *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procCreateWellKnownSid.Addr(), 4, uintptr(sidType), uintptr(unsafe.Pointer(domainSid)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sizeSid)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procCreateWellKnownSid.Addr(), uintptr(sidType), uintptr(unsafe.Pointer(domainSid)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sizeSid)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -728,7 +734,7 @@ func createWellKnownSid(sidType WELL_KNOWN_SID_TYPE, domainSid *SID, sid *SID, s
}
func CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procCryptAcquireContextW.Addr(), 5, uintptr(unsafe.Pointer(provhandle)), uintptr(unsafe.Pointer(container)), uintptr(unsafe.Pointer(provider)), uintptr(provtype), uintptr(flags), 0)
+ r1, _, e1 := syscall.SyscallN(procCryptAcquireContextW.Addr(), uintptr(unsafe.Pointer(provhandle)), uintptr(unsafe.Pointer(container)), uintptr(unsafe.Pointer(provider)), uintptr(provtype), uintptr(flags))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -736,7 +742,7 @@ func CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16
}
func CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error) {
- r1, _, e1 := syscall.Syscall(procCryptGenRandom.Addr(), 3, uintptr(provhandle), uintptr(buflen), uintptr(unsafe.Pointer(buf)))
+ r1, _, e1 := syscall.SyscallN(procCryptGenRandom.Addr(), uintptr(provhandle), uintptr(buflen), uintptr(unsafe.Pointer(buf)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -744,7 +750,7 @@ func CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error) {
}
func CryptReleaseContext(provhandle Handle, flags uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procCryptReleaseContext.Addr(), 2, uintptr(provhandle), uintptr(flags), 0)
+ r1, _, e1 := syscall.SyscallN(procCryptReleaseContext.Addr(), uintptr(provhandle), uintptr(flags))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -752,7 +758,7 @@ func CryptReleaseContext(provhandle Handle, flags uint32) (err error) {
}
func DeleteService(service Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procDeleteService.Addr(), 1, uintptr(service), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procDeleteService.Addr(), uintptr(service))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -760,7 +766,7 @@ func DeleteService(service Handle) (err error) {
}
func DeregisterEventSource(handle Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procDeregisterEventSource.Addr(), 1, uintptr(handle), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procDeregisterEventSource.Addr(), uintptr(handle))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -768,7 +774,7 @@ func DeregisterEventSource(handle Handle) (err error) {
}
func DuplicateTokenEx(existingToken Token, desiredAccess uint32, tokenAttributes *SecurityAttributes, impersonationLevel uint32, tokenType uint32, newToken *Token) (err error) {
- r1, _, e1 := syscall.Syscall6(procDuplicateTokenEx.Addr(), 6, uintptr(existingToken), uintptr(desiredAccess), uintptr(unsafe.Pointer(tokenAttributes)), uintptr(impersonationLevel), uintptr(tokenType), uintptr(unsafe.Pointer(newToken)))
+ r1, _, e1 := syscall.SyscallN(procDuplicateTokenEx.Addr(), uintptr(existingToken), uintptr(desiredAccess), uintptr(unsafe.Pointer(tokenAttributes)), uintptr(impersonationLevel), uintptr(tokenType), uintptr(unsafe.Pointer(newToken)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -776,7 +782,7 @@ func DuplicateTokenEx(existingToken Token, desiredAccess uint32, tokenAttributes
}
func EnumDependentServices(service Handle, activityState uint32, services *ENUM_SERVICE_STATUS, buffSize uint32, bytesNeeded *uint32, servicesReturned *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procEnumDependentServicesW.Addr(), 6, uintptr(service), uintptr(activityState), uintptr(unsafe.Pointer(services)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), uintptr(unsafe.Pointer(servicesReturned)))
+ r1, _, e1 := syscall.SyscallN(procEnumDependentServicesW.Addr(), uintptr(service), uintptr(activityState), uintptr(unsafe.Pointer(services)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), uintptr(unsafe.Pointer(servicesReturned)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -784,7 +790,7 @@ func EnumDependentServices(service Handle, activityState uint32, services *ENUM_
}
func EnumServicesStatusEx(mgr Handle, infoLevel uint32, serviceType uint32, serviceState uint32, services *byte, bufSize uint32, bytesNeeded *uint32, servicesReturned *uint32, resumeHandle *uint32, groupName *uint16) (err error) {
- r1, _, e1 := syscall.Syscall12(procEnumServicesStatusExW.Addr(), 10, uintptr(mgr), uintptr(infoLevel), uintptr(serviceType), uintptr(serviceState), uintptr(unsafe.Pointer(services)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), uintptr(unsafe.Pointer(servicesReturned)), uintptr(unsafe.Pointer(resumeHandle)), uintptr(unsafe.Pointer(groupName)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procEnumServicesStatusExW.Addr(), uintptr(mgr), uintptr(infoLevel), uintptr(serviceType), uintptr(serviceState), uintptr(unsafe.Pointer(services)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), uintptr(unsafe.Pointer(servicesReturned)), uintptr(unsafe.Pointer(resumeHandle)), uintptr(unsafe.Pointer(groupName)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -792,13 +798,13 @@ func EnumServicesStatusEx(mgr Handle, infoLevel uint32, serviceType uint32, serv
}
func EqualSid(sid1 *SID, sid2 *SID) (isEqual bool) {
- r0, _, _ := syscall.Syscall(procEqualSid.Addr(), 2, uintptr(unsafe.Pointer(sid1)), uintptr(unsafe.Pointer(sid2)), 0)
+ r0, _, _ := syscall.SyscallN(procEqualSid.Addr(), uintptr(unsafe.Pointer(sid1)), uintptr(unsafe.Pointer(sid2)))
isEqual = r0 != 0
return
}
func FreeSid(sid *SID) (err error) {
- r1, _, e1 := syscall.Syscall(procFreeSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procFreeSid.Addr(), uintptr(unsafe.Pointer(sid)))
if r1 != 0 {
err = errnoErr(e1)
}
@@ -806,7 +812,7 @@ func FreeSid(sid *SID) (err error) {
}
func GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (err error) {
- r1, _, e1 := syscall.Syscall(procGetAce.Addr(), 3, uintptr(unsafe.Pointer(acl)), uintptr(aceIndex), uintptr(unsafe.Pointer(pAce)))
+ r1, _, e1 := syscall.SyscallN(procGetAce.Addr(), uintptr(unsafe.Pointer(acl)), uintptr(aceIndex), uintptr(unsafe.Pointer(pAce)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -814,7 +820,7 @@ func GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (err error) {
}
func GetLengthSid(sid *SID) (len uint32) {
- r0, _, _ := syscall.Syscall(procGetLengthSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procGetLengthSid.Addr(), uintptr(unsafe.Pointer(sid)))
len = uint32(r0)
return
}
@@ -829,7 +835,7 @@ func getNamedSecurityInfo(objectName string, objectType SE_OBJECT_TYPE, security
}
func _getNamedSecurityInfo(objectName *uint16, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner **SID, group **SID, dacl **ACL, sacl **ACL, sd **SECURITY_DESCRIPTOR) (ret error) {
- r0, _, _ := syscall.Syscall9(procGetNamedSecurityInfoW.Addr(), 8, uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(sd)), 0)
+ r0, _, _ := syscall.SyscallN(procGetNamedSecurityInfoW.Addr(), uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(sd)))
if r0 != 0 {
ret = syscall.Errno(r0)
}
@@ -837,7 +843,7 @@ func _getNamedSecurityInfo(objectName *uint16, objectType SE_OBJECT_TYPE, securi
}
func getSecurityDescriptorControl(sd *SECURITY_DESCRIPTOR, control *SECURITY_DESCRIPTOR_CONTROL, revision *uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procGetSecurityDescriptorControl.Addr(), 3, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(control)), uintptr(unsafe.Pointer(revision)))
+ r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(control)), uintptr(unsafe.Pointer(revision)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -853,7 +859,7 @@ func getSecurityDescriptorDacl(sd *SECURITY_DESCRIPTOR, daclPresent *bool, dacl
if *daclDefaulted {
_p1 = 1
}
- r1, _, e1 := syscall.Syscall6(procGetSecurityDescriptorDacl.Addr(), 4, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(&_p0)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(&_p1)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorDacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(&_p0)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(&_p1)))
*daclPresent = _p0 != 0
*daclDefaulted = _p1 != 0
if r1 == 0 {
@@ -867,7 +873,7 @@ func getSecurityDescriptorGroup(sd *SECURITY_DESCRIPTOR, group **SID, groupDefau
if *groupDefaulted {
_p0 = 1
}
- r1, _, e1 := syscall.Syscall(procGetSecurityDescriptorGroup.Addr(), 3, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(&_p0)))
+ r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorGroup.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(&_p0)))
*groupDefaulted = _p0 != 0
if r1 == 0 {
err = errnoErr(e1)
@@ -876,7 +882,7 @@ func getSecurityDescriptorGroup(sd *SECURITY_DESCRIPTOR, group **SID, groupDefau
}
func getSecurityDescriptorLength(sd *SECURITY_DESCRIPTOR) (len uint32) {
- r0, _, _ := syscall.Syscall(procGetSecurityDescriptorLength.Addr(), 1, uintptr(unsafe.Pointer(sd)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procGetSecurityDescriptorLength.Addr(), uintptr(unsafe.Pointer(sd)))
len = uint32(r0)
return
}
@@ -886,7 +892,7 @@ func getSecurityDescriptorOwner(sd *SECURITY_DESCRIPTOR, owner **SID, ownerDefau
if *ownerDefaulted {
_p0 = 1
}
- r1, _, e1 := syscall.Syscall(procGetSecurityDescriptorOwner.Addr(), 3, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(&_p0)))
+ r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorOwner.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(&_p0)))
*ownerDefaulted = _p0 != 0
if r1 == 0 {
err = errnoErr(e1)
@@ -895,7 +901,7 @@ func getSecurityDescriptorOwner(sd *SECURITY_DESCRIPTOR, owner **SID, ownerDefau
}
func getSecurityDescriptorRMControl(sd *SECURITY_DESCRIPTOR, rmControl *uint8) (ret error) {
- r0, _, _ := syscall.Syscall(procGetSecurityDescriptorRMControl.Addr(), 2, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(rmControl)), 0)
+ r0, _, _ := syscall.SyscallN(procGetSecurityDescriptorRMControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(rmControl)))
if r0 != 0 {
ret = syscall.Errno(r0)
}
@@ -911,7 +917,7 @@ func getSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent *bool, sacl
if *saclDefaulted {
_p1 = 1
}
- r1, _, e1 := syscall.Syscall6(procGetSecurityDescriptorSacl.Addr(), 4, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(&_p0)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(&_p1)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorSacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(&_p0)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(&_p1)))
*saclPresent = _p0 != 0
*saclDefaulted = _p1 != 0
if r1 == 0 {
@@ -921,7 +927,7 @@ func getSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent *bool, sacl
}
func getSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner **SID, group **SID, dacl **ACL, sacl **ACL, sd **SECURITY_DESCRIPTOR) (ret error) {
- r0, _, _ := syscall.Syscall9(procGetSecurityInfo.Addr(), 8, uintptr(handle), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(sd)), 0)
+ r0, _, _ := syscall.SyscallN(procGetSecurityInfo.Addr(), uintptr(handle), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(sd)))
if r0 != 0 {
ret = syscall.Errno(r0)
}
@@ -929,25 +935,25 @@ func getSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformati
}
func getSidIdentifierAuthority(sid *SID) (authority *SidIdentifierAuthority) {
- r0, _, _ := syscall.Syscall(procGetSidIdentifierAuthority.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procGetSidIdentifierAuthority.Addr(), uintptr(unsafe.Pointer(sid)))
authority = (*SidIdentifierAuthority)(unsafe.Pointer(r0))
return
}
func getSidSubAuthority(sid *SID, index uint32) (subAuthority *uint32) {
- r0, _, _ := syscall.Syscall(procGetSidSubAuthority.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(index), 0)
+ r0, _, _ := syscall.SyscallN(procGetSidSubAuthority.Addr(), uintptr(unsafe.Pointer(sid)), uintptr(index))
subAuthority = (*uint32)(unsafe.Pointer(r0))
return
}
func getSidSubAuthorityCount(sid *SID) (count *uint8) {
- r0, _, _ := syscall.Syscall(procGetSidSubAuthorityCount.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procGetSidSubAuthorityCount.Addr(), uintptr(unsafe.Pointer(sid)))
count = (*uint8)(unsafe.Pointer(r0))
return
}
func GetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint32, returnedLen *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procGetTokenInformation.Addr(), 5, uintptr(token), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen), uintptr(unsafe.Pointer(returnedLen)), 0)
+ r1, _, e1 := syscall.SyscallN(procGetTokenInformation.Addr(), uintptr(token), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen), uintptr(unsafe.Pointer(returnedLen)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -955,7 +961,7 @@ func GetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint
}
func ImpersonateSelf(impersonationlevel uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procImpersonateSelf.Addr(), 1, uintptr(impersonationlevel), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procImpersonateSelf.Addr(), uintptr(impersonationlevel))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -963,7 +969,7 @@ func ImpersonateSelf(impersonationlevel uint32) (err error) {
}
func initializeSecurityDescriptor(absoluteSD *SECURITY_DESCRIPTOR, revision uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procInitializeSecurityDescriptor.Addr(), 2, uintptr(unsafe.Pointer(absoluteSD)), uintptr(revision), 0)
+ r1, _, e1 := syscall.SyscallN(procInitializeSecurityDescriptor.Addr(), uintptr(unsafe.Pointer(absoluteSD)), uintptr(revision))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -979,7 +985,7 @@ func InitiateSystemShutdownEx(machineName *uint16, message *uint16, timeout uint
if rebootAfterShutdown {
_p1 = 1
}
- r1, _, e1 := syscall.Syscall6(procInitiateSystemShutdownExW.Addr(), 6, uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(message)), uintptr(timeout), uintptr(_p0), uintptr(_p1), uintptr(reason))
+ r1, _, e1 := syscall.SyscallN(procInitiateSystemShutdownExW.Addr(), uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(message)), uintptr(timeout), uintptr(_p0), uintptr(_p1), uintptr(reason))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -987,7 +993,7 @@ func InitiateSystemShutdownEx(machineName *uint16, message *uint16, timeout uint
}
func isTokenRestricted(tokenHandle Token) (ret bool, err error) {
- r0, _, e1 := syscall.Syscall(procIsTokenRestricted.Addr(), 1, uintptr(tokenHandle), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procIsTokenRestricted.Addr(), uintptr(tokenHandle))
ret = r0 != 0
if !ret {
err = errnoErr(e1)
@@ -996,25 +1002,25 @@ func isTokenRestricted(tokenHandle Token) (ret bool, err error) {
}
func isValidSecurityDescriptor(sd *SECURITY_DESCRIPTOR) (isValid bool) {
- r0, _, _ := syscall.Syscall(procIsValidSecurityDescriptor.Addr(), 1, uintptr(unsafe.Pointer(sd)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procIsValidSecurityDescriptor.Addr(), uintptr(unsafe.Pointer(sd)))
isValid = r0 != 0
return
}
func isValidSid(sid *SID) (isValid bool) {
- r0, _, _ := syscall.Syscall(procIsValidSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procIsValidSid.Addr(), uintptr(unsafe.Pointer(sid)))
isValid = r0 != 0
return
}
func isWellKnownSid(sid *SID, sidType WELL_KNOWN_SID_TYPE) (isWellKnown bool) {
- r0, _, _ := syscall.Syscall(procIsWellKnownSid.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(sidType), 0)
+ r0, _, _ := syscall.SyscallN(procIsWellKnownSid.Addr(), uintptr(unsafe.Pointer(sid)), uintptr(sidType))
isWellKnown = r0 != 0
return
}
func LookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) {
- r1, _, e1 := syscall.Syscall9(procLookupAccountNameW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procLookupAccountNameW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1022,7 +1028,7 @@ func LookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen
}
func LookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) {
- r1, _, e1 := syscall.Syscall9(procLookupAccountSidW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procLookupAccountSidW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1030,7 +1036,7 @@ func LookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint3
}
func LookupPrivilegeValue(systemname *uint16, name *uint16, luid *LUID) (err error) {
- r1, _, e1 := syscall.Syscall(procLookupPrivilegeValueW.Addr(), 3, uintptr(unsafe.Pointer(systemname)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(luid)))
+ r1, _, e1 := syscall.SyscallN(procLookupPrivilegeValueW.Addr(), uintptr(unsafe.Pointer(systemname)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(luid)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1038,7 +1044,7 @@ func LookupPrivilegeValue(systemname *uint16, name *uint16, luid *LUID) (err err
}
func makeAbsoluteSD(selfRelativeSD *SECURITY_DESCRIPTOR, absoluteSD *SECURITY_DESCRIPTOR, absoluteSDSize *uint32, dacl *ACL, daclSize *uint32, sacl *ACL, saclSize *uint32, owner *SID, ownerSize *uint32, group *SID, groupSize *uint32) (err error) {
- r1, _, e1 := syscall.Syscall12(procMakeAbsoluteSD.Addr(), 11, uintptr(unsafe.Pointer(selfRelativeSD)), uintptr(unsafe.Pointer(absoluteSD)), uintptr(unsafe.Pointer(absoluteSDSize)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(daclSize)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(saclSize)), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(ownerSize)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(groupSize)), 0)
+ r1, _, e1 := syscall.SyscallN(procMakeAbsoluteSD.Addr(), uintptr(unsafe.Pointer(selfRelativeSD)), uintptr(unsafe.Pointer(absoluteSD)), uintptr(unsafe.Pointer(absoluteSDSize)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(daclSize)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(saclSize)), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(ownerSize)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(groupSize)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1046,7 +1052,7 @@ func makeAbsoluteSD(selfRelativeSD *SECURITY_DESCRIPTOR, absoluteSD *SECURITY_DE
}
func makeSelfRelativeSD(absoluteSD *SECURITY_DESCRIPTOR, selfRelativeSD *SECURITY_DESCRIPTOR, selfRelativeSDSize *uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procMakeSelfRelativeSD.Addr(), 3, uintptr(unsafe.Pointer(absoluteSD)), uintptr(unsafe.Pointer(selfRelativeSD)), uintptr(unsafe.Pointer(selfRelativeSDSize)))
+ r1, _, e1 := syscall.SyscallN(procMakeSelfRelativeSD.Addr(), uintptr(unsafe.Pointer(absoluteSD)), uintptr(unsafe.Pointer(selfRelativeSD)), uintptr(unsafe.Pointer(selfRelativeSDSize)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1054,7 +1060,7 @@ func makeSelfRelativeSD(absoluteSD *SECURITY_DESCRIPTOR, selfRelativeSD *SECURIT
}
func NotifyServiceStatusChange(service Handle, notifyMask uint32, notifier *SERVICE_NOTIFY) (ret error) {
- r0, _, _ := syscall.Syscall(procNotifyServiceStatusChangeW.Addr(), 3, uintptr(service), uintptr(notifyMask), uintptr(unsafe.Pointer(notifier)))
+ r0, _, _ := syscall.SyscallN(procNotifyServiceStatusChangeW.Addr(), uintptr(service), uintptr(notifyMask), uintptr(unsafe.Pointer(notifier)))
if r0 != 0 {
ret = syscall.Errno(r0)
}
@@ -1062,7 +1068,7 @@ func NotifyServiceStatusChange(service Handle, notifyMask uint32, notifier *SERV
}
func OpenProcessToken(process Handle, access uint32, token *Token) (err error) {
- r1, _, e1 := syscall.Syscall(procOpenProcessToken.Addr(), 3, uintptr(process), uintptr(access), uintptr(unsafe.Pointer(token)))
+ r1, _, e1 := syscall.SyscallN(procOpenProcessToken.Addr(), uintptr(process), uintptr(access), uintptr(unsafe.Pointer(token)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1070,7 +1076,7 @@ func OpenProcessToken(process Handle, access uint32, token *Token) (err error) {
}
func OpenSCManager(machineName *uint16, databaseName *uint16, access uint32) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall(procOpenSCManagerW.Addr(), 3, uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(databaseName)), uintptr(access))
+ r0, _, e1 := syscall.SyscallN(procOpenSCManagerW.Addr(), uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(databaseName)), uintptr(access))
handle = Handle(r0)
if handle == 0 {
err = errnoErr(e1)
@@ -1079,7 +1085,7 @@ func OpenSCManager(machineName *uint16, databaseName *uint16, access uint32) (ha
}
func OpenService(mgr Handle, serviceName *uint16, access uint32) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall(procOpenServiceW.Addr(), 3, uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(access))
+ r0, _, e1 := syscall.SyscallN(procOpenServiceW.Addr(), uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(access))
handle = Handle(r0)
if handle == 0 {
err = errnoErr(e1)
@@ -1092,7 +1098,7 @@ func OpenThreadToken(thread Handle, access uint32, openAsSelf bool, token *Token
if openAsSelf {
_p0 = 1
}
- r1, _, e1 := syscall.Syscall6(procOpenThreadToken.Addr(), 4, uintptr(thread), uintptr(access), uintptr(_p0), uintptr(unsafe.Pointer(token)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procOpenThreadToken.Addr(), uintptr(thread), uintptr(access), uintptr(_p0), uintptr(unsafe.Pointer(token)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1100,7 +1106,7 @@ func OpenThreadToken(thread Handle, access uint32, openAsSelf bool, token *Token
}
func QueryServiceConfig2(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procQueryServiceConfig2W.Addr(), 5, uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), 0)
+ r1, _, e1 := syscall.SyscallN(procQueryServiceConfig2W.Addr(), uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1108,7 +1114,7 @@ func QueryServiceConfig2(service Handle, infoLevel uint32, buff *byte, buffSize
}
func QueryServiceConfig(service Handle, serviceConfig *QUERY_SERVICE_CONFIG, bufSize uint32, bytesNeeded *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procQueryServiceConfigW.Addr(), 4, uintptr(service), uintptr(unsafe.Pointer(serviceConfig)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procQueryServiceConfigW.Addr(), uintptr(service), uintptr(unsafe.Pointer(serviceConfig)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1120,7 +1126,7 @@ func QueryServiceDynamicInformation(service Handle, infoLevel uint32, dynamicInf
if err != nil {
return
}
- r1, _, e1 := syscall.Syscall(procQueryServiceDynamicInformation.Addr(), 3, uintptr(service), uintptr(infoLevel), uintptr(dynamicInfo))
+ r1, _, e1 := syscall.SyscallN(procQueryServiceDynamicInformation.Addr(), uintptr(service), uintptr(infoLevel), uintptr(dynamicInfo))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1128,7 +1134,7 @@ func QueryServiceDynamicInformation(service Handle, infoLevel uint32, dynamicInf
}
func QueryServiceLockStatus(mgr Handle, lockStatus *QUERY_SERVICE_LOCK_STATUS, bufSize uint32, bytesNeeded *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procQueryServiceLockStatusW.Addr(), 4, uintptr(mgr), uintptr(unsafe.Pointer(lockStatus)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procQueryServiceLockStatusW.Addr(), uintptr(mgr), uintptr(unsafe.Pointer(lockStatus)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1136,7 +1142,7 @@ func QueryServiceLockStatus(mgr Handle, lockStatus *QUERY_SERVICE_LOCK_STATUS, b
}
func QueryServiceStatus(service Handle, status *SERVICE_STATUS) (err error) {
- r1, _, e1 := syscall.Syscall(procQueryServiceStatus.Addr(), 2, uintptr(service), uintptr(unsafe.Pointer(status)), 0)
+ r1, _, e1 := syscall.SyscallN(procQueryServiceStatus.Addr(), uintptr(service), uintptr(unsafe.Pointer(status)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1144,7 +1150,7 @@ func QueryServiceStatus(service Handle, status *SERVICE_STATUS) (err error) {
}
func QueryServiceStatusEx(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procQueryServiceStatusEx.Addr(), 5, uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), 0)
+ r1, _, e1 := syscall.SyscallN(procQueryServiceStatusEx.Addr(), uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1152,7 +1158,7 @@ func QueryServiceStatusEx(service Handle, infoLevel uint32, buff *byte, buffSize
}
func RegCloseKey(key Handle) (regerrno error) {
- r0, _, _ := syscall.Syscall(procRegCloseKey.Addr(), 1, uintptr(key), 0, 0)
+ r0, _, _ := syscall.SyscallN(procRegCloseKey.Addr(), uintptr(key))
if r0 != 0 {
regerrno = syscall.Errno(r0)
}
@@ -1160,7 +1166,7 @@ func RegCloseKey(key Handle) (regerrno error) {
}
func RegEnumKeyEx(key Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, class *uint16, classLen *uint32, lastWriteTime *Filetime) (regerrno error) {
- r0, _, _ := syscall.Syscall9(procRegEnumKeyExW.Addr(), 8, uintptr(key), uintptr(index), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(lastWriteTime)), 0)
+ r0, _, _ := syscall.SyscallN(procRegEnumKeyExW.Addr(), uintptr(key), uintptr(index), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(lastWriteTime)))
if r0 != 0 {
regerrno = syscall.Errno(r0)
}
@@ -1176,7 +1182,7 @@ func RegNotifyChangeKeyValue(key Handle, watchSubtree bool, notifyFilter uint32,
if asynchronous {
_p1 = 1
}
- r0, _, _ := syscall.Syscall6(procRegNotifyChangeKeyValue.Addr(), 5, uintptr(key), uintptr(_p0), uintptr(notifyFilter), uintptr(event), uintptr(_p1), 0)
+ r0, _, _ := syscall.SyscallN(procRegNotifyChangeKeyValue.Addr(), uintptr(key), uintptr(_p0), uintptr(notifyFilter), uintptr(event), uintptr(_p1))
if r0 != 0 {
regerrno = syscall.Errno(r0)
}
@@ -1184,7 +1190,7 @@ func RegNotifyChangeKeyValue(key Handle, watchSubtree bool, notifyFilter uint32,
}
func RegOpenKeyEx(key Handle, subkey *uint16, options uint32, desiredAccess uint32, result *Handle) (regerrno error) {
- r0, _, _ := syscall.Syscall6(procRegOpenKeyExW.Addr(), 5, uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(options), uintptr(desiredAccess), uintptr(unsafe.Pointer(result)), 0)
+ r0, _, _ := syscall.SyscallN(procRegOpenKeyExW.Addr(), uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(options), uintptr(desiredAccess), uintptr(unsafe.Pointer(result)))
if r0 != 0 {
regerrno = syscall.Errno(r0)
}
@@ -1192,7 +1198,7 @@ func RegOpenKeyEx(key Handle, subkey *uint16, options uint32, desiredAccess uint
}
func RegQueryInfoKey(key Handle, class *uint16, classLen *uint32, reserved *uint32, subkeysLen *uint32, maxSubkeyLen *uint32, maxClassLen *uint32, valuesLen *uint32, maxValueNameLen *uint32, maxValueLen *uint32, saLen *uint32, lastWriteTime *Filetime) (regerrno error) {
- r0, _, _ := syscall.Syscall12(procRegQueryInfoKeyW.Addr(), 12, uintptr(key), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(subkeysLen)), uintptr(unsafe.Pointer(maxSubkeyLen)), uintptr(unsafe.Pointer(maxClassLen)), uintptr(unsafe.Pointer(valuesLen)), uintptr(unsafe.Pointer(maxValueNameLen)), uintptr(unsafe.Pointer(maxValueLen)), uintptr(unsafe.Pointer(saLen)), uintptr(unsafe.Pointer(lastWriteTime)))
+ r0, _, _ := syscall.SyscallN(procRegQueryInfoKeyW.Addr(), uintptr(key), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(subkeysLen)), uintptr(unsafe.Pointer(maxSubkeyLen)), uintptr(unsafe.Pointer(maxClassLen)), uintptr(unsafe.Pointer(valuesLen)), uintptr(unsafe.Pointer(maxValueNameLen)), uintptr(unsafe.Pointer(maxValueLen)), uintptr(unsafe.Pointer(saLen)), uintptr(unsafe.Pointer(lastWriteTime)))
if r0 != 0 {
regerrno = syscall.Errno(r0)
}
@@ -1200,7 +1206,7 @@ func RegQueryInfoKey(key Handle, class *uint16, classLen *uint32, reserved *uint
}
func RegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) {
- r0, _, _ := syscall.Syscall6(procRegQueryValueExW.Addr(), 6, uintptr(key), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(valtype)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(buflen)))
+ r0, _, _ := syscall.SyscallN(procRegQueryValueExW.Addr(), uintptr(key), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(valtype)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(buflen)))
if r0 != 0 {
regerrno = syscall.Errno(r0)
}
@@ -1208,7 +1214,7 @@ func RegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32
}
func RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall(procRegisterEventSourceW.Addr(), 2, uintptr(unsafe.Pointer(uncServerName)), uintptr(unsafe.Pointer(sourceName)), 0)
+ r0, _, e1 := syscall.SyscallN(procRegisterEventSourceW.Addr(), uintptr(unsafe.Pointer(uncServerName)), uintptr(unsafe.Pointer(sourceName)))
handle = Handle(r0)
if handle == 0 {
err = errnoErr(e1)
@@ -1217,7 +1223,7 @@ func RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Hand
}
func RegisterServiceCtrlHandlerEx(serviceName *uint16, handlerProc uintptr, context uintptr) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall(procRegisterServiceCtrlHandlerExW.Addr(), 3, uintptr(unsafe.Pointer(serviceName)), uintptr(handlerProc), uintptr(context))
+ r0, _, e1 := syscall.SyscallN(procRegisterServiceCtrlHandlerExW.Addr(), uintptr(unsafe.Pointer(serviceName)), uintptr(handlerProc), uintptr(context))
handle = Handle(r0)
if handle == 0 {
err = errnoErr(e1)
@@ -1226,7 +1232,7 @@ func RegisterServiceCtrlHandlerEx(serviceName *uint16, handlerProc uintptr, cont
}
func ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) {
- r1, _, e1 := syscall.Syscall9(procReportEventW.Addr(), 9, uintptr(log), uintptr(etype), uintptr(category), uintptr(eventId), uintptr(usrSId), uintptr(numStrings), uintptr(dataSize), uintptr(unsafe.Pointer(strings)), uintptr(unsafe.Pointer(rawData)))
+ r1, _, e1 := syscall.SyscallN(procReportEventW.Addr(), uintptr(log), uintptr(etype), uintptr(category), uintptr(eventId), uintptr(usrSId), uintptr(numStrings), uintptr(dataSize), uintptr(unsafe.Pointer(strings)), uintptr(unsafe.Pointer(rawData)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1234,7 +1240,7 @@ func ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrS
}
func RevertToSelf() (err error) {
- r1, _, e1 := syscall.Syscall(procRevertToSelf.Addr(), 0, 0, 0, 0)
+ r1, _, e1 := syscall.SyscallN(procRevertToSelf.Addr())
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1242,7 +1248,7 @@ func RevertToSelf() (err error) {
}
func setEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCESS, oldACL *ACL, newACL **ACL) (ret error) {
- r0, _, _ := syscall.Syscall6(procSetEntriesInAclW.Addr(), 4, uintptr(countExplicitEntries), uintptr(unsafe.Pointer(explicitEntries)), uintptr(unsafe.Pointer(oldACL)), uintptr(unsafe.Pointer(newACL)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procSetEntriesInAclW.Addr(), uintptr(countExplicitEntries), uintptr(unsafe.Pointer(explicitEntries)), uintptr(unsafe.Pointer(oldACL)), uintptr(unsafe.Pointer(newACL)))
if r0 != 0 {
ret = syscall.Errno(r0)
}
@@ -1250,7 +1256,7 @@ func setEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCE
}
func SetKernelObjectSecurity(handle Handle, securityInformation SECURITY_INFORMATION, securityDescriptor *SECURITY_DESCRIPTOR) (err error) {
- r1, _, e1 := syscall.Syscall(procSetKernelObjectSecurity.Addr(), 3, uintptr(handle), uintptr(securityInformation), uintptr(unsafe.Pointer(securityDescriptor)))
+ r1, _, e1 := syscall.SyscallN(procSetKernelObjectSecurity.Addr(), uintptr(handle), uintptr(securityInformation), uintptr(unsafe.Pointer(securityDescriptor)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1267,7 +1273,7 @@ func SetNamedSecurityInfo(objectName string, objectType SE_OBJECT_TYPE, security
}
func _SetNamedSecurityInfo(objectName *uint16, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner *SID, group *SID, dacl *ACL, sacl *ACL) (ret error) {
- r0, _, _ := syscall.Syscall9(procSetNamedSecurityInfoW.Addr(), 7, uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procSetNamedSecurityInfoW.Addr(), uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)))
if r0 != 0 {
ret = syscall.Errno(r0)
}
@@ -1275,7 +1281,7 @@ func _SetNamedSecurityInfo(objectName *uint16, objectType SE_OBJECT_TYPE, securi
}
func setSecurityDescriptorControl(sd *SECURITY_DESCRIPTOR, controlBitsOfInterest SECURITY_DESCRIPTOR_CONTROL, controlBitsToSet SECURITY_DESCRIPTOR_CONTROL) (err error) {
- r1, _, e1 := syscall.Syscall(procSetSecurityDescriptorControl.Addr(), 3, uintptr(unsafe.Pointer(sd)), uintptr(controlBitsOfInterest), uintptr(controlBitsToSet))
+ r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(controlBitsOfInterest), uintptr(controlBitsToSet))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1291,7 +1297,7 @@ func setSecurityDescriptorDacl(sd *SECURITY_DESCRIPTOR, daclPresent bool, dacl *
if daclDefaulted {
_p1 = 1
}
- r1, _, e1 := syscall.Syscall6(procSetSecurityDescriptorDacl.Addr(), 4, uintptr(unsafe.Pointer(sd)), uintptr(_p0), uintptr(unsafe.Pointer(dacl)), uintptr(_p1), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorDacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(_p0), uintptr(unsafe.Pointer(dacl)), uintptr(_p1))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1303,7 +1309,7 @@ func setSecurityDescriptorGroup(sd *SECURITY_DESCRIPTOR, group *SID, groupDefaul
if groupDefaulted {
_p0 = 1
}
- r1, _, e1 := syscall.Syscall(procSetSecurityDescriptorGroup.Addr(), 3, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(group)), uintptr(_p0))
+ r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorGroup.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(group)), uintptr(_p0))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1315,7 +1321,7 @@ func setSecurityDescriptorOwner(sd *SECURITY_DESCRIPTOR, owner *SID, ownerDefaul
if ownerDefaulted {
_p0 = 1
}
- r1, _, e1 := syscall.Syscall(procSetSecurityDescriptorOwner.Addr(), 3, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(owner)), uintptr(_p0))
+ r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorOwner.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(owner)), uintptr(_p0))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1323,7 +1329,7 @@ func setSecurityDescriptorOwner(sd *SECURITY_DESCRIPTOR, owner *SID, ownerDefaul
}
func setSecurityDescriptorRMControl(sd *SECURITY_DESCRIPTOR, rmControl *uint8) {
- syscall.Syscall(procSetSecurityDescriptorRMControl.Addr(), 2, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(rmControl)), 0)
+ syscall.SyscallN(procSetSecurityDescriptorRMControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(rmControl)))
return
}
@@ -1336,7 +1342,7 @@ func setSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent bool, sacl *
if saclDefaulted {
_p1 = 1
}
- r1, _, e1 := syscall.Syscall6(procSetSecurityDescriptorSacl.Addr(), 4, uintptr(unsafe.Pointer(sd)), uintptr(_p0), uintptr(unsafe.Pointer(sacl)), uintptr(_p1), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorSacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(_p0), uintptr(unsafe.Pointer(sacl)), uintptr(_p1))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1344,7 +1350,7 @@ func setSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent bool, sacl *
}
func SetSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner *SID, group *SID, dacl *ACL, sacl *ACL) (ret error) {
- r0, _, _ := syscall.Syscall9(procSetSecurityInfo.Addr(), 7, uintptr(handle), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procSetSecurityInfo.Addr(), uintptr(handle), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)))
if r0 != 0 {
ret = syscall.Errno(r0)
}
@@ -1352,7 +1358,7 @@ func SetSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformati
}
func SetServiceStatus(service Handle, serviceStatus *SERVICE_STATUS) (err error) {
- r1, _, e1 := syscall.Syscall(procSetServiceStatus.Addr(), 2, uintptr(service), uintptr(unsafe.Pointer(serviceStatus)), 0)
+ r1, _, e1 := syscall.SyscallN(procSetServiceStatus.Addr(), uintptr(service), uintptr(unsafe.Pointer(serviceStatus)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1360,7 +1366,7 @@ func SetServiceStatus(service Handle, serviceStatus *SERVICE_STATUS) (err error)
}
func SetThreadToken(thread *Handle, token Token) (err error) {
- r1, _, e1 := syscall.Syscall(procSetThreadToken.Addr(), 2, uintptr(unsafe.Pointer(thread)), uintptr(token), 0)
+ r1, _, e1 := syscall.SyscallN(procSetThreadToken.Addr(), uintptr(unsafe.Pointer(thread)), uintptr(token))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1368,7 +1374,7 @@ func SetThreadToken(thread *Handle, token Token) (err error) {
}
func SetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procSetTokenInformation.Addr(), 4, uintptr(token), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procSetTokenInformation.Addr(), uintptr(token), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1376,7 +1382,7 @@ func SetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint
}
func StartServiceCtrlDispatcher(serviceTable *SERVICE_TABLE_ENTRY) (err error) {
- r1, _, e1 := syscall.Syscall(procStartServiceCtrlDispatcherW.Addr(), 1, uintptr(unsafe.Pointer(serviceTable)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procStartServiceCtrlDispatcherW.Addr(), uintptr(unsafe.Pointer(serviceTable)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1384,7 +1390,7 @@ func StartServiceCtrlDispatcher(serviceTable *SERVICE_TABLE_ENTRY) (err error) {
}
func StartService(service Handle, numArgs uint32, argVectors **uint16) (err error) {
- r1, _, e1 := syscall.Syscall(procStartServiceW.Addr(), 3, uintptr(service), uintptr(numArgs), uintptr(unsafe.Pointer(argVectors)))
+ r1, _, e1 := syscall.SyscallN(procStartServiceW.Addr(), uintptr(service), uintptr(numArgs), uintptr(unsafe.Pointer(argVectors)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1392,7 +1398,7 @@ func StartService(service Handle, numArgs uint32, argVectors **uint16) (err erro
}
func CertAddCertificateContextToStore(store Handle, certContext *CertContext, addDisposition uint32, storeContext **CertContext) (err error) {
- r1, _, e1 := syscall.Syscall6(procCertAddCertificateContextToStore.Addr(), 4, uintptr(store), uintptr(unsafe.Pointer(certContext)), uintptr(addDisposition), uintptr(unsafe.Pointer(storeContext)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procCertAddCertificateContextToStore.Addr(), uintptr(store), uintptr(unsafe.Pointer(certContext)), uintptr(addDisposition), uintptr(unsafe.Pointer(storeContext)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1400,7 +1406,7 @@ func CertAddCertificateContextToStore(store Handle, certContext *CertContext, ad
}
func CertCloseStore(store Handle, flags uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procCertCloseStore.Addr(), 2, uintptr(store), uintptr(flags), 0)
+ r1, _, e1 := syscall.SyscallN(procCertCloseStore.Addr(), uintptr(store), uintptr(flags))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1408,7 +1414,7 @@ func CertCloseStore(store Handle, flags uint32) (err error) {
}
func CertCreateCertificateContext(certEncodingType uint32, certEncoded *byte, encodedLen uint32) (context *CertContext, err error) {
- r0, _, e1 := syscall.Syscall(procCertCreateCertificateContext.Addr(), 3, uintptr(certEncodingType), uintptr(unsafe.Pointer(certEncoded)), uintptr(encodedLen))
+ r0, _, e1 := syscall.SyscallN(procCertCreateCertificateContext.Addr(), uintptr(certEncodingType), uintptr(unsafe.Pointer(certEncoded)), uintptr(encodedLen))
context = (*CertContext)(unsafe.Pointer(r0))
if context == nil {
err = errnoErr(e1)
@@ -1417,7 +1423,7 @@ func CertCreateCertificateContext(certEncodingType uint32, certEncoded *byte, en
}
func CertDeleteCertificateFromStore(certContext *CertContext) (err error) {
- r1, _, e1 := syscall.Syscall(procCertDeleteCertificateFromStore.Addr(), 1, uintptr(unsafe.Pointer(certContext)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procCertDeleteCertificateFromStore.Addr(), uintptr(unsafe.Pointer(certContext)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1425,13 +1431,13 @@ func CertDeleteCertificateFromStore(certContext *CertContext) (err error) {
}
func CertDuplicateCertificateContext(certContext *CertContext) (dupContext *CertContext) {
- r0, _, _ := syscall.Syscall(procCertDuplicateCertificateContext.Addr(), 1, uintptr(unsafe.Pointer(certContext)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procCertDuplicateCertificateContext.Addr(), uintptr(unsafe.Pointer(certContext)))
dupContext = (*CertContext)(unsafe.Pointer(r0))
return
}
func CertEnumCertificatesInStore(store Handle, prevContext *CertContext) (context *CertContext, err error) {
- r0, _, e1 := syscall.Syscall(procCertEnumCertificatesInStore.Addr(), 2, uintptr(store), uintptr(unsafe.Pointer(prevContext)), 0)
+ r0, _, e1 := syscall.SyscallN(procCertEnumCertificatesInStore.Addr(), uintptr(store), uintptr(unsafe.Pointer(prevContext)))
context = (*CertContext)(unsafe.Pointer(r0))
if context == nil {
err = errnoErr(e1)
@@ -1440,7 +1446,7 @@ func CertEnumCertificatesInStore(store Handle, prevContext *CertContext) (contex
}
func CertFindCertificateInStore(store Handle, certEncodingType uint32, findFlags uint32, findType uint32, findPara unsafe.Pointer, prevCertContext *CertContext) (cert *CertContext, err error) {
- r0, _, e1 := syscall.Syscall6(procCertFindCertificateInStore.Addr(), 6, uintptr(store), uintptr(certEncodingType), uintptr(findFlags), uintptr(findType), uintptr(findPara), uintptr(unsafe.Pointer(prevCertContext)))
+ r0, _, e1 := syscall.SyscallN(procCertFindCertificateInStore.Addr(), uintptr(store), uintptr(certEncodingType), uintptr(findFlags), uintptr(findType), uintptr(findPara), uintptr(unsafe.Pointer(prevCertContext)))
cert = (*CertContext)(unsafe.Pointer(r0))
if cert == nil {
err = errnoErr(e1)
@@ -1449,7 +1455,7 @@ func CertFindCertificateInStore(store Handle, certEncodingType uint32, findFlags
}
func CertFindChainInStore(store Handle, certEncodingType uint32, findFlags uint32, findType uint32, findPara unsafe.Pointer, prevChainContext *CertChainContext) (certchain *CertChainContext, err error) {
- r0, _, e1 := syscall.Syscall6(procCertFindChainInStore.Addr(), 6, uintptr(store), uintptr(certEncodingType), uintptr(findFlags), uintptr(findType), uintptr(findPara), uintptr(unsafe.Pointer(prevChainContext)))
+ r0, _, e1 := syscall.SyscallN(procCertFindChainInStore.Addr(), uintptr(store), uintptr(certEncodingType), uintptr(findFlags), uintptr(findType), uintptr(findPara), uintptr(unsafe.Pointer(prevChainContext)))
certchain = (*CertChainContext)(unsafe.Pointer(r0))
if certchain == nil {
err = errnoErr(e1)
@@ -1458,18 +1464,18 @@ func CertFindChainInStore(store Handle, certEncodingType uint32, findFlags uint3
}
func CertFindExtension(objId *byte, countExtensions uint32, extensions *CertExtension) (ret *CertExtension) {
- r0, _, _ := syscall.Syscall(procCertFindExtension.Addr(), 3, uintptr(unsafe.Pointer(objId)), uintptr(countExtensions), uintptr(unsafe.Pointer(extensions)))
+ r0, _, _ := syscall.SyscallN(procCertFindExtension.Addr(), uintptr(unsafe.Pointer(objId)), uintptr(countExtensions), uintptr(unsafe.Pointer(extensions)))
ret = (*CertExtension)(unsafe.Pointer(r0))
return
}
func CertFreeCertificateChain(ctx *CertChainContext) {
- syscall.Syscall(procCertFreeCertificateChain.Addr(), 1, uintptr(unsafe.Pointer(ctx)), 0, 0)
+ syscall.SyscallN(procCertFreeCertificateChain.Addr(), uintptr(unsafe.Pointer(ctx)))
return
}
func CertFreeCertificateContext(ctx *CertContext) (err error) {
- r1, _, e1 := syscall.Syscall(procCertFreeCertificateContext.Addr(), 1, uintptr(unsafe.Pointer(ctx)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procCertFreeCertificateContext.Addr(), uintptr(unsafe.Pointer(ctx)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1477,7 +1483,7 @@ func CertFreeCertificateContext(ctx *CertContext) (err error) {
}
func CertGetCertificateChain(engine Handle, leaf *CertContext, time *Filetime, additionalStore Handle, para *CertChainPara, flags uint32, reserved uintptr, chainCtx **CertChainContext) (err error) {
- r1, _, e1 := syscall.Syscall9(procCertGetCertificateChain.Addr(), 8, uintptr(engine), uintptr(unsafe.Pointer(leaf)), uintptr(unsafe.Pointer(time)), uintptr(additionalStore), uintptr(unsafe.Pointer(para)), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(chainCtx)), 0)
+ r1, _, e1 := syscall.SyscallN(procCertGetCertificateChain.Addr(), uintptr(engine), uintptr(unsafe.Pointer(leaf)), uintptr(unsafe.Pointer(time)), uintptr(additionalStore), uintptr(unsafe.Pointer(para)), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(chainCtx)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1485,13 +1491,13 @@ func CertGetCertificateChain(engine Handle, leaf *CertContext, time *Filetime, a
}
func CertGetNameString(certContext *CertContext, nameType uint32, flags uint32, typePara unsafe.Pointer, name *uint16, size uint32) (chars uint32) {
- r0, _, _ := syscall.Syscall6(procCertGetNameStringW.Addr(), 6, uintptr(unsafe.Pointer(certContext)), uintptr(nameType), uintptr(flags), uintptr(typePara), uintptr(unsafe.Pointer(name)), uintptr(size))
+ r0, _, _ := syscall.SyscallN(procCertGetNameStringW.Addr(), uintptr(unsafe.Pointer(certContext)), uintptr(nameType), uintptr(flags), uintptr(typePara), uintptr(unsafe.Pointer(name)), uintptr(size))
chars = uint32(r0)
return
}
func CertOpenStore(storeProvider uintptr, msgAndCertEncodingType uint32, cryptProv uintptr, flags uint32, para uintptr) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall6(procCertOpenStore.Addr(), 5, uintptr(storeProvider), uintptr(msgAndCertEncodingType), uintptr(cryptProv), uintptr(flags), uintptr(para), 0)
+ r0, _, e1 := syscall.SyscallN(procCertOpenStore.Addr(), uintptr(storeProvider), uintptr(msgAndCertEncodingType), uintptr(cryptProv), uintptr(flags), uintptr(para))
handle = Handle(r0)
if handle == 0 {
err = errnoErr(e1)
@@ -1500,7 +1506,7 @@ func CertOpenStore(storeProvider uintptr, msgAndCertEncodingType uint32, cryptPr
}
func CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, err error) {
- r0, _, e1 := syscall.Syscall(procCertOpenSystemStoreW.Addr(), 2, uintptr(hprov), uintptr(unsafe.Pointer(name)), 0)
+ r0, _, e1 := syscall.SyscallN(procCertOpenSystemStoreW.Addr(), uintptr(hprov), uintptr(unsafe.Pointer(name)))
store = Handle(r0)
if store == 0 {
err = errnoErr(e1)
@@ -1509,7 +1515,7 @@ func CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, err error) {
}
func CertVerifyCertificateChainPolicy(policyOID uintptr, chain *CertChainContext, para *CertChainPolicyPara, status *CertChainPolicyStatus) (err error) {
- r1, _, e1 := syscall.Syscall6(procCertVerifyCertificateChainPolicy.Addr(), 4, uintptr(policyOID), uintptr(unsafe.Pointer(chain)), uintptr(unsafe.Pointer(para)), uintptr(unsafe.Pointer(status)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procCertVerifyCertificateChainPolicy.Addr(), uintptr(policyOID), uintptr(unsafe.Pointer(chain)), uintptr(unsafe.Pointer(para)), uintptr(unsafe.Pointer(status)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1521,7 +1527,7 @@ func CryptAcquireCertificatePrivateKey(cert *CertContext, flags uint32, paramete
if *callerFreeProvOrNCryptKey {
_p0 = 1
}
- r1, _, e1 := syscall.Syscall6(procCryptAcquireCertificatePrivateKey.Addr(), 6, uintptr(unsafe.Pointer(cert)), uintptr(flags), uintptr(parameters), uintptr(unsafe.Pointer(cryptProvOrNCryptKey)), uintptr(unsafe.Pointer(keySpec)), uintptr(unsafe.Pointer(&_p0)))
+ r1, _, e1 := syscall.SyscallN(procCryptAcquireCertificatePrivateKey.Addr(), uintptr(unsafe.Pointer(cert)), uintptr(flags), uintptr(parameters), uintptr(unsafe.Pointer(cryptProvOrNCryptKey)), uintptr(unsafe.Pointer(keySpec)), uintptr(unsafe.Pointer(&_p0)))
*callerFreeProvOrNCryptKey = _p0 != 0
if r1 == 0 {
err = errnoErr(e1)
@@ -1530,7 +1536,7 @@ func CryptAcquireCertificatePrivateKey(cert *CertContext, flags uint32, paramete
}
func CryptDecodeObject(encodingType uint32, structType *byte, encodedBytes *byte, lenEncodedBytes uint32, flags uint32, decoded unsafe.Pointer, decodedLen *uint32) (err error) {
- r1, _, e1 := syscall.Syscall9(procCryptDecodeObject.Addr(), 7, uintptr(encodingType), uintptr(unsafe.Pointer(structType)), uintptr(unsafe.Pointer(encodedBytes)), uintptr(lenEncodedBytes), uintptr(flags), uintptr(decoded), uintptr(unsafe.Pointer(decodedLen)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procCryptDecodeObject.Addr(), uintptr(encodingType), uintptr(unsafe.Pointer(structType)), uintptr(unsafe.Pointer(encodedBytes)), uintptr(lenEncodedBytes), uintptr(flags), uintptr(decoded), uintptr(unsafe.Pointer(decodedLen)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1538,7 +1544,7 @@ func CryptDecodeObject(encodingType uint32, structType *byte, encodedBytes *byte
}
func CryptProtectData(dataIn *DataBlob, name *uint16, optionalEntropy *DataBlob, reserved uintptr, promptStruct *CryptProtectPromptStruct, flags uint32, dataOut *DataBlob) (err error) {
- r1, _, e1 := syscall.Syscall9(procCryptProtectData.Addr(), 7, uintptr(unsafe.Pointer(dataIn)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(optionalEntropy)), uintptr(reserved), uintptr(unsafe.Pointer(promptStruct)), uintptr(flags), uintptr(unsafe.Pointer(dataOut)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procCryptProtectData.Addr(), uintptr(unsafe.Pointer(dataIn)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(optionalEntropy)), uintptr(reserved), uintptr(unsafe.Pointer(promptStruct)), uintptr(flags), uintptr(unsafe.Pointer(dataOut)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1546,7 +1552,7 @@ func CryptProtectData(dataIn *DataBlob, name *uint16, optionalEntropy *DataBlob,
}
func CryptQueryObject(objectType uint32, object unsafe.Pointer, expectedContentTypeFlags uint32, expectedFormatTypeFlags uint32, flags uint32, msgAndCertEncodingType *uint32, contentType *uint32, formatType *uint32, certStore *Handle, msg *Handle, context *unsafe.Pointer) (err error) {
- r1, _, e1 := syscall.Syscall12(procCryptQueryObject.Addr(), 11, uintptr(objectType), uintptr(object), uintptr(expectedContentTypeFlags), uintptr(expectedFormatTypeFlags), uintptr(flags), uintptr(unsafe.Pointer(msgAndCertEncodingType)), uintptr(unsafe.Pointer(contentType)), uintptr(unsafe.Pointer(formatType)), uintptr(unsafe.Pointer(certStore)), uintptr(unsafe.Pointer(msg)), uintptr(unsafe.Pointer(context)), 0)
+ r1, _, e1 := syscall.SyscallN(procCryptQueryObject.Addr(), uintptr(objectType), uintptr(object), uintptr(expectedContentTypeFlags), uintptr(expectedFormatTypeFlags), uintptr(flags), uintptr(unsafe.Pointer(msgAndCertEncodingType)), uintptr(unsafe.Pointer(contentType)), uintptr(unsafe.Pointer(formatType)), uintptr(unsafe.Pointer(certStore)), uintptr(unsafe.Pointer(msg)), uintptr(unsafe.Pointer(context)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1554,7 +1560,7 @@ func CryptQueryObject(objectType uint32, object unsafe.Pointer, expectedContentT
}
func CryptUnprotectData(dataIn *DataBlob, name **uint16, optionalEntropy *DataBlob, reserved uintptr, promptStruct *CryptProtectPromptStruct, flags uint32, dataOut *DataBlob) (err error) {
- r1, _, e1 := syscall.Syscall9(procCryptUnprotectData.Addr(), 7, uintptr(unsafe.Pointer(dataIn)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(optionalEntropy)), uintptr(reserved), uintptr(unsafe.Pointer(promptStruct)), uintptr(flags), uintptr(unsafe.Pointer(dataOut)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procCryptUnprotectData.Addr(), uintptr(unsafe.Pointer(dataIn)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(optionalEntropy)), uintptr(reserved), uintptr(unsafe.Pointer(promptStruct)), uintptr(flags), uintptr(unsafe.Pointer(dataOut)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1562,7 +1568,7 @@ func CryptUnprotectData(dataIn *DataBlob, name **uint16, optionalEntropy *DataBl
}
func PFXImportCertStore(pfx *CryptDataBlob, password *uint16, flags uint32) (store Handle, err error) {
- r0, _, e1 := syscall.Syscall(procPFXImportCertStore.Addr(), 3, uintptr(unsafe.Pointer(pfx)), uintptr(unsafe.Pointer(password)), uintptr(flags))
+ r0, _, e1 := syscall.SyscallN(procPFXImportCertStore.Addr(), uintptr(unsafe.Pointer(pfx)), uintptr(unsafe.Pointer(password)), uintptr(flags))
store = Handle(r0)
if store == 0 {
err = errnoErr(e1)
@@ -1571,7 +1577,7 @@ func PFXImportCertStore(pfx *CryptDataBlob, password *uint16, flags uint32) (sto
}
func DnsNameCompare(name1 *uint16, name2 *uint16) (same bool) {
- r0, _, _ := syscall.Syscall(procDnsNameCompare_W.Addr(), 2, uintptr(unsafe.Pointer(name1)), uintptr(unsafe.Pointer(name2)), 0)
+ r0, _, _ := syscall.SyscallN(procDnsNameCompare_W.Addr(), uintptr(unsafe.Pointer(name1)), uintptr(unsafe.Pointer(name2)))
same = r0 != 0
return
}
@@ -1586,7 +1592,7 @@ func DnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSR
}
func _DnsQuery(name *uint16, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status error) {
- r0, _, _ := syscall.Syscall6(procDnsQuery_W.Addr(), 6, uintptr(unsafe.Pointer(name)), uintptr(qtype), uintptr(options), uintptr(unsafe.Pointer(extra)), uintptr(unsafe.Pointer(qrs)), uintptr(unsafe.Pointer(pr)))
+ r0, _, _ := syscall.SyscallN(procDnsQuery_W.Addr(), uintptr(unsafe.Pointer(name)), uintptr(qtype), uintptr(options), uintptr(unsafe.Pointer(extra)), uintptr(unsafe.Pointer(qrs)), uintptr(unsafe.Pointer(pr)))
if r0 != 0 {
status = syscall.Errno(r0)
}
@@ -1594,12 +1600,12 @@ func _DnsQuery(name *uint16, qtype uint16, options uint32, extra *byte, qrs **DN
}
func DnsRecordListFree(rl *DNSRecord, freetype uint32) {
- syscall.Syscall(procDnsRecordListFree.Addr(), 2, uintptr(unsafe.Pointer(rl)), uintptr(freetype), 0)
+ syscall.SyscallN(procDnsRecordListFree.Addr(), uintptr(unsafe.Pointer(rl)), uintptr(freetype))
return
}
func DwmGetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error) {
- r0, _, _ := syscall.Syscall6(procDwmGetWindowAttribute.Addr(), 4, uintptr(hwnd), uintptr(attribute), uintptr(value), uintptr(size), 0, 0)
+ r0, _, _ := syscall.SyscallN(procDwmGetWindowAttribute.Addr(), uintptr(hwnd), uintptr(attribute), uintptr(value), uintptr(size))
if r0 != 0 {
ret = syscall.Errno(r0)
}
@@ -1607,7 +1613,7 @@ func DwmGetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, si
}
func DwmSetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error) {
- r0, _, _ := syscall.Syscall6(procDwmSetWindowAttribute.Addr(), 4, uintptr(hwnd), uintptr(attribute), uintptr(value), uintptr(size), 0, 0)
+ r0, _, _ := syscall.SyscallN(procDwmSetWindowAttribute.Addr(), uintptr(hwnd), uintptr(attribute), uintptr(value), uintptr(size))
if r0 != 0 {
ret = syscall.Errno(r0)
}
@@ -1615,15 +1621,20 @@ func DwmSetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, si
}
func CancelMibChangeNotify2(notificationHandle Handle) (errcode error) {
- r0, _, _ := syscall.Syscall(procCancelMibChangeNotify2.Addr(), 1, uintptr(notificationHandle), 0, 0)
+ r0, _, _ := syscall.SyscallN(procCancelMibChangeNotify2.Addr(), uintptr(notificationHandle))
if r0 != 0 {
errcode = syscall.Errno(r0)
}
return
}
+func FreeMibTable(memory unsafe.Pointer) {
+ syscall.SyscallN(procFreeMibTable.Addr(), uintptr(memory))
+ return
+}
+
func GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapterAddresses *IpAdapterAddresses, sizePointer *uint32) (errcode error) {
- r0, _, _ := syscall.Syscall6(procGetAdaptersAddresses.Addr(), 5, uintptr(family), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(adapterAddresses)), uintptr(unsafe.Pointer(sizePointer)), 0)
+ r0, _, _ := syscall.SyscallN(procGetAdaptersAddresses.Addr(), uintptr(family), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(adapterAddresses)), uintptr(unsafe.Pointer(sizePointer)))
if r0 != 0 {
errcode = syscall.Errno(r0)
}
@@ -1631,7 +1642,7 @@ func GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapter
}
func GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error) {
- r0, _, _ := syscall.Syscall(procGetAdaptersInfo.Addr(), 2, uintptr(unsafe.Pointer(ai)), uintptr(unsafe.Pointer(ol)), 0)
+ r0, _, _ := syscall.SyscallN(procGetAdaptersInfo.Addr(), uintptr(unsafe.Pointer(ai)), uintptr(unsafe.Pointer(ol)))
if r0 != 0 {
errcode = syscall.Errno(r0)
}
@@ -1639,7 +1650,7 @@ func GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error) {
}
func getBestInterfaceEx(sockaddr unsafe.Pointer, pdwBestIfIndex *uint32) (errcode error) {
- r0, _, _ := syscall.Syscall(procGetBestInterfaceEx.Addr(), 2, uintptr(sockaddr), uintptr(unsafe.Pointer(pdwBestIfIndex)), 0)
+ r0, _, _ := syscall.SyscallN(procGetBestInterfaceEx.Addr(), uintptr(sockaddr), uintptr(unsafe.Pointer(pdwBestIfIndex)))
if r0 != 0 {
errcode = syscall.Errno(r0)
}
@@ -1647,7 +1658,7 @@ func getBestInterfaceEx(sockaddr unsafe.Pointer, pdwBestIfIndex *uint32) (errcod
}
func GetIfEntry(pIfRow *MibIfRow) (errcode error) {
- r0, _, _ := syscall.Syscall(procGetIfEntry.Addr(), 1, uintptr(unsafe.Pointer(pIfRow)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procGetIfEntry.Addr(), uintptr(unsafe.Pointer(pIfRow)))
if r0 != 0 {
errcode = syscall.Errno(r0)
}
@@ -1655,7 +1666,23 @@ func GetIfEntry(pIfRow *MibIfRow) (errcode error) {
}
func GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) {
- r0, _, _ := syscall.Syscall(procGetIfEntry2Ex.Addr(), 2, uintptr(level), uintptr(unsafe.Pointer(row)), 0)
+ r0, _, _ := syscall.SyscallN(procGetIfEntry2Ex.Addr(), uintptr(level), uintptr(unsafe.Pointer(row)))
+ if r0 != 0 {
+ errcode = syscall.Errno(r0)
+ }
+ return
+}
+
+func GetIpForwardEntry2(row *MibIpForwardRow2) (errcode error) {
+ r0, _, _ := syscall.SyscallN(procGetIpForwardEntry2.Addr(), uintptr(unsafe.Pointer(row)))
+ if r0 != 0 {
+ errcode = syscall.Errno(r0)
+ }
+ return
+}
+
+func GetIpForwardTable2(family uint16, table **MibIpForwardTable2) (errcode error) {
+ r0, _, _ := syscall.SyscallN(procGetIpForwardTable2.Addr(), uintptr(family), uintptr(unsafe.Pointer(table)))
if r0 != 0 {
errcode = syscall.Errno(r0)
}
@@ -1663,7 +1690,7 @@ func GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) {
}
func GetUnicastIpAddressEntry(row *MibUnicastIpAddressRow) (errcode error) {
- r0, _, _ := syscall.Syscall(procGetUnicastIpAddressEntry.Addr(), 1, uintptr(unsafe.Pointer(row)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procGetUnicastIpAddressEntry.Addr(), uintptr(unsafe.Pointer(row)))
if r0 != 0 {
errcode = syscall.Errno(r0)
}
@@ -1675,7 +1702,19 @@ func NotifyIpInterfaceChange(family uint16, callback uintptr, callerContext unsa
if initialNotification {
_p0 = 1
}
- r0, _, _ := syscall.Syscall6(procNotifyIpInterfaceChange.Addr(), 5, uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle)), 0)
+ r0, _, _ := syscall.SyscallN(procNotifyIpInterfaceChange.Addr(), uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle)))
+ if r0 != 0 {
+ errcode = syscall.Errno(r0)
+ }
+ return
+}
+
+func NotifyRouteChange2(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) {
+ var _p0 uint32
+ if initialNotification {
+ _p0 = 1
+ }
+ r0, _, _ := syscall.SyscallN(procNotifyRouteChange2.Addr(), uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle)))
if r0 != 0 {
errcode = syscall.Errno(r0)
}
@@ -1687,7 +1726,7 @@ func NotifyUnicastIpAddressChange(family uint16, callback uintptr, callerContext
if initialNotification {
_p0 = 1
}
- r0, _, _ := syscall.Syscall6(procNotifyUnicastIpAddressChange.Addr(), 5, uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle)), 0)
+ r0, _, _ := syscall.SyscallN(procNotifyUnicastIpAddressChange.Addr(), uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle)))
if r0 != 0 {
errcode = syscall.Errno(r0)
}
@@ -1695,7 +1734,7 @@ func NotifyUnicastIpAddressChange(family uint16, callback uintptr, callerContext
}
func AddDllDirectory(path *uint16) (cookie uintptr, err error) {
- r0, _, e1 := syscall.Syscall(procAddDllDirectory.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procAddDllDirectory.Addr(), uintptr(unsafe.Pointer(path)))
cookie = uintptr(r0)
if cookie == 0 {
err = errnoErr(e1)
@@ -1704,7 +1743,7 @@ func AddDllDirectory(path *uint16) (cookie uintptr, err error) {
}
func AssignProcessToJobObject(job Handle, process Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procAssignProcessToJobObject.Addr(), 2, uintptr(job), uintptr(process), 0)
+ r1, _, e1 := syscall.SyscallN(procAssignProcessToJobObject.Addr(), uintptr(job), uintptr(process))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1712,7 +1751,7 @@ func AssignProcessToJobObject(job Handle, process Handle) (err error) {
}
func CancelIo(s Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procCancelIo.Addr(), 1, uintptr(s), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procCancelIo.Addr(), uintptr(s))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1720,7 +1759,7 @@ func CancelIo(s Handle) (err error) {
}
func CancelIoEx(s Handle, o *Overlapped) (err error) {
- r1, _, e1 := syscall.Syscall(procCancelIoEx.Addr(), 2, uintptr(s), uintptr(unsafe.Pointer(o)), 0)
+ r1, _, e1 := syscall.SyscallN(procCancelIoEx.Addr(), uintptr(s), uintptr(unsafe.Pointer(o)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1728,7 +1767,7 @@ func CancelIoEx(s Handle, o *Overlapped) (err error) {
}
func ClearCommBreak(handle Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procClearCommBreak.Addr(), 1, uintptr(handle), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procClearCommBreak.Addr(), uintptr(handle))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1736,7 +1775,7 @@ func ClearCommBreak(handle Handle) (err error) {
}
func ClearCommError(handle Handle, lpErrors *uint32, lpStat *ComStat) (err error) {
- r1, _, e1 := syscall.Syscall(procClearCommError.Addr(), 3, uintptr(handle), uintptr(unsafe.Pointer(lpErrors)), uintptr(unsafe.Pointer(lpStat)))
+ r1, _, e1 := syscall.SyscallN(procClearCommError.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpErrors)), uintptr(unsafe.Pointer(lpStat)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1744,7 +1783,7 @@ func ClearCommError(handle Handle, lpErrors *uint32, lpStat *ComStat) (err error
}
func CloseHandle(handle Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procCloseHandle.Addr(), 1, uintptr(handle), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procCloseHandle.Addr(), uintptr(handle))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1752,12 +1791,12 @@ func CloseHandle(handle Handle) (err error) {
}
func ClosePseudoConsole(console Handle) {
- syscall.Syscall(procClosePseudoConsole.Addr(), 1, uintptr(console), 0, 0)
+ syscall.SyscallN(procClosePseudoConsole.Addr(), uintptr(console))
return
}
func ConnectNamedPipe(pipe Handle, overlapped *Overlapped) (err error) {
- r1, _, e1 := syscall.Syscall(procConnectNamedPipe.Addr(), 2, uintptr(pipe), uintptr(unsafe.Pointer(overlapped)), 0)
+ r1, _, e1 := syscall.SyscallN(procConnectNamedPipe.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(overlapped)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1765,7 +1804,7 @@ func ConnectNamedPipe(pipe Handle, overlapped *Overlapped) (err error) {
}
func CreateDirectory(path *uint16, sa *SecurityAttributes) (err error) {
- r1, _, e1 := syscall.Syscall(procCreateDirectoryW.Addr(), 2, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(sa)), 0)
+ r1, _, e1 := syscall.SyscallN(procCreateDirectoryW.Addr(), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(sa)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1773,7 +1812,7 @@ func CreateDirectory(path *uint16, sa *SecurityAttributes) (err error) {
}
func CreateEventEx(eventAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall6(procCreateEventExW.Addr(), 4, uintptr(unsafe.Pointer(eventAttrs)), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(desiredAccess), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procCreateEventExW.Addr(), uintptr(unsafe.Pointer(eventAttrs)), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(desiredAccess))
handle = Handle(r0)
if handle == 0 || e1 == ERROR_ALREADY_EXISTS {
err = errnoErr(e1)
@@ -1782,7 +1821,7 @@ func CreateEventEx(eventAttrs *SecurityAttributes, name *uint16, flags uint32, d
}
func CreateEvent(eventAttrs *SecurityAttributes, manualReset uint32, initialState uint32, name *uint16) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall6(procCreateEventW.Addr(), 4, uintptr(unsafe.Pointer(eventAttrs)), uintptr(manualReset), uintptr(initialState), uintptr(unsafe.Pointer(name)), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procCreateEventW.Addr(), uintptr(unsafe.Pointer(eventAttrs)), uintptr(manualReset), uintptr(initialState), uintptr(unsafe.Pointer(name)))
handle = Handle(r0)
if handle == 0 || e1 == ERROR_ALREADY_EXISTS {
err = errnoErr(e1)
@@ -1791,7 +1830,7 @@ func CreateEvent(eventAttrs *SecurityAttributes, manualReset uint32, initialStat
}
func CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall6(procCreateFileMappingW.Addr(), 6, uintptr(fhandle), uintptr(unsafe.Pointer(sa)), uintptr(prot), uintptr(maxSizeHigh), uintptr(maxSizeLow), uintptr(unsafe.Pointer(name)))
+ r0, _, e1 := syscall.SyscallN(procCreateFileMappingW.Addr(), uintptr(fhandle), uintptr(unsafe.Pointer(sa)), uintptr(prot), uintptr(maxSizeHigh), uintptr(maxSizeLow), uintptr(unsafe.Pointer(name)))
handle = Handle(r0)
if handle == 0 || e1 == ERROR_ALREADY_EXISTS {
err = errnoErr(e1)
@@ -1800,7 +1839,7 @@ func CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxS
}
func CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile Handle) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall9(procCreateFileW.Addr(), 7, uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procCreateFileW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile))
handle = Handle(r0)
if handle == InvalidHandle {
err = errnoErr(e1)
@@ -1809,7 +1848,7 @@ func CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes
}
func CreateHardLink(filename *uint16, existingfilename *uint16, reserved uintptr) (err error) {
- r1, _, e1 := syscall.Syscall(procCreateHardLinkW.Addr(), 3, uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(existingfilename)), uintptr(reserved))
+ r1, _, e1 := syscall.SyscallN(procCreateHardLinkW.Addr(), uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(existingfilename)), uintptr(reserved))
if r1&0xff == 0 {
err = errnoErr(e1)
}
@@ -1817,7 +1856,7 @@ func CreateHardLink(filename *uint16, existingfilename *uint16, reserved uintptr
}
func CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uintptr, threadcnt uint32) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall6(procCreateIoCompletionPort.Addr(), 4, uintptr(filehandle), uintptr(cphandle), uintptr(key), uintptr(threadcnt), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procCreateIoCompletionPort.Addr(), uintptr(filehandle), uintptr(cphandle), uintptr(key), uintptr(threadcnt))
handle = Handle(r0)
if handle == 0 {
err = errnoErr(e1)
@@ -1826,7 +1865,7 @@ func CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uintptr, thr
}
func CreateJobObject(jobAttr *SecurityAttributes, name *uint16) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall(procCreateJobObjectW.Addr(), 2, uintptr(unsafe.Pointer(jobAttr)), uintptr(unsafe.Pointer(name)), 0)
+ r0, _, e1 := syscall.SyscallN(procCreateJobObjectW.Addr(), uintptr(unsafe.Pointer(jobAttr)), uintptr(unsafe.Pointer(name)))
handle = Handle(r0)
if handle == 0 {
err = errnoErr(e1)
@@ -1835,7 +1874,7 @@ func CreateJobObject(jobAttr *SecurityAttributes, name *uint16) (handle Handle,
}
func CreateMutexEx(mutexAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall6(procCreateMutexExW.Addr(), 4, uintptr(unsafe.Pointer(mutexAttrs)), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(desiredAccess), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procCreateMutexExW.Addr(), uintptr(unsafe.Pointer(mutexAttrs)), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(desiredAccess))
handle = Handle(r0)
if handle == 0 || e1 == ERROR_ALREADY_EXISTS {
err = errnoErr(e1)
@@ -1848,7 +1887,7 @@ func CreateMutex(mutexAttrs *SecurityAttributes, initialOwner bool, name *uint16
if initialOwner {
_p0 = 1
}
- r0, _, e1 := syscall.Syscall(procCreateMutexW.Addr(), 3, uintptr(unsafe.Pointer(mutexAttrs)), uintptr(_p0), uintptr(unsafe.Pointer(name)))
+ r0, _, e1 := syscall.SyscallN(procCreateMutexW.Addr(), uintptr(unsafe.Pointer(mutexAttrs)), uintptr(_p0), uintptr(unsafe.Pointer(name)))
handle = Handle(r0)
if handle == 0 || e1 == ERROR_ALREADY_EXISTS {
err = errnoErr(e1)
@@ -1857,7 +1896,7 @@ func CreateMutex(mutexAttrs *SecurityAttributes, initialOwner bool, name *uint16
}
func CreateNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *SecurityAttributes) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall9(procCreateNamedPipeW.Addr(), 8, uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(pipeMode), uintptr(maxInstances), uintptr(outSize), uintptr(inSize), uintptr(defaultTimeout), uintptr(unsafe.Pointer(sa)), 0)
+ r0, _, e1 := syscall.SyscallN(procCreateNamedPipeW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(pipeMode), uintptr(maxInstances), uintptr(outSize), uintptr(inSize), uintptr(defaultTimeout), uintptr(unsafe.Pointer(sa)))
handle = Handle(r0)
if handle == InvalidHandle {
err = errnoErr(e1)
@@ -1866,7 +1905,7 @@ func CreateNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances u
}
func CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procCreatePipe.Addr(), 4, uintptr(unsafe.Pointer(readhandle)), uintptr(unsafe.Pointer(writehandle)), uintptr(unsafe.Pointer(sa)), uintptr(size), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procCreatePipe.Addr(), uintptr(unsafe.Pointer(readhandle)), uintptr(unsafe.Pointer(writehandle)), uintptr(unsafe.Pointer(sa)), uintptr(size))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1878,7 +1917,7 @@ func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityA
if inheritHandles {
_p0 = 1
}
- r1, _, e1 := syscall.Syscall12(procCreateProcessW.Addr(), 10, uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procCreateProcessW.Addr(), uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1886,7 +1925,7 @@ func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityA
}
func createPseudoConsole(size uint32, in Handle, out Handle, flags uint32, pconsole *Handle) (hr error) {
- r0, _, _ := syscall.Syscall6(procCreatePseudoConsole.Addr(), 5, uintptr(size), uintptr(in), uintptr(out), uintptr(flags), uintptr(unsafe.Pointer(pconsole)), 0)
+ r0, _, _ := syscall.SyscallN(procCreatePseudoConsole.Addr(), uintptr(size), uintptr(in), uintptr(out), uintptr(flags), uintptr(unsafe.Pointer(pconsole)))
if r0 != 0 {
hr = syscall.Errno(r0)
}
@@ -1894,7 +1933,7 @@ func createPseudoConsole(size uint32, in Handle, out Handle, flags uint32, pcons
}
func CreateSymbolicLink(symlinkfilename *uint16, targetfilename *uint16, flags uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procCreateSymbolicLinkW.Addr(), 3, uintptr(unsafe.Pointer(symlinkfilename)), uintptr(unsafe.Pointer(targetfilename)), uintptr(flags))
+ r1, _, e1 := syscall.SyscallN(procCreateSymbolicLinkW.Addr(), uintptr(unsafe.Pointer(symlinkfilename)), uintptr(unsafe.Pointer(targetfilename)), uintptr(flags))
if r1&0xff == 0 {
err = errnoErr(e1)
}
@@ -1902,7 +1941,7 @@ func CreateSymbolicLink(symlinkfilename *uint16, targetfilename *uint16, flags u
}
func CreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall(procCreateToolhelp32Snapshot.Addr(), 2, uintptr(flags), uintptr(processId), 0)
+ r0, _, e1 := syscall.SyscallN(procCreateToolhelp32Snapshot.Addr(), uintptr(flags), uintptr(processId))
handle = Handle(r0)
if handle == InvalidHandle {
err = errnoErr(e1)
@@ -1911,7 +1950,7 @@ func CreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, er
}
func DefineDosDevice(flags uint32, deviceName *uint16, targetPath *uint16) (err error) {
- r1, _, e1 := syscall.Syscall(procDefineDosDeviceW.Addr(), 3, uintptr(flags), uintptr(unsafe.Pointer(deviceName)), uintptr(unsafe.Pointer(targetPath)))
+ r1, _, e1 := syscall.SyscallN(procDefineDosDeviceW.Addr(), uintptr(flags), uintptr(unsafe.Pointer(deviceName)), uintptr(unsafe.Pointer(targetPath)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1919,7 +1958,7 @@ func DefineDosDevice(flags uint32, deviceName *uint16, targetPath *uint16) (err
}
func DeleteFile(path *uint16) (err error) {
- r1, _, e1 := syscall.Syscall(procDeleteFileW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procDeleteFileW.Addr(), uintptr(unsafe.Pointer(path)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1927,12 +1966,12 @@ func DeleteFile(path *uint16) (err error) {
}
func deleteProcThreadAttributeList(attrlist *ProcThreadAttributeList) {
- syscall.Syscall(procDeleteProcThreadAttributeList.Addr(), 1, uintptr(unsafe.Pointer(attrlist)), 0, 0)
+ syscall.SyscallN(procDeleteProcThreadAttributeList.Addr(), uintptr(unsafe.Pointer(attrlist)))
return
}
func DeleteVolumeMountPoint(volumeMountPoint *uint16) (err error) {
- r1, _, e1 := syscall.Syscall(procDeleteVolumeMountPointW.Addr(), 1, uintptr(unsafe.Pointer(volumeMountPoint)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procDeleteVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(volumeMountPoint)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1940,7 +1979,7 @@ func DeleteVolumeMountPoint(volumeMountPoint *uint16) (err error) {
}
func DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBufferSize uint32, outBuffer *byte, outBufferSize uint32, bytesReturned *uint32, overlapped *Overlapped) (err error) {
- r1, _, e1 := syscall.Syscall9(procDeviceIoControl.Addr(), 8, uintptr(handle), uintptr(ioControlCode), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferSize), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferSize), uintptr(unsafe.Pointer(bytesReturned)), uintptr(unsafe.Pointer(overlapped)), 0)
+ r1, _, e1 := syscall.SyscallN(procDeviceIoControl.Addr(), uintptr(handle), uintptr(ioControlCode), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferSize), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferSize), uintptr(unsafe.Pointer(bytesReturned)), uintptr(unsafe.Pointer(overlapped)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1948,7 +1987,7 @@ func DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBuff
}
func DisconnectNamedPipe(pipe Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procDisconnectNamedPipe.Addr(), 1, uintptr(pipe), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procDisconnectNamedPipe.Addr(), uintptr(pipe))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1960,7 +1999,7 @@ func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetP
if bInheritHandle {
_p0 = 1
}
- r1, _, e1 := syscall.Syscall9(procDuplicateHandle.Addr(), 7, uintptr(hSourceProcessHandle), uintptr(hSourceHandle), uintptr(hTargetProcessHandle), uintptr(unsafe.Pointer(lpTargetHandle)), uintptr(dwDesiredAccess), uintptr(_p0), uintptr(dwOptions), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procDuplicateHandle.Addr(), uintptr(hSourceProcessHandle), uintptr(hSourceHandle), uintptr(hTargetProcessHandle), uintptr(unsafe.Pointer(lpTargetHandle)), uintptr(dwDesiredAccess), uintptr(_p0), uintptr(dwOptions))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1968,7 +2007,7 @@ func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetP
}
func EscapeCommFunction(handle Handle, dwFunc uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procEscapeCommFunction.Addr(), 2, uintptr(handle), uintptr(dwFunc), 0)
+ r1, _, e1 := syscall.SyscallN(procEscapeCommFunction.Addr(), uintptr(handle), uintptr(dwFunc))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1976,12 +2015,12 @@ func EscapeCommFunction(handle Handle, dwFunc uint32) (err error) {
}
func ExitProcess(exitcode uint32) {
- syscall.Syscall(procExitProcess.Addr(), 1, uintptr(exitcode), 0, 0)
+ syscall.SyscallN(procExitProcess.Addr(), uintptr(exitcode))
return
}
func ExpandEnvironmentStrings(src *uint16, dst *uint16, size uint32) (n uint32, err error) {
- r0, _, e1 := syscall.Syscall(procExpandEnvironmentStringsW.Addr(), 3, uintptr(unsafe.Pointer(src)), uintptr(unsafe.Pointer(dst)), uintptr(size))
+ r0, _, e1 := syscall.SyscallN(procExpandEnvironmentStringsW.Addr(), uintptr(unsafe.Pointer(src)), uintptr(unsafe.Pointer(dst)), uintptr(size))
n = uint32(r0)
if n == 0 {
err = errnoErr(e1)
@@ -1990,7 +2029,7 @@ func ExpandEnvironmentStrings(src *uint16, dst *uint16, size uint32) (n uint32,
}
func FindClose(handle Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procFindClose.Addr(), 1, uintptr(handle), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procFindClose.Addr(), uintptr(handle))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -1998,7 +2037,7 @@ func FindClose(handle Handle) (err error) {
}
func FindCloseChangeNotification(handle Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procFindCloseChangeNotification.Addr(), 1, uintptr(handle), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procFindCloseChangeNotification.Addr(), uintptr(handle))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2019,7 +2058,7 @@ func _FindFirstChangeNotification(path *uint16, watchSubtree bool, notifyFilter
if watchSubtree {
_p1 = 1
}
- r0, _, e1 := syscall.Syscall(procFindFirstChangeNotificationW.Addr(), 3, uintptr(unsafe.Pointer(path)), uintptr(_p1), uintptr(notifyFilter))
+ r0, _, e1 := syscall.SyscallN(procFindFirstChangeNotificationW.Addr(), uintptr(unsafe.Pointer(path)), uintptr(_p1), uintptr(notifyFilter))
handle = Handle(r0)
if handle == InvalidHandle {
err = errnoErr(e1)
@@ -2028,7 +2067,7 @@ func _FindFirstChangeNotification(path *uint16, watchSubtree bool, notifyFilter
}
func findFirstFile1(name *uint16, data *win32finddata1) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall(procFindFirstFileW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(data)), 0)
+ r0, _, e1 := syscall.SyscallN(procFindFirstFileW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(data)))
handle = Handle(r0)
if handle == InvalidHandle {
err = errnoErr(e1)
@@ -2037,7 +2076,7 @@ func findFirstFile1(name *uint16, data *win32finddata1) (handle Handle, err erro
}
func FindFirstVolumeMountPoint(rootPathName *uint16, volumeMountPoint *uint16, bufferLength uint32) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall(procFindFirstVolumeMountPointW.Addr(), 3, uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(bufferLength))
+ r0, _, e1 := syscall.SyscallN(procFindFirstVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(bufferLength))
handle = Handle(r0)
if handle == InvalidHandle {
err = errnoErr(e1)
@@ -2046,7 +2085,7 @@ func FindFirstVolumeMountPoint(rootPathName *uint16, volumeMountPoint *uint16, b
}
func FindFirstVolume(volumeName *uint16, bufferLength uint32) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall(procFindFirstVolumeW.Addr(), 2, uintptr(unsafe.Pointer(volumeName)), uintptr(bufferLength), 0)
+ r0, _, e1 := syscall.SyscallN(procFindFirstVolumeW.Addr(), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferLength))
handle = Handle(r0)
if handle == InvalidHandle {
err = errnoErr(e1)
@@ -2055,7 +2094,7 @@ func FindFirstVolume(volumeName *uint16, bufferLength uint32) (handle Handle, er
}
func FindNextChangeNotification(handle Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procFindNextChangeNotification.Addr(), 1, uintptr(handle), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procFindNextChangeNotification.Addr(), uintptr(handle))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2063,7 +2102,7 @@ func FindNextChangeNotification(handle Handle) (err error) {
}
func findNextFile1(handle Handle, data *win32finddata1) (err error) {
- r1, _, e1 := syscall.Syscall(procFindNextFileW.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(data)), 0)
+ r1, _, e1 := syscall.SyscallN(procFindNextFileW.Addr(), uintptr(handle), uintptr(unsafe.Pointer(data)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2071,7 +2110,7 @@ func findNextFile1(handle Handle, data *win32finddata1) (err error) {
}
func FindNextVolumeMountPoint(findVolumeMountPoint Handle, volumeMountPoint *uint16, bufferLength uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procFindNextVolumeMountPointW.Addr(), 3, uintptr(findVolumeMountPoint), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(bufferLength))
+ r1, _, e1 := syscall.SyscallN(procFindNextVolumeMountPointW.Addr(), uintptr(findVolumeMountPoint), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(bufferLength))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2079,7 +2118,7 @@ func FindNextVolumeMountPoint(findVolumeMountPoint Handle, volumeMountPoint *uin
}
func FindNextVolume(findVolume Handle, volumeName *uint16, bufferLength uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procFindNextVolumeW.Addr(), 3, uintptr(findVolume), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferLength))
+ r1, _, e1 := syscall.SyscallN(procFindNextVolumeW.Addr(), uintptr(findVolume), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferLength))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2087,7 +2126,7 @@ func FindNextVolume(findVolume Handle, volumeName *uint16, bufferLength uint32)
}
func findResource(module Handle, name uintptr, resType uintptr) (resInfo Handle, err error) {
- r0, _, e1 := syscall.Syscall(procFindResourceW.Addr(), 3, uintptr(module), uintptr(name), uintptr(resType))
+ r0, _, e1 := syscall.SyscallN(procFindResourceW.Addr(), uintptr(module), uintptr(name), uintptr(resType))
resInfo = Handle(r0)
if resInfo == 0 {
err = errnoErr(e1)
@@ -2096,7 +2135,7 @@ func findResource(module Handle, name uintptr, resType uintptr) (resInfo Handle,
}
func FindVolumeClose(findVolume Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procFindVolumeClose.Addr(), 1, uintptr(findVolume), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procFindVolumeClose.Addr(), uintptr(findVolume))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2104,7 +2143,15 @@ func FindVolumeClose(findVolume Handle) (err error) {
}
func FindVolumeMountPointClose(findVolumeMountPoint Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procFindVolumeMountPointClose.Addr(), 1, uintptr(findVolumeMountPoint), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procFindVolumeMountPointClose.Addr(), uintptr(findVolumeMountPoint))
+ if r1 == 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+func FlushConsoleInputBuffer(console Handle) (err error) {
+ r1, _, e1 := syscall.SyscallN(procFlushConsoleInputBuffer.Addr(), uintptr(console))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2112,7 +2159,7 @@ func FindVolumeMountPointClose(findVolumeMountPoint Handle) (err error) {
}
func FlushFileBuffers(handle Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procFlushFileBuffers.Addr(), 1, uintptr(handle), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procFlushFileBuffers.Addr(), uintptr(handle))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2120,7 +2167,7 @@ func FlushFileBuffers(handle Handle) (err error) {
}
func FlushViewOfFile(addr uintptr, length uintptr) (err error) {
- r1, _, e1 := syscall.Syscall(procFlushViewOfFile.Addr(), 2, uintptr(addr), uintptr(length), 0)
+ r1, _, e1 := syscall.SyscallN(procFlushViewOfFile.Addr(), uintptr(addr), uintptr(length))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2132,7 +2179,7 @@ func FormatMessage(flags uint32, msgsrc uintptr, msgid uint32, langid uint32, bu
if len(buf) > 0 {
_p0 = &buf[0]
}
- r0, _, e1 := syscall.Syscall9(procFormatMessageW.Addr(), 7, uintptr(flags), uintptr(msgsrc), uintptr(msgid), uintptr(langid), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(args)), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procFormatMessageW.Addr(), uintptr(flags), uintptr(msgsrc), uintptr(msgid), uintptr(langid), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(args)))
n = uint32(r0)
if n == 0 {
err = errnoErr(e1)
@@ -2141,7 +2188,7 @@ func FormatMessage(flags uint32, msgsrc uintptr, msgid uint32, langid uint32, bu
}
func FreeEnvironmentStrings(envs *uint16) (err error) {
- r1, _, e1 := syscall.Syscall(procFreeEnvironmentStringsW.Addr(), 1, uintptr(unsafe.Pointer(envs)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procFreeEnvironmentStringsW.Addr(), uintptr(unsafe.Pointer(envs)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2149,7 +2196,7 @@ func FreeEnvironmentStrings(envs *uint16) (err error) {
}
func FreeLibrary(handle Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procFreeLibrary.Addr(), 1, uintptr(handle), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procFreeLibrary.Addr(), uintptr(handle))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2157,7 +2204,7 @@ func FreeLibrary(handle Handle) (err error) {
}
func GenerateConsoleCtrlEvent(ctrlEvent uint32, processGroupID uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procGenerateConsoleCtrlEvent.Addr(), 2, uintptr(ctrlEvent), uintptr(processGroupID), 0)
+ r1, _, e1 := syscall.SyscallN(procGenerateConsoleCtrlEvent.Addr(), uintptr(ctrlEvent), uintptr(processGroupID))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2165,19 +2212,19 @@ func GenerateConsoleCtrlEvent(ctrlEvent uint32, processGroupID uint32) (err erro
}
func GetACP() (acp uint32) {
- r0, _, _ := syscall.Syscall(procGetACP.Addr(), 0, 0, 0, 0)
+ r0, _, _ := syscall.SyscallN(procGetACP.Addr())
acp = uint32(r0)
return
}
func GetActiveProcessorCount(groupNumber uint16) (ret uint32) {
- r0, _, _ := syscall.Syscall(procGetActiveProcessorCount.Addr(), 1, uintptr(groupNumber), 0, 0)
+ r0, _, _ := syscall.SyscallN(procGetActiveProcessorCount.Addr(), uintptr(groupNumber))
ret = uint32(r0)
return
}
func GetCommModemStatus(handle Handle, lpModemStat *uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procGetCommModemStatus.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(lpModemStat)), 0)
+ r1, _, e1 := syscall.SyscallN(procGetCommModemStatus.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpModemStat)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2185,7 +2232,7 @@ func GetCommModemStatus(handle Handle, lpModemStat *uint32) (err error) {
}
func GetCommState(handle Handle, lpDCB *DCB) (err error) {
- r1, _, e1 := syscall.Syscall(procGetCommState.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(lpDCB)), 0)
+ r1, _, e1 := syscall.SyscallN(procGetCommState.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpDCB)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2193,7 +2240,7 @@ func GetCommState(handle Handle, lpDCB *DCB) (err error) {
}
func GetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) {
- r1, _, e1 := syscall.Syscall(procGetCommTimeouts.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(timeouts)), 0)
+ r1, _, e1 := syscall.SyscallN(procGetCommTimeouts.Addr(), uintptr(handle), uintptr(unsafe.Pointer(timeouts)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2201,13 +2248,13 @@ func GetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) {
}
func GetCommandLine() (cmd *uint16) {
- r0, _, _ := syscall.Syscall(procGetCommandLineW.Addr(), 0, 0, 0, 0)
+ r0, _, _ := syscall.SyscallN(procGetCommandLineW.Addr())
cmd = (*uint16)(unsafe.Pointer(r0))
return
}
func GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procGetComputerNameExW.Addr(), 3, uintptr(nametype), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n)))
+ r1, _, e1 := syscall.SyscallN(procGetComputerNameExW.Addr(), uintptr(nametype), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2215,7 +2262,7 @@ func GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) {
}
func GetComputerName(buf *uint16, n *uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procGetComputerNameW.Addr(), 2, uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n)), 0)
+ r1, _, e1 := syscall.SyscallN(procGetComputerNameW.Addr(), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2223,7 +2270,7 @@ func GetComputerName(buf *uint16, n *uint32) (err error) {
}
func GetConsoleCP() (cp uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetConsoleCP.Addr(), 0, 0, 0, 0)
+ r0, _, e1 := syscall.SyscallN(procGetConsoleCP.Addr())
cp = uint32(r0)
if cp == 0 {
err = errnoErr(e1)
@@ -2232,7 +2279,7 @@ func GetConsoleCP() (cp uint32, err error) {
}
func GetConsoleMode(console Handle, mode *uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(console), uintptr(unsafe.Pointer(mode)), 0)
+ r1, _, e1 := syscall.SyscallN(procGetConsoleMode.Addr(), uintptr(console), uintptr(unsafe.Pointer(mode)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2240,7 +2287,7 @@ func GetConsoleMode(console Handle, mode *uint32) (err error) {
}
func GetConsoleOutputCP() (cp uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetConsoleOutputCP.Addr(), 0, 0, 0, 0)
+ r0, _, e1 := syscall.SyscallN(procGetConsoleOutputCP.Addr())
cp = uint32(r0)
if cp == 0 {
err = errnoErr(e1)
@@ -2249,7 +2296,7 @@ func GetConsoleOutputCP() (cp uint32, err error) {
}
func GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) (err error) {
- r1, _, e1 := syscall.Syscall(procGetConsoleScreenBufferInfo.Addr(), 2, uintptr(console), uintptr(unsafe.Pointer(info)), 0)
+ r1, _, e1 := syscall.SyscallN(procGetConsoleScreenBufferInfo.Addr(), uintptr(console), uintptr(unsafe.Pointer(info)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2257,7 +2304,7 @@ func GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) (
}
func GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetCurrentDirectoryW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0)
+ r0, _, e1 := syscall.SyscallN(procGetCurrentDirectoryW.Addr(), uintptr(buflen), uintptr(unsafe.Pointer(buf)))
n = uint32(r0)
if n == 0 {
err = errnoErr(e1)
@@ -2266,19 +2313,19 @@ func GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error) {
}
func GetCurrentProcessId() (pid uint32) {
- r0, _, _ := syscall.Syscall(procGetCurrentProcessId.Addr(), 0, 0, 0, 0)
+ r0, _, _ := syscall.SyscallN(procGetCurrentProcessId.Addr())
pid = uint32(r0)
return
}
func GetCurrentThreadId() (id uint32) {
- r0, _, _ := syscall.Syscall(procGetCurrentThreadId.Addr(), 0, 0, 0, 0)
+ r0, _, _ := syscall.SyscallN(procGetCurrentThreadId.Addr())
id = uint32(r0)
return
}
func GetDiskFreeSpaceEx(directoryName *uint16, freeBytesAvailableToCaller *uint64, totalNumberOfBytes *uint64, totalNumberOfFreeBytes *uint64) (err error) {
- r1, _, e1 := syscall.Syscall6(procGetDiskFreeSpaceExW.Addr(), 4, uintptr(unsafe.Pointer(directoryName)), uintptr(unsafe.Pointer(freeBytesAvailableToCaller)), uintptr(unsafe.Pointer(totalNumberOfBytes)), uintptr(unsafe.Pointer(totalNumberOfFreeBytes)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procGetDiskFreeSpaceExW.Addr(), uintptr(unsafe.Pointer(directoryName)), uintptr(unsafe.Pointer(freeBytesAvailableToCaller)), uintptr(unsafe.Pointer(totalNumberOfBytes)), uintptr(unsafe.Pointer(totalNumberOfFreeBytes)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2286,13 +2333,13 @@ func GetDiskFreeSpaceEx(directoryName *uint16, freeBytesAvailableToCaller *uint6
}
func GetDriveType(rootPathName *uint16) (driveType uint32) {
- r0, _, _ := syscall.Syscall(procGetDriveTypeW.Addr(), 1, uintptr(unsafe.Pointer(rootPathName)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procGetDriveTypeW.Addr(), uintptr(unsafe.Pointer(rootPathName)))
driveType = uint32(r0)
return
}
func GetEnvironmentStrings() (envs *uint16, err error) {
- r0, _, e1 := syscall.Syscall(procGetEnvironmentStringsW.Addr(), 0, 0, 0, 0)
+ r0, _, e1 := syscall.SyscallN(procGetEnvironmentStringsW.Addr())
envs = (*uint16)(unsafe.Pointer(r0))
if envs == nil {
err = errnoErr(e1)
@@ -2301,7 +2348,7 @@ func GetEnvironmentStrings() (envs *uint16, err error) {
}
func GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetEnvironmentVariableW.Addr(), 3, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(size))
+ r0, _, e1 := syscall.SyscallN(procGetEnvironmentVariableW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(size))
n = uint32(r0)
if n == 0 {
err = errnoErr(e1)
@@ -2310,7 +2357,7 @@ func GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32
}
func GetExitCodeProcess(handle Handle, exitcode *uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procGetExitCodeProcess.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(exitcode)), 0)
+ r1, _, e1 := syscall.SyscallN(procGetExitCodeProcess.Addr(), uintptr(handle), uintptr(unsafe.Pointer(exitcode)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2318,7 +2365,7 @@ func GetExitCodeProcess(handle Handle, exitcode *uint32) (err error) {
}
func GetFileAttributesEx(name *uint16, level uint32, info *byte) (err error) {
- r1, _, e1 := syscall.Syscall(procGetFileAttributesExW.Addr(), 3, uintptr(unsafe.Pointer(name)), uintptr(level), uintptr(unsafe.Pointer(info)))
+ r1, _, e1 := syscall.SyscallN(procGetFileAttributesExW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(level), uintptr(unsafe.Pointer(info)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2326,7 +2373,7 @@ func GetFileAttributesEx(name *uint16, level uint32, info *byte) (err error) {
}
func GetFileAttributes(name *uint16) (attrs uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetFileAttributesW.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procGetFileAttributesW.Addr(), uintptr(unsafe.Pointer(name)))
attrs = uint32(r0)
if attrs == INVALID_FILE_ATTRIBUTES {
err = errnoErr(e1)
@@ -2335,7 +2382,7 @@ func GetFileAttributes(name *uint16) (attrs uint32, err error) {
}
func GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (err error) {
- r1, _, e1 := syscall.Syscall(procGetFileInformationByHandle.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(data)), 0)
+ r1, _, e1 := syscall.SyscallN(procGetFileInformationByHandle.Addr(), uintptr(handle), uintptr(unsafe.Pointer(data)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2343,7 +2390,7 @@ func GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (e
}
func GetFileInformationByHandleEx(handle Handle, class uint32, outBuffer *byte, outBufferLen uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procGetFileInformationByHandleEx.Addr(), 4, uintptr(handle), uintptr(class), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferLen), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procGetFileInformationByHandleEx.Addr(), uintptr(handle), uintptr(class), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferLen))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2351,7 +2398,7 @@ func GetFileInformationByHandleEx(handle Handle, class uint32, outBuffer *byte,
}
func GetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) {
- r1, _, e1 := syscall.Syscall6(procGetFileTime.Addr(), 4, uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procGetFileTime.Addr(), uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2359,7 +2406,7 @@ func GetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetim
}
func GetFileType(filehandle Handle) (n uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetFileType.Addr(), 1, uintptr(filehandle), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procGetFileType.Addr(), uintptr(filehandle))
n = uint32(r0)
if n == 0 {
err = errnoErr(e1)
@@ -2368,7 +2415,7 @@ func GetFileType(filehandle Handle) (n uint32, err error) {
}
func GetFinalPathNameByHandle(file Handle, filePath *uint16, filePathSize uint32, flags uint32) (n uint32, err error) {
- r0, _, e1 := syscall.Syscall6(procGetFinalPathNameByHandleW.Addr(), 4, uintptr(file), uintptr(unsafe.Pointer(filePath)), uintptr(filePathSize), uintptr(flags), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procGetFinalPathNameByHandleW.Addr(), uintptr(file), uintptr(unsafe.Pointer(filePath)), uintptr(filePathSize), uintptr(flags))
n = uint32(r0)
if n == 0 {
err = errnoErr(e1)
@@ -2377,7 +2424,7 @@ func GetFinalPathNameByHandle(file Handle, filePath *uint16, filePathSize uint32
}
func GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, err error) {
- r0, _, e1 := syscall.Syscall6(procGetFullPathNameW.Addr(), 4, uintptr(unsafe.Pointer(path)), uintptr(buflen), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(fname)), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procGetFullPathNameW.Addr(), uintptr(unsafe.Pointer(path)), uintptr(buflen), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(fname)))
n = uint32(r0)
if n == 0 {
err = errnoErr(e1)
@@ -2386,13 +2433,13 @@ func GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (
}
func GetLargePageMinimum() (size uintptr) {
- r0, _, _ := syscall.Syscall(procGetLargePageMinimum.Addr(), 0, 0, 0, 0)
+ r0, _, _ := syscall.SyscallN(procGetLargePageMinimum.Addr())
size = uintptr(r0)
return
}
func GetLastError() (lasterr error) {
- r0, _, _ := syscall.Syscall(procGetLastError.Addr(), 0, 0, 0, 0)
+ r0, _, _ := syscall.SyscallN(procGetLastError.Addr())
if r0 != 0 {
lasterr = syscall.Errno(r0)
}
@@ -2400,7 +2447,7 @@ func GetLastError() (lasterr error) {
}
func GetLogicalDriveStrings(bufferLength uint32, buffer *uint16) (n uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetLogicalDriveStringsW.Addr(), 2, uintptr(bufferLength), uintptr(unsafe.Pointer(buffer)), 0)
+ r0, _, e1 := syscall.SyscallN(procGetLogicalDriveStringsW.Addr(), uintptr(bufferLength), uintptr(unsafe.Pointer(buffer)))
n = uint32(r0)
if n == 0 {
err = errnoErr(e1)
@@ -2409,7 +2456,7 @@ func GetLogicalDriveStrings(bufferLength uint32, buffer *uint16) (n uint32, err
}
func GetLogicalDrives() (drivesBitMask uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetLogicalDrives.Addr(), 0, 0, 0, 0)
+ r0, _, e1 := syscall.SyscallN(procGetLogicalDrives.Addr())
drivesBitMask = uint32(r0)
if drivesBitMask == 0 {
err = errnoErr(e1)
@@ -2418,7 +2465,7 @@ func GetLogicalDrives() (drivesBitMask uint32, err error) {
}
func GetLongPathName(path *uint16, buf *uint16, buflen uint32) (n uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetLongPathNameW.Addr(), 3, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(buf)), uintptr(buflen))
+ r0, _, e1 := syscall.SyscallN(procGetLongPathNameW.Addr(), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(buf)), uintptr(buflen))
n = uint32(r0)
if n == 0 {
err = errnoErr(e1)
@@ -2427,13 +2474,13 @@ func GetLongPathName(path *uint16, buf *uint16, buflen uint32) (n uint32, err er
}
func GetMaximumProcessorCount(groupNumber uint16) (ret uint32) {
- r0, _, _ := syscall.Syscall(procGetMaximumProcessorCount.Addr(), 1, uintptr(groupNumber), 0, 0)
+ r0, _, _ := syscall.SyscallN(procGetMaximumProcessorCount.Addr(), uintptr(groupNumber))
ret = uint32(r0)
return
}
func GetModuleFileName(module Handle, filename *uint16, size uint32) (n uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetModuleFileNameW.Addr(), 3, uintptr(module), uintptr(unsafe.Pointer(filename)), uintptr(size))
+ r0, _, e1 := syscall.SyscallN(procGetModuleFileNameW.Addr(), uintptr(module), uintptr(unsafe.Pointer(filename)), uintptr(size))
n = uint32(r0)
if n == 0 {
err = errnoErr(e1)
@@ -2442,7 +2489,7 @@ func GetModuleFileName(module Handle, filename *uint16, size uint32) (n uint32,
}
func GetModuleHandleEx(flags uint32, moduleName *uint16, module *Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procGetModuleHandleExW.Addr(), 3, uintptr(flags), uintptr(unsafe.Pointer(moduleName)), uintptr(unsafe.Pointer(module)))
+ r1, _, e1 := syscall.SyscallN(procGetModuleHandleExW.Addr(), uintptr(flags), uintptr(unsafe.Pointer(moduleName)), uintptr(unsafe.Pointer(module)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2450,7 +2497,7 @@ func GetModuleHandleEx(flags uint32, moduleName *uint16, module *Handle) (err er
}
func GetNamedPipeClientProcessId(pipe Handle, clientProcessID *uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procGetNamedPipeClientProcessId.Addr(), 2, uintptr(pipe), uintptr(unsafe.Pointer(clientProcessID)), 0)
+ r1, _, e1 := syscall.SyscallN(procGetNamedPipeClientProcessId.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(clientProcessID)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2458,7 +2505,7 @@ func GetNamedPipeClientProcessId(pipe Handle, clientProcessID *uint32) (err erro
}
func GetNamedPipeHandleState(pipe Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) {
- r1, _, e1 := syscall.Syscall9(procGetNamedPipeHandleStateW.Addr(), 7, uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(curInstances)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), uintptr(unsafe.Pointer(userName)), uintptr(maxUserNameSize), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procGetNamedPipeHandleStateW.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(curInstances)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), uintptr(unsafe.Pointer(userName)), uintptr(maxUserNameSize))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2466,7 +2513,7 @@ func GetNamedPipeHandleState(pipe Handle, state *uint32, curInstances *uint32, m
}
func GetNamedPipeInfo(pipe Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procGetNamedPipeInfo.Addr(), 5, uintptr(pipe), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(outSize)), uintptr(unsafe.Pointer(inSize)), uintptr(unsafe.Pointer(maxInstances)), 0)
+ r1, _, e1 := syscall.SyscallN(procGetNamedPipeInfo.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(outSize)), uintptr(unsafe.Pointer(inSize)), uintptr(unsafe.Pointer(maxInstances)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2474,7 +2521,15 @@ func GetNamedPipeInfo(pipe Handle, flags *uint32, outSize *uint32, inSize *uint3
}
func GetNamedPipeServerProcessId(pipe Handle, serverProcessID *uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procGetNamedPipeServerProcessId.Addr(), 2, uintptr(pipe), uintptr(unsafe.Pointer(serverProcessID)), 0)
+ r1, _, e1 := syscall.SyscallN(procGetNamedPipeServerProcessId.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(serverProcessID)))
+ if r1 == 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+func GetNumberOfConsoleInputEvents(console Handle, numevents *uint32) (err error) {
+ r1, _, e1 := syscall.SyscallN(procGetNumberOfConsoleInputEvents.Addr(), uintptr(console), uintptr(unsafe.Pointer(numevents)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2486,7 +2541,7 @@ func GetOverlappedResult(handle Handle, overlapped *Overlapped, done *uint32, wa
if wait {
_p0 = 1
}
- r1, _, e1 := syscall.Syscall6(procGetOverlappedResult.Addr(), 4, uintptr(handle), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(done)), uintptr(_p0), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procGetOverlappedResult.Addr(), uintptr(handle), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(done)), uintptr(_p0))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2494,7 +2549,7 @@ func GetOverlappedResult(handle Handle, overlapped *Overlapped, done *uint32, wa
}
func GetPriorityClass(process Handle) (ret uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetPriorityClass.Addr(), 1, uintptr(process), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procGetPriorityClass.Addr(), uintptr(process))
ret = uint32(r0)
if ret == 0 {
err = errnoErr(e1)
@@ -2512,7 +2567,7 @@ func GetProcAddress(module Handle, procname string) (proc uintptr, err error) {
}
func _GetProcAddress(module Handle, procname *byte) (proc uintptr, err error) {
- r0, _, e1 := syscall.Syscall(procGetProcAddress.Addr(), 2, uintptr(module), uintptr(unsafe.Pointer(procname)), 0)
+ r0, _, e1 := syscall.SyscallN(procGetProcAddress.Addr(), uintptr(module), uintptr(unsafe.Pointer(procname)))
proc = uintptr(r0)
if proc == 0 {
err = errnoErr(e1)
@@ -2521,7 +2576,7 @@ func _GetProcAddress(module Handle, procname *byte) (proc uintptr, err error) {
}
func GetProcessId(process Handle) (id uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetProcessId.Addr(), 1, uintptr(process), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procGetProcessId.Addr(), uintptr(process))
id = uint32(r0)
if id == 0 {
err = errnoErr(e1)
@@ -2530,7 +2585,7 @@ func GetProcessId(process Handle) (id uint32, err error) {
}
func getProcessPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procGetProcessPreferredUILanguages.Addr(), 4, uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procGetProcessPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2538,7 +2593,7 @@ func getProcessPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uin
}
func GetProcessShutdownParameters(level *uint32, flags *uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procGetProcessShutdownParameters.Addr(), 2, uintptr(unsafe.Pointer(level)), uintptr(unsafe.Pointer(flags)), 0)
+ r1, _, e1 := syscall.SyscallN(procGetProcessShutdownParameters.Addr(), uintptr(unsafe.Pointer(level)), uintptr(unsafe.Pointer(flags)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2546,7 +2601,7 @@ func GetProcessShutdownParameters(level *uint32, flags *uint32) (err error) {
}
func GetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime, kernelTime *Filetime, userTime *Filetime) (err error) {
- r1, _, e1 := syscall.Syscall6(procGetProcessTimes.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(creationTime)), uintptr(unsafe.Pointer(exitTime)), uintptr(unsafe.Pointer(kernelTime)), uintptr(unsafe.Pointer(userTime)), 0)
+ r1, _, e1 := syscall.SyscallN(procGetProcessTimes.Addr(), uintptr(handle), uintptr(unsafe.Pointer(creationTime)), uintptr(unsafe.Pointer(exitTime)), uintptr(unsafe.Pointer(kernelTime)), uintptr(unsafe.Pointer(userTime)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2554,12 +2609,12 @@ func GetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime,
}
func GetProcessWorkingSetSizeEx(hProcess Handle, lpMinimumWorkingSetSize *uintptr, lpMaximumWorkingSetSize *uintptr, flags *uint32) {
- syscall.Syscall6(procGetProcessWorkingSetSizeEx.Addr(), 4, uintptr(hProcess), uintptr(unsafe.Pointer(lpMinimumWorkingSetSize)), uintptr(unsafe.Pointer(lpMaximumWorkingSetSize)), uintptr(unsafe.Pointer(flags)), 0, 0)
+ syscall.SyscallN(procGetProcessWorkingSetSizeEx.Addr(), uintptr(hProcess), uintptr(unsafe.Pointer(lpMinimumWorkingSetSize)), uintptr(unsafe.Pointer(lpMaximumWorkingSetSize)), uintptr(unsafe.Pointer(flags)))
return
}
func GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uintptr, overlapped **Overlapped, timeout uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procGetQueuedCompletionStatus.Addr(), 5, uintptr(cphandle), uintptr(unsafe.Pointer(qty)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(overlapped)), uintptr(timeout), 0)
+ r1, _, e1 := syscall.SyscallN(procGetQueuedCompletionStatus.Addr(), uintptr(cphandle), uintptr(unsafe.Pointer(qty)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(overlapped)), uintptr(timeout))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2567,7 +2622,7 @@ func GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uintptr, overl
}
func GetShortPathName(longpath *uint16, shortpath *uint16, buflen uint32) (n uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetShortPathNameW.Addr(), 3, uintptr(unsafe.Pointer(longpath)), uintptr(unsafe.Pointer(shortpath)), uintptr(buflen))
+ r0, _, e1 := syscall.SyscallN(procGetShortPathNameW.Addr(), uintptr(unsafe.Pointer(longpath)), uintptr(unsafe.Pointer(shortpath)), uintptr(buflen))
n = uint32(r0)
if n == 0 {
err = errnoErr(e1)
@@ -2576,12 +2631,12 @@ func GetShortPathName(longpath *uint16, shortpath *uint16, buflen uint32) (n uin
}
func getStartupInfo(startupInfo *StartupInfo) {
- syscall.Syscall(procGetStartupInfoW.Addr(), 1, uintptr(unsafe.Pointer(startupInfo)), 0, 0)
+ syscall.SyscallN(procGetStartupInfoW.Addr(), uintptr(unsafe.Pointer(startupInfo)))
return
}
func GetStdHandle(stdhandle uint32) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall(procGetStdHandle.Addr(), 1, uintptr(stdhandle), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procGetStdHandle.Addr(), uintptr(stdhandle))
handle = Handle(r0)
if handle == InvalidHandle {
err = errnoErr(e1)
@@ -2590,7 +2645,7 @@ func GetStdHandle(stdhandle uint32) (handle Handle, err error) {
}
func getSystemDirectory(dir *uint16, dirLen uint32) (len uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetSystemDirectoryW.Addr(), 2, uintptr(unsafe.Pointer(dir)), uintptr(dirLen), 0)
+ r0, _, e1 := syscall.SyscallN(procGetSystemDirectoryW.Addr(), uintptr(unsafe.Pointer(dir)), uintptr(dirLen))
len = uint32(r0)
if len == 0 {
err = errnoErr(e1)
@@ -2599,7 +2654,7 @@ func getSystemDirectory(dir *uint16, dirLen uint32) (len uint32, err error) {
}
func getSystemPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procGetSystemPreferredUILanguages.Addr(), 4, uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procGetSystemPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2607,17 +2662,17 @@ func getSystemPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint
}
func GetSystemTimeAsFileTime(time *Filetime) {
- syscall.Syscall(procGetSystemTimeAsFileTime.Addr(), 1, uintptr(unsafe.Pointer(time)), 0, 0)
+ syscall.SyscallN(procGetSystemTimeAsFileTime.Addr(), uintptr(unsafe.Pointer(time)))
return
}
func GetSystemTimePreciseAsFileTime(time *Filetime) {
- syscall.Syscall(procGetSystemTimePreciseAsFileTime.Addr(), 1, uintptr(unsafe.Pointer(time)), 0, 0)
+ syscall.SyscallN(procGetSystemTimePreciseAsFileTime.Addr(), uintptr(unsafe.Pointer(time)))
return
}
func getSystemWindowsDirectory(dir *uint16, dirLen uint32) (len uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetSystemWindowsDirectoryW.Addr(), 2, uintptr(unsafe.Pointer(dir)), uintptr(dirLen), 0)
+ r0, _, e1 := syscall.SyscallN(procGetSystemWindowsDirectoryW.Addr(), uintptr(unsafe.Pointer(dir)), uintptr(dirLen))
len = uint32(r0)
if len == 0 {
err = errnoErr(e1)
@@ -2626,7 +2681,7 @@ func getSystemWindowsDirectory(dir *uint16, dirLen uint32) (len uint32, err erro
}
func GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetTempPathW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0)
+ r0, _, e1 := syscall.SyscallN(procGetTempPathW.Addr(), uintptr(buflen), uintptr(unsafe.Pointer(buf)))
n = uint32(r0)
if n == 0 {
err = errnoErr(e1)
@@ -2635,7 +2690,7 @@ func GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) {
}
func getThreadPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procGetThreadPreferredUILanguages.Addr(), 4, uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procGetThreadPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2643,13 +2698,13 @@ func getThreadPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint
}
func getTickCount64() (ms uint64) {
- r0, _, _ := syscall.Syscall(procGetTickCount64.Addr(), 0, 0, 0, 0)
+ r0, _, _ := syscall.SyscallN(procGetTickCount64.Addr())
ms = uint64(r0)
return
}
func GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetTimeZoneInformation.Addr(), 1, uintptr(unsafe.Pointer(tzi)), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procGetTimeZoneInformation.Addr(), uintptr(unsafe.Pointer(tzi)))
rc = uint32(r0)
if rc == 0xffffffff {
err = errnoErr(e1)
@@ -2658,7 +2713,7 @@ func GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) {
}
func getUserPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procGetUserPreferredUILanguages.Addr(), 4, uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procGetUserPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2666,7 +2721,7 @@ func getUserPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16
}
func GetVersion() (ver uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetVersion.Addr(), 0, 0, 0, 0)
+ r0, _, e1 := syscall.SyscallN(procGetVersion.Addr())
ver = uint32(r0)
if ver == 0 {
err = errnoErr(e1)
@@ -2675,7 +2730,7 @@ func GetVersion() (ver uint32, err error) {
}
func GetVolumeInformationByHandle(file Handle, volumeNameBuffer *uint16, volumeNameSize uint32, volumeNameSerialNumber *uint32, maximumComponentLength *uint32, fileSystemFlags *uint32, fileSystemNameBuffer *uint16, fileSystemNameSize uint32) (err error) {
- r1, _, e1 := syscall.Syscall9(procGetVolumeInformationByHandleW.Addr(), 8, uintptr(file), uintptr(unsafe.Pointer(volumeNameBuffer)), uintptr(volumeNameSize), uintptr(unsafe.Pointer(volumeNameSerialNumber)), uintptr(unsafe.Pointer(maximumComponentLength)), uintptr(unsafe.Pointer(fileSystemFlags)), uintptr(unsafe.Pointer(fileSystemNameBuffer)), uintptr(fileSystemNameSize), 0)
+ r1, _, e1 := syscall.SyscallN(procGetVolumeInformationByHandleW.Addr(), uintptr(file), uintptr(unsafe.Pointer(volumeNameBuffer)), uintptr(volumeNameSize), uintptr(unsafe.Pointer(volumeNameSerialNumber)), uintptr(unsafe.Pointer(maximumComponentLength)), uintptr(unsafe.Pointer(fileSystemFlags)), uintptr(unsafe.Pointer(fileSystemNameBuffer)), uintptr(fileSystemNameSize))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2683,7 +2738,7 @@ func GetVolumeInformationByHandle(file Handle, volumeNameBuffer *uint16, volumeN
}
func GetVolumeInformation(rootPathName *uint16, volumeNameBuffer *uint16, volumeNameSize uint32, volumeNameSerialNumber *uint32, maximumComponentLength *uint32, fileSystemFlags *uint32, fileSystemNameBuffer *uint16, fileSystemNameSize uint32) (err error) {
- r1, _, e1 := syscall.Syscall9(procGetVolumeInformationW.Addr(), 8, uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeNameBuffer)), uintptr(volumeNameSize), uintptr(unsafe.Pointer(volumeNameSerialNumber)), uintptr(unsafe.Pointer(maximumComponentLength)), uintptr(unsafe.Pointer(fileSystemFlags)), uintptr(unsafe.Pointer(fileSystemNameBuffer)), uintptr(fileSystemNameSize), 0)
+ r1, _, e1 := syscall.SyscallN(procGetVolumeInformationW.Addr(), uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeNameBuffer)), uintptr(volumeNameSize), uintptr(unsafe.Pointer(volumeNameSerialNumber)), uintptr(unsafe.Pointer(maximumComponentLength)), uintptr(unsafe.Pointer(fileSystemFlags)), uintptr(unsafe.Pointer(fileSystemNameBuffer)), uintptr(fileSystemNameSize))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2691,7 +2746,7 @@ func GetVolumeInformation(rootPathName *uint16, volumeNameBuffer *uint16, volume
}
func GetVolumeNameForVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16, bufferlength uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procGetVolumeNameForVolumeMountPointW.Addr(), 3, uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferlength))
+ r1, _, e1 := syscall.SyscallN(procGetVolumeNameForVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferlength))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2699,7 +2754,7 @@ func GetVolumeNameForVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint
}
func GetVolumePathName(fileName *uint16, volumePathName *uint16, bufferLength uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procGetVolumePathNameW.Addr(), 3, uintptr(unsafe.Pointer(fileName)), uintptr(unsafe.Pointer(volumePathName)), uintptr(bufferLength))
+ r1, _, e1 := syscall.SyscallN(procGetVolumePathNameW.Addr(), uintptr(unsafe.Pointer(fileName)), uintptr(unsafe.Pointer(volumePathName)), uintptr(bufferLength))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2707,7 +2762,7 @@ func GetVolumePathName(fileName *uint16, volumePathName *uint16, bufferLength ui
}
func GetVolumePathNamesForVolumeName(volumeName *uint16, volumePathNames *uint16, bufferLength uint32, returnLength *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procGetVolumePathNamesForVolumeNameW.Addr(), 4, uintptr(unsafe.Pointer(volumeName)), uintptr(unsafe.Pointer(volumePathNames)), uintptr(bufferLength), uintptr(unsafe.Pointer(returnLength)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procGetVolumePathNamesForVolumeNameW.Addr(), uintptr(unsafe.Pointer(volumeName)), uintptr(unsafe.Pointer(volumePathNames)), uintptr(bufferLength), uintptr(unsafe.Pointer(returnLength)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2715,7 +2770,7 @@ func GetVolumePathNamesForVolumeName(volumeName *uint16, volumePathNames *uint16
}
func getWindowsDirectory(dir *uint16, dirLen uint32) (len uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetWindowsDirectoryW.Addr(), 2, uintptr(unsafe.Pointer(dir)), uintptr(dirLen), 0)
+ r0, _, e1 := syscall.SyscallN(procGetWindowsDirectoryW.Addr(), uintptr(unsafe.Pointer(dir)), uintptr(dirLen))
len = uint32(r0)
if len == 0 {
err = errnoErr(e1)
@@ -2724,7 +2779,7 @@ func getWindowsDirectory(dir *uint16, dirLen uint32) (len uint32, err error) {
}
func initializeProcThreadAttributeList(attrlist *ProcThreadAttributeList, attrcount uint32, flags uint32, size *uintptr) (err error) {
- r1, _, e1 := syscall.Syscall6(procInitializeProcThreadAttributeList.Addr(), 4, uintptr(unsafe.Pointer(attrlist)), uintptr(attrcount), uintptr(flags), uintptr(unsafe.Pointer(size)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procInitializeProcThreadAttributeList.Addr(), uintptr(unsafe.Pointer(attrlist)), uintptr(attrcount), uintptr(flags), uintptr(unsafe.Pointer(size)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2736,7 +2791,7 @@ func IsWow64Process(handle Handle, isWow64 *bool) (err error) {
if *isWow64 {
_p0 = 1
}
- r1, _, e1 := syscall.Syscall(procIsWow64Process.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(&_p0)), 0)
+ r1, _, e1 := syscall.SyscallN(procIsWow64Process.Addr(), uintptr(handle), uintptr(unsafe.Pointer(&_p0)))
*isWow64 = _p0 != 0
if r1 == 0 {
err = errnoErr(e1)
@@ -2749,7 +2804,7 @@ func IsWow64Process2(handle Handle, processMachine *uint16, nativeMachine *uint1
if err != nil {
return
}
- r1, _, e1 := syscall.Syscall(procIsWow64Process2.Addr(), 3, uintptr(handle), uintptr(unsafe.Pointer(processMachine)), uintptr(unsafe.Pointer(nativeMachine)))
+ r1, _, e1 := syscall.SyscallN(procIsWow64Process2.Addr(), uintptr(handle), uintptr(unsafe.Pointer(processMachine)), uintptr(unsafe.Pointer(nativeMachine)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2766,7 +2821,7 @@ func LoadLibraryEx(libname string, zero Handle, flags uintptr) (handle Handle, e
}
func _LoadLibraryEx(libname *uint16, zero Handle, flags uintptr) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall(procLoadLibraryExW.Addr(), 3, uintptr(unsafe.Pointer(libname)), uintptr(zero), uintptr(flags))
+ r0, _, e1 := syscall.SyscallN(procLoadLibraryExW.Addr(), uintptr(unsafe.Pointer(libname)), uintptr(zero), uintptr(flags))
handle = Handle(r0)
if handle == 0 {
err = errnoErr(e1)
@@ -2784,7 +2839,7 @@ func LoadLibrary(libname string) (handle Handle, err error) {
}
func _LoadLibrary(libname *uint16) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall(procLoadLibraryW.Addr(), 1, uintptr(unsafe.Pointer(libname)), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procLoadLibraryW.Addr(), uintptr(unsafe.Pointer(libname)))
handle = Handle(r0)
if handle == 0 {
err = errnoErr(e1)
@@ -2793,7 +2848,7 @@ func _LoadLibrary(libname *uint16) (handle Handle, err error) {
}
func LoadResource(module Handle, resInfo Handle) (resData Handle, err error) {
- r0, _, e1 := syscall.Syscall(procLoadResource.Addr(), 2, uintptr(module), uintptr(resInfo), 0)
+ r0, _, e1 := syscall.SyscallN(procLoadResource.Addr(), uintptr(module), uintptr(resInfo))
resData = Handle(r0)
if resData == 0 {
err = errnoErr(e1)
@@ -2802,7 +2857,7 @@ func LoadResource(module Handle, resInfo Handle) (resData Handle, err error) {
}
func LocalAlloc(flags uint32, length uint32) (ptr uintptr, err error) {
- r0, _, e1 := syscall.Syscall(procLocalAlloc.Addr(), 2, uintptr(flags), uintptr(length), 0)
+ r0, _, e1 := syscall.SyscallN(procLocalAlloc.Addr(), uintptr(flags), uintptr(length))
ptr = uintptr(r0)
if ptr == 0 {
err = errnoErr(e1)
@@ -2811,7 +2866,7 @@ func LocalAlloc(flags uint32, length uint32) (ptr uintptr, err error) {
}
func LocalFree(hmem Handle) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall(procLocalFree.Addr(), 1, uintptr(hmem), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procLocalFree.Addr(), uintptr(hmem))
handle = Handle(r0)
if handle != 0 {
err = errnoErr(e1)
@@ -2820,7 +2875,7 @@ func LocalFree(hmem Handle) (handle Handle, err error) {
}
func LockFileEx(file Handle, flags uint32, reserved uint32, bytesLow uint32, bytesHigh uint32, overlapped *Overlapped) (err error) {
- r1, _, e1 := syscall.Syscall6(procLockFileEx.Addr(), 6, uintptr(file), uintptr(flags), uintptr(reserved), uintptr(bytesLow), uintptr(bytesHigh), uintptr(unsafe.Pointer(overlapped)))
+ r1, _, e1 := syscall.SyscallN(procLockFileEx.Addr(), uintptr(file), uintptr(flags), uintptr(reserved), uintptr(bytesLow), uintptr(bytesHigh), uintptr(unsafe.Pointer(overlapped)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2828,7 +2883,7 @@ func LockFileEx(file Handle, flags uint32, reserved uint32, bytesLow uint32, byt
}
func LockResource(resData Handle) (addr uintptr, err error) {
- r0, _, e1 := syscall.Syscall(procLockResource.Addr(), 1, uintptr(resData), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procLockResource.Addr(), uintptr(resData))
addr = uintptr(r0)
if addr == 0 {
err = errnoErr(e1)
@@ -2837,7 +2892,7 @@ func LockResource(resData Handle) (addr uintptr, err error) {
}
func MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, err error) {
- r0, _, e1 := syscall.Syscall6(procMapViewOfFile.Addr(), 5, uintptr(handle), uintptr(access), uintptr(offsetHigh), uintptr(offsetLow), uintptr(length), 0)
+ r0, _, e1 := syscall.SyscallN(procMapViewOfFile.Addr(), uintptr(handle), uintptr(access), uintptr(offsetHigh), uintptr(offsetLow), uintptr(length))
addr = uintptr(r0)
if addr == 0 {
err = errnoErr(e1)
@@ -2846,7 +2901,7 @@ func MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow ui
}
func Module32First(snapshot Handle, moduleEntry *ModuleEntry32) (err error) {
- r1, _, e1 := syscall.Syscall(procModule32FirstW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(moduleEntry)), 0)
+ r1, _, e1 := syscall.SyscallN(procModule32FirstW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(moduleEntry)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2854,7 +2909,7 @@ func Module32First(snapshot Handle, moduleEntry *ModuleEntry32) (err error) {
}
func Module32Next(snapshot Handle, moduleEntry *ModuleEntry32) (err error) {
- r1, _, e1 := syscall.Syscall(procModule32NextW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(moduleEntry)), 0)
+ r1, _, e1 := syscall.SyscallN(procModule32NextW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(moduleEntry)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2862,7 +2917,7 @@ func Module32Next(snapshot Handle, moduleEntry *ModuleEntry32) (err error) {
}
func MoveFileEx(from *uint16, to *uint16, flags uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procMoveFileExW.Addr(), 3, uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), uintptr(flags))
+ r1, _, e1 := syscall.SyscallN(procMoveFileExW.Addr(), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), uintptr(flags))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2870,7 +2925,7 @@ func MoveFileEx(from *uint16, to *uint16, flags uint32) (err error) {
}
func MoveFile(from *uint16, to *uint16) (err error) {
- r1, _, e1 := syscall.Syscall(procMoveFileW.Addr(), 2, uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), 0)
+ r1, _, e1 := syscall.SyscallN(procMoveFileW.Addr(), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2878,7 +2933,7 @@ func MoveFile(from *uint16, to *uint16) (err error) {
}
func MultiByteToWideChar(codePage uint32, dwFlags uint32, str *byte, nstr int32, wchar *uint16, nwchar int32) (nwrite int32, err error) {
- r0, _, e1 := syscall.Syscall6(procMultiByteToWideChar.Addr(), 6, uintptr(codePage), uintptr(dwFlags), uintptr(unsafe.Pointer(str)), uintptr(nstr), uintptr(unsafe.Pointer(wchar)), uintptr(nwchar))
+ r0, _, e1 := syscall.SyscallN(procMultiByteToWideChar.Addr(), uintptr(codePage), uintptr(dwFlags), uintptr(unsafe.Pointer(str)), uintptr(nstr), uintptr(unsafe.Pointer(wchar)), uintptr(nwchar))
nwrite = int32(r0)
if nwrite == 0 {
err = errnoErr(e1)
@@ -2891,7 +2946,7 @@ func OpenEvent(desiredAccess uint32, inheritHandle bool, name *uint16) (handle H
if inheritHandle {
_p0 = 1
}
- r0, _, e1 := syscall.Syscall(procOpenEventW.Addr(), 3, uintptr(desiredAccess), uintptr(_p0), uintptr(unsafe.Pointer(name)))
+ r0, _, e1 := syscall.SyscallN(procOpenEventW.Addr(), uintptr(desiredAccess), uintptr(_p0), uintptr(unsafe.Pointer(name)))
handle = Handle(r0)
if handle == 0 {
err = errnoErr(e1)
@@ -2904,7 +2959,7 @@ func OpenMutex(desiredAccess uint32, inheritHandle bool, name *uint16) (handle H
if inheritHandle {
_p0 = 1
}
- r0, _, e1 := syscall.Syscall(procOpenMutexW.Addr(), 3, uintptr(desiredAccess), uintptr(_p0), uintptr(unsafe.Pointer(name)))
+ r0, _, e1 := syscall.SyscallN(procOpenMutexW.Addr(), uintptr(desiredAccess), uintptr(_p0), uintptr(unsafe.Pointer(name)))
handle = Handle(r0)
if handle == 0 {
err = errnoErr(e1)
@@ -2917,7 +2972,7 @@ func OpenProcess(desiredAccess uint32, inheritHandle bool, processId uint32) (ha
if inheritHandle {
_p0 = 1
}
- r0, _, e1 := syscall.Syscall(procOpenProcess.Addr(), 3, uintptr(desiredAccess), uintptr(_p0), uintptr(processId))
+ r0, _, e1 := syscall.SyscallN(procOpenProcess.Addr(), uintptr(desiredAccess), uintptr(_p0), uintptr(processId))
handle = Handle(r0)
if handle == 0 {
err = errnoErr(e1)
@@ -2930,7 +2985,7 @@ func OpenThread(desiredAccess uint32, inheritHandle bool, threadId uint32) (hand
if inheritHandle {
_p0 = 1
}
- r0, _, e1 := syscall.Syscall(procOpenThread.Addr(), 3, uintptr(desiredAccess), uintptr(_p0), uintptr(threadId))
+ r0, _, e1 := syscall.SyscallN(procOpenThread.Addr(), uintptr(desiredAccess), uintptr(_p0), uintptr(threadId))
handle = Handle(r0)
if handle == 0 {
err = errnoErr(e1)
@@ -2939,7 +2994,7 @@ func OpenThread(desiredAccess uint32, inheritHandle bool, threadId uint32) (hand
}
func PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uintptr, overlapped *Overlapped) (err error) {
- r1, _, e1 := syscall.Syscall6(procPostQueuedCompletionStatus.Addr(), 4, uintptr(cphandle), uintptr(qty), uintptr(key), uintptr(unsafe.Pointer(overlapped)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procPostQueuedCompletionStatus.Addr(), uintptr(cphandle), uintptr(qty), uintptr(key), uintptr(unsafe.Pointer(overlapped)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2947,7 +3002,7 @@ func PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uintptr, overla
}
func Process32First(snapshot Handle, procEntry *ProcessEntry32) (err error) {
- r1, _, e1 := syscall.Syscall(procProcess32FirstW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(procEntry)), 0)
+ r1, _, e1 := syscall.SyscallN(procProcess32FirstW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(procEntry)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2955,7 +3010,7 @@ func Process32First(snapshot Handle, procEntry *ProcessEntry32) (err error) {
}
func Process32Next(snapshot Handle, procEntry *ProcessEntry32) (err error) {
- r1, _, e1 := syscall.Syscall(procProcess32NextW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(procEntry)), 0)
+ r1, _, e1 := syscall.SyscallN(procProcess32NextW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(procEntry)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2963,7 +3018,7 @@ func Process32Next(snapshot Handle, procEntry *ProcessEntry32) (err error) {
}
func ProcessIdToSessionId(pid uint32, sessionid *uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procProcessIdToSessionId.Addr(), 2, uintptr(pid), uintptr(unsafe.Pointer(sessionid)), 0)
+ r1, _, e1 := syscall.SyscallN(procProcessIdToSessionId.Addr(), uintptr(pid), uintptr(unsafe.Pointer(sessionid)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2971,7 +3026,7 @@ func ProcessIdToSessionId(pid uint32, sessionid *uint32) (err error) {
}
func PulseEvent(event Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procPulseEvent.Addr(), 1, uintptr(event), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procPulseEvent.Addr(), uintptr(event))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2979,7 +3034,7 @@ func PulseEvent(event Handle) (err error) {
}
func PurgeComm(handle Handle, dwFlags uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procPurgeComm.Addr(), 2, uintptr(handle), uintptr(dwFlags), 0)
+ r1, _, e1 := syscall.SyscallN(procPurgeComm.Addr(), uintptr(handle), uintptr(dwFlags))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -2987,7 +3042,7 @@ func PurgeComm(handle Handle, dwFlags uint32) (err error) {
}
func QueryDosDevice(deviceName *uint16, targetPath *uint16, max uint32) (n uint32, err error) {
- r0, _, e1 := syscall.Syscall(procQueryDosDeviceW.Addr(), 3, uintptr(unsafe.Pointer(deviceName)), uintptr(unsafe.Pointer(targetPath)), uintptr(max))
+ r0, _, e1 := syscall.SyscallN(procQueryDosDeviceW.Addr(), uintptr(unsafe.Pointer(deviceName)), uintptr(unsafe.Pointer(targetPath)), uintptr(max))
n = uint32(r0)
if n == 0 {
err = errnoErr(e1)
@@ -2996,7 +3051,7 @@ func QueryDosDevice(deviceName *uint16, targetPath *uint16, max uint32) (n uint3
}
func QueryFullProcessImageName(proc Handle, flags uint32, exeName *uint16, size *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procQueryFullProcessImageNameW.Addr(), 4, uintptr(proc), uintptr(flags), uintptr(unsafe.Pointer(exeName)), uintptr(unsafe.Pointer(size)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procQueryFullProcessImageNameW.Addr(), uintptr(proc), uintptr(flags), uintptr(unsafe.Pointer(exeName)), uintptr(unsafe.Pointer(size)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3004,7 +3059,7 @@ func QueryFullProcessImageName(proc Handle, flags uint32, exeName *uint16, size
}
func QueryInformationJobObject(job Handle, JobObjectInformationClass int32, JobObjectInformation uintptr, JobObjectInformationLength uint32, retlen *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procQueryInformationJobObject.Addr(), 5, uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength), uintptr(unsafe.Pointer(retlen)), 0)
+ r1, _, e1 := syscall.SyscallN(procQueryInformationJobObject.Addr(), uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength), uintptr(unsafe.Pointer(retlen)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3012,7 +3067,7 @@ func QueryInformationJobObject(job Handle, JobObjectInformationClass int32, JobO
}
func ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) {
- r1, _, e1 := syscall.Syscall6(procReadConsoleW.Addr(), 5, uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(toread), uintptr(unsafe.Pointer(read)), uintptr(unsafe.Pointer(inputControl)), 0)
+ r1, _, e1 := syscall.SyscallN(procReadConsoleW.Addr(), uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(toread), uintptr(unsafe.Pointer(read)), uintptr(unsafe.Pointer(inputControl)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3024,7 +3079,7 @@ func ReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree
if watchSubTree {
_p0 = 1
}
- r1, _, e1 := syscall.Syscall9(procReadDirectoryChangesW.Addr(), 8, uintptr(handle), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(_p0), uintptr(mask), uintptr(unsafe.Pointer(retlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine), 0)
+ r1, _, e1 := syscall.SyscallN(procReadDirectoryChangesW.Addr(), uintptr(handle), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(_p0), uintptr(mask), uintptr(unsafe.Pointer(retlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3036,7 +3091,7 @@ func readFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (
if len(buf) > 0 {
_p0 = &buf[0]
}
- r1, _, e1 := syscall.Syscall6(procReadFile.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped)), 0)
+ r1, _, e1 := syscall.SyscallN(procReadFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3044,7 +3099,7 @@ func readFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (
}
func ReadProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size uintptr, numberOfBytesRead *uintptr) (err error) {
- r1, _, e1 := syscall.Syscall6(procReadProcessMemory.Addr(), 5, uintptr(process), uintptr(baseAddress), uintptr(unsafe.Pointer(buffer)), uintptr(size), uintptr(unsafe.Pointer(numberOfBytesRead)), 0)
+ r1, _, e1 := syscall.SyscallN(procReadProcessMemory.Addr(), uintptr(process), uintptr(baseAddress), uintptr(unsafe.Pointer(buffer)), uintptr(size), uintptr(unsafe.Pointer(numberOfBytesRead)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3052,7 +3107,7 @@ func ReadProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size u
}
func ReleaseMutex(mutex Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procReleaseMutex.Addr(), 1, uintptr(mutex), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procReleaseMutex.Addr(), uintptr(mutex))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3060,7 +3115,7 @@ func ReleaseMutex(mutex Handle) (err error) {
}
func RemoveDirectory(path *uint16) (err error) {
- r1, _, e1 := syscall.Syscall(procRemoveDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procRemoveDirectoryW.Addr(), uintptr(unsafe.Pointer(path)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3068,7 +3123,7 @@ func RemoveDirectory(path *uint16) (err error) {
}
func RemoveDllDirectory(cookie uintptr) (err error) {
- r1, _, e1 := syscall.Syscall(procRemoveDllDirectory.Addr(), 1, uintptr(cookie), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procRemoveDllDirectory.Addr(), uintptr(cookie))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3076,7 +3131,7 @@ func RemoveDllDirectory(cookie uintptr) (err error) {
}
func ResetEvent(event Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procResetEvent.Addr(), 1, uintptr(event), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procResetEvent.Addr(), uintptr(event))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3084,7 +3139,7 @@ func ResetEvent(event Handle) (err error) {
}
func resizePseudoConsole(pconsole Handle, size uint32) (hr error) {
- r0, _, _ := syscall.Syscall(procResizePseudoConsole.Addr(), 2, uintptr(pconsole), uintptr(size), 0)
+ r0, _, _ := syscall.SyscallN(procResizePseudoConsole.Addr(), uintptr(pconsole), uintptr(size))
if r0 != 0 {
hr = syscall.Errno(r0)
}
@@ -3092,7 +3147,7 @@ func resizePseudoConsole(pconsole Handle, size uint32) (hr error) {
}
func ResumeThread(thread Handle) (ret uint32, err error) {
- r0, _, e1 := syscall.Syscall(procResumeThread.Addr(), 1, uintptr(thread), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procResumeThread.Addr(), uintptr(thread))
ret = uint32(r0)
if ret == 0xffffffff {
err = errnoErr(e1)
@@ -3101,7 +3156,7 @@ func ResumeThread(thread Handle) (ret uint32, err error) {
}
func SetCommBreak(handle Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procSetCommBreak.Addr(), 1, uintptr(handle), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procSetCommBreak.Addr(), uintptr(handle))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3109,7 +3164,7 @@ func SetCommBreak(handle Handle) (err error) {
}
func SetCommMask(handle Handle, dwEvtMask uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procSetCommMask.Addr(), 2, uintptr(handle), uintptr(dwEvtMask), 0)
+ r1, _, e1 := syscall.SyscallN(procSetCommMask.Addr(), uintptr(handle), uintptr(dwEvtMask))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3117,7 +3172,7 @@ func SetCommMask(handle Handle, dwEvtMask uint32) (err error) {
}
func SetCommState(handle Handle, lpDCB *DCB) (err error) {
- r1, _, e1 := syscall.Syscall(procSetCommState.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(lpDCB)), 0)
+ r1, _, e1 := syscall.SyscallN(procSetCommState.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpDCB)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3125,7 +3180,7 @@ func SetCommState(handle Handle, lpDCB *DCB) (err error) {
}
func SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) {
- r1, _, e1 := syscall.Syscall(procSetCommTimeouts.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(timeouts)), 0)
+ r1, _, e1 := syscall.SyscallN(procSetCommTimeouts.Addr(), uintptr(handle), uintptr(unsafe.Pointer(timeouts)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3133,7 +3188,7 @@ func SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) {
}
func SetConsoleCP(cp uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procSetConsoleCP.Addr(), 1, uintptr(cp), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procSetConsoleCP.Addr(), uintptr(cp))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3141,7 +3196,7 @@ func SetConsoleCP(cp uint32) (err error) {
}
func setConsoleCursorPosition(console Handle, position uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procSetConsoleCursorPosition.Addr(), 2, uintptr(console), uintptr(position), 0)
+ r1, _, e1 := syscall.SyscallN(procSetConsoleCursorPosition.Addr(), uintptr(console), uintptr(position))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3149,7 +3204,7 @@ func setConsoleCursorPosition(console Handle, position uint32) (err error) {
}
func SetConsoleMode(console Handle, mode uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procSetConsoleMode.Addr(), 2, uintptr(console), uintptr(mode), 0)
+ r1, _, e1 := syscall.SyscallN(procSetConsoleMode.Addr(), uintptr(console), uintptr(mode))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3157,7 +3212,7 @@ func SetConsoleMode(console Handle, mode uint32) (err error) {
}
func SetConsoleOutputCP(cp uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procSetConsoleOutputCP.Addr(), 1, uintptr(cp), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procSetConsoleOutputCP.Addr(), uintptr(cp))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3165,7 +3220,7 @@ func SetConsoleOutputCP(cp uint32) (err error) {
}
func SetCurrentDirectory(path *uint16) (err error) {
- r1, _, e1 := syscall.Syscall(procSetCurrentDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procSetCurrentDirectoryW.Addr(), uintptr(unsafe.Pointer(path)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3173,7 +3228,7 @@ func SetCurrentDirectory(path *uint16) (err error) {
}
func SetDefaultDllDirectories(directoryFlags uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procSetDefaultDllDirectories.Addr(), 1, uintptr(directoryFlags), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procSetDefaultDllDirectories.Addr(), uintptr(directoryFlags))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3190,7 +3245,7 @@ func SetDllDirectory(path string) (err error) {
}
func _SetDllDirectory(path *uint16) (err error) {
- r1, _, e1 := syscall.Syscall(procSetDllDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procSetDllDirectoryW.Addr(), uintptr(unsafe.Pointer(path)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3198,7 +3253,7 @@ func _SetDllDirectory(path *uint16) (err error) {
}
func SetEndOfFile(handle Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procSetEndOfFile.Addr(), 1, uintptr(handle), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procSetEndOfFile.Addr(), uintptr(handle))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3206,7 +3261,7 @@ func SetEndOfFile(handle Handle) (err error) {
}
func SetEnvironmentVariable(name *uint16, value *uint16) (err error) {
- r1, _, e1 := syscall.Syscall(procSetEnvironmentVariableW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value)), 0)
+ r1, _, e1 := syscall.SyscallN(procSetEnvironmentVariableW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3214,13 +3269,13 @@ func SetEnvironmentVariable(name *uint16, value *uint16) (err error) {
}
func SetErrorMode(mode uint32) (ret uint32) {
- r0, _, _ := syscall.Syscall(procSetErrorMode.Addr(), 1, uintptr(mode), 0, 0)
+ r0, _, _ := syscall.SyscallN(procSetErrorMode.Addr(), uintptr(mode))
ret = uint32(r0)
return
}
func SetEvent(event Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procSetEvent.Addr(), 1, uintptr(event), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procSetEvent.Addr(), uintptr(event))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3228,7 +3283,7 @@ func SetEvent(event Handle) (err error) {
}
func SetFileAttributes(name *uint16, attrs uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procSetFileAttributesW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(attrs), 0)
+ r1, _, e1 := syscall.SyscallN(procSetFileAttributesW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(attrs))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3236,7 +3291,7 @@ func SetFileAttributes(name *uint16, attrs uint32) (err error) {
}
func SetFileCompletionNotificationModes(handle Handle, flags uint8) (err error) {
- r1, _, e1 := syscall.Syscall(procSetFileCompletionNotificationModes.Addr(), 2, uintptr(handle), uintptr(flags), 0)
+ r1, _, e1 := syscall.SyscallN(procSetFileCompletionNotificationModes.Addr(), uintptr(handle), uintptr(flags))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3244,7 +3299,7 @@ func SetFileCompletionNotificationModes(handle Handle, flags uint8) (err error)
}
func SetFileInformationByHandle(handle Handle, class uint32, inBuffer *byte, inBufferLen uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procSetFileInformationByHandle.Addr(), 4, uintptr(handle), uintptr(class), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procSetFileInformationByHandle.Addr(), uintptr(handle), uintptr(class), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3252,7 +3307,7 @@ func SetFileInformationByHandle(handle Handle, class uint32, inBuffer *byte, inB
}
func SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence uint32) (newlowoffset uint32, err error) {
- r0, _, e1 := syscall.Syscall6(procSetFilePointer.Addr(), 4, uintptr(handle), uintptr(lowoffset), uintptr(unsafe.Pointer(highoffsetptr)), uintptr(whence), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procSetFilePointer.Addr(), uintptr(handle), uintptr(lowoffset), uintptr(unsafe.Pointer(highoffsetptr)), uintptr(whence))
newlowoffset = uint32(r0)
if newlowoffset == 0xffffffff {
err = errnoErr(e1)
@@ -3261,7 +3316,7 @@ func SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence
}
func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) {
- r1, _, e1 := syscall.Syscall6(procSetFileTime.Addr(), 4, uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procSetFileTime.Addr(), uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3269,7 +3324,7 @@ func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetim
}
func SetFileValidData(handle Handle, validDataLength int64) (err error) {
- r1, _, e1 := syscall.Syscall(procSetFileValidData.Addr(), 2, uintptr(handle), uintptr(validDataLength), 0)
+ r1, _, e1 := syscall.SyscallN(procSetFileValidData.Addr(), uintptr(handle), uintptr(validDataLength))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3277,7 +3332,7 @@ func SetFileValidData(handle Handle, validDataLength int64) (err error) {
}
func SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procSetHandleInformation.Addr(), 3, uintptr(handle), uintptr(mask), uintptr(flags))
+ r1, _, e1 := syscall.SyscallN(procSetHandleInformation.Addr(), uintptr(handle), uintptr(mask), uintptr(flags))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3285,7 +3340,7 @@ func SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error)
}
func SetInformationJobObject(job Handle, JobObjectInformationClass uint32, JobObjectInformation uintptr, JobObjectInformationLength uint32) (ret int, err error) {
- r0, _, e1 := syscall.Syscall6(procSetInformationJobObject.Addr(), 4, uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procSetInformationJobObject.Addr(), uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength))
ret = int(r0)
if ret == 0 {
err = errnoErr(e1)
@@ -3294,7 +3349,7 @@ func SetInformationJobObject(job Handle, JobObjectInformationClass uint32, JobOb
}
func SetNamedPipeHandleState(pipe Handle, state *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procSetNamedPipeHandleState.Addr(), 4, uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procSetNamedPipeHandleState.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3302,7 +3357,7 @@ func SetNamedPipeHandleState(pipe Handle, state *uint32, maxCollectionCount *uin
}
func SetPriorityClass(process Handle, priorityClass uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procSetPriorityClass.Addr(), 2, uintptr(process), uintptr(priorityClass), 0)
+ r1, _, e1 := syscall.SyscallN(procSetPriorityClass.Addr(), uintptr(process), uintptr(priorityClass))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3314,7 +3369,7 @@ func SetProcessPriorityBoost(process Handle, disable bool) (err error) {
if disable {
_p0 = 1
}
- r1, _, e1 := syscall.Syscall(procSetProcessPriorityBoost.Addr(), 2, uintptr(process), uintptr(_p0), 0)
+ r1, _, e1 := syscall.SyscallN(procSetProcessPriorityBoost.Addr(), uintptr(process), uintptr(_p0))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3322,7 +3377,7 @@ func SetProcessPriorityBoost(process Handle, disable bool) (err error) {
}
func SetProcessShutdownParameters(level uint32, flags uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procSetProcessShutdownParameters.Addr(), 2, uintptr(level), uintptr(flags), 0)
+ r1, _, e1 := syscall.SyscallN(procSetProcessShutdownParameters.Addr(), uintptr(level), uintptr(flags))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3330,7 +3385,7 @@ func SetProcessShutdownParameters(level uint32, flags uint32) (err error) {
}
func SetProcessWorkingSetSizeEx(hProcess Handle, dwMinimumWorkingSetSize uintptr, dwMaximumWorkingSetSize uintptr, flags uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procSetProcessWorkingSetSizeEx.Addr(), 4, uintptr(hProcess), uintptr(dwMinimumWorkingSetSize), uintptr(dwMaximumWorkingSetSize), uintptr(flags), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procSetProcessWorkingSetSizeEx.Addr(), uintptr(hProcess), uintptr(dwMinimumWorkingSetSize), uintptr(dwMaximumWorkingSetSize), uintptr(flags))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3338,7 +3393,7 @@ func SetProcessWorkingSetSizeEx(hProcess Handle, dwMinimumWorkingSetSize uintptr
}
func SetStdHandle(stdhandle uint32, handle Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procSetStdHandle.Addr(), 2, uintptr(stdhandle), uintptr(handle), 0)
+ r1, _, e1 := syscall.SyscallN(procSetStdHandle.Addr(), uintptr(stdhandle), uintptr(handle))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3346,7 +3401,7 @@ func SetStdHandle(stdhandle uint32, handle Handle) (err error) {
}
func SetVolumeLabel(rootPathName *uint16, volumeName *uint16) (err error) {
- r1, _, e1 := syscall.Syscall(procSetVolumeLabelW.Addr(), 2, uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeName)), 0)
+ r1, _, e1 := syscall.SyscallN(procSetVolumeLabelW.Addr(), uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeName)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3354,7 +3409,7 @@ func SetVolumeLabel(rootPathName *uint16, volumeName *uint16) (err error) {
}
func SetVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16) (err error) {
- r1, _, e1 := syscall.Syscall(procSetVolumeMountPointW.Addr(), 2, uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(unsafe.Pointer(volumeName)), 0)
+ r1, _, e1 := syscall.SyscallN(procSetVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(unsafe.Pointer(volumeName)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3362,7 +3417,7 @@ func SetVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16) (err erro
}
func SetupComm(handle Handle, dwInQueue uint32, dwOutQueue uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procSetupComm.Addr(), 3, uintptr(handle), uintptr(dwInQueue), uintptr(dwOutQueue))
+ r1, _, e1 := syscall.SyscallN(procSetupComm.Addr(), uintptr(handle), uintptr(dwInQueue), uintptr(dwOutQueue))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3370,7 +3425,7 @@ func SetupComm(handle Handle, dwInQueue uint32, dwOutQueue uint32) (err error) {
}
func SizeofResource(module Handle, resInfo Handle) (size uint32, err error) {
- r0, _, e1 := syscall.Syscall(procSizeofResource.Addr(), 2, uintptr(module), uintptr(resInfo), 0)
+ r0, _, e1 := syscall.SyscallN(procSizeofResource.Addr(), uintptr(module), uintptr(resInfo))
size = uint32(r0)
if size == 0 {
err = errnoErr(e1)
@@ -3383,13 +3438,13 @@ func SleepEx(milliseconds uint32, alertable bool) (ret uint32) {
if alertable {
_p0 = 1
}
- r0, _, _ := syscall.Syscall(procSleepEx.Addr(), 2, uintptr(milliseconds), uintptr(_p0), 0)
+ r0, _, _ := syscall.SyscallN(procSleepEx.Addr(), uintptr(milliseconds), uintptr(_p0))
ret = uint32(r0)
return
}
func TerminateJobObject(job Handle, exitCode uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procTerminateJobObject.Addr(), 2, uintptr(job), uintptr(exitCode), 0)
+ r1, _, e1 := syscall.SyscallN(procTerminateJobObject.Addr(), uintptr(job), uintptr(exitCode))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3397,7 +3452,7 @@ func TerminateJobObject(job Handle, exitCode uint32) (err error) {
}
func TerminateProcess(handle Handle, exitcode uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procTerminateProcess.Addr(), 2, uintptr(handle), uintptr(exitcode), 0)
+ r1, _, e1 := syscall.SyscallN(procTerminateProcess.Addr(), uintptr(handle), uintptr(exitcode))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3405,7 +3460,7 @@ func TerminateProcess(handle Handle, exitcode uint32) (err error) {
}
func Thread32First(snapshot Handle, threadEntry *ThreadEntry32) (err error) {
- r1, _, e1 := syscall.Syscall(procThread32First.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(threadEntry)), 0)
+ r1, _, e1 := syscall.SyscallN(procThread32First.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(threadEntry)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3413,7 +3468,7 @@ func Thread32First(snapshot Handle, threadEntry *ThreadEntry32) (err error) {
}
func Thread32Next(snapshot Handle, threadEntry *ThreadEntry32) (err error) {
- r1, _, e1 := syscall.Syscall(procThread32Next.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(threadEntry)), 0)
+ r1, _, e1 := syscall.SyscallN(procThread32Next.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(threadEntry)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3421,7 +3476,7 @@ func Thread32Next(snapshot Handle, threadEntry *ThreadEntry32) (err error) {
}
func UnlockFileEx(file Handle, reserved uint32, bytesLow uint32, bytesHigh uint32, overlapped *Overlapped) (err error) {
- r1, _, e1 := syscall.Syscall6(procUnlockFileEx.Addr(), 5, uintptr(file), uintptr(reserved), uintptr(bytesLow), uintptr(bytesHigh), uintptr(unsafe.Pointer(overlapped)), 0)
+ r1, _, e1 := syscall.SyscallN(procUnlockFileEx.Addr(), uintptr(file), uintptr(reserved), uintptr(bytesLow), uintptr(bytesHigh), uintptr(unsafe.Pointer(overlapped)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3429,7 +3484,7 @@ func UnlockFileEx(file Handle, reserved uint32, bytesLow uint32, bytesHigh uint3
}
func UnmapViewOfFile(addr uintptr) (err error) {
- r1, _, e1 := syscall.Syscall(procUnmapViewOfFile.Addr(), 1, uintptr(addr), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procUnmapViewOfFile.Addr(), uintptr(addr))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3437,7 +3492,7 @@ func UnmapViewOfFile(addr uintptr) (err error) {
}
func updateProcThreadAttribute(attrlist *ProcThreadAttributeList, flags uint32, attr uintptr, value unsafe.Pointer, size uintptr, prevvalue unsafe.Pointer, returnedsize *uintptr) (err error) {
- r1, _, e1 := syscall.Syscall9(procUpdateProcThreadAttribute.Addr(), 7, uintptr(unsafe.Pointer(attrlist)), uintptr(flags), uintptr(attr), uintptr(value), uintptr(size), uintptr(prevvalue), uintptr(unsafe.Pointer(returnedsize)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procUpdateProcThreadAttribute.Addr(), uintptr(unsafe.Pointer(attrlist)), uintptr(flags), uintptr(attr), uintptr(value), uintptr(size), uintptr(prevvalue), uintptr(unsafe.Pointer(returnedsize)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3445,7 +3500,7 @@ func updateProcThreadAttribute(attrlist *ProcThreadAttributeList, flags uint32,
}
func VirtualAlloc(address uintptr, size uintptr, alloctype uint32, protect uint32) (value uintptr, err error) {
- r0, _, e1 := syscall.Syscall6(procVirtualAlloc.Addr(), 4, uintptr(address), uintptr(size), uintptr(alloctype), uintptr(protect), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procVirtualAlloc.Addr(), uintptr(address), uintptr(size), uintptr(alloctype), uintptr(protect))
value = uintptr(r0)
if value == 0 {
err = errnoErr(e1)
@@ -3454,7 +3509,7 @@ func VirtualAlloc(address uintptr, size uintptr, alloctype uint32, protect uint3
}
func VirtualFree(address uintptr, size uintptr, freetype uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procVirtualFree.Addr(), 3, uintptr(address), uintptr(size), uintptr(freetype))
+ r1, _, e1 := syscall.SyscallN(procVirtualFree.Addr(), uintptr(address), uintptr(size), uintptr(freetype))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3462,7 +3517,7 @@ func VirtualFree(address uintptr, size uintptr, freetype uint32) (err error) {
}
func VirtualLock(addr uintptr, length uintptr) (err error) {
- r1, _, e1 := syscall.Syscall(procVirtualLock.Addr(), 2, uintptr(addr), uintptr(length), 0)
+ r1, _, e1 := syscall.SyscallN(procVirtualLock.Addr(), uintptr(addr), uintptr(length))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3470,7 +3525,7 @@ func VirtualLock(addr uintptr, length uintptr) (err error) {
}
func VirtualProtect(address uintptr, size uintptr, newprotect uint32, oldprotect *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procVirtualProtect.Addr(), 4, uintptr(address), uintptr(size), uintptr(newprotect), uintptr(unsafe.Pointer(oldprotect)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procVirtualProtect.Addr(), uintptr(address), uintptr(size), uintptr(newprotect), uintptr(unsafe.Pointer(oldprotect)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3478,7 +3533,7 @@ func VirtualProtect(address uintptr, size uintptr, newprotect uint32, oldprotect
}
func VirtualProtectEx(process Handle, address uintptr, size uintptr, newProtect uint32, oldProtect *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procVirtualProtectEx.Addr(), 5, uintptr(process), uintptr(address), uintptr(size), uintptr(newProtect), uintptr(unsafe.Pointer(oldProtect)), 0)
+ r1, _, e1 := syscall.SyscallN(procVirtualProtectEx.Addr(), uintptr(process), uintptr(address), uintptr(size), uintptr(newProtect), uintptr(unsafe.Pointer(oldProtect)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3486,7 +3541,7 @@ func VirtualProtectEx(process Handle, address uintptr, size uintptr, newProtect
}
func VirtualQuery(address uintptr, buffer *MemoryBasicInformation, length uintptr) (err error) {
- r1, _, e1 := syscall.Syscall(procVirtualQuery.Addr(), 3, uintptr(address), uintptr(unsafe.Pointer(buffer)), uintptr(length))
+ r1, _, e1 := syscall.SyscallN(procVirtualQuery.Addr(), uintptr(address), uintptr(unsafe.Pointer(buffer)), uintptr(length))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3494,7 +3549,7 @@ func VirtualQuery(address uintptr, buffer *MemoryBasicInformation, length uintpt
}
func VirtualQueryEx(process Handle, address uintptr, buffer *MemoryBasicInformation, length uintptr) (err error) {
- r1, _, e1 := syscall.Syscall6(procVirtualQueryEx.Addr(), 4, uintptr(process), uintptr(address), uintptr(unsafe.Pointer(buffer)), uintptr(length), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procVirtualQueryEx.Addr(), uintptr(process), uintptr(address), uintptr(unsafe.Pointer(buffer)), uintptr(length))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3502,7 +3557,7 @@ func VirtualQueryEx(process Handle, address uintptr, buffer *MemoryBasicInformat
}
func VirtualUnlock(addr uintptr, length uintptr) (err error) {
- r1, _, e1 := syscall.Syscall(procVirtualUnlock.Addr(), 2, uintptr(addr), uintptr(length), 0)
+ r1, _, e1 := syscall.SyscallN(procVirtualUnlock.Addr(), uintptr(addr), uintptr(length))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3510,13 +3565,13 @@ func VirtualUnlock(addr uintptr, length uintptr) (err error) {
}
func WTSGetActiveConsoleSessionId() (sessionID uint32) {
- r0, _, _ := syscall.Syscall(procWTSGetActiveConsoleSessionId.Addr(), 0, 0, 0, 0)
+ r0, _, _ := syscall.SyscallN(procWTSGetActiveConsoleSessionId.Addr())
sessionID = uint32(r0)
return
}
func WaitCommEvent(handle Handle, lpEvtMask *uint32, lpOverlapped *Overlapped) (err error) {
- r1, _, e1 := syscall.Syscall(procWaitCommEvent.Addr(), 3, uintptr(handle), uintptr(unsafe.Pointer(lpEvtMask)), uintptr(unsafe.Pointer(lpOverlapped)))
+ r1, _, e1 := syscall.SyscallN(procWaitCommEvent.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpEvtMask)), uintptr(unsafe.Pointer(lpOverlapped)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3528,7 +3583,7 @@ func waitForMultipleObjects(count uint32, handles uintptr, waitAll bool, waitMil
if waitAll {
_p0 = 1
}
- r0, _, e1 := syscall.Syscall6(procWaitForMultipleObjects.Addr(), 4, uintptr(count), uintptr(handles), uintptr(_p0), uintptr(waitMilliseconds), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procWaitForMultipleObjects.Addr(), uintptr(count), uintptr(handles), uintptr(_p0), uintptr(waitMilliseconds))
event = uint32(r0)
if event == 0xffffffff {
err = errnoErr(e1)
@@ -3537,7 +3592,7 @@ func waitForMultipleObjects(count uint32, handles uintptr, waitAll bool, waitMil
}
func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err error) {
- r0, _, e1 := syscall.Syscall(procWaitForSingleObject.Addr(), 2, uintptr(handle), uintptr(waitMilliseconds), 0)
+ r0, _, e1 := syscall.SyscallN(procWaitForSingleObject.Addr(), uintptr(handle), uintptr(waitMilliseconds))
event = uint32(r0)
if event == 0xffffffff {
err = errnoErr(e1)
@@ -3546,7 +3601,7 @@ func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32,
}
func WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) {
- r1, _, e1 := syscall.Syscall6(procWriteConsoleW.Addr(), 5, uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(towrite), uintptr(unsafe.Pointer(written)), uintptr(unsafe.Pointer(reserved)), 0)
+ r1, _, e1 := syscall.SyscallN(procWriteConsoleW.Addr(), uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(towrite), uintptr(unsafe.Pointer(written)), uintptr(unsafe.Pointer(reserved)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3558,7 +3613,7 @@ func writeFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped)
if len(buf) > 0 {
_p0 = &buf[0]
}
- r1, _, e1 := syscall.Syscall6(procWriteFile.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped)), 0)
+ r1, _, e1 := syscall.SyscallN(procWriteFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3566,7 +3621,7 @@ func writeFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped)
}
func WriteProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size uintptr, numberOfBytesWritten *uintptr) (err error) {
- r1, _, e1 := syscall.Syscall6(procWriteProcessMemory.Addr(), 5, uintptr(process), uintptr(baseAddress), uintptr(unsafe.Pointer(buffer)), uintptr(size), uintptr(unsafe.Pointer(numberOfBytesWritten)), 0)
+ r1, _, e1 := syscall.SyscallN(procWriteProcessMemory.Addr(), uintptr(process), uintptr(baseAddress), uintptr(unsafe.Pointer(buffer)), uintptr(size), uintptr(unsafe.Pointer(numberOfBytesWritten)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3574,7 +3629,7 @@ func WriteProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size
}
func AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, recvd *uint32, overlapped *Overlapped) (err error) {
- r1, _, e1 := syscall.Syscall9(procAcceptEx.Addr(), 8, uintptr(ls), uintptr(as), uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(overlapped)), 0)
+ r1, _, e1 := syscall.SyscallN(procAcceptEx.Addr(), uintptr(ls), uintptr(as), uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(overlapped)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3582,12 +3637,12 @@ func AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32
}
func GetAcceptExSockaddrs(buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, lrsa **RawSockaddrAny, lrsalen *int32, rrsa **RawSockaddrAny, rrsalen *int32) {
- syscall.Syscall9(procGetAcceptExSockaddrs.Addr(), 8, uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(lrsa)), uintptr(unsafe.Pointer(lrsalen)), uintptr(unsafe.Pointer(rrsa)), uintptr(unsafe.Pointer(rrsalen)), 0)
+ syscall.SyscallN(procGetAcceptExSockaddrs.Addr(), uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(lrsa)), uintptr(unsafe.Pointer(lrsalen)), uintptr(unsafe.Pointer(rrsa)), uintptr(unsafe.Pointer(rrsalen)))
return
}
func TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (err error) {
- r1, _, e1 := syscall.Syscall9(procTransmitFile.Addr(), 7, uintptr(s), uintptr(handle), uintptr(bytesToWrite), uintptr(bytsPerSend), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(transmitFileBuf)), uintptr(flags), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procTransmitFile.Addr(), uintptr(s), uintptr(handle), uintptr(bytesToWrite), uintptr(bytsPerSend), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(transmitFileBuf)), uintptr(flags))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3595,7 +3650,7 @@ func TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint
}
func NetApiBufferFree(buf *byte) (neterr error) {
- r0, _, _ := syscall.Syscall(procNetApiBufferFree.Addr(), 1, uintptr(unsafe.Pointer(buf)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procNetApiBufferFree.Addr(), uintptr(unsafe.Pointer(buf)))
if r0 != 0 {
neterr = syscall.Errno(r0)
}
@@ -3603,7 +3658,7 @@ func NetApiBufferFree(buf *byte) (neterr error) {
}
func NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error) {
- r0, _, _ := syscall.Syscall(procNetGetJoinInformation.Addr(), 3, uintptr(unsafe.Pointer(server)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bufType)))
+ r0, _, _ := syscall.SyscallN(procNetGetJoinInformation.Addr(), uintptr(unsafe.Pointer(server)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bufType)))
if r0 != 0 {
neterr = syscall.Errno(r0)
}
@@ -3611,7 +3666,7 @@ func NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (nete
}
func NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, prefMaxLen uint32, entriesRead *uint32, totalEntries *uint32, resumeHandle *uint32) (neterr error) {
- r0, _, _ := syscall.Syscall9(procNetUserEnum.Addr(), 8, uintptr(unsafe.Pointer(serverName)), uintptr(level), uintptr(filter), uintptr(unsafe.Pointer(buf)), uintptr(prefMaxLen), uintptr(unsafe.Pointer(entriesRead)), uintptr(unsafe.Pointer(totalEntries)), uintptr(unsafe.Pointer(resumeHandle)), 0)
+ r0, _, _ := syscall.SyscallN(procNetUserEnum.Addr(), uintptr(unsafe.Pointer(serverName)), uintptr(level), uintptr(filter), uintptr(unsafe.Pointer(buf)), uintptr(prefMaxLen), uintptr(unsafe.Pointer(entriesRead)), uintptr(unsafe.Pointer(totalEntries)), uintptr(unsafe.Pointer(resumeHandle)))
if r0 != 0 {
neterr = syscall.Errno(r0)
}
@@ -3619,7 +3674,7 @@ func NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, pr
}
func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) {
- r0, _, _ := syscall.Syscall6(procNetUserGetInfo.Addr(), 4, uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procNetUserGetInfo.Addr(), uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf)))
if r0 != 0 {
neterr = syscall.Errno(r0)
}
@@ -3627,7 +3682,7 @@ func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **by
}
func NtCreateFile(handle *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, allocationSize *int64, attributes uint32, share uint32, disposition uint32, options uint32, eabuffer uintptr, ealength uint32) (ntstatus error) {
- r0, _, _ := syscall.Syscall12(procNtCreateFile.Addr(), 11, uintptr(unsafe.Pointer(handle)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(allocationSize)), uintptr(attributes), uintptr(share), uintptr(disposition), uintptr(options), uintptr(eabuffer), uintptr(ealength), 0)
+ r0, _, _ := syscall.SyscallN(procNtCreateFile.Addr(), uintptr(unsafe.Pointer(handle)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(allocationSize)), uintptr(attributes), uintptr(share), uintptr(disposition), uintptr(options), uintptr(eabuffer), uintptr(ealength))
if r0 != 0 {
ntstatus = NTStatus(r0)
}
@@ -3635,7 +3690,7 @@ func NtCreateFile(handle *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO
}
func NtCreateNamedPipeFile(pipe *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (ntstatus error) {
- r0, _, _ := syscall.Syscall15(procNtCreateNamedPipeFile.Addr(), 14, uintptr(unsafe.Pointer(pipe)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(share), uintptr(disposition), uintptr(options), uintptr(typ), uintptr(readMode), uintptr(completionMode), uintptr(maxInstances), uintptr(inboundQuota), uintptr(outputQuota), uintptr(unsafe.Pointer(timeout)), 0)
+ r0, _, _ := syscall.SyscallN(procNtCreateNamedPipeFile.Addr(), uintptr(unsafe.Pointer(pipe)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(share), uintptr(disposition), uintptr(options), uintptr(typ), uintptr(readMode), uintptr(completionMode), uintptr(maxInstances), uintptr(inboundQuota), uintptr(outputQuota), uintptr(unsafe.Pointer(timeout)))
if r0 != 0 {
ntstatus = NTStatus(r0)
}
@@ -3643,7 +3698,7 @@ func NtCreateNamedPipeFile(pipe *Handle, access uint32, oa *OBJECT_ATTRIBUTES, i
}
func NtQueryInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32, retLen *uint32) (ntstatus error) {
- r0, _, _ := syscall.Syscall6(procNtQueryInformationProcess.Addr(), 5, uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen), uintptr(unsafe.Pointer(retLen)), 0)
+ r0, _, _ := syscall.SyscallN(procNtQueryInformationProcess.Addr(), uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen), uintptr(unsafe.Pointer(retLen)))
if r0 != 0 {
ntstatus = NTStatus(r0)
}
@@ -3651,7 +3706,7 @@ func NtQueryInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe
}
func NtQuerySystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32, retLen *uint32) (ntstatus error) {
- r0, _, _ := syscall.Syscall6(procNtQuerySystemInformation.Addr(), 4, uintptr(sysInfoClass), uintptr(sysInfo), uintptr(sysInfoLen), uintptr(unsafe.Pointer(retLen)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procNtQuerySystemInformation.Addr(), uintptr(sysInfoClass), uintptr(sysInfo), uintptr(sysInfoLen), uintptr(unsafe.Pointer(retLen)))
if r0 != 0 {
ntstatus = NTStatus(r0)
}
@@ -3659,7 +3714,7 @@ func NtQuerySystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInf
}
func NtSetInformationFile(handle Handle, iosb *IO_STATUS_BLOCK, inBuffer *byte, inBufferLen uint32, class uint32) (ntstatus error) {
- r0, _, _ := syscall.Syscall6(procNtSetInformationFile.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen), uintptr(class), 0)
+ r0, _, _ := syscall.SyscallN(procNtSetInformationFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen), uintptr(class))
if r0 != 0 {
ntstatus = NTStatus(r0)
}
@@ -3667,7 +3722,7 @@ func NtSetInformationFile(handle Handle, iosb *IO_STATUS_BLOCK, inBuffer *byte,
}
func NtSetInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32) (ntstatus error) {
- r0, _, _ := syscall.Syscall6(procNtSetInformationProcess.Addr(), 4, uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen), 0, 0)
+ r0, _, _ := syscall.SyscallN(procNtSetInformationProcess.Addr(), uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen))
if r0 != 0 {
ntstatus = NTStatus(r0)
}
@@ -3675,7 +3730,7 @@ func NtSetInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.P
}
func NtSetSystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32) (ntstatus error) {
- r0, _, _ := syscall.Syscall(procNtSetSystemInformation.Addr(), 3, uintptr(sysInfoClass), uintptr(sysInfo), uintptr(sysInfoLen))
+ r0, _, _ := syscall.SyscallN(procNtSetSystemInformation.Addr(), uintptr(sysInfoClass), uintptr(sysInfo), uintptr(sysInfoLen))
if r0 != 0 {
ntstatus = NTStatus(r0)
}
@@ -3683,13 +3738,13 @@ func NtSetSystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoL
}
func RtlAddFunctionTable(functionTable *RUNTIME_FUNCTION, entryCount uint32, baseAddress uintptr) (ret bool) {
- r0, _, _ := syscall.Syscall(procRtlAddFunctionTable.Addr(), 3, uintptr(unsafe.Pointer(functionTable)), uintptr(entryCount), uintptr(baseAddress))
+ r0, _, _ := syscall.SyscallN(procRtlAddFunctionTable.Addr(), uintptr(unsafe.Pointer(functionTable)), uintptr(entryCount), uintptr(baseAddress))
ret = r0 != 0
return
}
func RtlDefaultNpAcl(acl **ACL) (ntstatus error) {
- r0, _, _ := syscall.Syscall(procRtlDefaultNpAcl.Addr(), 1, uintptr(unsafe.Pointer(acl)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procRtlDefaultNpAcl.Addr(), uintptr(unsafe.Pointer(acl)))
if r0 != 0 {
ntstatus = NTStatus(r0)
}
@@ -3697,13 +3752,13 @@ func RtlDefaultNpAcl(acl **ACL) (ntstatus error) {
}
func RtlDeleteFunctionTable(functionTable *RUNTIME_FUNCTION) (ret bool) {
- r0, _, _ := syscall.Syscall(procRtlDeleteFunctionTable.Addr(), 1, uintptr(unsafe.Pointer(functionTable)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procRtlDeleteFunctionTable.Addr(), uintptr(unsafe.Pointer(functionTable)))
ret = r0 != 0
return
}
func RtlDosPathNameToNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) {
- r0, _, _ := syscall.Syscall6(procRtlDosPathNameToNtPathName_U_WithStatus.Addr(), 4, uintptr(unsafe.Pointer(dosName)), uintptr(unsafe.Pointer(ntName)), uintptr(unsafe.Pointer(ntFileNamePart)), uintptr(unsafe.Pointer(relativeName)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procRtlDosPathNameToNtPathName_U_WithStatus.Addr(), uintptr(unsafe.Pointer(dosName)), uintptr(unsafe.Pointer(ntName)), uintptr(unsafe.Pointer(ntFileNamePart)), uintptr(unsafe.Pointer(relativeName)))
if r0 != 0 {
ntstatus = NTStatus(r0)
}
@@ -3711,7 +3766,7 @@ func RtlDosPathNameToNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFile
}
func RtlDosPathNameToRelativeNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) {
- r0, _, _ := syscall.Syscall6(procRtlDosPathNameToRelativeNtPathName_U_WithStatus.Addr(), 4, uintptr(unsafe.Pointer(dosName)), uintptr(unsafe.Pointer(ntName)), uintptr(unsafe.Pointer(ntFileNamePart)), uintptr(unsafe.Pointer(relativeName)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procRtlDosPathNameToRelativeNtPathName_U_WithStatus.Addr(), uintptr(unsafe.Pointer(dosName)), uintptr(unsafe.Pointer(ntName)), uintptr(unsafe.Pointer(ntFileNamePart)), uintptr(unsafe.Pointer(relativeName)))
if r0 != 0 {
ntstatus = NTStatus(r0)
}
@@ -3719,18 +3774,18 @@ func RtlDosPathNameToRelativeNtPathName(dosName *uint16, ntName *NTUnicodeString
}
func RtlGetCurrentPeb() (peb *PEB) {
- r0, _, _ := syscall.Syscall(procRtlGetCurrentPeb.Addr(), 0, 0, 0, 0)
+ r0, _, _ := syscall.SyscallN(procRtlGetCurrentPeb.Addr())
peb = (*PEB)(unsafe.Pointer(r0))
return
}
func rtlGetNtVersionNumbers(majorVersion *uint32, minorVersion *uint32, buildNumber *uint32) {
- syscall.Syscall(procRtlGetNtVersionNumbers.Addr(), 3, uintptr(unsafe.Pointer(majorVersion)), uintptr(unsafe.Pointer(minorVersion)), uintptr(unsafe.Pointer(buildNumber)))
+ syscall.SyscallN(procRtlGetNtVersionNumbers.Addr(), uintptr(unsafe.Pointer(majorVersion)), uintptr(unsafe.Pointer(minorVersion)), uintptr(unsafe.Pointer(buildNumber)))
return
}
func rtlGetVersion(info *OsVersionInfoEx) (ntstatus error) {
- r0, _, _ := syscall.Syscall(procRtlGetVersion.Addr(), 1, uintptr(unsafe.Pointer(info)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procRtlGetVersion.Addr(), uintptr(unsafe.Pointer(info)))
if r0 != 0 {
ntstatus = NTStatus(r0)
}
@@ -3738,23 +3793,23 @@ func rtlGetVersion(info *OsVersionInfoEx) (ntstatus error) {
}
func RtlInitString(destinationString *NTString, sourceString *byte) {
- syscall.Syscall(procRtlInitString.Addr(), 2, uintptr(unsafe.Pointer(destinationString)), uintptr(unsafe.Pointer(sourceString)), 0)
+ syscall.SyscallN(procRtlInitString.Addr(), uintptr(unsafe.Pointer(destinationString)), uintptr(unsafe.Pointer(sourceString)))
return
}
func RtlInitUnicodeString(destinationString *NTUnicodeString, sourceString *uint16) {
- syscall.Syscall(procRtlInitUnicodeString.Addr(), 2, uintptr(unsafe.Pointer(destinationString)), uintptr(unsafe.Pointer(sourceString)), 0)
+ syscall.SyscallN(procRtlInitUnicodeString.Addr(), uintptr(unsafe.Pointer(destinationString)), uintptr(unsafe.Pointer(sourceString)))
return
}
func rtlNtStatusToDosErrorNoTeb(ntstatus NTStatus) (ret syscall.Errno) {
- r0, _, _ := syscall.Syscall(procRtlNtStatusToDosErrorNoTeb.Addr(), 1, uintptr(ntstatus), 0, 0)
+ r0, _, _ := syscall.SyscallN(procRtlNtStatusToDosErrorNoTeb.Addr(), uintptr(ntstatus))
ret = syscall.Errno(r0)
return
}
func clsidFromString(lpsz *uint16, pclsid *GUID) (ret error) {
- r0, _, _ := syscall.Syscall(procCLSIDFromString.Addr(), 2, uintptr(unsafe.Pointer(lpsz)), uintptr(unsafe.Pointer(pclsid)), 0)
+ r0, _, _ := syscall.SyscallN(procCLSIDFromString.Addr(), uintptr(unsafe.Pointer(lpsz)), uintptr(unsafe.Pointer(pclsid)))
if r0 != 0 {
ret = syscall.Errno(r0)
}
@@ -3762,7 +3817,7 @@ func clsidFromString(lpsz *uint16, pclsid *GUID) (ret error) {
}
func coCreateGuid(pguid *GUID) (ret error) {
- r0, _, _ := syscall.Syscall(procCoCreateGuid.Addr(), 1, uintptr(unsafe.Pointer(pguid)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procCoCreateGuid.Addr(), uintptr(unsafe.Pointer(pguid)))
if r0 != 0 {
ret = syscall.Errno(r0)
}
@@ -3770,7 +3825,7 @@ func coCreateGuid(pguid *GUID) (ret error) {
}
func CoGetObject(name *uint16, bindOpts *BIND_OPTS3, guid *GUID, functionTable **uintptr) (ret error) {
- r0, _, _ := syscall.Syscall6(procCoGetObject.Addr(), 4, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bindOpts)), uintptr(unsafe.Pointer(guid)), uintptr(unsafe.Pointer(functionTable)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procCoGetObject.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bindOpts)), uintptr(unsafe.Pointer(guid)), uintptr(unsafe.Pointer(functionTable)))
if r0 != 0 {
ret = syscall.Errno(r0)
}
@@ -3778,7 +3833,7 @@ func CoGetObject(name *uint16, bindOpts *BIND_OPTS3, guid *GUID, functionTable *
}
func CoInitializeEx(reserved uintptr, coInit uint32) (ret error) {
- r0, _, _ := syscall.Syscall(procCoInitializeEx.Addr(), 2, uintptr(reserved), uintptr(coInit), 0)
+ r0, _, _ := syscall.SyscallN(procCoInitializeEx.Addr(), uintptr(reserved), uintptr(coInit))
if r0 != 0 {
ret = syscall.Errno(r0)
}
@@ -3786,23 +3841,23 @@ func CoInitializeEx(reserved uintptr, coInit uint32) (ret error) {
}
func CoTaskMemFree(address unsafe.Pointer) {
- syscall.Syscall(procCoTaskMemFree.Addr(), 1, uintptr(address), 0, 0)
+ syscall.SyscallN(procCoTaskMemFree.Addr(), uintptr(address))
return
}
func CoUninitialize() {
- syscall.Syscall(procCoUninitialize.Addr(), 0, 0, 0, 0)
+ syscall.SyscallN(procCoUninitialize.Addr())
return
}
func stringFromGUID2(rguid *GUID, lpsz *uint16, cchMax int32) (chars int32) {
- r0, _, _ := syscall.Syscall(procStringFromGUID2.Addr(), 3, uintptr(unsafe.Pointer(rguid)), uintptr(unsafe.Pointer(lpsz)), uintptr(cchMax))
+ r0, _, _ := syscall.SyscallN(procStringFromGUID2.Addr(), uintptr(unsafe.Pointer(rguid)), uintptr(unsafe.Pointer(lpsz)), uintptr(cchMax))
chars = int32(r0)
return
}
func EnumProcessModules(process Handle, module *Handle, cb uint32, cbNeeded *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procEnumProcessModules.Addr(), 4, uintptr(process), uintptr(unsafe.Pointer(module)), uintptr(cb), uintptr(unsafe.Pointer(cbNeeded)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procEnumProcessModules.Addr(), uintptr(process), uintptr(unsafe.Pointer(module)), uintptr(cb), uintptr(unsafe.Pointer(cbNeeded)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3810,7 +3865,7 @@ func EnumProcessModules(process Handle, module *Handle, cb uint32, cbNeeded *uin
}
func EnumProcessModulesEx(process Handle, module *Handle, cb uint32, cbNeeded *uint32, filterFlag uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procEnumProcessModulesEx.Addr(), 5, uintptr(process), uintptr(unsafe.Pointer(module)), uintptr(cb), uintptr(unsafe.Pointer(cbNeeded)), uintptr(filterFlag), 0)
+ r1, _, e1 := syscall.SyscallN(procEnumProcessModulesEx.Addr(), uintptr(process), uintptr(unsafe.Pointer(module)), uintptr(cb), uintptr(unsafe.Pointer(cbNeeded)), uintptr(filterFlag))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3818,7 +3873,7 @@ func EnumProcessModulesEx(process Handle, module *Handle, cb uint32, cbNeeded *u
}
func enumProcesses(processIds *uint32, nSize uint32, bytesReturned *uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procEnumProcesses.Addr(), 3, uintptr(unsafe.Pointer(processIds)), uintptr(nSize), uintptr(unsafe.Pointer(bytesReturned)))
+ r1, _, e1 := syscall.SyscallN(procEnumProcesses.Addr(), uintptr(unsafe.Pointer(processIds)), uintptr(nSize), uintptr(unsafe.Pointer(bytesReturned)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3826,7 +3881,7 @@ func enumProcesses(processIds *uint32, nSize uint32, bytesReturned *uint32) (err
}
func GetModuleBaseName(process Handle, module Handle, baseName *uint16, size uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procGetModuleBaseNameW.Addr(), 4, uintptr(process), uintptr(module), uintptr(unsafe.Pointer(baseName)), uintptr(size), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procGetModuleBaseNameW.Addr(), uintptr(process), uintptr(module), uintptr(unsafe.Pointer(baseName)), uintptr(size))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3834,7 +3889,7 @@ func GetModuleBaseName(process Handle, module Handle, baseName *uint16, size uin
}
func GetModuleFileNameEx(process Handle, module Handle, filename *uint16, size uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procGetModuleFileNameExW.Addr(), 4, uintptr(process), uintptr(module), uintptr(unsafe.Pointer(filename)), uintptr(size), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procGetModuleFileNameExW.Addr(), uintptr(process), uintptr(module), uintptr(unsafe.Pointer(filename)), uintptr(size))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3842,7 +3897,7 @@ func GetModuleFileNameEx(process Handle, module Handle, filename *uint16, size u
}
func GetModuleInformation(process Handle, module Handle, modinfo *ModuleInfo, cb uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procGetModuleInformation.Addr(), 4, uintptr(process), uintptr(module), uintptr(unsafe.Pointer(modinfo)), uintptr(cb), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procGetModuleInformation.Addr(), uintptr(process), uintptr(module), uintptr(unsafe.Pointer(modinfo)), uintptr(cb))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3850,7 +3905,7 @@ func GetModuleInformation(process Handle, module Handle, modinfo *ModuleInfo, cb
}
func QueryWorkingSetEx(process Handle, pv uintptr, cb uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procQueryWorkingSetEx.Addr(), 3, uintptr(process), uintptr(pv), uintptr(cb))
+ r1, _, e1 := syscall.SyscallN(procQueryWorkingSetEx.Addr(), uintptr(process), uintptr(pv), uintptr(cb))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3862,7 +3917,7 @@ func SubscribeServiceChangeNotifications(service Handle, eventType uint32, callb
if ret != nil {
return
}
- r0, _, _ := syscall.Syscall6(procSubscribeServiceChangeNotifications.Addr(), 5, uintptr(service), uintptr(eventType), uintptr(callback), uintptr(callbackCtx), uintptr(unsafe.Pointer(subscription)), 0)
+ r0, _, _ := syscall.SyscallN(procSubscribeServiceChangeNotifications.Addr(), uintptr(service), uintptr(eventType), uintptr(callback), uintptr(callbackCtx), uintptr(unsafe.Pointer(subscription)))
if r0 != 0 {
ret = syscall.Errno(r0)
}
@@ -3874,12 +3929,12 @@ func UnsubscribeServiceChangeNotifications(subscription uintptr) (err error) {
if err != nil {
return
}
- syscall.Syscall(procUnsubscribeServiceChangeNotifications.Addr(), 1, uintptr(subscription), 0, 0)
+ syscall.SyscallN(procUnsubscribeServiceChangeNotifications.Addr(), uintptr(subscription))
return
}
func GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procGetUserNameExW.Addr(), 3, uintptr(nameFormat), uintptr(unsafe.Pointer(nameBuffre)), uintptr(unsafe.Pointer(nSize)))
+ r1, _, e1 := syscall.SyscallN(procGetUserNameExW.Addr(), uintptr(nameFormat), uintptr(unsafe.Pointer(nameBuffre)), uintptr(unsafe.Pointer(nSize)))
if r1&0xff == 0 {
err = errnoErr(e1)
}
@@ -3887,7 +3942,7 @@ func GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err er
}
func TranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint32, translatedName *uint16, nSize *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procTranslateNameW.Addr(), 5, uintptr(unsafe.Pointer(accName)), uintptr(accNameFormat), uintptr(desiredNameFormat), uintptr(unsafe.Pointer(translatedName)), uintptr(unsafe.Pointer(nSize)), 0)
+ r1, _, e1 := syscall.SyscallN(procTranslateNameW.Addr(), uintptr(unsafe.Pointer(accName)), uintptr(accNameFormat), uintptr(desiredNameFormat), uintptr(unsafe.Pointer(translatedName)), uintptr(unsafe.Pointer(nSize)))
if r1&0xff == 0 {
err = errnoErr(e1)
}
@@ -3895,7 +3950,7 @@ func TranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint
}
func SetupDiBuildDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT) (err error) {
- r1, _, e1 := syscall.Syscall(procSetupDiBuildDriverInfoList.Addr(), 3, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType))
+ r1, _, e1 := syscall.SyscallN(procSetupDiBuildDriverInfoList.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3903,7 +3958,7 @@ func SetupDiBuildDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfoDa
}
func SetupDiCallClassInstaller(installFunction DI_FUNCTION, deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error) {
- r1, _, e1 := syscall.Syscall(procSetupDiCallClassInstaller.Addr(), 3, uintptr(installFunction), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)))
+ r1, _, e1 := syscall.SyscallN(procSetupDiCallClassInstaller.Addr(), uintptr(installFunction), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3911,7 +3966,7 @@ func SetupDiCallClassInstaller(installFunction DI_FUNCTION, deviceInfoSet DevInf
}
func SetupDiCancelDriverInfoSearch(deviceInfoSet DevInfo) (err error) {
- r1, _, e1 := syscall.Syscall(procSetupDiCancelDriverInfoSearch.Addr(), 1, uintptr(deviceInfoSet), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procSetupDiCancelDriverInfoSearch.Addr(), uintptr(deviceInfoSet))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3919,7 +3974,7 @@ func SetupDiCancelDriverInfoSearch(deviceInfoSet DevInfo) (err error) {
}
func setupDiClassGuidsFromNameEx(className *uint16, classGuidList *GUID, classGuidListSize uint32, requiredSize *uint32, machineName *uint16, reserved uintptr) (err error) {
- r1, _, e1 := syscall.Syscall6(procSetupDiClassGuidsFromNameExW.Addr(), 6, uintptr(unsafe.Pointer(className)), uintptr(unsafe.Pointer(classGuidList)), uintptr(classGuidListSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(unsafe.Pointer(machineName)), uintptr(reserved))
+ r1, _, e1 := syscall.SyscallN(procSetupDiClassGuidsFromNameExW.Addr(), uintptr(unsafe.Pointer(className)), uintptr(unsafe.Pointer(classGuidList)), uintptr(classGuidListSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(unsafe.Pointer(machineName)), uintptr(reserved))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3927,7 +3982,7 @@ func setupDiClassGuidsFromNameEx(className *uint16, classGuidList *GUID, classGu
}
func setupDiClassNameFromGuidEx(classGUID *GUID, className *uint16, classNameSize uint32, requiredSize *uint32, machineName *uint16, reserved uintptr) (err error) {
- r1, _, e1 := syscall.Syscall6(procSetupDiClassNameFromGuidExW.Addr(), 6, uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(className)), uintptr(classNameSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(unsafe.Pointer(machineName)), uintptr(reserved))
+ r1, _, e1 := syscall.SyscallN(procSetupDiClassNameFromGuidExW.Addr(), uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(className)), uintptr(classNameSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(unsafe.Pointer(machineName)), uintptr(reserved))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3935,7 +3990,7 @@ func setupDiClassNameFromGuidEx(classGUID *GUID, className *uint16, classNameSiz
}
func setupDiCreateDeviceInfoListEx(classGUID *GUID, hwndParent uintptr, machineName *uint16, reserved uintptr) (handle DevInfo, err error) {
- r0, _, e1 := syscall.Syscall6(procSetupDiCreateDeviceInfoListExW.Addr(), 4, uintptr(unsafe.Pointer(classGUID)), uintptr(hwndParent), uintptr(unsafe.Pointer(machineName)), uintptr(reserved), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procSetupDiCreateDeviceInfoListExW.Addr(), uintptr(unsafe.Pointer(classGUID)), uintptr(hwndParent), uintptr(unsafe.Pointer(machineName)), uintptr(reserved))
handle = DevInfo(r0)
if handle == DevInfo(InvalidHandle) {
err = errnoErr(e1)
@@ -3944,7 +3999,7 @@ func setupDiCreateDeviceInfoListEx(classGUID *GUID, hwndParent uintptr, machineN
}
func setupDiCreateDeviceInfo(deviceInfoSet DevInfo, DeviceName *uint16, classGUID *GUID, DeviceDescription *uint16, hwndParent uintptr, CreationFlags DICD, deviceInfoData *DevInfoData) (err error) {
- r1, _, e1 := syscall.Syscall9(procSetupDiCreateDeviceInfoW.Addr(), 7, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(DeviceName)), uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(DeviceDescription)), uintptr(hwndParent), uintptr(CreationFlags), uintptr(unsafe.Pointer(deviceInfoData)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procSetupDiCreateDeviceInfoW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(DeviceName)), uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(DeviceDescription)), uintptr(hwndParent), uintptr(CreationFlags), uintptr(unsafe.Pointer(deviceInfoData)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3952,7 +4007,7 @@ func setupDiCreateDeviceInfo(deviceInfoSet DevInfo, DeviceName *uint16, classGUI
}
func SetupDiDestroyDeviceInfoList(deviceInfoSet DevInfo) (err error) {
- r1, _, e1 := syscall.Syscall(procSetupDiDestroyDeviceInfoList.Addr(), 1, uintptr(deviceInfoSet), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procSetupDiDestroyDeviceInfoList.Addr(), uintptr(deviceInfoSet))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3960,7 +4015,7 @@ func SetupDiDestroyDeviceInfoList(deviceInfoSet DevInfo) (err error) {
}
func SetupDiDestroyDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT) (err error) {
- r1, _, e1 := syscall.Syscall(procSetupDiDestroyDriverInfoList.Addr(), 3, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType))
+ r1, _, e1 := syscall.SyscallN(procSetupDiDestroyDriverInfoList.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3968,7 +4023,7 @@ func SetupDiDestroyDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfo
}
func setupDiEnumDeviceInfo(deviceInfoSet DevInfo, memberIndex uint32, deviceInfoData *DevInfoData) (err error) {
- r1, _, e1 := syscall.Syscall(procSetupDiEnumDeviceInfo.Addr(), 3, uintptr(deviceInfoSet), uintptr(memberIndex), uintptr(unsafe.Pointer(deviceInfoData)))
+ r1, _, e1 := syscall.SyscallN(procSetupDiEnumDeviceInfo.Addr(), uintptr(deviceInfoSet), uintptr(memberIndex), uintptr(unsafe.Pointer(deviceInfoData)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3976,7 +4031,7 @@ func setupDiEnumDeviceInfo(deviceInfoSet DevInfo, memberIndex uint32, deviceInfo
}
func setupDiEnumDriverInfo(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT, memberIndex uint32, driverInfoData *DrvInfoData) (err error) {
- r1, _, e1 := syscall.Syscall6(procSetupDiEnumDriverInfoW.Addr(), 5, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType), uintptr(memberIndex), uintptr(unsafe.Pointer(driverInfoData)), 0)
+ r1, _, e1 := syscall.SyscallN(procSetupDiEnumDriverInfoW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType), uintptr(memberIndex), uintptr(unsafe.Pointer(driverInfoData)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -3984,7 +4039,7 @@ func setupDiEnumDriverInfo(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, d
}
func setupDiGetClassDevsEx(classGUID *GUID, Enumerator *uint16, hwndParent uintptr, Flags DIGCF, deviceInfoSet DevInfo, machineName *uint16, reserved uintptr) (handle DevInfo, err error) {
- r0, _, e1 := syscall.Syscall9(procSetupDiGetClassDevsExW.Addr(), 7, uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(Enumerator)), uintptr(hwndParent), uintptr(Flags), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(machineName)), uintptr(reserved), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procSetupDiGetClassDevsExW.Addr(), uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(Enumerator)), uintptr(hwndParent), uintptr(Flags), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(machineName)), uintptr(reserved))
handle = DevInfo(r0)
if handle == DevInfo(InvalidHandle) {
err = errnoErr(e1)
@@ -3993,7 +4048,7 @@ func setupDiGetClassDevsEx(classGUID *GUID, Enumerator *uint16, hwndParent uintp
}
func SetupDiGetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, classInstallParams *ClassInstallHeader, classInstallParamsSize uint32, requiredSize *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procSetupDiGetClassInstallParamsW.Addr(), 5, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(classInstallParams)), uintptr(classInstallParamsSize), uintptr(unsafe.Pointer(requiredSize)), 0)
+ r1, _, e1 := syscall.SyscallN(procSetupDiGetClassInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(classInstallParams)), uintptr(classInstallParamsSize), uintptr(unsafe.Pointer(requiredSize)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4001,7 +4056,7 @@ func SetupDiGetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfo
}
func setupDiGetDeviceInfoListDetail(deviceInfoSet DevInfo, deviceInfoSetDetailData *DevInfoListDetailData) (err error) {
- r1, _, e1 := syscall.Syscall(procSetupDiGetDeviceInfoListDetailW.Addr(), 2, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoSetDetailData)), 0)
+ r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceInfoListDetailW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoSetDetailData)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4009,7 +4064,7 @@ func setupDiGetDeviceInfoListDetail(deviceInfoSet DevInfo, deviceInfoSetDetailDa
}
func setupDiGetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, deviceInstallParams *DevInstallParams) (err error) {
- r1, _, e1 := syscall.Syscall(procSetupDiGetDeviceInstallParamsW.Addr(), 3, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(deviceInstallParams)))
+ r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(deviceInstallParams)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4017,7 +4072,7 @@ func setupDiGetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInf
}
func setupDiGetDeviceInstanceId(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, instanceId *uint16, instanceIdSize uint32, instanceIdRequiredSize *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procSetupDiGetDeviceInstanceIdW.Addr(), 5, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(instanceId)), uintptr(instanceIdSize), uintptr(unsafe.Pointer(instanceIdRequiredSize)), 0)
+ r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceInstanceIdW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(instanceId)), uintptr(instanceIdSize), uintptr(unsafe.Pointer(instanceIdRequiredSize)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4025,7 +4080,7 @@ func setupDiGetDeviceInstanceId(deviceInfoSet DevInfo, deviceInfoData *DevInfoDa
}
func setupDiGetDeviceProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, propertyKey *DEVPROPKEY, propertyType *DEVPROPTYPE, propertyBuffer *byte, propertyBufferSize uint32, requiredSize *uint32, flags uint32) (err error) {
- r1, _, e1 := syscall.Syscall9(procSetupDiGetDevicePropertyW.Addr(), 8, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(propertyKey)), uintptr(unsafe.Pointer(propertyType)), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(flags), 0)
+ r1, _, e1 := syscall.SyscallN(procSetupDiGetDevicePropertyW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(propertyKey)), uintptr(unsafe.Pointer(propertyType)), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(flags))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4033,7 +4088,7 @@ func setupDiGetDeviceProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData
}
func setupDiGetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, property SPDRP, propertyRegDataType *uint32, propertyBuffer *byte, propertyBufferSize uint32, requiredSize *uint32) (err error) {
- r1, _, e1 := syscall.Syscall9(procSetupDiGetDeviceRegistryPropertyW.Addr(), 7, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(property), uintptr(unsafe.Pointer(propertyRegDataType)), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), uintptr(unsafe.Pointer(requiredSize)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceRegistryPropertyW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(property), uintptr(unsafe.Pointer(propertyRegDataType)), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), uintptr(unsafe.Pointer(requiredSize)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4041,7 +4096,7 @@ func setupDiGetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *Dev
}
func setupDiGetDriverInfoDetail(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData, driverInfoDetailData *DrvInfoDetailData, driverInfoDetailDataSize uint32, requiredSize *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procSetupDiGetDriverInfoDetailW.Addr(), 6, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData)), uintptr(unsafe.Pointer(driverInfoDetailData)), uintptr(driverInfoDetailDataSize), uintptr(unsafe.Pointer(requiredSize)))
+ r1, _, e1 := syscall.SyscallN(procSetupDiGetDriverInfoDetailW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData)), uintptr(unsafe.Pointer(driverInfoDetailData)), uintptr(driverInfoDetailDataSize), uintptr(unsafe.Pointer(requiredSize)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4049,7 +4104,7 @@ func setupDiGetDriverInfoDetail(deviceInfoSet DevInfo, deviceInfoData *DevInfoDa
}
func setupDiGetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error) {
- r1, _, e1 := syscall.Syscall(procSetupDiGetSelectedDevice.Addr(), 2, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), 0)
+ r1, _, e1 := syscall.SyscallN(procSetupDiGetSelectedDevice.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4057,7 +4112,7 @@ func setupDiGetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData
}
func setupDiGetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData) (err error) {
- r1, _, e1 := syscall.Syscall(procSetupDiGetSelectedDriverW.Addr(), 3, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData)))
+ r1, _, e1 := syscall.SyscallN(procSetupDiGetSelectedDriverW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4065,7 +4120,7 @@ func setupDiGetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData
}
func SetupDiOpenDevRegKey(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, Scope DICS_FLAG, HwProfile uint32, KeyType DIREG, samDesired uint32) (key Handle, err error) {
- r0, _, e1 := syscall.Syscall6(procSetupDiOpenDevRegKey.Addr(), 6, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(Scope), uintptr(HwProfile), uintptr(KeyType), uintptr(samDesired))
+ r0, _, e1 := syscall.SyscallN(procSetupDiOpenDevRegKey.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(Scope), uintptr(HwProfile), uintptr(KeyType), uintptr(samDesired))
key = Handle(r0)
if key == InvalidHandle {
err = errnoErr(e1)
@@ -4074,7 +4129,7 @@ func SetupDiOpenDevRegKey(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, Sc
}
func SetupDiSetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, classInstallParams *ClassInstallHeader, classInstallParamsSize uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procSetupDiSetClassInstallParamsW.Addr(), 4, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(classInstallParams)), uintptr(classInstallParamsSize), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procSetupDiSetClassInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(classInstallParams)), uintptr(classInstallParamsSize))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4082,7 +4137,7 @@ func SetupDiSetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfo
}
func SetupDiSetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, deviceInstallParams *DevInstallParams) (err error) {
- r1, _, e1 := syscall.Syscall(procSetupDiSetDeviceInstallParamsW.Addr(), 3, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(deviceInstallParams)))
+ r1, _, e1 := syscall.SyscallN(procSetupDiSetDeviceInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(deviceInstallParams)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4090,7 +4145,7 @@ func SetupDiSetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInf
}
func setupDiSetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, property SPDRP, propertyBuffer *byte, propertyBufferSize uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procSetupDiSetDeviceRegistryPropertyW.Addr(), 5, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(property), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), 0)
+ r1, _, e1 := syscall.SyscallN(procSetupDiSetDeviceRegistryPropertyW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(property), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4098,7 +4153,7 @@ func setupDiSetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *Dev
}
func SetupDiSetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error) {
- r1, _, e1 := syscall.Syscall(procSetupDiSetSelectedDevice.Addr(), 2, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), 0)
+ r1, _, e1 := syscall.SyscallN(procSetupDiSetSelectedDevice.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4106,7 +4161,7 @@ func SetupDiSetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData
}
func SetupDiSetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData) (err error) {
- r1, _, e1 := syscall.Syscall(procSetupDiSetSelectedDriverW.Addr(), 3, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData)))
+ r1, _, e1 := syscall.SyscallN(procSetupDiSetSelectedDriverW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4114,7 +4169,7 @@ func SetupDiSetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData
}
func setupUninstallOEMInf(infFileName *uint16, flags SUOI, reserved uintptr) (err error) {
- r1, _, e1 := syscall.Syscall(procSetupUninstallOEMInfW.Addr(), 3, uintptr(unsafe.Pointer(infFileName)), uintptr(flags), uintptr(reserved))
+ r1, _, e1 := syscall.SyscallN(procSetupUninstallOEMInfW.Addr(), uintptr(unsafe.Pointer(infFileName)), uintptr(flags), uintptr(reserved))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4122,7 +4177,7 @@ func setupUninstallOEMInf(infFileName *uint16, flags SUOI, reserved uintptr) (er
}
func commandLineToArgv(cmd *uint16, argc *int32) (argv **uint16, err error) {
- r0, _, e1 := syscall.Syscall(procCommandLineToArgvW.Addr(), 2, uintptr(unsafe.Pointer(cmd)), uintptr(unsafe.Pointer(argc)), 0)
+ r0, _, e1 := syscall.SyscallN(procCommandLineToArgvW.Addr(), uintptr(unsafe.Pointer(cmd)), uintptr(unsafe.Pointer(argc)))
argv = (**uint16)(unsafe.Pointer(r0))
if argv == nil {
err = errnoErr(e1)
@@ -4131,7 +4186,7 @@ func commandLineToArgv(cmd *uint16, argc *int32) (argv **uint16, err error) {
}
func shGetKnownFolderPath(id *KNOWNFOLDERID, flags uint32, token Token, path **uint16) (ret error) {
- r0, _, _ := syscall.Syscall6(procSHGetKnownFolderPath.Addr(), 4, uintptr(unsafe.Pointer(id)), uintptr(flags), uintptr(token), uintptr(unsafe.Pointer(path)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procSHGetKnownFolderPath.Addr(), uintptr(unsafe.Pointer(id)), uintptr(flags), uintptr(token), uintptr(unsafe.Pointer(path)))
if r0 != 0 {
ret = syscall.Errno(r0)
}
@@ -4139,7 +4194,7 @@ func shGetKnownFolderPath(id *KNOWNFOLDERID, flags uint32, token Token, path **u
}
func ShellExecute(hwnd Handle, verb *uint16, file *uint16, args *uint16, cwd *uint16, showCmd int32) (err error) {
- r1, _, e1 := syscall.Syscall6(procShellExecuteW.Addr(), 6, uintptr(hwnd), uintptr(unsafe.Pointer(verb)), uintptr(unsafe.Pointer(file)), uintptr(unsafe.Pointer(args)), uintptr(unsafe.Pointer(cwd)), uintptr(showCmd))
+ r1, _, e1 := syscall.SyscallN(procShellExecuteW.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(verb)), uintptr(unsafe.Pointer(file)), uintptr(unsafe.Pointer(args)), uintptr(unsafe.Pointer(cwd)), uintptr(showCmd))
if r1 <= 32 {
err = errnoErr(e1)
}
@@ -4147,12 +4202,12 @@ func ShellExecute(hwnd Handle, verb *uint16, file *uint16, args *uint16, cwd *ui
}
func EnumChildWindows(hwnd HWND, enumFunc uintptr, param unsafe.Pointer) {
- syscall.Syscall(procEnumChildWindows.Addr(), 3, uintptr(hwnd), uintptr(enumFunc), uintptr(param))
+ syscall.SyscallN(procEnumChildWindows.Addr(), uintptr(hwnd), uintptr(enumFunc), uintptr(param))
return
}
func EnumWindows(enumFunc uintptr, param unsafe.Pointer) (err error) {
- r1, _, e1 := syscall.Syscall(procEnumWindows.Addr(), 2, uintptr(enumFunc), uintptr(param), 0)
+ r1, _, e1 := syscall.SyscallN(procEnumWindows.Addr(), uintptr(enumFunc), uintptr(param))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4160,7 +4215,7 @@ func EnumWindows(enumFunc uintptr, param unsafe.Pointer) (err error) {
}
func ExitWindowsEx(flags uint32, reason uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procExitWindowsEx.Addr(), 2, uintptr(flags), uintptr(reason), 0)
+ r1, _, e1 := syscall.SyscallN(procExitWindowsEx.Addr(), uintptr(flags), uintptr(reason))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4168,7 +4223,7 @@ func ExitWindowsEx(flags uint32, reason uint32) (err error) {
}
func GetClassName(hwnd HWND, className *uint16, maxCount int32) (copied int32, err error) {
- r0, _, e1 := syscall.Syscall(procGetClassNameW.Addr(), 3, uintptr(hwnd), uintptr(unsafe.Pointer(className)), uintptr(maxCount))
+ r0, _, e1 := syscall.SyscallN(procGetClassNameW.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(className)), uintptr(maxCount))
copied = int32(r0)
if copied == 0 {
err = errnoErr(e1)
@@ -4177,19 +4232,19 @@ func GetClassName(hwnd HWND, className *uint16, maxCount int32) (copied int32, e
}
func GetDesktopWindow() (hwnd HWND) {
- r0, _, _ := syscall.Syscall(procGetDesktopWindow.Addr(), 0, 0, 0, 0)
+ r0, _, _ := syscall.SyscallN(procGetDesktopWindow.Addr())
hwnd = HWND(r0)
return
}
func GetForegroundWindow() (hwnd HWND) {
- r0, _, _ := syscall.Syscall(procGetForegroundWindow.Addr(), 0, 0, 0, 0)
+ r0, _, _ := syscall.SyscallN(procGetForegroundWindow.Addr())
hwnd = HWND(r0)
return
}
func GetGUIThreadInfo(thread uint32, info *GUIThreadInfo) (err error) {
- r1, _, e1 := syscall.Syscall(procGetGUIThreadInfo.Addr(), 2, uintptr(thread), uintptr(unsafe.Pointer(info)), 0)
+ r1, _, e1 := syscall.SyscallN(procGetGUIThreadInfo.Addr(), uintptr(thread), uintptr(unsafe.Pointer(info)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4197,19 +4252,19 @@ func GetGUIThreadInfo(thread uint32, info *GUIThreadInfo) (err error) {
}
func GetKeyboardLayout(tid uint32) (hkl Handle) {
- r0, _, _ := syscall.Syscall(procGetKeyboardLayout.Addr(), 1, uintptr(tid), 0, 0)
+ r0, _, _ := syscall.SyscallN(procGetKeyboardLayout.Addr(), uintptr(tid))
hkl = Handle(r0)
return
}
func GetShellWindow() (shellWindow HWND) {
- r0, _, _ := syscall.Syscall(procGetShellWindow.Addr(), 0, 0, 0, 0)
+ r0, _, _ := syscall.SyscallN(procGetShellWindow.Addr())
shellWindow = HWND(r0)
return
}
func GetWindowThreadProcessId(hwnd HWND, pid *uint32) (tid uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetWindowThreadProcessId.Addr(), 2, uintptr(hwnd), uintptr(unsafe.Pointer(pid)), 0)
+ r0, _, e1 := syscall.SyscallN(procGetWindowThreadProcessId.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(pid)))
tid = uint32(r0)
if tid == 0 {
err = errnoErr(e1)
@@ -4218,25 +4273,25 @@ func GetWindowThreadProcessId(hwnd HWND, pid *uint32) (tid uint32, err error) {
}
func IsWindow(hwnd HWND) (isWindow bool) {
- r0, _, _ := syscall.Syscall(procIsWindow.Addr(), 1, uintptr(hwnd), 0, 0)
+ r0, _, _ := syscall.SyscallN(procIsWindow.Addr(), uintptr(hwnd))
isWindow = r0 != 0
return
}
func IsWindowUnicode(hwnd HWND) (isUnicode bool) {
- r0, _, _ := syscall.Syscall(procIsWindowUnicode.Addr(), 1, uintptr(hwnd), 0, 0)
+ r0, _, _ := syscall.SyscallN(procIsWindowUnicode.Addr(), uintptr(hwnd))
isUnicode = r0 != 0
return
}
func IsWindowVisible(hwnd HWND) (isVisible bool) {
- r0, _, _ := syscall.Syscall(procIsWindowVisible.Addr(), 1, uintptr(hwnd), 0, 0)
+ r0, _, _ := syscall.SyscallN(procIsWindowVisible.Addr(), uintptr(hwnd))
isVisible = r0 != 0
return
}
func LoadKeyboardLayout(name *uint16, flags uint32) (hkl Handle, err error) {
- r0, _, e1 := syscall.Syscall(procLoadKeyboardLayoutW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(flags), 0)
+ r0, _, e1 := syscall.SyscallN(procLoadKeyboardLayoutW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(flags))
hkl = Handle(r0)
if hkl == 0 {
err = errnoErr(e1)
@@ -4245,7 +4300,7 @@ func LoadKeyboardLayout(name *uint16, flags uint32) (hkl Handle, err error) {
}
func MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret int32, err error) {
- r0, _, e1 := syscall.Syscall6(procMessageBoxW.Addr(), 4, uintptr(hwnd), uintptr(unsafe.Pointer(text)), uintptr(unsafe.Pointer(caption)), uintptr(boxtype), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procMessageBoxW.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(text)), uintptr(unsafe.Pointer(caption)), uintptr(boxtype))
ret = int32(r0)
if ret == 0 {
err = errnoErr(e1)
@@ -4254,13 +4309,13 @@ func MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret i
}
func ToUnicodeEx(vkey uint32, scancode uint32, keystate *byte, pwszBuff *uint16, cchBuff int32, flags uint32, hkl Handle) (ret int32) {
- r0, _, _ := syscall.Syscall9(procToUnicodeEx.Addr(), 7, uintptr(vkey), uintptr(scancode), uintptr(unsafe.Pointer(keystate)), uintptr(unsafe.Pointer(pwszBuff)), uintptr(cchBuff), uintptr(flags), uintptr(hkl), 0, 0)
+ r0, _, _ := syscall.SyscallN(procToUnicodeEx.Addr(), uintptr(vkey), uintptr(scancode), uintptr(unsafe.Pointer(keystate)), uintptr(unsafe.Pointer(pwszBuff)), uintptr(cchBuff), uintptr(flags), uintptr(hkl))
ret = int32(r0)
return
}
func UnloadKeyboardLayout(hkl Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procUnloadKeyboardLayout.Addr(), 1, uintptr(hkl), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procUnloadKeyboardLayout.Addr(), uintptr(hkl))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4272,7 +4327,7 @@ func CreateEnvironmentBlock(block **uint16, token Token, inheritExisting bool) (
if inheritExisting {
_p0 = 1
}
- r1, _, e1 := syscall.Syscall(procCreateEnvironmentBlock.Addr(), 3, uintptr(unsafe.Pointer(block)), uintptr(token), uintptr(_p0))
+ r1, _, e1 := syscall.SyscallN(procCreateEnvironmentBlock.Addr(), uintptr(unsafe.Pointer(block)), uintptr(token), uintptr(_p0))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4280,7 +4335,7 @@ func CreateEnvironmentBlock(block **uint16, token Token, inheritExisting bool) (
}
func DestroyEnvironmentBlock(block *uint16) (err error) {
- r1, _, e1 := syscall.Syscall(procDestroyEnvironmentBlock.Addr(), 1, uintptr(unsafe.Pointer(block)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procDestroyEnvironmentBlock.Addr(), uintptr(unsafe.Pointer(block)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4288,7 +4343,7 @@ func DestroyEnvironmentBlock(block *uint16) (err error) {
}
func GetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procGetUserProfileDirectoryW.Addr(), 3, uintptr(t), uintptr(unsafe.Pointer(dir)), uintptr(unsafe.Pointer(dirLen)))
+ r1, _, e1 := syscall.SyscallN(procGetUserProfileDirectoryW.Addr(), uintptr(t), uintptr(unsafe.Pointer(dir)), uintptr(unsafe.Pointer(dirLen)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4305,7 +4360,7 @@ func GetFileVersionInfoSize(filename string, zeroHandle *Handle) (bufSize uint32
}
func _GetFileVersionInfoSize(filename *uint16, zeroHandle *Handle) (bufSize uint32, err error) {
- r0, _, e1 := syscall.Syscall(procGetFileVersionInfoSizeW.Addr(), 2, uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(zeroHandle)), 0)
+ r0, _, e1 := syscall.SyscallN(procGetFileVersionInfoSizeW.Addr(), uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(zeroHandle)))
bufSize = uint32(r0)
if bufSize == 0 {
err = errnoErr(e1)
@@ -4323,7 +4378,7 @@ func GetFileVersionInfo(filename string, handle uint32, bufSize uint32, buffer u
}
func _GetFileVersionInfo(filename *uint16, handle uint32, bufSize uint32, buffer unsafe.Pointer) (err error) {
- r1, _, e1 := syscall.Syscall6(procGetFileVersionInfoW.Addr(), 4, uintptr(unsafe.Pointer(filename)), uintptr(handle), uintptr(bufSize), uintptr(buffer), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procGetFileVersionInfoW.Addr(), uintptr(unsafe.Pointer(filename)), uintptr(handle), uintptr(bufSize), uintptr(buffer))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4340,7 +4395,7 @@ func VerQueryValue(block unsafe.Pointer, subBlock string, pointerToBufferPointer
}
func _VerQueryValue(block unsafe.Pointer, subBlock *uint16, pointerToBufferPointer unsafe.Pointer, bufSize *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procVerQueryValueW.Addr(), 4, uintptr(block), uintptr(unsafe.Pointer(subBlock)), uintptr(pointerToBufferPointer), uintptr(unsafe.Pointer(bufSize)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procVerQueryValueW.Addr(), uintptr(block), uintptr(unsafe.Pointer(subBlock)), uintptr(pointerToBufferPointer), uintptr(unsafe.Pointer(bufSize)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4348,7 +4403,7 @@ func _VerQueryValue(block unsafe.Pointer, subBlock *uint16, pointerToBufferPoint
}
func TimeBeginPeriod(period uint32) (err error) {
- r1, _, e1 := syscall.Syscall(proctimeBeginPeriod.Addr(), 1, uintptr(period), 0, 0)
+ r1, _, e1 := syscall.SyscallN(proctimeBeginPeriod.Addr(), uintptr(period))
if r1 != 0 {
err = errnoErr(e1)
}
@@ -4356,7 +4411,7 @@ func TimeBeginPeriod(period uint32) (err error) {
}
func TimeEndPeriod(period uint32) (err error) {
- r1, _, e1 := syscall.Syscall(proctimeEndPeriod.Addr(), 1, uintptr(period), 0, 0)
+ r1, _, e1 := syscall.SyscallN(proctimeEndPeriod.Addr(), uintptr(period))
if r1 != 0 {
err = errnoErr(e1)
}
@@ -4364,7 +4419,7 @@ func TimeEndPeriod(period uint32) (err error) {
}
func WinVerifyTrustEx(hwnd HWND, actionId *GUID, data *WinTrustData) (ret error) {
- r0, _, _ := syscall.Syscall(procWinVerifyTrustEx.Addr(), 3, uintptr(hwnd), uintptr(unsafe.Pointer(actionId)), uintptr(unsafe.Pointer(data)))
+ r0, _, _ := syscall.SyscallN(procWinVerifyTrustEx.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(actionId)), uintptr(unsafe.Pointer(data)))
if r0 != 0 {
ret = syscall.Errno(r0)
}
@@ -4372,12 +4427,12 @@ func WinVerifyTrustEx(hwnd HWND, actionId *GUID, data *WinTrustData) (ret error)
}
func FreeAddrInfoW(addrinfo *AddrinfoW) {
- syscall.Syscall(procFreeAddrInfoW.Addr(), 1, uintptr(unsafe.Pointer(addrinfo)), 0, 0)
+ syscall.SyscallN(procFreeAddrInfoW.Addr(), uintptr(unsafe.Pointer(addrinfo)))
return
}
func GetAddrInfoW(nodename *uint16, servicename *uint16, hints *AddrinfoW, result **AddrinfoW) (sockerr error) {
- r0, _, _ := syscall.Syscall6(procGetAddrInfoW.Addr(), 4, uintptr(unsafe.Pointer(nodename)), uintptr(unsafe.Pointer(servicename)), uintptr(unsafe.Pointer(hints)), uintptr(unsafe.Pointer(result)), 0, 0)
+ r0, _, _ := syscall.SyscallN(procGetAddrInfoW.Addr(), uintptr(unsafe.Pointer(nodename)), uintptr(unsafe.Pointer(servicename)), uintptr(unsafe.Pointer(hints)), uintptr(unsafe.Pointer(result)))
if r0 != 0 {
sockerr = syscall.Errno(r0)
}
@@ -4385,7 +4440,7 @@ func GetAddrInfoW(nodename *uint16, servicename *uint16, hints *AddrinfoW, resul
}
func WSACleanup() (err error) {
- r1, _, e1 := syscall.Syscall(procWSACleanup.Addr(), 0, 0, 0, 0)
+ r1, _, e1 := syscall.SyscallN(procWSACleanup.Addr())
if r1 == socket_error {
err = errnoErr(e1)
}
@@ -4393,7 +4448,7 @@ func WSACleanup() (err error) {
}
func WSADuplicateSocket(s Handle, processID uint32, info *WSAProtocolInfo) (err error) {
- r1, _, e1 := syscall.Syscall(procWSADuplicateSocketW.Addr(), 3, uintptr(s), uintptr(processID), uintptr(unsafe.Pointer(info)))
+ r1, _, e1 := syscall.SyscallN(procWSADuplicateSocketW.Addr(), uintptr(s), uintptr(processID), uintptr(unsafe.Pointer(info)))
if r1 != 0 {
err = errnoErr(e1)
}
@@ -4401,7 +4456,7 @@ func WSADuplicateSocket(s Handle, processID uint32, info *WSAProtocolInfo) (err
}
func WSAEnumProtocols(protocols *int32, protocolBuffer *WSAProtocolInfo, bufferLength *uint32) (n int32, err error) {
- r0, _, e1 := syscall.Syscall(procWSAEnumProtocolsW.Addr(), 3, uintptr(unsafe.Pointer(protocols)), uintptr(unsafe.Pointer(protocolBuffer)), uintptr(unsafe.Pointer(bufferLength)))
+ r0, _, e1 := syscall.SyscallN(procWSAEnumProtocolsW.Addr(), uintptr(unsafe.Pointer(protocols)), uintptr(unsafe.Pointer(protocolBuffer)), uintptr(unsafe.Pointer(bufferLength)))
n = int32(r0)
if n == -1 {
err = errnoErr(e1)
@@ -4414,7 +4469,7 @@ func WSAGetOverlappedResult(h Handle, o *Overlapped, bytes *uint32, wait bool, f
if wait {
_p0 = 1
}
- r1, _, e1 := syscall.Syscall6(procWSAGetOverlappedResult.Addr(), 5, uintptr(h), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(bytes)), uintptr(_p0), uintptr(unsafe.Pointer(flags)), 0)
+ r1, _, e1 := syscall.SyscallN(procWSAGetOverlappedResult.Addr(), uintptr(h), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(bytes)), uintptr(_p0), uintptr(unsafe.Pointer(flags)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4422,7 +4477,7 @@ func WSAGetOverlappedResult(h Handle, o *Overlapped, bytes *uint32, wait bool, f
}
func WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) {
- r1, _, e1 := syscall.Syscall9(procWSAIoctl.Addr(), 9, uintptr(s), uintptr(iocc), uintptr(unsafe.Pointer(inbuf)), uintptr(cbif), uintptr(unsafe.Pointer(outbuf)), uintptr(cbob), uintptr(unsafe.Pointer(cbbr)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine))
+ r1, _, e1 := syscall.SyscallN(procWSAIoctl.Addr(), uintptr(s), uintptr(iocc), uintptr(unsafe.Pointer(inbuf)), uintptr(cbif), uintptr(unsafe.Pointer(outbuf)), uintptr(cbob), uintptr(unsafe.Pointer(cbbr)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine))
if r1 == socket_error {
err = errnoErr(e1)
}
@@ -4430,7 +4485,7 @@ func WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbo
}
func WSALookupServiceBegin(querySet *WSAQUERYSET, flags uint32, handle *Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procWSALookupServiceBeginW.Addr(), 3, uintptr(unsafe.Pointer(querySet)), uintptr(flags), uintptr(unsafe.Pointer(handle)))
+ r1, _, e1 := syscall.SyscallN(procWSALookupServiceBeginW.Addr(), uintptr(unsafe.Pointer(querySet)), uintptr(flags), uintptr(unsafe.Pointer(handle)))
if r1 == socket_error {
err = errnoErr(e1)
}
@@ -4438,7 +4493,7 @@ func WSALookupServiceBegin(querySet *WSAQUERYSET, flags uint32, handle *Handle)
}
func WSALookupServiceEnd(handle Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procWSALookupServiceEnd.Addr(), 1, uintptr(handle), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procWSALookupServiceEnd.Addr(), uintptr(handle))
if r1 == socket_error {
err = errnoErr(e1)
}
@@ -4446,7 +4501,7 @@ func WSALookupServiceEnd(handle Handle) (err error) {
}
func WSALookupServiceNext(handle Handle, flags uint32, size *int32, querySet *WSAQUERYSET) (err error) {
- r1, _, e1 := syscall.Syscall6(procWSALookupServiceNextW.Addr(), 4, uintptr(handle), uintptr(flags), uintptr(unsafe.Pointer(size)), uintptr(unsafe.Pointer(querySet)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procWSALookupServiceNextW.Addr(), uintptr(handle), uintptr(flags), uintptr(unsafe.Pointer(size)), uintptr(unsafe.Pointer(querySet)))
if r1 == socket_error {
err = errnoErr(e1)
}
@@ -4454,7 +4509,7 @@ func WSALookupServiceNext(handle Handle, flags uint32, size *int32, querySet *WS
}
func WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, overlapped *Overlapped, croutine *byte) (err error) {
- r1, _, e1 := syscall.Syscall9(procWSARecv.Addr(), 7, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procWSARecv.Addr(), uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)))
if r1 == socket_error {
err = errnoErr(e1)
}
@@ -4462,7 +4517,7 @@ func WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32
}
func WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (err error) {
- r1, _, e1 := syscall.Syscall9(procWSARecvFrom.Addr(), 9, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)))
+ r1, _, e1 := syscall.SyscallN(procWSARecvFrom.Addr(), uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)))
if r1 == socket_error {
err = errnoErr(e1)
}
@@ -4470,7 +4525,7 @@ func WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *ui
}
func WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (err error) {
- r1, _, e1 := syscall.Syscall9(procWSASend.Addr(), 7, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procWSASend.Addr(), uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)))
if r1 == socket_error {
err = errnoErr(e1)
}
@@ -4478,7 +4533,7 @@ func WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32,
}
func WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (err error) {
- r1, _, e1 := syscall.Syscall9(procWSASendTo.Addr(), 9, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(to)), uintptr(tolen), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)))
+ r1, _, e1 := syscall.SyscallN(procWSASendTo.Addr(), uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(to)), uintptr(tolen), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)))
if r1 == socket_error {
err = errnoErr(e1)
}
@@ -4486,7 +4541,7 @@ func WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32
}
func WSASocket(af int32, typ int32, protocol int32, protoInfo *WSAProtocolInfo, group uint32, flags uint32) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall6(procWSASocketW.Addr(), 6, uintptr(af), uintptr(typ), uintptr(protocol), uintptr(unsafe.Pointer(protoInfo)), uintptr(group), uintptr(flags))
+ r0, _, e1 := syscall.SyscallN(procWSASocketW.Addr(), uintptr(af), uintptr(typ), uintptr(protocol), uintptr(unsafe.Pointer(protoInfo)), uintptr(group), uintptr(flags))
handle = Handle(r0)
if handle == InvalidHandle {
err = errnoErr(e1)
@@ -4495,7 +4550,7 @@ func WSASocket(af int32, typ int32, protocol int32, protoInfo *WSAProtocolInfo,
}
func WSAStartup(verreq uint32, data *WSAData) (sockerr error) {
- r0, _, _ := syscall.Syscall(procWSAStartup.Addr(), 2, uintptr(verreq), uintptr(unsafe.Pointer(data)), 0)
+ r0, _, _ := syscall.SyscallN(procWSAStartup.Addr(), uintptr(verreq), uintptr(unsafe.Pointer(data)))
if r0 != 0 {
sockerr = syscall.Errno(r0)
}
@@ -4503,7 +4558,7 @@ func WSAStartup(verreq uint32, data *WSAData) (sockerr error) {
}
func bind(s Handle, name unsafe.Pointer, namelen int32) (err error) {
- r1, _, e1 := syscall.Syscall(procbind.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen))
+ r1, _, e1 := syscall.SyscallN(procbind.Addr(), uintptr(s), uintptr(name), uintptr(namelen))
if r1 == socket_error {
err = errnoErr(e1)
}
@@ -4511,7 +4566,7 @@ func bind(s Handle, name unsafe.Pointer, namelen int32) (err error) {
}
func Closesocket(s Handle) (err error) {
- r1, _, e1 := syscall.Syscall(procclosesocket.Addr(), 1, uintptr(s), 0, 0)
+ r1, _, e1 := syscall.SyscallN(procclosesocket.Addr(), uintptr(s))
if r1 == socket_error {
err = errnoErr(e1)
}
@@ -4519,7 +4574,7 @@ func Closesocket(s Handle) (err error) {
}
func connect(s Handle, name unsafe.Pointer, namelen int32) (err error) {
- r1, _, e1 := syscall.Syscall(procconnect.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen))
+ r1, _, e1 := syscall.SyscallN(procconnect.Addr(), uintptr(s), uintptr(name), uintptr(namelen))
if r1 == socket_error {
err = errnoErr(e1)
}
@@ -4536,7 +4591,7 @@ func GetHostByName(name string) (h *Hostent, err error) {
}
func _GetHostByName(name *byte) (h *Hostent, err error) {
- r0, _, e1 := syscall.Syscall(procgethostbyname.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procgethostbyname.Addr(), uintptr(unsafe.Pointer(name)))
h = (*Hostent)(unsafe.Pointer(r0))
if h == nil {
err = errnoErr(e1)
@@ -4545,7 +4600,7 @@ func _GetHostByName(name *byte) (h *Hostent, err error) {
}
func getpeername(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) {
- r1, _, e1 := syscall.Syscall(procgetpeername.Addr(), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
+ r1, _, e1 := syscall.SyscallN(procgetpeername.Addr(), uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if r1 == socket_error {
err = errnoErr(e1)
}
@@ -4562,7 +4617,7 @@ func GetProtoByName(name string) (p *Protoent, err error) {
}
func _GetProtoByName(name *byte) (p *Protoent, err error) {
- r0, _, e1 := syscall.Syscall(procgetprotobyname.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0)
+ r0, _, e1 := syscall.SyscallN(procgetprotobyname.Addr(), uintptr(unsafe.Pointer(name)))
p = (*Protoent)(unsafe.Pointer(r0))
if p == nil {
err = errnoErr(e1)
@@ -4585,7 +4640,7 @@ func GetServByName(name string, proto string) (s *Servent, err error) {
}
func _GetServByName(name *byte, proto *byte) (s *Servent, err error) {
- r0, _, e1 := syscall.Syscall(procgetservbyname.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(proto)), 0)
+ r0, _, e1 := syscall.SyscallN(procgetservbyname.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(proto)))
s = (*Servent)(unsafe.Pointer(r0))
if s == nil {
err = errnoErr(e1)
@@ -4594,7 +4649,7 @@ func _GetServByName(name *byte, proto *byte) (s *Servent, err error) {
}
func getsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) {
- r1, _, e1 := syscall.Syscall(procgetsockname.Addr(), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
+ r1, _, e1 := syscall.SyscallN(procgetsockname.Addr(), uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if r1 == socket_error {
err = errnoErr(e1)
}
@@ -4602,7 +4657,7 @@ func getsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) {
}
func Getsockopt(s Handle, level int32, optname int32, optval *byte, optlen *int32) (err error) {
- r1, _, e1 := syscall.Syscall6(procgetsockopt.Addr(), 5, uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(unsafe.Pointer(optlen)), 0)
+ r1, _, e1 := syscall.SyscallN(procgetsockopt.Addr(), uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(unsafe.Pointer(optlen)))
if r1 == socket_error {
err = errnoErr(e1)
}
@@ -4610,7 +4665,7 @@ func Getsockopt(s Handle, level int32, optname int32, optval *byte, optlen *int3
}
func listen(s Handle, backlog int32) (err error) {
- r1, _, e1 := syscall.Syscall(proclisten.Addr(), 2, uintptr(s), uintptr(backlog), 0)
+ r1, _, e1 := syscall.SyscallN(proclisten.Addr(), uintptr(s), uintptr(backlog))
if r1 == socket_error {
err = errnoErr(e1)
}
@@ -4618,7 +4673,7 @@ func listen(s Handle, backlog int32) (err error) {
}
func Ntohs(netshort uint16) (u uint16) {
- r0, _, _ := syscall.Syscall(procntohs.Addr(), 1, uintptr(netshort), 0, 0)
+ r0, _, _ := syscall.SyscallN(procntohs.Addr(), uintptr(netshort))
u = uint16(r0)
return
}
@@ -4628,7 +4683,7 @@ func recvfrom(s Handle, buf []byte, flags int32, from *RawSockaddrAny, fromlen *
if len(buf) > 0 {
_p0 = &buf[0]
}
- r0, _, e1 := syscall.Syscall6(procrecvfrom.Addr(), 6, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
+ r0, _, e1 := syscall.SyscallN(procrecvfrom.Addr(), uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
n = int32(r0)
if n == -1 {
err = errnoErr(e1)
@@ -4641,7 +4696,7 @@ func sendto(s Handle, buf []byte, flags int32, to unsafe.Pointer, tolen int32) (
if len(buf) > 0 {
_p0 = &buf[0]
}
- r1, _, e1 := syscall.Syscall6(procsendto.Addr(), 6, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(tolen))
+ r1, _, e1 := syscall.SyscallN(procsendto.Addr(), uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(tolen))
if r1 == socket_error {
err = errnoErr(e1)
}
@@ -4649,7 +4704,7 @@ func sendto(s Handle, buf []byte, flags int32, to unsafe.Pointer, tolen int32) (
}
func Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (err error) {
- r1, _, e1 := syscall.Syscall6(procsetsockopt.Addr(), 5, uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(optlen), 0)
+ r1, _, e1 := syscall.SyscallN(procsetsockopt.Addr(), uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(optlen))
if r1 == socket_error {
err = errnoErr(e1)
}
@@ -4657,7 +4712,7 @@ func Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32
}
func shutdown(s Handle, how int32) (err error) {
- r1, _, e1 := syscall.Syscall(procshutdown.Addr(), 2, uintptr(s), uintptr(how), 0)
+ r1, _, e1 := syscall.SyscallN(procshutdown.Addr(), uintptr(s), uintptr(how))
if r1 == socket_error {
err = errnoErr(e1)
}
@@ -4665,7 +4720,7 @@ func shutdown(s Handle, how int32) (err error) {
}
func socket(af int32, typ int32, protocol int32) (handle Handle, err error) {
- r0, _, e1 := syscall.Syscall(procsocket.Addr(), 3, uintptr(af), uintptr(typ), uintptr(protocol))
+ r0, _, e1 := syscall.SyscallN(procsocket.Addr(), uintptr(af), uintptr(typ), uintptr(protocol))
handle = Handle(r0)
if handle == InvalidHandle {
err = errnoErr(e1)
@@ -4674,7 +4729,7 @@ func socket(af int32, typ int32, protocol int32) (handle Handle, err error) {
}
func WTSEnumerateSessions(handle Handle, reserved uint32, version uint32, sessions **WTS_SESSION_INFO, count *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procWTSEnumerateSessionsW.Addr(), 5, uintptr(handle), uintptr(reserved), uintptr(version), uintptr(unsafe.Pointer(sessions)), uintptr(unsafe.Pointer(count)), 0)
+ r1, _, e1 := syscall.SyscallN(procWTSEnumerateSessionsW.Addr(), uintptr(handle), uintptr(reserved), uintptr(version), uintptr(unsafe.Pointer(sessions)), uintptr(unsafe.Pointer(count)))
if r1 == 0 {
err = errnoErr(e1)
}
@@ -4682,12 +4737,12 @@ func WTSEnumerateSessions(handle Handle, reserved uint32, version uint32, sessio
}
func WTSFreeMemory(ptr uintptr) {
- syscall.Syscall(procWTSFreeMemory.Addr(), 1, uintptr(ptr), 0, 0)
+ syscall.SyscallN(procWTSFreeMemory.Addr(), uintptr(ptr))
return
}
func WTSQueryUserToken(session uint32, token *Token) (err error) {
- r1, _, e1 := syscall.Syscall(procWTSQueryUserToken.Addr(), 2, uintptr(session), uintptr(unsafe.Pointer(token)), 0)
+ r1, _, e1 := syscall.SyscallN(procWTSQueryUserToken.Addr(), uintptr(session), uintptr(unsafe.Pointer(token)))
if r1 == 0 {
err = errnoErr(e1)
}
diff --git a/vendor/golang.org/x/term/terminal.go b/vendor/golang.org/x/term/terminal.go
index bddb2e2aeb..9255449b9b 100644
--- a/vendor/golang.org/x/term/terminal.go
+++ b/vendor/golang.org/x/term/terminal.go
@@ -413,7 +413,7 @@ func (t *Terminal) eraseNPreviousChars(n int) {
}
}
-// countToLeftWord returns then number of characters from the cursor to the
+// countToLeftWord returns the number of characters from the cursor to the
// start of the previous word.
func (t *Terminal) countToLeftWord() int {
if t.pos == 0 {
@@ -438,7 +438,7 @@ func (t *Terminal) countToLeftWord() int {
return t.pos - pos
}
-// countToRightWord returns then number of characters from the cursor to the
+// countToRightWord returns the number of characters from the cursor to the
// start of the next word.
func (t *Terminal) countToRightWord() int {
pos := t.pos
@@ -478,7 +478,7 @@ func visualLength(runes []rune) int {
return length
}
-// histroryAt unlocks the terminal and relocks it while calling History.At.
+// historyAt unlocks the terminal and relocks it while calling History.At.
func (t *Terminal) historyAt(idx int) (string, bool) {
t.lock.Unlock() // Unlock to avoid deadlock if History methods use the output writer.
defer t.lock.Lock() // panic in At (or Len) protection.
diff --git a/vendor/golang.org/x/text/unicode/bidi/core.go b/vendor/golang.org/x/text/unicode/bidi/core.go
index 9d2ae547b5..fb8273236d 100644
--- a/vendor/golang.org/x/text/unicode/bidi/core.go
+++ b/vendor/golang.org/x/text/unicode/bidi/core.go
@@ -427,13 +427,6 @@ type isolatingRunSequence struct {
func (i *isolatingRunSequence) Len() int { return len(i.indexes) }
-func maxLevel(a, b level) level {
- if a > b {
- return a
- }
- return b
-}
-
// Rule X10, second bullet: Determine the start-of-sequence (sos) and end-of-sequence (eos) types,
// either L or R, for each isolating run sequence.
func (p *paragraph) isolatingRunSequence(indexes []int) *isolatingRunSequence {
@@ -474,8 +467,8 @@ func (p *paragraph) isolatingRunSequence(indexes []int) *isolatingRunSequence {
indexes: indexes,
types: types,
level: level,
- sos: typeForLevel(maxLevel(prevLevel, level)),
- eos: typeForLevel(maxLevel(succLevel, level)),
+ sos: typeForLevel(max(prevLevel, level)),
+ eos: typeForLevel(max(succLevel, level)),
}
}
diff --git a/vendor/golang.org/x/time/rate/rate.go b/vendor/golang.org/x/time/rate/rate.go
index 794b2e32bf..563270c154 100644
--- a/vendor/golang.org/x/time/rate/rate.go
+++ b/vendor/golang.org/x/time/rate/rate.go
@@ -195,7 +195,7 @@ func (r *Reservation) CancelAt(t time.Time) {
// update state
r.lim.last = t
r.lim.tokens = tokens
- if r.timeToAct == r.lim.lastEvent {
+ if r.timeToAct.Equal(r.lim.lastEvent) {
prevEvent := r.timeToAct.Add(r.limit.durationFromTokens(float64(-r.tokens)))
if !prevEvent.Before(t) {
r.lim.lastEvent = prevEvent
diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd3/stats.go b/vendor/k8s.io/apiserver/pkg/storage/etcd3/stats.go
index 227c46e10f..9f0b3f78e4 100644
--- a/vendor/k8s.io/apiserver/pkg/storage/etcd3/stats.go
+++ b/vendor/k8s.io/apiserver/pkg/storage/etcd3/stats.go
@@ -18,6 +18,7 @@ package etcd3
import (
"context"
+ "errors"
"strings"
"sync"
@@ -78,6 +79,8 @@ type sizeRevision struct {
revision int64
}
+var errStatsDisabled = errors.New("key size stats disabled")
+
func (sc *statsCache) Stats(ctx context.Context) (storage.Stats, error) {
keys, err := sc.GetKeys(ctx)
if err != nil {
@@ -100,6 +103,9 @@ func (sc *statsCache) GetKeys(ctx context.Context) ([]string, error) {
getKeys := sc.getKeys
sc.getKeysLock.Unlock()
+ if getKeys == nil {
+ return nil, errStatsDisabled
+ }
// Don't execute getKeys under lock.
return getKeys(ctx)
}
@@ -133,7 +139,10 @@ func (sc *statsCache) cleanKeysIfNeeded(ctx context.Context) {
}
keys, err := sc.GetKeys(ctx)
if err != nil {
- klog.InfoS("Error getting keys", "err", err)
+ if !errors.Is(err, errStatsDisabled) {
+ klog.InfoS("Error getting keys", "err", err)
+ }
+ return
}
sc.keysLock.Lock()
defer sc.keysLock.Unlock()
diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd3/store.go b/vendor/k8s.io/apiserver/pkg/storage/etcd3/store.go
index 6fb9fe9aa5..d8b7a00a2b 100644
--- a/vendor/k8s.io/apiserver/pkg/storage/etcd3/store.go
+++ b/vendor/k8s.io/apiserver/pkg/storage/etcd3/store.go
@@ -186,8 +186,9 @@ func New(c *kubernetes.Client, compactor Compactor, codec runtime.Codec, newFunc
newListFunc: newListFunc,
compactor: compactor,
}
- if utilfeature.DefaultFeatureGate.Enabled(features.SizeBasedListCostEstimate) {
- stats := newStatsCache(pathPrefix, s.getKeys)
+ // Collecting stats requires properly set resourcePrefix to call getKeys.
+ if resourcePrefix != "" && utilfeature.DefaultFeatureGate.Enabled(features.SizeBasedListCostEstimate) {
+ stats := newStatsCache(pathPrefix, nil)
s.stats = stats
w.stats = stats
}
@@ -631,7 +632,10 @@ func getNewItemFunc(listObj runtime.Object, v reflect.Value) func() runtime.Obje
func (s *store) Stats(ctx context.Context) (stats storage.Stats, err error) {
if s.stats != nil {
- return s.stats.Stats(ctx)
+ stats, err := s.stats.Stats(ctx)
+ if !errors.Is(err, errStatsDisabled) {
+ return stats, err
+ }
}
startTime := time.Now()
prefix, err := s.prepareKey(s.resourcePrefix)
diff --git a/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/leaselock.go b/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/leaselock.go
index 5d2054155c..79a748b74d 100644
--- a/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/leaselock.go
+++ b/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/leaselock.go
@@ -77,6 +77,9 @@ func (ll *LeaseLock) Update(ctx context.Context, ler LeaderElectionRecord) error
ll.lease.Spec = LeaderElectionRecordToLeaseSpec(&ler)
if ll.Labels != nil {
+ if ll.lease.Labels == nil {
+ ll.lease.Labels = map[string]string{}
+ }
// Only overwrite the labels that are specifically set
for k, v := range ll.Labels {
ll.lease.Labels[k] = v
diff --git a/vendor/k8s.io/client-go/util/cert/cert.go b/vendor/k8s.io/client-go/util/cert/cert.go
index 1220461264..48c78b595e 100644
--- a/vendor/k8s.io/client-go/util/cert/cert.go
+++ b/vendor/k8s.io/client-go/util/cert/cert.go
@@ -75,13 +75,15 @@ func NewSelfSignedCACert(cfg Config, key crypto.Signer) (*x509.Certificate, erro
CommonName: cfg.CommonName,
Organization: cfg.Organization,
},
- DNSNames: []string{cfg.CommonName},
NotBefore: notBefore,
NotAfter: now.Add(duration365d * 10).UTC(),
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign,
BasicConstraintsValid: true,
IsCA: true,
}
+ if len(cfg.CommonName) > 0 {
+ tmpl.DNSNames = []string{cfg.CommonName}
+ }
certDERBytes, err := x509.CreateCertificate(cryptorand.Reader, &tmpl, &tmpl, key.Public(), key)
if err != nil {
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 5568e5de4d..ddec202053 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -1,7 +1,7 @@
# cel.dev/expr v0.24.0
## explicit; go 1.22.0
cel.dev/expr
-# github.com/Azure/azure-sdk-for-go/sdk/azcore v1.19.0
+# github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0
## explicit; go 1.23.0
github.com/Azure/azure-sdk-for-go/sdk/azcore
github.com/Azure/azure-sdk-for-go/sdk/azcore/arm
@@ -24,7 +24,7 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime
github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming
github.com/Azure/azure-sdk-for-go/sdk/azcore/to
github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing
-# github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.11.0
+# github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1
## explicit; go 1.23.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity
github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal
@@ -67,6 +67,9 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources
# github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.1
## explicit; go 1.23.0
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage
+# github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2 v2.0.0
+## explicit; go 1.23.0
+github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2
# github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.4.0
## explicit; go 1.23.0
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets
@@ -82,7 +85,7 @@ github.com/Azure/go-ansiterm/winterm
github.com/Azure/msi-dataplane/pkg/dataplane
github.com/Azure/msi-dataplane/pkg/dataplane/internal/challenge
github.com/Azure/msi-dataplane/pkg/dataplane/internal/client
-# github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2
+# github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0
## explicit; go 1.18
github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache
github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential
@@ -274,7 +277,7 @@ github.com/pkg/browser
# github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
## explicit
github.com/pmezard/go-difflib/difflib
-# github.com/prometheus/client_golang v1.23.0
+# github.com/prometheus/client_golang v1.23.2
## explicit; go 1.23.0
github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil
github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/header
@@ -289,11 +292,11 @@ github.com/prometheus/client_golang/prometheus/testutil/promlint/validations
# github.com/prometheus/client_model v0.6.2
## explicit; go 1.22.0
github.com/prometheus/client_model/go
-# github.com/prometheus/common v0.65.0
+# github.com/prometheus/common v0.66.1
## explicit; go 1.23.0
github.com/prometheus/common/expfmt
github.com/prometheus/common/model
-# github.com/prometheus/otlptranslator v0.0.0-20250717125610-8549f4ab4f8f
+# github.com/prometheus/otlptranslator v0.0.2
## explicit; go 1.23.0
github.com/prometheus/otlptranslator
# github.com/prometheus/procfs v0.17.0
@@ -301,16 +304,17 @@ github.com/prometheus/otlptranslator
github.com/prometheus/procfs
github.com/prometheus/procfs/internal/fs
github.com/prometheus/procfs/internal/util
-# github.com/samber/lo v1.51.0
+# github.com/samber/lo v1.52.0
## explicit; go 1.18
github.com/samber/lo
github.com/samber/lo/internal/constraints
-github.com/samber/lo/internal/rand
+github.com/samber/lo/internal/xrand
+github.com/samber/lo/internal/xtime
github.com/samber/lo/mutable
-# github.com/spf13/cobra v1.9.1
+# github.com/spf13/cobra v1.10.1
## explicit; go 1.15
github.com/spf13/cobra
-# github.com/spf13/pflag v1.0.7
+# github.com/spf13/pflag v1.0.9
## explicit; go 1.12
github.com/spf13/pflag
# github.com/stoewer/go-strcase v1.3.1
@@ -362,7 +366,7 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil
-# go.opentelemetry.io/otel v1.37.0
+# go.opentelemetry.io/otel v1.38.0
## explicit; go 1.23.0
go.opentelemetry.io/otel
go.opentelemetry.io/otel/attribute
@@ -380,6 +384,8 @@ go.opentelemetry.io/otel/semconv/v1.26.0
go.opentelemetry.io/otel/semconv/v1.34.0
go.opentelemetry.io/otel/semconv/v1.34.0/httpconv
go.opentelemetry.io/otel/semconv/v1.34.0/rpcconv
+go.opentelemetry.io/otel/semconv/v1.37.0
+go.opentelemetry.io/otel/semconv/v1.37.0/otelconv
# go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.37.0
## explicit; go 1.23.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace
@@ -391,15 +397,15 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry
-# go.opentelemetry.io/otel/exporters/prometheus v0.59.1
+# go.opentelemetry.io/otel/exporters/prometheus v0.60.0
## explicit; go 1.23.0
go.opentelemetry.io/otel/exporters/prometheus
-# go.opentelemetry.io/otel/metric v1.37.0
+# go.opentelemetry.io/otel/metric v1.38.0
## explicit; go 1.23.0
go.opentelemetry.io/otel/metric
go.opentelemetry.io/otel/metric/embedded
go.opentelemetry.io/otel/metric/noop
-# go.opentelemetry.io/otel/sdk v1.37.0
+# go.opentelemetry.io/otel/sdk v1.38.0
## explicit; go 1.23.0
go.opentelemetry.io/otel/sdk
go.opentelemetry.io/otel/sdk/instrumentation
@@ -407,7 +413,8 @@ go.opentelemetry.io/otel/sdk/internal/env
go.opentelemetry.io/otel/sdk/internal/x
go.opentelemetry.io/otel/sdk/resource
go.opentelemetry.io/otel/sdk/trace
-# go.opentelemetry.io/otel/sdk/metric v1.37.0
+go.opentelemetry.io/otel/sdk/trace/internal/x
+# go.opentelemetry.io/otel/sdk/metric v1.38.0
## explicit; go 1.23.0
go.opentelemetry.io/otel/sdk/metric
go.opentelemetry.io/otel/sdk/metric/exemplar
@@ -415,7 +422,7 @@ go.opentelemetry.io/otel/sdk/metric/internal
go.opentelemetry.io/otel/sdk/metric/internal/aggregate
go.opentelemetry.io/otel/sdk/metric/internal/x
go.opentelemetry.io/otel/sdk/metric/metricdata
-# go.opentelemetry.io/otel/trace v1.37.0
+# go.opentelemetry.io/otel/trace v1.38.0
## explicit; go 1.23.0
go.opentelemetry.io/otel/trace
go.opentelemetry.io/otel/trace/embedded
@@ -451,8 +458,8 @@ go.yaml.in/yaml/v2
# go.yaml.in/yaml/v3 v3.0.4
## explicit; go 1.16
go.yaml.in/yaml/v3
-# golang.org/x/crypto v0.41.0
-## explicit; go 1.23.0
+# golang.org/x/crypto v0.45.0
+## explicit; go 1.24.0
golang.org/x/crypto/cryptobyte
golang.org/x/crypto/cryptobyte/asn1
golang.org/x/crypto/hkdf
@@ -465,8 +472,8 @@ golang.org/x/crypto/salsa20/salsa
# golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b
## explicit; go 1.24.0
golang.org/x/exp/slices
-# golang.org/x/net v0.43.0
-## explicit; go 1.23.0
+# golang.org/x/net v0.47.0
+## explicit; go 1.24.0
golang.org/x/net/context
golang.org/x/net/http/httpguts
golang.org/x/net/http2
@@ -480,24 +487,24 @@ golang.org/x/net/websocket
## explicit; go 1.23.0
golang.org/x/oauth2
golang.org/x/oauth2/internal
-# golang.org/x/sync v0.16.0
-## explicit; go 1.23.0
+# golang.org/x/sync v0.18.0
+## explicit; go 1.24.0
golang.org/x/sync/errgroup
golang.org/x/sync/semaphore
golang.org/x/sync/singleflight
-# golang.org/x/sys v0.35.0
-## explicit; go 1.23.0
+# golang.org/x/sys v0.38.0
+## explicit; go 1.24.0
golang.org/x/sys/cpu
golang.org/x/sys/plan9
golang.org/x/sys/unix
golang.org/x/sys/windows
golang.org/x/sys/windows/registry
golang.org/x/sys/windows/svc
-# golang.org/x/term v0.34.0
-## explicit; go 1.23.0
+# golang.org/x/term v0.37.0
+## explicit; go 1.24.0
golang.org/x/term
-# golang.org/x/text v0.28.0
-## explicit; go 1.23.0
+# golang.org/x/text v0.31.0
+## explicit; go 1.24.0
golang.org/x/text/cases
golang.org/x/text/feature/plural
golang.org/x/text/internal
@@ -515,8 +522,8 @@ golang.org/x/text/secure/bidirule
golang.org/x/text/transform
golang.org/x/text/unicode/bidi
golang.org/x/text/unicode/norm
-# golang.org/x/time v0.12.0
-## explicit; go 1.23.0
+# golang.org/x/time v0.14.0
+## explicit; go 1.24.0
golang.org/x/time/rate
# google.golang.org/genproto/googleapis/api v0.0.0-20250826171959-ef028d996bc1
## explicit; go 1.24.0
@@ -650,7 +657,7 @@ gopkg.in/natefinch/lumberjack.v2
# gopkg.in/yaml.v3 v3.0.1
## explicit
gopkg.in/yaml.v3
-# k8s.io/api v0.34.0
+# k8s.io/api v0.34.2
## explicit; go 1.24.0
k8s.io/api/admission/v1
k8s.io/api/admission/v1beta1
@@ -712,7 +719,7 @@ k8s.io/api/storage/v1
k8s.io/api/storage/v1alpha1
k8s.io/api/storage/v1beta1
k8s.io/api/storagemigration/v1alpha1
-# k8s.io/apimachinery v0.34.0
+# k8s.io/apimachinery v0.34.2
## explicit; go 1.24.0
k8s.io/apimachinery/pkg/api/equality
k8s.io/apimachinery/pkg/api/errors
@@ -783,7 +790,7 @@ k8s.io/apimachinery/pkg/version
k8s.io/apimachinery/pkg/watch
k8s.io/apimachinery/third_party/forked/golang/json
k8s.io/apimachinery/third_party/forked/golang/reflect
-# k8s.io/apiserver v0.34.0
+# k8s.io/apiserver v0.34.2
## explicit; go 1.24.0
k8s.io/apiserver/pkg/admission
k8s.io/apiserver/pkg/admission/configuration
@@ -944,7 +951,7 @@ k8s.io/apiserver/plugin/pkg/audit/webhook
k8s.io/apiserver/plugin/pkg/authenticator/token/webhook
k8s.io/apiserver/plugin/pkg/authorizer/webhook
k8s.io/apiserver/plugin/pkg/authorizer/webhook/metrics
-# k8s.io/client-go v0.34.0
+# k8s.io/client-go v0.34.2
## explicit; go 1.24.0
k8s.io/client-go/applyconfigurations
k8s.io/client-go/applyconfigurations/admissionregistration/v1
@@ -1287,7 +1294,7 @@ k8s.io/client-go/util/homedir
k8s.io/client-go/util/keyutil
k8s.io/client-go/util/retry
k8s.io/client-go/util/workqueue
-# k8s.io/cloud-provider v0.34.0
+# k8s.io/cloud-provider v0.34.2
## explicit; go 1.24.0
k8s.io/cloud-provider
k8s.io/cloud-provider/api
@@ -1307,7 +1314,7 @@ k8s.io/cloud-provider/names
k8s.io/cloud-provider/node/helpers
k8s.io/cloud-provider/options
k8s.io/cloud-provider/service/helpers
-# k8s.io/component-base v0.34.0
+# k8s.io/component-base v0.34.2
## explicit; go 1.24.0
k8s.io/component-base/cli/flag
k8s.io/component-base/cli/globalflag
@@ -1342,10 +1349,10 @@ k8s.io/component-base/zpages/features
k8s.io/component-base/zpages/flagz
k8s.io/component-base/zpages/httputil
k8s.io/component-base/zpages/statusz
-# k8s.io/component-helpers v0.34.0
+# k8s.io/component-helpers v0.34.2
## explicit; go 1.24.0
k8s.io/component-helpers/node/util
-# k8s.io/controller-manager v0.34.0
+# k8s.io/controller-manager v0.34.2
## explicit; go 1.24.0
k8s.io/controller-manager/app
k8s.io/controller-manager/config
@@ -1372,7 +1379,7 @@ k8s.io/klog/v2/internal/severity
k8s.io/klog/v2/internal/sloghandler
k8s.io/klog/v2/internal/verbosity
k8s.io/klog/v2/textlogger
-# k8s.io/kms v0.34.0
+# k8s.io/kms v0.34.2
## explicit; go 1.24.0
k8s.io/kms/apis/v1beta1
k8s.io/kms/apis/v2
@@ -1400,7 +1407,7 @@ k8s.io/kube-openapi/pkg/validation/errors
k8s.io/kube-openapi/pkg/validation/spec
k8s.io/kube-openapi/pkg/validation/strfmt
k8s.io/kube-openapi/pkg/validation/strfmt/bson
-# k8s.io/kubelet v0.34.0
+# k8s.io/kubelet v0.34.2
## explicit; go 1.24.0
k8s.io/kubelet/pkg/apis/credentialprovider
k8s.io/kubelet/pkg/apis/credentialprovider/install
@@ -1425,7 +1432,7 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client
sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/metrics
sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/common/metrics
sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client
-# sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.9.2
+# sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.11.0
## explicit; go 1.24.6
sigs.k8s.io/cloud-provider-azure/pkg/azclient
sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient
@@ -1513,10 +1520,10 @@ sigs.k8s.io/cloud-provider-azure/pkg/azclient/virtualnetworkclient
sigs.k8s.io/cloud-provider-azure/pkg/azclient/virtualnetworkclient/mock_virtualnetworkclient
sigs.k8s.io/cloud-provider-azure/pkg/azclient/virtualnetworklinkclient
sigs.k8s.io/cloud-provider-azure/pkg/azclient/virtualnetworklinkclient/mock_virtualnetworklinkclient
-# sigs.k8s.io/cloud-provider-azure/pkg/azclient/cache v0.8.3
+# sigs.k8s.io/cloud-provider-azure/pkg/azclient/cache v0.9.1
## explicit; go 1.24.6
sigs.k8s.io/cloud-provider-azure/pkg/azclient/cache
-# sigs.k8s.io/cloud-provider-azure/pkg/azclient/configloader v0.8.4
+# sigs.k8s.io/cloud-provider-azure/pkg/azclient/configloader v0.10.3
## explicit; go 1.24.6
sigs.k8s.io/cloud-provider-azure/pkg/azclient/configloader
# sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/.golangci.yml b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/.golangci.yml
index e2afc191ff..84b9e346f0 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/.golangci.yml
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/.golangci.yml
@@ -1,42 +1,64 @@
+version: "2"
run:
- timeout: 30m
+ modules-download-mode: mod
tests: true
linters:
- disable-all: true
+ default: none
enable:
+ - asasalint
+ - asciicheck
+ - bidichk
- errcheck
- - gosimple
- - govet
- - ineffassign
- - staticcheck
- - unused
+ - errorlint
- goconst
- - goimports
- - revive
- gosec
+ - govet
+ - ineffassign
+ - loggercheck
- misspell
- nakedret
- - typecheck
+ - revive
+ - staticcheck
- unconvert
- - asasalint
- - asciicheck
- - bidichk
- - errorlint
- - loggercheck
- fast: false
+ - unused
+ settings:
+ goconst:
+ min-occurrences: 10
+ gosec:
+ excludes:
+ - G114
+ - G115
+ staticcheck:
+ checks:
+ - all
+ - -SA1019
+ revive:
+ rules:
+ - name: var-naming
+ disabled: true
+ exclusions:
+ generated: lax
+ presets:
+ - comments
+ - common-false-positives
+ - legacy
+ - std-error-handling
+ paths:
+ - third_party$
+ - builtin$
+ - examples$
issues:
max-issues-per-linter: 0
max-same-issues: 0
-linters-settings:
- staticcheck:
- checks: ["all", "-SA1019"]
- gosec:
- excludes:
- - G114
- - G115
- goimports:
- local-prefixes: sigs.k8s.io/cloud-provider-azure/pkg/azclient
- goconst:
- min-occurrences: 10
-
-
+formatters:
+ enable:
+ - goimports
+ settings:
+ goimports:
+ local-prefixes:
+ - sigs.k8s.io/cloud-provider-azure/pkg/azclient
+ exclusions:
+ generated: lax
+ paths:
+ - third_party$
+ - builtin$
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/Makefile b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/Makefile
index 04c0655a24..a9093ca68e 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/Makefile
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/Makefile
@@ -146,7 +146,7 @@ GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint
.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
$(GOLANGCI_LINT): $(LOCALBIN)
- test -s $(LOCALBIN)/golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(LOCALBIN) v1.64.8
+ test -s $(LOCALBIN)/golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(LOCALBIN) v2.5.0
GOIMPORTS ?= $(LOCALBIN)/goimports
.PHONY: goimports
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient/custom.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient/custom.go
index d2e587c23a..6e7121a589 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient/custom.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient/custom.go
@@ -20,7 +20,7 @@ import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
- "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
"sigs.k8s.io/cloud-provider-azure/pkg/azclient/metrics"
"sigs.k8s.io/cloud-provider-azure/pkg/azclient/utils"
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient/interface.go
index 554825d383..c1452395be 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient/interface.go
@@ -20,12 +20,12 @@ package accountclient
import (
"context"
- armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
"sigs.k8s.io/cloud-provider-azure/pkg/azclient/utils"
)
-// +azure:client:verbs=listbyrg,resource=Account,packageName=github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage,packageAlias=armstorage,clientName=AccountsClient,expand=true,crossSubFactory=true,rateLimitKey=storageAccountRateLimit,azureStackCloudAPIVersion="2018-02-01",mooncakeApiVersion="2023-05-01"
+// +azure:client:verbs=listbyrg,resource=Account,packageName=github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2,packageAlias=armstorage,clientName=AccountsClient,expand=true,crossSubFactory=true,rateLimitKey=storageAccountRateLimit,azureStackCloudAPIVersion="2018-02-01",mooncakeApiVersion="2023-05-01"
type Interface interface {
utils.ListFunc[armstorage.Account]
Create(ctx context.Context, resourceGroupName string, accountName string, resource *armstorage.AccountCreateParameters) (*armstorage.Account, error)
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient/mock_accountclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient/mock_accountclient/interface.go
index af1a33c9e1..6f5259ef2f 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient/mock_accountclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient/mock_accountclient/interface.go
@@ -30,7 +30,7 @@ import (
context "context"
reflect "reflect"
- armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
gomock "go.uber.org/mock/gomock"
)
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient/zz_generated_client.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient/zz_generated_client.go
index 3adc0247dd..5af63e8400 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient/zz_generated_client.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient/zz_generated_client.go
@@ -24,7 +24,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing"
- armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
"sigs.k8s.io/cloud-provider-azure/pkg/azclient/metrics"
"sigs.k8s.io/cloud-provider-azure/pkg/azclient/utils"
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobcontainerclient/custom.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobcontainerclient/custom.go
index 78b0cd8817..abc03549e3 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobcontainerclient/custom.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobcontainerclient/custom.go
@@ -20,7 +20,7 @@ import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
- armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
"sigs.k8s.io/cloud-provider-azure/pkg/azclient/metrics"
)
@@ -36,7 +36,7 @@ func (client *Client) List(ctx context.Context, resourceGroupName string, parent
ctx, endSpan := runtime.StartSpan(ctx, ListOperationName, client.tracer, nil)
defer endSpan(err)
- pager := client.BlobContainersClient.NewListPager(resourceGroupName, parentResourceName, nil)
+ pager := client.NewListPager(resourceGroupName, parentResourceName, nil)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
@@ -53,7 +53,7 @@ func (client *Client) CreateContainer(ctx context.Context, resourceGroupName, ac
ctx, endSpan := runtime.StartSpan(ctx, CreateOperationName, client.tracer, nil)
defer endSpan(err)
- resp, err := client.BlobContainersClient.Create(ctx, resourceGroupName, accountName, containerName, parameters, nil)
+ resp, err := client.Create(ctx, resourceGroupName, accountName, containerName, parameters, nil)
if err != nil {
return nil, err
}
@@ -66,6 +66,6 @@ func (client *Client) DeleteContainer(ctx context.Context, resourceGroupName, ac
ctx, endSpan := runtime.StartSpan(ctx, DeleteOperationName, client.tracer, nil)
defer endSpan(err)
- _, err = client.BlobContainersClient.Delete(ctx, resourceGroupName, accountName, containerName, nil)
+ _, err = client.Delete(ctx, resourceGroupName, accountName, containerName, nil)
return err
}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobcontainerclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobcontainerclient/interface.go
index f1aa4d1b93..a53ca75af8 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobcontainerclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobcontainerclient/interface.go
@@ -20,12 +20,12 @@ package blobcontainerclient
import (
"context"
- armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
"sigs.k8s.io/cloud-provider-azure/pkg/azclient/utils"
)
-// +azure:client:verbs=get,resource=Account,subResource=BlobContainer,packageName=github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage,packageAlias=armstorage,clientName=BlobContainersClient,expand=false,crossSubFactory=true,azureStackCloudAPIVersion="2019-06-01",mooncakeApiVersion="2023-05-01"
+// +azure:client:verbs=get,resource=Account,subResource=BlobContainer,packageName=github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2,packageAlias=armstorage,clientName=BlobContainersClient,expand=false,crossSubFactory=true,azureStackCloudAPIVersion="2019-06-01",mooncakeApiVersion="2023-05-01"
type Interface interface {
utils.SubResourceGetFunc[armstorage.BlobContainer]
CreateContainer(ctx context.Context, resourceGroupName, accountName, containerName string, parameters armstorage.BlobContainer) (*armstorage.BlobContainer, error)
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobcontainerclient/mock_blobcontainerclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobcontainerclient/mock_blobcontainerclient/interface.go
index b36ffeb6a6..59b6c0ca43 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobcontainerclient/mock_blobcontainerclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobcontainerclient/mock_blobcontainerclient/interface.go
@@ -30,7 +30,7 @@ import (
context "context"
reflect "reflect"
- armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
gomock "go.uber.org/mock/gomock"
)
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobcontainerclient/zz_generated_client.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobcontainerclient/zz_generated_client.go
index 319d7a0719..edf812c4a6 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobcontainerclient/zz_generated_client.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobcontainerclient/zz_generated_client.go
@@ -24,7 +24,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing"
- armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
"sigs.k8s.io/cloud-provider-azure/pkg/azclient/metrics"
"sigs.k8s.io/cloud-provider-azure/pkg/azclient/utils"
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobservicepropertiesclient/custom.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobservicepropertiesclient/custom.go
index ae92fba5d8..56a4c70afe 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobservicepropertiesclient/custom.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobservicepropertiesclient/custom.go
@@ -20,7 +20,7 @@ import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
- armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
"sigs.k8s.io/cloud-provider-azure/pkg/azclient/metrics"
)
@@ -35,7 +35,7 @@ func (client *Client) Get(ctx context.Context, resourceGroupName string, resourc
ctx, endSpan := runtime.StartSpan(ctx, GetOperationName, client.tracer, nil)
defer endSpan(err)
- resp, err := client.BlobServicesClient.GetServiceProperties(ctx, resourceGroupName, resourceName, nil)
+ resp, err := client.GetServiceProperties(ctx, resourceGroupName, resourceName, nil)
if err != nil {
return nil, err
}
@@ -49,7 +49,7 @@ func (client *Client) Set(ctx context.Context, resourceGroupName string, resourc
ctx, endSpan := runtime.StartSpan(ctx, SetOperationName, client.tracer, nil)
defer endSpan(err)
- resp, err := client.BlobServicesClient.SetServiceProperties(ctx, resourceGroupName, resourceName, parameters, nil)
+ resp, err := client.SetServiceProperties(ctx, resourceGroupName, resourceName, parameters, nil)
if err != nil {
return nil, err
}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobservicepropertiesclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobservicepropertiesclient/interface.go
index 3387c22c05..8496d6fd50 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobservicepropertiesclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobservicepropertiesclient/interface.go
@@ -20,10 +20,10 @@ package blobservicepropertiesclient
import (
"context"
- armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
)
-// +azure:client:resource=BlobServiceProperties,packageName=github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage,packageAlias=armstorage,clientName=BlobServicesClient,expand=false,crossSubFactory=true,azureStackCloudAPIVersion="2019-06-01",mooncakeApiVersion="2023-05-01"
+// +azure:client:resource=BlobServiceProperties,packageName=github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2,packageAlias=armstorage,clientName=BlobServicesClient,expand=false,crossSubFactory=true,azureStackCloudAPIVersion="2019-06-01",mooncakeApiVersion="2023-05-01"
type Interface interface {
Get(ctx context.Context, resourceGroupName string, resourceName string) (*armstorage.BlobServiceProperties, error)
Set(ctx context.Context, resourceGroupName string, resourceName string, parameters armstorage.BlobServiceProperties) (*armstorage.BlobServiceProperties, error)
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobservicepropertiesclient/mock_blobservicepropertiesclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobservicepropertiesclient/mock_blobservicepropertiesclient/interface.go
index 75268c672d..aecc110f4f 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobservicepropertiesclient/mock_blobservicepropertiesclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobservicepropertiesclient/mock_blobservicepropertiesclient/interface.go
@@ -30,7 +30,7 @@ import (
context "context"
reflect "reflect"
- armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
gomock "go.uber.org/mock/gomock"
)
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobservicepropertiesclient/zz_generated_client.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobservicepropertiesclient/zz_generated_client.go
index ffd1b0d99b..f16a4acc50 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobservicepropertiesclient/zz_generated_client.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobservicepropertiesclient/zz_generated_client.go
@@ -21,7 +21,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing"
- armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
"sigs.k8s.io/cloud-provider-azure/pkg/azclient/utils"
)
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/deploymentclient/custom.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/deploymentclient/custom.go
index 8dd22ddc26..cc4b5ff2a2 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/deploymentclient/custom.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/deploymentclient/custom.go
@@ -26,7 +26,7 @@ import (
// List gets a list of Deployment in the resource group.
func (client *Client) List(ctx context.Context, resourceGroupName string) (result []*resources.DeploymentExtended, rerr error) {
- pager := client.DeploymentsClient.NewListByResourceGroupPager(resourceGroupName, nil)
+ pager := client.NewListByResourceGroupPager(resourceGroupName, nil)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
@@ -51,7 +51,7 @@ func (client *Client) Get(ctx context.Context, resourceGroupName string, resourc
// CreateOrUpdate creates or updates a Deployment.
func (client *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, resource resources.Deployment) (*resources.DeploymentExtended, error) {
- resp, err := utils.NewPollerWrapper(client.DeploymentsClient.BeginCreateOrUpdate(ctx, resourceGroupName, resourceName, resource, nil)).WaitforPollerResp(ctx)
+ resp, err := utils.NewPollerWrapper(client.BeginCreateOrUpdate(ctx, resourceGroupName, resourceName, resource, nil)).WaitforPollerResp(ctx)
if err != nil {
return nil, err
}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/factory_conf.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/factory_conf.go
index 8df1b2dfcc..913db1d45f 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/factory_conf.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/factory_conf.go
@@ -63,6 +63,6 @@ func GetDefaultResourceClientOption(armConfig *ARMClientConfig) (*policy.ClientO
armClientOption.AuxiliaryTenants = []string{armConfig.NetworkResourceTenantID}
}
- armClientOption.ClientOptions.Transport = DefaultResourceClientTransport
+ armClientOption.Transport = DefaultResourceClientTransport
return &armClientOption, err
}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileservicepropertiesclient/custom.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileservicepropertiesclient/custom.go
index 793de1b511..e5018b8eac 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileservicepropertiesclient/custom.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileservicepropertiesclient/custom.go
@@ -20,7 +20,7 @@ import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
- armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
"sigs.k8s.io/cloud-provider-azure/pkg/azclient/metrics"
)
@@ -35,7 +35,7 @@ func (client *Client) Get(ctx context.Context, resourceGroupName string, resourc
ctx, endSpan := runtime.StartSpan(ctx, GetOperationName, client.tracer, nil)
defer endSpan(err)
- resp, err := client.FileServicesClient.GetServiceProperties(ctx, resourceGroupName, resourceName, nil)
+ resp, err := client.GetServiceProperties(ctx, resourceGroupName, resourceName, nil)
if err != nil {
return nil, err
}
@@ -49,7 +49,7 @@ func (client *Client) Set(ctx context.Context, resourceGroupName string, resourc
ctx, endSpan := runtime.StartSpan(ctx, SetOperationName, client.tracer, nil)
defer endSpan(err)
- resp, err := client.FileServicesClient.SetServiceProperties(ctx, resourceGroupName, resourceName, parameters, nil)
+ resp, err := client.SetServiceProperties(ctx, resourceGroupName, resourceName, parameters, nil)
if err != nil {
return nil, err
}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileservicepropertiesclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileservicepropertiesclient/interface.go
index 7ae300159a..d54baa4007 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileservicepropertiesclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileservicepropertiesclient/interface.go
@@ -20,10 +20,10 @@ package fileservicepropertiesclient
import (
"context"
- armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
)
-// +azure:client:resource=FileServiceProperties,packageName=github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage,packageAlias=armstorage,clientName=FileServicesClient,expand=false,crossSubFactory=true,mooncakeApiVersion="2023-05-01"
+// +azure:client:resource=FileServiceProperties,packageName=github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2,packageAlias=armstorage,clientName=FileServicesClient,expand=false,crossSubFactory=true,mooncakeApiVersion="2023-05-01"
type Interface interface {
Get(ctx context.Context, resourceGroupName string, resourceName string) (*armstorage.FileServiceProperties, error)
Set(ctx context.Context, resourceGroupName string, resourceName string, parameters armstorage.FileServiceProperties) (*armstorage.FileServiceProperties, error)
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileservicepropertiesclient/mock_fileservicepropertiesclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileservicepropertiesclient/mock_fileservicepropertiesclient/interface.go
index a172bc1bc9..afbaf21a37 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileservicepropertiesclient/mock_fileservicepropertiesclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileservicepropertiesclient/mock_fileservicepropertiesclient/interface.go
@@ -30,7 +30,7 @@ import (
context "context"
reflect "reflect"
- armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
gomock "go.uber.org/mock/gomock"
)
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileservicepropertiesclient/zz_generated_client.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileservicepropertiesclient/zz_generated_client.go
index 4eda068bc3..de5dfb7ab0 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileservicepropertiesclient/zz_generated_client.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileservicepropertiesclient/zz_generated_client.go
@@ -21,7 +21,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing"
- armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
"sigs.k8s.io/cloud-provider-azure/pkg/azclient/utils"
)
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileshareclient/custom.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileshareclient/custom.go
index 67932221c2..48c764d3d8 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileshareclient/custom.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileshareclient/custom.go
@@ -20,7 +20,7 @@ import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
- armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
"sigs.k8s.io/cloud-provider-azure/pkg/azclient/metrics"
)
@@ -77,7 +77,7 @@ func (client *Client) List(ctx context.Context, resourceGroupName string, accoun
ctx, endSpan := runtime.StartSpan(ctx, ListOperationName, client.tracer, nil)
defer endSpan(err)
- pager := client.FileSharesClient.NewListPager(resourceGroupName, accountName, option)
+ pager := client.NewListPager(resourceGroupName, accountName, option)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileshareclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileshareclient/interface.go
index cdef44d12a..8b2bfbc94a 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileshareclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileshareclient/interface.go
@@ -20,10 +20,10 @@ package fileshareclient
import (
"context"
- armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
)
-// +azure:client:resource=Account,subResource=FileShare,packageName=github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage,packageAlias=armstorage,clientName=FileSharesClient,expand=true,crossSubFactory=true,mooncakeApiVersion="2023-05-01"
+// +azure:client:resource=Account,subResource=FileShare,packageName=github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2,packageAlias=armstorage,clientName=FileSharesClient,expand=true,crossSubFactory=true,mooncakeApiVersion="2023-05-01"
type Interface interface {
Get(ctx context.Context, resourceGroupName string, accountName string, resourceName string, option *armstorage.FileSharesClientGetOptions) (result *armstorage.FileShare, rerr error)
List(ctx context.Context, resourceGroupName string, accountName string, option *armstorage.FileSharesClientListOptions) (result []*armstorage.FileShareItem, err error)
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileshareclient/mock_fileshareclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileshareclient/mock_fileshareclient/interface.go
index c1d0622afd..3066b8ce33 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileshareclient/mock_fileshareclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileshareclient/mock_fileshareclient/interface.go
@@ -30,7 +30,7 @@ import (
context "context"
reflect "reflect"
- armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
gomock "go.uber.org/mock/gomock"
)
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileshareclient/zz_generated_client.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileshareclient/zz_generated_client.go
index 5d750a79b1..6d9e86399c 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileshareclient/zz_generated_client.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/fileshareclient/zz_generated_client.go
@@ -21,7 +21,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing"
- armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2"
"sigs.k8s.io/cloud-provider-azure/pkg/azclient/utils"
)
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/interfaceclient/custom.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/interfaceclient/custom.go
index ff03f31cb2..0bafdc83b6 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/interfaceclient/custom.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/interfaceclient/custom.go
@@ -24,7 +24,7 @@ import (
// List gets a list of IPGroup in the resource group.
func (client *Client) ListVirtualMachineScaleSetNetworkInterfaces(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string) ([]*armnetwork.Interface, error) {
- pager := client.InterfacesClient.NewListVirtualMachineScaleSetNetworkInterfacesPager(resourceGroupName, virtualMachineScaleSetName, nil)
+ pager := client.NewListVirtualMachineScaleSetNetworkInterfacesPager(resourceGroupName, virtualMachineScaleSetName, nil)
var result []*armnetwork.Interface
for pager.More() {
nextResult, err := pager.NextPage(ctx)
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/providerclient/custom.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/providerclient/custom.go
index 8e93304079..ec66e79169 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/providerclient/custom.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/providerclient/custom.go
@@ -24,7 +24,7 @@ import (
)
func (client *Client) ListProviders(ctx context.Context) (result []*armresources.Provider, rerr error) {
- pager := client.ProvidersClient.NewListPager(nil)
+ pager := client.NewListPager(nil)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
@@ -35,7 +35,7 @@ func (client *Client) ListProviders(ctx context.Context) (result []*armresources
return result, nil
}
func (client *Client) GetProvider(ctx context.Context, resourceProviderNamespace string) (*armresources.Provider, error) {
- resp, err := client.ProvidersClient.Get(ctx, resourceProviderNamespace, nil)
+ resp, err := client.Get(ctx, resourceProviderNamespace, nil)
if err != nil {
return nil, err
}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/resourcegroupclient/custom.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/resourcegroupclient/custom.go
index 5c55020c5b..2b97746c32 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/resourcegroupclient/custom.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/resourcegroupclient/custom.go
@@ -46,7 +46,7 @@ func (client *Client) Delete(ctx context.Context, resourceGroupName string) erro
}
func (client *Client) List(ctx context.Context) (result []*resources.ResourceGroup, rerr error) {
- pager := client.ResourceGroupsClient.NewListPager(nil)
+ pager := client.NewListPager(nil)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/snapshotclient/custom.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/snapshotclient/custom.go
index 2d25ed8697..bf48c56326 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/snapshotclient/custom.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/snapshotclient/custom.go
@@ -24,7 +24,7 @@ import (
// List gets a list of Snapshot in the resource group.
func (client *Client) List(ctx context.Context, resourceGroupName string) (result []*armcompute.Snapshot, rerr error) {
- pager := client.SnapshotsClient.NewListByResourceGroupPager(resourceGroupName, nil)
+ pager := client.NewListByResourceGroupPager(resourceGroupName, nil)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/utils/armbalancer/transport.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/utils/armbalancer/transport.go
index 4def516853..1b4b685cb0 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/utils/armbalancer/transport.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/utils/armbalancer/transport.go
@@ -27,7 +27,7 @@ type ClosableTransport struct {
}
func (transport *ClosableTransport) ForceClose() error {
- transport.Transport.CloseIdleConnections()
+ transport.CloseIdleConnections()
return nil
}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/virtualmachineclient/custom.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/virtualmachineclient/custom.go
index ffcd723c63..e319ad9955 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/virtualmachineclient/custom.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/virtualmachineclient/custom.go
@@ -48,7 +48,7 @@ func (client *Client) InstanceView(ctx context.Context, resourceGroupName string
}
func (client *Client) ListVMInstanceView(ctx context.Context, resourceGroupName string) (result []*armcompute.VirtualMachine, rerr error) {
- pager := client.VirtualMachinesClient.NewListPager(resourceGroupName, &armcompute.VirtualMachinesClientListOptions{Expand: to.Ptr(armcompute.ExpandTypeForListVMsInstanceView)})
+ pager := client.NewListPager(resourceGroupName, &armcompute.VirtualMachinesClientListOptions{Expand: to.Ptr(armcompute.ExpandTypeForListVMsInstanceView)})
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
@@ -60,7 +60,7 @@ func (client *Client) ListVMInstanceView(ctx context.Context, resourceGroupName
}
func (client *Client) ListVmssFlexVMsWithOnlyInstanceView(ctx context.Context, resourceGroupName, vmssFlexID string) (result []*armcompute.VirtualMachine, rerr error) {
- pager := client.VirtualMachinesClient.NewListPager(resourceGroupName, &armcompute.VirtualMachinesClientListOptions{
+ pager := client.NewListPager(resourceGroupName, &armcompute.VirtualMachinesClientListOptions{
Expand: to.Ptr(armcompute.ExpandTypeForListVMsInstanceView),
Filter: to.Ptr("'virtualMachineScaleSet/id' eq '" + vmssFlexID + "'"),
})
@@ -75,7 +75,7 @@ func (client *Client) ListVmssFlexVMsWithOnlyInstanceView(ctx context.Context, r
}
func (client *Client) ListVmssFlexVMsWithOutInstanceView(ctx context.Context, resourceGroupName, vmssFlexID string) (result []*armcompute.VirtualMachine, rerr error) {
- pager := client.VirtualMachinesClient.NewListPager(resourceGroupName, &armcompute.VirtualMachinesClientListOptions{
+ pager := client.NewListPager(resourceGroupName, &armcompute.VirtualMachinesClientListOptions{
Filter: to.Ptr("'virtualMachineScaleSet/id' eq '" + vmssFlexID + "'"),
})
for pager.More() {
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/virtualmachinescalesetvmclient/custom.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/virtualmachinescalesetvmclient/custom.go
index 8d7b304ff3..7b302f37ab 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/virtualmachinescalesetvmclient/custom.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/virtualmachinescalesetvmclient/custom.go
@@ -84,7 +84,7 @@ func UpdateVMsInBatch(ctx context.Context, client *Client, resourceGroupName str
// List gets a list of VirtualMachineScaleSetVM in the resource group.
func (client *Client) List(ctx context.Context, resourceGroupName string, parentResourceName string) (result []*armcompute.VirtualMachineScaleSetVM, rerr error) {
- pager := client.VirtualMachineScaleSetVMsClient.NewListPager(resourceGroupName, parentResourceName, nil)
+ pager := client.NewListPager(resourceGroupName, parentResourceName, nil)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
@@ -106,7 +106,7 @@ func (client *Client) GetInstanceView(ctx context.Context, resourceGroupName str
// List gets a list of VirtualMachineScaleSetVM in the resource group.
func (client *Client) ListVMInstanceView(ctx context.Context, resourceGroupName string, parentResourceName string) (result []*armcompute.VirtualMachineScaleSetVM, rerr error) {
- pager := client.VirtualMachineScaleSetVMsClient.NewListPager(resourceGroupName, parentResourceName, &armcompute.VirtualMachineScaleSetVMsClientListOptions{
+ pager := client.NewListPager(resourceGroupName, parentResourceName, &armcompute.VirtualMachineScaleSetVMsClientListOptions{
Expand: to.Ptr(string(armcompute.InstanceViewTypesInstanceView)),
})
for pager.More() {